GnuCashew ~ Web Application compatible with GnuCash sql data files.
GCW
Loading...
Searching...
No Matches
Dbo/Invoices/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
8const char * GCW::Dbo::Invoices::s_tableName = "invoices";
9
10const Wt::WFormModel::Field GCW::Dbo::Invoices::Field::guid = "guid" ; // text(32) PRIMARY KEY NOT NULL,
11const Wt::WFormModel::Field GCW::Dbo::Invoices::Field::id = "id" ; // text(2048) NOT NULL,
12const Wt::WFormModel::Field GCW::Dbo::Invoices::Field::date_opened = "date_opened" ; // text(19),
13const Wt::WFormModel::Field GCW::Dbo::Invoices::Field::date_posted = "date_posted" ; // text(19),
14const Wt::WFormModel::Field GCW::Dbo::Invoices::Field::notes = "notes" ; // text(2048) NOT NULL,
15const Wt::WFormModel::Field GCW::Dbo::Invoices::Field::active = "active" ; // integer NOT NULL,
16const Wt::WFormModel::Field GCW::Dbo::Invoices::Field::currency = "currency" ; // text(32) NOT NULL,
17const Wt::WFormModel::Field GCW::Dbo::Invoices::Field::owner_type = "owner_type" ; // integer,
18const Wt::WFormModel::Field GCW::Dbo::Invoices::Field::owner_guid = "owner_guid" ; // text(32),
20const Wt::WFormModel::Field GCW::Dbo::Invoices::Field::billing_id = "billing_id" ; // text(2048),
21const Wt::WFormModel::Field GCW::Dbo::Invoices::Field::post_txn = "post_txn" ; // text(32),
22const Wt::WFormModel::Field GCW::Dbo::Invoices::Field::post_lot = "post_lot" ; // text(32),
23const Wt::WFormModel::Field GCW::Dbo::Invoices::Field::post_acc = "post_acc" ; // text(32),
24const Wt::WFormModel::Field GCW::Dbo::Invoices::Field::billto_type = "billto_type" ; // integer,
25const Wt::WFormModel::Field GCW::Dbo::Invoices::Field::billto_guid = "billto_guid" ; // text(32),
26const Wt::WFormModel::Field GCW::Dbo::Invoices::Field::charge_amt_num = "charge_amt_num" ; // bigint,
27const Wt::WFormModel::Field GCW::Dbo::Invoices::Field::charge_amt_denom = "charge_amt_denom" ; // bigint
28
29auto
31load( 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
56auto
58byGuid( const std::string & _guid )-> GCW::Dbo::Invoices::Item::Ptr
59{
60 return GCW::Dbo::Invoices::load( _guid );
61
62} // endbyGuid( const std::string & _guid )-> GCW::Dbo::Invoices::Item::Ptr
63
64
const char * Field
const Wt::WFormModel::Field notes
const Wt::WFormModel::Field currency
const Wt::WFormModel::Field billing_id
const Wt::WFormModel::Field billto_guid
const Wt::WFormModel::Field date_posted
const Wt::WFormModel::Field active
const Wt::WFormModel::Field id
const Wt::WFormModel::Field post_lot
const Wt::WFormModel::Field billto_type
const Wt::WFormModel::Field post_acc
const Wt::WFormModel::Field owner_type
const Wt::WFormModel::Field date_opened
const Wt::WFormModel::Field charge_amt_num
const Wt::WFormModel::Field owner_guid
const Wt::WFormModel::Field post_txn
const Wt::WFormModel::Field guid
const Wt::WFormModel::Field charge_amt_denom
const Wt::WFormModel::Field terms
auto byGuid(const std::string &_guid) -> Item::Ptr
Load Invoice by Guid.
auto load(const std::string &_guid) -> Item::Ptr
Load Invoice by Guid.
const char * s_tableName
App * app()
Definition App.cpp:75