mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Improved implementation of liability accounts and the option to add or remove accounts from the net-worth calculations.
This commit is contained in:
@@ -99,7 +99,13 @@ class CreateController extends Controller
|
||||
];
|
||||
|
||||
// pre fill some data
|
||||
$request->session()->flash('preFilled', ['currency_id' => $defaultCurrency->id]);
|
||||
$hasOldInput = null !== $request->old('_token');
|
||||
$request->session()->flash(
|
||||
'preFilled', [
|
||||
'currency_id' => $defaultCurrency->id,
|
||||
'include_net_worth' => $hasOldInput ? (bool)$request->old('include_net_worth') : true,
|
||||
]
|
||||
);
|
||||
|
||||
// put previous url in session if not redirect from store (not "create another").
|
||||
if (true !== session('accounts.create.fromStore')) {
|
||||
|
@@ -116,6 +116,11 @@ class EditController extends Controller
|
||||
$openingBalanceDate = $repository->getOpeningBalanceDate($account);
|
||||
$default = app('amount')->getDefaultCurrency();
|
||||
$currency = $this->currencyRepos->findNull((int)$repository->getMetaValue($account, 'currency_id'));
|
||||
|
||||
// include this account in net-worth charts?
|
||||
$includeNetWorth = $repository->getMetaValue($account, 'include_net_worth');
|
||||
$includeNetWorth = null === $includeNetWorth ? true : '1' === $includeNetWorth;
|
||||
|
||||
if (null === $currency) {
|
||||
$currency = $default;
|
||||
}
|
||||
@@ -133,6 +138,7 @@ class EditController extends Controller
|
||||
'openingBalance' => $openingBalanceAmount,
|
||||
'virtualBalance' => $account->virtual_balance,
|
||||
'currency_id' => $currency->id,
|
||||
'include_net_worth' => $includeNetWorth,
|
||||
'interest' => $repository->getMetaValue($account, 'interest'),
|
||||
'interest_period' => $repository->getMetaValue($account, 'interest_period'),
|
||||
'notes' => $this->repository->getNoteText($account),
|
||||
|
Reference in New Issue
Block a user