New price
{{($ctrl.edit[0].quantity * $ctrl.edit[0].price) diff --git a/modules/ticket/front/sale/editDiscount.js b/modules/ticket/front/sale/editDiscount.js index 3df684ff3d..0694c67d52 100644 --- a/modules/ticket/front/sale/editDiscount.js +++ b/modules/ticket/front/sale/editDiscount.js @@ -38,12 +38,15 @@ class Controller { let modified = false; for (let i = 0; i < this.edit.length; i++) { if (this.newDiscount != this.edit[0].discount || this.bulk || !this.newDiscount) { - editLines.push({id: this.edit[i].id, discount: this.newDiscount, ticketFk: this.$state.params.id}); + editLines.push({id: this.edit[i].id, discount: this.newDiscount}); modified = true; } } + if (modified) { - this.$http.post(`/ticket/api/Sales/updateDiscount`, {editLines}).then(() => { + const ticketId = parseInt(this.$state.params.id); + const params = {ticketFk: ticketId, sales: editLines}; + this.$http.post(`/ticket/api/Sales/updateDiscount`, params).then(() => { this.vnApp.showSuccess(this.$translate.instant('Data saved!')); this.clear(); modified = false; @@ -53,7 +56,7 @@ class Controller { this.onHide(); } else - this.vnApp.showError(this.$translate.instant('There is no changes to save')); + this.vnApp.showError(this.$translate.instant('There are no changes to save')); } clear() { diff --git a/modules/ticket/front/sale/editDiscount.spec.js b/modules/ticket/front/sale/editDiscount.spec.js index 2fef13106c..e48fdbb630 100644 --- a/modules/ticket/front/sale/editDiscount.spec.js +++ b/modules/ticket/front/sale/editDiscount.spec.js @@ -69,7 +69,7 @@ describe('Ticket', () => { spyOn(controller.vnApp, 'showError'); controller.updateDiscount(); - expect(controller.vnApp.showError).toHaveBeenCalledWith('There is no changes to save'); + expect(controller.vnApp.showError).toHaveBeenCalledWith('There are no changes to save'); }); }); diff --git a/modules/ticket/front/sale/index.html b/modules/ticket/front/sale/index.html index 19b5414f85..b15d04090e 100644 --- a/modules/ticket/front/sale/index.html +++ b/modules/ticket/front/sale/index.html @@ -173,16 +173,17 @@
New price
{{($ctrl.sale.quantity * $ctrl.editedPrice)