GnuCashew ~ GnuCash Enabled Web
GCW
Public Types | Public Member Functions | Public Attributes | List of all members
GCW::Dbo::Transactions::Item Class Reference

Transaction Item. More...

#include <Transactions.h>

Inherits Wt::Dbo::Dbo< Item >.

Public Types

using Ptr = Wt::Dbo::ptr< Item >
 
using Collection = Wt::Dbo::collection< Ptr >
 
using Vector = std::vector< Ptr >
 

Public Member Functions

 Item ()
 
 Item (const std::string &_txGuid)
 
auto guid () const -> const std::string &
 
auto currency_guid () const -> const std::string &
 
auto num () const -> const std::string &
 
auto post_date () const -> const std::string &
 
auto enter_date () const -> const std::string &
 
auto description () const -> const std::string &
 
auto set_currency_guid (const std::string &_guid) -> void
 
auto set_enter_date (const std::string &_value) -> void
 
auto set_enter_date (const Wt::WDateTime &_value) -> void
 
auto set_num (const std::string &_value) -> void
 
auto post_date_as_string (const std::string &_format) const -> std::string
 Post Date as String. More...
 
auto post_date_as_date () const -> Wt::WDateTime
 Date as WDate. More...
 
auto set_post_date (const std::string &_value) -> void
 
auto set_post_date (const Wt::WDateTime &_value) -> void
 
auto set_description (const std::string &_value) -> void
 
template<class Action >
void persist (Action &action)
 

Public Attributes

std::string m_guid
 
std::string m_currency_guid
 
std::string m_num
 
std::string m_post_date
 
std::string m_enter_date
 
std::string m_description
 

Detailed Description

Transaction Item.

CREATE TABLE transactions
(
guid text(32) PRIMARY KEY NOT NULL,
currency_guid text(32) NOT NULL,
num text(2048) NOT NULL,
post_date text(19),
enter_date text(19),
description text(2048)
);
CREATE INDEX tx_post_date_index ON transactions(post_date);
sqlite> select * from transactions;
4b2259ef3fbb486bad1b42f28ec84346|10b24d11b4b94b8789d1830da2695bbb||2023-05-28 10:59:00|2023-05-28 21:46:09|transaction memo
8e841d9c97914cd5a5bd47062e7c91e3|10b24d11b4b94b8789d1830da2695bbb||2023-07-04 10:59:00|2023-07-05 16:19:43|2nd transaction
auto enter_date() const -> const std::string &
Definition: Transactions.h:88
auto description() const -> const std::string &
Definition: Transactions.h:89
auto currency_guid() const -> const std::string &
Definition: Transactions.h:85
auto num() const -> const std::string &
Definition: Transactions.h:86
auto guid() const -> const std::string &
Definition: Transactions.h:84
auto post_date() const -> const std::string &
Definition: Transactions.h:87

Definition at line 72 of file Transactions.h.

Member Typedef Documentation

◆ Collection

using GCW::Dbo::Transactions::Item::Collection = Wt::Dbo::collection< Ptr >

Definition at line 78 of file Transactions.h.

◆ Ptr

using GCW::Dbo::Transactions::Item::Ptr = Wt::Dbo::ptr< Item >

Definition at line 77 of file Transactions.h.

◆ Vector

using GCW::Dbo::Transactions::Item::Vector = std::vector< Ptr >

Definition at line 79 of file Transactions.h.

Constructor & Destructor Documentation

◆ Item() [1/2]

GCW::Dbo::Transactions::Item::Item ( )
inline

Definition at line 81 of file Transactions.h.

◆ Item() [2/2]

GCW::Dbo::Transactions::Item::Item ( const std::string &  _txGuid)
inline

Definition at line 82 of file Transactions.h.

References m_guid.

Member Function Documentation

◆ currency_guid()

auto GCW::Dbo::Transactions::Item::currency_guid ( ) const -> const std::string &
inline

Definition at line 85 of file Transactions.h.

References m_currency_guid.

◆ description()

auto GCW::Dbo::Transactions::Item::description ( ) const -> const std::string &
inline

Definition at line 89 of file Transactions.h.

References m_description.

◆ enter_date()

auto GCW::Dbo::Transactions::Item::enter_date ( ) const -> const std::string &
inline

Definition at line 88 of file Transactions.h.

References m_enter_date.

◆ guid()

auto GCW::Dbo::Transactions::Item::guid ( ) const -> const std::string &
inline

Definition at line 84 of file Transactions.h.

References m_guid.

◆ num()

auto GCW::Dbo::Transactions::Item::num ( ) const -> const std::string &
inline

Definition at line 86 of file Transactions.h.

References m_num.

◆ persist()

template<class Action >
void GCW::Dbo::Transactions::Item::persist ( Action &  action)
inline

◆ post_date()

auto GCW::Dbo::Transactions::Item::post_date ( ) const -> const std::string &
inline

Definition at line 87 of file Transactions.h.

References m_post_date.

Referenced by post_date_as_date(), and post_date_as_string().

◆ post_date_as_date()

auto GCW::Dbo::Transactions::Item::post_date_as_date ( ) const -> Wt::WDateTime
inline

Date as WDate.

This will take the stored string-date of the transaction and covert it to a system WDateTime value.

Definition at line 122 of file Transactions.h.

References post_date().

◆ post_date_as_string()

auto GCW::Dbo::Transactions::Item::post_date_as_string ( const std::string &  _format) const -> std::string
inline

Post Date as String.

This pulls the post-date from the back-end and formats it with the requested format. This is used for screen-representations of the date.

Definition at line 109 of file Transactions.h.

References post_date().

◆ set_currency_guid()

auto GCW::Dbo::Transactions::Item::set_currency_guid ( const std::string &  _guid) -> void
inline

Definition at line 91 of file Transactions.h.

References m_currency_guid.

◆ set_description()

auto GCW::Dbo::Transactions::Item::set_description ( const std::string &  _value) -> void

Definition at line 45 of file Transactions.cpp.

◆ set_enter_date() [1/2]

auto GCW::Dbo::Transactions::Item::set_enter_date ( const std::string &  _value) -> void

Definition at line 17 of file Transactions.cpp.

◆ set_enter_date() [2/2]

auto GCW::Dbo::Transactions::Item::set_enter_date ( const Wt::WDateTime &  _value) -> void

Definition at line 24 of file Transactions.cpp.

References GCW_DATE_FORMAT_STORAGE.

◆ set_num()

auto GCW::Dbo::Transactions::Item::set_num ( const std::string &  _value) -> void

Definition at line 9 of file Transactions.cpp.

◆ set_post_date() [1/2]

auto GCW::Dbo::Transactions::Item::set_post_date ( const std::string &  _value) -> void

Definition at line 31 of file Transactions.cpp.

◆ set_post_date() [2/2]

auto GCW::Dbo::Transactions::Item::set_post_date ( const Wt::WDateTime &  _value) -> void

Definition at line 38 of file Transactions.cpp.

Member Data Documentation

◆ m_currency_guid

std::string GCW::Dbo::Transactions::Item::m_currency_guid

Definition at line 144 of file Transactions.h.

Referenced by currency_guid(), persist(), and set_currency_guid().

◆ m_description

std::string GCW::Dbo::Transactions::Item::m_description

Definition at line 148 of file Transactions.h.

Referenced by description(), and persist().

◆ m_enter_date

std::string GCW::Dbo::Transactions::Item::m_enter_date

Definition at line 147 of file Transactions.h.

Referenced by enter_date(), and persist().

◆ m_guid

std::string GCW::Dbo::Transactions::Item::m_guid

Definition at line 143 of file Transactions.h.

Referenced by guid(), Item(), and persist().

◆ m_num

std::string GCW::Dbo::Transactions::Item::m_num

Definition at line 145 of file Transactions.h.

Referenced by num(), and persist().

◆ m_post_date

std::string GCW::Dbo::Transactions::Item::m_post_date

Definition at line 146 of file Transactions.h.

Referenced by persist(), and post_date().


The documentation for this class was generated from the following files: