Added recalculating receipt on item count changed. Some UI changes.

This commit is contained in:
2016-05-26 15:11:55 +02:00
parent 726da24de9
commit 9fbf216bba
12 changed files with 245 additions and 77 deletions
+7 -2
View File
@@ -29,9 +29,14 @@ void ShopService::calculate(QSharedPointer<Voucher> voucher)
QDecDouble total;
foreach (QSharedPointer<VoucherItem> item, voucher->items()) {
QDecDouble itemPrice = item->unitPrice() * item->count();
total += itemPrice;
calculateItem(item);
total += item->price();
}
voucher->setTotalPrice(total);
}
void ShopService::calculateItem(QSharedPointer<VoucherItem> item)
{
item->setPrice(item->unitPrice() * item->count());
}