I have a documentation system such that invoices/authorisations are attached to line items of a creditor purchase batch ...
The client now wants the associated invoices/authorisations to be available against line items on the payments batch page for review prior to approving the payment ...
I'm stumped trying to correctly associate payment line items back to the purchase line item they relate to.
On the purchase page, I can work with DispersalKey (CR_BatchTranLines.ReceiptLineID) or TranKey (_form.CRBatchTransObject.TransLines.RecID), but on the payment page I can't find any unique key per line item (either in the _form.CRChequePayObject or in the _form.grdLines columns) to get me back to the associated purchase.
What am I missing?
If you prefer, to ask the same question from a database perspective ...
I can see the data for the purchase:
- Code: Select all
SELECT * FROM CR_BatchTranLines WHERE ReceiptID = (SELECT ReceiptID FROM CR_BatchTrans WHERE BatchNum = '024366')
ORDER BY LineNum
And for the payment:
- Code: Select all
SELECT * FROM CR_BatchPayLines WHERE CR_BatchPayID = (SELECT CR_BatchPayID FROM CR_BatchPayment WHERE BatchNo = '006780')
ORDER BY LineNumber
But I can't work out how to traverse the database from a payment result line back to the associated purchase line.
Thanks in advance!
Cheers,
Neil.