mirror of
https://github.com/actualbudget/actual.git
synced 2026-03-09 03:32:54 -05:00
[Bug] Goals: Fix schedules 'in between' calculation (#1753)
* fix in between calculation * release note
This commit is contained in:
@@ -645,7 +645,12 @@ async function applyCategoryTemplate(
|
||||
let conditions = rule.serialize().conditions;
|
||||
let { date: dateConditions, amount: amountCondition } =
|
||||
extractScheduleConds(conditions);
|
||||
let target = -amountCondition.value;
|
||||
let target =
|
||||
amountCondition.op === 'isbetween'
|
||||
? -Math.round(
|
||||
amountCondition.value.num1 + amountCondition.value.num2,
|
||||
) / 2
|
||||
: -amountCondition.value;
|
||||
let next_date_string = getNextDate(
|
||||
dateConditions,
|
||||
monthUtils._parse(current_month),
|
||||
@@ -682,7 +687,7 @@ async function applyCategoryTemplate(
|
||||
monthUtils._parse(current_month),
|
||||
);
|
||||
while (next_date < next_month) {
|
||||
monthlyTarget += amountCondition.value;
|
||||
monthlyTarget += -target;
|
||||
next_date = monthUtils.addDays(next_date, 1);
|
||||
next_date = getNextDate(
|
||||
dateConditions,
|
||||
|
||||
6
upcoming-release-notes/1753.md
Normal file
6
upcoming-release-notes/1753.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
category: Bugfix
|
||||
authors: [shall0pass]
|
||||
---
|
||||
|
||||
Goals - Fix schedules 'in between' calculation
|
||||
Reference in New Issue
Block a user