mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-18 23:50:09 +00:00
Update various pages, clean up some code.
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -123,10 +123,10 @@ class ReconcileController extends Controller
|
||||
Log::debug(sprintf('End balance: "%s"', $endBalance));
|
||||
Log::debug(sprintf('Cleared amount: "%s"', $clearedAmount));
|
||||
Log::debug(sprintf('Amount: "%s"', $amount));
|
||||
$difference = bcadd(bcadd(bcsub($startBalance, $endBalance), $clearedAmount), $amount);
|
||||
$difference = bcadd(bcadd(bcsub($startBalance ?? '0', $endBalance ?? '0'), $clearedAmount?? '0'), $amount);
|
||||
$diffCompare = bccomp($difference, '0');
|
||||
$countCleared = count($clearedJournals);
|
||||
$reconSum = bcadd(bcadd($startBalance, $amount), $clearedAmount);
|
||||
$reconSum = bcadd(bcadd($startBalance ?? '0', $amount ?? '0'), $clearedAmount ?? '0');
|
||||
|
||||
try {
|
||||
$view = view('accounts.reconcile.overview', compact('account', 'start', 'diffCompare', 'difference', 'end', 'clearedAmount', 'startBalance', 'endBalance', 'amount', 'route', 'countCleared', 'reconSum', 'selectedIds'))->render();
|
||||
|
||||
Reference in New Issue
Block a user