Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

qlabcasboxmethods.h

00001 #ifndef QLABCASHBOXMETHODS_H
00002 #define QLABCASHBOXMETHODS_H
00003 
00004 #include <qobject.h>
00005 #include <qmap.h>
00006 #include <qvariant.h>
00007 
00008 class QStringList ;
00009 class QDateTime ;
00010 class QlabTicketLine ;
00011 
00012 class Q_EXPORT QlabCashBoxMethods : public QObject
00013 {
00014         Q_OBJECT
00015         
00016         Q_ENUMS( BoxDisplayMode )
00017         Q_ENUMS( BoxCountMode )
00018         Q_ENUMS( PayStrategies )
00019         Q_ENUMS( PaySteps )
00020         Q_ENUMS( LineTypes )
00021         Q_ENUMS( TicketEndStrategies )
00022         Q_ENUMS( MasterMode )
00023                 
00024         Q_PROPERTY( BoxCountMode boxCountMode READ mode WRITE setBoxCountMode )
00025         Q_PROPERTY( BoxDisplayMode boxDisplayMode READ boxDisplayMode WRITE setBoxDisplayMode )
00026         Q_PROPERTY( PayStrategies payStrategy READ payStrategy WRITE setPayStrategy )
00027         Q_PROPERTY( PaySteps payStep READ payStep WRITE setPayStep )
00028         Q_PROPERTY( LineTypes lineType READ lineType WRITE setLineType )
00029         Q_PROPERTY( TicketEndStrategies ticketEndStrategy READ ticketEndStrategy
00030                                         WRITE setTicketEndStrategy )
00031         
00032 public :
00033         QlabCashBoxMethods( Qobject * parent = 0, char * name = 0 ) ;
00034         ~QlabCashBoxMethods() ;
00035         
00036         enum BoxCountMode { MoneyNone, MoneyDrop, MoneyRetrieve, MoneyCount, MoneyTheory }
00037         enum { DisplayGraphics, DisplayText, DisplayVisor } ;
00038         enum PayStrategies      { PayCash, PayCheck, PayCreditCard, PayMoneo, PayPrivateCard,
00039                                                   PayServiceVoucher, PayPrivateVoucher, PayTicketVoucher,
00040                                                   PayVoucher, PayInstituteVoucher, PayDelayed, PayCustomerAccount, 
00041                                                   PayRefund, PayNone } ;
00042         enum PaySteps { PayStepNone, PayInit, PayEvaling, PayCancelling, PayDone } ;
00043         enum PayDialog { PayGetCashValue, PayFullPartial, PayGetVoucher, PayGetCustomer, 
00044                                           PayUnknownMode, PayGetRefundValue } ;
00045         enum LineTypes { Header, Footer, Line, Subtotal, Total, GrandTotal, Rebate, Tax, 
00046                          Refund, Cashin, Cheque, CreditCard, Moneo, 
00047                          PrivateCard, Delayed, Coupons, InternalCoupons,
00048                          LineCancel, PayCancel, PayCancelTransaction, PayModeChangeTransaction, Separator } ;
00049         enum TicketEndStrategies { TicketEndAutomatic, TicketEndUserDialog, TicketEndUserValidation } ;
00050         enum MasterModes { MasterNotAvailable, MasterTicketSend, MasterTicketRecall, MasterTicketInvalidate,
00051                                            MasterTicketCancel, MasterTicketChangePayMode, 
00052                                            MasterSendCashCount, MasterRecallCashCount } ;
00053 
00054                 
00055 public slots :
00056         // Properties
00057         BoxCountMode boxCountMode() const ;
00058         void setBoxCountMode( BoxCountMode md ) ;
00059         BoxDisplayMode boxDisplayMode() const ;
00060         void setBoxDisplayMode( BoxDisplayMode md ) ;
00061         PayStrategies payStrategy() const ;
00062         void setPayStrategy( PayStrategies strat ) ;
00063         PaySteps payStep() const ;
00064         void setPayStep( PaySteps step ) ;
00065         LineTypes lineType() const ;
00066         void setLineType( LineTypes tp ) ;
00067         TicketEndStrategies ticketEndStrategy() const ;
00068         void setTicketEndStrategy( TicketEndStrategies strat ) ;
00069         
00070         // CasboxSetup Methods
00071         setFreeButtonsBindings( QObject * parent = 0 ) ;
00072         setActionButtonsBindings( QObject * parent = 0 ) ;
00073         setPayModesButtonsBindings( QObject * parent = 0 ) ;
00074         
00075         // Standard Actions
00076         void newTicket( QObject * parent = 0 ) ;
00077         void ticketEnd() ;
00078         int getCustomer( const QString & cust ) ;
00079         QString askPassword() ;
00080         void checkPassword( const QString & pass ) ;
00081         void enterSupervisor() ;
00082         void leaveSupervisor() ;
00083         bool informMaster( MasterModes md, const QVariant query = QVariant( FALSE ) ) ;
00084         
00085         // Misc Methods
00086         static QVariant currency( double val ) ;
00087         double calcTotal( LineTypes md ) ;
00088         int countItems( LineTypes md ) ;
00089         int countLines( LineTypes md ) ;
00090         
00091 private :
00092         QMap< BoxCountMode, bool > countAccesMode ;
00093         BoxCountMode currentCountMode ;
00094         BoxDisplayMode currentDisplayMode ;
00095         PayStrategies currentPayStrategy ;
00096         PaySteps currentPayStep ;
00097         LineTypes currentLineType ;
00098         
00099         int ticketID ;
00100         int userID ;
00101         QDateTime timestamp ;
00102         QString ticketStamp ;
00103         
00104         QString stdHeader ;
00105         QString addHeader ;
00106         QString stdFooter ;
00107         QString preFooter ;
00108         QString stdAdvert ;
00109         
00110         bool inSupervise ;
00111         QMap< QString, QVariant> superviseAction ;
00112         QMap< QString, bool > superviseModeRequired ;
00113         QMap< uint, QlabTicketLine > ticketView ;
00114         
00115         QMap<uint, QLabTicketLine > pushedTicket ;
00116         
00117         // Used Tables
00118         QSqlCursor * ticketsTable ;
00119         QSqlCursor * partsTable ;
00120         QSqlCursor * prodsTable ;
00121         QSqlCursor * ticketEvents ;
00122 } ;
00123 
00124 
00125 #endif // QLABCASHBOXMETHODS_H

 

L.A.B. Project © 2001-2004 LAB Project & DJ Anubis