From 6ace34cbb15cdae23cd5ffa6b35ccb84effce71b Mon Sep 17 00:00:00 2001 From: wbuezas Date: Mon, 19 Feb 2024 17:23:50 -0300 Subject: [PATCH] descriptor menu show invoice actions --- .../Card/InvoiceOutDescriptorMenu.vue | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/pages/InvoiceOut/Card/InvoiceOutDescriptorMenu.vue b/src/pages/InvoiceOut/Card/InvoiceOutDescriptorMenu.vue index 3521ba0d7..ca2bf1304 100644 --- a/src/pages/InvoiceOut/Card/InvoiceOutDescriptorMenu.vue +++ b/src/pages/InvoiceOut/Card/InvoiceOutDescriptorMenu.vue @@ -4,6 +4,9 @@ import { useI18n } from 'vue-i18n'; import TransferInvoiceForm from 'src/components/TransferInvoiceForm.vue'; +import { useSession } from 'src/composables/useSession'; +import { usePrintService } from 'composables/usePrintService'; + const $props = defineProps({ invoiceOutData: { type: Object, @@ -11,13 +14,23 @@ const $props = defineProps({ }, }); +const session = useSession(); +const token = session.getToken(); const { t } = useI18n(); +const { openReport } = usePrintService(); const transferInvoiceDialogRef = ref(); -const showInvoicePdf = () => {}; +const showInvoicePdf = () => { + const url = `api/InvoiceOuts/${$props.invoiceOutData.id}/download?access_token=${token}`; + window.open(url, '_blank'); +}; -const showInvoiceCsv = () => {}; +const showInvoiceCsv = () => { + openReport(`InvoiceOuts/${$props.invoiceOutData.ref}/invoice-csv`, { + recipientId: $props.invoiceOutData.client.id, + }); +};