FactDev  0.1
contributory.h
1 #ifndef CONTRIBUTORY_H
2 #define CONTRIBUTORY_H
3 #include "models/project.h"
4 #include "models/imodel.h"
5 #include "models/unit.h"
6 #include "models/calculable.h"
7 
8 #include "utils/double.h"
9 namespace Models {
18 class Contributory : public IModel, public Calculable
19 {
20 public:
24  Contributory();
25 
31  Contributory(int id);
32 
36  ~Contributory();
37 
42  void commit();
43 
49  void hydrat(int id);
50 
54  void remove();
55 
60  double getPrice(const bool paied=false);
61 
67  double getSumQuantity();
68 
73  QVariantHash getDataMap();
74 
80  Project* getProject() const;
81 
87  void setProject(Project *id);
88 
93  double getQuantity() const;
94 
99  void setQuantity(double value);
100 
105  QString getDescription() const;
106 
111  void setDescription(const QString &getDescription);
112 
120  bool operator ==(const Contributory &c);
121 
129  bool operator !=(const Contributory &c);
130 
135  QString getLongDescription() const;
136 
141  void setLongDescription(const QString &getLongDescription);
142 
147  Unit getUnit() const;
148 
153  void setUnit(const Unit &value);
154 
159  double getHourlyRate() const;
160 
165  void setHourlyRate(double value);
166 
167 private:
168  Project* _project;
169  double _quantity;
170  double _hourlyRate;
171  Unit _unit;
172  QString _description;
173  QString _longDescription;
174 };
175 }
176 #endif // CONTRIBUTORY_H
Project * getProject() const
Contributory::getProject Return the project linked to this Contributory.
Definition: contributory.cpp:108
void setLongDescription(const QString &getLongDescription)
setLongDescription Change the long description
Definition: contributory.cpp:151
The IModel class.
Definition: imodel.h:13
QString getDescription() const
getDescription Description of a contributory
Definition: contributory.cpp:126
The Unit class An unity for billing calculs.
Definition: unit.h:15
double getPrice(const bool paied=false)
getPrice Return the price of a contributory
Definition: contributory.cpp:59
void commit()
Contributory::commit Update or insert a contributory to the database.
Definition: contributory.cpp:32
double getQuantity() const
getNbHours Number of work hour of a contributory
Definition: contributory.cpp:117
double getHourlyRate() const
getHourlyRate Hourly rate for this contributory
Definition: contributory.cpp:164
The Project class : Project linked to a Customer.
Definition: project.h:17
Contributory()
Contributory::Contributory Contruct a Contributory.
Definition: contributory.cpp:7
double getSumQuantity()
ContributoriesList::getSumQuantity Return the sum of quantity (number of hours) of the Contributories...
Definition: contributory.cpp:77
bool operator!=(const Contributory &c)
operator != define the operator "!=" to compare two Contributory
Definition: contributory.cpp:142
void setProject(Project *id)
Contributory::setProject Modify the identify id of the Project linked to this Contributory.
Definition: contributory.cpp:113
void setUnit(const Unit &value)
setUnit Change the unit
Definition: contributory.cpp:160
void setHourlyRate(double value)
setHourlyRate Change the hourly rate for this contributory
Definition: contributory.cpp:169
The Unit enum Unity of work : hour or day.
Definition: contributory.h:18
Unit getUnit() const
getUnit Return the unit (hour or day) of contributory
Definition: contributory.cpp:155
bool operator==(const Contributory &c)
operator == define the operator "==" to compare two Contributory
Definition: contributory.cpp:136
The Calculable interface Models who are calculable.
Definition: calculable.h:9
void setQuantity(double value)
setNbHours Change nbHours
Definition: contributory.cpp:122
QString getLongDescription() const
getLongDescription A contributory has a long description : display in tex appendix ...
Definition: contributory.cpp:146
void hydrat(int id)
Contributory::hydrat Get data about the Contributory which is specified by the identify id ...
Definition: contributory.cpp:43
QVariantHash getDataMap()
getDataMap Get all data of model with a HashMap key/value
Definition: contributory.cpp:95
void setDescription(const QString &getDescription)
setDescription Change the contributory description
Definition: contributory.cpp:131
~Contributory()
Destroy an contributory object.
Definition: contributory.cpp:26