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

Notifications

Announcements

No record found.

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,255

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)
  • Bilal Haider Profile Picture
    414 on at

    Hi,

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

  • Samantha73 Profile Picture
    3,255 on at

    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.  

  • Suggested answer
    Bilal Haider Profile Picture
    414 on at

    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,255 on at

    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
    414 on at

    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

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,664

#2
YUN ZHU Profile Picture

YUN ZHU 960 Super User 2025 Season 2

#3
Jainam M. Kothari Profile Picture

Jainam M. Kothari 773 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans