GnuCashew ~ Web Application compatible with GnuCash sql data files.
GCW
Loading...
Searching...
No Matches
BillPay.cpp
Go to the documentation of this file.
1#line 2 "src/Gui/BillPay/BillPay.cpp"
2
3#include "BillPay.h"
4
5auto
8{
9 Wt::Dbo::Transaction t( GCW::app()-> gnucashew_session() );
10
11 auto retVal = GCW::Dbo::Vars::get( "config", GCW_GUI_BILLPAY_CONFIG_CFY );
12
13 return retVal;
14
15} // endconfigItem()-> GCW::Dbo::Vars::Item::Ptr
16
17auto
19bpItems()-> std::vector< GCW::Gui::BillPay::Item >
20{
21 std::vector< GCW::Gui::BillPay::Item > retVal;
22
24 retVal.push_back( GCW::Gui::BillPay::Item( item ) );
25
26 return retVal;
27
28} // endbpItems()-> GCW::Gui::BillPay::Item::Vector
29
30
31auto
33bpItem( const std::string & _guid )-> GCW::Gui::BillPay::Item
34{
35 return
37 (
38 /*
39 ** get the BP item based on the GUID provided. Note
40 ** that if the item doesn't exist, it will be added.
41 **
42 */
44 (
45 _guid,
47 true
48 )
49 );
50
51} // endbpItem( const std::string & _nickname )-> GCW::Dbo::Vars::Item::Ptr
52
53auto
55toString( int _value )-> std::string
56{
57 std::string retVal = std::to_string( _value );
58
59 if( retVal.length() == 1 )
60 retVal = "0" + retVal;
61
62 return retVal;
63
64} // endtoString( int _value )-> std::string
65
66auto
68toOneLineString( const std::string & _value )-> std::string
69{
70 std::string retVal ;
71
72 for( auto c : _value )
73 {
74 if( c == 13 || c == 10 )
75 retVal += "\\n";
76 else
77 retVal += c;
78 }
79
80 return retVal;
81
82} // endtoString( int _value )-> std::string
83
84auto
86exportAll()-> void
87{
88
89} // endexportAll()-> void
90
91auto
93importAll()-> void
94{
95
96} // endimportAll()-> void
97
98
#define GCW_GUI_BILLPAY_ITEM_CFY
Definition BillPay.h:41
#define GCW_GUI_BILLPAY_CONFIG_CFY
Definition BillPay.h:40
auto getByCfy(const std::string &_cfyValue) -> GCW::Dbo::Vars::Item::Vector
Definition Vars.cpp:75
auto get(const std::string &_keyValue, const std::string &_cfyValue="*", bool _add=true) -> GCW::Dbo::Vars::Item::Ptr
Definition Vars.cpp:16
auto bpItem(const std::string &_guid) -> GCW::Gui::BillPay::Item
Bill Pay Item.
Definition BillPay.cpp:33
auto importAll() -> void
Definition BillPay.cpp:93
auto bpItems() -> std::vector< GCW::Gui::BillPay::Item >
Bill Pay Items.
Definition BillPay.cpp:19
auto exportAll() -> void
Definition BillPay.cpp:86
auto toOneLineString(const std::string &_input) -> std::string
Convert a string with new-lines.
Definition BillPay.cpp:68
auto toString(int _value) -> std::string
Convert Integer to String.
Definition BillPay.cpp:55
auto configItem() -> GCW::Dbo::Vars::Item::Ptr
Config Item.
Definition BillPay.cpp:7
App * app()
Definition App.cpp:75