diff --git a/src/css/app.scss b/src/css/app.scss index 525fb2a95..357c9ecdb 100644 --- a/src/css/app.scss +++ b/src/css/app.scss @@ -103,10 +103,6 @@ select:-webkit-autofill { border-radius: 8px; } -.card-width { - width: 770px; -} - .vn-card-list { width: 100%; max-width: 60em; diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index aa7e83fb3..67dadf16d 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -690,6 +690,7 @@ invoiceOut: chooseValidClient: Choose a valid client chooseValidCompany: Choose a valid company chooseValidPrinter: Choose a valid printer + chooseValidSerialType: Choose a serial type fillDates: Invoice date and the max date should be filled invoiceDateLessThanMaxDate: Invoice date can not be less than max date invoiceWithFutureDate: Exists an invoice with a future date diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index 100bf54ad..f1461cda1 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -696,6 +696,7 @@ invoiceOut: chooseValidClient: Selecciona un cliente válido chooseValidCompany: Selecciona una empresa válida chooseValidPrinter: Selecciona una impresora válida + chooseValidSerialType: Selecciona una tipo de serie válida fillDates: La fecha de la factura y la fecha máxima deben estar completas invoiceDateLessThanMaxDate: La fecha de la factura no puede ser menor que la fecha máxima invoiceWithFutureDate: Existe una factura con una fecha futura diff --git a/src/pages/InvoiceOut/Card/InvoiceOutDescriptorMenu.vue b/src/pages/InvoiceOut/Card/InvoiceOutDescriptorMenu.vue index e524faa24..4c02ccf84 100644 --- a/src/pages/InvoiceOut/Card/InvoiceOutDescriptorMenu.vue +++ b/src/pages/InvoiceOut/Card/InvoiceOutDescriptorMenu.vue @@ -222,7 +222,7 @@ const showTransferInvoiceForm = async () => { {{ t('Generate PDF invoice') }} - {{ t('Refund...') }} + {{ t('Refund') }} @@ -250,7 +250,7 @@ es: Delete invoice: Eliminar factura Book invoice: Asentar factura Generate PDF invoice: Generar PDF factura - Refund...: Abono + Refund: Abono As PDF: como PDF As CSV: como CSV Send PDF: Enviar PDF diff --git a/src/pages/InvoiceOut/InvoiceOutGlobal.vue b/src/pages/InvoiceOut/InvoiceOutGlobal.vue index eecc61bc2..5f2eb3c02 100644 --- a/src/pages/InvoiceOut/InvoiceOutGlobal.vue +++ b/src/pages/InvoiceOut/InvoiceOutGlobal.vue @@ -94,11 +94,13 @@ const selectCustomerId = (id) => { }; const statusText = computed(() => { - return status.value === 'invoicing' - ? `${t(`status.${status.value}`)} ${ - addresses.value[getAddressNumber.value]?.clientId - }` - : t(`status.${status.value}`); + const baseStatus = t(`status.${status.value}`); + const clientId = + status.value === 'invoicing' + ? addresses.value[getAddressNumber.value]?.clientId || '' + : ''; + + return clientId ? `${baseStatus} ${clientId}`.trim() : baseStatus; }); onMounted(() => (stateStore.rightDrawer = true)); diff --git a/src/pages/InvoiceOut/InvoiceOutGlobalForm.vue b/src/pages/InvoiceOut/InvoiceOutGlobalForm.vue index 23c63ee6a..362ede4be 100644 --- a/src/pages/InvoiceOut/InvoiceOutGlobalForm.vue +++ b/src/pages/InvoiceOut/InvoiceOutGlobalForm.vue @@ -20,21 +20,27 @@ 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 handleInvoiceOutSerialsFetch = (data) => { + serialTypesOptions.value = Array.from( + new Set(data.map((item) => item.type).filter((type) => type)) + ); +}; const formData = ref({}); const optionsInitialData = computed(() => { - return ( - companiesOptions.value.length > 0 && - printersOptions.value.length > 0 && - clientsOptions.value.length > 0 - ); + const optionsArrays = [ + companiesOptions.value, + printersOptions.value, + clientsOptions.value, + serialTypesOptions.value, + ]; + return optionsArrays.every((arr) => arr.length > 0); }); const getStatus = computed({ @@ -60,7 +66,11 @@ 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/pages/Ticket/Card/TicketSaleMoreActions.vue b/src/pages/Ticket/Card/TicketSaleMoreActions.vue index 9ec6b303a..f6803a9f1 100644 --- a/src/pages/Ticket/Card/TicketSaleMoreActions.vue +++ b/src/pages/Ticket/Card/TicketSaleMoreActions.vue @@ -244,7 +244,7 @@ const createRefund = async (withWarehouse) => { - {{ t('Refund...') }} + {{ t('Refund') }} @@ -279,7 +279,7 @@ es: Add claim: Crear reclamación Mark as reserved: Marcar como reservado Unmark as reserved: Desmarcar como reservado - Refund...: Abono... + Refund: Abono with warehouse: con almacén without warehouse: sin almacén Claim out of time: Reclamación fuera de plazo diff --git a/src/stores/invoiceOutGlobal.js b/src/stores/invoiceOutGlobal.js index bb9a3d376..42acac013 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, + serialType: 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, + serialType: formData.serialType, }; this.validateMakeInvoceParams(params, clientsToInvoice); @@ -152,7 +154,13 @@ export const useInvoiceOutGlobalStore = defineStore({ ); throw new Error('Invoice date in the future'); } - + if (!params.serialType) { + notify( + 'invoiceOut.globalInvoices.errors.chooseValidSerialType', + '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, + serialType: formData.serialType, }; this.status = 'invoicing'; @@ -191,12 +200,7 @@ export const useInvoiceOutGlobalStore = defineStore({ this.addressIndex++; this.isInvoicing = false; } catch (err) { - if ( - err && - err.response && - err.response.status >= 400 && - err.response.status < 500 - ) { + if (err?.response?.status >= 400 && err?.response?.status < 500) { this.invoiceClientError(address, err.response?.data?.error?.message); return; } else { @@ -243,7 +247,7 @@ export const useInvoiceOutGlobalStore = defineStore({ params, }); - if (data.data && data.data.error) throw new Error(); + if (data?.data?.error) throw new Error(); const status = exportFile('negativeBases.csv', data, { encoding: 'windows-1252',