Topic: Import Sales Order

Hi,
Is there a way to import or create or pre-fill an order from a csv file rather than having to enter manually each item of the sale order.
That would be much quicker . Actually I have to wait 1 seconde each time I type a item code for the fa to fetch the corresponding description and then another second to fetch the price. I get also "disconnected" quite often if I go to the next field to quickly.

Any idea ?

Elax

Re: Import Sales Order

There is no way to import csv files in the FA core. However you can look into the modules that handles import of SO to get an idea.

/Joe

Re: Import Sales Order

Hi
As I really need an import feature for miscellaneous reasons, I came across this ugly solution.

I created a (ruby) script which parses a csv file (+ some extra command) and  generate a sql file filling the sales_order_details table.
The sql file lookup at the price and description in the database if need

The csv+ file looks like :


:order, 36             #set the current order id
sku1                    # add item "sku1" to order#36
sku2 | desc         # add item "sku2" and set the description to desc
sku3, 20  , 14.5  # qty = 20 price = 14.5

:order, 37          #order 37 now
:clear             #clear the order 37 (except details with sent qty)
sku1
sku2

etc ...


That seems to work pretty well. I can now write all of my orders in one file using vim , duplicate bits if needed, copy paste from excel or email etc ...
However I have to create the "empty" order manually first as my script only deal with the sales_order_details.

I also written a sql query wich 'prepopulate' a such file making easier to find  which order id correspond to which order and what is missing in it.

This solution is still a bit tedious as it involve some file manipulations  and the use of phpmyadmin to run the query, but if you have to convert a excel spreadsheet with 200 items to an FA order that really worth it.

If anyboby is interested by this I could provide the script ( It still not fully tested yet though)

Elax

Re: Import Sales Order

@Joe, do you think updating only the sales_order_details is ok or am I missing something ?
Should I update the audit table too ?

Thanks
Elax

Re: Import Sales Order

Please look into the modules that handles import of SO to get an idea of which tables (if any) should be updated as well.

/Joe

Re: Import Sales Order

Which modules ?

Re: Import Sales Order

Well, I guess you should look at either osc_import or zen_import to see if there are SO importing here. You may also look at the older modules at the download pages, however there may be changes to table structures, so take care.

/Joe

Re: Import Sales Order

Ok, thanks

Re: Import Sales Order

Hi
I've been implementing this ruby thing because I don't like the actual order/cart interface neither I will never like GUI based. I want to enter sales order, purchase order, stock transfer, etc in my favorite text editor
- because I love it (my text editor)
- it's faster ( I don't have to wait for anything before entering the next field) ... really faster
- I can do amazing stuff like  copy/paste , subsitution (usefull when the order is, I want this in every color or I want Y in the same colors as X) etc
- it doesn't crash in the middle, meaning I have to start from the beginning
- purchase orders can "generated" from sales orders
- I can enter them from email etc  etc etc ....


So I had this idea, rather than generating a SQL file that then I have to upload, I can add a "free text" popup in the actual GUI where I could copy/paste my order text file (in my format) and convert it (using PHP or JS) to a cart. I've been looking a bit how it work and it's seems possible to add a import/export to text function to the cart(s) which should then "modify" properly. (I understood that the cart is saved in the session, therefore it should be possible to "build" it from a text).
I'm a wright ? Does it seems to be a good approach or could you suggest me something else ?

/Elax

Re: Import Sales Order

Really excentric approach smile.
Keep in mind FA make lots of checks before the data for any entered document are stored in database. The more FA code you ommit the more chances to break your ledger.

Janusz

Re: Import Sales Order

janusz wrote:

Really excentric approach smile.
Keep in mind FA make lots of checks before the data for any entered document are stored in database. The more FA code you ommit the more chances to break your ledger.

Janusz

You are right, this is why I want to integrate it in FA (so I can use all the FA code) rather than doing SQL (even though It work pretty well). I've started doing something and It's quite promising, I'll keep you in touch when it's finished.

/Elax

Re: Import Sales Order

Hi elax,

I have recently created a module that can import CSV to sales order form.
It will not directly post the sales order, rather it will import items through CSV and show a pre-filled Sales Order form.
Which you may check, select customer and set other details properly before confirming the order.

Since I am away, I will be posting this module to FA admins for review soon.

It has a TODO : Check item is salable
Also this feature needs to have a 2 lines added in FA core file - sales_order_entry.php

Thanks

Chaitanya

Re: Import Sales Order

chaitanya wrote:

Hi elax,

I have recently created a module that can import CSV to sales order form.
It will not directly post the sales order, rather it will import items through CSV and show a pre-filled Sales Order form.
Which you may check, select customer and set other details properly before confirming the order.

Since I am away, I will be posting this module to FA admins for review soon.

It has a TODO : Check item is salable
Also this feature needs to have a 2 lines added in FA core file - sales_order_entry.php

Thanks

Hi
I've done my own module which allow you to copy/paste orders to/from Excel (or any text editor) and much much more (https://frontaccounting.com/punbb/viewtopic.php?id=2793)
Let me know if you are interested.

/Elax

Re: Import Sales Order

Hi Elax,

I checked the module and amazed by it's implementation.
Hats off to you ! smile

I am wondering with you such great programming skills, have you developed other modules to make FA more productive ? Something like serialized inventory, POS etc.

Thanks

Chaitanya

Re: Import Sales Order

Hi Chaitanya,

Thanks you very much ! Have you had a chance to use it ? Unfortunately I haven't had the time to write any other modules. Just some custom modifications for my own uses, but nothing major.


/Elax

Re: Import Sales Order

Hi Elax,

I happened to check forum today after many days.
I have loaded the module in my local instance.
Will be using it. A quick review gave me good feel.

I don't know wheather I should be discussing following part here -
Could you please help to remove an issue in reporting module ?
Issue is - When we take Excel report. In OOCalc (May be Ms Excel too) report files show up without borders but in preview and print, borders are visible. So reports are not printed properly. If you can give it a look, it would be nice.

Thanks

Chaitanya