• Resolved aviator737

    (@aviator737)


    hi,

    I have 1 item which i sell for 10usd including tax, vat is set for 25% so the price is 8excluding vat.

    however once the invoice comes the plugin makes up weird numbers.. like 6,5usd unitprice.. the vat of 2usd is correct and the total sum is always 10, so its also correct but the raw price excl vat is wrong and i don’t know why, its correct in woo commerce..

    Now its like

    Sum 6,5
    Vat 2,0
    Total 10,0

    Should be sum 8,0..

    Any ideas?

    thanks

    https://ww.wp.xz.cn/plugins/woocommerce-pdf-invoices/

Viewing 2 replies - 1 through 2 (of 2 total)
  • I have the same problem. Have you found a solution?
    Thx

    OK. I think I have found the problem, but you try it entirely at your own risk as I do not code for a living and have VERY LITTLE experience with WordPress.

    I think the problem lies with one of the WooCommerce functions being used. The code for this plugin obtains (or thinks it is obtaining) a price including tax, but one of the parameters appears to be incorrectly set.

    The simplest way to resolve this is to go to the plugin editor (Plugins->Editor) and select the pdf invoice plugin (WooCommerce PDF Invoices). Then, select the woocommerce-pdf-invoices/includes/class-invoice.php file. Then search for the following line:

    $item_unit_price_incl_tax = $order->get_item_subtotal($item, false, false);

    This line is the troublemaker in my view. If you change the first “false” to “true”, you get the right result. So, the line should look this:

    $item_unit_price_incl_tax = $order->get_item_subtotal($item, true, false);

    Again, my caveats – I have not tested this exhaustively and I do not know if this change has any “knock on” effects on the rest of the plug-in. However, for me, it has solved the problem.

    Good luck!!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘the sum is wrong’ is closed to new replies.