Update various pages, clean up some code.

This commit is contained in:
James Cole
2024-12-26 09:16:17 +01:00
parent d313f5fdf5
commit 06049a9a28
8 changed files with 58 additions and 56 deletions

View File

@@ -76,7 +76,6 @@ class IndexController extends Controller
$collection = $this->repository->getBills();
$total = $collection->count();
$defaultCurrency = app('amount')->getDefaultCurrency();
$parameters = new ParameterBag();
// sub one day from temp start so the last paid date is one day before it should be.
$tempStart = clone $start;
@@ -84,7 +83,8 @@ class IndexController extends Controller
// $tempStart->subDay();
$parameters->set('start', $tempStart);
$parameters->set('end', $end);
$parameters->set('convertToNative', $this->convertToNative);
$parameters->set('defaultCurrency', $this->defaultCurrency);
/** @var BillTransformer $transformer */
$transformer = app(BillTransformer::class);
$transformer->setParameters($parameters);
@@ -112,7 +112,7 @@ class IndexController extends Controller
'bills' => [],
];
$currency = $bill->transactionCurrency ?? $defaultCurrency;
$currency = $bill->transactionCurrency ?? $this->defaultCurrency;
$array['currency_id'] = $currency->id;
$array['currency_name'] = $currency->name;
$array['currency_symbol'] = $currency->symbol;
@@ -122,7 +122,6 @@ class IndexController extends Controller
$array['rules'] = $rules[$bill['id']] ?? [];
$bills[$groupOrder]['bills'][] = $array;
}
// order by key
ksort($bills);