Fixed a bug where the bill chart and boxes would inaccurately reflect the amount of bills yet to pay.

This commit is contained in:
James Cole 2015-04-10 06:52:36 +02:00
parent d3f642551d
commit 2ef7a01945
2 changed files with 3 additions and 3 deletions

View File

@ -302,7 +302,7 @@ class GoogleChartController extends Controller
/** @var Bill $entry */ /** @var Bill $entry */
foreach ($unpaid as $entry) { foreach ($unpaid as $entry) {
$unpaidDescriptions[] = $entry[0]->name . ' (' . $entry[1]->format('jS M Y') . ')'; $unpaidDescriptions[] = $entry[0]->name . ' (' . $entry[1]->format('jS M Y') . ')';
$unpaidAmount += ($entry[0]->amount_max + $entry[0]->amount_min / 2); $unpaidAmount += ($entry[0]->amount_max + $entry[0]->amount_min) / 2;
} }
$chart->addRow('Unpaid: ' . join(', ', $unpaidDescriptions), $unpaidAmount); $chart->addRow('Unpaid: ' . join(', ', $unpaidDescriptions), $unpaidAmount);

View File

@ -70,6 +70,7 @@ class JsonController extends Controller
} }
} }
} }
unset($bill, $range, $ranges);
$creditCards = $accountRepository->getCreditCards(); $creditCards = $accountRepository->getCreditCards();
foreach ($creditCards as $creditCard) { foreach ($creditCards as $creditCard) {
@ -86,8 +87,7 @@ class JsonController extends Controller
// loop unpaid: // loop unpaid:
/** @var Bill $entry */ /** @var Bill $entry */
foreach ($unpaid as $entry) { foreach ($unpaid as $entry) {
$unpaidDescriptions[] = $entry[0]->name . ' (' . $entry[1]->format('jS M Y') . ')'; $amount += ($entry[0]->amount_max + $entry[0]->amount_min) / 2;
$amount += ($entry[0]->amount_max + $entry[0]->amount_min / 2);
} }
break; break;