Easy export order details for accountant

  • Posts: 91
  • Thank you received: 3
10 years 3 weeks ago #148866

Hi, I played a bit with the Reports function. It looks like you can create great things with it for the Dashboard, but it isn't really an export tool (although it has an export button). Am I right about that? Let me explain my needs: my client wants to be able to export some basic details of the last order to a XLS of CSV. He wants to use that file to get the sale in to his accounting system (Exact online). There's no automatic way to do this, that's why we are looking for the options with an export.

When I use the export button of Reports a get a CSV with 62 columns, most of them I don't understand. I just need the customer details (name, address, et cetera) and the order details (bought products, total price, et cetera). Is there something like this possible. Best way would be an export tool where I can select the items (fields) I want to be exported.

Please Log in or Create an account to join the conversation.

  • Posts: 81428
  • Thank you received: 13058
  • MODERATOR
10 years 3 weeks ago #148879

Hi,

What you want to use then is not the reporting system but the mass actions system.
Create one via the menu System>Mass actions on the "order" data and set an action "export CSV file" and here you'll be able to select the columns you want in your CSV that you will get when you process the massaction.
It can also be processed automatically with a trigger if necessary.

The following user(s) said Thank You: miracle

Please Log in or Create an account to join the conversation.

  • Posts: 91
  • Thank you received: 3
10 years 3 weeks ago #148970

Thank you, I will look into that. Didn't realize mass actions could be used for that.
Any chance of having a connection with Exact (used by more then 50.000 business owners) in the future?

Please Log in or Create an account to join the conversation.

  • Posts: 91
  • Thank you received: 3
10 years 3 weeks ago #148982

Mass actions is nice, but I miss a few things. Maybe I'm not looking at the right place, maybe it's not there. If so, see it as a feature request :cheer:

1. I want the CSV or XLS file only to be filled with the last order. I cannot filter for 'last order' or 'last x orders'
2. Is it possible to mail the created file instead of putting it somewhere (export path)?

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
10 years 3 weeks ago #148990

Hi,

Actually it's not possible. But I just have added this possibility, it will be probably in the next release. (2.3.1).
If you want this modification, you have to edit the file "administrator/components/hikashop/classes/massaction.php" and add:

	var $ordering = '';
	var $direction = '';
After:
	var $value = 500;
And in the function "getQuery()", add:
		if(!empty($this->ordering)) $query .= ' ORDER BY '.implode(',',$this->ordering);
		if(!empty($this->direction)) $query .= ' '.$this->direction;
Before:
return $query;
Then create a plugin and add the following content inside:
	function onProcessOrderMassFilterlimit(&$elements, &$query,$filter,$num){
		$query->ordering[] = 'order_id';
		$query->direction = 'DESC';
	}
Here is the documentation for the plugins:
hikashop.com/support/support/documentati...r-documentation.html

And to send by email instead of export, it's not yet possible.

Please Log in or Create an account to join the conversation.

  • Posts: 91
  • Thank you received: 3
10 years 3 weeks ago #149094

Thanks for the support, I think I will wait to the next release, especially creating the plugin is beyond my scope :dry:

Not being able to mail the results is something I can solve in other ways. I see I can configure an export path. What's the default path and what should I put there to change that? More important: will the function create a unique filename? I mean, when I use a trigger (order created for example) and a report is created and put in the export directory, it has a file name. What if it's triggered again, will it overwrite the current file (BAD) or will it create an extra file (GOOD)? Best way would be to have a unique file with date and time or even better order ID. Just thinking ahead :)

Please Log in or Create an account to join the conversation.

  • Posts: 81428
  • Thank you received: 13058
  • MODERATOR
10 years 3 weeks ago #149096

For the export path, it would be the relative path from the website root or the absolute path of the file you want.

It will of course overwrite the file.
That way, you can give the link to the file to someone and he will always have the latest version of the file available with that link.
Now I understand that in your case that's not what you would prefer.
Having the system create different CSVs would require the export path parameter to support tags. That's a good idea, but not yet possible.

Please Log in or Create an account to join the conversation.

  • Posts: 91
  • Thank you received: 3
10 years 2 weeks ago #149965

I have not put anything in the export path field, so I expected to find a hikashop_export.xls in the root ( www.domain.com/hikashop_export.xls ). But I can't find anything. Doing something wrong?

Please Log in or Create an account to join the conversation.

  • Posts: 81428
  • Thank you received: 13058
  • MODERATOR
10 years 2 weeks ago #149974

If you don't put anything in it, if you directly click on the "process" button, it will give you the file directly. If you don't click the button, nothing will happen.

Please Log in or Create an account to join the conversation.

  • Posts: 91
  • Thank you received: 3
9 years 11 months ago #154295

Hi Nicolas,

1. Do you have any idea when the new version will be available and if the above mentioned options will be in it?
2. I talked to you about Exact, an accounting system that is used by many thousands of people. There are other webshops that have made plugins / connections to make data transfer between the webshop and Exact possible. For me, I think not having this option in Hikashop is a big disadvantage. Is there any chance this will be addressed in the near future?

Please Log in or Create an account to join the conversation.

  • Posts: 81428
  • Thank you received: 13058
  • MODERATOR
9 years 11 months ago #154306

Hi,

1. Next version will be available in May. In one or two weeks. As Xavier said, it will be included.

2. Not in the near future, unless someone pays for us to develop it.
There are plenty of accounting systems used by more than thousands of users. We can't develop an integration for all of them. We're already trying to develop payment plugins for plenty of payment gateways.

Please Log in or Create an account to join the conversation.

  • Posts: 91
  • Thank you received: 3
9 years 10 months ago #157459

Any news on the new version?

Please Log in or Create an account to join the conversation.

  • Posts: 2334
  • Thank you received: 403
9 years 10 months ago #157474

Hi there,

The last version has been released on May 14 but the auto-update is not activated yet.
You can download it from your user account or on the website for the free version though. Do not hesitate to give us feedback if you encounter any issue!

Please Log in or Create an account to join the conversation.

  • Posts: 91
  • Thank you received: 3
9 years 10 months ago #159304

Hi, I just installed the new version. Lot of improvements, nice!

But.... this topic was about one asked improvement:
1. I want the CSV or XLS file only to be filled with the last order. I cannot filter for 'last order' or 'last x orders'

I can't find it or don't understand how to get this working. Can you help me (and others) a bit?

Please Log in or Create an account to join the conversation.

  • Posts: 81428
  • Thank you received: 13058
  • MODERATOR
9 years 10 months ago #159327

Hi,

I indeed don't see the capability either. I've asked Xavier to look at it as he is the one in charge of that. He'll get back to you on Tuesday, when he gets back to work.

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
9 years 10 months ago #159545

Hi,

You have to set your mass action like that:



This allow to get the last 20 orders.

Attachments:
The following user(s) said Thank You: miracle

Please Log in or Create an account to join the conversation.

  • Posts: 91
  • Thank you received: 3
9 years 10 months ago #159579

Thanks, this is working. Last question. I want the created file to be exported to /lastorder (protected directory).
I tried in the export path /lastorder and lastorder (without /) but no result.
What shoud I type in exactly to get this working? You told me path from website root, but that's what I did (didn't I?)

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
9 years 10 months ago #159604

Hi,

The path from website root is for example /var/www/mysite/lastorder

Please Log in or Create an account to join the conversation.

  • Posts: 91
  • Thank you received: 3
9 years 10 months ago #159712

Sorry, but I don't get it working. When I log in to the shell, go to the right directory and give the command PWD (print working directory) I get /home/company/public_html/lastorder as answer. But when I use that and let Hikashop process the bulk action nothing happens.

Could it be going wrong because it's a password protected directory? I did that on purpose, because I don't want customer information public available.

An email option would still be great :)

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
9 years 10 months ago #159734

I think that it's not working because of the password protection. Maybe folder permissions are not correct too in order to allow HikaShop to write a file inside.

Thanks to try in a not protected folder, with writable permissions.

Yes, email will be great, still on our TODO list ;)

Please Log in or Create an account to join the conversation.

Time to create page: 0.095 seconds
Powered by Kunena Forum