From 0e11bfab0b81ba3cb524c5a506673e729122fe2b Mon Sep 17 00:00:00 2001 From: alexandre Date: Tue, 23 May 2023 07:53:25 +0200 Subject: [PATCH 1/3] refs #5581 ticketId != id --- modules/ticket/back/methods/ticket/transferSales.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ticket/back/methods/ticket/transferSales.js b/modules/ticket/back/methods/ticket/transferSales.js index 48035648c..e3137487f 100644 --- a/modules/ticket/back/methods/ticket/transferSales.js +++ b/modules/ticket/back/methods/ticket/transferSales.js @@ -78,7 +78,7 @@ module.exports = Self => { const saleIds = sales.map(sale => sale.id); const hasClaimedSales = await models.ClaimBeginning.findOne({where: {saleFk: {inq: saleIds}}}); - if (hasClaimedSales) + if (ticketId != id && hasClaimedSales) throw new UserError(`Can't transfer claimed sales`); for (const sale of sales) { From bf8d82f3c65400a5c07c8a9c48f5803170c8f44c Mon Sep 17 00:00:00 2001 From: alexandre Date: Tue, 23 May 2023 08:43:31 +0200 Subject: [PATCH 2/3] refs #5581 refresh model --- modules/ticket/front/sale/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/ticket/front/sale/index.js b/modules/ticket/front/sale/index.js index b7cdc22b9..be5f22154 100644 --- a/modules/ticket/front/sale/index.js +++ b/modules/ticket/front/sale/index.js @@ -244,7 +244,12 @@ class Controller extends Section { const query = `tickets/${this.ticket.id}/transferSales`; this.$http.post(query, params) - .then(res => this.$state.go('ticket.card.sale', {id: res.data.id})); + .then(res => { + if (res.data && res.data.id === this.ticket.id) { + this.$.transfer.hide(); + this.$.model.refresh(); + } else this.$state.go('ticket.card.sale', {id: res.data.id}); + }); } showEditPricePopover(event, sale) { From 73c2ae9fdc0e7c10fd721e4e320177b3a86809bb Mon Sep 17 00:00:00 2001 From: alexandre Date: Tue, 23 May 2023 09:17:37 +0200 Subject: [PATCH 3/3] refs #5581 changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 984f8fffd..b8d3a97c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - (Trabajadores -> Nuevo trabajador) Los clientes se crean sin 'TR' pero se añade tipo de negocio 'Trabajador' ### Fixed -- +- (Tickets -> Líneas) Se permite hacer split de líneas al mismo ticket