diff --git a/e2e/paths/08-route-module/03_tickets.spec.js b/e2e/paths/08-route-module/03_tickets.spec.js index 0ae3fe0ad..18d54ff4a 100644 --- a/e2e/paths/08-route-module/03_tickets.spec.js +++ b/e2e/paths/08-route-module/03_tickets.spec.js @@ -108,7 +108,7 @@ describe('Route basic Data path', () => { .waitToClick(selectors.routeTickets.confirmButton) .waitForLastSnackbar(); - expect(result).toEqual('Ticket deleted from route'); + expect(result).toEqual('Ticket removed from route'); }); it('should now count how many tickets are in route to find one less', async() => { diff --git a/modules/route/front/tickets/index.html b/modules/route/front/tickets/index.html index a8d8655e7..af266d35a 100644 --- a/modules/route/front/tickets/index.html +++ b/modules/route/front/tickets/index.html @@ -110,5 +110,5 @@ + on-response="$ctrl.removeTicketFromRoute(response)"> \ No newline at end of file diff --git a/modules/route/front/tickets/index.js b/modules/route/front/tickets/index.js index 2b3aa26f1..ce12d88ac 100644 --- a/modules/route/front/tickets/index.js +++ b/modules/route/front/tickets/index.js @@ -69,17 +69,25 @@ class Controller { this.$.confirm.show(); } - deleteFromRoute(response) { + removeTicketFromRoute(response) { if (response === 'ACCEPT') { let params = {routeFk: null}; let query = `/api/Tickets/${this.selectedTicket}/`; this.$http.patch(query, params).then(() => { - this.vnApp.showSuccess(this.$translate.instant('Ticket deleted from route')); - this.$.model.refresh(); + this.vnApp.showSuccess(this.$translate.instant('Ticket removed from route')); + this.updateVolume(); }); } } + updateVolume() { + let url = `/route/api/Routes/${this.$stateParams.id}/updateVolume`; + this.$http.post(url).then(() => { + this.card.reload(); + this.$.model.refresh(); + }); + } + guessPriority() { let query = `/api/Routes/${this.$stateParams.id}/guessPriority/`; this.$http.get(query).then(() => { @@ -107,5 +115,8 @@ Controller.$inject = ['$stateParams', '$scope', '$translate', '$http', 'vnApp']; ngModule.component('vnRouteTickets', { template: require('./index.html'), + require: { + card: '^vnRouteCard' + }, controller: Controller }); diff --git a/modules/route/front/tickets/locale/es.yml b/modules/route/front/tickets/locale/es.yml index e339f6b20..d668e0a8a 100644 --- a/modules/route/front/tickets/locale/es.yml +++ b/modules/route/front/tickets/locale/es.yml @@ -1,6 +1,6 @@ Remove ticket: Borrar ticket Open buscaman: Abrir buscaman -Ticket deleted from route: Ticket borrado de la ruta +Ticket removed from route: Ticket borrado de la ruta Order changed: Orden cambiado Delete ticket from route?: ¿Borrar ticket de la ruta? Sort routes: Ordenar rutas \ No newline at end of file