GnuCashew ~ GnuCash Enabled Web
GCW
Entries.cpp
Go to the documentation of this file.
1 #line 2 "src/Dbo/Entries/Entries.cpp"
2 
3 #include "../App.h"
4 #include "../Glb/Core.h"
5 
6 #include "Entries.h"
7 
8 const char * GCW::Dbo::Entries::s_tableName = "entries";
9 
10 const Wt::WFormModel::Field GCW::Dbo::Entries::Field::guid = "guid" ; // text(32) PRIMARY KEY NOT NULL,
11 const Wt::WFormModel::Field GCW::Dbo::Entries::Field::date = "date" ; // text(19) NOT NULL,
12 const Wt::WFormModel::Field GCW::Dbo::Entries::Field::date_entered = "date_entered" ; // text(19),
13 const Wt::WFormModel::Field GCW::Dbo::Entries::Field::description = "description" ; // text(2048),
14 const Wt::WFormModel::Field GCW::Dbo::Entries::Field::action = "action" ; // text(2048),
15 const Wt::WFormModel::Field GCW::Dbo::Entries::Field::notes = "notes" ; // text(2048),
16 const Wt::WFormModel::Field GCW::Dbo::Entries::Field::quantity_num = "quantity_num" ; // bigint,
17 const Wt::WFormModel::Field GCW::Dbo::Entries::Field::quantity_denom = "quantity_denom" ; // bigint,
18 const Wt::WFormModel::Field GCW::Dbo::Entries::Field::i_acct = "i_acct" ; // text(32),
19 const Wt::WFormModel::Field GCW::Dbo::Entries::Field::i_price_num = "i_price_num" ; // bigint,
20 const Wt::WFormModel::Field GCW::Dbo::Entries::Field::i_price_denom = "i_price_denom" ; // bigint,
21 const Wt::WFormModel::Field GCW::Dbo::Entries::Field::i_discount_num = "i_discount_num" ; // bigint,
22 const Wt::WFormModel::Field GCW::Dbo::Entries::Field::i_discount_denom = "i_discount_denom" ; // bigint,
23 const Wt::WFormModel::Field GCW::Dbo::Entries::Field::invoice = "invoice" ; // text(32),
24 const Wt::WFormModel::Field GCW::Dbo::Entries::Field::i_disc_type = "i_disc_type" ; // text(2048),
25 const Wt::WFormModel::Field GCW::Dbo::Entries::Field::i_disc_how = "i_disc_how" ; // text(2048),
26 const Wt::WFormModel::Field GCW::Dbo::Entries::Field::i_taxable = "i_taxable" ; // integer,
27 const Wt::WFormModel::Field GCW::Dbo::Entries::Field::i_taxincluded = "i_taxincluded" ; // integer,
28 const Wt::WFormModel::Field GCW::Dbo::Entries::Field::i_taxtable = "i_taxtable" ; // text(32),
29 const Wt::WFormModel::Field GCW::Dbo::Entries::Field::b_acct = "b_acct" ; // text(32),
30 const Wt::WFormModel::Field GCW::Dbo::Entries::Field::b_price_num = "b_price_num" ; // bigint,
31 const Wt::WFormModel::Field GCW::Dbo::Entries::Field::b_price_denom = "b_price_denom" ; // bigint,
32 const Wt::WFormModel::Field GCW::Dbo::Entries::Field::bill = "bill" ; // text(32),
33 const Wt::WFormModel::Field GCW::Dbo::Entries::Field::b_taxable = "b_taxable" ; // integer,
34 const Wt::WFormModel::Field GCW::Dbo::Entries::Field::b_taxincluded = "b_taxincluded" ; // integer,
35 const Wt::WFormModel::Field GCW::Dbo::Entries::Field::b_taxtable = "b_taxtable" ; // text(32),
36 const Wt::WFormModel::Field GCW::Dbo::Entries::Field::b_paytype = "b_paytype" ; // integer,
37 const Wt::WFormModel::Field GCW::Dbo::Entries::Field::billable = "billable" ; // integer,
38 const Wt::WFormModel::Field GCW::Dbo::Entries::Field::billto_type = "billto_type" ; // integer,
39 const Wt::WFormModel::Field GCW::Dbo::Entries::Field::billto_guid = "billto_guid" ; // text(32),
40 const Wt::WFormModel::Field GCW::Dbo::Entries::Field::order_guid = "order_guid" ; // text(32)
41 
42 auto
44 load( const std::string & _guid )-> GCW::Dbo::Entries::Item::Ptr
45 {
47 
48  if( _guid != "" )
49  {
50 
51  Wt::Dbo::Transaction t( GCW::app()-> gnucashew_session() );
52 
53  try
54  {
55  retVal =
56  GCW::app()-> gnucashew_session().load< GCW::Dbo::Entries::Item >( _guid )
57  ;
58  }
59  catch( std::exception & e )
60  {
61  std::cout << __FILE__ << ":" << __LINE__ << " " << e.what() << std::endl;
62  }
63  }
64 
65  return retVal;
66 
67 } // endload( const std::string & _guid )-> GCW::Dbo::Entries::Item::Ptr
68 
69 auto
71 byGuid( const std::string & _guid )-> GCW::Dbo::Entries::Item::Ptr
72 {
73  return load( _guid );
74 
75 } // endbyGuid( const std::string & _guid )-> GCW::Dbo::Entries::Item::Ptr
76 
77 
Wt::Dbo::ptr< Item > Ptr
Definition: BaseItem.h:39
Entries Class.
Definition: Item.h:99
auto load(const std::string &_guid) -> Item::Ptr
Load Account by GUID.
Definition: Accounts.cpp:135
const Wt::WFormModel::Field bill
Definition: Entries.cpp:32
const Wt::WFormModel::Field i_taxtable
Definition: Entries.cpp:28
const Wt::WFormModel::Field i_discount_denom
Definition: Entries.cpp:22
const Wt::WFormModel::Field action
Definition: Entries.cpp:14
const Wt::WFormModel::Field billable
Definition: Entries.cpp:37
const Wt::WFormModel::Field guid
Definition: Entries.cpp:10
const Wt::WFormModel::Field i_disc_how
Definition: Entries.cpp:25
const Wt::WFormModel::Field b_taxable
Definition: Entries.cpp:33
const Wt::WFormModel::Field b_price_denom
Definition: Entries.cpp:31
const Wt::WFormModel::Field date_entered
Definition: Entries.cpp:12
const Wt::WFormModel::Field i_disc_type
Definition: Entries.cpp:24
const Wt::WFormModel::Field billto_type
Definition: Entries.cpp:38
const Wt::WFormModel::Field description
Definition: Entries.cpp:13
const Wt::WFormModel::Field b_paytype
Definition: Entries.cpp:36
const Wt::WFormModel::Field date
Definition: Entries.cpp:11
const Wt::WFormModel::Field billto_guid
Definition: Entries.cpp:39
const Wt::WFormModel::Field b_taxtable
Definition: Entries.cpp:35
const Wt::WFormModel::Field i_discount_num
Definition: Entries.cpp:21
const Wt::WFormModel::Field order_guid
Definition: Entries.cpp:40
const Wt::WFormModel::Field i_price_num
Definition: Entries.cpp:19
const Wt::WFormModel::Field notes
Definition: Entries.cpp:15
const Wt::WFormModel::Field b_price_num
Definition: Entries.cpp:30
const Wt::WFormModel::Field i_taxable
Definition: Entries.cpp:26
const Wt::WFormModel::Field b_acct
Definition: Entries.cpp:29
const Wt::WFormModel::Field i_price_denom
Definition: Entries.cpp:20
const Wt::WFormModel::Field i_taxincluded
Definition: Entries.cpp:27
const Wt::WFormModel::Field quantity_num
Definition: Entries.cpp:16
const Wt::WFormModel::Field invoice
Definition: Entries.cpp:23
const Wt::WFormModel::Field quantity_denom
Definition: Entries.cpp:17
const Wt::WFormModel::Field b_taxincluded
Definition: Entries.cpp:34
const Wt::WFormModel::Field i_acct
Definition: Entries.cpp:18
const char * s_tableName
Definition: Entries.cpp:8
auto byGuid(const std::string &_guid) -> Item::Ptr
Load Entry by Guid.
Definition: Entries.cpp:71
auto load(const std::string &_guid) -> Item::Ptr
Load Entry by Guid.
Definition: Entries.cpp:44
App * app()
Definition: App.cpp:67