summaryrefslogtreecommitdiff
path: root/src/lib/transaction/utils/transactions.js
blob: 4c7522be0e3f4edc67f0fc39913cd10e875c0dc7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import { getAuth } from '@/core/utils/auth'

const downloadPurchaseOrder = (transaction) => {
  const auth = getAuth()
  const url = `${process.env.ODOO_HOST}/api/v1/partner/${auth.partnerId}/sale_order/${transaction.id}/download_po/${transaction.token}`
  window.open(url, 'download')
}

const downloadQuotation = (transaction) => {
  const auth = getAuth()
  const url = `${process.env.ODOO_HOST}/api/v1/partner/${auth.partnerId}/sale_order/${transaction.id}/download/${transaction.token}`
  window.open(url, 'download')
}

export { downloadPurchaseOrder, downloadQuotation }