Fixed loading of saved vouchers.

master
Josef Rokos 2 years ago
parent de2bab90de
commit 12dd6ddba0

@ -156,7 +156,7 @@ public:
pSession = ptrSession.data();
}
*pSession += qx::dao::delete_by_id(entity);
*pSession += qx::dao::delete_by_id(entity, pSession->database());
if (!pSession->isValid()) {
qDebug() << pSession->firstError().text();

@ -60,10 +60,6 @@ void ShopService::calculate(VoucherPtr voucher)
loadSettings();
if (voucher->items().isEmpty()) {
load(voucher);
}
foreach (QSharedPointer<VoucherItem> item, voucher->items()) {
if (item->refId() == ROUNDING_ITEM)
@ -384,6 +380,9 @@ void ShopService::moveItems(QList<VoucherItemPtr> items, VoucherPtr source, Vouc
it->setVoucher(target);
}
calculate(target);
update(target, &session);
if (source->items().isEmpty())
{
erase(source, &session);

Loading…
Cancel
Save