diff --git a/modules/invoiceOut/front/descriptor-menu/index.html b/modules/invoiceOut/front/descriptor-menu/index.html
index 18ebdda3c3..5736948078 100644
--- a/modules/invoiceOut/front/descriptor-menu/index.html
+++ b/modules/invoiceOut/front/descriptor-menu/index.html
@@ -1,15 +1,3 @@
-
-
-
-
- {{::description}}
+ {{ ::description}}
@@ -227,13 +214,12 @@
{{::code}} - {{::description}}
diff --git a/modules/invoiceOut/front/descriptor-menu/index.js b/modules/invoiceOut/front/descriptor-menu/index.js
index c29e4b788f..8047e1c14c 100644
--- a/modules/invoiceOut/front/descriptor-menu/index.js
+++ b/modules/invoiceOut/front/descriptor-menu/index.js
@@ -8,6 +8,16 @@ class Controller extends Section {
this.vnReport = vnReport;
this.vnEmail = vnEmail;
this.checked = true;
+ this.$http.get(`CplusRectificationTypes`, {filter: {order: 'description'}})
+ .then(res => {
+ this.cplusRectificationTypes = res.data;
+ this.cplusRectificationType = res.data.filter(type => type.description == 'I – Por diferencias')[0].id;
+ });
+ this.$http.get(`SiiTypeInvoiceOuts`, {filter: {where: {code: {like: 'R%'}}}})
+ .then(res => {
+ this.siiTypeInvoiceOuts = res.data;
+ this.siiTypeInvoiceOut = res.data.filter(type => type.code == 'R4')[0].id;
+ });
}
get invoiceOut() {
@@ -149,23 +159,20 @@ class Controller extends Section {
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 => {
const clientData = response.data;
const hasToInvoiceByAddress = clientData.hasToInvoiceByAddress;
if (this.checked && hasToInvoiceByAddress) {
- if (window.confirm('El cliente destino tiene marcado facturar por consignatario, ¿desea continuar?'))
- transferInvoiceRequest();
- } else
- transferInvoiceRequest();
+ if (!window.confirm('El cliente destino tiene marcado facturar por consignatario, ¿desea continuar?'))
+ return;
+ }
+
+ 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});
+ });
});
}
}