|
|
@@ -65,86 +65,96 @@ Page 'Mon abonnement'
|
|
|
</v-container>
|
|
|
</UiExpansionPanel>
|
|
|
|
|
|
- <UiExpansionPanel
|
|
|
- v-if="dolibarrAccount !== null && dolibarrAccount.order"
|
|
|
- title="purchase_order"
|
|
|
- icon="fas fa-file"
|
|
|
- >
|
|
|
- <v-container :fluid="true" class="container">
|
|
|
- <v-row>
|
|
|
- <v-table>
|
|
|
- <thead>
|
|
|
- <tr>
|
|
|
- <th>{{ $t('reference') }}</th>
|
|
|
- <th>{{ $t('date') }}</th>
|
|
|
- <th></th>
|
|
|
- </tr>
|
|
|
- </thead>
|
|
|
- <tbody>
|
|
|
- <tr>
|
|
|
- <td>{{ dolibarrAccount.order.ref }}</td>
|
|
|
- <td>{{ $d(dolibarrAccount.order.date) }}</td>
|
|
|
- <td>
|
|
|
- <a
|
|
|
- @click="downloadDolibarrBillingDoc(DOLIBARR_BILLING_DOC_TYPE.ORDER, dolibarrAccount.order.ref)"
|
|
|
- class="clickable"
|
|
|
- >
|
|
|
- {{ $t('download') }}
|
|
|
- </a>
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- </tbody>
|
|
|
- </v-table>
|
|
|
- </v-row>
|
|
|
- </v-container>
|
|
|
- </UiExpansionPanel>
|
|
|
-
|
|
|
- <UiExpansionPanel
|
|
|
- v-if="showDolibarrBillsPanel"
|
|
|
- title="bills"
|
|
|
- icon="fas fa-file"
|
|
|
- >
|
|
|
- <v-container :fluid="true" class="container">
|
|
|
- <v-row>
|
|
|
- <v-table v-if="dolibarrAccount !== null">
|
|
|
- <thead>
|
|
|
- <tr>
|
|
|
- <th>{{ $t('reference') }}</th>
|
|
|
- <th>{{ $t('date') }}</th>
|
|
|
- <th>{{ $t('taxExcludedAmount') }}</th>
|
|
|
- <th>{{ $t('status') }}</th>
|
|
|
- <th></th>
|
|
|
- </tr>
|
|
|
- </thead>
|
|
|
- <tbody>
|
|
|
- <tr v-for="bill in dolibarrAccount.bills" :key="bill.id">
|
|
|
- <td>{{ bill.ref }}</td>
|
|
|
- <td>{{ $d(bill.date) }}</td>
|
|
|
- <td>
|
|
|
- {{
|
|
|
- bill.taxExcludedAmount.toLocaleString($i18n.locale, {
|
|
|
- style: 'currency',
|
|
|
- currency: 'EUR',
|
|
|
- })
|
|
|
- }}
|
|
|
- </td>
|
|
|
- <td>
|
|
|
- {{ bill.paid === true ? $t('paid') : $t('unpaid') }}
|
|
|
- </td>
|
|
|
- <td>
|
|
|
- <a
|
|
|
- @click="downloadDolibarrBillingDoc(DOLIBARR_BILLING_DOC_TYPE.INVOICE, bill.ref)"
|
|
|
- class="clickable"
|
|
|
- >
|
|
|
- {{ $t('download') }}
|
|
|
- </a>
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- </tbody>
|
|
|
- </v-table>
|
|
|
- </v-row>
|
|
|
- </v-container>
|
|
|
- </UiExpansionPanel>
|
|
|
+ <UiExpansionPanel
|
|
|
+ v-if="dolibarrAccount !== null && dolibarrAccount.order"
|
|
|
+ title="purchase_order"
|
|
|
+ icon="fas fa-file"
|
|
|
+ >
|
|
|
+ <v-container :fluid="true" class="container">
|
|
|
+ <v-row>
|
|
|
+ <v-table>
|
|
|
+ <thead>
|
|
|
+ <tr>
|
|
|
+ <th>{{ $t('reference') }}</th>
|
|
|
+ <th>{{ $t('date') }}</th>
|
|
|
+ <th />
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody>
|
|
|
+ <tr>
|
|
|
+ <td>{{ dolibarrAccount.order.ref }}</td>
|
|
|
+ <td>{{ $d(dolibarrAccount.order.date) }}</td>
|
|
|
+ <td>
|
|
|
+ <a
|
|
|
+ class="clickable"
|
|
|
+ @click="
|
|
|
+ downloadDolibarrBillingDoc(
|
|
|
+ DOLIBARR_BILLING_DOC_TYPE.ORDER,
|
|
|
+ dolibarrAccount.order.ref,
|
|
|
+ )
|
|
|
+ "
|
|
|
+ >
|
|
|
+ {{ $t('download') }}
|
|
|
+ </a>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ </tbody>
|
|
|
+ </v-table>
|
|
|
+ </v-row>
|
|
|
+ </v-container>
|
|
|
+ </UiExpansionPanel>
|
|
|
+
|
|
|
+ <UiExpansionPanel
|
|
|
+ v-if="showDolibarrBillsPanel"
|
|
|
+ title="bills"
|
|
|
+ icon="fas fa-file"
|
|
|
+ >
|
|
|
+ <v-container :fluid="true" class="container">
|
|
|
+ <v-row>
|
|
|
+ <v-table v-if="dolibarrAccount !== null">
|
|
|
+ <thead>
|
|
|
+ <tr>
|
|
|
+ <th>{{ $t('reference') }}</th>
|
|
|
+ <th>{{ $t('date') }}</th>
|
|
|
+ <th>{{ $t('taxExcludedAmount') }}</th>
|
|
|
+ <th>{{ $t('status') }}</th>
|
|
|
+ <th />
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody>
|
|
|
+ <tr v-for="bill in dolibarrAccount.bills" :key="bill.id">
|
|
|
+ <td>{{ bill.ref }}</td>
|
|
|
+ <td>{{ $d(bill.date) }}</td>
|
|
|
+ <td>
|
|
|
+ {{
|
|
|
+ bill.taxExcludedAmount.toLocaleString($i18n.locale, {
|
|
|
+ style: 'currency',
|
|
|
+ currency: 'EUR',
|
|
|
+ })
|
|
|
+ }}
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ {{ bill.paid === true ? $t('paid') : $t('unpaid') }}
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <a
|
|
|
+ class="clickable"
|
|
|
+ @click="
|
|
|
+ downloadDolibarrBillingDoc(
|
|
|
+ DOLIBARR_BILLING_DOC_TYPE.INVOICE,
|
|
|
+ bill.ref,
|
|
|
+ )
|
|
|
+ "
|
|
|
+ >
|
|
|
+ {{ $t('download') }}
|
|
|
+ </a>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ </tbody>
|
|
|
+ </v-table>
|
|
|
+ </v-row>
|
|
|
+ </v-container>
|
|
|
+ </UiExpansionPanel>
|
|
|
|
|
|
<UiExpansionPanel
|
|
|
v-if="!organizationProfile.isManagerProduct"
|
|
|
@@ -483,7 +493,7 @@ import UrlUtils from '~/services/utils/urlUtils'
|
|
|
import { useDownloadFromRoute } from '~/composables/utils/useDownloadFromRoute'
|
|
|
import { useApiLegacyRequestService } from '~/composables/data/useApiLegacyRequestService'
|
|
|
import { usePageStore } from '~/stores/page'
|
|
|
-import {DOLIBARR_BILLING_DOC_TYPE} from '~/types/enum/enums';
|
|
|
+import { DOLIBARR_BILLING_DOC_TYPE } from '~/types/enum/enums'
|
|
|
|
|
|
// meta
|
|
|
definePageMeta({
|
|
|
@@ -661,8 +671,15 @@ async function stopTrial() {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-const downloadDolibarrBillingDoc = (type: DOLIBARR_BILLING_DOC_TYPE, ref: string): void => {
|
|
|
- const route = UrlUtils.join('api/dolibarr/download', type, encodeURIComponent(ref))
|
|
|
+const downloadDolibarrBillingDoc = (
|
|
|
+ type: DOLIBARR_BILLING_DOC_TYPE,
|
|
|
+ ref: string,
|
|
|
+): void => {
|
|
|
+ const route = UrlUtils.join(
|
|
|
+ 'api/dolibarr/download',
|
|
|
+ type,
|
|
|
+ encodeURIComponent(ref),
|
|
|
+ )
|
|
|
|
|
|
useDownloadFromRoute(route, `${ref}.pdf`)
|
|
|
}
|