GnuCash  5.6-93-g926250afab+
Modules | Files | Data Structures | Macros | Typedefs | Enumerations | Functions | Variables | Friends
GnuCash Engine: Core, Non-GUI Accounting Functions

The GnuCash Engine provides a set of objects and classes that encapsulate typical financial accounting concepts. More...

Modules

 Environment
 The API in this file is used to read the environment configuration file and set up a number of environment variables based on the values found in it.
 
 Generic Preference Utilities
 The only function in this file is meant to initialize the preferences system early in the load process.
 
 
 Cap Gains
 This file implements the various routines to automatically compute and handle Cap Gains/Losses resulting from trading activities.
 
 Commodities
 A commodity is something of value that is easily tradeable or sellable; for example, currencies, stocks, bonds, grain, copper, and oil are all commodities.
 
 Lots: Core Function for AR/AP, Inventory, Stock Lots, Cap Gains
 One often needs to know that the item 'bought' in one transaction is the same one as the item 'sold' in a different transaction.
 
 Options
 GnuCash Options System for Book, Report, and Stylesheet Options.
 
 Price Database
 The PriceDB is intended to be a database of price quotes, or more specifically, a database of GNCPrices.
 
 Prices
 Each price in the database represents an "instantaneous" quote for a given commodity with respect to another commodity.
 
 Business
 The Business Engine provides a set of structures for that provide small-business accounting features.
 
 Accounting Policy (FIFO/LIFO)
 This file implements Accounting Policy.
 
 Scheduled/Periodic/Recurring Transactions
 
Scheduled Transactions provide a framework for remembering information about a transactions that are set to occur in the future, either once or periodically.
 
 Data Validation
 Data scrubbing, repairing and forward migration routines.
 
 Transaction, Split
 A good overview of transactions, splits and accounts can be found in the texinfo documentation, together with an overview of how to use this API.
 
 Transaction Logging
 The transaction logging mechanism provides a very simple, low-level logging of user input to a file.
 

Files

file  gnc-engine.h
 All type declarations for the whole Gnucash engine.
 

Data Structures

struct  GncImapInfo
 

Macros

#define ACCOUNT_MATCH_ALL_TYPE   "account-match-all"
 This is the type-override when you want to match all accounts. More...
 
#define GNC_ID_NONE   QOF_ID_NONE
 IDENTIFIERS GncGUID Identifiers can be used to reference Accounts, Transactions, Splits and other objects. More...
 
#define GNC_ID_BOOK   QOF_ID_BOOK
 
#define GNC_ID_SESSION   QOF_ID_SESSION
 
#define GNC_ID_NULL   QOF_ID_NULL
 
#define GNC_ID_ACCOUNT   "Account"
 
#define GNC_ID_COMMODITY   "Commodity"
 
#define GNC_ID_COMMODITY_NAMESPACE   "CommodityNamespace"
 
#define GNC_ID_COMMODITY_TABLE   "CommodityTable"
 
#define GNC_ID_LOT   "Lot"
 
#define GNC_ID_PERIOD   "Period"
 
#define GNC_ID_PRICE   "Price"
 
#define GNC_ID_PRICEDB   "PriceDB"
 
#define GNC_ID_SPLIT   "Split"
 
#define GNC_ID_BUDGET   "Budget"
 
#define GNC_ID_SCHEDXACTION   "SchedXaction"
 
#define GNC_ID_SXES   "SchedXactions"
 
#define GNC_ID_SXTG   "SXTGroup"
 
#define GNC_ID_SXTT   "SXTTrans"
 
#define GNC_ID_TRANS   "Trans"
 
#define GNC_INVOICE_ID   "gncInvoice"
 STRING CONSTANTS ********************************************** Used to declare constant KVP keys used in more than one class.
 
#define GNC_INVOICE_GUID   "invoice-guid"
 
#define GNC_OWNER_ID   "gncOwner"
 
#define GNC_OWNER_TYPE   "owner-type"
 
#define GNC_OWNER_GUID   "owner-guid"
 
#define GNC_SX_ID   "sched-xaction"
 

Typedefs

typedef GList AccountList
 GList of Account.
 
typedef GList LotList
 GList of GNCLots.
 
typedef GList SplitList
 GList of Split.
 
typedef GList TransList
 GList of Transaction.
 
typedef GList AccountGUIDList
 GList of GUIDs of a Account.
 
typedef GList BookGUIDList
 GList of GUIDs of a QofBook.
 
typedef void(* EngineCommitErrorCallback) (gpointer data, QofBackendError errcode)
 
typedef gint(* SplitCallback) (Split *s, gpointer data)
 
typedef gint(* TransactionCallback) (Transaction *t, void *data)
 
typedef void(* gnc_engine_init_hook_t) (int, char **)
 Function type for init hooks in the engine. More...
 

Enumerations

enum  GNCPlaceholderType { PLACEHOLDER_NONE, PLACEHOLDER_THIS, PLACEHOLDER_CHILD }
 DOCUMENT ME!
 

Functions

GList * gnc_accounts_and_all_descendants (GList *accounts)
 
void gnc_engine_init (int argc, char **argv)
 PROTOTYPES. More...
 
void gnc_engine_init_static (int argc, char **argv)
 This is the statically linked-in version of gnc_engine_init. More...
 
void gnc_engine_shutdown (void)
 Called to shutdown the engine. More...
 
gboolean gnc_engine_is_initialized (void)
 check the engine is fully initialized
 
void gnc_log_default (void)
 enable default log modules
 
void gnc_engine_add_init_hook (gnc_engine_init_hook_t hook)
 Pass a function pointer to gnc_engine_add_init_hook and it will be called during the evaluation of gnc_engine_init.
 
void gnc_engine_add_commit_error_callback (EngineCommitErrorCallback cb, gpointer data)
 Set a callback function to be called in case an engine commit fails.
 
void gnc_engine_signal_commit_error (QofBackendError errcode)
 
 GncOptionValue< ValueType >::GncOptionValue (const char *section, const char *name, const char *key, const char *doc_string, ValueType value, GncOptionUIType ui_type=GncOptionUIType::INTERNAL)
 
 GncOptionValue< ValueType >::GncOptionValue (const GncOptionValue &)=default
 
 GncOptionValue< ValueType >::GncOptionValue (GncOptionValue &&)=default
 
GncOptionValueGncOptionValue< ValueType >::operator= (const GncOptionValue &)=default
 
GncOptionValueGncOptionValue< ValueType >::operator= (GncOptionValue &&)=default
 
ValueType GncOptionValue< ValueType >::get_value () const
 
ValueType GncOptionValue< ValueType >::get_default_value () const
 
void GncOptionValue< ValueType >::set_value (ValueType new_value)
 
void GncOptionValue< ValueType >::set_default_value (ValueType new_value)
 
void GncOptionValue< ValueType >::reset_default_value ()
 
void GncOptionValue< ValueType >::mark_saved () noexcept
 
bool GncOptionValue< ValueType >::is_dirty () const noexcept
 
bool GncOptionValue< ValueType >::is_changed () const noexcept
 
GncOptionUIType GncOptionValue< ValueType >::get_ui_type () const noexcept
 
void GncOptionValue< ValueType >::make_internal ()
 
bool GncOptionValue< ValueType >::is_internal ()
 
std::string GncOptionValue< ValueType >::serialize () const noexcept
 
bool GncOptionValue< ValueType >::deserialize (const std::string &str) noexcept
 
void GncOwnerDeleter::operator() (GncOwner *o)
 
 GncOptionGncOwnerValue::GncOptionGncOwnerValue (const char *section, const char *name, const char *key, const char *doc_string, const GncOwner *value, GncOptionUIType ui_type=GncOptionUIType::INTERNAL)
 
 GncOptionGncOwnerValue::GncOptionGncOwnerValue (const GncOptionGncOwnerValue &from)
 
 GncOptionGncOwnerValue::GncOptionGncOwnerValue (GncOptionGncOwnerValue &&)=default
 
const GncOwnerGncOptionGncOwnerValue::get_value () const
 
const GncOwnerGncOptionGncOwnerValue::get_default_value () const
 
void GncOptionGncOwnerValue::set_value (const GncOwner *new_value)
 
void GncOptionGncOwnerValue::set_default_value (const GncOwner *new_value)
 
void GncOptionGncOwnerValue::reset_default_value ()
 
void GncOptionGncOwnerValue::mark_saved () noexcept
 
bool GncOptionGncOwnerValue::is_dirty () const noexcept
 
bool GncOptionGncOwnerValue::is_changed () const noexcept
 
GncOptionUIType GncOptionGncOwnerValue::get_ui_type () const noexcept
 
void GncOptionGncOwnerValue::make_internal ()
 
bool GncOptionGncOwnerValue::is_internal ()
 
std::string GncOptionGncOwnerValue::serialize () const noexcept
 
bool GncOptionGncOwnerValue::deserialize (const std::string &str) noexcept
 
 GncOptionQofInstanceValue::GncOptionQofInstanceValue (const char *section, const char *name, const char *key, const char *doc_string, const QofInstance *value, GncOptionUIType ui_type=GncOptionUIType::INTERNAL)
 
 GncOptionQofInstanceValue::GncOptionQofInstanceValue (const GncOptionQofInstanceValue &from)
 
 GncOptionQofInstanceValue::GncOptionQofInstanceValue (GncOptionQofInstanceValue &&)=default
 
GncOptionQofInstanceValueGncOptionQofInstanceValue::operator= (GncOptionQofInstanceValue &&)=default
 
const QofInstanceGncOptionQofInstanceValue::get_value () const
 
const QofInstanceGncOptionQofInstanceValue::get_default_value () const
 
GncItem GncOptionQofInstanceValue::get_item () const
 
GncItem GncOptionQofInstanceValue::get_default_item () const
 
void GncOptionQofInstanceValue::set_value (const QofInstance *new_value)
 
void GncOptionQofInstanceValue::set_default_value (const QofInstance *new_value)
 
void GncOptionQofInstanceValue::reset_default_value ()
 
void GncOptionQofInstanceValue::mark_saved () noexcept
 
bool GncOptionQofInstanceValue::is_dirty () const noexcept
 
bool GncOptionQofInstanceValue::is_changed () const noexcept
 
GncOptionUIType GncOptionQofInstanceValue::get_ui_type () const noexcept
 
void GncOptionQofInstanceValue::make_internal ()
 
bool GncOptionQofInstanceValue::is_internal ()
 
std::string GncOptionQofInstanceValue::serialize () const noexcept
 
bool GncOptionQofInstanceValue::deserialize (const std::string &str) noexcept
 
 GncOptionCommodityValue::GncOptionCommodityValue (const char *section, const char *name, const char *key, const char *doc_string, gnc_commodity *value, GncOptionUIType ui_type=GncOptionUIType::COMMODITY)
 
 GncOptionCommodityValue::GncOptionCommodityValue (const GncOptionCommodityValue &)=default
 
 GncOptionCommodityValue::GncOptionCommodityValue (GncOptionCommodityValue &&)=default
 
GncOptionCommodityValueGncOptionCommodityValue::operator= (const GncOptionCommodityValue &)=default
 
GncOptionCommodityValueGncOptionCommodityValue::operator= (GncOptionCommodityValue &&)=default
 
gnc_commodity * GncOptionCommodityValue::get_value () const
 
gnc_commodity * GncOptionCommodityValue::get_default_value () const
 
bool GncOptionCommodityValue::validate (gnc_commodity *) const noexcept
 
void GncOptionCommodityValue::set_value (gnc_commodity *value)
 
void GncOptionCommodityValue::set_default_value (gnc_commodity *value)
 
void GncOptionCommodityValue::reset_default_value ()
 
void GncOptionCommodityValue::mark_saved () noexcept
 
bool GncOptionCommodityValue::is_dirty () const noexcept
 
bool GncOptionCommodityValue::is_changed () const noexcept
 
GncOptionUIType GncOptionCommodityValue::get_ui_type () const noexcept
 
void GncOptionCommodityValue::make_internal ()
 
bool GncOptionCommodityValue::is_internal ()
 
std::string GncOptionCommodityValue::serialize () const noexcept
 
bool GncOptionCommodityValue::deserialize (const std::string &str) noexcept
 
 GncOptionRangeValue< ValueType >::GncOptionRangeValue (const char *section, const char *name, const char *key, const char *doc_string, ValueType value, ValueType min, ValueType max, ValueType step)
 
 GncOptionRangeValue< ValueType >::GncOptionRangeValue (const char *section, const char *name, const char *key, const char *doc_string, ValueType value, ValueType min, ValueType max, ValueType step, GncOptionUIType ui)
 
 GncOptionRangeValue< ValueType >::GncOptionRangeValue (const GncOptionRangeValue< ValueType > &)=default
 
 GncOptionRangeValue< ValueType >::GncOptionRangeValue (GncOptionRangeValue< ValueType > &&)=default
 
GncOptionRangeValue< ValueType > & GncOptionRangeValue< ValueType >::operator= (const GncOptionRangeValue< ValueType > &)=default
 
GncOptionRangeValue< ValueType > & GncOptionRangeValue< ValueType >::operator= (GncOptionRangeValue< ValueType > &&)=default
 
ValueType GncOptionRangeValue< ValueType >::get_value () const
 
ValueType GncOptionRangeValue< ValueType >::get_default_value () const
 
bool GncOptionRangeValue< ValueType >::validate (ValueType value)
 
void GncOptionRangeValue< ValueType >::set_value (ValueType value)
 
void GncOptionRangeValue< ValueType >::set_default_value (ValueType value)
 
void GncOptionRangeValue< ValueType >::get_limits (ValueType &upper, ValueType &lower, ValueType &step) const noexcept
 
void GncOptionRangeValue< ValueType >::reset_default_value ()
 
void GncOptionRangeValue< ValueType >::mark_saved () noexcept
 
bool GncOptionRangeValue< ValueType >::is_dirty () const noexcept
 
bool GncOptionRangeValue< ValueType >::is_changed () const noexcept
 
GncOptionUIType GncOptionRangeValue< ValueType >::get_ui_type () const noexcept
 
void GncOptionRangeValue< ValueType >::make_internal ()
 
bool GncOptionRangeValue< ValueType >::is_internal ()
 
bool GncOptionRangeValue< ValueType >::is_alternate () const noexcept
 
void GncOptionRangeValue< ValueType >::set_alternate (bool value) noexcept
 
std::string GncOptionRangeValue< ValueType >::serialize () const noexcept
 
bool GncOptionRangeValue< ValueType >::deserialize (const std::string &str) noexcept
 
 GncOptionMultichoiceValue::GncOptionMultichoiceValue (const char *section, const char *name, const char *key, const char *doc_string, const char *value, GncMultichoiceOptionChoices &&choices, GncOptionUIType ui_type=GncOptionUIType::MULTICHOICE)
 
 GncOptionMultichoiceValue::GncOptionMultichoiceValue (const char *section, const char *name, const char *key, const char *doc_string, uint16_t index, GncMultichoiceOptionChoices &&choices, GncOptionUIType ui_type=GncOptionUIType::MULTICHOICE)
 
 GncOptionMultichoiceValue::GncOptionMultichoiceValue (const char *section, const char *name, const char *key, const char *doc_string, GncMultichoiceOptionIndexVec &&indices, GncMultichoiceOptionChoices &&choices, GncOptionUIType ui_type=GncOptionUIType::LIST)
 
 GncOptionMultichoiceValue::GncOptionMultichoiceValue (const GncOptionMultichoiceValue &)=default
 
 GncOptionMultichoiceValue::GncOptionMultichoiceValue (GncOptionMultichoiceValue &&)=default
 
GncOptionMultichoiceValueGncOptionMultichoiceValue::operator= (const GncOptionMultichoiceValue &)=default
 
GncOptionMultichoiceValueGncOptionMultichoiceValue::operator= (GncOptionMultichoiceValue &&)=default
 
const std::string & GncOptionMultichoiceValue::get_value () const
 
const std::string & GncOptionMultichoiceValue::get_default_value () const
 
uint16_t GncOptionMultichoiceValue::get_index () const
 
const GncMultichoiceOptionIndexVec & GncOptionMultichoiceValue::get_multiple () const noexcept
 
const GncMultichoiceOptionIndexVec & GncOptionMultichoiceValue::get_default_multiple () const noexcept
 
bool GncOptionMultichoiceValue::validate (const std::string &value) const noexcept
 
bool GncOptionMultichoiceValue::validate (const GncMultichoiceOptionIndexVec &indexes) const noexcept
 
void GncOptionMultichoiceValue::set_value (const std::string &value)
 
void GncOptionMultichoiceValue::set_value (uint16_t index)
 
void GncOptionMultichoiceValue::set_default_value (const std::string &value)
 
void GncOptionMultichoiceValue::set_default_value (uint16_t index)
 
void GncOptionMultichoiceValue::set_multiple (const GncMultichoiceOptionIndexVec &indexes)
 
void GncOptionMultichoiceValue::set_default_multiple (const GncMultichoiceOptionIndexVec &indexes)
 
uint16_t GncOptionMultichoiceValue::num_permissible_values () const noexcept
 
uint16_t GncOptionMultichoiceValue::permissible_value_index (const char *key) const noexcept
 
const char * GncOptionMultichoiceValue::permissible_value (uint16_t index) const
 
const char * GncOptionMultichoiceValue::permissible_value_name (uint16_t index) const
 
void GncOptionMultichoiceValue::reset_default_value ()
 
void GncOptionMultichoiceValue::mark_saved () noexcept
 
bool GncOptionMultichoiceValue::is_dirty () const noexcept
 
bool GncOptionMultichoiceValue::is_changed () const noexcept
 
GncOptionUIType GncOptionMultichoiceValue::get_ui_type () const noexcept
 
void GncOptionMultichoiceValue::make_internal ()
 
bool GncOptionMultichoiceValue::is_internal ()
 
GncOptionMultichoiceKeyType GncOptionMultichoiceValue::get_keytype (unsigned i) const
 
std::string GncOptionMultichoiceValue::serialize () const noexcept
 
bool GncOptionMultichoiceValue::deserialize (const std::string &str) noexcept
 
 GncOptionAccountListValue::GncOptionAccountListValue (const char *section, const char *name, const char *key, const char *doc_string, GncOptionUIType ui_type, bool multi=true)
 
 GncOptionAccountListValue::GncOptionAccountListValue (const char *section, const char *name, const char *key, const char *doc_string, GncOptionUIType ui_type, const GncOptionAccountList &value, bool multi=true)
 
 GncOptionAccountListValue::GncOptionAccountListValue (const char *section, const char *name, const char *key, const char *doc_string, GncOptionUIType ui_type, GncOptionAccountTypeList &&allowed, bool multi=true)
 
 GncOptionAccountListValue::GncOptionAccountListValue (const char *section, const char *name, const char *key, const char *doc_string, GncOptionUIType ui_type, const GncOptionAccountList &value, GncOptionAccountTypeList &&allowed, bool multi=true)
 
GncOptionAccountList GncOptionAccountListValue::get_value () const
 
GncOptionAccountList GncOptionAccountListValue::get_default_value () const
 
bool GncOptionAccountListValue::validate (const GncOptionAccountList &values) const
 
void GncOptionAccountListValue::set_value (GncOptionAccountList values)
 
void GncOptionAccountListValue::set_default_value (GncOptionAccountList values)
 
GList * GncOptionAccountListValue::account_type_list () const noexcept
 Create a GList of account types to pass to gnc_account_sel_set_acct_filters. More...
 
void GncOptionAccountListValue::reset_default_value ()
 
void GncOptionAccountListValue::mark_saved () noexcept
 
bool GncOptionAccountListValue::is_dirty () const noexcept
 
bool GncOptionAccountListValue::is_changed () const noexcept
 
GncOptionUIType GncOptionAccountListValue::get_ui_type () const noexcept
 
void GncOptionAccountListValue::make_internal ()
 
bool GncOptionAccountListValue::is_internal ()
 
bool GncOptionAccountListValue::is_multiselect () const noexcept
 
std::string GncOptionAccountListValue::serialize () const noexcept
 
bool GncOptionAccountListValue::deserialize (const std::string &str) noexcept
 
 GncOptionAccountSelValue::GncOptionAccountSelValue (const char *section, const char *name, const char *key, const char *doc_string, GncOptionUIType ui_type)
 
 GncOptionAccountSelValue::GncOptionAccountSelValue (const char *section, const char *name, const char *key, const char *doc_string, GncOptionUIType ui_type, const Account *value)
 
 GncOptionAccountSelValue::GncOptionAccountSelValue (const char *section, const char *name, const char *key, const char *doc_string, GncOptionUIType ui_type, GncOptionAccountTypeList &&allowed)
 
 GncOptionAccountSelValue::GncOptionAccountSelValue (const char *section, const char *name, const char *key, const char *doc_string, GncOptionUIType ui_type, const Account *value, GncOptionAccountTypeList &&allowed)
 
const AccountGncOptionAccountSelValue::get_value () const
 
const AccountGncOptionAccountSelValue::get_default_value () const
 
bool GncOptionAccountSelValue::validate (const Account *value) const
 
void GncOptionAccountSelValue::set_value (const Account *value)
 
void GncOptionAccountSelValue::set_default_value (const Account *value)
 
GList * GncOptionAccountSelValue::account_type_list () const noexcept
 Create a GList of account types to pass to gnc_account_sel_set_acct_filters. More...
 
void GncOptionAccountSelValue::reset_default_value ()
 
void GncOptionAccountSelValue::mark_saved () noexcept
 
bool GncOptionAccountSelValue::is_dirty () const noexcept
 
bool GncOptionAccountSelValue::is_changed () const noexcept
 
GncOptionUIType GncOptionAccountSelValue::get_ui_type () const noexcept
 
void GncOptionAccountSelValue::make_internal ()
 
bool GncOptionAccountSelValue::is_internal ()
 
std::string GncOptionAccountSelValue::serialize () const noexcept
 
bool GncOptionAccountSelValue::deserialize (const std::string &str) noexcept
 
 GncOptionDateValue::GncOptionDateValue (const char *section, const char *name, const char *key, const char *doc_string, GncOptionUIType ui_type)
 
 GncOptionDateValue::GncOptionDateValue (const char *section, const char *name, const char *key, const char *doc_string, GncOptionUIType ui_type, time64 time)
 
 GncOptionDateValue::GncOptionDateValue (const char *section, const char *name, const char *key, const char *doc_string, GncOptionUIType ui_type, RelativeDatePeriod period)
 
 GncOptionDateValue::GncOptionDateValue (const char *section, const char *name, const char *key, const char *doc_string, GncOptionUIType ui_type, const RelativeDatePeriodVec &period_set)
 
 GncOptionDateValue::GncOptionDateValue (const GncOptionDateValue &)=default
 
 GncOptionDateValue::GncOptionDateValue (GncOptionDateValue &&)=default
 
GncOptionDateValueGncOptionDateValue::operator= (const GncOptionDateValue &)=default
 
GncOptionDateValueGncOptionDateValue::operator= (GncOptionDateValue &&)=default
 
time64 GncOptionDateValue::get_value () const noexcept
 
time64 GncOptionDateValue::get_default_value () const noexcept
 
RelativeDatePeriod GncOptionDateValue::get_period () const noexcept
 
RelativeDatePeriod GncOptionDateValue::get_default_period () const noexcept
 
uint16_t GncOptionDateValue::get_period_index () const noexcept
 
uint16_t GncOptionDateValue::get_default_period_index () const noexcept
 
std::ostream & GncOptionDateValue::out_stream (std::ostream &oss) const noexcept
 
std::istream & GncOptionDateValue::in_stream (std::istream &iss)
 
bool GncOptionDateValue::validate (RelativeDatePeriod value)
 
bool GncOptionDateValue::validate (time64 time)
 
void GncOptionDateValue::set_value (RelativeDatePeriod value)
 
void GncOptionDateValue::set_value (time64 time)
 
void GncOptionDateValue::set_value (uint16_t index) noexcept
 
void GncOptionDateValue::set_default_value (RelativeDatePeriod value)
 
void GncOptionDateValue::set_default_value (time64 time)
 
uint16_t GncOptionDateValue::num_permissible_values () const noexcept
 
uint16_t GncOptionDateValue::permissible_value_index (const char *key) const noexcept
 
const char * GncOptionDateValue::permissible_value (uint16_t index) const
 
const char * GncOptionDateValue::permissible_value_name (uint16_t index) const
 
void GncOptionDateValue::reset_default_value ()
 
void GncOptionDateValue::mark_saved () noexcept
 
bool GncOptionDateValue::is_dirty () const noexcept
 
bool GncOptionDateValue::is_changed () const noexcept
 
GncOptionUIType GncOptionDateValue::get_ui_type () const noexcept
 
void GncOptionDateValue::make_internal ()
 
bool GncOptionDateValue::is_internal ()
 
const RelativeDatePeriodVec & GncOptionDateValue::get_period_set () const
 
std::string GncOptionDateValue::serialize () const noexcept
 
bool GncOptionDateValue::deserialize (const std::string &str) noexcept
 
template<typename OptionType , typename std::enable_if_t< is_OptionClassifier_v< OptionType >, int > = 0>
 GncOption::GncOption (OptionType option)
 
template<typename ValueType , typename std::enable_if_t<!is_OptionClassifier_v< ValueType >, int > = 0>
 GncOption::GncOption (const char *section, const char *name, const char *key, const char *doc_string, ValueType value, GncOptionUIType ui_type=GncOptionUIType::INTERNAL)
 
template<typename ValueType >
void GncOption::set_value (ValueType value)
 
template<typename ValueType >
void GncOption::set_default_value (ValueType value)
 
template<typename ValueType >
ValueType GncOption::get_default_value () const
 
template<typename ValueType >
ValueType GncOption::get_value () const
 
void GncOption::reset_default_value ()
 
const std::string & GncOption::get_section () const
 
const std::string & GncOption::get_name () const
 
const std::string & GncOption::get_key () const
 
const std::string & GncOption::get_docstring () const
 
void GncOption::set_ui_item (GncOptionUIItemPtr &&ui_elem)
 
const GncOptionUIType GncOption::get_ui_type () const
 
void GncOption::set_ui_item_selectable (bool) const noexcept
 
GncOptionUIItem *const GncOption::get_ui_item () const
 
void GncOption::set_ui_item_from_option ()
 
void GncOption::set_option_from_ui_item ()
 
void GncOption::make_internal ()
 
bool GncOption::is_internal ()
 
void GncOption::mark_saved () noexcept
 Mark the option as needing to be saved. More...
 
bool GncOption::is_dirty () const noexcept
 
bool GncOption::is_changed () const noexcept
 
bool GncOption::is_multiselect () const noexcept
 
template<typename ValueType >
void GncOption::get_limits (ValueType &, ValueType &, ValueType &) const noexcept
 Implemented only for GncOptionNumericRange.
 
template<typename ValueType >
bool GncOption::validate (ValueType value) const
 Not implemented for GncOptionValue. More...
 
uint16_t GncOption::num_permissible_values () const
 Implemented only for GncOptionMultiselectValue. More...
 
uint16_t GncOption::permissible_value_index (const char *value) const
 Implemented only for GncOptionMultiselectValue. More...
 
const char * GncOption::permissible_value (uint16_t index) const
 Implemented only for GncOptionMultiselectValue. More...
 
const char * GncOption::permissible_value_name (uint16_t index) const
 Implemented only for GncOptionMultiselectValue. More...
 
GList * GncOption::account_type_list () const noexcept
 Implemented only for GncOptionAccountListValue. More...
 
bool GncOption::is_alternate () const noexcept
 
void GncOption::set_alternate (bool) noexcept
 
std::string GncOption::serialize () const
 Get a string suitable for storage representing the option's value. More...
 
bool GncOption::deserialize (const std::string &str)
 Set the option's value from a character sequence. More...
 
std::istream & GncOption::in_stream (std::istream &iss)
 Set the option's value from an input stream. More...
 
void GncOption::set_widget_changed (std::any cb)
 
std::any & GncOption::get_widget_changed ()
 
 GncOptionSection::GncOptionSection (const char *name)
 
void GncOptionSection::foreach_option (std::function< void(GncOption &)> func)
 
void GncOptionSection::foreach_option (std::function< void(const GncOption &)> func) const
 
const std::string & GncOptionSection::get_name () const noexcept
 
size_t GncOptionSection::get_num_options () const noexcept
 
void GncOptionSection::add_option (GncOption &&option)
 
void GncOptionSection::remove_option (const char *name)
 
const GncOptionGncOptionSection::find_option (const char *name) const
 
 GncOptionDBCallback::GncOptionDBCallback (size_t id, GncOptionDBChangeCallback func, void *data)
 
 GncOptionDBCallback::GncOptionDBCallback (const GncOptionDBCallback &)=delete
 
 GncOptionDBCallback::GncOptionDBCallback (GncOptionDBCallback &&)=default
 
GncOptionDBCallbackGncOptionDBCallback::operator= (const GncOptionDBCallback &)=default
 
GncOptionDBCallbackGncOptionDBCallback::operator= (GncOptionDBCallback &&)=default
 
 GncOptionDB::GncOptionDB (QofBook *book)
 
void GncOptionDB::foreach_section (std::function< void(GncOptionSectionPtr &)> func)
 
void GncOptionDB::foreach_section (std::function< void(const GncOptionSectionPtr &)> func) const
 
size_t GncOptionDB::num_sections () const noexcept
 
bool GncOptionDB::get_changed () const noexcept
 
void GncOptionDB::register_option (const char *section, GncOption &&option)
 
void GncOptionDB::register_option (const char *section, GncOption *option)
 
void GncOptionDB::unregister_option (const char *section, const char *name)
 
void GncOptionDB::set_default_section (const char *section)
 
const GncOptionSection *const GncOptionDB::get_default_section () const noexcept
 
std::string GncOptionDB::lookup_string_option (const char *section, const char *name)
 
bool GncOptionDB::set_string_option (const char *section, const char *name, const std::string &value)
 
template<typename ValueType >
bool GncOptionDB::set_option (const char *section, const char *name, ValueType value)
 
void GncOptionDB::make_internal (const char *section, const char *name)
 
void GncOptionDB::commit ()
 
GncOptionSectionGncOptionDB::find_section (const std::string &sectname)
 
const GncOptionSectionGncOptionDB::find_section (const std::string &sectname) const
 
GncOptionGncOptionDB::find_option (const std::string &section, const char *name)
 
const GncOptionGncOptionDB::find_option (const std::string &section, const char *name) const
 
std::ostream & GncOptionDB::save_to_key_value (std::ostream &oss) const noexcept
 
std::istream & GncOptionDB::load_from_key_value (std::istream &iss)
 
void GncOptionDB::save_to_kvp (QofBook *book, bool clear_book) const noexcept
 
void GncOptionDB::load_from_kvp (QofBook *book) noexcept
 
std::ostream & GncOptionDB::save_option_key_value (std::ostream &oss, const std::string &section, const std::string &name) const noexcept
 
std::istream & GncOptionDB::load_option_key_value (std::istream &iss)
 
size_t GncOptionDB::register_callback (GncOptionDBChangeCallback, void *)
 
void GncOptionDB::unregister_callback (size_t)
 
void GncOptionDB::run_callbacks ()
 

Variables

std::string OptionClassifier::m_section
 
std::string OptionClassifier::m_name
 
std::string OptionClassifier::m_sort_tag
 
std::string OptionClassifier::m_doc_string
 
static constexpr bool is_GncOwnerValue< T >::value
 
static constexpr bool is_QofInstanceValue< T >::value
 
static constexpr bool is_QofQueryValue< T >::value
 
static constexpr bool is_OptionClassifier< T >::value
 
static constexpr bool is_same_decayed< T, U >::value
 
static constexpr bool is_RangeValue< T >::value
 
size_t GncOptionDBCallback::m_id
 
GncOptionDBChangeCallback GncOptionDBCallback::m_func
 
void * GncOptionDBCallback::m_data
 

Friends

GncOptionVariant & GncOption::swig_get_option (GncOption *)
 

Lookup Accounts and Subaccounts by name or code

Accountgnc_account_lookup_by_name (const Account *parent, const char *name)
 The gnc_account_lookup_by_name() subroutine fetches the account by name from the descendants of the specified account. More...
 
Accountgnc_account_lookup_by_full_name (const Account *any_account, const gchar *name)
 The gnc_account_lookup_full_name() subroutine works like gnc_account_lookup_by_name, but uses fully-qualified names using the given separator.
 
Accountgnc_account_lookup_by_code (const Account *parent, const char *code)
 The gnc_account_lookup_by_code() subroutine works like gnc_account_lookup_by_name, but uses the account code.
 
Accountgnc_account_lookup_by_opening_balance (Account *account, gnc_commodity *commodity)
 Find the opening balance account for the currency. More...
 
GList * gnc_account_lookup_by_type_and_commodity (Account *root, const char *name, GNCAccountType acctype, gnc_commodity *commodity)
 Find a direct child account matching name, GNCAccountType, and/or commodity. More...
 

GNCAccountType conversion/checking

const char * xaccAccountTypeEnumAsString (GNCAccountType type)
 Conversion routines for the account types to/from strings that are used in persistent storage, communications. More...
 
gboolean xaccAccountStringToType (const char *str, GNCAccountType *type)
 Conversion routines for the account types to/from strings that are used in persistent storage, communications. More...
 
GNCAccountType xaccAccountStringToEnum (const char *str)
 Conversion routines for the account types to/from strings that are used in persistent storage, communications. More...
 
const char * xaccAccountGetTypeStr (GNCAccountType type)
 The xaccAccountGetTypeStr() routine returns a string suitable for use in the GUI/Interface. More...
 
guint32 xaccAccountTypesCompatibleWith (GNCAccountType type)
 Return the bitmask of account types compatible with a given type. More...
 
guint32 xaccParentAccountTypesCompatibleWith (GNCAccountType type)
 Return the bitmask of parent account types compatible with a given type. More...
 
gboolean xaccAccountTypesCompatible (GNCAccountType parent_type, GNCAccountType child_type)
 Return TRUE if accounts of type parent_type can have accounts of type child_type as children. More...
 
guint32 xaccAccountTypesValid (void)
 Returns the bitmask of the account type enums that are valid. More...
 
gboolean xaccAccountIsAssetLiabType (GNCAccountType t)
 Convenience function to check if the account is a valid Asset or Liability type, but not a business account type (meaning not an Accounts Payable/Accounts Receivable). More...
 
GNCAccountType xaccAccountTypeGetFundamental (GNCAccountType t)
 Convenience function to return the fundamental type asset/liability/income/expense/equity given an account type. More...
 
gboolean xaccAccountIsAPARType (GNCAccountType t)
 Convenience function to check if the account is a valid business account type (meaning an Accounts Payable/Accounts Receivable). More...
 
gboolean xaccAccountIsEquityType (GNCAccountType t)
 Convenience function to check if the account is a valid Equity type. More...
 

Account split/transaction list management

SplitListxaccAccountGetSplitList (const Account *account)
 The xaccAccountGetSplitList() routine returns a pointer to a GList of the splits in the account. More...
 
size_t xaccAccountGetSplitsSize (const Account *account)
 
void xaccAccountMoveAllSplits (Account *accfrom, Account *accto)
 The xaccAccountMoveAllSplits() routine reassigns each of the splits in accfrom to accto. More...
 
gint xaccAccountForEachTransaction (const Account *account, TransactionCallback proc, void *data)
 The xaccAccountForEachTransaction() routine will traverse all of the transactions in account and call the callback function proc on each transaction. More...
 
Transaction * xaccAccountFindTransByDesc (const Account *account, const char *description)
 Returns a pointer to the transaction, not a copy. More...
 
Split * xaccAccountFindSplitByDesc (const Account *account, const char *description)
 Returns a pointer to the split, not a copy. More...
 
#define xaccAccountInsertSplit(acc, s)   xaccSplitSetAccount((s), (acc))
 The xaccAccountInsertSplit() method will insert the indicated split into the indicated account. More...
 

Account lots

void xaccAccountInsertLot (Account *, GNCLot *)
 The xaccAccountInsertLot() method will register the indicated lot with this account. More...
 
void xaccAccountRemoveLot (Account *, GNCLot *)
 
LotListxaccAccountGetLotList (const Account *account)
 The xaccAccountGetLotList() routine returns a list of all lots in this account. More...
 
gpointer xaccAccountForEachLot (const Account *acc, gpointer(*proc)(GNCLot *lot, gpointer user_data), gpointer user_data)
 The xaccAccountForEachLot() method will apply the function 'proc' to each lot in the account. More...
 
LotListxaccAccountFindOpenLots (const Account *acc, gboolean(*match_func)(GNCLot *lot, gpointer user_data), gpointer user_data, GCompareFunc sort_func)
 Find a list of open lots that match the match_func. More...
 

Account Reconciliation information getters/setters

gboolean xaccAccountGetReconcileLastDate (const Account *account, time64 *last_date)
 DOCUMENT ME!
 
void xaccAccountSetReconcileLastDate (Account *account, time64 last_date)
 DOCUMENT ME!
 
gboolean xaccAccountGetReconcileLastInterval (const Account *account, int *months, int *days)
 DOCUMENT ME!
 
void xaccAccountSetReconcileLastInterval (Account *account, int months, int days)
 DOCUMENT ME!
 
gboolean xaccAccountGetReconcilePostponeDate (const Account *account, time64 *postpone_date)
 DOCUMENT ME!
 
void xaccAccountSetReconcilePostponeDate (Account *account, time64 postpone_date)
 DOCUMENT ME!
 
gboolean xaccAccountGetReconcilePostponeBalance (const Account *account, gnc_numeric *balance)
 DOCUMENT ME!
 
void xaccAccountSetReconcilePostponeBalance (Account *account, gnc_numeric balance)
 DOCUMENT ME!
 
void xaccAccountClearReconcilePostpone (Account *account)
 DOCUMENT ME!
 

Account Balance Limits

gboolean xaccAccountGetHigherBalanceLimit (const Account *account, gnc_numeric *balance)
 Get the higher balance limit for the account. More...
 
void xaccAccountSetHigherBalanceLimit (Account *account, gnc_numeric balance)
 Set the higher balance limit for the account. More...
 
void xaccAccountClearHigherBalanceLimit (Account *account)
 Clear the higher balance limit for the account. More...
 
gboolean xaccAccountGetLowerBalanceLimit (const Account *account, gnc_numeric *balance)
 Get the lower balance limit for the account. More...
 
void xaccAccountSetLowerBalanceLimit (Account *account, gnc_numeric balance)
 Set the lower balance limit for the account. More...
 
void xaccAccountClearLowerBalanceLimit (Account *account)
 Clear the lower balance limit for the account. More...
 
gboolean xaccAccountGetIncludeSubAccountBalances (const Account *account)
 Get whether to include balances of sub accounts. More...
 
void xaccAccountSetIncludeSubAccountBalances (Account *account, gboolean include)
 Set whether to include balances of sub accounts. More...
 

Account Placeholder flag

gboolean xaccAccountGetPlaceholder (const Account *account)
 Get the "placeholder" flag for an account. More...
 
void xaccAccountSetPlaceholder (Account *account, gboolean val)
 Set the "placeholder" flag for an account. More...
 

Account Append Text flag

gboolean xaccAccountGetAppendText (const Account *account)
 Get the "import-append-text" flag for an account. More...
 
void xaccAccountSetAppendText (Account *account, gboolean val)
 Set the "import-append-text" flag for an account. More...
 
gboolean xaccAccountGetIsOpeningBalance (const Account *account)
 Get the "opening-balance" flag for an account. More...
 
void xaccAccountSetIsOpeningBalance (Account *account, gboolean val)
 Set the "opening-balance" flag for an account. More...
 
GNCPlaceholderType xaccAccountGetDescendantPlaceholder (const Account *account)
 Returns PLACEHOLDER_NONE if account is NULL or neither account nor any descendant of account is a placeholder. More...
 

Account Hidden flag

gboolean xaccAccountGetHidden (const Account *acc)
 Get the "hidden" flag for an account. More...
 
void xaccAccountSetHidden (Account *acc, gboolean val)
 Set the "hidden" flag for an account. More...
 
gboolean xaccAccountIsHidden (const Account *acc)
 Should this account be "hidden". More...
 

Account Auto Interest flag

gboolean xaccAccountGetAutoInterest (const Account *acc)
 Get the "auto interest" flag for an account. More...
 
void xaccAccountSetAutoInterest (Account *acc, gboolean val)
 Set the "auto interest" flag for an account. More...
 

Account Tax related getters/setters

gboolean xaccAccountGetTaxRelated (const Account *account)
 DOCUMENT ME!
 
void xaccAccountSetTaxRelated (Account *account, gboolean tax_related)
 DOCUMENT ME!
 
const char * xaccAccountGetTaxUSCode (const Account *account)
 DOCUMENT ME!
 
void xaccAccountSetTaxUSCode (Account *account, const char *code)
 DOCUMENT ME!
 
const char * xaccAccountGetTaxUSPayerNameSource (const Account *account)
 DOCUMENT ME!
 
void xaccAccountSetTaxUSPayerNameSource (Account *account, const char *source)
 DOCUMENT ME!
 
gint64 xaccAccountGetTaxUSCopyNumber (const Account *account)
 DOCUMENT ME!
 
void xaccAccountSetTaxUSCopyNumber (Account *account, gint64 copy_number)
 DOCUMENT ME!
 

Account type debit/credit string getters

@ { *

const char * gnc_account_get_debit_string (GNCAccountType acct_type)
 Get the debit string associated with this account type.
 
const char * gnc_account_get_credit_string (GNCAccountType acct_type)
 Get the credit string associated with this account type.
 

Account marking

void xaccAccountSetMark (Account *account, short mark)
 Set a mark on the account. More...
 
void xaccClearMark (Account *account, short val)
 Get the mark set by xaccAccountSetMark short xaccAccountGetMark (const Account *account);. More...
 
void xaccClearMarkDown (Account *account, short val)
 The xaccClearMarkDown will clear the mark only in this and in sub-accounts. More...
 

Staged Traversal

The following functions provide support for "staged traversals" over all of the transactions in an account or group.

The idea is to be able to perform a sequence of traversals ("stages"), and perform an operation on each transaction exactly once for that stage.

Only transactions whose current "stage" is less than the stage of the current traversal will be affected, and they will be "brought up" to the current stage when they are processed.

For example, you could perform a stage 1 traversal of all the transactions in an account, and then perform a stage 1 traversal of the transactions in a second account. Presuming the traversal of the first account didn't abort prematurely, any transactions shared by both accounts would be ignored during the traversal of the second account since they had been processed while traversing the first account.

However, if you had traversed the second account using a stage of 2, then all the transactions in the second account would have been processed.

Traversal can be aborted by having the callback function return a non-zero value. The traversal is aborted immediately, and the non-zero value is returned. Note that an aborted traversal can be restarted; no information is lost due to an abort.

The initial impetus for this particular approach came from generalizing a mark/sweep practice that was already being used in FileIO.c.

Note that currently, there is a hard limit of 256 stages, which can be changed by enlarging "marker" in the transaction struct.

void gnc_account_tree_begin_staged_transaction_traversals (Account *acc)
 gnc_account_tree_begin_staged_transaction_traversals() resets the traversal marker inside every transactions of every account in the account tree originating with the specified node. More...
 
void xaccAccountBeginStagedTransactionTraversals (const Account *account)
 xaccAccountBeginStagedTransactionTraversals() resets the traversal marker for each transaction which is a parent of one of the splits in the account.
 
gboolean xaccTransactionTraverse (Transaction *trans, int stage)
 xaccTransactionTraverse() checks the stage of the given transaction. More...
 
int xaccAccountStagedTransactionTraversal (const Account *a, unsigned int stage, TransactionCallback thunk, void *data)
 xaccAccountStagedTransactionTraversal() calls thunk on each transaction in account a whose current marker is less than the given stage and updates each transaction's marker to be stage. More...
 
int gnc_account_tree_staged_transaction_traversal (const Account *account, unsigned int stage, TransactionCallback thunk, void *data)
 gnc_account_tree_staged_transaction_traversal() calls thunk on each transaction in the group whose current marker is less than the given stage and updates each transaction's marker to be stage. More...
 
int xaccAccountTreeForEachTransaction (Account *acc, TransactionCallback proc, void *data)
 Traverse all of the transactions in the given account group. More...
 
Accountgnc_account_imap_find_account (Account *acc, const char *category, const char *key)
 
Accountgnc_account_imap_find_any (QofBook *book, const char *category, const char *key)
 
void gnc_account_imap_add_account (Account *acc, const char *category, const char *key, Account *added_acc)
 
void gnc_account_imap_delete_account (Account *acc, const char *category, const char *key)
 
Accountgnc_account_imap_find_account_bayes (Account *acc, GList *tokens)
 Look up an Account in the map using Baysian. More...
 
void gnc_account_imap_add_account_bayes (Account *acc, GList *tokens, Account *added_acc)
 Updates the imap for a given account using a list of tokens.
 
void gnc_account_imap_info_destroy (GncImapInfo *)
 Clean destructor for the imap_info structure of Bayesian mappings.
 
GList * gnc_account_imap_get_info_bayes (Account *acc)
 Returns a GList of structure imap_info of all Bayesian mappings for required Account.
 
GList * gnc_account_imap_get_info (Account *acc, const char *category)
 Returns a GList of structure imap_info of all Non Bayesian mappings for required Account.
 
gchar * gnc_account_get_map_entry (Account *acc, const char *head, const char *category)
 Returns the text string pointed to by head and category for the Account, free the returned text.
 
void gnc_account_delete_map_entry (Account *acc, char *head, char *category, char *match_string, gboolean empty)
 Delete the entry for Account pointed to by head,category and match_string, if empty is TRUE then use delete if empty.
 
void gnc_account_delete_all_bayes_maps (Account *acc)
 Delete all bayes entries for Account.
 
void gnc_account_reset_convert_bayes_to_flat (void)
 Reset the flag that indicates the function imap_convert_bayes_to_flat has been run.
 

Deprecated Routines.

void DxaccAccountSetCurrency (Account *account, gnc_commodity *currency)
 
gnc_commodity * DxaccAccountGetCurrency (const Account *account)
 
void dxaccAccountSetQuoteTZ (Account *account, const char *tz)
 Set the timezone to be used when interpreting the results from a given Finance::Quote backend. More...
 
const char * dxaccAccountGetQuoteTZ (const Account *account)
 Get the timezone to be used when interpreting the results from a given Finance::Quote backend. More...
 

Account parameter names

#define ACCOUNT_KVP   "kvp"
 
#define ACCOUNT_NAME_   "name"
 
#define ACCOUNT_CODE_   "code"
 
#define ACCOUNT_DESCRIPTION_   "desc"
 
#define ACCOUNT_COLOR_   "color"
 
#define ACCOUNT_FILTER_   "filter"
 
#define ACCOUNT_SORT_ORDER_   "sort-order"
 
#define ACCOUNT_SORT_REVERSED_   "sort-reversed"
 
#define ACCOUNT_NOTES_   "notes"
 
#define ACCOUNT_BALANCE_   "balance"
 
#define ACCOUNT_NOCLOSING_   "noclosing"
 
#define ACCOUNT_OPENING_BALANCE_   "opening-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"
 
#define ACCOUNT_TYPE_   "account-type"
 
#define ACCOUNT_SCU   "smallest-commodity-unit"
 
#define ACCOUNT_NSCU   "non-standard-scu"
 
#define ACCOUNT_PARENT   "parent-account"
 

QofLogModule identifiers

#define GNC_MOD_ROOT   "gnc"
 
#define GNC_MOD_ENGINE   "gnc.engine"
 
#define GNC_MOD_ACCOUNT   "gnc.account"
 
#define GNC_MOD_SX   "gnc.engine.sx"
 
#define GNC_MOD_QUERY   "gnc.query"
 
#define GNC_MOD_SCRUB   "gnc.scrub"
 
#define GNC_MOD_LOT   "gnc.lots"
 
#define GNC_MOD_COMMODITY   "gnc.commodity"
 
#define GNC_MOD_BACKEND   "gnc.backend"
 
#define GNC_MOD_PRICE   "gnc.pricedb"
 
#define GNC_MOD_BUSINESS   "gnc.business"
 
#define GNC_MOD_IO   "gnc.io"
 
#define GNC_MOD_BOOK   "gnc.book-period"
 
#define GNC_MOD_GUI   "gnc.gui"
 
#define GNC_MOD_GUI_SX   "gnc.gui.sx"
 
#define GNC_MOD_GUILE   "gnc.guile"
 
#define GNC_MOD_LEDGER   "gnc.ledger"
 
#define GNC_MOD_REGISTER   "gnc.register"
 
#define GNC_MOD_HTML   "gnc.html"
 
#define GNC_MOD_PREFS   "gnc.pref"
 
#define GNC_MOD_IMPORT   "gnc.import"
 
#define GNC_MOD_ASSISTANT   "gnc.assistant"
 
#define GNC_MOD_BUDGET   "gnc.budget"
 

Detailed Description

The GnuCash Engine provides a set of objects and classes that encapsulate typical financial accounting concepts.

The GnuCash GUI is expected to manipulate these objects through the provided engine API.

Macro Definition Documentation

◆ ACCOUNT_MATCH_ALL_TYPE

#define ACCOUNT_MATCH_ALL_TYPE   "account-match-all"

This is the type-override when you want to match all accounts.

Used in the gnome-search parameter list. Be careful when you use this.

Definition at line 1721 of file Account.h.

◆ GNC_ID_NONE

#define GNC_ID_NONE   QOF_ID_NONE

IDENTIFIERS GncGUID Identifiers can be used to reference Accounts, Transactions, Splits and other objects.

These Gnucash types are referred to as Gnucash entities. GncGUID Identifiers are globally-unique and permanent, i.e., once an entity has been assigned an identifier, it retains that same identifier for its lifetime.

  • Identifiers are 'typed' with strings. The ids used in gnucash are defined below. An id with type GNC_ID_NONE does not refer to any entity, although that may change as new ids are created. An id with type GNC_ID_NULL does not refer to any entity, and will never refer to any entity. An identifier with any other type may refer to an actual entity, but that is not guaranteed. If an id does refer to an entity, the type of the entity will match the type of the identifier.

Definition at line 91 of file gnc-engine.h.

◆ xaccAccountInsertSplit

#define xaccAccountInsertSplit (   acc,
 
)    xaccSplitSetAccount((s), (acc))

The xaccAccountInsertSplit() method will insert the indicated split into the indicated account.

If the split already belongs to another account, it will be removed from that account first.

Definition at line 1048 of file Account.h.

Typedef Documentation

◆ gnc_engine_init_hook_t

typedef void(* gnc_engine_init_hook_t) (int, char **)

Function type for init hooks in the engine.

Definition at line 221 of file gnc-engine.h.

Function Documentation

◆ account_type_list() [1/3]

GList * GncOption::account_type_list ( ) const
noexcept

Implemented only for GncOptionAccountListValue.

Definition at line 414 of file gnc-option.cpp.

415 {
416  return std::visit([] (const auto& option) -> GList* {
417  if constexpr (std::is_same_v<std::decay_t<decltype(option)>,
419  return option.account_type_list();
420  else
421  return nullptr;
422  }, *m_option);
423 }
Set one or more accounts on which to report, optionally restricted to certain account types...
GList * account_type_list() const noexcept
Implemented only for GncOptionAccountListValue.
Definition: gnc-option.cpp:414

◆ account_type_list() [2/3]

GList * GncOptionAccountListValue::account_type_list ( ) const
noexcept

Create a GList of account types to pass to gnc_account_sel_set_acct_filters.

gnc_account_sel_set_acct_filters copies the list so the intermediary caller is responsible for freeing the list.

Returns
an allocated GList* or nullptr if the list is empty.

Definition at line 462 of file gnc-option-impl.cpp.

463 {
464  if (m_allowed.empty())
465  return nullptr;
466  GList* retval{nullptr};
467  for (auto type : m_allowed)
468  retval = g_list_prepend(retval, GINT_TO_POINTER(type));
469  return g_list_reverse(retval);
470 }

◆ account_type_list() [3/3]

GList * GncOptionAccountSelValue::account_type_list ( ) const
noexcept

Create a GList of account types to pass to gnc_account_sel_set_acct_filters.

gnc_account_sel_set_acct_filters copies the list so the intermediary caller is responsible for freeing the list.

Returns
an allocated GList* or nullptr if the list is empty.

Definition at line 533 of file gnc-option-impl.cpp.

534 {
535  if (m_allowed.empty())
536  return nullptr;
537  GList* retval{nullptr};
538  for (auto type : m_allowed)
539  retval = g_list_prepend(retval, GINT_TO_POINTER(type));
540  return g_list_reverse(retval);
541 }

◆ deserialize()

bool GncOption::deserialize ( const std::string &  str)

Set the option's value from a character sequence.

Parameters
strThe character sequence representing the value
Returns
true if the value was set, false otherwise.

Definition at line 455 of file gnc-option.cpp.

456 {
457  return std::visit([&str](auto& option) -> bool {
458  return option.deserialize(str);
459  }, *m_option);
460 }

◆ DxaccAccountGetCurrency()

gnc_commodity* DxaccAccountGetCurrency ( const Account account)
Deprecated:
The current API associates only one thing with an account: the 'commodity'.

Use xaccAccountGetCommodity() to fetch it.

Definition at line 3427 of file Account.cpp.

3428 {
3429  GValue v = G_VALUE_INIT;
3430  const char *s = nullptr;
3431  gnc_commodity_table *table;
3432  gnc_commodity *retval = nullptr;
3433 
3434  if (!acc) return nullptr;
3435  qof_instance_get_path_kvp (QOF_INSTANCE(acc), &v, {"old-currency"});
3436  if (G_VALUE_HOLDS_STRING (&v))
3437  s = g_value_get_string (&v);
3438  if (s)
3439  {
3441  retval = gnc_commodity_table_lookup_unique (table, s);
3442  }
3443  g_value_unset (&v);
3444 
3445  return retval;
3446 }
gnc_commodity_table * gnc_commodity_table_get_table(QofBook *book)
Returns the commodity table associated with a book.
QofBook * qof_instance_get_book(gconstpointer inst)
Return the book pointer.

◆ dxaccAccountGetQuoteTZ()

const char* dxaccAccountGetQuoteTZ ( const Account account)

Get the timezone to be used when interpreting the results from a given Finance::Quote backend.

Unfortunately, the upstream sources don't label their output, so the user has to specify this bit. This function uses a static char*.

Deprecated:
Price quote information is now stored on the commodity, not the account.

Definition at line 5292 of file Account.cpp.

5293 {
5294  if (!acc) return nullptr;
5295  if (!xaccAccountIsPriced(acc)) return nullptr;
5296  GValue v = G_VALUE_INIT;
5297  auto rv = get_kvp_string_tag (acc, "old-quote-tz", &v);
5298  g_value_unset (&v);
5299  return rv;
5300 }
gboolean xaccAccountIsPriced(const Account *acc)
Returns true if the account is a stock, mutual fund or currency, otherwise false. ...
Definition: Account.cpp:4680

◆ DxaccAccountSetCurrency()

void DxaccAccountSetCurrency ( Account account,
gnc_commodity *  currency 
)
Deprecated:
The current API associates only one thing with an account: the 'commodity'.

Use xaccAccountGetCommodity() to fetch it.

These two funcs take control of their gnc_commodity args. Don't free

Definition at line 2726 of file Account.cpp.

2727 {
2728  QofBook *book;
2729  GValue v = G_VALUE_INIT;
2730  const char *s = gnc_commodity_get_unique_name (currency);
2731  gnc_commodity *commodity;
2732  gnc_commodity_table *table;
2733 
2734  if ((!acc) || (!currency)) return;
2735  g_value_init (&v, G_TYPE_STRING);
2736  g_value_set_static_string (&v, s);
2737  qof_instance_set_path_kvp (QOF_INSTANCE (acc), &v, {"old-currency"});
2738  mark_account (acc);
2739  xaccAccountCommitEdit(acc);
2740  g_value_unset (&v);
2741 
2743  commodity = gnc_commodity_table_lookup_unique (table, s);
2744 
2745  if (!commodity)
2746  {
2747  book = qof_instance_get_book(acc);
2749  currency);
2750  }
2751 }
gnc_commodity * gnc_commodity_table_insert(gnc_commodity_table *table, gnc_commodity *comm)
Add a new commodity to the commodity table.
gnc_commodity_table * gnc_commodity_table_get_table(QofBook *book)
Returns the commodity table associated with a book.
QofBook * qof_instance_get_book(gconstpointer inst)
Return the book pointer.
const char * gnc_commodity_get_unique_name(const gnc_commodity *cm)
Retrieve the &#39;unique&#39; name for the specified commodity.
void xaccAccountCommitEdit(Account *acc)
ThexaccAccountCommitEdit() subroutine is the second phase of a two-phase-commit wrapper for account u...
Definition: Account.cpp:1508

◆ dxaccAccountSetQuoteTZ()

void dxaccAccountSetQuoteTZ ( Account account,
const char *  tz 
)

Set the timezone to be used when interpreting the results from a given Finance::Quote backend.

Unfortunately, the upstream sources don't label their output, so the user has to specify this bit.

Deprecated:
Price quote information is now stored on the commodity, not the account.

Definition at line 5281 of file Account.cpp.

5282 {
5283  if (!acc) return;
5284  if (!xaccAccountIsPriced(acc)) return;
5285  set_kvp_string_tag (acc, "old-quote-tz", tz);
5286 }
gboolean xaccAccountIsPriced(const Account *acc)
Returns true if the account is a stock, mutual fund or currency, otherwise false. ...
Definition: Account.cpp:4680

◆ gnc_account_imap_find_account_bayes()

Account* gnc_account_imap_find_account_bayes ( Account acc,
GList *  tokens 
)

Look up an Account in the map using Baysian.

Look up an Account in the map using Baysian.

Definition at line 5996 of file Account.cpp.

5997 {
5998  if (!acc)
5999  return nullptr;
6000  auto book = gnc_account_get_book(acc);
6001  check_import_map_data (book);
6002  auto first_pass = get_first_pass_probabilities(acc, tokens);
6003  if (!first_pass.size())
6004  return nullptr;
6005  auto final_probabilities = build_probabilities(first_pass);
6006  if (!final_probabilities.size())
6007  return nullptr;
6008  auto best = highest_probability(final_probabilities);
6009  if (best.account_guid == "")
6010  return nullptr;
6011  if (best.probability < threshold)
6012  return nullptr;
6013  gnc::GUID guid;
6014  try {
6015  guid = gnc::GUID::from_string(best.account_guid);
6016  } catch (gnc::guid_syntax_exception&) {
6017  return nullptr;
6018  }
6019  auto account = xaccAccountLookup (reinterpret_cast<GncGUID*>(&guid), book);
6020  return account;
6021 }
Account * xaccAccountLookup(const GncGUID *guid, QofBook *book)
The xaccAccountLookup() subroutine will return the account associated with the given id...
Definition: Account.cpp:2046

◆ gnc_account_lookup_by_name()

Account* gnc_account_lookup_by_name ( const Account parent,
const char *  name 
)

The gnc_account_lookup_by_name() subroutine fetches the account by name from the descendants of the specified account.

The immediate children are searched first. If there is no match, then a recursive search of all descendants is performed looking for a match.

Returns
A pointer to the account with the specified name, or NULL if the account was not found.

Definition at line 3068 of file Account.cpp.

3069 {
3070  return (Account*)account_foreach_descendant_breadthfirst_until (parent, is_acct_name, (char*)name);
3071 }
STRUCTS.

◆ gnc_account_lookup_by_opening_balance()

Account* gnc_account_lookup_by_opening_balance ( Account account,
gnc_commodity *  commodity 
)

Find the opening balance account for the currency.

Parameters
accountThe account of which the sought-for account is a descendant.
commodityThe commodity in which the account should be denominated
Returns
The descendant account of EQUITY_TYPE_OPENING_BALANCE or NULL if one doesn't exist.

Definition at line 3096 of file Account.cpp.

3097 {
3098  return (Account *)gnc_account_foreach_descendant_until (account, is_opening_balance_account, commodity);
3099 }
STRUCTS.
gpointer gnc_account_foreach_descendant_until(const Account *acc, AccountCb2 thunk, gpointer user_data)
This method will traverse all children of this accounts and their descendants, calling &#39;func&#39; on each...
Definition: Account.cpp:3238

◆ gnc_account_lookup_by_type_and_commodity()

GList* gnc_account_lookup_by_type_and_commodity ( Account root,
const char *  name,
GNCAccountType  acctype,
gnc_commodity *  commodity 
)

Find a direct child account matching name, GNCAccountType, and/or commodity.

Name and commodity may be nullptr in which case the accounts in the list may have any value for those properties. Note that commodity matching is by equivalence: If the mnemonic/symbol and namespace are the same, it matches.

Parameters
rootThe account among whose children one expects to find the account.
nameThe name of the account to look for or nullptr.
acctypeThe GNCAccountType to match.
commodityThe commodity in which the account should be denominated or nullptr.
Returns
A GList of children matching the supplied parameters.

Definition at line 3173 of file Account.cpp.

3177 {
3178  GList *retval{};
3179  auto rpriv{GET_PRIVATE(root)};
3180  for (auto node = rpriv->children; node; node = node->next)
3181  {
3182  auto account{static_cast<Account*>(node->data)};
3183  if (xaccAccountGetType (account) == acctype)
3184  {
3185  if (commodity &&
3187  commodity))
3188  continue;
3189 
3190  if (name && strcmp(name, xaccAccountGetName(account)))
3191  continue;
3192 
3193  retval = g_list_prepend(retval, account);
3194  }
3195  }
3196 
3197  if (!retval) // Recurse through the children
3198  for (auto node = rpriv->children; node; node = node->next)
3199  {
3200  auto account{static_cast<Account*>(node->data)};
3201  auto result = gnc_account_lookup_by_type_and_commodity(account,
3202  name,
3203  acctype,
3204  commodity);
3205  if (result)
3206  retval = g_list_concat(result, retval);
3207  }
3208  return retval;
3209 }
GNCAccountType xaccAccountGetType(const Account *acc)
Returns the account&#39;s account type.
Definition: Account.cpp:3264
STRUCTS.
gnc_commodity * xaccAccountGetCommodity(const Account *acc)
Get the account&#39;s commodity.
Definition: Account.cpp:3449
const char * xaccAccountGetName(const Account *acc)
Get the account&#39;s name.
Definition: Account.cpp:3286
gboolean gnc_commodity_equiv(const gnc_commodity *a, const gnc_commodity *b)
This routine returns TRUE if the two commodities are equivalent.
GList * gnc_account_lookup_by_type_and_commodity(Account *root, const char *name, GNCAccountType acctype, gnc_commodity *commodity)
Find a direct child account matching name, GNCAccountType, and/or commodity.
Definition: Account.cpp:3173

◆ gnc_account_tree_begin_staged_transaction_traversals()

void gnc_account_tree_begin_staged_transaction_traversals ( Account acc)

gnc_account_tree_begin_staged_transaction_traversals() resets the traversal marker inside every transactions of every account in the account tree originating with the specified node.

This is done so that a new sequence of staged traversals can begin.

Definition at line 5511 of file Account.cpp.

5512 {
5513  GList *descendants;
5514 
5515  descendants = gnc_account_get_descendants(account);
5516  g_list_foreach(descendants, (GFunc)do_one_account, nullptr);
5517  g_list_free(descendants);
5518 }
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...
Definition: Account.cpp:3021

◆ gnc_account_tree_staged_transaction_traversal()

int gnc_account_tree_staged_transaction_traversal ( const Account account,
unsigned int  stage,
TransactionCallback  thunk,
void *  data 
)

gnc_account_tree_staged_transaction_traversal() calls thunk on each transaction in the group whose current marker is less than the given stage and updates each transaction's marker to be stage.

The traversal will stop if thunk returns a non-zero value. gnc_account_tree_staged_transaction_traversal() function will return zero or the non-zero value returned by thunk. This API does not handle handle recursive traversals.

Warning
For performance reasons, the transaction callback thunk must never destroy any of the transaction's splits, nor assign any of them to a different account. To do so risks a crash.

Definition at line 5547 of file Account.cpp.

5551 {
5552  const AccountPrivate *priv;
5553  Transaction *trans;
5554  int retval;
5555 
5556  if (!acc) return 0;
5557 
5558  /* depth first traversal */
5559  priv = GET_PRIVATE(acc);
5560  for (auto acc_p = priv->children; acc_p; acc_p = g_list_next(acc_p))
5561  {
5562  retval = gnc_account_tree_staged_transaction_traversal(static_cast <Account*> (acc_p->data),
5563  stage, thunk, cb_data);
5564  if (retval) return retval;
5565  }
5566 
5567  /* Now this account */
5568  for (auto s : priv->splits)
5569  {
5570  trans = s->parent;
5571  if (trans && (trans->marker < stage))
5572  {
5573  trans->marker = stage;
5574  if (thunk)
5575  {
5576  retval = thunk(trans, cb_data);
5577  if (retval) return retval;
5578  }
5579  }
5580  }
5581 
5582  return 0;
5583 }
int gnc_account_tree_staged_transaction_traversal(const Account *acc, unsigned int stage, TransactionCallback thunk, void *cb_data)
gnc_account_tree_staged_transaction_traversal() calls thunk on each transaction in the group whose cu...
Definition: Account.cpp:5547

◆ gnc_engine_init()

void gnc_engine_init ( int  argc,
char **  argv 
)

PROTOTYPES.

gnc_engine_init should be called before gnc engine functions can be used.

Definition at line 116 of file gnc-engine.cpp.

117 {
118  if (1 == engine_is_initialized) return;
119 
120  gnc_engine_init_part1();
121  gnc_engine_init_part2();
122  gnc_engine_init_part3(argc, argv);
123 }

◆ gnc_engine_init_static()

void gnc_engine_init_static ( int  argc,
char **  argv 
)

This is the statically linked-in version of gnc_engine_init.

It is identical to that function except that it doesn't load any backend library.

Definition at line 126 of file gnc-engine.cpp.

127 {
128  if (1 == engine_is_initialized) return;
129 
130  gnc_engine_init_part1();
131  gnc_engine_init_part3(argc, argv);
132 }

◆ gnc_engine_shutdown()

void gnc_engine_shutdown ( void  )

Called to shutdown the engine.

Definition at line 141 of file gnc-engine.cpp.

142 {
144  qof_close();
145  engine_is_initialized = 0;
146 }
void qof_log_shutdown(void)
Be nice, close the logfile if possible.
Definition: qoflog.cpp:264
void qof_close(void)
Safely close down the Query Object Framework.
Definition: qofutil.cpp:269

◆ in_stream()

std::istream & GncOption::in_stream ( std::istream &  iss)

Set the option's value from an input stream.

Parameters
issAn input stream reference.
Returns
the stream reference for chaining.

Definition at line 463 of file gnc-option.cpp.

464 {
465  return std::visit([&iss](auto& option) -> std::istream& {
466  iss >> option;
467  return iss;
468  }, *m_option);
469 }

◆ is_changed()

bool GncOption::is_changed ( ) const
noexcept
Returns
true if the option value differs from its default value.

Definition at line 314 of file gnc-option.cpp.

315 {
316  return std::visit([](const auto& option)->bool {
317  return option.is_changed();
318  }, *m_option);
319 }

◆ is_dirty()

bool GncOption::is_dirty ( ) const
noexcept
Returns
true if the option has been marked as needing to be saved.

Definition at line 306 of file gnc-option.cpp.

307 {
308  return std::visit([](const auto& option)->bool {
309  return option.is_dirty();
310  }, *m_option);
311 }

◆ is_multiselect()

bool GncOption::is_multiselect ( ) const
noexcept
Returns
false unless m_option contains a GncOptionMultiselectValue or GncOptionAccountListValue for which multiple selections have been enabled.

Definition at line 322 of file gnc-option.cpp.

323 {
324  return std::visit(
325  [](const auto& option)->bool {
326  if constexpr (is_same_decayed_v<decltype(option),
328  return option.is_multiselect();
329  else
330  return false;
331  }, *m_option);
332 }
bool is_multiselect() const noexcept
Definition: gnc-option.cpp:322
Set one or more accounts on which to report, optionally restricted to certain account types...

◆ mark_saved()

void GncOption::mark_saved ( )
noexcept

Mark the option as needing to be saved.

Definition at line 298 of file gnc-option.cpp.

299 {
300  std::visit([](auto& option)->void {
301  option.mark_saved();
302  }, *m_option);
303 }

◆ num_permissible_values()

std::uint16_t GncOption::num_permissible_values ( ) const

Implemented only for GncOptionMultiselectValue.

Definition at line 356 of file gnc-option.cpp.

357 {
358  return std::visit(
359  [] (const auto& option) -> uint16_t {
360  if constexpr (is_same_decayed_v<decltype(option),
362  is_same_decayed_v<decltype(option),
364  return option.num_permissible_values();
365  else
366  return uint16_t_max;
367  }, *m_option);
368 }
A legal date value is a pair of either a RelativeDatePeriod, the absolute flag and a time64...
Multichoice options have a vector of valid options (GncMultichoiceOptionChoices) and validate the sel...
uint16_t num_permissible_values() const
Implemented only for GncOptionMultiselectValue.
Definition: gnc-option.cpp:356

◆ permissible_value()

const char * GncOption::permissible_value ( uint16_t  index) const

Implemented only for GncOptionMultiselectValue.

Definition at line 386 of file gnc-option.cpp.

387 {
388  return std::visit([index] (const auto& option) -> const char* {
389  if constexpr (std::is_same_v<std::decay_t<decltype(option)>,
391  std::is_same_v<std::decay_t<decltype(option)>,
393  return option.permissible_value(index);
394  else
395  return "";
396  }, *m_option);
397 }
A legal date value is a pair of either a RelativeDatePeriod, the absolute flag and a time64...
Multichoice options have a vector of valid options (GncMultichoiceOptionChoices) and validate the sel...
const char * permissible_value(uint16_t index) const
Implemented only for GncOptionMultiselectValue.
Definition: gnc-option.cpp:386

◆ permissible_value_index()

std::uint16_t GncOption::permissible_value_index ( const char *  value) const

Implemented only for GncOptionMultiselectValue.

Definition at line 371 of file gnc-option.cpp.

372 {
373  return std::visit(
374  [&value] (const auto& option) -> uint16_t {
375  if constexpr (is_same_decayed_v<decltype(option),
377  is_same_decayed_v<decltype(option),
379  return option.permissible_value_index(value);
380  else
381  return uint16_t_max;
382  }, *m_option);
383 }
uint16_t permissible_value_index(const char *value) const
Implemented only for GncOptionMultiselectValue.
Definition: gnc-option.cpp:371
A legal date value is a pair of either a RelativeDatePeriod, the absolute flag and a time64...
Multichoice options have a vector of valid options (GncMultichoiceOptionChoices) and validate the sel...

◆ permissible_value_name()

const char * GncOption::permissible_value_name ( uint16_t  index) const

Implemented only for GncOptionMultiselectValue.

Definition at line 400 of file gnc-option.cpp.

401 {
402  return std::visit([index] (const auto& option) -> const char* {
403  if constexpr (std::is_same_v<std::decay_t<decltype(option)>,
405  std::is_same_v<std::decay_t<decltype(option)>,
407  return option.permissible_value_name(index);
408  else
409  return "";
410  }, *m_option);
411 }
A legal date value is a pair of either a RelativeDatePeriod, the absolute flag and a time64...
Multichoice options have a vector of valid options (GncMultichoiceOptionChoices) and validate the sel...
const char * permissible_value_name(uint16_t index) const
Implemented only for GncOptionMultiselectValue.
Definition: gnc-option.cpp:400

◆ serialize()

std::string GncOption::serialize ( ) const

Get a string suitable for storage representing the option's value.

Returns
a std::string

Definition at line 445 of file gnc-option.cpp.

446 {
447  if (m_option->valueless_by_exception())
448  return "Valueless Option";
449  return std::visit([&](auto& option) -> std::string {
450  return option.serialize();
451  }, *m_option);
452 }

◆ validate()

template<typename ValueType >
template bool GncOption::validate ( ValueType  value) const

Not implemented for GncOptionValue.

Definition at line 335 of file gnc-option.cpp.

336 {
337  return std::visit(
338  [value] (const auto& option) -> bool {
339  if constexpr ((is_same_decayed_v<decltype(option),
341  is_same_decayed_v<ValueType, std::string>) ||
342  (is_same_decayed_v<decltype(option),
344  is_same_decayed_v<ValueType,
345  GncMultichoiceOptionIndexVec>) ||
346  (is_same_decayed_v<decltype(option),
348  is_same_decayed_v<ValueType, gnc_commodity*>))
349  return option.validate(value);
350  else
351  return false;
352  }, *m_option);
353 }
Multichoice options have a vector of valid options (GncMultichoiceOptionChoices) and validate the sel...
class GncOptionCommodityValue Commodities are stored with their namespace and mnemonic instead of the...

◆ xaccAccountClearHigherBalanceLimit()

void xaccAccountClearHigherBalanceLimit ( Account account)

Clear the higher balance limit for the account.

Parameters
accountThe account to clear the limit on

Definition at line 5107 of file Account.cpp.

5108 {
5109  g_return_if_fail (GNC_IS_ACCOUNT(acc));
5110 
5111  clear_balance_limits (acc, true);
5112 }

◆ xaccAccountClearLowerBalanceLimit()

void xaccAccountClearLowerBalanceLimit ( Account account)

Clear the lower balance limit for the account.

Parameters
accountThe account to clear the limit on

Definition at line 5115 of file Account.cpp.

5116 {
5117  g_return_if_fail (GNC_IS_ACCOUNT(acc));
5118 
5119  clear_balance_limits (acc, false);
5120 }

◆ xaccAccountFindOpenLots()

LotList* xaccAccountFindOpenLots ( const Account acc,
gboolean(*)(GNCLot *lot, gpointer user_data)  match_func,
gpointer  user_data,
GCompareFunc  sort_func 
)

Find a list of open lots that match the match_func.

Sort according to sort_func. If match_func is NULL, then all open lots are returned. If sort_func is NULL, then the returned list has no particular order. The caller must free to returned list.

Definition at line 4038 of file Account.cpp.

4042 {
4043  AccountPrivate *priv;
4044  GList *lot_list;
4045  GList *retval = nullptr;
4046 
4047  g_return_val_if_fail(GNC_IS_ACCOUNT(acc), nullptr);
4048 
4049  priv = GET_PRIVATE(acc);
4050  for (lot_list = priv->lots; lot_list; lot_list = lot_list->next)
4051  {
4052  GNCLot *lot = static_cast<GNCLot*>(lot_list->data);
4053 
4054  /* If this lot is closed, then ignore it */
4055  if (gnc_lot_is_closed (lot))
4056  continue;
4057 
4058  if (match_func && !(match_func)(lot, user_data))
4059  continue;
4060 
4061  /* Ok, this is a valid lot. Add it to our list of lots */
4062  retval = g_list_prepend (retval, lot);
4063  }
4064 
4065  if (sort_func)
4066  retval = g_list_sort (retval, sort_func);
4067 
4068  return retval;
4069 }
gboolean gnc_lot_is_closed(GNCLot *lot)
The gnc_lot_is_closed() routine returns a boolean flag: is this lot closed? A lot is closed if its ba...
Definition: gnc-lot.cpp:367

◆ xaccAccountFindSplitByDesc()

Split* xaccAccountFindSplitByDesc ( const Account account,
const char *  description 
)

Returns a pointer to the split, not a copy.

Definition at line 5349 of file Account.cpp.

5350 {
5351  auto has_description = [description](const Split* s) -> bool
5352  { return !g_strcmp0 (description, xaccTransGetDescription (xaccSplitGetParent (s))); };
5353  return gnc_account_find_split (acc, has_description, true);
5354 }
Transaction * xaccSplitGetParent(const Split *split)
Returns the parent transaction of the split.
const char * xaccTransGetDescription(const Transaction *trans)
Gets the transaction Description.
Split * gnc_account_find_split(const Account *acc, std::function< bool(const Split *)> predicate, bool reverse)
scans account split list (in forward or reverse order) until predicate split->bool returns true...
Definition: Account.cpp:1155

◆ xaccAccountFindTransByDesc()

Transaction* xaccAccountFindTransByDesc ( const Account account,
const char *  description 
)

Returns a pointer to the transaction, not a copy.

Definition at line 5362 of file Account.cpp.

5363 {
5364  auto split = xaccAccountFindSplitByDesc (acc, description);
5365  return split ? xaccSplitGetParent (split) : nullptr;
5366 }
Transaction * xaccSplitGetParent(const Split *split)
Returns the parent transaction of the split.
Split * xaccAccountFindSplitByDesc(const Account *acc, const char *description)
Returns a pointer to the split, not a copy.
Definition: Account.cpp:5349

◆ xaccAccountForEachLot()

gpointer xaccAccountForEachLot ( const Account acc,
gpointer(*)(GNCLot *lot, gpointer user_data)  proc,
gpointer  user_data 
)

The xaccAccountForEachLot() method will apply the function 'proc' to each lot in the account.

If 'proc' returns a non-NULL value, further application will be stopped, and the resulting value will be returned. There is no guaranteed order over which the Lots will be traversed.

◆ xaccAccountForEachTransaction()

gint xaccAccountForEachTransaction ( const Account account,
TransactionCallback  proc,
void *  data 
)

The xaccAccountForEachTransaction() routine will traverse all of the transactions in account and call the callback function proc on each transaction.

Processing will continue if-and-only-if proc returns 0. The user data pointer data will be passed on to the callback function proc.

This function does not descend recursively to traverse transactions in child accounts.

proc will be called exactly once for each transaction that is pointed to by at least one split in the given account.

The result of this function will be 0 if and only if every relevant transaction was traversed exactly once. Else the return value is the last non-zero value returned by proc.

Warning
For performance reasons, the transaction callback proc must never destroy any of the transaction's splits, nor assign any of them to a different account. To do so risks a crash.
The traversal occurs only over the transactions that are locally cached in the local gnucash engine. If the gnucash engine is attached to a remote database, the database may contain (many) transactions that are not mirrored in the local cache. This routine will not cause an SQL database query to be performed; it will not traverse transactions present only in the remote database.

Definition at line 5601 of file Account.cpp.

5603 {
5604  if (!acc || !proc) return 0;
5606  return xaccAccountStagedTransactionTraversal(acc, 42, proc, data);
5607 }
void xaccAccountBeginStagedTransactionTraversals(const Account *account)
xaccAccountBeginStagedTransactionTraversals() resets the traversal marker for each transaction which ...
Definition: Account.cpp:5481
int xaccAccountStagedTransactionTraversal(const Account *acc, unsigned int stage, TransactionCallback thunk, void *cb_data)
xaccAccountStagedTransactionTraversal() calls thunk on each transaction in account a whose current ma...
Definition: Account.cpp:5521

◆ xaccAccountGetAppendText()

gboolean xaccAccountGetAppendText ( const Account account)

Get the "import-append-text" flag for an account.

This is the saved state of the Append checkbox in the "Generic import transaction matcher" used to set the initial state of the Append checkbox next time this account is imported.

Parameters
accountThe account whose flag should be retrieved.
Returns
The current state of the account's "import-append-text" flag.

Definition at line 4247 of file Account.cpp.

4248 {
4249  return boolean_from_key(acc, {"import-append-text"});
4250 }

◆ xaccAccountGetAutoInterest()

gboolean xaccAccountGetAutoInterest ( const Account acc)

Get the "auto interest" flag for an account.

If this flag is set then the account (and any children) will trigger an interest transfer after reconciling.

Parameters
accThe account whose flag should be retrieved.
Returns
The current state of the account's "auto interest" flag.

Definition at line 4304 of file Account.cpp.

4305 {
4306  return boolean_from_key (acc, {KEY_RECONCILE_INFO, "auto-interest-transfer"});
4307 }

◆ xaccAccountGetDescendantPlaceholder()

GNCPlaceholderType xaccAccountGetDescendantPlaceholder ( const Account account)

Returns PLACEHOLDER_NONE if account is NULL or neither account nor any descendant of account is a placeholder.

If account is a placeholder, returns PLACEHOLDER_THIS. Otherwise, if any descendant of account is a placeholder, return PLACEHOLDER_CHILD.

Definition at line 4280 of file Account.cpp.

4281 {
4282  GList *descendants, *node;
4283  GNCPlaceholderType ret = PLACEHOLDER_NONE;
4284 
4285  g_return_val_if_fail(GNC_IS_ACCOUNT(acc), PLACEHOLDER_NONE);
4286  if (xaccAccountGetPlaceholder(acc)) return PLACEHOLDER_THIS;
4287 
4288  descendants = gnc_account_get_descendants(acc);
4289  for (node = descendants; node; node = node->next)
4290  if (xaccAccountGetPlaceholder((Account *) node->data))
4291  {
4292  ret = PLACEHOLDER_CHILD;
4293  break;
4294  }
4295 
4296  g_list_free(descendants);
4297  return ret;
4298 }
STRUCTS.
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...
Definition: Account.cpp:3021
GNCPlaceholderType
DOCUMENT ME!
Definition: Account.h:1261
gboolean xaccAccountGetPlaceholder(const Account *acc)
Get the "placeholder" flag for an account.
Definition: Account.cpp:4235

◆ xaccAccountGetHidden()

gboolean xaccAccountGetHidden ( const Account acc)

Get the "hidden" flag for an account.

If this flag is set then the account (and any children) will be hidden from the user unless they explicitly ask to see them.

Parameters
accThe account whose flag should be retrieved.
Returns
The current state of the account's "hidden" flag.

Definition at line 4319 of file Account.cpp.

4320 {
4321  return boolean_from_key (acc, {"hidden"});
4322 }

◆ xaccAccountGetHigherBalanceLimit()

gboolean xaccAccountGetHigherBalanceLimit ( const Account account,
gnc_numeric *  balance 
)

Get the higher balance limit for the account.

Parameters
accountThe account whose higher limit is to be retrieved
balanceThe placeholder to store the retrieved balance
Returns
True if the limit is valid.

Definition at line 4931 of file Account.cpp.

4933 {
4934  g_return_val_if_fail (GNC_IS_ACCOUNT(acc), false);
4935 
4936  if (GET_PRIVATE(acc)->higher_balance_limit.has_value())
4937  {
4938  *balance = GET_PRIVATE(acc)->higher_balance_limit.value();
4939 
4940  if (gnc_numeric_check (*balance) == 0)
4941  return true;
4942  else
4943  return false;
4944  }
4945  else
4946  {
4947  gnc_numeric bal = gnc_numeric_create (1,0);
4948  GValue v = G_VALUE_INIT;
4949  gboolean retval = false;
4950 
4951  qof_instance_get_path_kvp (QOF_INSTANCE(acc), &v, {KEY_BALANCE_LIMIT,
4952  KEY_BALANCE_HIGHER_LIMIT_VALUE});
4953  if (G_VALUE_HOLDS_BOXED(&v))
4954  {
4955  bal = *(gnc_numeric*)g_value_get_boxed (&v);
4956  if (bal.denom)
4957  {
4958  if (balance)
4959  *balance = bal;
4960  retval = true;
4961  }
4962  }
4963  g_value_unset (&v);
4964 
4965  GET_PRIVATE(acc)->higher_balance_limit = bal;
4966  return retval;
4967  }
4968 }
GNCNumericErrorCode gnc_numeric_check(gnc_numeric in)
Check for error signal in value.

◆ xaccAccountGetIncludeSubAccountBalances()

gboolean xaccAccountGetIncludeSubAccountBalances ( const Account account)

Get whether to include balances of sub accounts.

Parameters
accountThe account to get setting on
Returns
TRUE to include, default is FALSE

Definition at line 5123 of file Account.cpp.

5124 {
5125  g_return_val_if_fail (GNC_IS_ACCOUNT(acc), false);
5126 
5127  if (!GET_PRIVATE(acc)->include_sub_account_balances.has_value())
5128  {
5129  gboolean inc_sub = boolean_from_key (acc, {KEY_BALANCE_LIMIT,
5130  KEY_BALANCE_INCLUDE_SUB_ACCTS});
5131 
5132  GET_PRIVATE(acc)->include_sub_account_balances = inc_sub;
5133  }
5134  return GET_PRIVATE(acc)->include_sub_account_balances.value();
5135 }

◆ xaccAccountGetIsOpeningBalance()

gboolean xaccAccountGetIsOpeningBalance ( const Account account)

Get the "opening-balance" flag for an account.

If this flag is set then the account is used for opening balance transactions.

Parameters
accountThe account whose flag should be retrieved.
Returns
The current state of the account's "opening-balance" flag.

Definition at line 4259 of file Account.cpp.

4260 {
4261  if (GET_PRIVATE(acc)->type != ACCT_TYPE_EQUITY)
4262  return false;
4263 
4264  GValue v = G_VALUE_INIT;
4265  auto rv = !g_strcmp0 (get_kvp_string_tag (acc, "equity-type", &v),
4266  "opening-balance");
4267  g_value_unset (&v);
4268  return rv;
4269 }
Equity account is used to balance the balance sheet.
Definition: Account.h:146

◆ xaccAccountGetLotList()

LotList* xaccAccountGetLotList ( const Account account)

The xaccAccountGetLotList() routine returns a list of all lots in this account.

Parameters
accountThe account whose lots should be returned.
Returns
A GList of lot pointers, or NULL if there are no lots in this account children. It is the callers responsibility to free any returned list with the g_list_free() function.

Definition at line 4031 of file Account.cpp.

4032 {
4033  g_return_val_if_fail(GNC_IS_ACCOUNT(acc), nullptr);
4034  return g_list_copy(GET_PRIVATE(acc)->lots);
4035 }

◆ xaccAccountGetLowerBalanceLimit()

gboolean xaccAccountGetLowerBalanceLimit ( const Account account,
gnc_numeric *  balance 
)

Get the lower balance limit for the account.

Parameters
accountThe account whose lower limit is to be retrieved
balanceThe placeholder to store the retrieved balance
Returns
True if the limit is valid.

Definition at line 4971 of file Account.cpp.

4973 {
4974  g_return_val_if_fail (GNC_IS_ACCOUNT(acc), false);
4975 
4976  if (GET_PRIVATE(acc)->lower_balance_limit.has_value())
4977  {
4978  *balance = GET_PRIVATE(acc)->lower_balance_limit.value();
4979 
4980  if (gnc_numeric_check (*balance) == 0)
4981  return true;
4982  else
4983  return false;
4984  }
4985  else
4986  {
4987  gnc_numeric bal = gnc_numeric_create (1,0);
4988  GValue v = G_VALUE_INIT;
4989  gboolean retval = false;
4990 
4991  qof_instance_get_path_kvp (QOF_INSTANCE(acc), &v, {KEY_BALANCE_LIMIT,
4992  KEY_BALANCE_LOWER_LIMIT_VALUE});
4993  if (G_VALUE_HOLDS_BOXED(&v))
4994  {
4995  bal = *(gnc_numeric*)g_value_get_boxed (&v);
4996  if (bal.denom)
4997  {
4998  if (balance)
4999  *balance = bal;
5000  retval = true;
5001  }
5002  }
5003  g_value_unset (&v);
5004 
5005  GET_PRIVATE(acc)->lower_balance_limit = bal;
5006  return retval;
5007  }
5008 }
GNCNumericErrorCode gnc_numeric_check(gnc_numeric in)
Check for error signal in value.

◆ xaccAccountGetPlaceholder()

gboolean xaccAccountGetPlaceholder ( const Account account)

Get the "placeholder" flag for an account.

If this flag is set then the account may not be modified by the user.

Parameters
accountThe account whose flag should be retrieved.
Returns
The current state of the account's "placeholder" flag.

Definition at line 4235 of file Account.cpp.

4236 {
4237  return boolean_from_key(acc, {"placeholder"});
4238 }

◆ xaccAccountGetSplitList()

SplitList* xaccAccountGetSplitList ( const Account account)

The xaccAccountGetSplitList() routine returns a pointer to a GList of the splits in the account.

Note
This GList is the account's internal data structure: do not delete it when done; treat it as a read-only structure. Note that some routines (such as xaccAccountRemoveSplit()) modify this list directly, and could leave you with a corrupted pointer.
This should be changed so that the returned value is a copy of the list. No other part of the code should have access to the internal data structure used by this object.

Definition at line 4003 of file Account.cpp.

4004 {
4005  g_return_val_if_fail(GNC_IS_ACCOUNT(acc), nullptr);
4006  auto priv{GET_PRIVATE(acc)};
4007  return std::accumulate (priv->splits.rbegin(), priv->splits.rend(),
4008  static_cast<GList*>(nullptr), g_list_prepend);
4009 }

◆ xaccAccountGetTypeStr()

const char* xaccAccountGetTypeStr ( GNCAccountType  type)

The xaccAccountGetTypeStr() routine returns a string suitable for use in the GUI/Interface.

These strings should be translated to the local language.

Definition at line 4486 of file Account.cpp.

4487 {
4488  if (type < 0 || NUM_ACCOUNT_TYPES <= type ) return "";
4489  return _(account_type_name [type]);
4490 }
stop here; the following types just aren&#39;t ready for prime time
Definition: Account.h:161

◆ xaccAccountInsertLot()

void xaccAccountInsertLot ( Account ,
GNCLot *   
)

The xaccAccountInsertLot() method will register the indicated lot with this account.

Any splits later inserted into this lot must belong to this account. If the lot is already in another account, the lot, and all of the splits in it, will be moved from that account to this account.

Definition at line 2139 of file Account.cpp.

2140 {
2141  AccountPrivate *priv, *opriv;
2142  Account * old_acc = nullptr;
2143  Account* lot_account;
2144 
2145  /* errors */
2146  g_return_if_fail(GNC_IS_ACCOUNT(acc));
2147  g_return_if_fail(GNC_IS_LOT(lot));
2148 
2149  /* optimizations */
2150  lot_account = gnc_lot_get_account(lot);
2151  if (lot_account == acc)
2152  return;
2153 
2154  ENTER ("(acc=%p, lot=%p)", acc, lot);
2155 
2156  /* pull it out of the old account */
2157  if (lot_account)
2158  {
2159  old_acc = lot_account;
2160  opriv = GET_PRIVATE(old_acc);
2161  opriv->lots = g_list_remove(opriv->lots, lot);
2162  }
2163 
2164  priv = GET_PRIVATE(acc);
2165  priv->lots = g_list_prepend(priv->lots, lot);
2166  gnc_lot_set_account(lot, acc);
2167 
2168  /* Don't move the splits to the new account. The caller will do this
2169  * if appropriate, and doing it here will not work if we are being
2170  * called from gnc_book_close_period since xaccAccountInsertSplit
2171  * will try to balance capital gains and things aren't ready for that. */
2172 
2173  qof_event_gen (QOF_INSTANCE(lot), QOF_EVENT_ADD, nullptr);
2174  qof_event_gen (&acc->inst, QOF_EVENT_MODIFY, nullptr);
2175 
2176  LEAVE ("(acc=%p, lot=%p)", acc, lot);
2177 }
STRUCTS.
#define ENTER(format, args...)
Print a function entry debugging message.
Definition: qoflog.h:272
#define LEAVE(format, args...)
Print a function exit debugging message.
Definition: qoflog.h:282
Account * gnc_lot_get_account(const GNCLot *lot)
The gnc_lot_get_account() routine returns the account with which this lot is associated.
Definition: gnc-lot.cpp:377
void qof_event_gen(QofInstance *entity, QofEventId event_id, gpointer event_data)
Invoke all registered event handlers using the given arguments.
Definition: qofevent.cpp:231

◆ xaccAccountIsAPARType()

gboolean xaccAccountIsAPARType ( GNCAccountType  t)

Convenience function to check if the account is a valid business account type (meaning an Accounts Payable/Accounts Receivable).

Definition at line 4656 of file Account.cpp.

4657 {
4658  switch (t)
4659  {
4660  case ACCT_TYPE_RECEIVABLE:
4661  case ACCT_TYPE_PAYABLE:
4662  return TRUE;
4663  default:
4664  return FALSE;
4665  }
4666 }
A/P account type.
Definition: Account.h:151
A/R account type.
Definition: Account.h:149

◆ xaccAccountIsAssetLiabType()

gboolean xaccAccountIsAssetLiabType ( GNCAccountType  t)

Convenience function to check if the account is a valid Asset or Liability type, but not a business account type (meaning not an Accounts Payable/Accounts Receivable).

Definition at line 4610 of file Account.cpp.

4611 {
4612  switch (t)
4613  {
4614  case ACCT_TYPE_RECEIVABLE:
4615  case ACCT_TYPE_PAYABLE:
4616  return FALSE;
4617  default:
4620  }
4621 }
gboolean xaccAccountTypesCompatible(GNCAccountType parent_type, GNCAccountType child_type)
Return TRUE if accounts of type parent_type can have accounts of type child_type as children...
Definition: Account.cpp:4583
A/P account type.
Definition: Account.h:151
asset (and liability) accounts indicate generic, generalized accounts that are none of the above...
Definition: Account.h:116
liability (and asset) accounts indicate generic, generalized accounts that are none of the above...
Definition: Account.h:119
A/R account type.
Definition: Account.h:149

◆ xaccAccountIsEquityType()

gboolean xaccAccountIsEquityType ( GNCAccountType  t)

Convenience function to check if the account is a valid Equity type.

Definition at line 4668 of file Account.cpp.

4669 {
4670  switch (t)
4671  {
4672  case ACCT_TYPE_EQUITY:
4673  return TRUE;
4674  default:
4675  return FALSE;
4676  }
4677 }
Equity account is used to balance the balance sheet.
Definition: Account.h:146

◆ xaccAccountIsHidden()

gboolean xaccAccountIsHidden ( const Account acc)

Should this account be "hidden".

If this flag is set for this account (or any parent account) then the account should be hidden from the user unless they explicitly ask to see it. This function is different from the xaccAccountGetHidden() function because it checks the flag in parent accounts in addition to this account.

Parameters
accThe account whose flag should be retrieved.
Returns
Whether or not this account should be "hidden".

Definition at line 4331 of file Account.cpp.

4332 {
4333  AccountPrivate *priv;
4334 
4335  g_return_val_if_fail(GNC_IS_ACCOUNT(acc), FALSE);
4336 
4337  if (xaccAccountGetHidden(acc))
4338  return TRUE;
4339  priv = GET_PRIVATE(acc);
4340  while ((acc = priv->parent) != nullptr)
4341  {
4342  priv = GET_PRIVATE(acc);
4343  if (xaccAccountGetHidden(acc))
4344  return TRUE;
4345  }
4346  return FALSE;
4347 }
gboolean xaccAccountGetHidden(const Account *acc)
Get the "hidden" flag for an account.
Definition: Account.cpp:4319

◆ xaccAccountMoveAllSplits()

void xaccAccountMoveAllSplits ( Account accfrom,
Account accto 
)

The xaccAccountMoveAllSplits() routine reassigns each of the splits in accfrom to accto.

Definition at line 2199 of file Account.cpp.

2200 {
2201  AccountPrivate *from_priv;
2202 
2203  /* errors */
2204  g_return_if_fail(GNC_IS_ACCOUNT(accfrom));
2205  g_return_if_fail(GNC_IS_ACCOUNT(accto));
2206 
2207  /* optimizations */
2208  from_priv = GET_PRIVATE(accfrom);
2209  if (from_priv->splits.empty() || accfrom == accto)
2210  return;
2211 
2212  /* check for book mix-up */
2213  g_return_if_fail (qof_instance_books_equal(accfrom, accto));
2214  ENTER ("(accfrom=%p, accto=%p)", accfrom, accto);
2215 
2216  xaccAccountBeginEdit(accfrom);
2217  xaccAccountBeginEdit(accto);
2218  /* Begin editing both accounts and all transactions in accfrom. */
2219  std::for_each (from_priv->splits.begin(), from_priv->splits.end(), xaccPreSplitMove);
2220 
2221  /* Concatenate accfrom's lists of splits and lots to accto's lists. */
2222  //to_priv->splits = g_list_concat(to_priv->splits, from_priv->splits);
2223  //to_priv->lots = g_list_concat(to_priv->lots, from_priv->lots);
2224 
2225  /* Set appropriate flags. */
2226  //from_priv->balance_dirty = TRUE;
2227  //from_priv->sort_dirty = FALSE;
2228  //to_priv->balance_dirty = TRUE;
2229  //to_priv->sort_dirty = TRUE;
2230 
2231  /*
2232  * Change each split's account back pointer to accto.
2233  * Convert each split's amount to accto's commodity.
2234  * Commit to editing each transaction.
2235  */
2236  std::for_each (from_priv->splits.begin(), from_priv->splits.end(),
2237  [accto](Split *s){ xaccPostSplitMove (s, accto); });
2238 
2239  /* Finally empty accfrom. */
2240  g_assert(from_priv->splits.empty());
2241  g_assert(from_priv->lots == nullptr);
2242  xaccAccountCommitEdit(accfrom);
2243  xaccAccountCommitEdit(accto);
2244 
2245  LEAVE ("(accfrom=%p, accto=%p)", accfrom, accto);
2246 }
#define ENTER(format, args...)
Print a function entry debugging message.
Definition: qoflog.h:272
gboolean qof_instance_books_equal(gconstpointer ptr1, gconstpointer ptr2)
See if two QofInstances share the same book.
void xaccAccountBeginEdit(Account *acc)
The xaccAccountBeginEdit() subroutine is the first phase of a two-phase-commit wrapper for account up...
Definition: Account.cpp:1467
#define LEAVE(format, args...)
Print a function exit debugging message.
Definition: qoflog.h:282
void xaccAccountCommitEdit(Account *acc)
ThexaccAccountCommitEdit() subroutine is the second phase of a two-phase-commit wrapper for account u...
Definition: Account.cpp:1508

◆ xaccAccountSetAppendText()

void xaccAccountSetAppendText ( Account account,
gboolean  val 
)

Set the "import-append-text" flag for an account.

This is the saved state of the Append checkbox in the "Generic import transaction matcher" used to set the initial state of the Append checkbox next time this account is imported.

Parameters
accountThe account whose flag should be retrieved.
valThe new state for the account's "import-append-text" flag.

Definition at line 4253 of file Account.cpp.

4254 {
4255  set_boolean_key(acc, {"import-append-text"}, val);
4256 }

◆ xaccAccountSetAutoInterest()

void xaccAccountSetAutoInterest ( Account acc,
gboolean  val 
)

Set the "auto interest" flag for an account.

If this flag is set then the account (and any children) will trigger an interest transfer after reconciling.

Parameters
accThe account whose flag should be retrieved.
valThe new state for the account's "auto interest" flag.

Definition at line 4310 of file Account.cpp.

4311 {
4312  set_boolean_key (acc, {KEY_RECONCILE_INFO, "auto-interest-transfer"}, val);
4313 }

◆ xaccAccountSetHidden()

void xaccAccountSetHidden ( Account acc,
gboolean  val 
)

Set the "hidden" flag for an account.

If this flag is set then the account (and any children) will be hidden from the user unless they explicitly ask to see them.

Parameters
accThe account whose flag should be retrieved.
valThe new state for the account's "hidden" flag.

Definition at line 4325 of file Account.cpp.

4326 {
4327  set_boolean_key (acc, {"hidden"}, val);
4328 }

◆ xaccAccountSetHigherBalanceLimit()

void xaccAccountSetHigherBalanceLimit ( Account account,
gnc_numeric  balance 
)

Set the higher balance limit for the account.

Parameters
accountThe account whose higher limit is to be saved
balanceThe balance to be saved

Definition at line 5052 of file Account.cpp.

5053 {
5054  g_return_if_fail (GNC_IS_ACCOUNT(acc));
5055 
5056  if (gnc_numeric_check (balance) != 0)
5057  return;
5058 
5059  set_balance_limits (acc, balance, true);
5060 }
GNCNumericErrorCode gnc_numeric_check(gnc_numeric in)
Check for error signal in value.

◆ xaccAccountSetIncludeSubAccountBalances()

void xaccAccountSetIncludeSubAccountBalances ( Account account,
gboolean  include 
)

Set whether to include balances of sub accounts.

Parameters
accountThe account to set the setting on
includeSet to TRUE for including sub account balances

Definition at line 5138 of file Account.cpp.

5139 {
5140  g_return_if_fail (GNC_IS_ACCOUNT(acc));
5141 
5142  if (inc_sub != xaccAccountGetIncludeSubAccountBalances (acc))
5143  {
5144  GValue v = G_VALUE_INIT;
5145  g_value_init (&v, G_TYPE_BOOLEAN);
5146  g_value_set_boolean (&v, inc_sub);
5147  std::vector<std::string> path {KEY_BALANCE_LIMIT,
5148  KEY_BALANCE_INCLUDE_SUB_ACCTS};
5149  xaccAccountBeginEdit (acc);
5150  if (inc_sub)
5151  qof_instance_set_path_kvp (QOF_INSTANCE(acc), &v, path);
5152  else
5153  qof_instance_set_path_kvp (QOF_INSTANCE(acc), nullptr, path);
5154  GET_PRIVATE(acc)->include_sub_account_balances = inc_sub;
5155  mark_account (acc);
5156  xaccAccountCommitEdit (acc);
5157  g_value_unset (&v);
5158  }
5159 }
gboolean xaccAccountGetIncludeSubAccountBalances(const Account *acc)
Get whether to include balances of sub accounts.
Definition: Account.cpp:5123
void xaccAccountBeginEdit(Account *acc)
The xaccAccountBeginEdit() subroutine is the first phase of a two-phase-commit wrapper for account up...
Definition: Account.cpp:1467
void xaccAccountCommitEdit(Account *acc)
ThexaccAccountCommitEdit() subroutine is the second phase of a two-phase-commit wrapper for account u...
Definition: Account.cpp:1508

◆ xaccAccountSetIsOpeningBalance()

void xaccAccountSetIsOpeningBalance ( Account account,
gboolean  val 
)

Set the "opening-balance" flag for an account.

If this flag is set then the account is used for opening balance transactions.

Parameters
accountThe account whose flag should be set.
valThe new state for the account's "opening-balance" flag.

Definition at line 4272 of file Account.cpp.

4273 {
4274  if (GET_PRIVATE(acc)->type != ACCT_TYPE_EQUITY)
4275  return;
4276  set_kvp_string_tag(acc, "equity-type", val ? "opening-balance" : nullptr);
4277 }
Equity account is used to balance the balance sheet.
Definition: Account.h:146

◆ xaccAccountSetLowerBalanceLimit()

void xaccAccountSetLowerBalanceLimit ( Account account,
gnc_numeric  balance 
)

Set the lower balance limit for the account.

Parameters
accountThe account whose lower limit is to be saved
balanceThe balance to be saved

Definition at line 5063 of file Account.cpp.

5064 {
5065  g_return_if_fail (GNC_IS_ACCOUNT(acc));
5066 
5067  if (gnc_numeric_check (balance) != 0)
5068  return;
5069 
5070  set_balance_limits (acc, balance, false);
5071 }
GNCNumericErrorCode gnc_numeric_check(gnc_numeric in)
Check for error signal in value.

◆ xaccAccountSetMark()

void xaccAccountSetMark ( Account account,
short  mark 
)

Set a mark on the account.

The meaning of this mark is completely undefined. Its presented here as a utility for the programmer, to use as desired. Handy for performing customer traversals over the account tree. The mark is not stored in the database/file format. When accounts are newly created, the mark is set to zero.

Definition at line 2058 of file Account.cpp.

2059 {
2060  AccountPrivate *priv;
2061 
2062  g_return_if_fail(GNC_IS_ACCOUNT(acc));
2063 
2064  priv = GET_PRIVATE(acc);
2065  priv->mark = m;
2066 }

◆ xaccAccountSetPlaceholder()

void xaccAccountSetPlaceholder ( Account account,
gboolean  val 
)

Set the "placeholder" flag for an account.

If this flag is set then the account may not be modified by the user.

Parameters
accountThe account whose flag should be retrieved.
valThe new state for the account's "placeholder" flag.

Definition at line 4241 of file Account.cpp.

4242 {
4243  set_boolean_key(acc, {"placeholder"}, val);
4244 }

◆ xaccAccountStagedTransactionTraversal()

int xaccAccountStagedTransactionTraversal ( const Account a,
unsigned int  stage,
TransactionCallback  thunk,
void *  data 
)

xaccAccountStagedTransactionTraversal() calls thunk on each transaction in account a whose current marker is less than the given stage and updates each transaction's marker to be stage.

The traversal will stop if thunk returns a non-zero value. xaccAccountStagedTransactionTraversal() function will return zero or the non-zero value returned by thunk. This API does not handle handle recursive traversals.

Warning
For performance reasons, the transaction callback thunk must never destroy any of the transaction's splits, nor assign any of them to a different account. To do so risks a crash.

Definition at line 5521 of file Account.cpp.

5525 {
5526  if (!acc) return 0;
5527 
5528  auto splits = GET_PRIVATE(acc)->splits;
5529  for (auto s : splits)
5530  {
5531  auto trans = s->parent;
5532  if (trans && (trans->marker < stage))
5533  {
5534  trans->marker = stage;
5535  if (thunk)
5536  {
5537  auto retval = thunk(trans, cb_data);
5538  if (retval) return retval;
5539  }
5540  }
5541  }
5542 
5543  return 0;
5544 }

◆ xaccAccountStringToEnum()

GNCAccountType xaccAccountStringToEnum ( const char *  str)

Conversion routines for the account types to/from strings that are used in persistent storage, communications.

These strings should not be translated to the local language. Typical conversion is "INCOME" -> ACCT_TYPE_INCOME.

Definition at line 4447 of file Account.cpp.

4448 {
4449  GNCAccountType type;
4450  gboolean rc;
4451  rc = xaccAccountStringToType(str, &type);
4452  if (FALSE == rc) return ACCT_TYPE_INVALID;
4453  return type;
4454 }
gboolean xaccAccountStringToType(const char *str, GNCAccountType *type)
Conversion routines for the account types to/from strings that are used in persistent storage...
Definition: Account.cpp:4413
GNCAccountType
The account types are used to determine how the transaction data in the account is displayed...
Definition: Account.h:101
Not a type.
Definition: Account.h:104

◆ xaccAccountStringToType()

gboolean xaccAccountStringToType ( const char *  str,
GNCAccountType type 
)

Conversion routines for the account types to/from strings that are used in persistent storage, communications.

These strings should not be translated to the local language. Typical conversion is "INCOME" -> ACCT_TYPE_INCOME.

Definition at line 4413 of file Account.cpp.

4414 {
4415 
4416  GNC_RETURN_ON_MATCH(NONE);
4417  GNC_RETURN_ON_MATCH(BANK);
4418  GNC_RETURN_ON_MATCH(CASH);
4419  GNC_RETURN_ON_MATCH(CREDIT);
4420  GNC_RETURN_ON_MATCH(ASSET);
4421  GNC_RETURN_ON_MATCH(LIABILITY);
4422  GNC_RETURN_ON_MATCH(STOCK);
4423  GNC_RETURN_ON_MATCH(MUTUAL);
4424  GNC_RETURN_ON_MATCH(CURRENCY);
4425  GNC_RETURN_ON_MATCH(INCOME);
4426  GNC_RETURN_ON_MATCH(EXPENSE);
4427  GNC_RETURN_ON_MATCH(EQUITY);
4428  GNC_RETURN_ON_MATCH(RECEIVABLE);
4429  GNC_RETURN_ON_MATCH(PAYABLE);
4430  GNC_RETURN_ON_MATCH(ROOT);
4431  GNC_RETURN_ON_MATCH(TRADING);
4432  GNC_RETURN_ON_MATCH(CHECKING);
4433  GNC_RETURN_ON_MATCH(SAVINGS);
4434  GNC_RETURN_ON_MATCH(MONEYMRKT);
4435  GNC_RETURN_ON_MATCH(CREDITLINE);
4436 
4437  PERR("asked to translate unknown account type string %s.\n",
4438  str ? str : "(null)");
4439 
4440  return(FALSE);
4441 }
#define PERR(format, args...)
Log a serious error.
Definition: qoflog.h:244

◆ xaccAccountTreeForEachTransaction()

int xaccAccountTreeForEachTransaction ( Account acc,
TransactionCallback  proc,
void *  data 
)

Traverse all of the transactions in the given account group.

Continue processing IF proc returns 0. This function will descend recursively to traverse transactions in the children of the accounts in the group.

Proc will be called exactly once for each transaction that is pointed to by at least one split in any account in the hierarchy topped by the root Account acc.

The result of this function will be 0 IF every relevant transaction was traversed exactly once; otherwise, the return value is the last non-zero value returned by the callback.

Warning
For performance reasons, the transaction callback proc must never destroy any of the transaction's splits, nor assign any of them to a different account. To do so risks a crash.
The traversal occurs only over the transactions that are locally cached in the local gnucash engine. If the gnucash engine is attached to a remote database, the database may contain (many) transactions that are not mirrored in the local cache. This routine will not cause an SQL database query to be performed; it will not traverse transactions present only in the remote database.

Note that this routine is just a trivial wrapper for

gnc_account_tree_begin_staged_transaction_traversals(g); gnc_account_tree_staged_transaction_traversal(g, 42, proc, data);

◆ xaccAccountTypeEnumAsString()

const char* xaccAccountTypeEnumAsString ( GNCAccountType  type)

Conversion routines for the account types to/from strings that are used in persistent storage, communications.

These strings should not be translated to the local language. Typical conversion is ACCT_TYPE_INCOME -> "INCOME".

Definition at line 4376 of file Account.cpp.

4377 {
4378  switch (type)
4379  {
4380  GNC_RETURN_ENUM_AS_STRING(NONE);
4381  GNC_RETURN_ENUM_AS_STRING(BANK);
4382  GNC_RETURN_ENUM_AS_STRING(CASH);
4383  GNC_RETURN_ENUM_AS_STRING(CREDIT);
4384  GNC_RETURN_ENUM_AS_STRING(ASSET);
4385  GNC_RETURN_ENUM_AS_STRING(LIABILITY);
4386  GNC_RETURN_ENUM_AS_STRING(STOCK);
4387  GNC_RETURN_ENUM_AS_STRING(MUTUAL);
4388  GNC_RETURN_ENUM_AS_STRING(CURRENCY);
4389  GNC_RETURN_ENUM_AS_STRING(INCOME);
4390  GNC_RETURN_ENUM_AS_STRING(EXPENSE);
4391  GNC_RETURN_ENUM_AS_STRING(EQUITY);
4392  GNC_RETURN_ENUM_AS_STRING(RECEIVABLE);
4393  GNC_RETURN_ENUM_AS_STRING(PAYABLE);
4394  GNC_RETURN_ENUM_AS_STRING(ROOT);
4395  GNC_RETURN_ENUM_AS_STRING(TRADING);
4396  GNC_RETURN_ENUM_AS_STRING(CHECKING);
4397  GNC_RETURN_ENUM_AS_STRING(SAVINGS);
4398  GNC_RETURN_ENUM_AS_STRING(MONEYMRKT);
4399  GNC_RETURN_ENUM_AS_STRING(CREDITLINE);
4400  default:
4401  PERR ("asked to translate unknown account type %d.\n", type);
4402  break;
4403  }
4404  return(nullptr);
4405 }
#define PERR(format, args...)
Log a serious error.
Definition: qoflog.h:244

◆ xaccAccountTypeGetFundamental()

GNCAccountType xaccAccountTypeGetFundamental ( GNCAccountType  t)

Convenience function to return the fundamental type asset/liability/income/expense/equity given an account type.

Definition at line 4624 of file Account.cpp.

4625 {
4626  switch (t)
4627  {
4628  case ACCT_TYPE_BANK:
4629  case ACCT_TYPE_STOCK:
4630  case ACCT_TYPE_MONEYMRKT:
4631  case ACCT_TYPE_CHECKING:
4632  case ACCT_TYPE_SAVINGS:
4633  case ACCT_TYPE_MUTUAL:
4634  case ACCT_TYPE_CURRENCY:
4635  case ACCT_TYPE_CASH:
4636  case ACCT_TYPE_ASSET:
4637  case ACCT_TYPE_RECEIVABLE:
4638  return ACCT_TYPE_ASSET;
4639  case ACCT_TYPE_CREDIT:
4640  case ACCT_TYPE_LIABILITY:
4641  case ACCT_TYPE_PAYABLE:
4642  case ACCT_TYPE_CREDITLINE:
4643  return ACCT_TYPE_LIABILITY;
4644  case ACCT_TYPE_INCOME:
4645  return ACCT_TYPE_INCOME;
4646  case ACCT_TYPE_EXPENSE:
4647  return ACCT_TYPE_EXPENSE;
4648  case ACCT_TYPE_EQUITY:
4649  return ACCT_TYPE_EQUITY;
4650  case ACCT_TYPE_TRADING:
4651  default:
4652  return ACCT_TYPE_NONE;
4653  }
4654 }
Expense accounts are used to denote expenses.
Definition: Account.h:143
Mutual Fund accounts will typically be shown in registers which show three columns: price...
Definition: Account.h:125
The cash account type is used to denote a shoe-box or pillowcase stuffed with * cash.
Definition: Account.h:110
Account used to record multiple commodity transactions.
Definition: Account.h:155
Stock accounts will typically be shown in registers which show three columns: price, number of shares, and value.
Definition: Account.h:122
bank account type – don&#39;t use this for now, see NUM_ACCOUNT_TYPES
Definition: Account.h:165
Income accounts are used to denote income.
Definition: Account.h:140
line of credit – don&#39;t use this for now, see NUM_ACCOUNT_TYPES
Definition: Account.h:171
The bank account type denotes a savings or checking account held at a bank.
Definition: Account.h:107
A/P account type.
Definition: Account.h:151
bank account type – don&#39;t use this for now, see NUM_ACCOUNT_TYPES
Definition: Account.h:167
asset (and liability) accounts indicate generic, generalized accounts that are none of the above...
Definition: Account.h:116
The currency account type indicates that the account is a currency trading account.
Definition: Account.h:129
liability (and asset) accounts indicate generic, generalized accounts that are none of the above...
Definition: Account.h:119
A/R account type.
Definition: Account.h:149
bank account type – don&#39;t use this for now, see NUM_ACCOUNT_TYPES
Definition: Account.h:169
Equity account is used to balance the balance sheet.
Definition: Account.h:146
Not a type.
Definition: Account.h:105
The Credit card account is used to denote credit (e.g.
Definition: Account.h:113

◆ xaccAccountTypesCompatible()

gboolean xaccAccountTypesCompatible ( GNCAccountType  parent_type,
GNCAccountType  child_type 
)

Return TRUE if accounts of type parent_type can have accounts of type child_type as children.

Definition at line 4583 of file Account.cpp.

4585 {
4586  /* ACCT_TYPE_NONE isn't compatible with anything, even ACCT_TYPE_NONE. */
4587  if (parent_type == ACCT_TYPE_NONE || child_type == ACCT_TYPE_NONE)
4588  return FALSE;
4589 
4590  /* ACCT_TYPE_ROOT can't have a parent account, and asking will raise
4591  * an error. */
4592  if (child_type == ACCT_TYPE_ROOT)
4593  return FALSE;
4594 
4595  return ((xaccParentAccountTypesCompatibleWith (child_type) &
4596  (1 << parent_type))
4597  != 0);
4598 }
guint32 xaccParentAccountTypesCompatibleWith(GNCAccountType type)
Return the bitmask of parent account types compatible with a given type.
Definition: Account.cpp:4536
Not a type.
Definition: Account.h:105
The hidden root account of an account tree.
Definition: Account.h:153

◆ xaccAccountTypesCompatibleWith()

guint32 xaccAccountTypesCompatibleWith ( GNCAccountType  type)

Return the bitmask of account types compatible with a given type.

That is, you could switch to any of the account types in the compatible list without unwanted side-effects.

Definition at line 4496 of file Account.cpp.

4497 {
4498  switch (type)
4499  {
4500  case ACCT_TYPE_BANK:
4501  case ACCT_TYPE_CASH:
4502  case ACCT_TYPE_ASSET:
4503  case ACCT_TYPE_CREDIT:
4504  case ACCT_TYPE_LIABILITY:
4505  case ACCT_TYPE_INCOME:
4506  case ACCT_TYPE_EXPENSE:
4507  case ACCT_TYPE_EQUITY:
4508  return
4509  (1 << ACCT_TYPE_BANK) |
4510  (1 << ACCT_TYPE_CASH) |
4511  (1 << ACCT_TYPE_ASSET) |
4512  (1 << ACCT_TYPE_CREDIT) |
4513  (1 << ACCT_TYPE_LIABILITY) |
4514  (1 << ACCT_TYPE_INCOME) |
4515  (1 << ACCT_TYPE_EXPENSE) |
4516  (1 << ACCT_TYPE_EQUITY);
4517  case ACCT_TYPE_STOCK:
4518  case ACCT_TYPE_MUTUAL:
4519  case ACCT_TYPE_CURRENCY:
4520  return
4521  (1 << ACCT_TYPE_STOCK) |
4522  (1 << ACCT_TYPE_MUTUAL) |
4523  (1 << ACCT_TYPE_CURRENCY);
4524  case ACCT_TYPE_RECEIVABLE:
4525  return (1 << ACCT_TYPE_RECEIVABLE);
4526  case ACCT_TYPE_PAYABLE:
4527  return (1 << ACCT_TYPE_PAYABLE);
4528  case ACCT_TYPE_TRADING:
4529  return (1 << ACCT_TYPE_TRADING);
4530  default:
4531  PERR("bad account type: %d", type);
4532  return 0;
4533  }
4534 }
Expense accounts are used to denote expenses.
Definition: Account.h:143
Mutual Fund accounts will typically be shown in registers which show three columns: price...
Definition: Account.h:125
#define PERR(format, args...)
Log a serious error.
Definition: qoflog.h:244
The cash account type is used to denote a shoe-box or pillowcase stuffed with * cash.
Definition: Account.h:110
Account used to record multiple commodity transactions.
Definition: Account.h:155
Stock accounts will typically be shown in registers which show three columns: price, number of shares, and value.
Definition: Account.h:122
Income accounts are used to denote income.
Definition: Account.h:140
The bank account type denotes a savings or checking account held at a bank.
Definition: Account.h:107
A/P account type.
Definition: Account.h:151
asset (and liability) accounts indicate generic, generalized accounts that are none of the above...
Definition: Account.h:116
The currency account type indicates that the account is a currency trading account.
Definition: Account.h:129
liability (and asset) accounts indicate generic, generalized accounts that are none of the above...
Definition: Account.h:119
A/R account type.
Definition: Account.h:149
Equity account is used to balance the balance sheet.
Definition: Account.h:146
The Credit card account is used to denote credit (e.g.
Definition: Account.h:113

◆ xaccAccountTypesValid()

guint32 xaccAccountTypesValid ( void  )

Returns the bitmask of the account type enums that are valid.

Deprecated and root account types are stripped.

Definition at line 4601 of file Account.cpp.

4602 {
4603  guint32 mask = (1 << NUM_ACCOUNT_TYPES) - 1;
4604  mask &= ~((1 << ACCT_TYPE_CURRENCY) | /* DEPRECATED */
4605  (1 << ACCT_TYPE_ROOT)); /* ROOT */
4606 
4607  return mask;
4608 }
stop here; the following types just aren&#39;t ready for prime time
Definition: Account.h:161
The currency account type indicates that the account is a currency trading account.
Definition: Account.h:129
The hidden root account of an account tree.
Definition: Account.h:153

◆ xaccClearMark()

void xaccClearMark ( Account account,
short  val 
)

Get the mark set by xaccAccountSetMark short xaccAccountGetMark (const Account *account);.

The xaccClearMark will find the root account, and clear the mark in the entire account tree.

Definition at line 2069 of file Account.cpp.

2070 {
2071  Account *root;
2072 
2073  g_return_if_fail(GNC_IS_ACCOUNT(acc));
2074 
2075  root = gnc_account_get_root(acc);
2076  xaccClearMarkDown(root ? root : acc, val);
2077 }
STRUCTS.
void xaccClearMarkDown(Account *acc, short val)
The xaccClearMarkDown will clear the mark only in this and in sub-accounts.
Definition: Account.cpp:2080
Account * gnc_account_get_root(Account *acc)
This routine returns the root account of the account tree that the specified account belongs to...
Definition: Account.cpp:2891

◆ xaccClearMarkDown()

void xaccClearMarkDown ( Account account,
short  val 
)

The xaccClearMarkDown will clear the mark only in this and in sub-accounts.

Definition at line 2080 of file Account.cpp.

2081 {
2082  AccountPrivate *priv;
2083  GList *node;
2084 
2085  g_return_if_fail(GNC_IS_ACCOUNT(acc));
2086 
2087  priv = GET_PRIVATE(acc);
2088  priv->mark = val;
2089  for (node = priv->children; node; node = node->next)
2090  {
2091  xaccClearMarkDown(static_cast<Account*>(node->data), val);
2092  }
2093 }
void xaccClearMarkDown(Account *acc, short val)
The xaccClearMarkDown will clear the mark only in this and in sub-accounts.
Definition: Account.cpp:2080

◆ xaccParentAccountTypesCompatibleWith()

guint32 xaccParentAccountTypesCompatibleWith ( GNCAccountType  type)

Return the bitmask of parent account types compatible with a given type.

Definition at line 4536 of file Account.cpp.

4537 {
4538  switch (type)
4539  {
4540  case ACCT_TYPE_BANK:
4541  case ACCT_TYPE_CASH:
4542  case ACCT_TYPE_ASSET:
4543  case ACCT_TYPE_STOCK:
4544  case ACCT_TYPE_MUTUAL:
4545  case ACCT_TYPE_CURRENCY:
4546  case ACCT_TYPE_CREDIT:
4547  case ACCT_TYPE_LIABILITY:
4548  case ACCT_TYPE_RECEIVABLE:
4549  case ACCT_TYPE_PAYABLE:
4550  return
4551  (1 << ACCT_TYPE_BANK) |
4552  (1 << ACCT_TYPE_CASH) |
4553  (1 << ACCT_TYPE_ASSET) |
4554  (1 << ACCT_TYPE_STOCK) |
4555  (1 << ACCT_TYPE_MUTUAL) |
4556  (1 << ACCT_TYPE_CURRENCY) |
4557  (1 << ACCT_TYPE_CREDIT) |
4558  (1 << ACCT_TYPE_LIABILITY) |
4559  (1 << ACCT_TYPE_RECEIVABLE) |
4560  (1 << ACCT_TYPE_PAYABLE) |
4561  (1 << ACCT_TYPE_ROOT);
4562  case ACCT_TYPE_INCOME:
4563  case ACCT_TYPE_EXPENSE:
4564  return
4565  (1 << ACCT_TYPE_INCOME) |
4566  (1 << ACCT_TYPE_EXPENSE) |
4567  (1 << ACCT_TYPE_ROOT);
4568  case ACCT_TYPE_EQUITY:
4569  return
4570  (1 << ACCT_TYPE_EQUITY) |
4571  (1 << ACCT_TYPE_ROOT);
4572  case ACCT_TYPE_TRADING:
4573  return
4574  (1 << ACCT_TYPE_TRADING) |
4575  (1 << ACCT_TYPE_ROOT);
4576  default:
4577  PERR("bad account type: %d", type);
4578  return 0;
4579  }
4580 }
Expense accounts are used to denote expenses.
Definition: Account.h:143
Mutual Fund accounts will typically be shown in registers which show three columns: price...
Definition: Account.h:125
#define PERR(format, args...)
Log a serious error.
Definition: qoflog.h:244
The cash account type is used to denote a shoe-box or pillowcase stuffed with * cash.
Definition: Account.h:110
Account used to record multiple commodity transactions.
Definition: Account.h:155
Stock accounts will typically be shown in registers which show three columns: price, number of shares, and value.
Definition: Account.h:122
Income accounts are used to denote income.
Definition: Account.h:140
The bank account type denotes a savings or checking account held at a bank.
Definition: Account.h:107
A/P account type.
Definition: Account.h:151
asset (and liability) accounts indicate generic, generalized accounts that are none of the above...
Definition: Account.h:116
The currency account type indicates that the account is a currency trading account.
Definition: Account.h:129
liability (and asset) accounts indicate generic, generalized accounts that are none of the above...
Definition: Account.h:119
A/R account type.
Definition: Account.h:149
Equity account is used to balance the balance sheet.
Definition: Account.h:146
The hidden root account of an account tree.
Definition: Account.h:153
The Credit card account is used to denote credit (e.g.
Definition: Account.h:113

◆ xaccTransactionTraverse()

gboolean xaccTransactionTraverse ( Transaction *  trans,
int  stage 
)

xaccTransactionTraverse() checks the stage of the given transaction.

If the transaction hasn't reached the given stage, the transaction is updated to that stage and the function returns TRUE. Otherwise no change is made and the function returns FALSE.

Definition at line 5489 of file Account.cpp.

5490 {
5491  if (trans == nullptr) return FALSE;
5492 
5493  if (trans->marker < stage)
5494  {
5495  trans->marker = stage;
5496  return TRUE;
5497  }
5498 
5499  return FALSE;
5500 }

Variable Documentation

◆ value [1/6]

template<typename T >
constexpr bool is_OptionClassifier< T >::value
static
Initial value:
=
std::is_base_of_v<OptionClassifier, std::decay_t<T>>

Definition at line 75 of file gnc-option.hpp.

◆ value [2/6]

template<typename T , typename U >
constexpr bool is_same_decayed< T, U >::value
static
Initial value:
= std::is_same_v<std::decay_t<T>,
std::decay_t<U>>

Definition at line 85 of file gnc-option.hpp.

◆ value [3/6]

template<typename T >
constexpr bool is_RangeValue< T >::value
static
Initial value:
=
(is_same_decayed_v<T, GncOptionRangeValue<int>> ||
is_same_decayed_v<T, GncOptionRangeValue<double>>)

Definition at line 95 of file gnc-option.hpp.

◆ value [4/6]

template<typename T >
constexpr bool is_GncOwnerValue< T >::value
static
Initial value:
=
std::is_same_v<std::decay_t<T>, GncOptionGncOwnerValue>

Definition at line 268 of file gnc-option-impl.hpp.

◆ value [5/6]

template<typename T >
constexpr bool is_QofInstanceValue< T >::value
static
Initial value:
=
std::is_same_v<std::decay_t<T>, GncOptionQofInstanceValue>

Definition at line 278 of file gnc-option-impl.hpp.

◆ value [6/6]

template<typename T >
constexpr bool is_QofQueryValue< T >::value
static
Initial value:
=
std::is_same_v<std::decay_t<T>, GncOptionValue<const QofQuery*>>

Definition at line 288 of file gnc-option-impl.hpp.