Update available budgets code.

This commit is contained in:
James Cole
2024-12-30 10:51:34 +01:00
parent 760da08ab7
commit 62f4da6063
28 changed files with 65 additions and 61 deletions

View File

@@ -77,7 +77,7 @@ class CreateController extends Controller
$periods[$current] = (string) trans('firefly.repeat_freq_'.$current);
}
$subTitle = (string) trans('firefly.create_new_bill');
$defaultCurrency = app('amount')->getDefaultCurrency();
$defaultCurrency = $this->defaultCurrency;
// put previous url in session if not redirect from store (not "create another").
if (true !== session('bills.create.fromStore')) {

View File

@@ -85,11 +85,10 @@ class EditController extends Controller
$this->rememberPreviousUrl('bills.edit.url');
}
$currency = app('amount')->getDefaultCurrency();
$bill->amount_min = app('steam')->bcround($bill->amount_min, $currency->decimal_places);
$bill->amount_max = app('steam')->bcround($bill->amount_max, $currency->decimal_places);
$bill->amount_min = app('steam')->bcround($bill->amount_min, $bill->transactionCurrency->decimal_places);
$bill->amount_max = app('steam')->bcround($bill->amount_max, $bill->transactionCurrency->decimal_places);
$rules = $this->repository->getRulesForBill($bill);
$defaultCurrency = app('amount')->getDefaultCurrency();
$defaultCurrency = $this->defaultCurrency;
// code to handle active-checkboxes
$hasOldInput = null !== $request->old('_token');