Merge branch 'maint'

This commit is contained in:
Christopher Lam
2019-12-08 20:34:49 +08:00
17 changed files with 201 additions and 82 deletions

View File

@@ -51,6 +51,7 @@
#include "Account.h"
#include "Transaction.h"
#include "gnc-engine.h"
#include "gnc-features.h"
#include "gnc-euro.h"
#include "gnc-hooks.h"
#include "gnc-locale-tax.h"
@@ -178,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)