mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Fixed a bug where the associated total amount for a bar would be too high.
This commit is contained in:
parent
743deb4227
commit
fd6e7fc1ab
@ -95,9 +95,12 @@ class RepeatedExpense implements CUD, CommonDatabaseCalls, PiggybankInterface
|
||||
$amountPerBar = floatval($piggyBank->targetamount) / $parts;
|
||||
$cumulative = $amountPerBar;
|
||||
/** @var PiggybankPart $bar */
|
||||
foreach ($bars as $bar) {
|
||||
foreach ($bars as $index => $bar) {
|
||||
$bar->setAmountPerBar($amountPerBar);
|
||||
$bar->setCumulativeAmount($cumulative);
|
||||
if($parts -1 == $index) {
|
||||
$bar->setCumulativeAmount($piggyBank->targetamount);
|
||||
}
|
||||
|
||||
$reminder = $piggyBank->reminders()
|
||||
->where('startdate', $bar->getStartdate()->format('Y-m-d'))
|
||||
|
Loading…
Reference in New Issue
Block a user