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 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) { 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) {