mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-24 22:48:18 +00:00
Reformat various code.
This commit is contained in:
@@ -76,18 +76,18 @@ class BillController extends Controller
|
||||
|
||||
$chartData = [];
|
||||
$currencies = [];
|
||||
$paid = $repository->getBillsPaidInRangePerCurrency($start, $end); // will be a negative amount.
|
||||
$paid = $repository->getBillsPaidInRangePerCurrency($start, $end); // will be a negative amount.
|
||||
$unpaid = $repository->getBillsUnpaidInRangePerCurrency($start, $end); // will be a positive amount.
|
||||
|
||||
foreach ($paid as $currencyId => $amount) {
|
||||
$currencies[$currencyId] = $currencies[$currencyId] ?? $currencyRepository->find($currencyId);
|
||||
$label = (string)trans('firefly.paid_in_currency', ['currency' => $currencies[$currencyId]->name]);
|
||||
$label = (string) trans('firefly.paid_in_currency', ['currency' => $currencies[$currencyId]->name]);
|
||||
$chartData[$label] = ['amount' => $amount, 'currency_symbol' => $currencies[$currencyId]->symbol,
|
||||
'currency_code' => $currencies[$currencyId]->code];
|
||||
}
|
||||
foreach ($unpaid as $currencyId => $amount) {
|
||||
$currencies[$currencyId] = $currencies[$currencyId] ?? $currencyRepository->find($currencyId);
|
||||
$label = (string)trans('firefly.unpaid_in_currency', ['currency' => $currencies[$currencyId]->name]);
|
||||
$label = (string) trans('firefly.unpaid_in_currency', ['currency' => $currencies[$currencyId]->name]);
|
||||
$chartData[$label] = ['amount' => $amount, 'currency_symbol' => $currencies[$currencyId]->symbol,
|
||||
'currency_code' => $currencies[$currencyId]->code];
|
||||
}
|
||||
@@ -136,16 +136,16 @@ class BillController extends Controller
|
||||
);
|
||||
|
||||
$chartData = [
|
||||
['type' => 'line', 'label' => (string)trans('firefly.min-amount'), 'currency_symbol' => $bill->transactionCurrency->symbol,
|
||||
['type' => 'line', 'label' => (string) trans('firefly.min-amount'), 'currency_symbol' => $bill->transactionCurrency->symbol,
|
||||
'currency_code' => $bill->transactionCurrency->code, 'entries' => []],
|
||||
['type' => 'line', 'label' => (string)trans('firefly.max-amount'), 'currency_symbol' => $bill->transactionCurrency->symbol,
|
||||
['type' => 'line', 'label' => (string) trans('firefly.max-amount'), 'currency_symbol' => $bill->transactionCurrency->symbol,
|
||||
'currency_code' => $bill->transactionCurrency->code, 'entries' => []],
|
||||
['type' => 'bar', 'label' => (string)trans('firefly.journal-amount'), 'currency_symbol' => $bill->transactionCurrency->symbol,
|
||||
['type' => 'bar', 'label' => (string) trans('firefly.journal-amount'), 'currency_symbol' => $bill->transactionCurrency->symbol,
|
||||
'currency_code' => $bill->transactionCurrency->code, 'entries' => []],
|
||||
];
|
||||
|
||||
foreach ($journals as $journal) {
|
||||
$date = $journal['date']->isoFormat((string)trans('config.month_and_day_js', [], $locale));
|
||||
$date = $journal['date']->isoFormat((string) trans('config.month_and_day_js', [], $locale));
|
||||
$chartData[0]['entries'][$date] = $bill->amount_min; // minimum amount of bill
|
||||
$chartData[1]['entries'][$date] = $bill->amount_max; // maximum amount of bill
|
||||
|
||||
|
Reference in New Issue
Block a user