web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested answer

Create Sales Invoice From Code and insert line tax amount

(0) ShareShare
ReportReport
Posted on by 3,083

Hi All

I'm trying to import sales invoices from excel and instead of letting the system calculate line level tax, I'd like to insert the tax amount so we can match BC invoices to external invoices. Is it possible? I have read that this is not possible through the API but here I'm importing from excel to a staging table and then running a code unit

Thanks

I have the same question (0)
  • Suggested answer
    Bilal Haider Profile Picture
    391 on at
    RE: Create Sales Invoice From Code and insert line tax amount

    Hi,

    Yes you are right. Work around I shared is based on if you importing from excel.

    If want to update from user interface it is not difficult.

    For one time you need to do setup that is:

    1: You need to give Max VAT difference in the general ledger setup.

    2: Then you need to Allow VAT difference on Sales & Receivables setup.

    Now go to the document where you want to make VAT different. On the Navigate go to statistics and then change VAT amount.

    VAT-diff.PNG

  • Samantha73 Profile Picture
    3,083 on at
    RE: Create Sales Invoice From Code and insert line tax amount

    Thanks Bilal I'll check your workaround to manipulate amounts to get the exact VAT but I cannot believe I'm the first one to have this requirement as it's common to have rounding differences when matching external documents based on other ERP systems

  • Suggested answer
    Bilal Haider Profile Picture
    391 on at
    RE: Create Sales Invoice From Code and insert line tax amount

    As you know in BC the VAT calculation is done based on VAT posting setup and we do not give VAT % on individual documents.

    In Sales Line there is no field that store VAT Amount.

    The fields store information like Amount, Amount Including VAT, VAT Base Amount and VAT %.

    VAT % comes from the VAT posting setup.

    VAT base amount is the same as Amount but it is different if you are giving VAT discount. System calculates Amount Incl. VAT using formula:

    Amount Including VAT = Amount + VAT Base Amount * VAT % / 100

    At the time of posting, VAT amount is calculated again using the formula VAT Amount := Amount Incl. VAT - Amount.

    Solution but not recommended: After putting values in item no and quantity you can manipulate the Amount Incl. VAT and Amount fields to get the exact VAT amount but make sure that you are doing calculations correct.

  • Samantha73 Profile Picture
    3,083 on at
    RE: Create Sales Invoice From Code and insert line tax amount

    Thanks Bilal..We want to have tax on the same line.  Basically everything  is the same as standard sales invoice/order entry from front end except we want to specifically set the tax amount for the row (this is GST/VAT in AU so no complexity like North America) since we are matching to an external document.  

  • Bilal Haider Profile Picture
    391 on at
    RE: Create Sales Invoice From Code and insert line tax amount

    Hi,

    Are you creating separate line for tax? or you want the tax and base amount in the same line for a sales document.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Mansi Soni – Community Spotlight

We are honored to recognize Mansi Soni as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 2,899 Super User 2025 Season 2

#2
Sumit Singh Profile Picture

Sumit Singh 2,444

#3
Jeffrey Bulanadi Profile Picture

Jeffrey Bulanadi 2,304

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans