#ifndef VOUCHERITEM_H #define VOUCHERITEM_H #include #include #include #include #include #include #include "../shop_global.h" #include class Voucher; class SHOPSHARED_EXPORT VoucherItem : public QObject { Q_OBJECT QX_REGISTER_FRIEND_CLASS(VoucherItem) Q_PROPERTY(QDateTime insertDate READ insertDate WRITE setInsertDate) Q_PROPERTY(QString name READ name WRITE setName) Q_PROPERTY(int count READ count WRITE setCount NOTIFY countChanged) Q_PROPERTY(QDecDouble unitPrice READ unitPrice WRITE setUnitPrice) Q_PROPERTY(Enums::VatType vatType READ vatType WRITE setVatType) Q_PROPERTY(QDecDouble vatRate READ vatRate WRITE setVatRate) Q_PROPERTY(QDecDouble vatAmount READ vatAmount) Q_PROPERTY(QDecDouble price READ price WRITE setPrice) public: explicit VoucherItem(QObject *parent = nullptr); long id() const; void setId(long id); QString name() const; void setName(const QString &name); int count() const; void setCount(int count); QDecDouble unitPrice() const; void setUnitPrice(QDecDouble unitPrice); QDecDouble price() const; void setPrice(QDecDouble price); int refId() const; void setRefId(int refId); QString itemPlugin() const; void setItemPlugin(const QString &itemPlugin); Enums::VatType vatType() const; void setVatType(const Enums::VatType &vatType); QDecDouble vatRate() const; void setVatRate(QDecDouble vatRate); QDecDouble priceWitouthVat() const; void setPriceWitouthVat(QDecDouble priceWitouthVat); QDecDouble vatAmount() const; QSharedPointer voucher() const; void setVoucher(const QSharedPointer &voucher); QDateTime insertDate() const; void setInsertDate(const QDateTime &insertDate); signals: void countChanged(int oldCount); private: long m_id; QString m_name; int m_count; int m_unitPrice; int m_vatRate; int m_priceWitouthVat; int m_price; int m_refId; QDateTime m_insertDate; QString m_itemPlugin; Enums::VatType m_vatType; QSharedPointer m_voucher; }; typedef QSharedPointer VoucherItemPtr; QX_REGISTER_HPP_SHOP(VoucherItem, QObject, 0); #endif // VOUCHERITEM_H