From fc3a025047cd58894c2106541645f077171b146f Mon Sep 17 00:00:00 2001 From: jgallego Date: Tue, 1 Oct 2024 13:03:55 +0200 Subject: [PATCH 01/50] feat: manualInvoice with address --- src/components/CreateManualInvoiceForm.vue | 155 ------------------ src/components/VnTable/VnTable.vue | 4 +- src/components/common/VnInputDate.vue | 3 +- src/composables/useArrayData.js | 2 +- .../Card/InvoiceOutDescriptorMenu.vue | 3 - src/pages/InvoiceOut/InvoiceOutList.vue | 17 ++ src/pages/InvoiceOut/locale/en.yml | 17 +- src/pages/InvoiceOut/locale/es.yml | 19 ++- src/pages/Order/Card/OrderCreateDialog.vue | 7 +- 9 files changed, 41 insertions(+), 186 deletions(-) delete mode 100644 src/components/CreateManualInvoiceForm.vue diff --git a/src/components/CreateManualInvoiceForm.vue b/src/components/CreateManualInvoiceForm.vue deleted file mode 100644 index da006e024..000000000 --- a/src/components/CreateManualInvoiceForm.vue +++ /dev/null @@ -1,155 +0,0 @@ - - - - - - - -es: - Create manual invoice: Crear factura manual - Ticket: Ticket - Client: Cliente - Max date: Fecha límite - Serial: Serie - Area: Area - Reference: Referencia - Or: O - Invoicing in progress...: Facturación en progreso... - diff --git a/src/components/VnTable/VnTable.vue b/src/components/VnTable/VnTable.vue index 572dbf144..c9867dd07 100644 --- a/src/components/VnTable/VnTable.vue +++ b/src/components/VnTable/VnTable.vue @@ -162,9 +162,7 @@ onMounted(() => { : $props.defaultMode; stateStore.rightDrawer = quasar.screen.gt.xs; columnsVisibilitySkipped.value = [ - ...splittedColumns.value.columns - .filter((c) => c.visible == false) - .map((c) => c.name), + ...splittedColumns.value.columns.filter((c) => !c.visible).map((c) => c.name), ...['tableActions'], ]; createForm.value = $props.create; diff --git a/src/components/common/VnInputDate.vue b/src/components/common/VnInputDate.vue index 3d5afaf80..57335d293 100644 --- a/src/components/common/VnInputDate.vue +++ b/src/components/common/VnInputDate.vue @@ -1,8 +1,7 @@ diff --git a/src/components/ui/VnRow.vue b/src/components/ui/VnRow.vue index 16bcfab7d..b57489a98 100644 --- a/src/components/ui/VnRow.vue +++ b/src/components/ui/VnRow.vue @@ -1,8 +1,5 @@ - @@ -21,6 +18,9 @@ defineProps({ wrap: { type: Boolean, default: false } }); &:not(.wrap) { flex-direction: column; } + &[fixed] { + flex-direction: row; + } } } diff --git a/src/pages/InvoiceOut/InvoiceOutList.vue b/src/pages/InvoiceOut/InvoiceOutList.vue index 9fb2fc5f5..205f67cd4 100644 --- a/src/pages/InvoiceOut/InvoiceOutList.vue +++ b/src/pages/InvoiceOut/InvoiceOutList.vue @@ -15,6 +15,9 @@ import { QBtn } from 'quasar'; import axios from 'axios'; import RightMenu from 'src/components/common/RightMenu.vue'; import InvoiceOutFilter from './InvoiceOutFilter.vue'; +import VnRow from 'src/components/ui/VnRow.vue'; +import VnRadio from 'src/components/common/VnRadio.vue'; +import VnInput from 'src/components/common/VnInput.vue'; const { t } = useI18n(); const stateStore = useStateStore(); @@ -39,13 +42,9 @@ const columns = computed(() => [ align: 'center', name: 'id', label: t('invoiceOutList.tableVisibleColumns.id'), - chip: { - condition: () => true, - }, + chip: { condition: () => true }, isId: true, - columnFilter: { - name: 'search', - }, + columnFilter: { name: 'search' }, }, { align: 'left', @@ -53,14 +52,8 @@ const columns = computed(() => [ label: t('invoiceOutList.tableVisibleColumns.ref'), isTitle: true, component: 'select', - attrs: { - url: MODEL, - optionLabel: 'ref', - optionValue: 'id', - }, - columnField: { - component: null, - }, + attrs: { url: MODEL, optionLabel: 'ref', optionValue: 'id' }, + columnField: { component: null }, }, { align: 'left', @@ -68,9 +61,7 @@ const columns = computed(() => [ label: t('invoiceOutList.tableVisibleColumns.issued'), component: 'date', format: (row) => toDate(row.issued), - columnField: { - component: null, - }, + columnField: { component: null }, }, { align: 'left', @@ -78,13 +69,8 @@ const columns = computed(() => [ label: t('invoiceOutModule.customer'), cardVisible: true, component: 'select', - attrs: { - url: 'Clients', - fields: ['id', 'name'], - }, - columnField: { - component: null, - }, + attrs: { url: 'Clients', fields: ['id', 'name'] }, + columnField: { component: null }, }, { align: 'left', @@ -92,14 +78,8 @@ const columns = computed(() => [ label: t('invoiceOutModule.company'), cardVisible: true, component: 'select', - attrs: { - url: 'Companies', - optionLabel: 'code', - optionValue: 'id', - }, - columnField: { - component: null, - }, + attrs: { url: 'Companies', optionLabel: 'code', optionValue: 'id' }, + columnField: { component: null }, }, { align: 'left', @@ -113,9 +93,7 @@ const columns = computed(() => [ name: 'created', label: t('invoiceOutList.tableVisibleColumns.created'), component: 'date', - columnField: { - component: null, - }, + columnField: { component: null }, format: (row) => toDate(row.created), }, { @@ -123,9 +101,7 @@ const columns = computed(() => [ name: 'dued', label: t('invoiceOutList.tableVisibleColumns.dueDate'), component: 'date', - columnField: { - component: null, - }, + columnField: { component: null }, format: (row) => toDate(row.dued), }, { @@ -216,9 +192,7 @@ watchEffect(selectedRows); urlCreate: 'InvoiceOuts/createManualInvoice', title: t('createManualInvoice'), onDataSaved: ({ id }) => tableRef.redirect(id), - formInitialData: { - active: true, - }, + formInitialData: { active: true }, }" :right-search="false" v-model:selected="selectedRows" @@ -232,92 +206,84 @@ watchEffect(selectedRows); }" > - - en: - searchInvoice: Search issued invoice - fileDenied: Browser denied file download... - fileAllowed: Successful download of CSV file - youCanSearchByInvoiceReference: You can search by invoice reference - createInvoice: Make invoice - createManualInvoice: 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 - createManualInvoice: Crear factura manual - + From 76e35cc758f52b06a88fdfaa73a66d8e2e980719 Mon Sep 17 00:00:00 2001 From: jgallego Date: Tue, 12 Nov 2024 07:28:51 +0100 Subject: [PATCH 11/50] feat: refs #7346 address ordered --- src/pages/InvoiceOut/InvoiceOutList.vue | 172 +++++++++++++++++++----- 1 file changed, 139 insertions(+), 33 deletions(-) diff --git a/src/pages/InvoiceOut/InvoiceOutList.vue b/src/pages/InvoiceOut/InvoiceOutList.vue index 205f67cd4..728ba9442 100644 --- a/src/pages/InvoiceOut/InvoiceOutList.vue +++ b/src/pages/InvoiceOut/InvoiceOutList.vue @@ -31,17 +31,24 @@ const MODEL = 'InvoiceOuts'; const { openReport } = usePrintService(); const addressOptions = ref([]); const selectedOption = ref('ticket'); - async function fetchClientAddress(id) { - const { data } = await axios.get(`Clients/${id}/addresses`); + const { data } = await axios.get( + `Clients/${id}/addresses?filter[order]=isActive DESC` + ); addressOptions.value = data; } +const exprBuilder = (_, value) => { + return { + or: [{ code: value }, { description: { like: `%${value}%` } }], + }; +}; + const columns = computed(() => [ { align: 'center', name: 'id', - label: t('invoiceOutList.tableVisibleColumns.id'), + label: t('invoice id'), chip: { condition: () => true }, isId: true, columnFilter: { name: 'search' }, @@ -49,7 +56,7 @@ const columns = computed(() => [ { align: 'left', name: 'ref', - label: t('invoiceOutList.tableVisibleColumns.ref'), + label: t('invoiceOut.list.ref'), isTitle: true, component: 'select', attrs: { url: MODEL, optionLabel: 'ref', optionValue: 'id' }, @@ -57,8 +64,8 @@ const columns = computed(() => [ }, { align: 'left', - name: 'Issued', - label: t('invoiceOutList.tableVisibleColumns.issued'), + name: 'issued', + label: t('invoiceOut.list.issued'), component: 'date', format: (row) => toDate(row.issued), columnField: { component: null }, @@ -66,7 +73,7 @@ const columns = computed(() => [ { align: 'left', name: 'clientFk', - label: t('invoiceOutModule.customer'), + label: t('invoiceOut.list.client'), cardVisible: true, component: 'select', attrs: { url: 'Clients', fields: ['id', 'name'] }, @@ -75,7 +82,7 @@ const columns = computed(() => [ { align: 'left', name: 'companyCode', - label: t('invoiceOutModule.company'), + label: t('invoiceOut.list.company'), cardVisible: true, component: 'select', attrs: { url: 'Companies', optionLabel: 'code', optionValue: 'id' }, @@ -84,14 +91,14 @@ const columns = computed(() => [ { align: 'left', name: 'amount', - label: t('invoiceOutModule.amount'), + label: t('invoiceOut.list.amount'), cardVisible: true, format: (row) => toCurrency(row.amount), }, { align: 'left', name: 'created', - label: t('invoiceOutList.tableVisibleColumns.created'), + label: t('invoiceOut.list.created'), component: 'date', columnField: { component: null }, format: (row) => toDate(row.created), @@ -99,7 +106,7 @@ const columns = computed(() => [ { align: 'left', name: 'dued', - label: t('invoiceOutList.tableVisibleColumns.dueDate'), + label: t('invoiceOut.list.dued'), component: 'date', columnField: { component: null }, format: (row) => toDate(row.dued), @@ -109,12 +116,12 @@ const columns = computed(() => [ name: 'tableActions', actions: [ { - title: t('components.smartCard.viewSummary'), + title: t('view summary'), icon: 'preview', action: (row) => viewSummary(row.id, InvoiceOutSummary), }, { - title: t('DownloadPdf'), + title: t('download pdf'), icon: 'vn:ticket', isPrimary: true, action: (row) => openPdf(row.id), @@ -163,8 +170,8 @@ watchEffect(selectedRows); @@ -190,7 +197,7 @@ watchEffect(selectedRows); :url="`${MODEL}/filter`" :create="{ urlCreate: 'InvoiceOuts/createManualInvoice', - title: t('createManualInvoice'), + title: t('create manual invoice'), onDataSaved: ({ id }) => tableRef.redirect(id), formInitialData: { active: true }, }" @@ -240,7 +247,21 @@ watchEffect(selectedRows); option-value="id" @update:model-value="fetchClientAddress" style="flex: 1" - /> + > + + + > + +
+ > + +
@@ -287,31 +367,36 @@ watchEffect(selectedRows); - + option-filter + :expr-builder="exprBuilder" + > + + + - + @@ -332,3 +417,24 @@ watchEffect(selectedRows); flex: 0.75; } + + en: + invoice id: Invoice ID + view summary: View Summary + download pdf: Download PDF + you can search by invoice reference: You can search by invoice reference + search invoice: Search Invoice + create manual invoice: Create Manual Invoice + invoice serial: Invoice Serial + tax area: Tax Area + + es: + invoice id: ID de factura + view summary: Ver resumen + download pdf: Descargar PDF + you can search by invoice reference: Puedes buscar por referencia de la factura + search invoice: Buscar factura + create manual invoice: Crear factura manual + invoice serial: Serie de factura + tax area: Área fiscal + From 8e4931516a25008a2703c62a5685a19798d95f5b Mon Sep 17 00:00:00 2001 From: jgallego Date: Tue, 12 Nov 2024 07:42:55 +0100 Subject: [PATCH 12/50] feat: refs #7346 traducciones en cammelCase --- src/pages/InvoiceOut/InvoiceOutList.vue | 61 ++++++++++++++----------- 1 file changed, 35 insertions(+), 26 deletions(-) diff --git a/src/pages/InvoiceOut/InvoiceOutList.vue b/src/pages/InvoiceOut/InvoiceOutList.vue index 728ba9442..9c4b9753c 100644 --- a/src/pages/InvoiceOut/InvoiceOutList.vue +++ b/src/pages/InvoiceOut/InvoiceOutList.vue @@ -48,7 +48,7 @@ const columns = computed(() => [ { align: 'center', name: 'id', - label: t('invoice id'), + label: t('invoiceId'), chip: { condition: () => true }, isId: true, columnFilter: { name: 'search' }, @@ -116,12 +116,12 @@ const columns = computed(() => [ name: 'tableActions', actions: [ { - title: t('view summary'), + title: t('viewSummary'), icon: 'preview', action: (row) => viewSummary(row.id, InvoiceOutSummary), }, { - title: t('download pdf'), + title: t('downloadPdf'), icon: 'vn:ticket', isPrimary: true, action: (row) => openPdf(row.id), @@ -170,8 +170,8 @@ watchEffect(selectedRows); @@ -197,7 +197,7 @@ watchEffect(selectedRows); :url="`${MODEL}/filter`" :create="{ urlCreate: 'InvoiceOuts/createManualInvoice', - title: t('create manual invoice'), + title: t('createManualInvoice'), onDataSaved: ({ id }) => tableRef.redirect(id), formInitialData: { active: true }, }" @@ -367,7 +367,7 @@ watchEffect(selectedRows); - + + en: - invoice id: Invoice ID - view summary: View Summary - download pdf: Download PDF - you can search by invoice reference: You can search by invoice reference - search invoice: Search Invoice - create manual invoice: Create Manual Invoice - invoice serial: Invoice Serial - tax area: Tax Area + invoiceId: Invoice ID + viewSummary: View Summary + downloadPdf: Download PDF + youCanSearchByInvoiceReference: You can search by invoice reference + searchInvoice: Search Invoice + createManualInvoice: Create Manual Invoice + invoiceSerial: Invoice Serial + taxArea: Tax Area + dueDate: Due Date + reference: Reference + basicData: + inactive: Inactive es: - invoice id: ID de factura - view summary: Ver resumen - download pdf: Descargar PDF - you can search by invoice reference: Puedes buscar por referencia de la factura - search invoice: Buscar factura - create manual invoice: Crear factura manual - invoice serial: Serie de factura - tax area: Área fiscal + invoiceId: ID de factura + viewSummary: Ver resumen + downloadPdf: Descargar PDF + youCanSearchByInvoiceReference: Puedes buscar por referencia de la factura + searchInvoice: Buscar factura + createManualInvoice: Crear factura manual + invoiceSerial: Serie de factura + taxArea: Área fiscal + dueDate: Fecha de vencimiento + reference: Referencia + basicData: + inactive: Inactivo From 94c7ee3ae3afa39043c8e058695043c4a756a47f Mon Sep 17 00:00:00 2001 From: alexm Date: Thu, 14 Nov 2024 10:36:42 +0100 Subject: [PATCH 13/50] fix: arrayData store shared --- src/components/CrudModel.vue | 2 +- src/components/VnTable/VnFilter.vue | 2 +- src/components/VnTable/VnOrder.vue | 2 +- src/components/ui/VnFilterPanel.vue | 2 +- src/components/ui/VnPaginate.vue | 9 ++++++--- src/components/ui/VnSearchbar.vue | 2 +- src/composables/useArrayData.js | 2 +- src/pages/Account/AccountList.vue | 6 +++--- src/pages/Account/Role/AccountRoles.vue | 4 ++-- src/pages/Account/Role/Card/RoleCard.vue | 2 +- src/pages/Claim/ClaimFilter.vue | 2 +- src/pages/Customer/CustomerFilter.vue | 2 +- src/pages/Customer/CustomerList.vue | 6 +++--- src/pages/InvoiceIn/InvoiceInList.vue | 2 +- src/pages/InvoiceOut/InvoiceOutList.vue | 6 +++--- src/pages/Ticket/Card/TicketDescriptorMenu.vue | 1 - src/pages/Ticket/TicketFilter.vue | 2 +- src/pages/Ticket/TicketList.vue | 6 +++--- src/pages/Travel/TravelFilter.vue | 2 +- src/pages/Worker/Card/WorkerCard.vue | 1 + src/pages/Worker/WorkerList.vue | 6 +++--- src/pages/Zone/Card/ZoneSearchbar.vue | 2 +- src/pages/Zone/ZoneFilterPanel.vue | 1 - src/pages/Zone/ZoneList.vue | 4 ++-- src/stores/useArrayDataStore.js | 2 +- 25 files changed, 40 insertions(+), 38 deletions(-) diff --git a/src/components/CrudModel.vue b/src/components/CrudModel.vue index a4cb55a2c..0de5d3aa2 100644 --- a/src/components/CrudModel.vue +++ b/src/components/CrudModel.vue @@ -77,7 +77,7 @@ const isLoading = ref(false); const hasChanges = ref(false); const originalData = ref(); const vnPaginateRef = ref(); -const formData = ref(); +const formData = ref([]); const saveButtonRef = ref(null); const watchChanges = ref(); const formUrl = computed(() => $props.url); diff --git a/src/components/VnTable/VnFilter.vue b/src/components/VnTable/VnFilter.vue index 9da0b26a4..86802ee92 100644 --- a/src/components/VnTable/VnFilter.vue +++ b/src/components/VnTable/VnFilter.vue @@ -25,7 +25,7 @@ const $props = defineProps({ }, searchUrl: { type: String, - default: 'params', + default: 'table', }, }); diff --git a/src/components/VnTable/VnOrder.vue b/src/components/VnTable/VnOrder.vue index 7fdd23b78..8ffdfe2bc 100644 --- a/src/components/VnTable/VnOrder.vue +++ b/src/components/VnTable/VnOrder.vue @@ -17,7 +17,7 @@ const $props = defineProps({ }, searchUrl: { type: String, - default: 'params', + default: 'table', }, vertical: { type: Boolean, diff --git a/src/components/ui/VnFilterPanel.vue b/src/components/ui/VnFilterPanel.vue index 43d634ad9..1ed1194ea 100644 --- a/src/components/ui/VnFilterPanel.vue +++ b/src/components/ui/VnFilterPanel.vue @@ -49,7 +49,7 @@ const $props = defineProps({ }, searchUrl: { type: String, - default: 'params', + default: 'table', }, redirect: { type: Boolean, diff --git a/src/components/ui/VnPaginate.vue b/src/components/ui/VnPaginate.vue index 80c607214..f5519eb01 100644 --- a/src/components/ui/VnPaginate.vue +++ b/src/components/ui/VnPaginate.vue @@ -44,7 +44,7 @@ const props = defineProps({ }, limit: { type: Number, - default: 10, + default: 20, }, userParams: { type: Object, @@ -100,7 +100,7 @@ const arrayData = useArrayData(props.dataKey, { const store = arrayData.store; onMounted(async () => { - if (props.autoLoad) await fetch(); + if (props.autoLoad && !store.data?.length) await fetch(); mounted.value = true; }); @@ -115,7 +115,10 @@ watch( watch( () => store.data, - (data) => emit('onChange', data) + (data) => { + emit('onChange', data); + }, + { immediate: true } ); watch( diff --git a/src/components/ui/VnSearchbar.vue b/src/components/ui/VnSearchbar.vue index dc6d4751c..da2d370fe 100644 --- a/src/components/ui/VnSearchbar.vue +++ b/src/components/ui/VnSearchbar.vue @@ -45,7 +45,7 @@ const props = defineProps({ }, limit: { type: Number, - default: 10, + default: 20, }, userParams: { type: Object, diff --git a/src/composables/useArrayData.js b/src/composables/useArrayData.js index 30bcac66b..7fa494349 100644 --- a/src/composables/useArrayData.js +++ b/src/composables/useArrayData.js @@ -269,7 +269,7 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) { const pushUrl = { path: to }; if (to.endsWith('/list') || to.endsWith('/')) pushUrl.query = newUrl.query; - destroy(); + else destroy(); return router.push(pushUrl); } } diff --git a/src/pages/Account/AccountList.vue b/src/pages/Account/AccountList.vue index 72c445fa9..9e750e1cb 100644 --- a/src/pages/Account/AccountList.vue +++ b/src/pages/Account/AccountList.vue @@ -104,7 +104,7 @@ const exprBuilder = (param, value) => {