Added sell commodity feature.
This commit is contained in:
@@ -8,7 +8,7 @@ CommodityData::CommodityData(QObject *parent)
|
||||
m_price = 0;
|
||||
m_vat = Enums::NONE;
|
||||
}
|
||||
int CommodityData::id() const
|
||||
int CommodityData::id()
|
||||
{
|
||||
return m_id;
|
||||
}
|
||||
@@ -17,7 +17,7 @@ void CommodityData::setId(int id)
|
||||
{
|
||||
m_id = id;
|
||||
}
|
||||
QString CommodityData::name() const
|
||||
QString CommodityData::name()
|
||||
{
|
||||
return m_name;
|
||||
}
|
||||
@@ -83,6 +83,21 @@ void CommodityData::setCount(int count)
|
||||
m_count = count;
|
||||
}
|
||||
|
||||
QDecDouble CommodityData::unitPrice()
|
||||
{
|
||||
return price();
|
||||
}
|
||||
|
||||
Enums::VatType CommodityData::vatType()
|
||||
{
|
||||
return vat();
|
||||
}
|
||||
|
||||
QString CommodityData::pluginId()
|
||||
{
|
||||
return "COMMODITY";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
class CommodityData : public ShopItem
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(QString code READ code WRITE setCode)
|
||||
Q_PROPERTY(QString name READ name WRITE setName)
|
||||
Q_PROPERTY(QString shortName READ shortName WRITE setShortName)
|
||||
Q_PROPERTY(QString code READ code WRITE setCode)
|
||||
Q_PROPERTY(QSharedPointer<QObject> type READ type WRITE setType)
|
||||
Q_PROPERTY(QDecDouble price READ price WRITE setPrice)
|
||||
Q_PROPERTY(Enums::VatType vat READ vat WRITE setVat)
|
||||
@@ -25,10 +25,10 @@ class CommodityData : public ShopItem
|
||||
public:
|
||||
CommodityData(QObject *parent = 0);
|
||||
|
||||
int id() const;
|
||||
int id() override;
|
||||
void setId(int id);
|
||||
|
||||
QString name() const;
|
||||
QString name() override;
|
||||
void setName(const QString &name);
|
||||
|
||||
QString shortName() const;
|
||||
@@ -60,6 +60,12 @@ private:
|
||||
int m_price;
|
||||
Enums::VatType m_vat;
|
||||
int m_count;
|
||||
|
||||
// IShopItem interface
|
||||
public:
|
||||
QDecDouble unitPrice() override;
|
||||
Enums::VatType vatType() override;
|
||||
QString pluginId() override;
|
||||
};
|
||||
|
||||
#endif // COMMODITYDATA_H
|
||||
|
||||
Reference in New Issue
Block a user