diff --git a/src/pages/Customer/Card/CustomerBalance.vue b/src/pages/Customer/Card/CustomerBalance.vue index f7d22a345..420bef9bc 100644 --- a/src/pages/Customer/Card/CustomerBalance.vue +++ b/src/pages/Customer/Card/CustomerBalance.vue @@ -11,6 +11,7 @@ import { useState } from 'src/composables/useState'; import { useStateStore } from 'stores/useStateStore'; import { useValidator } from 'src/composables/useValidator'; import { usePrintService } from 'src/composables/usePrintService'; +import { useSession } from 'src/composables/useSession'; import VnPaginate from 'src/components/ui/VnPaginate.vue'; import FetchData from 'components/FetchData.vue'; @@ -19,6 +20,9 @@ import VnSelectFilter from 'src/components/common/VnSelectFilter.vue'; import CustomerNewPayment from 'src/pages/Customer/components/CustomerNewPayment.vue'; import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue'; import InvoiceOutDescriptorProxy from 'src/pages/InvoiceOut/Card/InvoiceOutDescriptorProxy.vue'; +const session = useSession(); + +const tokenMultimedia = session.getTokenMultimedia(); const { sendEmail } = usePrintService(); const { t } = useI18n(); @@ -188,6 +192,11 @@ const saveFieldValue = async (row) => { const sendEmailAction = () => { sendEmail(`Suppliers/${route.params.id}/campaign-metrics-email`); }; + +const showBalancePdf = (balance) => { + const url = `api/InvoiceOuts/${balance.id}/download?access_token=${tokenMultimedia}`; + window.open(url, '_blank'); +};