descriptor menu show invoice actions

This commit is contained in:
William Buezas 2024-02-19 17:23:50 -03:00
parent 41e5110a8a
commit 6ace34cbb1
1 changed files with 15 additions and 2 deletions

View File

@ -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,
});
};
</script>
<template>