Olivier Massot 6 maanden geleden
bovenliggende
commit
f38734fe96
3 gewijzigde bestanden met toevoegingen van 101 en 87 verwijderingen
  1. 1 3
      pages/public/ping.vue
  2. 100 83
      pages/subscription.vue
  3. 0 1
      plugins/init.server.ts

+ 1 - 3
pages/public/ping.vue

@@ -15,6 +15,4 @@ definePageMeta({
 })
 </script>
 
-<style scoped lang="scss">
-
-</style>
+<style scoped lang="scss"></style>

+ 100 - 83
pages/subscription.vue

@@ -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`)
 }

+ 0 - 1
plugins/init.server.ts

@@ -4,7 +4,6 @@ import { useRedirect } from '~/composables/utils/useRedirect'
 import { useRefreshProfile } from '~/composables/data/useRefreshProfile'
 
 export default defineNuxtPlugin(async () => {
-
   const route = useRoute()
   if (route.path.match(/\/public\/.+/)) {
     return