Invoice Not Showing Tax When Price Inclusive Tax

When "Enter Prices Inclusive of Tax?" option is checked in Store Settings > General section, the Invoice PDF doesn't show the Tax rate. Is there any way I can show the Tax Rate even though the Prices are inclusive of Tax?

https://static.livechatinc.com/8801096/OU6BCRI9FL/c18ca58cbaeb7274d3abb5d1bc4f87d6/Screen%20Shot%202017-08-07%20at%2012.28.19.png

  • Oguz
    • QA Engineer

    Hey Emanaku ,

    I just checked the Invoice PDF feature with "Enter Prices Inclusive of Tax?" option checked. The PDF shows tax at the next line after the subtotal line. But it doesn't show for old orders. After the set of tax when I make a new order, PDF looks like what you want.

    Settings page;

    Product page;

    Invoice;

    Can you check your settings and try with new order? Hope that can help you.
    Cheers!
    Oguz

  • Emanaku
    • The Incredible Code Injector

    Hi, Oguzhan,
    thank you for checking this. I am able to reproduce the same behaviour with a fresh install of WP and MP.
    Unfortunately in the system, I am working on, with the same settings, with a new product and a new customer I am getting this:

    I tried it several times. With and without CoursePress plugin etc. pp. The tax is just wrong.
    So maybe I have to set up this website anew?

  • Emanaku
    • The Incredible Code Injector

    Sorry, now I found the REAL culprit:
    It is the Coupon Code addon!!!
    If the Coupon Code addon is NOT active - everything is fine (tax is computed, but tax is included in the price of article)
    If the Coupon Code addon is ACTIVE - the tax is computed AND added to the price (instead of being included)
    (You can see it already in the cart - no printing of invoice is needed to see the problem.)
    This happens even, when no Coupon is used.
    If a Coupon is used, then amount to pay is reduced according to the coupon, the tax is computed from the reduced amount, and then the tax is ADDED to that (which is wrong also).
    Do I need to open another ticket (oh, I can't :wink: ).
    WP 4.8.1 and MP 3.2.5

  • Emanaku
    • The Incredible Code Injector

    Here is the solution.
    Problem: The Coupon Code Addon does not take into account the setting tax->tax_inclusive
    Where: in includes>addons>mp-coupons>class-mp-coupons-addon.php
    1. in function cart_total change:

    //		$total = ( $total + (float) $cart->tax_total() + (float) $cart->shipping_total() );	// ema original
    // ema changed because setting "Tax inclusive" not correctly handled
    		if ( !mp_get_setting( 'tax->tax_inclusive' ) ) {		// ema changed
    			$total = ( $total + (float) $cart->tax_total()  );	// ema changed
    		}														// ema changed
    		$total = ( $total + (float) $cart->shipping_total());	// ema changed

    2. in function tax_total change:

    //		$cart_price = $total_pre * ( 1 + $tax_rate );		// ema original
    // ema changed because setting "Tax inclusive" not correctly handled
    		if ( mp_get_setting( 'tax->tax_inclusive' ) ) {		// ema changed
    			$cart_price = $total_pre;						// ema changed
    			$total_pre = $total_pre / (1 + $tax_rate);		// ema changed
    		} else {											// ema changed
    			$cart_price = $total_pre * ( 1 + $tax_rate );	// ema changed
    		}													// ema changed

    These changes make the cart correct, in case the setting tax->tax_inclusive is set.
    DISCLAIMER: I cannot guarantee that it works for all other combinations of tax settings. It seems to work for me for now (country Germany).

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.