Doing debtor allocations from spreadsheet
version 7.2.1
Scenario:
Debtor credit/payment transactions already exists with unallocated amount.
Likewise there is heaps of debit/invoices unallocated.
Client will provide a 2 column spreadsheet thus. First column is credit remitno, second column is the invoice remitno:
I'm wanting to knock up a piece of plugin code which will read the cell value and find the credit remitno based on that value (say in my example payment 0001).
Then it reads the next cell to the right and allocates the full invoice value against the payment.
Then move to the next line & do it all over again. Up until there's no more unallocated amount on the credit/payment.
I'm having trouble finding any relevant code in Jiwa's objects to read the transaction based on the InvRemitNo, and then perform the allocation. I think the closest I can find is
Out of the realm of this question is how to read the spreadsheet and cells (that bit I can already do). It's just finding the transactions & allocating which I am having trouble with. I've seen a few similar questions on the forums from time to time but they seem to be related to cash book allocations. In my case, the debits and credits already exist against the debtor unallocated. I'm just looking for a speedy way to allocate payments to a large list of invoices.
Scenario:
Debtor credit/payment transactions already exists with unallocated amount.
Likewise there is heaps of debit/invoices unallocated.
Client will provide a 2 column spreadsheet thus. First column is credit remitno, second column is the invoice remitno:
- Code: Select all
CREDIT Remit No InvoiceNo
payment 0001 0000327345-D01
payment 0001 0000127663-D01
payment 0001 0000127670-D01
payment 0001 0000344109-D01
I'm wanting to knock up a piece of plugin code which will read the cell value and find the credit remitno based on that value (say in my example payment 0001).
Then it reads the next cell to the right and allocates the full invoice value against the payment.
Then move to the next line & do it all over again. Up until there's no more unallocated amount on the credit/payment.
I'm having trouble finding any relevant code in Jiwa's objects to read the transaction based on the InvRemitNo, and then perform the allocation. I think the closest I can find is
- Code: Select all
JiwaFinancials.Jiwa.JiwaDebtors.DebtorTransaction creditTrans = debtor.Transactions.GetItem("InvRemitNo", System.Convert.ToString(worksheet.Cells[row, 1].Value));
Out of the realm of this question is how to read the spreadsheet and cells (that bit I can already do). It's just finding the transactions & allocating which I am having trouble with. I've seen a few similar questions on the forums from time to time but they seem to be related to cash book allocations. In my case, the debits and credits already exist against the debtor unallocated. I'm just looking for a speedy way to allocate payments to a large list of invoices.