00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef Ordered_HPP
00012 #define Ordered_HPP
00013
00014 #define RAINBOW_GTWY
00015 #include "ocTrustCommerce.h"
00016
00017 #include "read_write_base.hpp"
00018 enum enm_order_status
00019 {
00020 os_awaiting_shipment=1,
00021 os_shipped,
00022 os_recieved,
00023 os_cancelled,
00024 os_returned,
00025 os_completed
00026 };
00027
00028 class Ordered_Obj: public read_write_base
00029 {
00030 public:
00031 identifier Id;
00032 llong Product_Id;
00033 llong Customer_Id;
00034 llong Order_Status_Id;
00035 money Product_Total;
00036 money Shipping_Total;
00037 money Tax_Total;
00038 money Order_Total;
00039 time_date Order_Date;
00040 time_date Ship_Date;
00041 time_date Reconcile_Date;
00042 string Transaction_Id;
00043 llong Shipping_Co;
00044 string Tracking_Number;
00045 string Notes;
00046 llong Customer_Pmt_Svc_Id;
00047 llong Promotion;
00048
00049 Ordered_Obj():read_write_base()
00050 ,Id(0LL)
00051 ,Product_Id(0LL)
00052 ,Customer_Id(0LL)
00053 ,Order_Status_Id(1LL)
00054 ,Product_Total(0.0)
00055 ,Shipping_Total(0.0)
00056 ,Tax_Total(0.0)
00057 ,Order_Total(0.0)
00058 ,Order_Date( )
00059 ,Ship_Date( )
00060 ,Reconcile_Date( )
00061 ,Transaction_Id("")
00062 ,Shipping_Co(0LL)
00063 ,Tracking_Number("")
00064 ,Notes("")
00065 ,Customer_Pmt_Svc_Id(0LL)
00066 ,Promotion(0LL)
00067 {
00068
00069 data_name("Ordered");
00070
00071 addDXMap( new llongXfer("Id", &Id ));
00072 addDXMap( new llongXfer("Product_Id", &Product_Id ));
00073 addDXMap( new llongXfer("Customer_Id", &Customer_Id ));
00074 addDXMap( new llongXfer("Order_Status_Id", &Order_Status_Id ));
00075 addDXMap( new moneyXfer("Product_Total", &Product_Total ));
00076 addDXMap( new moneyXfer("Shipping_Total", &Shipping_Total ));
00077 addDXMap( new moneyXfer("Tax_Total", &Tax_Total ));
00078 addDXMap( new moneyXfer("Order_Total", &Order_Total ));
00079 addDXMap( new time_dateXfer("Order_Date", &Order_Date ));
00080 addDXMap( new time_dateXfer("Ship_Date", &Ship_Date ));
00081 addDXMap( new time_dateXfer("Reconcile_Date", &Reconcile_Date ));
00082 addDXMap( new stringXfer("Transaction_Id", &Transaction_Id ));
00083 addDXMap( new llongXfer("Shipping_Co", &Shipping_Co ));
00084 addDXMap( new stringXfer("Tracking_Number", &Tracking_Number ));
00085 addDXMap( new stringXfer("Notes", &Notes ));
00086 addDXMap( new llongXfer("Customer_Pmt_Svc_Id", &Customer_Pmt_Svc_Id ));
00087 addDXMap( new llongXfer("Promotion", &Promotion ));
00088 }
00089 void shipInc (double & ship )
00090 {
00091 Shipping_Total.amount() += ship;
00092 }
00093
00094
00095 string netShipping( void )
00096 {
00097 return Shipping_Total.format("%n");
00098 }
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114 };
00115 #endif
00116