From 97f732d3cf446f5c6bcc83560243d3f21c06911d Mon Sep 17 00:00:00 2001 From: Joel Crespo Date: Mon, 20 Nov 2023 13:06:14 -0300 Subject: [PATCH 1/4] wip --- package-lock.json | 12 +- src/i18n/en/index.js | 1 + src/i18n/es/index.js | 1 + .../InvoiceOut/InvoiceOutNegativeBases.vue | 104 ++++++++++++++++++ src/router/modules/invoiceOut.js | 13 ++- 5 files changed, 123 insertions(+), 8 deletions(-) create mode 100644 src/pages/InvoiceOut/InvoiceOutNegativeBases.vue diff --git a/package-lock.json b/package-lock.json index a3a9dcc63..c541ee00e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,14 +1,14 @@ { "name": "salix-front", - "version": "23.40.01", + "version": "23.48.01", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "salix-front", - "version": "0.0.1", + "version": "23.48.01", "dependencies": { - "@quasar/cli": "^2.2.1", + "@quasar/cli": "^2.3.0", "@quasar/extras": "^1.16.4", "axios": "^1.4.0", "chromium": "^3.0.3", @@ -946,9 +946,9 @@ } }, "node_modules/@quasar/cli": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@quasar/cli/-/cli-2.2.1.tgz", - "integrity": "sha512-PMwJ76IeeNRRBw+08hUMjhqGC6JKJ/t1zIb+IOiyR5D4rkBR26Ha/Z46OD3KfwUprq4Q8s4ieB1+d3VY8FhPKg==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@quasar/cli/-/cli-2.3.0.tgz", + "integrity": "sha512-DNFDemicj3jXe5+Ib+5w9Bwj1U3yoHQkqn0bU/qysIl/p0MmGA1yqOfUF0V4fw/5or1dfCvStIA/oZxUcC+2pQ==", "dependencies": { "@quasar/ssl-certificate": "^1.0.0", "ci-info": "^3.8.0", diff --git a/src/i18n/en/index.js b/src/i18n/en/index.js index 948332d46..f98c9a4bd 100644 --- a/src/i18n/en/index.js +++ b/src/i18n/en/index.js @@ -348,6 +348,7 @@ export default { pageTitles: { invoiceOuts: 'Invoices Out', list: 'List', + negativeBases: 'Negative Bases', createInvoiceOut: 'Create invoice out', summary: 'Summary', basicData: 'Basic Data', diff --git a/src/i18n/es/index.js b/src/i18n/es/index.js index 9b452ab22..cbe194865 100644 --- a/src/i18n/es/index.js +++ b/src/i18n/es/index.js @@ -348,6 +348,7 @@ export default { pageTitles: { invoiceOuts: 'Fact. emitidas', list: 'Listado', + negativeBases: 'Bases Negativas', createInvoiceOut: 'Crear fact. emitida', summary: 'Resumen', basicData: 'Datos básicos', diff --git a/src/pages/InvoiceOut/InvoiceOutNegativeBases.vue b/src/pages/InvoiceOut/InvoiceOutNegativeBases.vue new file mode 100644 index 000000000..781996f7b --- /dev/null +++ b/src/pages/InvoiceOut/InvoiceOutNegativeBases.vue @@ -0,0 +1,104 @@ + + + + + + + +es: + Search invoice: Buscar factura emitida + You can search by invoice reference: Puedes buscar por referencia de la factura + diff --git a/src/router/modules/invoiceOut.js b/src/router/modules/invoiceOut.js index daf5041e9..067c6be8f 100644 --- a/src/router/modules/invoiceOut.js +++ b/src/router/modules/invoiceOut.js @@ -10,7 +10,7 @@ export default { component: RouterView, redirect: { name: 'InvoiceOutMain' }, menus: { - main: ['InvoiceOutList'], + main: ['InvoiceOutList', 'InvoiceOutNegativeBases'], card: [], }, children: [ @@ -28,7 +28,16 @@ export default { icon: 'view_list', }, component: () => import('src/pages/InvoiceOut/InvoiceOutList.vue'), - } + }, + { + path: 'negative-bases', + name: 'InvoiceOutNegativeBases', + meta: { + title: 'negativeBases', + icon: 'view_list', + }, + component: () => import('src/pages/InvoiceOut/InvoiceOutNegativeBases.vue'), + }, ] }, { From 010ddd01a67a5d6e953739ff3fd7754e254c9193 Mon Sep 17 00:00:00 2001 From: Joel Crespo Date: Wed, 22 Nov 2023 07:32:20 -0300 Subject: [PATCH 2/4] fix i18n headers --- src/i18n/en/index.js | 15 ++++ src/i18n/es/index.js | 15 ++++ .../InvoiceOut/InvoiceOutNegativeBases.vue | 74 ++++++++++++++----- 3 files changed, 84 insertions(+), 20 deletions(-) diff --git a/src/i18n/en/index.js b/src/i18n/en/index.js index 7e97a377b..e3b9b9533 100644 --- a/src/i18n/en/index.js +++ b/src/i18n/en/index.js @@ -403,6 +403,21 @@ export default { criticalInvoiceError: 'Critical invoicing error, process stopped', }, }, + negativeBases: { + from: 'From', + to: 'To', + company: 'Company', + country: 'Country', + clientId: 'Client Id', + client: 'Client', + amount: 'Amount', + base: 'Base', + ticketId: 'Ticket Id', + active: 'Active', + hasToInvoice: 'Has to Invoice', + verifiedData: 'Verified Data', + comercial: 'Comercial', + }, }, worker: { pageTitles: { diff --git a/src/i18n/es/index.js b/src/i18n/es/index.js index 6bd7954da..0f1dead30 100644 --- a/src/i18n/es/index.js +++ b/src/i18n/es/index.js @@ -405,6 +405,21 @@ export default { criticalInvoiceError: 'Error crítico en la facturación, proceso detenido', }, }, + negativeBases: { + from: 'Desde', + to: 'Hasta', + company: 'Empresa', + country: 'País', + clientId: 'ID Cliente', + client: 'Cliente', + amount: 'Importe', + base: 'Base', + ticketId: 'ID Ticket', + active: 'Activo', + hasToInvoice: 'Tiene que facturar', + verifiedData: 'Datos verificados', + comercial: 'Comercial', + }, }, worker: { pageTitles: { diff --git a/src/pages/InvoiceOut/InvoiceOutNegativeBases.vue b/src/pages/InvoiceOut/InvoiceOutNegativeBases.vue index 60d5c3eca..5f63c06db 100644 --- a/src/pages/InvoiceOut/InvoiceOutNegativeBases.vue +++ b/src/pages/InvoiceOut/InvoiceOutNegativeBases.vue @@ -18,33 +18,73 @@ const payload = ref({ }); const columns = ref([ - { label: 'Company', field: 'company', name: 'company', align: 'left' }, - { label: 'Country', field: 'country', name: 'country', align: 'left' }, - { label: 'Client Id', field: 'clientId', name: 'clientId', align: 'left' }, - { label: 'Client', field: 'clientSocialName', name: 'client', align: 'left' }, { - label: 'Amount', + label: 'company', + field: 'company', + name: 'company', + align: 'left', + }, + { + label: 'country', + field: 'country', + name: 'country', + align: 'left', + }, + { + label: 'clientId', + field: 'clientId', + name: 'clientId', + align: 'left', + }, + { + label: 'client', + field: 'clientSocialName', + name: 'client', + align: 'left', + }, + { + label: 'amount', field: 'amount', name: 'amount', align: 'left', format: (value) => toCurrency(value), }, - { label: 'Base', field: 'taxableBase', name: 'base', align: 'left' }, - { label: 'Ticket Id', field: 'ticketFk', name: 'ticketId', align: 'left' }, - { label: 'Active', field: 'isActive', name: 'active', align: 'left' }, { - label: 'Has to invoice', + label: 'base', + field: 'taxableBase', + name: 'base', + align: 'left', + }, + { + label: 'ticketId', + field: 'ticketFk', + name: 'ticketId', + align: 'left', + }, + { + label: 'active', + field: 'isActive', + name: 'active', + align: 'left', + }, + { + label: 'hasToInvoice', field: 'hasToInvoice', name: 'hasToInvoice', align: 'left', }, { - label: 'Verified data', + label: 'verifiedData', field: 'isTaxDataChecked', name: 'verifiedData', align: 'left', }, - { label: 'Comercial', field: 'comercialName', name: 'comercial', align: 'left' }, + { + label: 'comercial', + field: 'comercialName', + name: 'comercial', + align: 'left', + }, ]); const wrapCsvValue = (val, formatFn, row) => { @@ -77,16 +117,10 @@ const exportTable = () => { if (status !== true) { console.log('Browser denied file download...'); - /* $q.notify({ - message: 'Browser denied file download...', - color: 'negative', - icon: 'warning', - }); */ } }; const search = async () => { - console.log(payload.value); rows.value = await invoiceOutService.getNegativeBases(payload.value); }; @@ -121,7 +155,7 @@ onMounted(async () => { type="date" mask="date" class="q-mr-sm q" - :label="t('from')" + :label="t('invoiceOut.negativeBases.from')" /> { type="date" mask="date" class="q-mr-md q" - :label="t('to')" + :label="t('invoiceOut.negativeBases.to')" /> {
- {{ col.label }} + {{ t(`invoiceOut.negativeBases.${col.label}`) }}
From 21731f304712983e19b4d3bc7cd5b6f071059502 Mon Sep 17 00:00:00 2001 From: Joel Crespo Date: Wed, 22 Nov 2023 09:37:58 -0300 Subject: [PATCH 4/4] fix boolean values in grid --- .../InvoiceOut/InvoiceOutNegativeBases.vue | 104 ++++++++++++++++-- 1 file changed, 93 insertions(+), 11 deletions(-) diff --git a/src/pages/InvoiceOut/InvoiceOutNegativeBases.vue b/src/pages/InvoiceOut/InvoiceOutNegativeBases.vue index cbed6c1f0..e4b8f4f89 100644 --- a/src/pages/InvoiceOut/InvoiceOutNegativeBases.vue +++ b/src/pages/InvoiceOut/InvoiceOutNegativeBases.vue @@ -5,7 +5,7 @@ import { useI18n } from 'vue-i18n'; import CustomerDescriptor from 'src/pages/Customer/Card/CustomerDescriptor.vue'; */ import invoiceOutService from 'src/services/InvoiceOut.service'; import { toCurrency } from 'src/filters'; -import { exportFile } from 'quasar'; +import { QBadge, QCheckbox, exportFile } from 'quasar'; const rows = ref([]); const { t } = useI18n(); @@ -31,6 +31,53 @@ const filter = ref({ comercial: null, }); +const tableColumnComponents = { + company: { + component: 'span', + props: {}, + }, + country: { + component: 'span', + props: {}, + }, + clientId: { + component: 'a', + props: { href: '#' }, + }, + client: { + component: 'span', + props: {}, + }, + amount: { + component: 'span', + props: {}, + }, + base: { + component: 'span', + props: {}, + }, + ticketId: { + component: 'span', + props: {}, + }, + active: { + component: 'span', + props: { type: 'boolean' }, + }, + hasToInvoice: { + component: 'span', + props: { type: 'boolean' }, + }, + verifiedData: { + component: 'span', + props: { type: 'boolean' }, + }, + comercial: { + component: 'a', + props: { href: '#' }, + }, +}; + const columns = ref([ { label: 'company', @@ -135,17 +182,23 @@ const exportTable = () => { }; const search = async () => { + const and = []; + Object.keys(filter.value).forEach((key) => { + if (filter.value[key]) { + and.push({ + [key]: filter.value[key], + }); + } + }); + const params = { ...payload.value, filter: { limit: 20, - where: { - ...filter.value, - }, + where: { and }, }, }; - console.log(params); - rows.value = await invoiceOutService.getNegativeBases(payload.value); + rows.value = await invoiceOutService.getNegativeBases(params); }; const refresh = () => { @@ -153,6 +206,19 @@ const refresh = () => { from: new Date('2001-01-01'), to: new Date('2001-01-31'), }; + filter.value = { + company: null, + country: null, + clientId: null, + client: null, + amount: null, + base: null, + ticketId: null, + active: null, + hasToInvoice: null, + verifiedData: null, + comercial: null, + }; search(); }; @@ -178,7 +244,7 @@ onMounted(async () => { v-model="payload.from" type="date" mask="date" - class="q-mr-sm q" + class="q-mr-md q" :label="t('invoiceOut.negativeBases.from')" /> {
- +