mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-01-05 21:53:08 -06:00
Math fixes. Not bugs.
This commit is contained in:
parent
93b6c68938
commit
f38d38f139
@ -259,12 +259,13 @@ class PiggyBankController extends Controller
|
||||
public function postRemove(PiggyBankRepositoryInterface $repository, PiggyBank $piggyBank)
|
||||
{
|
||||
$amount = floatval(Input::get('amount'));
|
||||
bcscale(2);
|
||||
|
||||
$savedSoFar = $piggyBank->currentRelevantRep()->currentamount;
|
||||
|
||||
if ($amount <= $savedSoFar) {
|
||||
$repetition = $piggyBank->currentRelevantRep();
|
||||
$repetition->currentamount -= $amount;
|
||||
$repetition = $piggyBank->currentRelevantRep();
|
||||
$repetition->currentamount = bcsub($repetition->currentamount, $amount);
|
||||
$repetition->save();
|
||||
|
||||
// create event
|
||||
|
Loading…
Reference in New Issue
Block a user