Change Tax Amount on Purchase Line by AL Code

samantha73
Member Posts: 118
Hi All,
I'm trying to build an integration to an external system to sync purchase orders and lines. There are small rounding differences between the two systems. Tried setting rounding on general ledger setup but the reality is it's never going match 100%. What are the options to set tax amount on document lines? Couldn't find code used in base app statistics based as this page allows the user to adjust tax from the front end so I'm thinking there must be a code unit somewhere that does the job?
I'm trying to build an integration to an external system to sync purchase orders and lines. There are small rounding differences between the two systems. Tried setting rounding on general ledger setup but the reality is it's never going match 100%. What are the options to set tax amount on document lines? Couldn't find code used in base app statistics based as this page allows the user to adjust tax from the front end so I'm thinking there must be a code unit somewhere that does the job?
0
Answers
-
On the statistics page user can set the VAT difference. You need to do implement the same logic in the code.
Set Allow VAT difference in the Purchase & Payables Setup.
In the Code calculate the VAT difference on the Purchase Lines.
After creating all the purchase lines
Use
PurchaseLine.CalcVATAmountLines(0, PurchaseHeader, PurchaseLine, VATAmountLine);
PurchaseLine.UpdateVATOnLines(0, PurchaseHeader, PurchaseLine, VATAmountLine);
PurchaseLine.UpdateVATOnLines(1, PurchaseHeader, PurchaseLine, VATAmountLine)
VATAmountline is temporary record
United Kingdom0
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