45 #ifndef XACC_ACCOUNT_H
46 #define XACC_ACCOUNT_H
55 gboolean include_children);
60 typedef void (*AccountCb)(
Account *a, gpointer data);
61 typedef gpointer (*AccountCb2)(
Account *a, gpointer data);
69 #define GNC_TYPE_ACCOUNT (gnc_account_get_type ())
70 #define GNC_ACCOUNT(o) \
71 (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_ACCOUNT, Account))
72 #define GNC_ACCOUNT_CLASS(k) \
73 (G_TYPE_CHECK_CLASS_CAST((k), GNC_TYPE_ACCOUNT, AccountClass))
74 #define GNC_IS_ACCOUNT(o) \
75 (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_ACCOUNT))
76 #define GNC_IS_ACCOUNT_CLASS(k) \
77 (G_TYPE_CHECK_CLASS_TYPE ((k), GNC_TYPE_ACCOUNT))
78 #define GNC_ACCOUNT_GET_CLASS(o) \
79 (G_TYPE_INSTANCE_GET_CLASS ((o), GNC_TYPE_ACCOUNT, AccountClass))
206 gboolean check_guids);
231 gunichar gnc_get_account_separator (
void);
232 void gnc_set_account_separator (
const gchar *separator);
239 #define xaccAccountGetGUID(X) qof_entity_get_guid(QOF_INSTANCE(X))
240 #define xaccAccountReturnGUID(X) (X ? *(qof_entity_get_guid(QOF_INSTANCE(X))) : *(guid_null()))
246 #define xaccAccountLookupDirect(g,b) xaccAccountLookup(&(g),b)
451 gboolean default_value);
562 gnc_numeric xaccAccountConvertBalanceToCurrencyAsOfDate(
571 gboolean include_children);
572 gnc_numeric xaccAccountGetClearedBalanceInCurrency (
574 gboolean include_children);
575 gnc_numeric xaccAccountGetReconciledBalanceInCurrency (
577 gboolean include_children);
578 gnc_numeric xaccAccountGetPresentBalanceInCurrency (
580 gboolean include_children);
581 gnc_numeric xaccAccountGetProjectedMinimumBalanceInCurrency (
583 gboolean include_children);
587 gnc_numeric xaccAccountGetBalanceAsOfDateInCurrency(
589 gboolean include_children);
801 AccountCb func, gpointer user_data);
817 AccountCb func, gpointer user_data);
835 AccountCb2 func, gpointer user_data);
972 #define xaccAccountInsertSplit(acc, s) xaccSplitSetAccount((s), (acc))
1030 TransactionCallback proc,
1035 const char *description);
1039 const char *description);
1074 gpointer (*proc)(
GNCLot *lot, gpointer user_data), gpointer user_data);
1083 gboolean (*match_func)(
GNCLot *lot,
1084 gpointer user_data),
1085 gpointer user_data, GCompareFunc sort_func);
1101 int *months,
int *days);
1104 int months,
int days);
1320 TransactionCallback thunk,
1338 TransactionCallback thunk,
1373 TransactionCallback proc,
void *data);
1415 #define ACCOUNT_KVP "kvp"
1416 #define ACCOUNT_NAME_ "name"
1417 #define ACCOUNT_CODE_ "code"
1418 #define ACCOUNT_DESCRIPTION_ "desc"
1419 #define ACCOUNT_COLOR_ "color"
1420 #define ACCOUNT_FILTER_ "filter"
1421 #define ACCOUNT_SORT_ORDER_ "sort-order"
1422 #define ACCOUNT_NOTES_ "notes"
1423 #define ACCOUNT_BALANCE_ "balance"
1424 #define ACCOUNT_CLEARED_ "cleared"
1425 #define ACCOUNT_RECONCILED_ "reconciled"
1426 #define ACCOUNT_PRESENT_ "present"
1427 #define ACCOUNT_FUTURE_MINIMUM_ "future-minimum"
1428 #define ACCOUNT_TAX_RELATED "tax-related-p"
1429 #define ACCOUNT_TYPE_ "account-type"
1430 #define ACCOUNT_SCU "smallest-commodity-unit"
1431 #define ACCOUNT_NSCU "non-standard-scu"
1432 #define ACCOUNT_PARENT "parent-account"
1438 #define ACCOUNT_MATCH_ALL_TYPE "account-match-all"
void xaccAccountSetType(Account *account, GNCAccountType)
Account * gnc_account_get_parent(const Account *account)
void xaccAccountSetFilter(Account *account, const char *filter)
void xaccAccountSetSortOrder(Account *account, const char *sortorder)
gint xaccAccountForEachTransaction(const Account *account, TransactionCallback proc, void *data)
int xaccAccountTreeForEachTransaction(Account *acc, TransactionCallback proc, void *data)
int gnc_account_tree_staged_transaction_traversal(const Account *account, unsigned int stage, TransactionCallback thunk, void *data)
const char * xaccAccountGetLastNum(const Account *account)
void gnc_account_append_child(Account *new_parent, Account *child)
gpointer xaccAccountForEachLot(const Account *acc, gpointer(*proc)(GNCLot *lot, gpointer user_data), gpointer user_data)
GList * gnc_account_get_descendants_sorted(const Account *account)
gint gnc_account_n_descendants(const Account *account)
gint64 xaccAccountGetTaxUSCopyNumber(const Account *account)
gboolean gnc_account_is_root(const Account *account)
SplitList * xaccAccountGetSplitList(const Account *account)
gboolean xaccAccountGetNonStdSCU(const Account *account)
int xaccAccountGetCommoditySCUi(const Account *account)
gnc_commodity * DxaccAccountGetCurrency(const Account *account)
void gnc_account_foreach_descendant(const Account *account, AccountCb func, gpointer user_data)
void xaccAccountSetNotes(Account *account, const char *notes)
gboolean xaccAccountIsPriced(const Account *acc)
const char * xaccAccountGetFilter(const Account *account)
GNCAccountType xaccAccountGetType(const Account *account)
void xaccAccountSetMark(Account *account, short mark)
int xaccAccountGetCommoditySCU(const Account *account)
const char * xaccAccountGetCode(const Account *account)
void xaccAccountSetReconcileLastDate(Account *account, time64 last_date)
Account * gnc_account_create_root(QofBook *book)
void xaccAccountSetTaxRelated(Account *account, gboolean tax_related)
void xaccAccountSortSplits(Account *acc, gboolean force)
void xaccAccountSetCode(Account *account, const char *code)
gpointer gnc_account_foreach_descendant_until(const Account *account, AccountCb2 func, gpointer user_data)
void gnc_account_set_policy(Account *account, GNCPolicy *policy)
void xaccAccountSetReconcileLastInterval(Account *account, int months, int days)
gboolean gnc_account_remove_split(Account *acc, Split *s)
guint32 xaccAccountTypesValid(void)
const char * xaccAccountTypeEnumAsString(GNCAccountType type)
GList * gnc_account_list_name_violations(QofBook *book, const gchar *separator)
void xaccAccountInsertLot(Account *, GNCLot *)
void xaccAccountMoveAllSplits(Account *accfrom, Account *accto)
void gnc_account_set_sort_dirty(Account *acc)
void xaccAccountSetLastNum(Account *account, const char *num)
gnc_numeric xaccAccountGetClearedBalance(const Account *account)
gboolean xaccAccountGetReconcilePostponeDate(const Account *account, time64 *postpone_date)
void xaccAccountDestroy(Account *account)
gboolean xaccAccountIsHidden(const Account *acc)
Account * gnc_account_lookup_by_name(const Account *parent, const char *name)
void gnc_account_remove_child(Account *parent, Account *child)
int xaccAccountOrder(const Account *account_1, const Account *account_2)
const char * xaccAccountGetColor(const Account *account)
Split * xaccAccountFindSplitByDesc(const Account *account, const char *description)
gboolean xaccAccountIsAssetLiabType(GNCAccountType t)
void xaccClearMarkDown(Account *account, short val)
GNCAccountType xaccAccountStringToEnum(const char *str)
gchar * gnc_account_get_full_name(const Account *account)
void xaccAccountSetPlaceholder(Account *account, gboolean val)
gboolean xaccAccountTypesCompatible(GNCAccountType parent_type, GNCAccountType child_type)
gchar * gnc_account_name_violations_errmsg(const gchar *separator, GList *invalid_account_names)
gboolean xaccTransactionTraverse(Transaction *trans, int stage)
void xaccAccountSetColor(Account *account, const char *color)
Transaction * xaccAccountFindTransByDesc(const Account *account, const char *description)
void gnc_account_set_balance_dirty(Account *acc)
void gnc_account_foreach_child(const Account *account, AccountCb func, gpointer user_data)
Account * gnc_account_lookup_by_code(const Account *parent, const char *code)
void gnc_account_tree_begin_staged_transaction_traversals(Account *acc)
void dxaccAccountSetPriceSrc(Account *account, const char *src)
void xaccAccountBeginStagedTransactionTraversals(const Account *account)
Implement Accounting Policy.
GNCPlaceholderType xaccAccountGetDescendantPlaceholder(const Account *account)
const char * xaccAccountGetDescription(const Account *account)
void gnc_account_set_start_reconciled_balance(Account *acc, const gnc_numeric start_baln)
const char * dxaccAccountGetQuoteTZ(const Account *account)
GType gnc_account_get_type(void)
void xaccAccountClearReconcilePostpone(Account *account)
const char * xaccAccountGetTaxUSPayerNameSource(const Account *account)
void xaccSplitsBeginStagedTransactionTraversals(SplitList *splits)
GList * gnc_account_get_children_sorted(const Account *account)
LotList * xaccAccountGetLotList(const Account *account)
void xaccAccountRecomputeBalance(Account *)
Account * gnc_account_lookup_by_full_name(const Account *any_account, const gchar *name)
void xaccAccountSetReconcilePostponeDate(Account *account, time64 postpone_date)
const char * xaccAccountGetTaxUSCode(const Account *account)
gboolean xaccAccountIsAPARType(GNCAccountType t)
gboolean xaccAccountStringToType(const char *str, GNCAccountType *type)
void xaccAccountSetReconcilePostponeBalance(Account *account, gnc_numeric balance)
gboolean xaccAccountEqual(const Account *a, const Account *b, gboolean check_guids)
gboolean xaccAccountGetTaxRelated(const Account *account)
void gnc_account_set_start_cleared_balance(Account *acc, const gnc_numeric start_baln)
Account * xaccCloneAccount(const Account *source, QofBook *book)
gnc_numeric xaccAccountGetReconciledBalance(const Account *account)
gint gnc_account_n_children(const Account *account)
void gnc_account_join_children(Account *to_parent, Account *from_parent)
gnc_numeric xaccAccountGetBalanceAsOfDate(Account *account, time64 date)
All type declarations for the whole Gnucash engine.
gnc_numeric xaccAccountGetBalance(const Account *account)
gboolean xaccAccountGetReconcileLastDate(const Account *account, time64 *last_date)
void dxaccAccountSetQuoteTZ(Account *account, const char *tz)
void xaccAccountSetCommoditySCU(Account *account, int frac)
struct _gnc_numeric gnc_numeric
An rational-number type.
gnc_commodity * gnc_account_get_currency_or_parent(const Account *account)
gboolean xaccAccountGetHidden(const Account *acc)
gint64 xaccAccountCountSplits(const Account *acc, gboolean include_children)
gboolean gnc_account_insert_split(Account *acc, Split *s)
GList * gnc_account_get_descendants(const Account *account)
void xaccAccountSetTaxUSCode(Account *account, const char *code)
guint32 xaccParentAccountTypesCompatibleWith(GNCAccountType type)
gboolean xaccAccountGetReconcileChildrenStatus(const Account *account)
gboolean xaccAccountGetReconcileLastInterval(const Account *account, int *months, int *days)
const char * dxaccAccountGetPriceSrc(const Account *account)
GList * gnc_account_get_children(const Account *account)
void xaccAccountSetHidden(Account *acc, gboolean val)
void xaccAccountBeginEdit(Account *account)
gboolean xaccAccountHasAncestor(const Account *acc, const Account *ancestor)
gnc_commodity * xaccAccountGetCommodity(const Account *account)
gboolean xaccAccountGetPlaceholder(const Account *account)
gint gnc_account_get_current_depth(const Account *account)
Account * xaccAccountGainsAccount(Account *acc, gnc_commodity *curr)
Account * gnc_account_nth_child(const Account *parent, gint num)
Account * xaccMallocAccount(QofBook *book)
gint gnc_account_child_index(const Account *parent, const Account *child)
void xaccAccountSetAutoInterestXfer(Account *account, gboolean value)
void xaccAccountSetTaxUSPayerNameSource(Account *account, const char *source)
void xaccAccountSetDescription(Account *account, const char *desc)
void DxaccAccountSetCurrency(Account *account, gnc_commodity *currency)
void gnc_account_set_start_balance(Account *acc, const gnc_numeric start_baln)
void xaccAccountSetNonStdSCU(Account *account, gboolean flag)
LotList * xaccAccountFindOpenLots(const Account *acc, gboolean(*match_func)(GNCLot *lot, gpointer user_data), gpointer user_data, GCompareFunc sort_func)
Account * gnc_account_get_root(Account *account)
const char * xaccAccountGetName(const Account *account)
const char * xaccAccountGetTypeStr(GNCAccountType type)
const char * xaccAccountGetSortOrder(const Account *account)
int xaccAccountStagedTransactionTraversal(const Account *a, unsigned int stage, TransactionCallback thunk, void *data)
void xaccAccountCommitEdit(Account *account)
void xaccClearMark(Account *account, short val)
void xaccAccountSetName(Account *account, const char *name)
gboolean xaccAccountGetAutoInterestXfer(const Account *account, gboolean default_value)
GNCPolicy * gnc_account_get_policy(Account *account)
void gnc_account_merge_children(Account *parent)
gboolean xaccAccountIsEquityType(GNCAccountType t)
void xaccAccountSetReconcileChildrenStatus(Account *account, gboolean status)
const gchar * gnc_get_account_separator_string(void)
void xaccAccountSetCommodity(Account *account, gnc_commodity *comm)
const char * xaccAccountGetNotes(const Account *account)
gboolean xaccAccountGetReconcilePostponeBalance(const Account *account, gnc_numeric *balance)
gint gnc_account_get_tree_depth(const Account *account)
Account * xaccAccountLookup(const GncGUID *guid, QofBook *book)
void xaccAccountSetTaxUSCopyNumber(Account *account, gint64 copy_number)