From 77cb0ed7a8f64fce14eea6a9bbc99a2af4bec3f8 Mon Sep 17 00:00:00 2001 From: jorgep Date: Thu, 29 Aug 2024 16:02:39 +0200 Subject: [PATCH 01/20] feat: refs #7909 add scroll --- src/components/common/VnLog.vue | 510 +++++++++++++++++--------------- 1 file changed, 274 insertions(+), 236 deletions(-) diff --git a/src/components/common/VnLog.vue b/src/components/common/VnLog.vue index 2163d54d4..640be2c0a 100644 --- a/src/components/common/VnLog.vue +++ b/src/components/common/VnLog.vue @@ -14,6 +14,7 @@ import VnJsonValue from '../common/VnJsonValue.vue'; import FetchData from '../FetchData.vue'; import VnSelect from './VnSelect.vue'; import VnUserLink from '../ui/VnUserLink.vue'; +import VnPaginate from '../ui/VnPaginate.vue'; const stateStore = useStateStore(); const validationsStore = useValidator(); @@ -68,7 +69,6 @@ const filter = { ], }; -const workers = ref(); const actions = ref(); const changeInput = ref(); const searchInput = ref(); @@ -235,9 +235,9 @@ async function openPointRecord(id, modelLog) { const locale = validations[modelLog.model]?.locale || {}; pointRecord.value = parseProps(propNames, locale, data); } -async function setLogTree() { +async function setLogTree(data) { filter.where = { and: [{ originFk: route.params.id }] }; - const { data } = await getLogs(filter); + // const { data } = await getLogs(filter); logTree.value = getLogTree(data); } @@ -377,8 +377,6 @@ async function clearFilter() { await applyFilter(); } -setLogTree(); - onUnmounted(() => { stateStore.rightDrawer = false; }); @@ -391,16 +389,6 @@ watch( ); + @@ -691,17 +730,16 @@ watch( - - - - + From c7bb0333bd055a01dd8d39a7239c0485979cc074 Mon Sep 17 00:00:00 2001 From: jorgep Date: Thu, 29 Aug 2024 16:28:59 +0200 Subject: [PATCH 02/20] refactor: refs #7909 improve applyFilter --- src/components/common/VnLog.vue | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/components/common/VnLog.vue b/src/components/common/VnLog.vue index 640be2c0a..1d5b2c182 100644 --- a/src/components/common/VnLog.vue +++ b/src/components/common/VnLog.vue @@ -69,6 +69,7 @@ const filter = { ], }; +const paginate = ref(); const actions = ref(); const changeInput = ref(); const searchInput = ref(); @@ -237,7 +238,6 @@ async function openPointRecord(id, modelLog) { } async function setLogTree(data) { filter.where = { and: [{ originFk: route.params.id }] }; - // const { data } = await getLogs(filter); logTree.value = getLogTree(data); } @@ -266,15 +266,7 @@ async function applyFilter() { filter.where.and.push(selectedFilters.value); } - const { data } = await getLogs(filter); - - logTree.value = getLogTree(data); -} - -async function getLogs(filter) { - return axios.get(props.url ?? `${props.model}Logs`, { - params: { filter: JSON.stringify(filter) }, - }); + paginate.value.fetch(filter); } function setDate(type) { @@ -407,6 +399,7 @@ watch( auto-load /> Date: Mon, 2 Sep 2024 08:43:32 +0200 Subject: [PATCH 03/20] fix: refs #6900 fine tunning wip --- src/composables/getTotal.js | 10 ++++ src/i18n/locale/en.yml | 51 +---------------- src/i18n/locale/es.yml | 49 +--------------- .../InvoiceIn/Card/InvoiceInBasicData.vue | 8 +-- .../InvoiceIn/Card/InvoiceInDescriptor.vue | 5 +- src/pages/InvoiceIn/Card/InvoiceInDueDay.vue | 17 ++++-- .../InvoiceIn/Card/InvoiceInIntrastat.vue | 6 +- src/pages/InvoiceIn/Card/InvoiceInSummary.vue | 57 ++++++++++--------- src/pages/InvoiceIn/Card/InvoiceInVat.vue | 31 +++++++--- src/pages/InvoiceIn/InvoiceInFilter.vue | 48 +++++----------- src/pages/InvoiceIn/InvoiceInList.vue | 10 +--- src/pages/InvoiceIn/locale/en.yml | 49 ++++++++++++++++ src/pages/InvoiceIn/locale/es.yml | 47 +++++++++++++++ 13 files changed, 195 insertions(+), 193 deletions(-) create mode 100644 src/composables/getTotal.js create mode 100644 src/pages/InvoiceIn/locale/en.yml create mode 100644 src/pages/InvoiceIn/locale/es.yml diff --git a/src/composables/getTotal.js b/src/composables/getTotal.js new file mode 100644 index 000000000..41c4330c4 --- /dev/null +++ b/src/composables/getTotal.js @@ -0,0 +1,10 @@ +import { toCurrency } from 'src/filters'; + +export function getTotal(rows, key, opts = {}) { + const { currency, cb } = opts; + const total = rows.reduce((acc, row) => acc + +(cb ? cb(row) : row[key] || 0), 0); + + return currency + ? toCurrency(total, currency == 'default' ? undefined : currency) + : total; +} diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index fae22b06d..0c416a046 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -252,6 +252,7 @@ globals: ldap: LDAP samba: Samba serial: Serial + supplier: Supplier created: Created worker: Worker now: Now @@ -738,56 +739,6 @@ parking: searchBar: info: You can search by parking code label: Search parking... -invoiceIn: - list: - ref: Reference - supplier: Supplier - supplierRef: Supplier ref. - serialNumber: Serial number - serial: Serial - file: File - issued: Issued - isBooked: Is booked - awb: AWB - amount: Amount - card: - issued: Issued - amount: Amount - client: Client - company: Company - customerCard: Customer card - ticketList: Ticket List - vat: Vat - dueDay: Due day - intrastat: Intrastat - summary: - supplier: Supplier - supplierRef: Supplier ref. - currency: Currency - docNumber: Doc number - issued: Expedition date - operated: Operation date - bookEntried: Entry date - bookedDate: Booked date - sage: Sage withholding - vat: Undeductible VAT - company: Company - booked: Booked - expense: Expense - taxableBase: Taxable base - rate: Rate - sageVat: Sage vat - sageTransaction: Sage transaction - dueDay: Date - bank: Bank - amount: Amount - foreignValue: Foreign value - dueTotal: Due day - noMatch: Do not match - code: Code - net: Net - stems: Stems - country: Country order: field: salesPersonFk: Sales Person diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index e1946515c..946ee5e54 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -254,6 +254,7 @@ globals: ldap: LDAP samba: Samba serial: Facturas por serie + supplier: Proveedor created: Fecha creación worker: Trabajador now: Ahora @@ -782,54 +783,6 @@ parking: searchBar: info: Puedes buscar por código de parking label: Buscar parking... -invoiceIn: - list: - ref: Referencia - supplier: Proveedor - supplierRef: Ref. proveedor - serialNumber: Num. serie - shortIssued: F. emisión - serial: Serie - file: Fichero - issued: Fecha emisión - isBooked: Conciliada - awb: AWB - amount: Importe - card: - issued: Fecha emisión - amount: Importe - client: Cliente - company: Empresa - customerCard: Ficha del cliente - ticketList: Listado de tickets - vat: Iva - dueDay: Fecha de vencimiento - summary: - supplier: Proveedor - supplierRef: Ref. proveedor - currency: Divisa - docNumber: Número documento - issued: Fecha de expedición - operated: Fecha operación - bookEntried: Fecha asiento - bookedDate: Fecha contable - sage: Retención sage - vat: Iva no deducible - company: Empresa - booked: Contabilizada - expense: Gasto - taxableBase: Base imp. - rate: Tasa - sageTransaction: Sage transación - dueDay: Fecha - bank: Caja - amount: Importe - foreignValue: Divisa - dueTotal: Vencimiento - code: Código - net: Neto - stems: Tallos - country: País department: pageTitles: basicData: Basic data diff --git a/src/pages/InvoiceIn/Card/InvoiceInBasicData.vue b/src/pages/InvoiceIn/Card/InvoiceInBasicData.vue index ede9af825..045517a3f 100644 --- a/src/pages/InvoiceIn/Card/InvoiceInBasicData.vue +++ b/src/pages/InvoiceIn/Card/InvoiceInBasicData.vue @@ -223,6 +223,10 @@ async function onSubmit() { autofocus /> + + + + - - - - {