Skip to content

Commit

Permalink
allow partial fills of non-rollover
Browse files Browse the repository at this point in the history
  • Loading branch information
shall0pass committed Jan 28, 2024
1 parent 4684490 commit fbfee5b
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion packages/loot-core/src/server/budget/cleanup-template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,17 @@ async function processCleanup(month: string): Promise<Notification> {
month,
amount: to_budget,
});
} else if (
balance < 0 &&
!category.is_income &&
carryover.carryover === 0 &&
Math.abs(balance) > budgetAvailable
) {
await setBudget({
category: category.id,
month,
amount: budgeted + budgetAvailable,
});
}
}
const budgetAvailable = await getSheetValue(sheetName, `to-budget`);
Expand Down Expand Up @@ -130,7 +141,7 @@ async function processCleanup(month: string): Promise<Notification> {
balance < 0 &&
!category.is_income &&
carryover.carryover === 1 &&
Math.abs(balance) >= budgetAvailable
Math.abs(balance) > budgetAvailable
) {
await setBudget({
category: category.id,
Expand Down

0 comments on commit fbfee5b

Please sign in to comment.