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