mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-13 07:53:16 +00:00
This fixes #344
This commit is contained in:
@@ -200,6 +200,10 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface
|
|||||||
// remove money from the rep.
|
// remove money from the rep.
|
||||||
$repetition = $piggyBank->currentRelevantRep();
|
$repetition = $piggyBank->currentRelevantRep();
|
||||||
if ($repetition->currentamount > $piggyBank->targetamount) {
|
if ($repetition->currentamount > $piggyBank->targetamount) {
|
||||||
|
|
||||||
|
$diff = bcsub($piggyBank->targetamount, $repetition->currentamount);
|
||||||
|
$this->createEvent($piggyBank, $diff);
|
||||||
|
|
||||||
$repetition->currentamount = $piggyBank->targetamount;
|
$repetition->currentamount = $piggyBank->targetamount;
|
||||||
$repetition->save();
|
$repetition->save();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user