diff --git a/modules/ticket/back/methods/ticket/updateDiscount.js b/modules/ticket/back/methods/ticket/updateDiscount.js index 66b4d6f95..8777a60fc 100644 --- a/modules/ticket/back/methods/ticket/updateDiscount.js +++ b/modules/ticket/back/methods/ticket/updateDiscount.js @@ -108,8 +108,10 @@ module.exports = Self => { await Promise.all(promises); - query = `call vn.manaSpellersRequery(?)`; - await Self.rawSql(query, [salesPersonId], options); + if (salesPersonId) { + const query = `call vn.manaSpellersRequery(?)`; + await Self.rawSql(query, [salesPersonId], options); + } await tx.commit(); } catch (error) {