Skip to content

Commit

Permalink
fix: adding discount_amounth_total for empty items on invoice creation
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
reatile committed Apr 1, 2020
1 parent b55e18f commit 1ef9c70
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Jobs/Sale/CreateInvoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ protected function createItems()
$taxes = [];

if (empty($this->request['items'])) {
return [$sub_total, $taxes];
return [$sub_total, $discount_amount_total, $taxes];
}

foreach ((array) $this->request['items'] as $item) {
Expand Down

0 comments on commit 1ef9c70

Please sign in to comment.