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

qlabcashbox.h

00001 #ifndef QLABCASHBOX_H
00002 #define QLABCASHBOX_H
00003 
00004 #include <qobject.h>
00005 #include <qvariant.h>
00006 
00007 class QlabPrinterDriver ;
00008 class QSqlCursor ;
00009 class QDateTime ;
00010 class QStringList ;
00011 class ticketLine ;
00012 class ticketInfo ;
00013 
00014 class Q_EXPORT QlabCashbox : public QObject
00015 {
00016         Q_OBJECT 
00017         
00018         Q_ENUMS( BoxStatus )
00019         Q_ENUMS( LineTypes )
00020         Q_ENUMS( MasterConversation )
00021         Q_ENUMS( PayStrategies )
00022         Q_ENUMS( PayDialog )
00023         Q_ENUMS( ActionCodes )
00024         Q_ENUMS( TElements )
00025         
00026         
00027 public :
00028         QlabCashbox( QObject * parent = 0, const char * name = 0 ) ;
00029         ~QlabCashbox() ;
00030         
00031         
00032         enum BoxStatus { Closed, Opened, Paused, Waiting, InPay } ;
00033         enum LineTypes { Header, Footer, Line, Subtotal, Total, Rebate, Tax, 
00034                          Refund, Cashin, Cheque, CreditCard, Moneo, 
00035                          PrivateCard, Delayed, Coupons, InternalCoupons } ;
00036         enum MasterConversation { TicketEnd, CountOpening, CountClose, 
00037                                   CountRedrawal, CountInsertion, Cancelation, 
00038                                   Anomality } ;
00039         enum PayStrategies { PayCash, PayCheck, PayCreditCard, PayMoneo, PayPrivateCard,
00040                              PayServiceVoucher, PayPrivateVoucher, PayTicketVoucher,
00041                              PayVoucher, PayInstituteVoucher, PayDelayed, PayCustomerAccount, PayNone } ;
00042         enum PayDialog { GetCashValue, FullPartial, GetVoucher, GetCustomer, UnknownMode } ;
00043         enum ActionCodes { Ready, Searching, Payment,
00044                    BegSubTotal, BegTotal, BegImmediateCancel,
00045                    BegTicketCancel, BegTransactionCancel } ;
00046         
00047         enum TElements { TProdid, TSerial, TProdName, TRetail, TQty, TRebate,
00048                                          TTotal, TGrandTotal, TTotalItems } ;
00049         
00050         
00051         QString prevSerial() ;
00052         
00053 public slots :
00054         void setValue( const QString & fld, const QString & value ) ;
00055         QString createTicket() ;
00056         void insertLine( LineTypes lt ) ;
00057         bool cancelLast() ;
00058         bool cancelLastTicket() ;
00059         bool getTicketList() ;
00060         bool cancelTicket( const QString & num ) ;
00061         void informMaster( MasterConversation mc ) ;
00062         bool printLine( const QString & line ) ;
00063         double getGrandTotal() const ;
00064         void setStatus( BoxStatus newStatus ) ;
00065         ActionCodes actionCode() ;
00066         void setActionCode( ActionCodes act ) ;
00067         PayStrategies payStrategy() ;
00068         PayDialog setPayStrategy( const QString & strat ) ;
00069         BoxStatus status() ;
00070         bool countDone() ;
00071         void setCountDone( bool cd ) ;
00072         QStringList getProgrammableButtons() ;
00073         bool findPart( const QString & part ) ;
00074         QVariant getElement( TElements elem ) ;
00075         void clearLine() ;
00076         
00077 private :
00078         QString getTicketIdent() ;
00079         LineTypes stringToType( const QString & tp ) ;
00080         QString typeToString( LineTypes tp ) ;
00081         PayStrategies stringToPay( const QString & pay ) ;
00082         void saveLine() ;
00083         
00084         ticketLine * currLine ;
00085         ticketInfo  * currTicket ;
00086         BoxStatus currentStatus ;
00087         bool countdone ;
00088         QSqlCursor * cashOptions ;
00089         QSqlCursor * partsTable ;
00090         QSqlCursor * ticketTable ;
00091         QSqlCursor * ticketList ;
00092         QSqlCursor * prodDef ;
00093         QlabPrinterDriver * printer ;
00094         uint subTotals ;
00095         double currentTotal ;
00096         int itemQty ;
00097         // Action Manager
00098         ActionCodes action ;
00099         PayStrategies paymode ;
00100 } ;
00101 
00102 
00103 #endif

 

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