GnuCash
2.6.99
|
Files | |
file | Account.h |
Account handling public routines. | |
Data Structures | |
struct | AccountClass |
Macros | |
#define | GNC_TYPE_ACCOUNT (gnc_account_get_type ()) |
#define | GNC_ACCOUNT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_ACCOUNT, Account)) |
#define | GNC_ACCOUNT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GNC_TYPE_ACCOUNT, AccountClass)) |
#define | GNC_IS_ACCOUNT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_ACCOUNT)) |
#define | GNC_IS_ACCOUNT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GNC_TYPE_ACCOUNT)) |
#define | GNC_ACCOUNT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GNC_TYPE_ACCOUNT, AccountClass)) |
Typedefs | |
typedef gnc_numeric(* | xaccGetBalanceFn )(const Account *account) |
typedef gnc_numeric(* | xaccGetBalanceInCurrencyFn )(const Account *account, const gnc_commodity *report_commodity, gboolean include_children) |
typedef gnc_numeric(* | xaccGetBalanceAsOfDateFn )(Account *account, time64 date) |
typedef void(* | AccountCb )(Account *a, gpointer data) |
typedef gpointer(* | AccountCb2 )(Account *a, gpointer data) |
Enumerations | |
enum | GNCAccountType { ACCT_TYPE_INVALID = -1, ACCT_TYPE_NONE = -1, ACCT_TYPE_BANK = 0, ACCT_TYPE_CASH = 1, ACCT_TYPE_CREDIT = 3, ACCT_TYPE_ASSET = 2, ACCT_TYPE_LIABILITY = 4, ACCT_TYPE_STOCK = 5, ACCT_TYPE_MUTUAL = 6, ACCT_TYPE_CURRENCY = 7, ACCT_TYPE_INCOME = 8, ACCT_TYPE_EXPENSE = 9, ACCT_TYPE_EQUITY = 10, ACCT_TYPE_RECEIVABLE = 11, ACCT_TYPE_PAYABLE = 12, ACCT_TYPE_ROOT = 13, ACCT_TYPE_TRADING = 14, NUM_ACCOUNT_TYPES = 15, ACCT_TYPE_CHECKING = 15, ACCT_TYPE_SAVINGS = 16, ACCT_TYPE_MONEYMRKT = 17, ACCT_TYPE_CREDITLINE = 18, ACCT_TYPE_LAST } |
Functions | |
GType | gnc_account_get_type (void) |
gchar * | gnc_account_name_violations_errmsg (const gchar *separator, GList *invalid_account_names) |
GList * | gnc_account_list_name_violations (QofBook *book, const gchar *separator) |
void | xaccAccountSetReconcileChildrenStatus (Account *account, gboolean status) |
gboolean | xaccAccountGetReconcileChildrenStatus (const Account *account) |
gboolean | xaccAccountHasAncestor (const Account *acc, const Account *ancestor) |
Account Constructors, Edit/Commit, Comparison | |
Account * | xaccMallocAccount (QofBook *book) |
Account * | gnc_account_create_root (QofBook *book) |
Account * | xaccCloneAccount (const Account *source, QofBook *book) |
void | xaccAccountBeginEdit (Account *account) |
void | xaccAccountCommitEdit (Account *account) |
void | xaccAccountDestroy (Account *account) |
gboolean | xaccAccountEqual (const Account *a, const Account *b, gboolean check_guids) |
int | xaccAccountOrder (const Account *account_1, const Account *account_2) |
Account lookup and GncGUID routines | |
const gchar * | gnc_get_account_separator_string (void) |
gunichar | gnc_get_account_separator (void) |
void | gnc_set_account_separator (const gchar *separator) |
Account * | gnc_book_get_root_account (QofBook *book) |
void | gnc_book_set_root_account (QofBook *book, Account *root) |
Account * | xaccAccountLookup (const GncGUID *guid, QofBook *book) |
#define | xaccAccountGetGUID(X) qof_entity_get_guid(QOF_INSTANCE(X)) |
#define | xaccAccountReturnGUID(X) (X ? *(qof_entity_get_guid(QOF_INSTANCE(X))) : *(guid_null())) |
#define | xaccAccountLookupDirect(g, b) xaccAccountLookup(&(g),b) |
Account Commodity setters/getters | |
Accounts are used to store an amount of 'something', that 'something' is called the 'commodity'. An account can only hold one kind of commodity. The following are used to get and set the commodity, and also to set the SCU, the 'Smallest Commodity Unit'. Note that when we say that a 'split' holds an 'amount', that amount is denominated in the account commodity. Do not confuse 'amount' and 'value'. The 'value' of a split is the value of the amount expressed in the currency of the transaction. Thus, for example, the 'amount' may be 12 apples, where the account commodity is 'apples'. The value of these 12 apples may be 12 dollars, where the transaction currency is 'dollars'. The SCU is the 'Smallest Commodity Unit', signifying the smallest non-zero amount that can be stored in the account. It is represented as the integer denominator of a fraction. Thus, for example, a SCU of 12 means that 1/12 of something is the smallest amount that can be stored in the account. SCU's can be any value; they do not need to be decimal. This allows the use of accounts with unusual, non-decimal commodities and currencies. Normally, the SCU is determined by the commodity of the account. However, this default SCU can be over-ridden and set to an account-specific value. This is account-specific value is called the 'non-standard' value in the documentation below. | |
void | xaccAccountSetCommodity (Account *account, gnc_commodity *comm) |
gnc_commodity * | xaccAccountGetCommodity (const Account *account) |
gnc_commodity * | gnc_account_get_currency_or_parent (const Account *account) |
int | xaccAccountGetCommoditySCU (const Account *account) |
int | xaccAccountGetCommoditySCUi (const Account *account) |
void | xaccAccountSetCommoditySCU (Account *account, int frac) |
void | xaccAccountSetNonStdSCU (Account *account, gboolean flag) |
gboolean | xaccAccountGetNonStdSCU (const Account *account) |
Account Balance | |
gnc_numeric | xaccAccountGetBalance (const Account *account) |
gnc_numeric | xaccAccountGetClearedBalance (const Account *account) |
gnc_numeric | xaccAccountGetReconciledBalance (const Account *account) |
gnc_numeric | xaccAccountGetPresentBalance (const Account *account) |
gnc_numeric | xaccAccountGetProjectedMinimumBalance (const Account *account) |
gnc_numeric | xaccAccountGetBalanceAsOfDate (Account *account, time64 date) |
gnc_numeric | xaccAccountConvertBalanceToCurrency (const Account *account, gnc_numeric balance, const gnc_commodity *balance_currency, const gnc_commodity *new_currency) |
gnc_numeric | xaccAccountConvertBalanceToCurrencyAsOfDate (const Account *account, gnc_numeric balance, gnc_commodity *balance_currency, gnc_commodity *new_currency, time64 date) |
gnc_numeric | xaccAccountGetBalanceInCurrency (const Account *account, const gnc_commodity *report_commodity, gboolean include_children) |
gnc_numeric | xaccAccountGetClearedBalanceInCurrency (const Account *account, const gnc_commodity *report_commodity, gboolean include_children) |
gnc_numeric | xaccAccountGetReconciledBalanceInCurrency (const Account *account, const gnc_commodity *report_commodity, gboolean include_children) |
gnc_numeric | xaccAccountGetPresentBalanceInCurrency (const Account *account, const gnc_commodity *report_commodity, gboolean include_children) |
gnc_numeric | xaccAccountGetProjectedMinimumBalanceInCurrency (const Account *account, const gnc_commodity *report_commodity, gboolean include_children) |
gnc_numeric | xaccAccountGetBalanceAsOfDateInCurrency (Account *account, time64 date, gnc_commodity *report_commodity, gboolean include_children) |
gnc_numeric | xaccAccountGetBalanceChangeForPeriod (Account *acc, time64 date1, time64 date2, gboolean recurse) |
Account Children and Parents. | |
The set of accounts is represented as a doubly-linked tree, so that given any account, both its parent and its children can be easily found. At the top of the tree hierarchy lies a single root node, the root account. The account tree hierarchy is unique, in that a given account can have only one parent account. | |
void | gnc_account_append_child (Account *new_parent, Account *child) |
void | gnc_account_remove_child (Account *parent, Account *child) |
Account * | gnc_account_get_parent (const Account *account) |
Account * | gnc_account_get_root (Account *account) |
gboolean | gnc_account_is_root (const Account *account) |
GList * | gnc_account_get_children (const Account *account) |
GList * | gnc_account_get_children_sorted (const Account *account) |
gint | gnc_account_n_children (const Account *account) |
gint | gnc_account_child_index (const Account *parent, const Account *child) |
Account * | gnc_account_nth_child (const Account *parent, gint num) |
GList * | gnc_account_get_descendants (const Account *account) |
GList * | gnc_account_get_descendants_sorted (const Account *account) |
gint | gnc_account_n_descendants (const Account *account) |
gint | gnc_account_get_current_depth (const Account *account) |
gint | gnc_account_get_tree_depth (const Account *account) |
ForEach | |
void | gnc_account_foreach_child (const Account *account, AccountCb func, gpointer user_data) |
void | gnc_account_foreach_descendant (const Account *account, AccountCb func, gpointer user_data) |
gpointer | gnc_account_foreach_descendant_until (const Account *account, AccountCb2 func, gpointer user_data) |
Concatenation, Merging | |
void | gnc_account_join_children (Account *to_parent, Account *from_parent) |
void | gnc_account_merge_children (Account *parent) |
Splits are grouped into Accounts which are also known as "Ledgers" in accounting practice. Each Account consists of a list of Splits that debit that Account. To ensure consistency, if a Split points to an Account, then the Account must point to the Split, and vice-versa. A Split can belong to at most one Account. Besides merely containing a list of Splits, the Account structure also gives the Account a name, a code number, description and notes fields, a key-value frame, a pointer to the commodity that is used for all splits in this account. The commodity can be the name of anything traded and tradeable: a stock (e.g. "IBM", "McDonald's"), a currency (e.g. "USD", "GBP"), or anything added to the commodity table.
Accounts can be arranged in a hierarchical tree. By accounting convention, the value of an Account is equal to the value of all of its Splits plus the value of all of its sub-Accounts.
#define xaccAccountGetGUID | ( | X | ) | qof_entity_get_guid(QOF_INSTANCE(X)) |
enum GNCAccountType |
The account types are used to determine how the transaction data in the account is displayed. These values can be safely changed from one release to the next. Note that if values are added, the file IO translation routines need to be updated. Note also that GUI code depends on these numbers.
Enumerator | |
---|---|
ACCT_TYPE_INVALID |
Not a type |
ACCT_TYPE_NONE |
Not a type |
ACCT_TYPE_BANK |
The bank account type denotes a savings or checking account held at a bank. Often interest bearing. |
ACCT_TYPE_CASH |
The cash account type is used to denote a shoe-box or pillowcase stuffed with * cash. |
ACCT_TYPE_CREDIT |
The Credit card account is used to denote credit (e.g. amex) and debit (e.g. visa, mastercard) card accounts |
ACCT_TYPE_ASSET |
asset (and liability) accounts indicate generic, generalized accounts that are none of the above. |
ACCT_TYPE_LIABILITY |
liability (and asset) accounts indicate generic, generalized accounts that are none of the above. |
ACCT_TYPE_STOCK |
Stock accounts will typically be shown in registers which show three columns: price, number of shares, and value. |
ACCT_TYPE_MUTUAL |
Mutual Fund accounts will typically be shown in registers which show three columns: price, number of shares, and value. |
ACCT_TYPE_CURRENCY |
The currency account type indicates that the account is a currency trading account. In many ways, a currency trading account is like a stock * trading account. It is shown in the register with three columns: price, number of shares, and value. Note: Since version 1.7.0, this account is * no longer needed to exchange currencies between accounts, so this type is DEPRECATED. |
ACCT_TYPE_INCOME |
Income accounts are used to denote income |
ACCT_TYPE_EXPENSE |
Expense accounts are used to denote expenses. |
ACCT_TYPE_EQUITY |
Equity account is used to balance the balance sheet. |
ACCT_TYPE_RECEIVABLE |
A/R account type |
ACCT_TYPE_PAYABLE |
A/P account type |
ACCT_TYPE_ROOT |
The hidden root account of an account tree. |
ACCT_TYPE_TRADING |
Account used to record multiple commodity transactions. This is not the same as ACCT_TYPE_CURRENCY above. Multiple commodity transactions have splits in these accounts to make the transaction balance in each commodity as well as in total value. |
NUM_ACCOUNT_TYPES |
stop here; the following types just aren't ready for prime time |
ACCT_TYPE_CHECKING |
bank account type – don't use this for now, see NUM_ACCOUNT_TYPES |
ACCT_TYPE_SAVINGS |
bank account type – don't use this for now, see NUM_ACCOUNT_TYPES |
ACCT_TYPE_MONEYMRKT |
bank account type – don't use this for now, see NUM_ACCOUNT_TYPES |
ACCT_TYPE_CREDITLINE |
line of credit – don't use this for now, see NUM_ACCOUNT_TYPES |
Definition at line 96 of file Account.h.
const char* dxaccAccountGetPriceSrc | ( | const Account * | account | ) |
Get a string that identifies the Finance::Quote backend that should be used to retrieve online prices. See price-quotes.scm for more information.
Definition at line 4590 of file Account.c.
void dxaccAccountSetPriceSrc | ( | Account * | account, |
const char * | src | ||
) |
Set a string that identifies the Finance::Quote backend that should be used to retrieve online prices. See price-quotes.scm for more information
Definition at line 4569 of file Account.c.
This function will remove from the child account any pre-existing parent relationship, and will then add the account as a child of the new parent. The exception to this is when the old and new parent accounts are the same, in which case this function does nothing.
If the child account belongs to a different book than the specified new parent account, the child will be removed from the other book (and thus, the other book's entity tables, generating a destroy event), and will be added to the new book (generating a create event).
new_parent | The new parent account to which the child should be attached. |
child | The account to attach. |
Definition at line 2525 of file Account.c.
Return the index of the specified child within the list of the parent's children. The first child index is 0. This function returns -1 if the parent account is NULL of if the specified child does not belong to the parent account.
parent | The parent account to check. |
child | The child account to find. |
Create a new root level account.
Definition at line 1097 of file Account.c.
void gnc_account_foreach_child | ( | const Account * | account, |
AccountCb | func, | ||
gpointer | user_data | ||
) |
This method will traverse the immediate children of this accounts, calling 'func' on each account. This function traverses all children nodes. To traverse only a subset of the child nodes use the gnc_account_foreach_child_until() function.
account | A pointer to the account on whose children the function should be called. |
func | A function taking two arguments, an Account and a gpointer. |
user_data | This data will be passed to each call of func. |
Definition at line 2940 of file Account.c.
void gnc_account_foreach_descendant | ( | const Account * | account, |
AccountCb | func, | ||
gpointer | user_data | ||
) |
This method will traverse all children of this accounts and their descendants, calling 'func' on each account. This function traverses all descendant nodes. To traverse only a subset of the descendant nodes use the gnc_account_foreach_descendant_until() function.
account | A pointer to the account on whose descendants the function should be called. |
func | A function taking two arguments, an Account and a gpointer. |
user_data | This data will be passed to each call of func. |
Definition at line 2958 of file Account.c.
gpointer gnc_account_foreach_descendant_until | ( | const Account * | account, |
AccountCb2 | func, | ||
gpointer | user_data | ||
) |
This method will traverse all children of this accounts and their descendants, calling 'func' on each account. Traversal will stop when func returns a non-null value, and the routine will return with that value. Therefore, this function will return null if func returns null for every account. For a simpler function that always traverses all children nodes, use the gnc_account_foreach_descendant() function.
account | A pointer to the account on whose descendants the function should be called. |
func | A function taking two arguments, an Account and a gpointer. |
user_data | This data will be passed to each call of func. |
Definition at line 2979 of file Account.c.
GList* gnc_account_get_children | ( | const Account * | account | ) |
This routine returns a GList of all children accounts of the specified account. This function only returns the immediate children of the specified account. For a list of all descendant accounts, use the gnc_account_get_descendants() function.
If you are looking for the splits of this account, use xaccAccountGetSplitList() instead. This function here deals with children accounts inside the account tree.
account | The account whose children should be returned. |
GList* gnc_account_get_children_sorted | ( | const Account * | account | ) |
This routine returns a GList of all children accounts of the specified account, ordered by xaccAccountOrder().
Definition at line 2661 of file Account.c.
gnc_commodity* gnc_account_get_currency_or_parent | ( | const Account * | account | ) |
Returns a gnc_commodity that is a currency, suitable for being a Transaction's currency. The gnc_commodity is taken either from the current account, or from the next parent account that has a gnc_commodity that is a currency. If neither this account nor any of its parent has such a commodity that is a currency, NULL is returned. In that case, you can use gnc_default_currency() but you might want to show a warning dialog first.
Definition at line 3155 of file Account.c.
gint gnc_account_get_current_depth | ( | const Account * | account | ) |
Return the number of levels of this account below the root account.
account | The account to query. |
Definition at line 2715 of file Account.c.
GList* gnc_account_get_descendants | ( | const Account * | account | ) |
This routine returns a flat list of all of the accounts that are descendants of the specified account. This includes not only the the children, but the children of the children, etc. For a list of only the immediate child accounts, use the gnc_account_get_children() function. Within each set of child accounts, the accounts returned by this function are unordered. For a list of descendants where each set of children is sorted via the standard account sort function, use the gnc_account_get_descendants_sorted() function.
account | The account whose descendants should be returned. |
Definition at line 2755 of file Account.c.
GList* gnc_account_get_descendants_sorted | ( | const Account * | account | ) |
This function returns a GList containing all the descendants of the specified account, sorted at each level. This includes not only the the children, but the children of the children, etc. Within each set of child accounts, the accounts returned by this function are ordered via the standard account sort function. For a list of descendants where each set of children is unordered, use the gnc_account_get_descendants() function.
Note: Use this function where the results are intended for display to the user. If the results are internal to GnuCash or will be resorted at som later point in time you should use the gnc_account_get_descendants() function.
account | The account whose descendants should be returned. |
Definition at line 2777 of file Account.c.
gchar* gnc_account_get_full_name | ( | const Account * | account | ) |
The gnc_account_get_full_name routine returns the fully qualified name of the account using the given separator char. The name must be g_free'd after use. The fully qualified name of an account is the concatenation of the names of the account and all its ancestor accounts starting with the topmost account and ending with the given account. Each name is separated by the given character.
Definition at line 3038 of file Account.c.
This routine returns a pointer to the parent of the specified account. If the account has no parent, i.e it is either the root node or is a disconnected account, then its parent will be NULL.
account | A pointer to any exiting account. |
This routine returns the root account of the account tree that the specified account belongs to. It is the equivalent of repeatedly calling the gnc_account_get_parent() routine until that routine returns NULL.
account | A pointer to any existing account. |
Definition at line 2630 of file Account.c.
gint gnc_account_get_tree_depth | ( | const Account * | account | ) |
Return the number of levels of descendants accounts below the specified account. The returned number does not include the specifed account itself.
account | The account to query. |
Definition at line 2734 of file Account.c.
GType gnc_account_get_type | ( | void | ) |
Returns the GType type system description of the Account class.
This must not be confused with the GNCAccountType as returned by xaccAccountGetType().
Insert the given split from an account.
acc | The account to which the split should be added. |
s | The split to be added. |
Definition at line 1720 of file Account.c.
gboolean gnc_account_is_root | ( | const Account * | account | ) |
This routine indicates whether the specified account is the root node of an account tree.
account | A pointer to any account. |
The gnc_account_join_children() subroutine will move (reparent) all child accounts from the from_parent account to the to_parent account, preserving the account hierarchy. It will also take care that the moved accounts will have the to_parent's book parent as well.
Definition at line 4739 of file Account.c.
GList* gnc_account_list_name_violations | ( | QofBook * | book, |
const gchar * | separator | ||
) |
Runs through all the accounts and returns a list of account names that contain the provided separator character. This can be used to check if certain account names are invalid.
book | Pointer to the book with accounts to verify |
separator | The separator character to verify against |
Definition at line 196 of file Account.c.
void gnc_account_merge_children | ( | Account * | parent | ) |
The gnc_account_merge_children() subroutine will go through an account, merging all child accounts that have the same name and description. This function is useful when importing Quicken(TM) files.
Definition at line 4764 of file Account.c.
gint gnc_account_n_children | ( | const Account * | account | ) |
Return the number of children of the specified account. The returned number does not include the account itself.
account | The account to query. |
gint gnc_account_n_descendants | ( | const Account * | account | ) |
Return the number of descendants of the specified account. The returned number does not include the account itself.
account | The account to query. |
Definition at line 2698 of file Account.c.
gchar* gnc_account_name_violations_errmsg | ( | const gchar * | separator, |
GList * | invalid_account_names | ||
) |
Composes a translatable error message showing which account names clash with the current account separator. Can be called after gnc_account_list_name_violations to have a consistent error message in different parts of GnuCash
separator | The separator character that was verified against |
invalid_account_names | A GList of invalid account names. |
Definition at line 159 of file Account.c.
Return the n'th child account of the specified parent account. If the parent account is not specified or the child index number is invalid, this function returns NULL.
parent | The parent account to check. |
num | The index number of the child account that should be returned. |
This function will remove the specified child account from the specified parent account. It will NOT free the associated memory or otherwise alter the account: the account can now be reparented to a new location. Note, however, that it will mark the old parents as having been modified.
parent | The parent account from which the child should be removed. |
child | The child account to remove. |
Definition at line 2587 of file Account.c.
Remove the given split from an account.
acc | The account from which the split should be removed. |
s | The split to be removed. |
Definition at line 1756 of file Account.c.
void gnc_account_set_balance_dirty | ( | Account * | acc | ) |
Tell the account that the running balances may be incorrect and need to be recomputed.
acc | Set the flag on this account. |
Definition at line 1703 of file Account.c.
Set the account's lot order policy
Definition at line 1888 of file Account.c.
void gnc_account_set_sort_dirty | ( | Account * | acc | ) |
Tell the account believes that the splits may be incorrectly sorted and need to be resorted.
acc | Set the flag on this account. |
Definition at line 1689 of file Account.c.
void gnc_account_set_start_balance | ( | Account * | acc, |
const gnc_numeric | start_baln | ||
) |
This function will set the starting commodity balance for this account. This routine is intended for use with backends that do not return the complete list of splits for an account, but rather return a partial list. In such a case, the backend will typically return all of the splits after some certain date, and the 'starting balance' will represent the summation of the splits up to that date.
Definition at line 3191 of file Account.c.
void gnc_account_set_start_cleared_balance | ( | Account * | acc, |
const gnc_numeric | start_baln | ||
) |
This function will set the starting cleared commodity balance for this account. This routine is intended for use with backends that do not return the complete list of splits for an account, but rather return a partial list. In such a case, the backend will typically return all of the splits after some certain date, and the 'starting balance' will represent the summation of the splits up to that date.
Definition at line 3203 of file Account.c.
void gnc_account_set_start_reconciled_balance | ( | Account * | acc, |
const gnc_numeric | start_baln | ||
) |
This function will set the starting reconciled commodity balance for this account. This routine is intended for use with backends that do not return the complete list of splits for an account, but rather return a partial list. In such a case, the backend will typically return all of the splits after some certain date, and the 'starting balance' will represent the summation of the splits up to that date.
Definition at line 3216 of file Account.c.
const gchar* gnc_get_account_separator_string | ( | void | ) |
void xaccAccountBeginEdit | ( | Account * | account | ) |
The xaccAccountBeginEdit() subroutine is the first phase of a two-phase-commit wrapper for account updates.
Definition at line 1280 of file Account.c.
void xaccAccountCommitEdit | ( | Account * | account | ) |
ThexaccAccountCommitEdit() subroutine is the second phase of a two-phase-commit wrapper for account updates.
Definition at line 1321 of file Account.c.
void xaccAccountDestroy | ( | Account * | account | ) |
The xaccAccountDestroy() routine can be used to get rid of an account. The account should have been opened for editing (by calling xaccAccountBeginEdit()) before calling this routine.
Definition at line 1400 of file Account.c.
Compare two accounts for equality - this is a deep compare.
Definition at line 1475 of file Account.c.
Account* xaccAccountGainsAccount | ( | Account * | acc, |
gnc_commodity * | curr | ||
) |
Retrieve the gains account used by this account for the indicated currency, creating and recording a new one if necessary.
FIXME: There is at present no interface to designate an existing account, and the new account name is hard coded to "Orphaned Gains -- CUR"
FIXME: There is no provision for creating separate accounts for anything other than currency, e.g. holding period of a security.
Definition at line 4537 of file Account.c.
gboolean xaccAccountGetAutoInterestXfer | ( | const Account * | account, |
gboolean | default_value | ||
) |
Returns a per-account flag: Prior to reconciling an account which charges or pays interest, this flag tells whether to prompt the user to enter a transaction for the interest charge or payment. This per-account flag overrides the global preference.
gnc_numeric xaccAccountGetBalance | ( | const Account * | account | ) |
gnc_numeric xaccAccountGetBalanceAsOfDate | ( | Account * | account, |
time64 | date | ||
) |
Get the balance of the account as of the date specified
Definition at line 3288 of file Account.c.
gnc_numeric xaccAccountGetClearedBalance | ( | const Account * | account | ) |
const char* xaccAccountGetCode | ( | const Account * | account | ) |
const char* xaccAccountGetColor | ( | const Account * | account | ) |
gnc_commodity* xaccAccountGetCommodity | ( | const Account * | account | ) |
int xaccAccountGetCommoditySCU | ( | const Account * | account | ) |
Return the SCU for the account. If a non-standard SCU has been set for the account, that is returned; else the default SCU for the account commodity is returned.
Definition at line 2458 of file Account.c.
int xaccAccountGetCommoditySCUi | ( | const Account * | account | ) |
const char* xaccAccountGetDescription | ( | const Account * | account | ) |
const char* xaccAccountGetFilter | ( | const Account * | account | ) |
const char* xaccAccountGetLastNum | ( | const Account * | account | ) |
const char* xaccAccountGetName | ( | const Account * | account | ) |
gboolean xaccAccountGetNonStdSCU | ( | const Account * | account | ) |
const char* xaccAccountGetNotes | ( | const Account * | account | ) |
gboolean xaccAccountGetReconcileChildrenStatus | ( | const Account * | account | ) |
gnc_numeric xaccAccountGetReconciledBalance | ( | const Account * | account | ) |
const char* xaccAccountGetSortOrder | ( | const Account * | account | ) |
GNCAccountType xaccAccountGetType | ( | const Account * | account | ) |
Returns the account's account type.
This must not be confused with the GType as returned by gnc_account_get_type(), which is related to glib's type system.
Definition at line 3009 of file Account.c.
gboolean xaccAccountIsPriced | ( | const Account * | acc | ) |
Returns true if the account is a stock, mutual fund or currency, otherwise false.
Definition at line 4249 of file Account.c.
The xaccAccountLookup() subroutine will return the account associated with the given id, or NULL if there is no such account.
Definition at line 1827 of file Account.c.
The xaccAccountOrder() subroutine defines a sorting order on accounts. It takes pointers to two accounts, and returns an int < 0 if the first account is "less than" the second, returns an int > 0 if the first is "greater than" the second, and 0 if they are equal. To determine the sort order, first the account codes are compared, and if these are equal, then account types, then account names. If still equal, it compares GUID to ensure that there aren't any ties.
Definition at line 2132 of file Account.c.
void xaccAccountRecomputeBalance | ( | Account * | ) |
The following recompute the partial balances (stored with the transaction) and the total balance, for this account
Definition at line 2058 of file Account.c.
void xaccAccountSetAutoInterestXfer | ( | Account * | account, |
gboolean | value | ||
) |
Sets a per-account flag: Prior to reconciling an account which charges or pays interest, this flag tells whether to prompt the user to enter a transaction for the interest charge or payment. This per-account flag overrides the global preference.
Definition at line 4455 of file Account.c.
void xaccAccountSetCode | ( | Account * | account, |
const char * | code | ||
) |
Set the account's accounting code
Definition at line 2249 of file Account.c.
void xaccAccountSetColor | ( | Account * | account, |
const char * | color | ||
) |
void xaccAccountSetCommodity | ( | Account * | account, |
gnc_commodity * | comm | ||
) |
Set the account's commodity
Definition at line 2389 of file Account.c.
void xaccAccountSetCommoditySCU | ( | Account * | account, |
int | frac | ||
) |
Set the SCU for the account. Normally, this routine is not required, as the default SCU for an account is given by its commodity.
Definition at line 2435 of file Account.c.
void xaccAccountSetDescription | ( | Account * | account, |
const char * | desc | ||
) |
void xaccAccountSetFilter | ( | Account * | account, |
const char * | filter | ||
) |
void xaccAccountSetLastNum | ( | Account * | account, |
const char * | num | ||
) |
void xaccAccountSetName | ( | Account * | account, |
const char * | name | ||
) |
void xaccAccountSetNonStdSCU | ( | Account * | account, |
gboolean | flag | ||
) |
Set the flag indicating that this account uses a non-standard SCU.
Definition at line 2471 of file Account.c.
void xaccAccountSetNotes | ( | Account * | account, |
const char * | notes | ||
) |
void xaccAccountSetReconcileChildrenStatus | ( | Account * | account, |
gboolean | status | ||
) |
void xaccAccountSetSortOrder | ( | Account * | account, |
const char * | sortorder | ||
) |
void xaccAccountSetType | ( | Account * | account, |
GNCAccountType | |||
) |
Set the account's type
Definition at line 2208 of file Account.c.
void xaccAccountSortSplits | ( | Account * | acc, |
gboolean | force | ||
) |
The xaccAccountSortSplits() routine will resort the account's splits if the sort is dirty. If 'force' is true, the account is sorted even if the editlevel is not zero.
Definition at line 1781 of file Account.c.
The xaccCloneAccount() routine makes a simple copy of the indicated account, placing it in the indicated book. It copies the account type, name, description, and the kvp values; it does not copy splits/transactions. The book should have a commodity table in it that has commodities with the same unique name as the ones being copied in the account (the commodities in the clone will be those from the book).
Definition at line 1114 of file Account.c.