I know this might seem awfully stupid but when you look at payments in the tables 21 and 379... how do you actually work out which Invoices they were applied to? Im trying Navigate and all kinds of things and rarely am I finding a connection between payments and the invoices they were applied to.
To clarify... you pull a payment from table 21 in C/AL code into a record variable.
Based on the data in that record, how will you find the document number of the invoice this payment relates to?
GmcB
0
Comments
If the posting dates are different ( manually appilied payment ) but the document no. is the same, Navigate can be used with undefined date.
The field "Closed by Entry No." in Table 21 can be always be used to find the closing entry (if there a partial payments there may be more than one).
There could also be more than one payment against an invoice so the closed by entry number might not work?
I need to be able to pull out ANY payment in the system and match it to the invoice it was applied to.
Application is a very complicated thing in Navision.
It is best you take what you need and leave most of the code what you don't need out with the setup you have done.
Application->Applied Entries
http://www.BiloBeauty.com
http://www.autismspeaks.org
Yes, this is also form 232.
No, this is Form 61.
The code in this form can be used to find all entries that closed each other.
Thanks for the correction
1) One payment was applied to more than one invoice
2) One invoice required more than one payment to close it.
Im a little new to navision programming. Surely there is a bit of code there that, given a payment document number of ledger entry number, you can list the invoices it had been related to?
GmcB
Have you looked at the code in form 61?
If you look in the OnOpenForm trigger you will find the code you need I think.
If a payment is applied to more invoices you can see this in the detailed entries.
If only one amount was posted for several invoices these are split up into separate entries in this table.
There are some G/L comfort add-ons which in this case create one payment entry for the full amount and a correction entry of the same amount and then create a separate payment entry for each invoice in "Cust. Ledger Entry", but in standard Navision the "Detailed Customer Ledger Entries" have to be used.
Fraid this is no good either. The document number for the payment in table 21 is the same as the document number used in the detailed entries table. No sign of the invoice numbers anywhere on this table.
G