From ef9f8b8705e39d936213b9602e534089378d01d5 Mon Sep 17 00:00:00 2001 From: jorgep Date: Mon, 27 May 2024 13:36:16 +0200 Subject: [PATCH] refactor: refs #6942 store key & actions --- .../InvoiceIn/Card/InvoiceInBasicData.vue | 5 ++-- .../InvoiceIn/Card/InvoiceInDescriptor.vue | 29 +++++++++---------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/src/pages/InvoiceIn/Card/InvoiceInBasicData.vue b/src/pages/InvoiceIn/Card/InvoiceInBasicData.vue index d3ed4604a..bd7d758b4 100644 --- a/src/pages/InvoiceIn/Card/InvoiceInBasicData.vue +++ b/src/pages/InvoiceIn/Card/InvoiceInBasicData.vue @@ -17,10 +17,11 @@ const quasar = useQuasar(); const { t } = useI18n(); const dms = ref({}); +const route = useRoute(); const editDownloadDisabled = ref(false); -const invoiceIn = computed(() => useArrayData('InvoiceIn').store.data); +const invoiceIn = computed(() => useArrayData(route.meta.moduleName).store.data); const userConfig = ref(null); -const invoiceId = computed(() => +useRoute().params.id); +const invoiceId = computed(() => +route.params.id); const expenses = ref([]); const currencies = ref([]); diff --git a/src/pages/InvoiceIn/Card/InvoiceInDescriptor.vue b/src/pages/InvoiceIn/Card/InvoiceInDescriptor.vue index bbb52b15d..348d9cce2 100644 --- a/src/pages/InvoiceIn/Card/InvoiceInDescriptor.vue +++ b/src/pages/InvoiceIn/Card/InvoiceInDescriptor.vue @@ -27,7 +27,7 @@ const quasar = useQuasar(); const { hasAny } = useRole(); const { t } = useI18n(); const { openReport, sendEmail } = usePrintService(); -const { store } = useArrayData('InvoiceIn'); +const { store } = useArrayData(currentRoute.value.meta.moduleName); const invoiceIn = computed(() => store.data); const cardDescriptorRef = ref(); @@ -41,26 +41,20 @@ const siiTypeInvoiceOuts = ref([]); const invoiceCorrectionTypes = ref([]); const actions = { unbook: { - title: 'Are you sure you want to unbook this invoice?', + title: t('assertAction', { action: t('unbook') }), action: toUnbook, }, delete: { - title: 'Are you sure you want to delete this invoice?', + title: t('assertAction', { action: t('delete') }), action: deleteInvoice, }, clone: { - title: 'Are you sure you want to clone this invoice?', + title: t('assertAction', { action: t('clone') }), action: cloneInvoice, }, - showPdf: { - cb: showPdfInvoice, - }, - sendPdf: { - cb: sendPdfInvoiceConfirmation, - }, - correct: { - cb: () => correctionDialogRef.value.show(), - }, + showPdf: { cb: showPdfInvoice }, + sendPdf: { cb: sendPdfInvoiceConfirmation }, + correct: { cb: () => correctionDialogRef.value.show() }, }; const filter = { include: [ @@ -514,13 +508,15 @@ const createInvoiceInCorrection = async () => { en: isNotLinked: The entry {bookEntry} has been deleted with {accountingEntries} entries isLinked: The entry {bookEntry} has been linked to Sage. Please contact administration for further information + assertAction: Are you sure you want to {action} this invoice? es: + book: asentar + unbook: desasentar + delete: eliminar + clone: clonar To book: Contabilizar To unbook: Descontabilizar - Are you sure you want to book this invoice?: Estas seguro de querer asentar esta factura? - Are you sure you want to unbook this invoice?: Estas seguro de querer desasentar esta factura? Delete invoice: Eliminar factura - Are you sure you want to delete this invoice?: Estas seguro de querer eliminar esta factura? Invoice deleted: Factura eliminada Clone invoice: Clonar factura Invoice cloned: Factura clonada @@ -534,4 +530,5 @@ es: Entry: entrada isNotLinked: Se ha eliminado el asiento nº {bookEntry} con {accountingEntries} apuntes isLinked: El asiento {bookEntry} fue enlazado a Sage, por favor contacta con administración + assertAction: Estas seguro de querer {action} esta factura?