We can create a payment with multiple lines for multipe invoices by using multiple INSERT commands (with the FQSaveToCache caching flag set true '1' except for the last insert where it is false '0') like this:
INSERT INTO ReceivePaymentLine (CustomerRefListID, DepositToAccountRefListID, TotalAmount, AppliedToTxnTxnID, AppliedToTxnPaymentAmount, TxnDate, Memo, FQSaveToCache) Values ('AC0000-1197757899', '80000-933270541', 200.00, 'EEC-1197680711', 80.00, {d'2007-12-15'}, 'Payment for Invoice #1000 & 1002', 1)
INSERT INTO ReceivePaymentLine (CustomerRefListID, DepositToAccountRefListID, TotalAmount, AppliedToTxnTxnID, AppliedToTxnPaymentAmount, TxnDate, Memo, FQSaveToCache) Values ('AC0000-1197757899', '80000-933270541', 200.00, 'EFB-1197675550', 120.00, {d'2007-12-15'}, 'Payment for Invoice #1001 & 1002', 0)
You will need to locate the TxnID of each of the invoices for payment. See: How do I create a new Customer, invoice them and mark the invoice as paid? for more details. |