GnuCashew ~ GnuCash Enabled Web
GCW
BillTerms.cpp
Go to the documentation of this file.
1 #line 2 "src/Dbo/BillTerms/BillTerms.cpp"
2 
3 #include "../App.h"
4 #include "../Glb/Core.h"
5 
6 #include "BillTerms.h"
7 
8 const char * GCW::Dbo::BillTerms::s_tableName = "billterms";
9 
10 const Wt::WFormModel::Field GCW::Dbo::BillTerms::Field::guid = "guid" ; // text(32) PRIMARY KEY NOT NULL,
11 const Wt::WFormModel::Field GCW::Dbo::BillTerms::Field::name = "name" ; // text(2048) NOT NULL,
12 const Wt::WFormModel::Field GCW::Dbo::BillTerms::Field::description = "description" ; // text(2048) NOT NULL,
13 const Wt::WFormModel::Field GCW::Dbo::BillTerms::Field::refcount = "refcount" ; // integer NOT NULL,
14 const Wt::WFormModel::Field GCW::Dbo::BillTerms::Field::invisible = "invisible" ; // integer NOT NULL,
15 const Wt::WFormModel::Field GCW::Dbo::BillTerms::Field::parent = "parent" ; // text(32),
16 const Wt::WFormModel::Field GCW::Dbo::BillTerms::Field::type = "type" ; // text(2048) NOT NULL,
17 const Wt::WFormModel::Field GCW::Dbo::BillTerms::Field::duedays = "duedays" ; // integer,
18 const Wt::WFormModel::Field GCW::Dbo::BillTerms::Field::discountdays = "discountdays" ; // integer,
19 const Wt::WFormModel::Field GCW::Dbo::BillTerms::Field::discount_num = "discount_num" ; // bigint,
20 const Wt::WFormModel::Field GCW::Dbo::BillTerms::Field::discount_denom = "discount_denom" ; // bigint,
21 const Wt::WFormModel::Field GCW::Dbo::BillTerms::Field::cutoff = "cutoff" ; // integer
22 
23 auto
25 load( const std::string & _guid )-> GCW::Dbo::BillTerms::Item::Ptr
26 {
28 
29  if( _guid != "" )
30  {
31 
32  Wt::Dbo::Transaction t( GCW::app()-> gnucashew_session() );
33 
34  try
35  {
36  retVal =
37  GCW::app()-> gnucashew_session().load< GCW::Dbo::BillTerms::Item >( _guid )
38  ;
39  }
40  catch( std::exception & e )
41  {
42  std::cout << __FILE__ << ":" << __LINE__ << " " << e.what() << std::endl;
43  }
44  }
45 
46  return retVal;
47 
48 } // endload( const std::string & _guid )-> GCW::Dbo::BillTerms::Item::Ptr
49 
50 auto
52 byGuid( const std::string & _guid )-> GCW::Dbo::BillTerms::Item::Ptr
53 {
54  return GCW::Dbo::BillTerms::load( _guid );
55 
56 } // endbyGuid( const std::string & _guid )-> GCW::Dbo::BillTerms::Item::Ptr
57 
58 
Wt::Dbo::ptr< Item > Ptr
Definition: BaseItem.h:39
BillTerms Class.
Definition: Item.h:80
const Wt::WFormModel::Field description
Definition: BillTerms.cpp:12
const Wt::WFormModel::Field refcount
Definition: BillTerms.cpp:13
const Wt::WFormModel::Field discount_num
Definition: BillTerms.cpp:19
const Wt::WFormModel::Field cutoff
Definition: BillTerms.cpp:21
const Wt::WFormModel::Field parent
Definition: BillTerms.cpp:15
const Wt::WFormModel::Field guid
Definition: BillTerms.cpp:10
const Wt::WFormModel::Field discount_denom
Definition: BillTerms.cpp:20
const Wt::WFormModel::Field discountdays
Definition: BillTerms.cpp:18
const Wt::WFormModel::Field invisible
Definition: BillTerms.cpp:14
const Wt::WFormModel::Field name
Definition: BillTerms.cpp:11
const Wt::WFormModel::Field type
Definition: BillTerms.cpp:16
const Wt::WFormModel::Field duedays
Definition: BillTerms.cpp:17
const char * s_tableName
Definition: BillTerms.cpp:8
auto byGuid(const std::string &_guid) -> Item::Ptr
Load by Guid.
Definition: BillTerms.cpp:52
auto load(const std::string &_guid) -> Item::Ptr
Load by Guid.
Definition: BillTerms.cpp:25
App * app()
Definition: App.cpp:67