GnuCashew ~ Web Application compatible with GnuCash sql data files.
GCW
|
Namespaces | |
namespace | Children |
Account Children Namespace. | |
namespace | Field |
Classes | |
struct | ACCOUNTDEF_S |
Account Definition. More... | |
class | Item |
Account Item Class. More... | |
Typedefs | |
typedef struct GCW::Dbo::Accounts::ACCOUNTDEF_S | AccountDef_t |
Account Definition. | |
Enumerations | |
enum class | DrCr { NONE = 0x00 , DEBIT = 0x01 , CREDIT = 0x02 } |
Account Debit/Credit Enum. More... | |
enum class | Type { INVALID = -1 , NONE = -1 , BANK = 0 , CASH = 1 , CREDIT = 3 , ASSET = 2 , LIABILITY = 4 , STOCK = 5 , MUTUAL = 6 , CURRENCY = 7 , INCOME = 8 , EXPENSE = 9 , EQUITY = 10 , RECEIVABLE = 11 , PAYABLE = 12 , ROOT = 13 , TRADING = 14 , NUM_ACCOUNT_TYPES = 15 , CHECKING = 15 , SAVINGS = 16 , MONEYMRKT = 17 , CREDITLINE = 18 , LAST } |
Account Type. More... | |
Functions | |
auto | rootAccount () -> Item::Ptr |
Load Root Account. | |
auto | load (const std::string &_guid) -> Item::Ptr |
Load Account by GUID. | |
auto | byGuid (const std::string &_guid) -> Item::Ptr |
Load Account by GUID. | |
auto | byChildName (const std::string &_parentGuid, const std::string &_childName) -> Item::Ptr |
Load Account by 'child name' and 'parent id'. | |
auto | byFullName (const std::string &_fullName) -> Item::Ptr |
Load Account by 'full name' with ':' account separator. | |
auto | byFullName (const Wt::WString &_fullName) -> Item::Ptr |
auto | allAccounts () -> Item::Vector |
Load all accounts. | |
auto | activeAccounts () -> Item::Vector |
Load accounts as; if( !hidden() && !placeHolder() ) | |
auto | fullName (const std::string &_guid) -> std::string |
Account Fullname via GUID. | |
auto | fullName (Item::Ptr _item) -> std::string |
Account Fullname via Item. | |
auto | isType (const Item::Ptr _acctItem, GCW::Dbo::Accounts::Type _type) -> bool |
Is Account Type. | |
auto | isType (const std::string &_guid, GCW::Dbo::Accounts::Type _type) -> bool |
Variables | |
const char * | s_tableName = "accounts" |
const std::vector< AccountDef_t > | s_accountDefs |
typedef struct GCW::Dbo::Accounts::ACCOUNTDEF_S GCW::Dbo::Accounts::AccountDef_t |
Account Definition.
This structure provides a set of account-definitions that are used in the various views and balance calculations.
|
strong |
Account Debit/Credit Enum.
This indicates if this account is a 'debit' type account or a 'credit' type account.
Enumerator | |
---|---|
NONE | 0x00 ~ invalid - should not happen |
DEBIT | 0x01 ~ DEBIT type account |
CREDIT | 0x02 ~ CREDIT type account |
Definition at line 23 of file Accounts/Definition.h.
|
strong |
Account Type.
These are used internally to switch the views depending on the account type. While these codes exactly match the codes in the native gnucash proper, they should not be relied on to match the native gnucash account type codes (those are textual, see; GCW::Dbo::Accounts::Item::accountTypeName). But, these are internal anyhow, and they don't get stored. They're just used to steer the application, especially as it pertains to debit/credit calculations.
The definition-table can be found here: s_accountDefs
Definition at line 50 of file Accounts/Definition.h.
auto GCW::Dbo::Accounts::activeAccounts | ( | ) | -> Item::Vector |
Load accounts as; if( !hidden() && !placeHolder() )
Definition at line 253 of file Dbo/Accounts/Accounts.cpp.
References GCW::app().
auto GCW::Dbo::Accounts::allAccounts | ( | ) | -> Item::Vector |
Load all accounts.
Definition at line 233 of file Dbo/Accounts/Accounts.cpp.
References GCW::app().
Referenced by GCW::Eng::AccountComboModel::AccountComboModel().
auto GCW::Dbo::Accounts::byChildName | ( | const std::string & | _parentGuid, |
const std::string & | _childName | ||
) | -> Item::Ptr |
Load Account by 'child name' and 'parent id'.
Definition at line 179 of file Dbo/Accounts/Accounts.cpp.
References GCW::app().
Referenced by byFullName().
auto GCW::Dbo::Accounts::byFullName | ( | const std::string & | _fullName | ) | -> Item::Ptr |
Load Account by 'full name' with ':' account separator.
Definition at line 197 of file Dbo/Accounts/Accounts.cpp.
References GCW::app(), byChildName(), rootAccount(), split(), and GCW::Core::split().
Referenced by byFullName(), GCW::Gui::AccountRegister::Model::getTransferGuid(), and GCW::Gui::BillPay::PaymentWidget::saveData().
auto GCW::Dbo::Accounts::byFullName | ( | const Wt::WString & | _fullName | ) | -> Item::Ptr |
Definition at line 226 of file Dbo/Accounts/Accounts.cpp.
References byFullName().
auto GCW::Dbo::Accounts::byGuid | ( | const std::string & | _guid | ) | -> Item::Ptr |
Load Account by GUID.
Definition at line 171 of file Dbo/Accounts/Accounts.cpp.
References load().
Referenced by GCW::Eng::Transaction::Manager::createAccount(), fullName(), isType(), GCW::Gui::BillPay::TableModel::loadData(), GCW::Gui::CentralWidget::open_AccountRegister(), and GCW::Gui::AccountRegister::Model::refreshFromDisk().
auto GCW::Dbo::Accounts::fullName | ( | const std::string & | _accountGuid | ) | -> std::string |
Account Fullname via GUID.
Compute Account Full-Name from Heirarchy.
This function will calculate the "full account name" from the accountGuid up to the root parent.
If the provided account guid is blank, then just return an empty string.
During the building process, even though the "root account" is a valid account, it is ignored and not included in the results.
Recursively, this should generate a name such as; "Assets:2023:Cash:FGB:OLB:2300-LSI"
Definition at line 298 of file Dbo/Accounts/Accounts.cpp.
References byGuid(), fullName(), and rootAccount().
Referenced by GCW::Eng::AccountComboModel::AccountComboModel(), GCW::Gui::BillPay::Item::accountFullName(), GCW::Eng::Transaction::Manager::createAccount(), GCW::Dbo::Accounts::Item::fullName(), fullName(), fullName(), GCW::Gui::BillPay::EditWidget::loadData(), GCW::Gui::BillPay::PaymentWidget::loadData(), and GCW::Gui::BillPay::TableModel::loadData().
auto GCW::Dbo::Accounts::fullName | ( | Item::Ptr | _item | ) | -> std::string |
Account Fullname via Item.
Definition at line 361 of file Dbo/Accounts/Accounts.cpp.
References fullName().
auto GCW::Dbo::Accounts::isType | ( | const Item::Ptr | _acctItem, |
GCW::Dbo::Accounts::Type | _type | ||
) | -> bool |
Is Account Type.
This returns .true. if the account is an _type account, meaning, if the acccount itself is not designated as an _type (could be BANK or CASH or something), then the parent tree is walked all the way to root and returns .true. if any of the parent accounts are an _type account.
Definition at line 370 of file Dbo/Accounts/Accounts.cpp.
References isType().
Referenced by isType(), isType(), and GCW::Gui::BillPay::SummaryWidget::setMonth().
auto GCW::Dbo::Accounts::isType | ( | const std::string & | _guid, |
GCW::Dbo::Accounts::Type | _type | ||
) | -> bool |
Definition at line 393 of file Dbo/Accounts/Accounts.cpp.
auto GCW::Dbo::Accounts::load | ( | const std::string & | _guid | ) | -> Item::Ptr |
Load Account by GUID.
Definition at line 134 of file Dbo/Accounts/Accounts.cpp.
References GCW::app().
Referenced by GCW::Gui::AccountEditor::AccountEditor(), byGuid(), GCW::Eng::Transaction::Manager::newTransaction(), and GCW::Gui::AccountEditor::Tab1::Tab1().
auto GCW::Dbo::Accounts::rootAccount | ( | ) | -> Item::Ptr |
Load Root Account.
Definition at line 125 of file Dbo/Accounts/Accounts.cpp.
Referenced by byFullName(), fullName(), and GCW::Eng::AccountsTreeViewModel::load().
|
extern |
These are the account-types, debit/credit types, and register column labels for said accounts.
Definition at line 20 of file Dbo/Accounts/Accounts.cpp.
Referenced by GCW::Dbo::Accounts::Item::accountDef(), GCW::Dbo::Accounts::Item::accountDrCr(), GCW::Dbo::Accounts::Item::accountType(), AccountTypeCombo::AccountTypeCombo(), and GCW::Gui::AccountRegister::Model::refreshFromDisk().
|
extern |
Definition at line 7 of file Dbo/Accounts/Accounts.cpp.