1 #line 2 "src/Dbo/Accounts/Accounts.cpp"
3 #include "../Glb/Core.h"
74 _accountItems.begin(),
80 auto fullName1 = GCW::Dbo::Accounts::fullName( item1-> guid() );
81 auto fullName2 = GCW::Dbo::Accounts::fullName( item2-> guid() );
99 Wt::Dbo::Transaction t(
GCW::app()-> gnucashew_session() );
109 .where(
"(parent_guid = '' OR parent_guid IS NULL) AND name = 'Root Account'" )
113 if( results.size() == 1 )
115 retVal = *results.begin();
142 Wt::Dbo::Transaction t(
GCW::app()-> gnucashew_session() );
150 catch( std::exception & e )
152 std::cout << __FILE__ <<
":" << __LINE__ <<
" " << e.what() << std::endl;
164 return load( _guid );
176 .where(
"parent_guid = ? AND name = ?" )
206 Wt::Dbo::Transaction t(
GCW::app()-> gnucashew_session() );
208 for(
int i=0; i<
split.size(); i++ )
226 for(
auto result : results )
227 retVal.push_back( result );
252 for(
auto & result : results )
256 retVal.push_back( result );
282 fullName(
const std::string & _accountGuid )-> std::string
289 if( _accountGuid ==
"" )
296 auto accountItem =
byGuid( _accountGuid );
326 retVal += accountItem->
name();
339 fullName( Item::Ptr _item )-> std::string
static std::vector< std::string > & split(const std::string &s, char delim, std::vector< std::string > &elems)
std::vector< Ptr > Vector
std::vector< std::string > split(const std::string &value, char delim)
auto vector(const std::string &_parentGuid) -> Item::Vector
Child Accounts via parent.
const Wt::WFormModel::Field name
const Wt::WFormModel::Field guid
const Wt::WFormModel::Field description
const Wt::WFormModel::Field commodity_scu
const Wt::WFormModel::Field account_typeName
const Wt::WFormModel::Field code
const Wt::WFormModel::Field non_std_scu
const Wt::WFormModel::Field commodity_guid
const Wt::WFormModel::Field placeHolder
const Wt::WFormModel::Field hidden
const Wt::WFormModel::Field parent_guid
auto rootAccount() -> Item::Ptr
Load Root Account.
@ CREDITLINE
18 ~ do not use
@ CURRENCY
07 ~ currency trading account (DEPRECATED)
@ EXPENSE
09 ~ expense tracking account
@ CHECKING
15 ~ do not use
@ ASSET
02 ~ generic generalized asset account
@ INCOME
08 ~ income tracking account
@ BANK
00 ~ bank institutionally held monies, can be interest bearing
@ MUTUAL
06 ~ similar to stock, shows: price, # shares, value
@ LIABILITY
04 ~ generic generalized liability account
@ EQUITY
10 ~ used to balance the balance sheet
@ TRADING
14 ~ used to record multiple commodify transactions
@ CASH
01 ~ pure cash (shoebox)
@ CREDIT
03 ~ AMEX / VISA / DISCOVER type of credit cards
@ MONEYMRKT
17 ~ do not use
@ ROOT
13 ~ hidden root account for the account tree
@ PAYABLE
12 ~ A/R payable account
@ RECEIVABLE
11 ~ A/R receivable account
@ STOCK
05 ~ stock account show as three-column registers: price, # shares, value
auto load(const std::string &_guid) -> Item::Ptr
Load Account by GUID.
auto activeAccounts() -> Item::Vector
Load accounts as; if( !hidden() && !placeHolder() )
@ DEBIT
0x01 ~ DEBIT type account
@ NONE
0x00 ~ invalid - should not happen
@ CREDIT
0x02 ~ CREDIT type account
const std::vector< AccountDef_t > s_accountDefs
auto allAccounts() -> Item::Vector
Load all accounts.
auto byFullName(const std::string &_fullName) -> Item::Ptr
Load Account by 'full name' with ':' account separator.
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 fullName(const std::string &_guid) -> std::string
Account Fullname via GUID.