GnuCashew ~ GnuCash Enabled Web
GCW
|
#include <Item.h>
Public Member Functions | |
Item () | |
ctor More... | |
Item (const std::string &_guid) | |
ctor with guid. More... | |
auto | accountDef () const -> const GCW::Dbo::Accounts::AccountDef_t & |
Account Definition. More... | |
auto | accountDrCr () const -> GCW::Dbo::Accounts::DrCr |
Account Debit/Credit. More... | |
auto | accountType () const -> GCW::Dbo::Accounts::Type |
Account Type. More... | |
auto | guid () const -> const std::string & |
GUID. More... | |
auto | name () const -> const std::string & |
Name. More... | |
auto | accountTypeName () const -> const std::string & |
Type Name. More... | |
auto | commodity_guid () const -> const std::string & |
Commodity GUID. More... | |
auto | commodity_scu () const -> const int |
Commodity SCU (Special Currency Unit) More... | |
auto | non_std_scu () const -> const int |
Non Standard SCU (Special Currency Unit) More... | |
auto | parent_guid () const -> const std::string & |
Parent GUID. More... | |
auto | code () const -> const std::string & |
Code. More... | |
auto | description () const -> const std::string & |
Description. More... | |
auto | hidden () const -> const int |
Hidden. More... | |
auto | placeHolder () const -> const int |
Placeholder. More... | |
auto | fullName () const -> std::string |
Full Name. More... | |
auto | hasColor () const -> bool |
Has Color. More... | |
auto | color () const -> std::string |
Color. More... | |
template<class Action > | |
void | persist (Action &action) |
persist the data More... | |
![]() | |
BaseItem () | |
Private Attributes | |
std::string | m_guid |
std::string | m_name |
std::string | m_account_typeName |
std::string | m_commodity_guid |
int | m_commodity_scu |
int | m_non_std_scu |
std::string | m_parent_guid |
std::string | m_code |
std::string | m_description |
int | m_hidden |
int | m_placeHolder |
Additional Inherited Members | |
![]() | |
using | Ptr = Wt::Dbo::ptr< Item > |
using | Collection = Wt::Dbo::collection< Ptr > |
using | Vector = std::vector< Ptr > |
Account Item Class.
This class represents an 'account' within gnucash. This is a Dbo object so this class is used as the interface between the gnucashew application and the back-end database.
|
inline |
auto GCW::Dbo::Accounts::Item::accountDef | ( | ) | const -> const GCW::Dbo::Accounts::AccountDef_t & |
Account Definition.
Return the definition object for the account.
Definition at line 11 of file Item.cpp.
References accountTypeName(), and GCW::Dbo::Accounts::s_accountDefs.
auto GCW::Dbo::Accounts::Item::accountDrCr | ( | ) | const -> GCW::Dbo::Accounts::DrCr |
Account Debit/Credit.
Return the account Debit/Credit type.
Definition at line 24 of file Item.cpp.
References GCW::Dbo::Accounts::NONE, and GCW::Dbo::Accounts::s_accountDefs.
auto GCW::Dbo::Accounts::Item::accountType | ( | ) | const -> GCW::Dbo::Accounts::Type |
Account Type.
Return the account Type as an enum.
Definition at line 37 of file Item.cpp.
References GCW::Dbo::Accounts::NONE, and GCW::Dbo::Accounts::s_accountDefs.
|
inline |
Type Name.
Return account type as a 'string' value. This is, in fact, how the account type is actually recorded in the back-end database, as a 'text' string such as 'BANK', 'CASH', 'INCOME' and so forth. GnuCashew takes this text value and uses that to switch to the GCW::Dbo::Accounts::Type account type enum.
Definition at line 147 of file Item.h.
References m_account_typeName.
Referenced by accountDef().
|
inline |
auto GCW::Dbo::Accounts::Item::color | ( | ) | const -> std::string |
Color.
Return the color as a string-value.
Definition at line 66 of file Item.cpp.
References GCW::Dbo::Slots::get(), GCW::Dbo::Accounts::Field::guid, and GCW::Dbo::Slots::Field::string_val.
|
inline |
|
inline |
Commodity SCU (Special Currency Unit)
Currency Unit is usually 1/100. This field allows it to be changed. If this value is non-standard, the Item::non_std_scu() will return true.
Definition at line 163 of file Item.h.
References m_commodity_scu.
|
inline |
auto GCW::Dbo::Accounts::Item::fullName | ( | ) | const -> std::string |
Full Name.
Return the 'full name representation' of the account. This includes all parent accounts, using the ':' separator.
Definition at line 50 of file Item.cpp.
References GCW::Dbo::Accounts::fullName().
|
inline |
auto GCW::Dbo::Accounts::Item::hasColor | ( | ) | const -> bool |
Has Color.
Returns 'true' if this account has a color assigned to it.
Definition at line 58 of file Item.cpp.
References GCW::Dbo::Slots::get(), and GCW::Dbo::Accounts::Field::guid.
|
inline |
|
inline |
|
inline |
Non Standard SCU (Special Currency Unit)
If the Item::commodity_scu() is non-standard, this returns true
Definition at line 171 of file Item.h.
References m_non_std_scu.
|
inline |
Parent GUID.
Link to a parent account.
Definition at line 181 of file Item.h.
References m_parent_guid.
|
inline |
persist the data
This connects this object to the back-end database.
Definition at line 243 of file Item.h.
References GCW::Dbo::Accounts::Field::account_typeName, GCW::Dbo::Entries::Field::action, GCW::Dbo::Accounts::Field::code, GCW::Dbo::Accounts::Field::commodity_guid, GCW::Dbo::Accounts::Field::commodity_scu, GCW::Dbo::Accounts::Field::description, GCW::Dbo::Accounts::Field::guid, GCW::Dbo::Accounts::Field::hidden, GCW::Dbo::Invoices::Field::id, m_account_typeName, m_code, m_commodity_guid, m_commodity_scu, m_description, m_guid, m_hidden, m_name, m_non_std_scu, m_parent_guid, m_placeHolder, GCW::Dbo::Accounts::Field::name, GCW::Dbo::Accounts::Field::non_std_scu, GCW::Dbo::Accounts::Field::parent_guid, and GCW::Dbo::Accounts::Field::placeHolder.
|
inline |
Placeholder.
'true' causes this account to not allow transactions to be posted in to
Definition at line 208 of file Item.h.
References m_placeHolder.
|
private |
Definition at line 262 of file Item.h.
Referenced by accountTypeName(), and persist().
|
private |
|
private |
Definition at line 263 of file Item.h.
Referenced by commodity_guid(), and persist().
|
private |
Definition at line 264 of file Item.h.
Referenced by commodity_scu(), and persist().
|
private |
Definition at line 268 of file Item.h.
Referenced by description(), and persist().
|
private |
|
private |
|
private |
|
private |
Definition at line 265 of file Item.h.
Referenced by non_std_scu(), and persist().
|
private |
Definition at line 266 of file Item.h.
Referenced by parent_guid(), and persist().
|
private |
Definition at line 270 of file Item.h.
Referenced by persist(), and placeHolder().