Change Tax Amount on Purchase Line by AL Code

samantha73samantha73 Member Posts: 94
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?


  • Developer101Developer101 Member Posts: 523
    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


    PurchaseLine.CalcVATAmountLines(0, PurchaseHeader, PurchaseLine, VATAmountLine);
    PurchaseLine.UpdateVATOnLines(0, PurchaseHeader, PurchaseLine, VATAmountLine);
    PurchaseLine.UpdateVATOnLines(1, PurchaseHeader, PurchaseLine, VATAmountLine)

    VATAmountline is temporary record

    United Kingdom
Sign In or Register to comment.