GnuCashew ~ GnuCash Enabled Web
GCW
Invoices.cpp
Go to the documentation of this file.
1 #line 2 "src/Dbo/Invoices/Invoices.cpp"
2 
3 #include "../App.h"
4 #include "../Glb/Core.h"
5 
6 #include "Invoices.h"
7 
8 const char * GCW::Dbo::Invoices::s_tableName = "invoices";
9 
10 const Wt::WFormModel::Field GCW::Dbo::Invoices::Field::guid = "guid" ; // text(32) PRIMARY KEY NOT NULL,
11 const Wt::WFormModel::Field GCW::Dbo::Invoices::Field::id = "id" ; // text(2048) NOT NULL,
12 const Wt::WFormModel::Field GCW::Dbo::Invoices::Field::date_opened = "date_opened" ; // text(19),
13 const Wt::WFormModel::Field GCW::Dbo::Invoices::Field::date_posted = "date_posted" ; // text(19),
14 const Wt::WFormModel::Field GCW::Dbo::Invoices::Field::notes = "notes" ; // text(2048) NOT NULL,
15 const Wt::WFormModel::Field GCW::Dbo::Invoices::Field::active = "active" ; // integer NOT NULL,
16 const Wt::WFormModel::Field GCW::Dbo::Invoices::Field::currency = "currency" ; // text(32) NOT NULL,
17 const Wt::WFormModel::Field GCW::Dbo::Invoices::Field::owner_type = "owner_type" ; // integer,
18 const Wt::WFormModel::Field GCW::Dbo::Invoices::Field::owner_guid = "owner_guid" ; // text(32),
19 const Wt::WFormModel::Field GCW::Dbo::Invoices::Field::terms = "terms" ; // text(32),
20 const Wt::WFormModel::Field GCW::Dbo::Invoices::Field::billing_id = "billing_id" ; // text(2048),
21 const Wt::WFormModel::Field GCW::Dbo::Invoices::Field::post_txn = "post_txn" ; // text(32),
22 const Wt::WFormModel::Field GCW::Dbo::Invoices::Field::post_lot = "post_lot" ; // text(32),
23 const Wt::WFormModel::Field GCW::Dbo::Invoices::Field::post_acc = "post_acc" ; // text(32),
24 const Wt::WFormModel::Field GCW::Dbo::Invoices::Field::billto_type = "billto_type" ; // integer,
25 const Wt::WFormModel::Field GCW::Dbo::Invoices::Field::billto_guid = "billto_guid" ; // text(32),
26 const Wt::WFormModel::Field GCW::Dbo::Invoices::Field::charge_amt_num = "charge_amt_num" ; // bigint,
27 const Wt::WFormModel::Field GCW::Dbo::Invoices::Field::charge_amt_denom = "charge_amt_denom" ; // bigint
28 
29 auto
31 load( const std::string & _guid )-> GCW::Dbo::Invoices::Item::Ptr
32 {
34 
35  if( _guid != "" )
36  {
37 
38  Wt::Dbo::Transaction t( GCW::app()-> gnucashew_session() );
39 
40  try
41  {
42  retVal =
43  GCW::app()-> gnucashew_session().load< GCW::Dbo::Invoices::Item >( _guid )
44  ;
45  }
46  catch( std::exception & e )
47  {
48  std::cout << __FILE__ << ":" << __LINE__ << " " << e.what() << std::endl;
49  }
50  }
51 
52  return retVal;
53 
54 } // endload( const std::string & _guid )-> GCW::Dbo::Invoices::Item::Ptr
55 
56 auto
58 byGuid( const std::string & _guid )-> GCW::Dbo::Invoices::Item::Ptr
59 {
60  return load( _guid );
61 
62 } // endbyGuid( const std::string & _guid )-> GCW::Dbo::Invoices::Item::Ptr
63 
64 
Wt::Dbo::ptr< Item > Ptr
Definition: BaseItem.h:39
Invoices Class.
Definition: Item.h:86
auto load(const std::string &_guid) -> Item::Ptr
Load Account by GUID.
Definition: Accounts.cpp:135
const Wt::WFormModel::Field notes
Definition: Definition.h:20
const Wt::WFormModel::Field currency
Definition: Definition.h:22
const Wt::WFormModel::Field billing_id
Definition: Definition.h:26
const Wt::WFormModel::Field billto_guid
Definition: Definition.h:31
const Wt::WFormModel::Field date_posted
Definition: Definition.h:19
const Wt::WFormModel::Field active
Definition: Definition.h:21
const Wt::WFormModel::Field id
Definition: Definition.h:17
const Wt::WFormModel::Field post_lot
Definition: Definition.h:28
const Wt::WFormModel::Field billto_type
Definition: Definition.h:30
const Wt::WFormModel::Field post_acc
Definition: Definition.h:29
const Wt::WFormModel::Field owner_type
Definition: Definition.h:23
const Wt::WFormModel::Field date_opened
Definition: Definition.h:18
const Wt::WFormModel::Field charge_amt_num
Definition: Definition.h:32
const Wt::WFormModel::Field owner_guid
Definition: Definition.h:24
const Wt::WFormModel::Field post_txn
Definition: Definition.h:27
const Wt::WFormModel::Field guid
Definition: Definition.h:16
const Wt::WFormModel::Field charge_amt_denom
Definition: Definition.h:33
const Wt::WFormModel::Field terms
Definition: Definition.h:25
auto byGuid(const std::string &_guid) -> Item::Ptr
Load Invoice by Guid.
Definition: Invoices.cpp:58
auto load(const std::string &_guid) -> Item::Ptr
Load Invoice by Guid.
Definition: Invoices.cpp:31
const char * s_tableName
Definition: Definition.h:12
App * app()
Definition: App.cpp:67