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 : Empty BillExpenseLine Transaction??Search Forum

Forum Home > QODBC - ODBC Driver for QuickBooks > QODBC v6 Forum

 New Topic 
 
 Post Reply 
[1]  
 Empty BillExpenseLine Transaction?? 
 Author   Message 
  Jim Turner 
  
 Group: Members 
 Posts: 6 
 Joined: 2006-04-04 
 Profile
 Posted : 2006-04-04 07:18:35
I am using the eval copy of 2006 to demonstrate to my client the ease of transferring data from Microsoft Access to Quickbooks.  Currently the QB version is 05 Pro but will be upgraded to 2006 soon

I am using 2 simple SQL statements to demonstrate the insertion of a bill into QB

strsql = "INSERT INTO BillExpenseLine ( RefNumber, ExpenseLineAmount, ExpenseLineMemo, FQSaveToCache ) Values ('Ref Number 123',50.00,'test memo',1)


strsql = "INSERT INTO Bill (VendorRefListID,APAccountRefListID,TxnDate,DueDate,RefNumber,TermsRefListID,Memo) VALUES ('380000-955572222','5D0000-959781330','2/2/2006','2/2/2006','Ref Number 123','70000-940545978','Memo 123456')"

The first query runs fine.  The second query gives an error message 3180: Quickbooks Error, the transaction is empty!  What am I doing wrong with the above code.

Thanks 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2006-04-04 08:57:03

The two SQL statements need to be run one after the other without breaking or closing the connection to QODBC or running any other statements between them. Try re-running the statements using VB Demo.

 

  Top 
  Jim Turner 
  
 Group: Members 
 Posts: 6 
 Joined: 2006-04-04 
 Profile
 Posted : 2006-04-04 09:01:23
They were run without breaking the SQL statement in Access and I tried them in the VBDemo with the same result of error 3180 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2006-04-04 09:29:50

Although I don't see the requirement using sp_columns BillExpenseLine, try adding the ExpenseLineAccountRefListID as per the following example which creates one bill with three expense lines. Note the FQSaveToCache field, set to True. Saving the Bill sets FQSaveToCache field to False and saves the BillExpenseLine lines with it.

BillItemLine
This creates one bill with three lines. Note the FQSaveToCache field, set to True except on the last line.

INSERT INTO "BillItemLine" ("VendorRefListID", "RefNumber", "ItemLineItemRefListID", "ItemLineDesc", "ItemLineCost", "ItemLineAmount", "FQSaveToCache") VALUES ('10000-933272655', '1', '250000-933272656', 'Building permit 1', 1.00000, 1.00, 1)

INSERT INTO "BillItemLine" ("VendorRefListID", "RefNumber", "ItemLineItemRefListID", "ItemLineDesc", "ItemLineCost", "ItemLineAmount", "FQSaveToCache") VALUES ('10000-933272655', '1', '250000-933272656', 'Building permit 2', 2.00000, 2.00, 1)

INSERT INTO "BillItemLine" ("VendorRefListID", "RefNumber", "ItemLineItemRefListID", "ItemLineDesc", "ItemLineCost", "ItemLineAmount", "FQSaveToCache") VALUES ('10000-933272655', '1', '250000-933272656', 'Building permit 3', 3.00000, 3.00, 0)

This creates three bills with one line each. Note the FQSaveToCache field is not specified (or can be set to false)

INSERT INTO "BillItemLine" ("VendorRefListID", "RefNumber", "ItemLineItemRefListID", "ItemLineDesc", "ItemLineCost", "ItemLineAmount") VALUES ('10000-933272655', '1', '250000-933272656', 'Building permit 1', 1.00000, 1.00)

INSERT INTO "BillItemLine" ("VendorRefListID", "RefNumber", "ItemLineItemRefListID", "ItemLineDesc", "ItemLineCost", "ItemLineAmount") VALUES ('10000-933272655', '1', '250000-933272656', 'Building permit 2', 2.00000, 2.00)

INSERT INTO "BillItemLine" ("VendorRefListID", "RefNumber", "ItemLineItemRefListID", "ItemLineDesc", "ItemLineCost", "ItemLineAmount") VALUES ('10000-933272655', '1', '250000-933272656', 'Building permit 3', 3.00000, 3.00)

This creates one bill with three item lines. Note the FQSaveToCache field, set to True. Saving the Bill saves the lines with it.

INSERT INTO "BillItemLine" ("ItemLineItemRefListID", "ItemLineDesc", "ItemLineCost", "ItemLineAmount", "FQSaveToCache") VALUES ('250000-933272656', 'Building permit 1', 1.00000, 1.00, 1)

INSERT INTO "BillItemLine" ("ItemLineItemRefListID", "ItemLineDesc", "ItemLineCost", "ItemLineAmount", "FQSaveToCache") VALUES ('250000-933272656', 'Building permit 2', 2.00000, 2.00, 1)

INSERT INTO "BillItemLine" ("ItemLineItemRefListID", "ItemLineDesc", "ItemLineCost", "ItemLineAmount", "FQSaveToCache") VALUES ('250000-933272656', 'Building permit 3', 3.00000, 3.00, 1)

INSERT INTO "Bill" ("VendorRefListID", "APAccountRefListID", "TxnDate", "RefNumber", "TermsRefListID", "DueDate", "Memo") VALUES ('10000-933272655', 'C0000-933270541', {d'2002-10-01'}, '1', '10000-933272658', {d'2002-10-31'}, 'Memo Test')

BillExpenseLine
This creates one bill with two expense lines. Note the FQSaveToCache field, set to True. Saving the Bill saves the lines with it.

INSERT INTO "BillExpenseLine" ("ExpenseLineAccountRefListID", "ExpenseLineAmount", "ExpenseLineMemo", "ExpenseLineCustomerRefListID", "FQSaveToCache") VALUES ('120000-933270541', 436.07, 'Expense Line Memo Test 1', '6E0000-1071509585', 1)

INSERT INTO "BillExpenseLine" ("ExpenseLineAccountRefListID", "ExpenseLineAmount", "ExpenseLineMemo", "ExpenseLineCustomerRefListID", "FQSaveToCache") VALUES ('120000-933270541', 436.06, 'Expense Line Memo Test 2', '6E0000-1071509585', 1)

INSERT INTO "Bill" ("VendorRefListID", "APAccountRefListID", "TxnDate", "RefNumber", "TermsRefListID", "DueDate", "Memo") VALUES ('720000-1071512482', 'C0000-933270541', {d'2002-10-01'}, '1', '20000-933272658', {d'2002-10-31'}, 'Expense Memo Test')

and results in the following Bill in QuickBooks:

or for Australian users, use the following SQL Statements using ExpenseLineTaxCodeRefListID (for GST) and these modified values to create a single line expense bill for "Optical Phone Networks" in the sample Stadium Construction company file supplied with QuickBooks in Australia located at :-
 
C:\Program Files\Intuit\QuickBooks Premier\Stadium Construction and Hardware Pty Ltd QB Premier.qbw

INSERT INTO "BillExpenseLine" ("ExpenseLineAccountRefListID", "ExpenseLineAmount", "ExpenseLineMemo", "ExpenseLineTaxCodeRefListID", "FQSaveToCache") VALUES ('270000-1045536344', 500.00, 'QODBC Expense Line Memo Test 1', 'C0000-1045536338', 1)

INSERT INTO "Bill" ("VendorRefListID", "APAccountRefListID", "TxnDate", "RefNumber", "TermsRefListID", "DueDate", "Memo") VALUES ('200000-1045537156', '3D0000-1045609540', {d'2004-11-17'}, '1', '20000-1045536343', {d'2004-12-31'}, 'QODBC Bill Expense Memo Test')

Never enter a tax value as QuickBooks generates the tax amount based upon the ExpenseLineTaxCodeRefListID being used. ExpenseLineTaxCodeRefListID is the ListID for GST found in the TaxCode Table. Use the following SQL Statement in VB Demo to locate the ListID: SELECT * FROM TaxCode

Please Note: The ExpenseLineCustomerRefListID or ExpenseLineAccountRefFullName is NOT required on all BillExpenseLine inserts.

 

 

 

  Top 
  Jim Turner 
  
 Group: Members 
 Posts: 6 
 Joined: 2006-04-04 
 Profile
 Posted : 2006-04-04 09:57:41
Thanks...that was the solution.  I had enjoyed using the sp_columns procedure that I didn't look closer at the example 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2006-04-21 09:01:30

UPDATE: You can actually leave out ExpenseLineCustomerRefListID all together, you just can't say you are going to use it, and then try to insert a null. 

The following example also works:

INSERT INTO "BillExpenseLine" ("ExpenseLineAccountRefListID", "ExpenseLineAmount", "ExpenseLineMemo", "FQSaveToCache") VALUES ('120000-933270541', 436.07, 'Expense Line Memo Test 100', 1)

INSERT INTO "Bill" ("VendorRefListID", "APAccountRefListID", "TxnDate", "RefNumber", "TermsRefListID", "DueDate", "Memo") VALUES ('720000-1071512482', 'C0000-933270541', {d'2002-10-01'}, '100', '20000-933272658', {d'2002-10-31'}, 'Expense Memo Test')

 

  Top 
 New Topic 
 
 Post Reply 
[1]  

Jump to