mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-15 16:57:09 +00:00
Fix #2543
This commit is contained in:
@@ -434,17 +434,22 @@ class BillController extends Controller
|
||||
if (false === $bill['active']) {
|
||||
continue;
|
||||
}
|
||||
if (0 === count($bill['pay_dates'])) {
|
||||
continue;
|
||||
}
|
||||
/** @var TransactionCurrency $currency */
|
||||
$currencyId = $bill['currency_id'];
|
||||
$sums[$currencyId] = $sums[$currencyId] ?? [
|
||||
$currencyId = $bill['currency_id'];
|
||||
$sums[$currencyId] = $sums[$currencyId] ?? [
|
||||
'currency_id' => $currencyId,
|
||||
'currency_code' => $bill['currency_code'],
|
||||
'currency_name' => $bill['currency_name'],
|
||||
'currency_symbol' => $bill['currency_symbol'],
|
||||
'currency_decimal_places' => $bill['currency_decimal_places'],
|
||||
'avg' => '0',
|
||||
'avg' => '0',
|
||||
];
|
||||
$avg = bcdiv(bcadd((string)$bill['amount_min'], (string)$bill['amount_max']), '2');
|
||||
|
||||
$avg = bcdiv(bcadd((string)$bill['amount_min'], (string)$bill['amount_max']), '2');
|
||||
$avg = bcmul($avg, (string)count($bill['pay_dates']));
|
||||
$sums[$currencyId]['avg'] = bcadd($sums[$currencyId]['avg'], $avg);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user