#ifndef SHOPSERVICE_H #define SHOPSERVICE_H #include #include #include #include "data/shop-data.h" #include "shopitem.h" #include "shop_global.h" #define ROUNDING_ITEM -9999 class PayDialog; class ShopForm; void SHOPSHARED_EXPORT payVoucherFromUI(VoucherPtr voucher, PayDialog *dialog, ShopForm *form = NULL); class SHOPSHARED_EXPORT ShopService : public Service { public: ShopService(); VoucherPtr createVoucher(); void addShopItem(VoucherPtr voucher, QSharedPointer item, int count); void calculate(VoucherPtr voucher); void calculateItem(VoucherItemPtr item); void loadItems(VoucherPtr voucher); void pay(VoucherPtr voucher); void moveItems(QList items, VoucherPtr source, VoucherPtr target); void updateRelatedItem(VoucherItem* item, int countAdded); bool processEet(VoucherPtr voucher, QString &message); void setEetOnline(bool online); bool isEetOnline(); bool isEetEnabled(); void roundVoucher(VoucherPtr voucher); VoucherItemPtr roundingItem(VoucherPtr voucher); QList savedVouchers(); QList tempVouchers(); QList paiedVouchers(); QList vouchersForEet(); QList allSellableItems(); private: QDecDouble includeVat(QDecDouble price, Enums::VatType vatType); QDecDouble excludeVat(QDecDouble price, Enums::VatType vatType); void loadSettings(); QSharedPointer m_gs; QDecDouble vatRate(Enums::VatType vatType); public: void saveVoucher(VoucherPtr entity); void updateVoucher(VoucherPtr entity); void eraseVoucher(VoucherPtr entity); }; #endif // SHOPSERVICE_H