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 : Do you have an example on how to modify existing invoices and add lines also?Search Forum

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

 New Topic 
 
 Post Reply 
[1]  
 Do you have an example on how to modify existing invoices and add lines also? 
 Author   Message 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2006-02-22 10:11:23

The example below inserts a new Invoice line into the InvoiceLine table. Note that a TxnID is supplied. It's that simple, just call up an existing invoice to insert a new record line.

INSERT INTO "InvoiceLine" ("TxnId", "InvoiceLineItemRefListID", "InvoiceLineDesc", "InvoiceLineRate", "InvoiceLineAmount", "InvoiceLineSalesTaxCodeRefListID") VALUES ('6130-1197786604', '250000-933272656', 'Test Add a Line', 1.00000, 1.00, '20000-999022286')

The TxnID is found by searching the Invoice table for the invoice you wish to modify by doing:

select TxnID, RefNumber from Invoice where RefNumber = 'the invoice number you are looking for'

If you need to update an exisiting InvoiceLine record you can use a statement similar to the one below. The TxnID in the WHERE statement is used for speed but could be omitted.

UPDATE "InvoiceLine" SET "InvoiceLineDesc" = 'New Desc 10001' WHERE "TxnID" = '6130-1197786604' And "InvoiceLineTxnLineID" = '7133-1197736106'

See: Duplicate invoice on Insert of new InvoiceLine for an example.

 

  Top 
  JimK 
  
 Group: Members 
 Posts: 34 
 Joined: 2006-08-08 
 Profile
 Posted : 2006-08-08 09:58:35

I have tried all day to get this to work. All I want to do is add a line to an existing invoice. When I use the following line I receive a 'Field not allowed in insert' error.

INSERT INTO "InvoiceLine" ("TxnId", "InvoiceLineItemRefFullName", "InvoiceLineDesc", "InvoiceLineRate", "InvoiceLineAmount") VALUES ('1109C-1154924243', 'Surveying Supplies', 'Test Add a Line', 1.00000, 1.00)

Any ideas?

 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2006-08-08 10:41:59
For a better example on how to add invoice lines to an existing invoice see: Using ClassRefListID when inserting invoice lines  

  Top 
  JimK 
  
 Group: Members 
 Posts: 34 
 Joined: 2006-08-08 
 Profile
 Posted : 2006-08-08 11:42:29

Tom,

Thanks for the quick response (as everyone on here appreciates). The problem was that it was the 6.00.00.150 version. I had upgraded but it didn't take until I uninstalled and reinstalled! One I got to the latest rev it worked just as indicated.

Thanks!

 

  Top 
 New Topic 
 
 Post Reply 
[1]  

Jump to