mirror of
https://github.com/actualbudget/actual.git
synced 2026-04-28 01:58:40 -05:00
Goals: Up To Template calculation with negative category balance (#2535)
* 'up to' calculation * note * update to last months balance
This commit is contained in:
@@ -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;
|
||||
|
||||
6
upcoming-release-notes/2535.md
Normal file
6
upcoming-release-notes/2535.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
category: Bugfix
|
||||
authors: [shall0pass]
|
||||
---
|
||||
|
||||
Goal templates: Allow budgeting to a full category balance when using 'up to' and a negative category rollover balance.
|
||||
Reference in New Issue
Block a user