Topic: Invoice Importing

I have looked into the import scripts / add-ons posted ant they look fairly straight forward.  However I need the ability to import CDR summaries (Call Detail Record) summary rows into a new invoice from an external set of systems.

Is there a method of doing that posted any place?  I can sync the billto in the remote system using the ID of the FA billing entity but just need to get the detail imported into a new invoice.

Rough Example:

AccountID, Invoice Date, ItemCode, Qty,Discount%,Unit Price

Any thoughts, pointers etc.  I'd be glad to code it and contribute the resulting code smile

Re: Invoice Importing

Well, you should look into /sales/customer_invoice.php and the included files. Here you will get the idea of how to write the add_on module. You should be able to include the same files when doing this.

/Joe

Re: Invoice Importing

Would it be better to do a Sales Order then invoice them, or do direct to an invoice?  Looks like the Sales Order and Invoice are one in the same from the schema.  I see Qty and amount also InvoicedQTY and Invoiced Amount is that correct?

Re: Invoice Importing

The Sales Order is unnecessary to keep all the data consistent. But yes, you can use in this place sales system ability to automatic sales order generation. This is used in Direct Invoice/DirectDelivery. Have a look into sales_order_entry.php file which is used also in direct invoicing/delivery. If you would call write_sales_invoice() with cart class object corectly initialized with your data you will end with both sales order and sales invoice imported into database.