Connecting Payments to Invoices
Mauddib
Member Posts: 269
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
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
-
The Navigate function only works if the document no. and usually also the posting date are the same. This will be the case if a "Bal. Account No." is filled for the "Payment Method" (Table 289).(i.e. Cash Payment ) The Cust. Ledger Entry is then automatically closed when the invoice is posted.
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).Kai Kowalewski0 -
The payments method table is empty in the company Im looking at.
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.0 -
If you take a look at form 232 you will see how Navision does this.
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.0 -
Maybe I didn't read it clearly but what about
Application->Applied Entries0 -
Savatage wrote:Maybe I didn't read it clearly but what about
Application->Applied Entries
Yes, this is also form 232.0 -
Mark Brummel wrote:Savatage wrote:Maybe I didn't read it clearly but what about
Application->Applied Entries
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.Kai Kowalewski0 -
Yes, you are right. I had the wrong form number in my mind.
Thanks for the correction
0 -
I hope I didn't get it wrong. But you can use field "Applies-to Doc. No." or "Closed by Entry No." in table 21 (Cust. Ledger Entry) to find the information you need.Be fast, be straight, be quiet0
-
I dont think you can use the closed by fields as this only shows the last application made doesnt it? It wont work in situations where..
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?
GmcB0 -
You are right and I must admit that this post is getting a bit confusing, which is partly on me to blame. :?
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.0 -
The Field "Cust. Ledger Entry No." in Table 379 "Detailed Cust. Ledg. Entry" is the same for the invoice and all payments. Use the "Entry No." of Table 21 and put a filter on this field.
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.Kai Kowalewski0 -
I did this. I took the entry number from table 21 and used it as the filter on the detailed table. This gives all kinds of entries such as initial entry, application and so on.
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.
G0 -
If you need an extra invoice number this can be filled into "External Document No." in the journal line, this will then be copied into Table 21 / Field 63Kai Kowalewski0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions

