diff --git a/src/pages/InvoiceOut/InvoiceOutGlobalForm.vue b/src/pages/InvoiceOut/InvoiceOutGlobalForm.vue index 5bcb21001..e85f1f44c 100644 --- a/src/pages/InvoiceOut/InvoiceOutGlobalForm.vue +++ b/src/pages/InvoiceOut/InvoiceOutGlobalForm.vue @@ -13,7 +13,7 @@ const { t } = useI18n(); const invoiceOutGlobalStore = useInvoiceOutGlobalStore(); // invoiceOutGlobalStore state and getters -const { initialDataLoading, formInitialData, invoicing, status } = +const { initialDataLoading, formInitialData, status } = storeToRefs(invoiceOutGlobalStore); // invoiceOutGlobalStore actions @@ -151,9 +151,8 @@ onMounted(async () => { rounded /> - { dense /> = 400 && err?.response?.status < 500) { @@ -205,13 +201,16 @@ export const useInvoiceOutGlobalStore = defineStore({ return; } else { this.invoicing = false; - this.status = 'done'; notify( 'invoiceOut.globalInvoices.errors.criticalInvoiceError', 'negative' ); throw new Error('Critical invoicing error, process stopped'); } + } finally { + this.addressIndex++; + if (this.status != 'stopping') + await this.invoiceClient(formData, this.addressIndex); } }, @@ -234,7 +233,6 @@ export const useInvoiceOutGlobalStore = defineStore({ handleError(err) { this.invoicing = false; - this.status = null; throw err; }, @@ -279,7 +277,7 @@ export const useInvoiceOutGlobalStore = defineStore({ return 0; } let porcentaje = (state.addressIndex / this.getNAddresses) * 100; - return porcentaje; + return porcentaje?.toFixed(2); }, getAddressNumber(state) { return state.addressIndex;