Added possibility for creating vouchers from other module.

This commit is contained in:
2017-06-07 15:54:13 +02:00
parent 35696fbfea
commit d163a92293
7 changed files with 86 additions and 36 deletions
+11
View File
@@ -375,3 +375,14 @@ void ShopService::updateVoucher(VoucherPtr entity)
tr.commit();
}
void ShopService::eraseVoucher(VoucherPtr entity)
{
Transaction tr;
odb::database *db = Context::instance().db();
db->execute(QString("DELETE FROM VoucherItem WHERE voucher = %1").arg(entity->id()).toStdString());
db->erase(entity);
tr.commit();
}