float > string.

This commit is contained in:
James Cole 2016-02-08 21:09:00 +01:00
parent 7679721007
commit 905ae3437b

View File

@ -168,7 +168,7 @@ class PiggyBankController extends Controller
/** @var Collection $piggyBanks */ /** @var Collection $piggyBanks */
$piggyBanks = $piggyRepository->getPiggyBanks(); $piggyBanks = $piggyRepository->getPiggyBanks();
/** @var Carbon $end */ /** @var Carbon $end */
$end = session('end', Carbon::now()->endOfMonth()); $end = session('end', Carbon::now()->endOfMonth());
bcscale(2); bcscale(2);
$accounts = []; $accounts = [];
@ -229,7 +229,7 @@ class PiggyBankController extends Controller
public function postAdd(PiggyBankRepositoryInterface $repository, ARI $accounts, PiggyBank $piggyBank) public function postAdd(PiggyBankRepositoryInterface $repository, ARI $accounts, PiggyBank $piggyBank)
{ {
bcscale(2); bcscale(2);
$amount = round(Input::get('amount'), 2); $amount = round(Input::get('amount'), 2);
/** @var Carbon $date */ /** @var Carbon $date */
$date = session('end', Carbon::now()->endOfMonth()); $date = session('end', Carbon::now()->endOfMonth());
$leftOnAccount = $accounts->leftOnAccount($piggyBank->account, $date); $leftOnAccount = $accounts->leftOnAccount($piggyBank->account, $date);
@ -274,7 +274,7 @@ class PiggyBankController extends Controller
$repetition->save(); $repetition->save();
// create event // create event
$repository->createEvent($piggyBank, $amount * -1); $repository->createEvent($piggyBank, bcmul($amount, '-1'));
Session::flash('success', 'Removed ' . Amount::format($amount, false) . ' from "' . e($piggyBank->name) . '".'); Session::flash('success', 'Removed ' . Amount::format($amount, false) . ' from "' . e($piggyBank->name) . '".');
Preferences::mark(); Preferences::mark();