Expected Behaviour:
In line items, $item->item_subtotal should contain the final cost of the item, taking into account any taxes and discounts for the item.
Actual Behaviour:
$item->item_subtotal does not include the item discount.
Workaround:
This is possible to fix in the template by changing: <?php echo format_currency($item->item_subtotal); ?>
to: <?php echo format_currency($item->item_subtotal - $item->item_discount); ?>
but that won’t actually solve the real problem: that $item->item_subtotal is wrong.
And…
The calculation of the tax is not right on the invoice screen and the invoice template when you have a discount applied.
I think in the file application/modules/invoices/models/mdt_items_amounts.php the order of the calculation is not right.
And a extra calcutation has to be added.
With this code the invoice screen and the template are showing the correct data.
EDIT: for the standard InvoicePlane invoice template to work correct, you have to change the itemtotal to: