Skip to content

Commit

Permalink
'up to' calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
shall0pass committed Mar 31, 2024
1 parent 270705b commit 2b07083
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/loot-core/src/server/budget/goals/goalsSimple.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export async function goalsSimple(
limit,
hold,
to_budget,
balance,
) {
// simple has 'monthly' and/or 'limit' params
if (template.limit != null) {
Expand All @@ -25,7 +26,7 @@ export async function goalsSimple(
const monthly = amountToInteger(template.monthly);
increment = monthly;
} else {
increment = limit;
increment = limit - balance;
}
to_budget += increment;
return { to_budget, errors, limit, limitCheck, hold };
Expand Down
1 change: 1 addition & 0 deletions packages/loot-core/src/server/budget/goaltemplates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,7 @@ async function applyCategoryTemplate(
limit,
hold,
to_budget,
balance,
);
to_budget = goalsReturn.to_budget;
errors = goalsReturn.errors;
Expand Down

0 comments on commit 2b07083

Please sign in to comment.