Added possibility for creating vouchers from other module.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user