GnuCash  4.12-558-g06612b8434
Macros | Functions
gnc-budget.h File Reference

GnuCash Budgets. More...

#include <glib.h>
#include "qof.h"
#include "Account.h"
#include "Recurrence.h"

Go to the source code of this file.


#define GNC_TYPE_BUDGET   (gnc_budget_get_type ())
#define GNC_BUDGET_NOTES_PATH   "notes"
#define gnc_budget_return_guid(X)   (X ? *(qof_entity_get_guid(QOF_INSTANCE(X))) : *(guid_null()))
#define gnc_budget_lookup_direct(g, b)   gnc_budget_lookup(&(g),(b))


GType gnc_budget_get_type (void)
gboolean gnc_budget_register (void)
GncBudget * gnc_budget_new (QofBook *book)
 Creates and initializes a Budget.
void gnc_budget_destroy (GncBudget *budget)
 Deletes the given budget object. More...
void gnc_budget_begin_edit (GncBudget *bgt)
void gnc_budget_commit_edit (GncBudget *bgt)
GncBudget * gnc_budget_clone (const GncBudget *budget)
 Clones a budget creating a copy.
const GncGUIDgnc_budget_get_guid (const GncBudget *budget)
void gnc_budget_set_name (GncBudget *budget, const gchar *name)
 Set/Get the name of the Budget.
const gchar * gnc_budget_get_name (const GncBudget *budget)
void gnc_budget_set_description (GncBudget *budget, const gchar *description)
 Set/Get the description of the Budget.
const gchar * gnc_budget_get_description (const GncBudget *budget)
void gnc_budget_set_num_periods (GncBudget *budget, guint num_periods)
 Set/Get the number of periods in the Budget.
guint gnc_budget_get_num_periods (const GncBudget *budget)
void gnc_budget_set_recurrence (GncBudget *budget, const Recurrence *r)
const Recurrencegnc_budget_get_recurrence (const GncBudget *budget)
time64 gnc_budget_get_period_start_date (const GncBudget *budget, guint period_num)
 Get the starting date of the Budget period.
time64 gnc_budget_get_period_end_date (const GncBudget *budget, guint period_num)
 Get the ending date of the Budget period.
void gnc_budget_set_account_period_value (GncBudget *budget, const Account *account, guint period_num, gnc_numeric val)
void gnc_budget_unset_account_period_value (GncBudget *budget, const Account *account, guint period_num)
gboolean gnc_budget_is_account_period_value_set (const GncBudget *budget, const Account *account, guint period_num)
gnc_numeric gnc_budget_get_account_period_value (const GncBudget *budget, const Account *account, guint period_num)
gnc_numeric gnc_budget_get_account_period_actual_value (const GncBudget *budget, Account *account, guint period_num)
void gnc_budget_set_account_period_note (GncBudget *budget, const Account *account, guint period_num, const gchar *note)
const gchar * gnc_budget_get_account_period_note (const GncBudget *budget, const Account *account, guint period_num)
GncBudget * gnc_budget_get_default (QofBook *book)
GncBudget * gnc_budget_lookup (const GncGUID *guid, const QofBook *book)

Detailed Description

GnuCash Budgets.

Design decisions:

Accounts with sub-accounts can have a value budgeted. For those accounts,

Option 1: when setting or getting budgeted values, the value is always exclusive of sub-account values. Pro: consistent values in all contexts. Con: no summary behavior.

Option 2: make setting only for account proper, but always report summaries. Con: value can change as soon as it is entered; forces entry from bottom-up.

Definition in file gnc-budget.h.