|
|
@@ -178,7 +178,7 @@ Page 'Mon abonnement'
|
|
|
<v-col cols="12" v-if="organizationProfile.isTrialActive && (accessProfileStore.isAdmin || accessProfileStore.isCaMember)">
|
|
|
<v-btn
|
|
|
class="stop_btn"
|
|
|
- @click="stopTrial"
|
|
|
+ @click="showStopTrialDialog"
|
|
|
>
|
|
|
Arrêter l'essai
|
|
|
</v-btn>
|
|
|
@@ -294,6 +294,7 @@ Page 'Mon abonnement'
|
|
|
<DialogTrialStopConfirmation
|
|
|
:show="showDialogTrialStopConfirmation"
|
|
|
@closeDialog = "showDialogTrialStopConfirmation = false"
|
|
|
+ @stopTrial = "stopTrial"
|
|
|
/>
|
|
|
</template>
|
|
|
|
|
|
@@ -309,6 +310,7 @@ import MobytUserStatus from '~/models/Organization/MobytUserStatus'
|
|
|
import UrlUtils from '~/services/utils/urlUtils';
|
|
|
import {useDownloadFromRoute} from '~/composables/utils/useDownloadFromRoute';
|
|
|
import {useApiLegacyRequestService} from "~/composables/data/useApiLegacyRequestService";
|
|
|
+import {usePageStore} from "~/stores/page";
|
|
|
|
|
|
//meta
|
|
|
definePageMeta({
|
|
|
@@ -452,12 +454,25 @@ async function subscription(){
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Action lorsque l'on souhaite stopper l'essai
|
|
|
+ * Action lorsque l'on souhaite afficher la modal de confirmation pour stopper
|
|
|
*/
|
|
|
-function stopTrial(){
|
|
|
+function showStopTrialDialog(){
|
|
|
showDialogTrialStopConfirmation.value = true
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * Action lorsque l'on souhaite stopper l'essai
|
|
|
+ */
|
|
|
+async function stopTrial() {
|
|
|
+ usePageStore().loading = true
|
|
|
+ await apiRequestService.post('/trial/stop')
|
|
|
+ const v1BaseURL = runtimeConfig.baseUrlAdminLegacy || runtimeConfig.public.baseUrlAdminLegacy
|
|
|
+ await navigateTo(UrlUtils.join(v1BaseURL, '#', 'dashboard'), {
|
|
|
+ external: true
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
const downloadDolibarrBill = (ref: string): void => {
|
|
|
const route = UrlUtils.join('api/dolibarr/download/invoice', ref)
|
|
|
|