refactor: refs #6739 transferInvoice() refactor
gitea/salix/pipeline/pr-dev This commit looks good
Details
gitea/salix/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
parent
4e78307a8d
commit
d4f734455d
|
@ -33,7 +33,6 @@ module.exports = Self => {
|
||||||
try {
|
try {
|
||||||
await Self.makePdf(id, options);
|
await Self.makePdf(id, options);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err);
|
|
||||||
throw new UserError('Error while generating PDF', 'pdfError');
|
throw new UserError('Error while generating PDF', 'pdfError');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -148,25 +148,24 @@ class Controller extends Section {
|
||||||
invoiceCorrectionTypeFk: this.invoiceCorrectionType,
|
invoiceCorrectionTypeFk: this.invoiceCorrectionType,
|
||||||
checked: this.checked
|
checked: this.checked
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const transferInvoiceRequest = () => {
|
||||||
|
this.$http.post(`InvoiceOuts/transferInvoice`, params).then(res => {
|
||||||
|
const invoiceId = res.data;
|
||||||
|
this.vnApp.showSuccess(this.$t('Transferred invoice'));
|
||||||
|
this.$state.go('invoiceOut.card.summary', {id: invoiceId});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
this.$http.get(`Clients/${this.clientId}`).then(response => {
|
this.$http.get(`Clients/${this.clientId}`).then(response => {
|
||||||
const clientData = response.data;
|
const clientData = response.data;
|
||||||
const hasToInvoiceByAddress = clientData.hasToInvoiceByAddress;
|
const hasToInvoiceByAddress = clientData.hasToInvoiceByAddress;
|
||||||
|
|
||||||
if (this.checked && hasToInvoiceByAddress) {
|
if (this.checked && hasToInvoiceByAddress) {
|
||||||
if (window.confirm('El cliente destino tiene marcado facturar por consignatario, ¿desea continuar?')) {
|
if (window.confirm('El cliente destino tiene marcado facturar por consignatario, ¿desea continuar?'))
|
||||||
this.$http.post(`InvoiceOuts/transferInvoice`, params).then(res => {
|
transferInvoiceRequest();
|
||||||
const invoiceId = res.data;
|
} else
|
||||||
this.vnApp.showSuccess(this.$t('Transferred invoice'));
|
transferInvoiceRequest();
|
||||||
this.$state.go('invoiceOut.card.summary', {id: invoiceId});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.$http.post(`InvoiceOuts/transferInvoice`, params).then(res => {
|
|
||||||
const invoiceId = res.data;
|
|
||||||
this.vnApp.showSuccess(this.$t('Transferred invoice'));
|
|
||||||
this.$state.go('invoiceOut.card.summary', {id: invoiceId});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue