MagicSmoke  $VERSION$
billrender.h
Go to the documentation of this file.
1 //
2 // C++ Interface: order bill renderer
3 //
4 // Description:
5 //
6 //
7 // Author: Konrad Rosenbaum <konrad@silmor.de>, (C) 2016
8 //
9 // Copyright: See README/COPYING.GPL files that come with this distribution
10 //
11 //
12 
13 #ifndef MAGICSMOKE_BILLRENDER_H
14 #define MAGICSMOKE_BILLRENDER_H
15 
16 #include <QMap>
17 
18 #include "odtrender.h"
19 
20 #include "MOOrder"
21 #include "MOShipping"
22 
25 {
26  public:
28  MBillRenderer(const MOOrder&,const MTemplate&);
29 
30  protected:
32  QVariant getVariable(QString)override;
34  int getLoopIterations(QString loopname)override;
36  void setLoopIteration(QString loopname,int iteration)override;
38  QVariant getLoopVariable(QString,int,QString);
39 
40  private:
41  MOOrder m_order;
42  QMap<QString,int>m_loopiter;
43 
44  //printing buffer
45  struct TickInfo{
46  TickInfo(const MOTicket&t):proto(t){amount=1;}
47  TickInfo(const TickInfo&t):proto(t.proto){amount=t.amount;}
48  TickInfo(){amount=0;}
49  MOTicket proto;
50  int amount;
51  };
52  struct PrintBuffer{
53  QList<MOTicket> tickets;
54  QList<MOVoucher> vouchers;
55  QList<TickInfo> tickinfo;
56  }printBuffer;
57 };
58 
59 #endif
#define MAGICSMOKE_COMMON_EXPORT
Definition: commonexport.h:7
this class wraps a single template
Definition: templates.h:25
virtual int getLoopIterations(QString loopname)=0
implement this to return the amount of iterations for a defined loop; should return 0 if the loop doe...
abstract base class for all ODT rendering classes
Definition: odtrender.h:29
Definition: ticket.h:25
virtual QVariant getVariable(QString varname)=0
implement this to return the value of a variable during rendering; should return empty string if the ...
virtual void setLoopIteration(QString loopname, int interation)=0
implement this to populate the variables used in a specific iteration of the loop ...
displays an order and allows the user to execute several commands on it
Definition: billrender.h:24
this class represents a complete order
Definition: order.h:27