#886 client.fiscal-data comprobación recargo

This commit is contained in:
Gerard 2018-12-11 13:16:33 +01:00
parent c0e6865523
commit 3b9df59df2
3 changed files with 14 additions and 8 deletions

View File

@ -100,7 +100,8 @@
<vn-check <vn-check
vn-one vn-one
label="Is equalizated" label="Is equalizated"
field="$ctrl.client.isEqualizated"> field="$ctrl.client.isEqualizated"
info="In order to invoice, this field is not consulted, but the consignee's ET. When modifying this field if the invoice by address option is not checked, the change will be automatically propagated to all addresses, otherwise the user will be asked if he wants to propagate it or not.">
</vn-check> </vn-check>
<vn-check <vn-check
vn-one vn-one

View File

@ -15,10 +15,9 @@ export default class Controller {
} }
copyData() { copyData() {
if (this.client) { if (this.client)
this.isEqualizated = this.client.isEqualizated; this.isEqualizated = this.client.isEqualizated;
} }
}
buyerHaspermissions() { buyerHaspermissions() {
if (!this.client) return true; if (!this.client) return true;
@ -26,8 +25,10 @@ export default class Controller {
} }
submit() { submit() {
if (this.isEqualizated != this.client.isEqualizated) if (this.isEqualizated != this.client.isEqualizated) {
this.oldHasToInvoiceByAddress = this.client.hasToInvoiceByAddress;
this.client.hasToInvoiceByAddress = false; this.client.hasToInvoiceByAddress = false;
}
return this.$.watcher.submit().then( return this.$.watcher.submit().then(
() => this.checkEtChanges()); () => this.checkEtChanges());
@ -37,18 +38,21 @@ export default class Controller {
let equals = this.isEqualizated == this.client.isEqualizated; let equals = this.isEqualizated == this.client.isEqualizated;
this.isEqualizated = this.client.isEqualizated; this.isEqualizated = this.client.isEqualizated;
if (!equals) if (!equals && !this.oldHasToInvoiceByAddress)
this.$.propagateIsEqualizated.show(); this.$.propagateIsEqualizated.show();
else if (!equals)
this.returnDialogEt('ACCEPT');
delete this.oldHasToInvoiceByAddress;
} }
returnDialogEt(response) { returnDialogEt(response) {
if (response === 'ACCEPT') { if (response === 'ACCEPT') {
this.$http.patch(`/client/api/Clients/${this.client.id}/addressesPropagateRe`, {isEqualizated: this.client.isEqualizated}).then( this.$http.patch(`/client/api/Clients/${this.client.id}/addressesPropagateRe`, {isEqualizated: this.client.isEqualizated}).then(
res => { res => {
if (res.data) { if (res.data)
this.vnApp.showMessage(this.translate.instant('Equivalent tax spreaded')); this.vnApp.showMessage(this.translate.instant('Equivalent tax spreaded'));
} }
}
); );
} }
} }

View File

@ -2,3 +2,4 @@ Yes, notify: Sí, notificar
You changed the equalization tax: Has cambiado el recargo de equivalencia You changed the equalization tax: Has cambiado el recargo de equivalencia
Do you want to spread the change?: ¿Deseas propagar el cambio a sus consignatarios? Do you want to spread the change?: ¿Deseas propagar el cambio a sus consignatarios?
Frozen: Congelado Frozen: Congelado
In order to invoice, this field is not consulted, but the consignee's ET. When modifying this field if the invoice by address option is not checked, the change will be automatically propagated to all addresses, otherwise the user will be asked if he wants to propagate it or not.: Para facturar no se consulta este campo, sino el RE de consignatario. Al modificar este campo si no esta marcada la casilla Facturar por consignatario, se propagará automáticamente el cambio a todos los consignatarios, en caso contrario preguntará al usuario si quiere o no propagar.