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, + }); +};