diff --git a/src/pages/InvoiceOut/InvoiceOutGlobalForm.vue b/src/pages/InvoiceOut/InvoiceOutGlobalForm.vue index 23c63ee6a..5fc519061 100644 --- a/src/pages/InvoiceOut/InvoiceOutGlobalForm.vue +++ b/src/pages/InvoiceOut/InvoiceOutGlobalForm.vue @@ -20,20 +20,18 @@ const { initialDataLoading, formInitialData, invoicing, status } = const { makeInvoice, setStatusValue } = invoiceOutGlobalStore; const clientsToInvoice = ref('all'); - const companiesOptions = ref([]); - const printersOptions = ref([]); - const clientsOptions = ref([]); - +const serialTypesOptions = ref([]); const formData = ref({}); const optionsInitialData = computed(() => { return ( companiesOptions.value.length > 0 && printersOptions.value.length > 0 && - clientsOptions.value.length > 0 + clientsOptions.value.length > 0 && + serialTypesOptions.value.length > 0 ); }); @@ -60,7 +58,22 @@ onMounted(async () => { /> - + { outlined rounded /> + diff --git a/src/pages/InvoiceOut/InvoiceOutList.vue b/src/pages/InvoiceOut/InvoiceOutList.vue index 822f6bb33..b08e12b3e 100644 --- a/src/pages/InvoiceOut/InvoiceOutList.vue +++ b/src/pages/InvoiceOut/InvoiceOutList.vue @@ -198,7 +198,7 @@ watchEffect(selectedRows); :url="`${MODEL}/filter`" :create="{ urlCreate: 'InvoiceOuts/createManualInvoice', - title: t('Create Manual Invoice'), + title: t('Create manual invoice'), onDataSaved: ({ id }) => tableRef.redirect(id), formInitialData: { active: true, @@ -275,10 +275,12 @@ en: fileAllowed: Successful download of CSV file youCanSearchByInvoiceReference: You can search by invoice reference createInvoice: Make invoice + Create manual invoice: Create manual invoice es: searchInvoice: Buscar factura emitida fileDenied: El navegador denegó la descarga de archivos... fileAllowed: Descarga exitosa de archivo CSV youCanSearchByInvoiceReference: Puedes buscar por referencia de la factura createInvoice: Crear factura + Create manual invoice: Crear factura manual diff --git a/src/stores/invoiceOutGlobal.js b/src/stores/invoiceOutGlobal.js index bb9a3d376..ca123d0b3 100644 --- a/src/stores/invoiceOutGlobal.js +++ b/src/stores/invoiceOutGlobal.js @@ -19,6 +19,7 @@ export const useInvoiceOutGlobalStore = defineStore({ maxShipped: null, clientId: null, printer: null, + invoiceType: null, }, addresses: [], minInvoicingDate: null, @@ -100,6 +101,7 @@ export const useInvoiceOutGlobalStore = defineStore({ maxShipped: new Date(formData.maxShipped), clientId: formData.clientId ? formData.clientId : null, companyFk: formData.companyFk, + invoiceType: formData.invoiceType, }; this.validateMakeInvoceParams(params, clientsToInvoice); @@ -152,7 +154,13 @@ export const useInvoiceOutGlobalStore = defineStore({ ); throw new Error('Invoice date in the future'); } - + if (!params.invoiceType) { + notify( + 'invoiceOut.globalInvoices.errors.chooseValidinvoiceType', + 'negative' + ); + throw new Error('Invalid Serial Type'); + } if (!params.companyFk) { notify('invoiceOut.globalInvoices.errors.chooseValidCompany', 'negative'); throw new Error('Invalid company'); @@ -180,6 +188,7 @@ export const useInvoiceOutGlobalStore = defineStore({ invoiceDate: new Date(formData.invoiceDate), maxShipped: new Date(formData.maxShipped), companyFk: formData.companyFk, + invoiceType: formData.invoiceType, }; this.status = 'invoicing';