1

(5 replies, posted in Modules Add-on's)

Hi, I am new to FA and am currently evaluating for purpose of integrating to my own ecommerce site. I have chosen FA because of php/mysql. Likewise, I am researching import of order, and I would like my ecommerce site to create the order directly into FA without import steps etc.. In other words, the ecommerce site is to be built upon the tables used in FA.

I have tried to adapt the code used for zen import , but the issue here is that because the order is to be created by external code in the ecommerce site then it needs to be logged into FA etc.. which I am finding difficult.

I had considered also enhancing the Web SOAP service that allows for customer creation etc.. to also include sales order generation, but this is all a bit out of my depth.

So , it appears best to simply add the order directly to the sales_orders and sales_orders_details tables.
Looking at the FA code function add_sales_order(&$order) in sales_order_db.inc, then the procedure is:

1. Begin transaction
2. Get next reference number for sales order from REFS table
3. Insert record into sales_orders table
4. Insert record(s) into sales_orders_details table
5. Update next reference number in REFS table
6. Add to audit table (is this optional?)
7. Commit Transaction

Obviously, FA does a couple of more things such as emailing notification of low stock, and updating sales quote if applicable. But I do not think this is necessary for most ecommerce applications.

So after this long winded explanation, maybe someone with more experience can confirm that:

My understanding is correct and it is that simple to insert sales orders directly into the mysql tables, and that sales orders do not update anything in GL, nor affect stock movements or any other tables. These processes seem to only occur when invoicing the sales order. eg. I have added a sales order via normal FA sales order entry and noted nothing was added to stock movements table.