mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 00:54:29 -04:00
Fix for tests
This commit is contained in:
parent
d2cf9b2fbe
commit
7beb6a7f34
@ -191,8 +191,8 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
Validator::extend('valid_invoice_items', function($attribute, $value, $parameters) {
|
Validator::extend('valid_invoice_items', function($attribute, $value, $parameters) {
|
||||||
$total = 0;
|
$total = 0;
|
||||||
foreach ($value as $item) {
|
foreach ($value as $item) {
|
||||||
$qty = isset($item['qty']) ? $item['qty'] : 1;
|
$qty = !empty($item['qty']) ? $item['qty'] : 1;
|
||||||
$cost = isset($item['cost']) ? $item['cost'] : 1;
|
$cost = !empty($item['cost']) ? $item['cost'] : 1;
|
||||||
$total += $qty * $cost;
|
$total += $qty * $cost;
|
||||||
}
|
}
|
||||||
return $total <= MAX_INVOICE_AMOUNT;
|
return $total <= MAX_INVOICE_AMOUNT;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user