fix: adding discount_amounth_total for empty items on invoice creation

This fixes an error where if you delete the first [default and oly] row when creating a new invoice and save a Flash message of "Undefined offset 2" is returned.
This commit is contained in:
Reatile Tshikalange 2020-04-01 02:19:26 +02:00
parent b55e18f2af
commit 1ef9c7037b

View File

@ -175,7 +175,7 @@ class CreateInvoice extends Job
$taxes = [];
if (empty($this->request['items'])) {
return [$sub_total, $taxes];
return [$sub_total, $discount_amount_total, $taxes];
}
foreach ((array) $this->request['items'] as $item) {