MagicSmoke  $VERSION$
orderwin.h
Go to the documentation of this file.
1 //
2 // C++ Interface: orderwin
3 //
4 // Description:
5 //
6 //
7 // Author: Konrad Rosenbaum <konrad@silmor.de>, (C) 2008-2011
8 //
9 // Copyright: See README/COPYING.GPL files that come with this distribution
10 //
11 //
12 
13 #ifndef MAGICSMOKE_ORDERWIN_H
14 #define MAGICSMOKE_ORDERWIN_H
15 
16 #include <QDialog>
17 #include <QMainWindow>
18 #include <QMap>
19 
20 #include "odtrender.h"
21 
22 #include "MOOrder"
23 #include "MOShipping"
24 
25 class QAction;
26 class QLabel;
27 class QTableView;
28 class QStandardItemModel;
29 class QPrinter;
30 
32 class MOrderWindow:public QMainWindow
33 {
34  Q_OBJECT
35  public:
37  MOrderWindow(QWidget*,const MOOrder&);
38 
40  void setTestTemplateFile(QString);
41 
42  private slots:
44  void updateData();
45 
47  void itemView();
49  void printCurrentItem();
51  void printTickets();
53  void printTickets(QList<MOTicket>);
55  void printVouchers();
57  void printVouchers(QList<MOVoucher>);
58 
60  void printBill();
62  void saveBill();
63 
65  void payment();
67  void refund();
69  void payvoucher();
70 
72  void changeItem();
74  void changeItemCat();
76  void changeVoucherValid();
78  void itemReturn();
79 
81  void addComment();
83  void changeComments();
84 
86  void changeShipping();
87 
89  void changeInvAddr();
91  void changeDelAddr();
93  void changeCustData();
94 
96  void cancelOrder();
98  void shipOrder();
99 
101  void createOrder();
102 
104  void voucherAudit();
106  void ticketAudit();
108  void orderAudit();
109 
110  private:
111  MOOrder m_order;
112  bool m_changed;
113  QLabel *m_orderid,*m_orderdate,*m_sentdate,*m_state,*m_paid,*m_total,*m_comment,
114  *m_shipmeth,*m_shipprice,*m_daddr,*m_iaddr,*m_soldby,*m_custname,*m_coupon;
115  QTableView *m_table;
116  QStandardItemModel *m_model;
117  QAction*m_res2order,*m_cancel,*m_ship,*m_pay,*m_payv,*m_refund;
118  QMap<QString,int>m_loopiter;
119  QString m_testTemplate;
120 };
121 
122 class MTicketRenderer;
123 class MVoucherRenderer;
124 
126 class MOrderItemView:public QDialog
127 {
128  Q_OBJECT
129  public:
130  MOrderItemView(QWidget*,QList<MOTicket>,QList<MOVoucher>);
131  ~MOrderItemView();
132 
133  private slots:
134  void changeItem(int);
135  private:
136  QList<MOTicket> tickets;
137  QList<MOVoucher> vouchers;
138  QLabel*disp;
139  MTicketRenderer*trender;
140  MVoucherRenderer*vrender;
141 };
142 
143 class MCentSpinBox;
144 class QComboBox;
145 
147 class MShippingChange:public QDialog
148 {
149  Q_OBJECT
150  public:
152  MShippingChange(QWidget*,MOShipping,int);
153 
155  MOShipping selection()const;
157  int price()const;
158 
159  private slots:
161  void changeItem(int);
162  private:
163  QList<MOShipping> all;
164  QComboBox*opt;
165  MCentSpinBox*prc;
166 };
167 
168 #endif
MShippingChange(QWidget *, MOShipping, int)
creates the dialog
Definition: orderwin.cpp:1042
int price() const
returns the entered price in cent
Definition: orderwin.cpp:1099
MOrderWindow(QWidget *, const MOOrder &)
creates the order window
Definition: orderwin.cpp:103
Definition: centbox.h:22
~MOrderItemView()
Definition: orderwin.cpp:1013
convenience class: renders vouchers directly
Definition: ticketrender.h:77
convenience class: renders vouchers directly
Definition: ticketrender.h:69
this class represents a complete order
Definition: order.h:27
displays an order and allows the user to execute several commands on it
Definition: orderwin.h:32
helper class: allows to change the shipping option
Definition: orderwin.h:147
helper class: displays tickets and vouchers
Definition: orderwin.h:126
void setTestTemplateFile(QString)
used by the ODF editor: sets the template file to use for testing
Definition: orderwin.cpp:220
MOShipping selection() const
returns the selected shipping option, including corrected price
Definition: orderwin.cpp:1090
MOrderItemView(QWidget *, QList< MOTicket >, QList< MOVoucher >)
Definition: orderwin.cpp:991
This class encapsulates shipping types.
Definition: srcMOShipping.h:15