Commit Graph

3 Commits

Author SHA1 Message Date
Christopher Lam
05ffd3d4eb [budget-feature] move unset_feature call to gnc_budget_gui_delete_budget
because gnc_budget_gui_delete_budget is a more general function to
delete a budget.
2022-10-31 12:03:58 +08:00
Christopher Lam
f7ee644695 Amendment to 73822f97a [1/2] use heuristics to scrub budget signs
Testing income<0 to conclude "none reversal" is likely a more sound
strategy than testing liability>0.
2022-01-04 08:25:02 +08:00
Christopher Lam
73822f97a9 [1/2][Scrubbudget.c] use heuristics to scrub budget signs
If book has budgets, and GNC_FEATURE_BUDGET_UNREVERSED isn't set,
check and fix budget amount signs. Previously budgets were created
with assumption that sign reversal was set to credit amounts. A
heuristic approach is used:

- if budgeted expense is negative, conclude sign reversal is
"Income and Expense"

- if budgeted liability is positive, conclude sign reversal is
"None"

- otherwise conclude sign reversal is "Credit Accounts"

The above is calibrated to (hopefully) prefer sign reversal of Credit
Accounts.
2021-12-03 17:40:21 +08:00