GnuCashew ~ Web Application compatible with GnuCash sql data files.
GCW
Loading...
Searching...
No Matches
Dbo/Accounts/Item.cpp
Go to the documentation of this file.
1#line 2 "src/Dbo/Accounts/Item.cpp"
2
3//#include <gnucash/gnc-session.h>
4//#include <gnucash/Account.h>
5
6#include "../Transactions/Transactions.h"
7#include "../Slots/Slots.h"
8#include "Item.h"
9
10auto
12accountDef() const-> const GCW::Dbo::Accounts::AccountDef_t &
13{
14 auto atn = accountTypeName();
15
16 for( auto & val : GCW::Dbo::Accounts::s_accountDefs )
17 if( val.backendName == accountTypeName() )
18 return val;
19
21}
22
23auto
25accountDrCr() const-> GCW::Dbo::Accounts::DrCr
26{
27 auto atn = accountTypeName();
28
29 for( auto & val : GCW::Dbo::Accounts::s_accountDefs )
30 if( val.backendName == accountTypeName() )
31 return val.drcr;
32
34}
35
36auto
38accountType() const-> GCW::Dbo::Accounts::Type
39{
40 auto atn = accountTypeName();
41
42 for( auto & val : GCW::Dbo::Accounts::s_accountDefs )
43 if( val.backendName == accountTypeName() )
44 return val.type;
45
47}
48
49auto
51fullName() const-> std::string
52{
53 return GCW::Dbo::Accounts::fullName( self() );
54
55} // endfullName() const-> std::string
56
57auto
59hasColor() const-> bool
60{
61 return GCW::Dbo::Slots::get( guid(), "color" ).get();
62
63} // endhasColor() const-> bool
64
65auto
67color() const-> std::string
68{
69 std::string retVal;
70
71 if( auto slotItem = GCW::Dbo::Slots::get( guid(), "color" ) )
72 {
73 retVal = slotItem-> string_val();
74 }
75
76 return retVal;
77
78} // endcolor() const-> std::string
79
80
auto hasColor() const -> bool
Has Color.
auto color() const -> std::string
Color.
auto accountDrCr() const -> GCW::Dbo::Accounts::DrCr
Account Debit/Credit.
auto accountType() const -> GCW::Dbo::Accounts::Type
Account Type.
auto fullName() const -> std::string
Full Name.
auto accountTypeName() const -> const std::string &
Type Name.
auto accountDef() const -> const GCW::Dbo::Accounts::AccountDef_t &
Account Definition.
@ NONE
-1 ~ not a type
DrCr
Account Debit/Credit Enum.
@ NONE
0x00 ~ invalid - should not happen
const std::vector< AccountDef_t > s_accountDefs
auto fullName(const std::string &_guid) -> std::string
Account Fullname via GUID.
auto get() -> GCW::Dbo::Slots::Item::Vector
Definition Slots.cpp:30
Definition App.h:18