GnuCashew ~ GnuCash Enabled Web
GCW
|
#include <Manager.h>
Public Member Functions | |
Manager () | |
Manager (GCW::Dbo::Splits::Item::Ptr _splitItem) | |
auto | loadTransaction (const std::string &_transactionGuid) -> void |
Set Transaction. More... | |
auto | deleteTransaction () -> void |
auto | loadSplit (const std::string &_splitGuid) -> void |
Set Split. More... | |
auto | newTransaction (const std::string &_accountGuid1, const std::string &_accountGuid2) -> void |
New Transaction. More... | |
auto | transaction () const -> GCW::Dbo::Transactions::Item::Ptr |
Transaction Item. More... | |
auto | splits () const -> GCW::Dbo::Splits::Item::Vector |
Splits Vector. More... | |
auto | otherGuid () const -> std::string |
Other GUID. More... | |
auto | getDate () const -> Wt::WDateTime |
Set Date. More... | |
auto | setDate (const Wt::WDateTime &_value) -> void |
auto | setAction (const std::string &_value) -> void |
Set Action. More... | |
auto | getDescription () const -> std::string |
Set Description. More... | |
auto | setDescription (const std::string &_value) -> void |
auto | setTransferGuid (const std::string &_value) -> void |
Set Transfer GUID. More... | |
auto | setReconcile (const std::string &_value) -> void |
auto | getValue () const -> GCW_NUMERIC |
auto | getValueAsString () const -> std::string |
auto | setValue (GCW_NUMERIC _value) -> void |
auto | setNotes (const std::string &_value) -> void |
auto | split (const std::string &_splitGuid) const -> GCW::Dbo::Splits::Item::Ptr |
auto | thisSplit () const -> GCW::Dbo::Splits::Item::Ptr |
auto | thatSplit () const -> GCW::Dbo::Splits::Item::Ptr |
Private Attributes | |
std::string | m_splitGuid |
GCW::Dbo::Transactions ::Item::Ptr | m_transaction |
GCW::Dbo::Splits ::Item::Vector | m_splitItems |
Transaction Manager.
This class is simply a convenience class for grouping all the transaction manipulation tasks in to one place. It allows new transactions to be created, and takes care of insuring that the transaction is always in balance, and always contains the requisite debits and credits to insure a properly balanced transaction.
GCW::Dbo::Transactions::Manager::Manager | ( | ) |
Definition at line 6 of file Manager.cpp.
GCW::Dbo::Transactions::Manager::Manager | ( | GCW::Dbo::Splits::Item::Ptr | _splitItem | ) |
Definition at line 12 of file Manager.cpp.
auto GCW::Dbo::Transactions::Manager::deleteTransaction | ( | ) | -> void |
Definition at line 79 of file Manager.cpp.
References GCW::app().
auto GCW::Dbo::Transactions::Manager::getDate | ( | ) | const -> Wt::WDateTime |
Set Date.
This sets the date on the Transaction of the element.
Definition at line 152 of file Manager.cpp.
auto GCW::Dbo::Transactions::Manager::getDescription | ( | ) | const -> std::string |
Set Description.
This sets the description on the Transaction of the element.
Definition at line 178 of file Manager.cpp.
References GCW::Dbo::Accounts::Field::description.
auto GCW::Dbo::Transactions::Manager::getValue | ( | ) | const -> GCW_NUMERIC |
Definition at line 213 of file Manager.cpp.
auto GCW::Dbo::Transactions::Manager::getValueAsString | ( | ) | const -> std::string |
Definition at line 221 of file Manager.cpp.
auto GCW::Dbo::Transactions::Manager::loadSplit | ( | const std::string & | _splitGuid | ) | -> void |
Set Split.
Set transaction based on any one of the splits.
This will load the split, then load the transaction for that split, causing all the other splits to load.
Definition at line 91 of file Manager.cpp.
References GCW::Dbo::Splits::load().
Referenced by GCW::Eng::AccountRegisterModel::isDeletable(), GCW::Eng::AccountRegisterModel::isEditable(), and GCW::Eng::AccountRegisterModel::saveToDisk().
auto GCW::Dbo::Transactions::Manager::loadTransaction | ( | const std::string & | _transactionGuid | ) | -> void |
Set Transaction.
Set transaction based on the transaction Guid. This will load the transaction as well as all the splits associated with it.
Definition at line 63 of file Manager.cpp.
References GCW::Dbo::Splits::byTransaction(), GCW::Dbo::Accounts::Field::guid, and GCW::Dbo::Transactions::load().
auto GCW::Dbo::Transactions::Manager::newTransaction | ( | const std::string & | _accountGuid1, |
const std::string & | _accountGuid2 | ||
) | -> void |
New Transaction.
This will create a new Transaction for an account within the system fully populated with at least two splits.
Definition at line 19 of file Manager.cpp.
References GCW::Dbo::Splits::add(), GCW::Dbo::Transactions::add(), GCW::app(), GCW::Dbo::Accounts::Field::commodity_guid, GCW_DEFAULT_DATE, GCW_RECONCILE_NO, GCW::Dbo::Accounts::Field::guid, GCW::Dbo::Accounts::load(), and GCW::Core::newGuid().
Referenced by GCW::Eng::AccountRegisterModel::saveToDisk().
auto GCW::Dbo::Transactions::Manager::otherGuid | ( | ) | const -> std::string |
Other GUID.
When there are only two splits, this will return the guid of the split item that does not match the guid provided.
Definition at line 112 of file Manager.cpp.
References GCW::Dbo::Accounts::Field::guid.
auto GCW::Dbo::Transactions::Manager::setAction | ( | const std::string & | _value | ) | -> void |
Set Action.
This sets the Action on the split. The 'action' is stored in the Split item and this function will apply the value to both sides of the split.
Definition at line 169 of file Manager.cpp.
References GCW::app().
Referenced by GCW::Eng::AccountRegisterModel::saveToDisk().
auto GCW::Dbo::Transactions::Manager::setDate | ( | const Wt::WDateTime & | _value | ) | -> void |
Definition at line 160 of file Manager.cpp.
References GCW::app().
Referenced by GCW::Eng::AccountRegisterModel::saveToDisk().
auto GCW::Dbo::Transactions::Manager::setDescription | ( | const std::string & | _value | ) | -> void |
Definition at line 186 of file Manager.cpp.
References GCW::app().
Referenced by GCW::Eng::AccountRegisterModel::saveToDisk().
auto GCW::Dbo::Transactions::Manager::setNotes | ( | const std::string & | _value | ) | -> void |
Definition at line 239 of file Manager.cpp.
Referenced by GCW::Eng::AccountRegisterModel::saveToDisk().
auto GCW::Dbo::Transactions::Manager::setReconcile | ( | const std::string & | _value | ) | -> void |
Definition at line 204 of file Manager.cpp.
References GCW::app().
Referenced by GCW::Eng::AccountRegisterModel::saveToDisk().
auto GCW::Dbo::Transactions::Manager::setTransferGuid | ( | const std::string & | _value | ) | -> void |
Set Transfer GUID.
This sets the (other) split (identified by guid) to the account given.
Definition at line 195 of file Manager.cpp.
References GCW::app().
Referenced by GCW::Eng::AccountRegisterModel::saveToDisk().
auto GCW::Dbo::Transactions::Manager::setValue | ( | GCW_NUMERIC | _value | ) | -> void |
Definition at line 229 of file Manager.cpp.
References GCW::app().
Referenced by GCW::Eng::AccountRegisterModel::saveToDisk().
auto GCW::Dbo::Transactions::Manager::split | ( | const std::string & | _splitGuid | ) | const -> GCW::Dbo::Splits::Item::Ptr |
Definition at line 124 of file Manager.cpp.
References GCW::Dbo::Accounts::Field::guid.
|
inline |
Splits Vector.
This returns the splits vector
Definition at line 81 of file Manager.h.
References m_splitItems.
auto GCW::Dbo::Transactions::Manager::thatSplit | ( | ) | const -> GCW::Dbo::Splits::Item::Ptr |
Definition at line 144 of file Manager.cpp.
References split().
auto GCW::Dbo::Transactions::Manager::thisSplit | ( | ) | const -> GCW::Dbo::Splits::Item::Ptr |
Definition at line 136 of file Manager.cpp.
References split().
Referenced by GCW::Eng::AccountRegisterModel::isDeletable(), and GCW::Eng::AccountRegisterModel::isEditable().
|
inline |
Transaction Item.
This returns the transaction point object
Definition at line 73 of file Manager.h.
References m_transaction.
|
private |
|
private |
|
private |
Definition at line 158 of file Manager.h.
Referenced by transaction().