Show including tax amount on Documents

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wdbruwer
    Junior Member
    • Jan 2023
    • 16

    #1

    Show including tax amount on Documents

    We would like to show the including tax amount on quotes for each line item/product, how do we go about this?

    Alternatively is there away to have product unit prices as including VAT amount and have quotes/invoices etc. display as including VAT as default and just a total VAT at the bottom onfo the quote?
  • victor
    Active Community Member
    • Aug 2022
    • 936

    #2
    For example, Quote and Quote Items:

    1. In Administration > Entity Manager > Quote Item > Fields, create a field called myTaxAmount with Currency type.

    Click image for larger version  Name:	image.png Views:	0 Size:	27.3 KB ID:	118879

    2.In Administration > Entity Manager > Quote Item > Formula > Before Save Custom Script, create the formula:

    HTML Code:
    myTaxAmount = taxRate/100*amount;
    3. Add the myTaxAmount field in Administration > Entity Manager > Quote Item > Layouts > List (Item).

    - For the formula to work, you must specify the Tax Rate in your Quote Item:​

    Click image for larger version

Name:	image.png
Views:	25
Size:	47.7 KB
ID:	118881
    - The value in the myTaxAmount field will be calculated after saving changes to your Quote Item, not in inline editing mode.​
    Last edited by victor; Yesterday, 05:10 PM.

    Comment

    • shalmaxb
      Senior Member
      • Mar 2015
      • 1680

      #3
      I do not know, if that is, what the TE wanted, because he wrote "including tax amount". There is a differnece in tax calculation regarding this.
      If there is a tax rate of 19% and the amount is 100 €, than the tax after the amount is 19 € in this case.
      But if there is a total amount (including tax in a rate of 19%) then the net amount (without 19% tax) is 100/1.19, which is = 84,034 €, the tax itself in this case is 100 € - 84,034 = 15,97 € (round).
      Confirmation: 19% from 84,033 € net = (taxRate/100*amount) = 15,97 €, sum = 100 €

      For the calculation of the included tax I use a tax rate in decimal value, i.e. for 19% = 0,19. The decimal value you can achieve by a custom field taxRateDec, which you can calculate by formula as well. I divide the amount then by 1,19 and the result will be the net value of amount, on which I calculate the tax amount as the difference between amount and gross amount. So the calculation in formula for included tax has to be something like

      Code:
      netAmount = amount/1 + taxRateDec;
      includedTaxAmount = amount - netAmount;
      There might be other way to execute the calculation, but the structure has to be the mentioned way.

      Comment

      • yuri
        Member
        • Mar 2014
        • 9095

        #4
        'c' prefix is missing. Should be cMyTaxAmount.

        There should be a check to avoid division by zero if the amount is zero.
        cMyTaxAmountCurrency should be set with amountCurrency.
        If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

        Comment

        • wdbruwer
          Junior Member
          • Jan 2023
          • 16

          #5
          Originally posted by victor
          For example, Quote and Quote Items:

          1. In Administration > Entity Manager > Quote Item > Fields, create a field called myTaxAmount with Currency type.

          Click image for larger version Name:	image.png Views:	0 Size:	27.3 KB ID:	118879

          2.In Administration > Entity Manager > Quote Item > Formula > Before Save Custom Script, create the formula:

          HTML Code:
          myTaxAmount = taxRate/100*amount;
          3. Add the myTaxAmount field in Administration > Entity Manager > Quote Item > Layouts > List (Item).

          - For the formula to work, you must specify the Tax Rate in your Quote Item:

          Click image for larger version

Name:	image.png
Views:	25
Size:	47.7 KB
ID:	118881
          - The value in the myTaxAmount field will be calculated after saving changes to your Quote Item, not in inline editing mode.​
          I have figured that out yes, Right now is our issue Grandtotal calculation + VAT that is not balancing as Espocrm is calculating on ex VAT total, not individual items.

          Example:
          Product ex vat price is 1,434.78, including VAT is 1650. but if we have 2 products, total ex VAT price is then 2,869.56 & including VAT total is 3,299.99 and not 3300 (1650 + 1650).

          Comment


          • victor
            victor commented
            Editing a comment
            I have suggested a workaround that works. It is up to you to decide whether to use it or not.
            In your case, the fields involved in the formula may be different. And the tax calculation (the formula itself) may also be different.
        Working...