Added sell commodity feature.

This commit is contained in:
2016-07-21 16:24:07 +02:00
parent fb6b4fe027
commit 44c74a5cfe
13 changed files with 122 additions and 19 deletions
+12
View File
@@ -17,3 +17,15 @@ QList<QSharedPointer<ShopItem> > CommodityService::shopItems()
return ret;
}
void CommodityService::addedToVoucher(int itemId, int countAdded)
{
QSharedPointer<CommodityData> commodity = loadById(itemId);
if (!commodity.isNull())
{
commodity->setCount(commodity->count() - countAdded);
}
update(commodity);
}