mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
[budgets.c] handle both natural & reversed signs budgets
introduce new API * gnc_using_unreversed_budgets - queries book's unreversed feature * gnc_reverse_budget_balance - check if book unreversal status matches 2nd argument. if so, return account's reversal status. else, return FALSE. * gnome-budget-view can now show both natural and reversed budgets * gnome-plugin-page-budget will now read&write both natural and reversed budgets.
This commit is contained in:
@@ -179,6 +179,23 @@ gnc_reverse_balance (const Account *account)
|
||||
return reverse_type[type];
|
||||
}
|
||||
|
||||
gboolean gnc_using_unreversed_budgets (QofBook* book)
|
||||
{
|
||||
return gnc_features_check_used (book, GNC_FEATURE_BUDGET_UNREVERSED);
|
||||
}
|
||||
|
||||
/* similar to gnc_reverse_balance but also accepts a gboolean
|
||||
unreversed which specifies the reversal strategy - FALSE = pre-4.x
|
||||
always-assume-credit-accounts, TRUE = all amounts unreversed */
|
||||
gboolean
|
||||
gnc_reverse_budget_balance (const Account *account, gboolean unreversed)
|
||||
{
|
||||
if (unreversed == gnc_using_unreversed_budgets(gnc_account_get_book(account)))
|
||||
return gnc_reverse_balance (account);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
gchar *
|
||||
gnc_get_default_directory (const gchar *section)
|
||||
|
||||
Reference in New Issue
Block a user