From ae051c73f24360f5744d9ea11df7af586028463c Mon Sep 17 00:00:00 2001 From: vicent Date: Wed, 18 Jan 2023 07:26:57 +0100 Subject: [PATCH] =?UTF-8?q?feat:=20a=C3=B1adir=20clientes=20al=20principio?= =?UTF-8?q?=20del=20array=20y=20borrarlos=20si=20han=20sido=20OK?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/invoiceOut/front/global-invoicing/index.js | 6 +++++- modules/invoiceOut/front/global-invoicing/locale/es.yml | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/invoiceOut/front/global-invoicing/index.js b/modules/invoiceOut/front/global-invoicing/index.js index 2b32858e0..e8f0ae4b6 100644 --- a/modules/invoiceOut/front/global-invoicing/index.js +++ b/modules/invoiceOut/front/global-invoicing/index.js @@ -67,7 +67,7 @@ class Controller extends Section { .then(res => { this.address = res.data; - this.$.data.push({ + this.$.data.unshift({ id: clientAndAddress.clientId, address: this.address, status: 'waiting' @@ -80,6 +80,7 @@ class Controller extends Section { return this.$http.post(`InvoiceOuts/invoiceClient`, params) .then(() => { this.$.data[index].status = 'ok'; + this.$.data.shift(); }).catch(res => { this.$.data[index].status = 'error'; this.$.data[index].error = res.data.error.message; @@ -101,6 +102,9 @@ class Controller extends Section { if (!this.invoice.companyFk) throw new Error('Choose a valid company'); + if (!this.invoice.printerFk) + throw new Error('Choose a valid printer'); + this.$.invoiceButton.disabled = true; this.$.data = []; this.packageInvoicing = true; diff --git a/modules/invoiceOut/front/global-invoicing/locale/es.yml b/modules/invoiceOut/front/global-invoicing/locale/es.yml index 56c74dcd5..d87aa481d 100644 --- a/modules/invoiceOut/front/global-invoicing/locale/es.yml +++ b/modules/invoiceOut/front/global-invoicing/locale/es.yml @@ -4,6 +4,7 @@ Invoice date: Fecha de factura Invoice date and the max date should be filled: La fecha de factura y la fecha límite deben rellenarse Choose a valid clients range: Selecciona un rango válido de clientes Choose a valid company: Selecciona un empresa válida +Choose a valid printer: Selecciona una impresora válida Clients range: Rango de clientes All clients: Todos los clientes Calculating packages to invoice...: Calculando paquetes a facturar...