Extend invoices and invoice items to keep more information.

This commit is contained in:
2025-01-31 13:04:59 +01:00
parent e2240c017d
commit d8afe4960e
20 changed files with 1475 additions and 640 deletions

View File

@@ -43,8 +43,8 @@ class EController extends Controller
if (!isset($taxes[$item->tax])) {
$taxes[$item->tax] = ['tax' => 0, 'taxable' => 0];
}
$taxes[$item->tax]['tax'] += round($item->price * $item->amount * $item->tax / 100, 2, PHP_ROUND_HALF_UP);
$taxes[$item->tax]['taxable'] += $item->price * $item->amount;
$taxes[$item->tax]['tax'] += round($item->price * $item->amount * ($item->tax / 100) * (100 - $item->discount) / 100, 2, PHP_ROUND_HALF_UP);
$taxes[$item->tax]['taxable'] += $item->price * $item->amount * (100 - $item->discount) / 100;
}
return $taxes;