MagicSmoke  $VERSION$
orderstab.h
Go to the documentation of this file.
1 //
2 // C++ Interface: overview
3 //
4 // Description:
5 //
6 //
7 // Author: Konrad Rosenbaum <konrad@silmor.de>, (C) 2007-2011
8 //
9 // Copyright: See README/COPYING.GPL files that come with this distribution
10 //
11 //
12 
13 #ifndef MAGICSMOKE_ORDERSTAB_H
14 #define MAGICSMOKE_ORDERSTAB_H
15 
16 #include <QDialog>
17 
18 #include <MOOrder>
19 #include <MOOrderInfo>
20 
21 class QAction;
22 class QCheckBox;
23 class QComboBox;
24 class QLabel;
25 class QLineEdit;
26 class QMenu;
27 class QPushButton;
28 class QSpinBox;
29 class QStandardItemModel;
30 class QTabWidget;
31 class QTableView;
32 
33 class MSInterface;
34 class MOOrderInfo;
35 class MOCustomerInfo;
36 
38 class MOrdersTab:public QWidget
39 {
40  Q_OBJECT
41  public:
43  MOrdersTab(QString);
44 
46  QList<QMenu*>menu();
47 
48  private slots:
50  void updateOrders();
52  void orderDetails();
53 
55  void orderByTicket();
57  void orderByEvent();
59  void orderByCustomer();
61  void orderByOrder();
63  void orderSinceDate();
65  void orderByUser();
66 
68  void genReport();
69 
70  signals:
72  void selectEventIds(QList<int>&);
73 
74  private:
76  void addOrderToModel(const MOOrderInfo&,const QList<MOCustomerInfo>&);
78  void resetModel();
79 
80  enum OrderTimeStampMode{
81  OldestForAll,
82  OldestForOpen,
83  OldestForEvent,
84  OldestForCustomer,
85  OldestForSince,
86  OldestForUser,
87  };
89  qint64 oldestOrderStamp(OrderTimeStampMode mode,int age=-1);
90 
91  //the profile associated with this session
92  QString profilekey;
93  //widgets
94  QTableView*ordertable;
95  QStandardItemModel*ordermodel;
96  QComboBox*ordermode;
97  QList<MOOrderInfo>m_orders;
98 };
99 
100 class MOrdersByUserDlg:public QDialog
101 {
102  Q_OBJECT
103  public:
104  MOrdersByUserDlg(int oldestdefault, QWidget* parent, Qt::WindowFlags f = 0);
105 
106  bool mySelfOnly()const;
107  QString userName()const;
108  bool includeAll()const;
109  qint64 oldest()const;
110 
111  private:
112  QComboBox*m_uname,*m_incall;
113  QCheckBox*m_myself;
114  QSpinBox*m_days;
115 };
116 
117 class MOrdersReport:public QDialog
118 {
119  Q_OBJECT
120  public:
121  explicit MOrdersReport(const QList<MOOrderInfo>&orders,QWidget* parent = 0, Qt::WindowFlags f = 0);
122 
123  private slots:
124  void saveAs();
125  private:
126  QStandardItemModel*sum,*byord,*byday,*audit=nullptr;
127  QTableView*stable,*otable,*dtable,*atable=nullptr;
128  const QList<MOOrderInfo>orders;
129 
130  void drawAllOrders();
131  void drawDayOrders();
132  void drawOrderSums();
133  void drawAudit();
134 };
135 
136 #endif
bool includeAll() const
Definition: orderstab.cpp:494
Definition: customerinfo.h:22
Definition: orderinfo.h:24
MOrdersReport(const QList< MOOrderInfo > &orders, QWidget *parent=0, Qt::WindowFlags f=0)
Definition: orderstab.cpp:516
Main Overview Window: order list tab.
Definition: orderstab.h:38
qint64 oldest() const
Definition: orderstab.cpp:509
MOrdersTab(QString)
construct the window with QSettings-key for current profile
Definition: orderstab.cpp:63
bool mySelfOnly() const
Definition: orderstab.cpp:499
QString userName() const
Definition: orderstab.cpp:504
MOrdersByUserDlg(int oldestdefault, QWidget *parent, Qt::WindowFlags f=0)
Definition: orderstab.cpp:442
Definition: orderstab.h:117
QList< QMenu * > menu()
create menu for this tab
Definition: orderstab.cpp:128
the MagicSmoke specific interface class - enhances the basic interface by some functionality needed i...
Definition: msinterface.h:29
Definition: orderstab.h:100
void selectEventIds(QList< int > &)
needs to be connected to the event tab