Main Page Modules Alphabetical List Data Structures File List Data Fields Globals

# Account.h File Reference

Account handling public routines. More...

`#include "gnc-book.h"`
`#include "GNCId.h"`
`#include "gnc-engine.h"`
`#include "kvp_frame.h"`

## Account parameter names
#define | ACCOUNT_KVP "kvp"
#define | ACCOUNT_NAME_ "name"
#define | ACCOUNT_CODE_ "code"
#define | ACCOUNT_DESCRIPTION_ "desc"
#define | ACCOUNT_NOTES_ "notes"
#define | ACCOUNT_BALANCE_ "balance"
#define | ACCOUNT_CLEARED_ "cleared"
#define | ACCOUNT_RECONCILED_ "reconciled"
#define | ACCOUNT_PRESENT_ "present"
#define | ACCOUNT_FUTURE_MINIMUM_ "future-minimum"
#define | ACCOUNT_TAX_RELATED "tax-related-p"
## Account Placeholder getters/setters
enum | GNCPlaceholderType { PLACEHOLDER_NONE, PLACEHOLDER_THIS, PLACEHOLDER_CHILD }
gboolean | xaccAccountGetPlaceholder (Account *account)
void | xaccAccountSetPlaceholder (Account *account, gboolean option)
GNCPlaceholderType | xaccAccountGetDescendantPlaceholder (Account *account)
## Account Conversion routines
Conversion routines for the account types to/from strings that are used in persistant storage, communications. These strings should *not& be translated to the local language. Typical converstion is INCOME -> "INCOME".
char * | xaccAccountTypeEnumAsString (GNCAccountType type)
gboolean | xaccAccountStringToType (const char *str, GNCAccountType *type)
GNCAccountType | xaccAccountStringToEnum (const char *str)
## Account Constructors/Destructors and Edit/Commit
Account * | xaccMallocAccount (GNCBook *book)
Account * | xaccCloneAccount (const Account *from, GNCBook *book)
Account * | xaccCloneAccountSimple (const Account *from, GNCBook *book)
void | xaccAccountBeginEdit (Account *account)
void | xaccAccountCommitEdit (Account *account)
void | xaccAccountDestroy (Account *account)
## Account kvp_frame getters/setters
kvp_frame * | xaccAccountGetSlots (Account *account)
void | xaccAccountSetSlots_nc (Account *account, kvp_frame *frame)
## Account GUID subroutines
const GUID * | xaccAccountGetGUID (Account *account)
GUID | xaccAccountReturnGUID (Account *account)
Account * | xaccAccountLookup (const GUID *guid, GNCBook *book)
Account * | xaccAccountLookupDirect (GUID guid, GNCBook *book)
## Account general setters/getters
void | xaccAccountSetType (Account *account, GNCAccountType)
void | xaccAccountSetName (Account *account, const char *name)
void | xaccAccountSetCode (Account *account, const char *code)
void | xaccAccountSetDescription (Account *account, const char *desc)
void | xaccAccountSetNotes (Account *account, const char *notes)
void | xaccAccountSetLastNum (Account *account, const char *num)
GNCAccountType | xaccAccountGetType (Account *account)
const char * | xaccAccountGetName (Account *account)
const char * | xaccAccountGetCode (Account *account)
const char * | xaccAccountGetDescription (Account *account)
const char * | xaccAccountGetNotes (Account *account)
const char * | xaccAccountGetLastNum (Account *account)
## Account Deprecated currency/security access routines.
Deprecated: The current API associates only one thing with an account: the 'commodity'. Use xaccAccountGetCommodity() to fetch it.
void | DxaccAccountSetCurrency (Account *account, gnc_commodity *currency, GNCBook *book)
void | DxaccAccountSetSecurity (Account *account, gnc_commodity *security, GNCBook *book)
gnc_commodity * | DxaccAccountGetCurrency (Account *account, GNCBook *book)
gnc_commodity * | DxaccAccountGetSecurity (Account *account, GNCBook *book)
void | DxaccAccountSetCurrencySCU (Account *account, int frac)
int | DxaccAccountGetCurrencySCU (Account *account)
## Account Children and Parent getters/setters
AccountGroup * | xaccAccountGetChildren (Account *account)
AccountGroup * | xaccAccountGetParent (Account *account)
Account * | xaccAccountGetParentAccount (Account *account)
GList * | xaccAccountGetDescendants (Account *account)
void | xaccAccountSetReconcileChildrenStatus (Account *account, gboolean status)
gboolean | xaccAccountGetReconcileChildrenStatus (Account *account)
## Account Tax related getters/setters
gboolean | xaccAccountGetTaxRelated (Account *account)
void | xaccAccountSetTaxRelated (Account *account, gboolean tax_related)
const char * | xaccAccountGetTaxUSCode (Account *account)
void | xaccAccountSetTaxUSCode (Account *account, const char *code)
const char * | xaccAccountGetTaxUSPayerNameSource (Account *account)
void | xaccAccountSetTaxUSPayerNameSource (Account *account, const char *source)
## Account Reconciliation information getters/setters
gboolean | xaccAccountGetReconcileLastDate (Account *account, time_t *last_date)
void | xaccAccountSetReconcileLastDate (Account *account, time_t last_date)
gboolean | xaccAccountGetReconcileLastInterval (Account *account, int *months, int *days)
void | xaccAccountSetReconcileLastInterval (Account *account, int months, int days)
gboolean | xaccAccountGetReconcilePostponeDate (Account *account, time_t *postpone_date)
void | xaccAccountSetReconcilePostponeDate (Account *account, time_t postpone_date)
gboolean | xaccAccountGetReconcilePostponeBalance (Account *account, gnc_numeric *balance)
void | xaccAccountSetReconcilePostponeBalance (Account *account, gnc_numeric balance)
void | xaccAccountClearReconcilePostpone (Account *account)
## Account AutoInterest getters/setters
Note: FIXME: What is this?
gboolean | xaccAccountGetAutoInterestXfer (Account *account, gboolean default_value)
void | xaccAccountSetAutoInterestXfer (Account *account, gboolean option)
## Defines
#define | ACCOUNT_MATCH_ALL_TYPE "account-match-all"
## Typedefs
typedef gnc_numeric(* | xaccGetBalanceFn )(Account *account)
typedef gnc_numeric(* | xaccGetBalanceInCurrencyFn )(Account *account, gnc_commodity *report_commodity, gboolean include_children)
typedef gpointer(* | SplitCallback )(Split *s, gpointer data)
typedef gboolean(* | TransactionCallback )(Transaction *t, void *data)
## Enumerations
enum | GNCAccountType { BAD_TYPE = -1, NO_TYPE = -1, BANK = 0, CASH = 1, CREDIT = 3, ASSET = 2, LIABILITY = 4, STOCK = 5, MUTUAL = 6, CURRENCY = 7, INCOME = 8, EXPENSE = 9, EQUITY = 10, RECEIVABLE = 11, PAYABLE = 12, NUM_ACCOUNT_TYPES = 13, CHECKING = 13, SAVINGS = 14, MONEYMRKT = 15, CREDITLINE = 16 }
## Functions
const char * | xaccAccountGetTypeStr (GNCAccountType type)
GNCAccountType | xaccAccountGetTypeFromStr (const gchar *str)
gboolean | xaccAccountTypesCompatible (GNCAccountType parent_type, GNCAccountType child_type)
GNCBook * | xaccAccountGetBook (Account *account)
Account * | xaccAccountLookupTwin (Account *acc, GNCBook *book)
gboolean | xaccAccountEqual (Account *a, Account *b, gboolean check_guids)
void | xaccAccountInsertLot (Account *, GNCLot *)
void | xaccAccountRemoveLot (Account *, GNCLot *)
void | xaccAccountInsertSplit (Account *account, Split *split)
void | xaccAccountFixSplitDateOrder (Account *account, Split *split)
void | xaccTransFixSplitDateOrder (Transaction *trans)
int | xaccAccountOrder (Account **account_1, Account **account_2)
void | xaccAccountDeleteOldData (Account *account)
SplitList * | xaccAccountGetSplitList (Account *account)
LotList * | xaccAccountGetLotList (Account *account)
LotList * | xaccAccountFindOpenLots (Account *acc, gboolean(*match_func)(GNCLot *lot, gpointer user_data), gpointer user_data, GCompareFunc sort_func)
char * | xaccAccountGetFullName (Account *account, const char separator)
gboolean | xaccAccountHasAncestor (Account *account, Account *ancestor)
void | xaccAccountSetMark (Account *account, short mark)
short | xaccAccountGetMark (Account *account)
void | xaccClearMark (Account *account, short val)
void | xaccClearMarkDown (Account *account, short val)
void | xaccClearMarkDownGr (AccountGroup *group, short val)
void | xaccAccountSetPriceSrc (Account *account, const char *src)
const char * | xaccAccountGetPriceSrc (Account *account)
void | xaccAccountSetQuoteTZ (Account *account, const char *tz)
const char * | xaccAccountGetQuoteTZ (Account *account)
gpointer | xaccAccountForEachSplit (Account *account, SplitCallback, gpointer data)
gboolean | xaccAccountForEachTransaction (Account *account, TransactionCallback, void *data)
gboolean | xaccAccountVisitUnvisitedTransactions (Account *account, TransactionCallback, void *data, GHashTable *visited_txns)
Transaction * | xaccAccountFindTransByDesc (Account *account, const char *description)
Split * | xaccAccountFindSplitByDesc (Account *account, const char *description)

## Detailed Description

Account handling public routines.

Author:
  Copyright (C) 1997 Robin D. Clark , Copyright (C) 1997-2002 Linas Vepstas <linas@linas.org>