Member Login

Username
Password
Forget Password
New Sign Up
Search Forum

Buy Support
Incidents

If you can't find your answer in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us private or confidential information:

Click Here
If you can't login and post questions or you are having trouble viewing forum posts:
Click Here
Callback
Support

If you live in USA, UK, Canada, Australia or New Zealand, you can leave us details on your question and request us to call you back and discuss them with you personally  (charges apply).

Click Here
 
Buy Support
Incidents
If you can't find your answer in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us private or confidential information:
Click Here

Forum : Importing Invoices for more than 1 customerSearch Forum

Forum Home > QODBC - ODBC Driver for QuickBooks > QODBC SQL Sample Scripts Forum

 New Topic 
 
 Post Reply 
[1]  
 Importing Invoices for more than 1 customer 
 Author   Message 
  Keith 
  
 Group: Members 
 Posts: 1 
 Joined: 2007-08-04 
 Profile
 Posted : 2007-08-10 23:49:53

I have sucessfully imported invoice data for a customer into quickbooks with QODBC and it works great.  When I try to import invoices for more than 1 customer at a time, all the invoice amounts are added to an invoice in quickbooks for one customer.  Is there a way to import multiple invoices at one time if we know and can tie the customerreflistid to that invoice?  Sample code of this procedure would be appreciated!!

 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2007-08-11 08:50:33

You're nearly there. When FQSaveToCache is set false, or the header insert is executed (after lines have been cached), the cached lines of the invoice will get writtened.

So you need to check the FQSaveToCache logic in your INSERT queries. For example for two invoices with two lines in each I do:

insert invoiceline FQSaveToCache 1  <<< Invoice 1 line 1
insert invoiceline FQSaveToCache 1 <<< Invoice 1 line 2
insert invoice  <<< header sets FQSaveToCache 0

Invoice 1 gets written to QuickBooks

insert invoiceline FQSaveToCache 1 <<< Invoice 2 line 1
insert invoiceline FQSaveToCache 1 <<< Invoice 2 line 2
insert invoice  <<< change the CustomerRefListID, header sets FQSaveToCache 0

Invoice 2 gets written to QuickBooks for different customer.

You can create any number of invoices you wish with a range of invoice lines using a sequence of SQL statements. You don't need to use the Invoice header and you can do your inserts just using the InvoiceLine table like this:

insert invoiceline FQSaveToCache 1 <<< Invoice 1 line 1 using CustomerRefListID for Cust1
insert invoiceline FQSaveToCache 0 <<< Invoice 1 line 2 using CustomerRefListID for Cust1

Invoice 1 gets written to QuickBooks for Cust1

insert invoiceline FQSaveToCache 1 <<< Invoice 2 line 1 using CustomerRefListID for Cust2
insert invoiceline FQSaveToCache 1 <<< Invoice 2 line 2 using CustomerRefListID for Cust2
insert invoiceline FQSaveToCache 1 <<< Invoice 2 line 3 using CustomerRefListID for Cust3
insert invoiceline FQSaveToCache 0 <<< Invoice 2 line 4 using CustomerRefListID for Cust2

Invoice 2 gets written to QuickBooks for Cust2

instead. Simply do single line invoices as a single SQL INSERT with the CUSTOMER detail, for example:

INSERT INTO "InvoiceLine" ("CustomerRefListID", "ClassRefListID", "RefNumber",
"InvoiceLineItemRefListID", "InvoiceLineDesc", "InvoiceLineRate",
"InvoiceLineAmount", "InvoiceLineSalesTaxCodeRefListID", "FQSaveToCache")
VALUES ('470001-1071525403', '30000-933272658', 'QODBCClass2', '250000-933272656',
'Building permit Additional Room', 100.00000, 100.00, '20000-999022286', 0)

See: How do I create Invoices? for more detail.

 

  Top 
 New Topic 
 
 Post Reply 
[1]  

Jump to