mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fix validate invoice_items on PHP v7.1
This commit is contained in:
parent
bb9fc4dfa4
commit
2c54bbfdf0
@ -204,8 +204,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 = ! empty($item['qty']) ? $item['qty'] : 1;
|
$qty = ! empty($item['qty']) ? Utils::parseFloat($item['qty']) : 1;
|
||||||
$cost = ! empty($item['cost']) ? $item['cost'] : 1;
|
$cost = ! empty($item['cost']) ? Utils::parseFloat($item['cost']) : 1;
|
||||||
$total += $qty * $cost;
|
$total += $qty * $cost;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user