[QODBC-Desktop] How to create Supplier Credits (VendorCredit)
Posted by brad waddell on 12 March 2009 05:21 PM
|
|
An Example of creating VendorCreditCreates one VendorCredit with Three LinesNote: This creates one VendorCredit with three lines. Note the FQSaveToCache field, set to True except on the last one. Note: The primary rule is first to save the data to the child record. The child record for each parent/child pair has all the data required by the parent record. First Line INSERT INTO "VendorCreditItemLine" ("VendorRefListID", "APAccountRefListID", "TxnDate", "RefNumber", "Memo", "ItemLineItemRefListID", "ItemLineDesc", "ItemLineCost", "ItemLineQuantity", "ItemLineAmount", "ItemLineCustomerRefListID", "FQSaveToCache") VALUES ('90000-933272656', 'C0000-933270541', {d'2003-12-15'}, '1', 'Memo Test', 'E0000-933272656', 'Install tile or counter', 1.11, 1.00, 1.11, '280000-933272658', 1) Second Line INSERT INTO "VendorCreditItemLine" ("VendorRefListID", "APAccountRefListID", "TxnDate", "RefNumber", "Memo", "ItemLineItemRefListID", "ItemLineDesc", "ItemLineCost", "ItemLineQuantity", "ItemLineAmount", "ItemLineCustomerRefListID", "FQSaveToCache") VALUES ('90000-933272656', 'C0000-933270541', {d'2003-12-15'}, '1', 'Memo Test', 'D0000-933272656', 'Roofing', 2.22, 2.00, 4.44, '280000-933272658', 1) Third (Last) Line INSERT INTO "VendorCreditItemLine" ("VendorRefListID", "APAccountRefListID", "TxnDate", "RefNumber", "Memo", "ItemLineItemRefListID", "ItemLineDesc", "ItemLineCost", "ItemLineQuantity", "ItemLineAmount", "ItemLineCustomerRefListID", "FQSaveToCache") VALUES ('90000-933272656', 'C0000-933270541', {d'2003-12-15'}, '1', 'Memo Test', '250000-933272656', 'Permit', 3.33, 3.00, 9.99, '280000-933272658', 0) Create One VendorCredit with Three Lines with All Shared Header InformationNote: This creates one VendorCredit with three lines. Saving the VendorCredit will save the lines. Note the FQSaveToCache field, set to True. First Line INSERT INTO "VendorCreditItemLine" ("ItemLineItemRefListID", "ItemLineDesc", "ItemLineCost", "ItemLineQuantity", "ItemLineAmount", "ItemLineCustomerRefListID", "FQSaveToCache") VALUES ('E0000-933272656', 'Install tile or counter', 1.11, 1.00, 1.11, '280000-933272658', 1) Second Line INSERT INTO "VendorCreditItemLine" ("ItemLineItemRefListID", "ItemLineDesc", "ItemLineCost", "ItemLineQuantity", "ItemLineAmount", "ItemLineCustomerRefListID", "FQSaveToCache") VALUES ('D0000-933272656', 'Roofing', 2.22, 2.00, 4.44, '280000-933272658', 1) Third Line INSERT INTO "VendorCreditItemLine" ("ItemLineItemRefListID", "ItemLineDesc", "ItemLineCost", "ItemLineQuantity", "ItemLineAmount", "ItemLineCustomerRefListID", "FQSaveToCache") VALUES ('250000-933272656', 'Permit', 3.33, 3.00, 9.99, '280000-933272658', 1) Shared Header Information INSERT INTO "VendorCredit" ("VendorRefListID", "APAccountRefListID", "TxnDate", "RefNumber", "Memo") VALUES ('90000-933272656', 'C0000-933270541', {d'2003-12-15'}, '1', 'Memo Test') | |
|