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.

95 lines
2.3 KiB
C

#ifndef VOUCHERITEM_H
#define VOUCHERITEM_H
#include <QObject>
#include <QString>
#include <QDecDouble.hh>
#include <QSharedPointer>
#include <QDateTime>
#include <enums.h>
#include "../shop_global.h"
#include <QtCore/qglobal.h>
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> voucher() const;
void setVoucher(const QSharedPointer<Voucher> &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<Voucher> m_voucher;
};
typedef QSharedPointer<VoucherItem> VoucherItemPtr;
QX_REGISTER_HPP_SHOP(VoucherItem, QObject, 0);
#endif // VOUCHERITEM_H