From 5851784e4147ad3a2410940ce47e2e10cb8c7c61 Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Tue, 24 Sep 2019 11:35:46 +0200 Subject: [PATCH 1/2] Create new order now opens on new window --- modules/ticket/front/sale/index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/ticket/front/sale/index.js b/modules/ticket/front/sale/index.js index f262a5211..c783a321e 100644 --- a/modules/ticket/front/sale/index.js +++ b/modules/ticket/front/sale/index.js @@ -401,10 +401,9 @@ class Controller { newOrderFromTicket() { this.$http.post(`/api/Orders/newFromTicket`, {ticketFk: this.ticket.id}).then(res => { - const path = $state.href('order.card.catalog', {id: res.data}); + const path = this.$state.href('order.card.catalog', {id: res.data}); window.open(path, '_blank'); - // this.$state.go('order.card.catalog', {id: res.data}); this.vnApp.showSuccess(this.$translate.instant('Order created')); }); } From 3af26900e36410aab8c1b7521b7db139b341253d Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Tue, 24 Sep 2019 11:55:36 +0200 Subject: [PATCH 2/2] watcher preventing claim creation --- modules/ticket/front/sale/index.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/ticket/front/sale/index.js b/modules/ticket/front/sale/index.js index c783a321e..31e2ee155 100644 --- a/modules/ticket/front/sale/index.js +++ b/modules/ticket/front/sale/index.js @@ -246,12 +246,11 @@ class Controller { sales: this.transfer.sales }; + this.$scope.watcher.updateOriginalData(); + const query = `/api/tickets/${this.ticket.id}/transferSales`; this.$http.post(query, params).then(res => { - this.$scope.watcher.updateOriginalData(); this.goToTicket(res.data.id); - }).finally(() => { - this.$scope.watcher.updateOriginalData(); }); } @@ -262,6 +261,10 @@ class Controller { ticketCreated: this.ticket.shipped }; const sales = this.checkedLines(); + + if (this.newInstances().length === 0) + this.$scope.watcher.updateOriginalData(); + this.$http.post(`/api/Claims/createFromSales`, {claim: claim, sales: sales}).then(res => { this.$state.go('claim.card.basicData', {id: res.data.id}); });