Merge branch 'master' of https://git.bukova.info/repos/git/prodejna
This commit is contained in:
@@ -25,6 +25,8 @@ void ShopService::addShopItem(VoucherPtr voucher, QSharedPointer<IShopItem> item
|
||||
vItem->setVatType(item->vatType());
|
||||
|
||||
voucher->addItem(vItem);
|
||||
|
||||
updateRelatedItem(vItem.data(), count);
|
||||
}
|
||||
|
||||
void ShopService::calculate(VoucherPtr voucher)
|
||||
@@ -106,6 +108,17 @@ void ShopService::pay(VoucherPtr voucher)
|
||||
tx.commit();
|
||||
}
|
||||
|
||||
void ShopService::updateRelatedItem(VoucherItem* item, int countAdded)
|
||||
{
|
||||
IPlugin *plugin = Context::instance().plugin(item->itemPlugin());
|
||||
IService *srv = (plugin != NULL ? plugin->service<IService>() : NULL);
|
||||
ISellableService *selSrv = dynamic_cast<ISellableService*>(srv);
|
||||
|
||||
if (selSrv != NULL)
|
||||
{
|
||||
selSrv->addedToVoucher(item->refId(), countAdded);
|
||||
}
|
||||
}
|
||||
void ShopService::moveItems(QList<VoucherItemPtr> items, VoucherPtr source, VoucherPtr target)
|
||||
{
|
||||
Transaction tx;
|
||||
|
||||
Reference in New Issue
Block a user