[QODBC-Desktop] How to Import Bill with Expense line and Item line using QODBC
Posted by brad waddell on 12 March 2009 05:21 PM
|
|
An Example of Importing a Bill with Item Line and Expense LineNote: It's simple, but you must create either the Expense or Item lines first and then add the Item or Expense lines afterward, like below. Note: The primary rule is first to save the data to the child record. The child record for each parent/child pair includes all the data required by the parent record. Create the Expense LineINSERT INTO "BillExpenseLine" ("ExpenseLineAccountRefListID", "ExpenseLineAmount",
Write the Bill HeaderINSERT INTO "Bill" ("VendorRefListID", "APAccountRefListID", "TxnDate", "RefNumber",
Determine the TxnID of the new Billsp_lastinsertID Bill Note: Please do not close the connection between the Insert Bill / BillExpenseLine / BillItemLine otherwise, you will not be able to get the last inserted ID.
Use the TxnID to append Item lines to the existing BillNote: The LastInsertID returned was: 8C47-1481796786 INSERT INTO "BillItemLine" ("TxnID", "ItemLineItemRefListID",
Result in QuickBooks This results in the following Bill in QuickBooks with both an Expense and Item line:
| |
|