From 868fbbfc2e0d873962ebe43afdf4883ff0961dcb Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 16 Aug 2023 08:04:32 +0200 Subject: [PATCH 1/3] cau #103812 hotFix(supplier): beforeSave name --- modules/supplier/back/models/supplier.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/supplier/back/models/supplier.js b/modules/supplier/back/models/supplier.js index f359d0580..96042c9a0 100644 --- a/modules/supplier/back/models/supplier.js +++ b/modules/supplier/back/models/supplier.js @@ -142,12 +142,12 @@ module.exports = Self => { const changes = ctx.data || ctx.instance; const orgData = ctx.currentInstance; - const socialName = changes.name || orgData.name; + const name = changes.name || orgData.name; const hasChanges = orgData && changes; - const socialNameChanged = hasChanges - && orgData.socialName != socialName; + const nameChanged = hasChanges + && orgData.name != name; - if ((socialNameChanged) && !isAlpha(socialName)) + if ((nameChanged) && !isAlpha(name)) throw new UserError('The social name has an invalid format'); }); }; From 518d5111e49f8422605e07ffd651a88ffb44a97f Mon Sep 17 00:00:00 2001 From: alexm Date: Thu, 17 Aug 2023 08:42:04 +0200 Subject: [PATCH 2/3] refs #6127 hotFix(ticketRefund): get ticketFk front ticketService --- modules/ticket/back/methods/sale/refund.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/ticket/back/methods/sale/refund.js b/modules/ticket/back/methods/sale/refund.js index a8191610a..12f240ae2 100644 --- a/modules/ticket/back/methods/sale/refund.js +++ b/modules/ticket/back/methods/sale/refund.js @@ -67,8 +67,12 @@ module.exports = Self => { const sales = await models.Sale.find(salesFilter, myOptions); const ticketsIds = [...new Set(sales.map(sale => sale.ticketFk))]; + let [firstTicketId] = ticketsIds; + if (!firstTicketId) { + [ticketServices] = await models.TicketService.find({where: {id: {inq: servicesIds}}}, myOptions); + firstTicketId = ticketServices.ticketFk; + } const now = Date.vnNew(); - const [firstTicketId] = ticketsIds; const refundTicket = await createTicketRefund(firstTicketId, now, refundAgencyMode, refoundZoneId, withWarehouse, myOptions); From 86def6e2120dfe474ee51319811f797c582f46b1 Mon Sep 17 00:00:00 2001 From: guillermo Date: Mon, 21 Aug 2023 08:47:28 +0200 Subject: [PATCH 3/3] refs #5995 Changed query getExternalCmrs --- modules/route/back/methods/route/getExternalCmrs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/route/back/methods/route/getExternalCmrs.js b/modules/route/back/methods/route/getExternalCmrs.js index 5b08cf34a..7b3772c9e 100644 --- a/modules/route/back/methods/route/getExternalCmrs.js +++ b/modules/route/back/methods/route/getExternalCmrs.js @@ -95,7 +95,7 @@ module.exports = Self => { t.id ticketFk, co.country, t.clientFk, - sub.id hasCmrDms, + IF(sub.id, TRUE, FALSE) hasCmrDms, DATE(t.shipped) shipped FROM ticket t JOIN ticketState ts ON ts.ticketFk = t.id