Skip to content
Snippets Groups Projects
Unverified Commit 1dd1c188 authored by shall0pass's avatar shall0pass Committed by GitHub
Browse files

Goals: Up To Template calculation with negative category balance (#2535)

* 'up to' calculation

* note

* update to last months balance
parent 8f634099
No related branches found
No related tags found
No related merge requests found
......@@ -8,6 +8,7 @@ export async function goalsSimple(
limit,
hold,
to_budget,
last_month_balance,
) {
// simple has 'monthly' and/or 'limit' params
if (template.limit != null) {
......@@ -25,7 +26,7 @@ export async function goalsSimple(
const monthly = amountToInteger(template.monthly);
increment = monthly;
} else {
increment = limit;
increment = limit - last_month_balance;
}
to_budget += increment;
return { to_budget, errors, limit, limitCheck, hold };
......
......@@ -513,6 +513,7 @@ async function applyCategoryTemplate(
limit,
hold,
to_budget,
last_month_balance,
);
to_budget = goalsReturn.to_budget;
errors = goalsReturn.errors;
......
---
category: Bugfix
authors: [shall0pass]
---
Goal templates: Allow budgeting to a full category balance when using 'up to' and a negative category rollover balance.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment