VAT Rounding Problem

ClaudioPereira
Member Posts: 38
Hello everyone,
I've implemented a new Document Type (Hire Order) in a navision 3.70 customer, that document is exactly like a sales order being the only diference that it calculates the amount in run-time (already inside codeunit 80)
It calculates (changes) the amount very early in the code so the VAT and all other calculations are done by the standard code.
However there is a difference in how it calculates the VAT: in a scenario where sales rounds 1 line up and another line down - making the overall total correct, my document is rounding both lines up and therefore calculating the wrong total VAT for the document.
Anyone knows where is the code where navision calculates the VAT?
Also any ideas on what's missing?
Thanks in advance
Claudio
I've implemented a new Document Type (Hire Order) in a navision 3.70 customer, that document is exactly like a sales order being the only diference that it calculates the amount in run-time (already inside codeunit 80)
It calculates (changes) the amount very early in the code so the VAT and all other calculations are done by the standard code.
However there is a difference in how it calculates the VAT: in a scenario where sales rounds 1 line up and another line down - making the overall total correct, my document is rounding both lines up and therefore calculating the wrong total VAT for the document.
Anyone knows where is the code where navision calculates the VAT?
Also any ideas on what's missing?
Thanks in advance
Claudio
0
Comments
-
Sales Release Codeunit 414
This is where the VAT is calculated, you may have to investigate the VAT Line calls in here.Analyst Developer with over 17 years Navision, Contract Status - Busy
Mobile: +44(0)7854 842801
Email: david.cox@adeptris.com
Twitter: https://twitter.com/Adeptris
Website: http://www.adeptris.com0 -
Hi, Thanks for the help,
I've tried running this codeunit after changing the amount on the lines but now i'm having consistency errors.
I've tried to comment the consistency function in CU 12, and what it's doing it's not posting one of the lines, but the total amount is still the same. that seems to only happen for certain amounts though ](*,)0 -
Do NOT comment out the consistency check in Navision. It will basically render all the accounting useless.
Check how VAT is handled in the Release Sales Document -- that's the only way.0 -
ClaudioPereira wrote:Hello everyone,
I've implemented a new Document Type (Hire Order) in a navision 3.70 customer, that document is exactly like a sales order being the only diference that it calculates the amount in run-time (already inside codeunit 80)
It calculates (changes) the amount very early in the code so the VAT and all other calculations are done by the standard code.
Claudio
"Inconsistency errors can make you database, unrecoverable from a backup, if you have a problem fix it don't work around it"
?? diference that it calculates the amount in run-time ?? How Why ??
!! You must release the document to calculate VAT properly !!
I had a look at the code and I cannot see how an extra "Document Type", on the Header and Lines, can cause a problem, calculating VAT with the standard release functions,
However Adding a new document type has an Impact system wide, not a path anyone would take lightly.
how do you deal with the New Document type in codeunit 80 ??
Posting what Document type to the G/L, Item, Value, VAT Ledgers etc?
I would check the RoundingLineInserted functions in CodeUnit 80
Create 2 Documents, first a Standard Order the second your new type, same item data, then release both documents, check the lines finance values are the same, if not then check why.
Post the order Ship and Invoice!
If this post ok and yours don't then the problem is in CU80, might be RoundingLineInserted functions, or a document type problem.
If your New Document emulates an Order then everywhere the document type is order you need to add your type.
Good lock! [-o<Analyst Developer with over 17 years Navision, Contract Status - Busy
Mobile: +44(0)7854 842801
Email: david.cox@adeptris.com
Twitter: https://twitter.com/Adeptris
Website: http://www.adeptris.com0 -
David Cox wrote:ClaudioPereira wrote:Hello everyone,
I've implemented a new Document Type (Hire Order) in a navision 3.70 customer, that document is exactly like a sales order being the only diference that it calculates the amount in run-time (already inside codeunit 80)
It calculates (changes) the amount very early in the code so the VAT and all other calculations are done by the standard code.
Claudio
"Inconsistency errors can make you database, unrecoverable from a backup, if you have a problem fix it don't work around it"
?? diference that it calculates the amount in run-time ?? How Why ??
!! You must release the document to calculate VAT properly !!
I had a look at the code and I cannot see how an extra "Document Type", on the Header and Lines, can cause a problem, calculating VAT with the standard release functions,
However Adding a new document type has an Impact system wide, not a path anyone would take lightly.
how do you deal with the New Document type in codeunit 80 ??
Posting what Document type to the G/L, Item, Value, VAT Ledgers etc?
I would check the RoundingLineInserted functions in CodeUnit 80
Create 2 Documents, first a Standard Order the second your new type, same item data, then release both documents, check the lines finance values are the same, if not then check why.
Post the order Ship and Invoice!
If this post ok and yours don't then the problem is in CU80, might be RoundingLineInserted functions, or a document type problem.
If your New Document emulates an Order then everywhere the document type is order you need to add your type.
Good lock! [-o<
Hello,
Thanks for your help, after a bit of research i was able to get everything working just.
I had to calculate the amount in run-time because it's a rental system i'm implementing, and at the time of posting the user only know how much is the weekly rate, the system then calculates the invoice amount considering the time interval, the rate, which days are working days, etc.
that is also why i had to add the new document, because as a rental, the order has to stay in the system until the item is returned, and generate a new invoice for the same item every month that it's out on rent. That is not the behavior of the normal sales order that they also use.
Again, thanks a lot for your help,
Best regards,
Claudio0 -
Glad we could help out \:D/
I would have modified the blanket orders to resove your weekly hire scenario, and created Invoices instead of orders from the blanket order, and the link would already be there with the blanket order number!
But thats the beauty of Navision ask one question and get twenty different soloutions! :shock:Analyst Developer with over 17 years Navision, Contract Status - Busy
Mobile: +44(0)7854 842801
Email: david.cox@adeptris.com
Twitter: https://twitter.com/Adeptris
Website: http://www.adeptris.com0
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