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:
parent
b55e18f2af
commit
1ef9c7037b
@ -175,7 +175,7 @@ class CreateInvoice extends Job
|
|||||||
$taxes = [];
|
$taxes = [];
|
||||||
|
|
||||||
if (empty($this->request['items'])) {
|
if (empty($this->request['items'])) {
|
||||||
return [$sub_total, $taxes];
|
return [$sub_total, $discount_amount_total, $taxes];
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ((array) $this->request['items'] as $item) {
|
foreach ((array) $this->request['items'] as $item) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user