I think you mean the discount for each item in invoice/quote. For invoices you must change following lines in application/modules/invoices/models/mdl_item_amounts.php :
$item_subtotal = $item->item_quantity * $item->item_price;
//$item_tax_total = $item_subtotal * ($item->item_tax_rate_percent / 100);
$item_discount_total = $item->item_discount_amount * $item->item_quantity;
$item_tax_total = ($item_subtotal - $item_discount_total) * ($item->item_tax_rate_percent / 100);
$item_total = $item_subtotal + $item_tax_total - $item_discount_total;
And the same way for quotes in application/modules/quotes/models/mdl_quote_item_amounts.php :
$item_subtotal = $item->item_quantity * $item_price;
// $item_tax_total = $item_subtotal * ($item->item_tax_rate_percent / 100);
$item_discount_total = $item->item_discount_amount * $item->item_quantity;
$item_tax_total = ($item_subtotal - $item_discount_total)* ($item->item_tax_rate_percent / 100);
$item_total = $item_subtotal + $item_tax_total - $item_discount_total;
Short solution:
- Delete/comment old line for $item_tax_total
- Calculate $item_discount_total first
- Substract $item_discount_total first from $item_subtotal and than calculate $item_tax_total
@Kovah May you patch this issue in next version?