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.

96 lines
1.5 KiB
C++

#include "voucher.h"
#include <define.h>
Voucher::Voucher(QObject *parent) : QObject(parent)
{
}
QString Voucher::name() const
{
return m_name;
}
void Voucher::setName(const QString &name)
{
m_name = name;
}
QString Voucher::description() const
{
return m_description;
}
void Voucher::setDescription(const QString &description)
{
m_description = description;
}
QSharedPointer<QObject> Voucher::contact() const
{
return m_contact;
}
void Voucher::setContact(const QSharedPointer<QObject> &contact)
{
if (qobject_cast<AddressbookData*>(contact.data()) != NULL)
{
m_contact = qSharedPointerDynamicCast<AddressbookData, QObject>(contact);
}
}
Voucher::VoucherStatus Voucher::status() const
{
return m_status;
}
void Voucher::setStatus(const Voucher::VoucherStatus &status)
{
m_status = status;
}
QDecDouble Voucher::totalPrice() const
{
return TO_DEC(m_totalPrice);
}
void Voucher::setTotalPrice(QDecDouble totalPrice)
{
m_totalPrice = FROM_DEC(totalPrice);
}
QList<QSharedPointer<VoucherItem> > Voucher::items() const
{
return m_items;
}
void Voucher::setItems(const QList<QSharedPointer<VoucherItem> > &items)
{
m_items = items;
}
void Voucher::addItem(QSharedPointer<VoucherItem> item)
{
m_items.append(item);
}
void Voucher::removeItem(QSharedPointer<VoucherItem> item)
{
m_items.removeOne(item);
}
void Voucher::clearItems()
{
m_items.clear();
}
int Voucher::id() const
{
return m_id;
}
void Voucher::setId(int id)
{
m_id = id;
}