Invoice & Bill add discount style change

This commit is contained in:
cuneytsenturk
2018-04-28 18:43:43 +03:00
parent ac9cd85394
commit 34c869b0cf
8 changed files with 260 additions and 24 deletions

View File

@ -290,10 +290,16 @@ class Items extends Controller
$json->sub_total = money($sub_total, $currency_code, true)->format();
$json->discount_text= trans('invoices.add_discount');
$json->discount_total = '';
$json->tax_total = money($tax_total, $currency_code, true)->format();
// Apply discount to total
if ($discount) {
$json->discount_text= trans('invoices.show_discount', ['discount' => $discount]);
$json->discount_total = money($sub_total * ($discount / 100), $currency_code, true)->format();
$sub_total = $sub_total - ($sub_total * ($discount / 100));
}