mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-09 12:42:36 +01: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) {
|
||||
$total = 0;
|
||||
foreach ($value as $item) {
|
||||
$qty = ! empty($item['qty']) ? $item['qty'] : 1;
|
||||
$cost = ! empty($item['cost']) ? $item['cost'] : 1;
|
||||
$qty = ! empty($item['qty']) ? Utils::parseFloat($item['qty']) : 1;
|
||||
$cost = ! empty($item['cost']) ? Utils::parseFloat($item['cost']) : 1;
|
||||
$total += $qty * $cost;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user