mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-25 06:51:08 +00:00
Various code cleanup.
This commit is contained in:
@@ -296,8 +296,8 @@ class PiggyBankController extends Controller
|
||||
Log::error('Cannot add ' . $amount . ' because canAddAmount returned false.');
|
||||
Session::flash(
|
||||
'error', strval(
|
||||
trans('firefly.cannot_add_amount_piggy', ['amount' => Amount::formatAnything($currency, $amount, false), 'name' => e($piggyBank->name)])
|
||||
)
|
||||
trans('firefly.cannot_add_amount_piggy', ['amount' => Amount::formatAnything($currency, $amount, false), 'name' => e($piggyBank->name)])
|
||||
)
|
||||
);
|
||||
|
||||
return redirect(route('piggy-banks.index'));
|
||||
@@ -312,12 +312,13 @@ class PiggyBankController extends Controller
|
||||
*/
|
||||
public function postRemove(Request $request, PiggyBankRepositoryInterface $repository, PiggyBank $piggyBank)
|
||||
{
|
||||
$amount = $request->get('amount');
|
||||
$amount = $request->get('amount');
|
||||
$currency = Amount::getDefaultCurrency();
|
||||
if ($repository->canRemoveAmount($piggyBank, $amount)) {
|
||||
$repository->removeAmount($piggyBank, $amount);
|
||||
Session::flash(
|
||||
'success', strval(trans('firefly.removed_amount_from_piggy', ['amount' => Amount::formatAnything($currency, $amount, false), 'name' => $piggyBank->name]))
|
||||
'success',
|
||||
strval(trans('firefly.removed_amount_from_piggy', ['amount' => Amount::formatAnything($currency, $amount, false), 'name' => $piggyBank->name]))
|
||||
);
|
||||
Preferences::mark();
|
||||
|
||||
@@ -326,7 +327,11 @@ class PiggyBankController extends Controller
|
||||
|
||||
$amount = strval(round($request->get('amount'), 12));
|
||||
|
||||
Session::flash('error', strval(trans('firefly.cannot_remove_from_piggy', ['amount' => Amount::formatAnything($currency, $amount, false), 'name' => e($piggyBank->name)])));
|
||||
Session::flash(
|
||||
'error', strval(
|
||||
trans('firefly.cannot_remove_from_piggy', ['amount' => Amount::formatAnything($currency, $amount, false), 'name' => e($piggyBank->name)])
|
||||
)
|
||||
);
|
||||
|
||||
return redirect(route('piggy-banks.index'));
|
||||
}
|
||||
|
Reference in New Issue
Block a user