Split Customer Entries

Magno
Member Posts: 168
Hi,
I need to make an adjustment for sales invoices, so that in some special cases, the customer entry that will be created will be split in 3 entries with different due dates.
In codeunit 21, specific when posting customer ledger, I did my checks, created a GenJnlLine2 which is a copy of GenJnlLine.
And made the PostCust with this data and the second. And again with the original amount - amounts from first 2 entries.
First time I got an error stating that the Invoice No X already exists (Customer entry check before creating again, which is not executed when recurring method is set)
I added some more checks to skip this test, but the next error leaves me a bit wondering how to solve it:
Any ideas/tips/hints?
I need to make an adjustment for sales invoices, so that in some special cases, the customer entry that will be created will be split in 3 entries with different due dates.
In codeunit 21, specific when posting customer ledger, I did my checks, created a GenJnlLine2 which is a copy of GenJnlLine.
And made the PostCust with this data and the second. And again with the original amount - amounts from first 2 entries.
First time I got an error stating that the Invoice No X already exists (Customer entry check before creating again, which is not executed when recurring method is set)
I added some more checks to skip this test, but the next error leaves me a bit wondering how to solve it:
Microsoft Dynamics NAV Classic
The transaction cannot be completed because it will cause inconsistencies in the G/L Entry table.
Check where and how the CONSISTENT function is used in the transaction to find the reason for the error.
Contact your system administrator.
Tables can be marked as inconsistent during comprehensive tasks, such as posting. This prevents data from being updated incorrectly.
OK
Any ideas/tips/hints?
0
Comments
-
Hi,
This error occurred because while completing transaction, its Debit part & Credit part has some difference, that means if Debit part is 400.35 then Credit must be 400.35Uday Mer | MS Dynamics NAV Techno-Functional Consultant0 -
I would say that this is very bad design, and even if you will be able to implement this - this will lead to many issues in future.
As per NAV architecture you always should have 1 customer/vendor entry per sales/purchase document.
If you need to have more than one entry - you have to deal not with posting routines, but split your data before posting, e.g create separate documents from your initial invoice.0 -
Yes you are right, this is not a good design
Will suggest you to handle such spiting before posting e.g. in Gen. Journal or Cash Receipt Journal, where you can add a button Split Lines which creates multiple Lines from one line with your some predefined conditions.Uday Mer | MS Dynamics NAV Techno-Functional Consultant0 -
Isn't this standard for NAV in countries like Italy?
I've done it before in the past, it is not that difficult, as long as you program it on top of codeunit 80, using the General Journal.
Basically what you do is design a transaction that can be executed on top of a posted sales invoice as if you would divide the entries manually. This way you are always "safe".0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K 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
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions