GnuCashew ~ Web Application compatible with GnuCash sql data files.
GCW
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
GCW::Dbo::Transactions::Item Class Reference

Transaction Item. More...

#include <Transactions.h>

+ Inheritance diagram for GCW::Dbo::Transactions::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 Wt::WDate &_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.
 
auto post_date_as_date () const -> Wt::WDateTime
 Date as WDate.
 
auto set_post_date (const Wt::WDate &_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 Member Functions inherited from Wt::Dbo::Dbo< Item >
 Dbo ()
 
 Dbo (const Dbo< C > &other)
 
dbo_traits< C >::IdType id () const
 
Sessionsession () const
 
void setDirty ()
 
bool isDirty () const
 
ptr< C > self () const
 

Private Member Functions

auto set_enter_date (const std::string &_value) -> void
 
auto set_post_date (const std::string &_value) -> void
 

Private 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 &
auto description() const -> const std::string &
auto currency_guid() const -> const std::string &
auto num() const -> const std::string &
auto guid() const -> const std::string &
auto post_date() const -> const std::string &

Definition at line 74 of file Transactions.h.

Member Typedef Documentation

◆ Collection

Definition at line 80 of file Transactions.h.

◆ Ptr

Definition at line 79 of file Transactions.h.

◆ Vector

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

Definition at line 81 of file Transactions.h.

Constructor & Destructor Documentation

◆ Item() [1/2]

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

Definition at line 83 of file Transactions.h.

◆ Item() [2/2]

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

Definition at line 84 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 87 of file Transactions.h.

References m_currency_guid.

◆ description()

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

Definition at line 91 of file Transactions.h.

References m_description.

◆ enter_date()

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

Definition at line 90 of file Transactions.h.

References m_enter_date.

◆ guid()

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

Definition at line 86 of file Transactions.h.

References m_guid.

◆ num()

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

Definition at line 88 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 89 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 124 of file Transactions.h.

References Wt::WDateTime::fromString(), GCW_DATETIME_FORMAT_STORAGE, and 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 111 of file Transactions.h.

References Wt::WDateTime::fromString(), GCW_DATETIME_FORMAT_STORAGE, and post_date().

◆ set_currency_guid()

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

Definition at line 93 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 73 of file Transactions.cpp.

◆ set_enter_date() [1/3]

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

Definition at line 17 of file Transactions.cpp.

◆ set_enter_date() [2/3]

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

Definition at line 24 of file Transactions.cpp.

References GCW_DATE_DEFAULT_TIME, and GCW_DATETIME_FORMAT_STORAGE.

◆ set_enter_date() [3/3]

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

Definition at line 32 of file Transactions.cpp.

References GCW_DATETIME_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/3]

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

Definition at line 39 of file Transactions.cpp.

◆ set_post_date() [2/3]

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

Definition at line 46 of file Transactions.cpp.

References GCW_DATE_DEFAULT_TIME, and GCW_DATETIME_FORMAT_STORAGE.

◆ set_post_date() [3/3]

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

Definition at line 56 of file Transactions.cpp.

Member Data Documentation

◆ m_currency_guid

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

Definition at line 151 of file Transactions.h.

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

◆ m_description

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

Definition at line 155 of file Transactions.h.

Referenced by description(), and persist().

◆ m_enter_date

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

Definition at line 154 of file Transactions.h.

Referenced by enter_date(), and persist().

◆ m_guid

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

Definition at line 150 of file Transactions.h.

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

◆ m_num

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

Definition at line 152 of file Transactions.h.

Referenced by num(), and persist().

◆ m_post_date

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

Definition at line 153 of file Transactions.h.

Referenced by persist(), and post_date().


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