From 154c06e7f4caedb023f8a9aaf02cedce3321f931 Mon Sep 17 00:00:00 2001 From: Carlos Date: Mon, 13 Nov 2017 11:47:41 +0100 Subject: [PATCH] added hasToInvoiceByAddress checkbox to client > billingData --- client/client/src/billing-data/billing-data.html | 7 +++++-- client/client/src/billing-data/billing-data.js | 15 ++++++++++----- client/client/src/billing-data/locale/es.json | 4 +++- services/client/common/models/client.json | 4 ++++ 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/client/client/src/billing-data/billing-data.html b/client/client/src/billing-data/billing-data.html index 09590dee6a..ad4641da29 100644 --- a/client/client/src/billing-data/billing-data.html +++ b/client/client/src/billing-data/billing-data.html @@ -28,11 +28,14 @@ - + + + + @@ -72,7 +75,7 @@ + on-response="$ctrl.returnDialogEt(response)"> You changes the equivalent tax diff --git a/client/client/src/billing-data/billing-data.js b/client/client/src/billing-data/billing-data.js index a28aea9639..b06f20cd77 100644 --- a/client/client/src/billing-data/billing-data.js +++ b/client/client/src/billing-data/billing-data.js @@ -9,9 +9,11 @@ export default class Controller { this.billData = {}; this.copyData(); } + $onChanges() { this.copyData(); } + copyData() { if (this.client) { this.billData.payMethodFk = this.client.payMethodFk; @@ -23,10 +25,12 @@ export default class Controller { this.equalizationTax = this.client.equalizationTax; } } + submit() { return this.$.watcher.submit().then( () => this.checkPaymentChanges()); } + checkPaymentChanges() { let equals = true; Object.keys(this.billData).forEach( @@ -39,25 +43,26 @@ export default class Controller { ); if (equals) { - this.checkREChanges(); + this.checkEtChanges(); } else { this.$.sendMail.show(); } } + returnDialog(response) { if (response === 'ACCEPT') { this.$http.post(`/mailer/manuscript/payment-update/${this.client.id}`).then( () => { this.vnApp.showMessage(this.translate.instant('Notification sent!')); - this.checkREChanges(); + this.checkEtChanges(); } ); } else { - this.checkREChanges(); + this.checkEtChanges(); } } - checkREChanges() { + checkEtChanges() { let equals = this.equalizationTax == this.client.equalizationTax; this.equalizationTax = this.client.equalizationTax; @@ -65,7 +70,7 @@ export default class Controller { this.$.propagateEqualizationTax.show(); } - returnDialogRE(response) { + returnDialogEt(response) { if (response === 'ACCEPT') { this.$http.patch(`/client/api/Clients/${this.client.id}/addressesPropagateRe`, {isEqualizated: this.client.equalizationTax}).then( res => { diff --git a/client/client/src/billing-data/locale/es.json b/client/client/src/billing-data/locale/es.json index 5706db30e9..1d643a9348 100644 --- a/client/client/src/billing-data/locale/es.json +++ b/client/client/src/billing-data/locale/es.json @@ -8,5 +8,7 @@ "You changes the equivalent tax": "Has cambiado el recargo de equivalencia", "Do you want to spread the change to their consignees?" : "¿Deseas propagar el cambio a sus consignatarios?", "Yes, propagate": "Si, propagar", - "Equivalent tax spreaded": "Recargo de equivalencia propagado" + "Equivalent tax spreaded": "Recargo de equivalencia propagado", + "Invoice by address": "Facturar por consignatario", + "Equalization tax": "Recargo de equivalencia" } \ No newline at end of file diff --git a/services/client/common/models/client.json b/services/client/common/models/client.json index ddb59bbd75..3ef9b48f2d 100644 --- a/services/client/common/models/client.json +++ b/services/client/common/models/client.json @@ -64,6 +64,10 @@ "type": "boolean", "description": "The client has equalization tax" }, + "hasToInvoiceByAddress": { + "type": "boolean", + "description": "The client has to be invoiced by address" + }, "hasToInvoice": { "type": "boolean", "description": "Global invoicing enabled for the client"