You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
83 lines
2.1 KiB
C++
83 lines
2.1 KiB
C++
#ifndef SREVICEITEM_H
|
|
#define SREVICEITEM_H
|
|
|
|
#include "camp-data.h"
|
|
#include <QObject>
|
|
#include <QSharedPointer>
|
|
#include <QWeakPointer>
|
|
#include <QDecDouble.hh>
|
|
#include <data/accservice.h>
|
|
|
|
#include "../camp_global.h"
|
|
|
|
class CampData;
|
|
|
|
class ServiceItem : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
QX_REGISTER_FRIEND_CLASS(ServiceItem)
|
|
Q_PROPERTY(QString name READ name WRITE setName)
|
|
Q_PROPERTY(QString code READ code WRITE setCode)
|
|
Q_PROPERTY(QString description READ description WRITE setDescription)
|
|
Q_PROPERTY(QDecDouble price READ price WRITE setPrice)
|
|
Q_PROPERTY(QDecDouble fullPrice READ fullPrice WRITE setFullPrice)
|
|
Q_PROPERTY(QDecDouble sale READ sale WRITE setSale)
|
|
Q_PROPERTY(QDecDouble totalPrice READ totalPrice WRITE setTotalPrice)
|
|
Q_PROPERTY(AccService::ServiceType type READ type WRITE setType)
|
|
Q_ENUMS(AccService::ServiceType)
|
|
|
|
public:
|
|
explicit ServiceItem(QObject *parent = nullptr);
|
|
|
|
long id() const;
|
|
void setId(long id);
|
|
|
|
QString name() const;
|
|
void setName(const QString &name);
|
|
|
|
QString code() const;
|
|
void setCode(const QString &code);
|
|
|
|
QDecDouble price() const;
|
|
void setPrice(QDecDouble price);
|
|
|
|
bool salePossible() const;
|
|
void setSalePossible(bool salePossible);
|
|
|
|
AccService::ServiceType type() const;
|
|
void setType(const AccService::ServiceType &type);
|
|
|
|
QWeakPointer<CampData> campData() const;
|
|
void setCampData(const QWeakPointer<CampData> &campData);
|
|
|
|
QString description() const;
|
|
void setDescription(const QString &description);
|
|
|
|
QDecDouble sale() const;
|
|
void setSale(QDecDouble sale);
|
|
|
|
QDecDouble totalPrice() const;
|
|
void setTotalPrice(QDecDouble totalPrice);
|
|
|
|
QDecDouble fullPrice() const;
|
|
void setFullPrice(QDecDouble fullPrice);
|
|
|
|
private:
|
|
long m_id;
|
|
QString m_name;
|
|
QString m_code;
|
|
QString m_description;
|
|
int m_price;
|
|
int m_fullPrice;
|
|
int m_totalPrice;
|
|
int m_sale;
|
|
bool m_salePossible;
|
|
AccService::ServiceType m_type;
|
|
CampDataPtr m_campData;
|
|
};
|
|
|
|
QX_REGISTER_HPP_CAMP(ServiceItem, QObject, 0)
|
|
|
|
#endif // SREVICEITEM_H
|