From 30e501610d6522bb0aa04a0815f0dbddac628b0a Mon Sep 17 00:00:00 2001 From: alexm Date: Tue, 14 Jan 2025 09:09:26 +0100 Subject: [PATCH 1/2] fix: parallelism --- src/stores/invoiceOutGlobal.js | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/src/stores/invoiceOutGlobal.js b/src/stores/invoiceOutGlobal.js index d8649753f..d8e061f84 100644 --- a/src/stores/invoiceOutGlobal.js +++ b/src/stores/invoiceOutGlobal.js @@ -7,7 +7,14 @@ import useNotify from 'src/composables/useNotify.js'; import axios from 'axios'; const { notify } = useNotify(); - +const initInvoicing = { + invoicing: false, + nRequests: 0, + nPdfs: 0, + totalPdfs: 0, + addressIndex: 0, + errors: [], +}; export const useInvoiceOutGlobalStore = defineStore({ id: 'invoiceOutGlobal', state: () => ({ @@ -23,16 +30,11 @@ export const useInvoiceOutGlobalStore = defineStore({ addresses: [], minInvoicingDate: null, parallelism: null, - invoicing: false, - isInvoicing: false, status: null, - addressIndex: 0, - errors: [], + printer: null, - nRequests: 0, - nPdfs: 0, - totalPdfs: 0, formData: null, + ...initInvoicing, }), actions: { async init() { @@ -117,12 +119,13 @@ export const useInvoiceOutGlobalStore = defineStore({ ); throw new Error("There aren't addresses to invoice"); } - this.invoicing = false; - this.status = 'invoicing'; this.formData = formData; - this.addressIndex = 0; - this.errors = []; - await this.invoiceClient(); + this.status = 'invoicing'; + //reset data + for (const key in initInvoicing) { + this[key] = initInvoicing[key]; + } + this.invoiceClient(); } catch (err) { this.handleError(err); } @@ -184,7 +187,6 @@ export const useInvoiceOutGlobalStore = defineStore({ async invoiceClient() { if (this.invoicing || this.nRequests >= this.parallelism) return; const address = this.addresses[this.addressIndex]; - if (!address || !this.status || this.status == 'stopping') { this.status = 'stopping'; this.invoicing = false; @@ -192,6 +194,7 @@ export const useInvoiceOutGlobalStore = defineStore({ } try { this.invoicing = true; + this.nRequests++; const params = { clientId: address.clientId, addressId: address.id, @@ -215,6 +218,7 @@ export const useInvoiceOutGlobalStore = defineStore({ } } finally { this.invoicing = false; + this.nRequests--; this.addressIndex++; this.invoiceClient(); } From 64fcf3c824cbde78d67895d343892fb031cf0ef2 Mon Sep 17 00:00:00 2001 From: carlossa Date: Tue, 14 Jan 2025 11:36:46 +0100 Subject: [PATCH 2/2] fix: hotfix 7366 6943 --- src/i18n/locale/en.yml | 1 + src/i18n/locale/es.yml | 1 + src/pages/Customer/Card/CustomerBillingData.vue | 2 +- src/pages/Customer/Card/CustomerCredits.vue | 1 + src/pages/Travel/TravelList.vue | 7 +++++++ 5 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index 33829d98d..4b9accb91 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -773,6 +773,7 @@ travel: totalEntries: Total entries totalEntriesTooltip: Total entries daysOnward: Landed days onwards + awb: AWB summary: entryId: Entry Id freight: Freight diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index f0cbe3543..f91a02e6a 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -774,6 +774,7 @@ travel: totalEntries: ∑ totalEntriesTooltip: Entradas totales daysOnward: Días de llegada en adelante + awb: AWB summary: entryId: Id entrada freight: Porte diff --git a/src/pages/Customer/Card/CustomerBillingData.vue b/src/pages/Customer/Card/CustomerBillingData.vue index 48f729e29..29394ceec 100644 --- a/src/pages/Customer/Card/CustomerBillingData.vue +++ b/src/pages/Customer/Card/CustomerBillingData.vue @@ -38,7 +38,7 @@ const getBankEntities = (data, formData) => { hide-selected option-label="name" option-value="id" - v-model="data.payMethod" + v-model="data.payMethodFk" /> diff --git a/src/pages/Customer/Card/CustomerCredits.vue b/src/pages/Customer/Card/CustomerCredits.vue index 1fa7047e5..d6e4be89e 100644 --- a/src/pages/Customer/Card/CustomerCredits.vue +++ b/src/pages/Customer/Card/CustomerCredits.vue @@ -59,6 +59,7 @@ const columns = computed(() => [