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.

36 lines
946 B
C

#ifndef SHOPSERVICE_H
#define SHOPSERVICE_H
#include <QSharedPointer>
#include <core.h>
#include <settings/globalsettings.h>
#include "data/shop-data.h"
#include "ishopitem.h"
class ShopService : public Service<Voucher>
{
public:
ShopService();
QSharedPointer<Voucher> createVoucher();
void addShopItem(QSharedPointer<Voucher> voucher, QSharedPointer<IShopItem> item, int count);
void calculate(QSharedPointer<Voucher> voucher);
void calculateItem(QSharedPointer<VoucherItem> item);
void loadItems(QSharedPointer<Voucher> voucher);
private:
QDecDouble includeVat(QDecDouble price, Enums::VatType vatType);
void loadSettings();
QSharedPointer<GlobalSettings> m_gs;
QDecDouble vatRate(Enums::VatType vatType);
// Service interface
public:
virtual void save(QSharedPointer<Voucher> entity) override;
virtual void update(QSharedPointer<Voucher> entity) override;
};
#endif // SHOPSERVICE_H