Question: Need Help Wrong Vat Show On Invoice

Need Help Wrong Vat Show On Invoice

I have problem with swedish 25% vat. It show wrong vat. It is 500 inkl ´vat so 100 is vat but show 80 I have atachment you can see picture

KV

Kalle Visu

Asked
I have problem with swedish 25% vat. It show wrong vat. It is 500 inkl ´vat so 100 is vat but show 80

I have atachment you can see picture
  • MS

    Mian Saleem

    Answered
    Hello,

    The tax is calculated as following

    ```
    Exclusive Tax = (price * tax rate / 100) => (100 * 25 / 100) = `25`
    so product nett price 100 & unit price will be 125

    Inclusive Tax = (price * tax rate / (100 + tax rate)) => (100 * 25 / (100 + 25)) = `20`
    so product nett price 80 & unit price will be 100
    ```

    If you want to change these, you will need to edit `themes/default/assets/js/custom.js` around line 241 for front-end javascript calculation and `app/models/Sales_model.php` around line 524 for back-end php.

    Thank you
  • KV

    Kalle Visu

    Answered
    Can you help me change this? I am beginner :)
  • KV

    Kalle Visu

    Answered
    in sales model i change

    ```
    if ($tax_method == 'inclusive') {
    $item_tax_amt = $this->sim->formatDecimal((($net_unit_price * $tax_details->rate) / (75+$tax_details->rate)), 4);
    $item_tax_val = $tax_details->rate."%";
    $net_unit_price -= $item_tax_amt;
    } else {
    $item_tax_amt = $this->sim->formatDecimal((($net_unit_price * $tax_details->rate) / 75), 4);
    ```

    in cusom.js i change to

    ```
    if (tax_method == 'inclusive') {
    product_tax = formatDecimal(((net_unit_price * this.rate) / (80 + this.rate)), 4);
    net_unit_price -= product_tax;
    } else {
    product_tax = formatDecimal(((net_unit_price * this.rate) / 80), 4);
    ```

    Now is show same vat number :) but is show only on new invoice not on old invoice is it correct? And is it correct with 80 and 75?
  • MS

    Mian Saleem

    Answered
    Hello,

    I am not sure how you need it and how your country calculate the inclusive tax. Once you have formula you can apply as you mentioned above. It will apply to all new sales.

    To apply it to old sales, you will need to edit them. Once submitted the tax will be calculated same as for new sales.

    Thank you
  • Login to Reply