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.

131 lines
2.0 KiB
C++

#include "voucheritem.h"
#include <define.h>
VoucherItem::VoucherItem(QObject *parent) : QObject(parent)
{
m_price = 0;
m_unitPrice = 0;
m_count = 0;
m_refId = 0;
m_vatType = Enums::NONE;
m_vatRate = 0;
m_priceWitouthVat = 0;
}
int VoucherItem::id() const
{
return m_id;
}
void VoucherItem::setId(int id)
{
m_id = id;
}
QString VoucherItem::name() const
{
return m_name;
}
void VoucherItem::setName(const QString &name)
{
m_name = name;
}
int VoucherItem::count() const
{
return m_count;
}
void VoucherItem::setCount(int count)
{
int oldCount = m_count;
m_count = count;
emit countChanged(oldCount);
}
QDecDouble VoucherItem::unitPrice() const
{
return TO_DEC(m_unitPrice);
}
void VoucherItem::setUnitPrice(QDecDouble unitPrice)
{
m_unitPrice = FROM_DEC(unitPrice);
}
QDecDouble VoucherItem::price() const
{
return TO_DEC(m_price);
}
void VoucherItem::setPrice(QDecDouble price)
{
m_price = FROM_DEC(price);
}
int VoucherItem::refId() const
{
return m_refId;
}
void VoucherItem::setRefId(int refId)
{
m_refId = refId;
}
QString VoucherItem::itemPlugin() const
{
return m_itemPlugin;
}
void VoucherItem::setItemPlugin(const QString &itemPlugin)
{
m_itemPlugin = itemPlugin;
}
Enums::VatType VoucherItem::vatType() const
{
return m_vatType;
}
void VoucherItem::setVatType(const Enums::VatType &vatType)
{
m_vatType = vatType;
}
QDecDouble VoucherItem::vatRate() const
{
return TO_DEC(m_vatRate);
}
void VoucherItem::setVatRate(QDecDouble vatRate)
{
m_vatRate = FROM_DEC(vatRate);
}
QDecDouble VoucherItem::priceWitouthVat() const
{
return TO_DEC(m_priceWitouthVat);
}
void VoucherItem::setPriceWitouthVat(QDecDouble priceWitouthVat)
{
m_priceWitouthVat = FROM_DEC(priceWitouthVat);
}
QDecDouble VoucherItem::vatAmount() const
{
return TO_DEC(m_price) - TO_DEC(m_priceWitouthVat);
}
QWeakPointer<Voucher> VoucherItem::voucher() const
{
return m_voucher;
}
void VoucherItem::setVoucher(const QWeakPointer<Voucher> &voucher)
{
m_voucher = voucher;
}