subscription.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410
  1. <!--
  2. Page 'Mon abonnement'
  3. @see https://ressources.opentalent.fr/display/SPEC/Mon+abonnement
  4. -->
  5. <template>
  6. <LayoutContainer>
  7. <v-col cols="12" sm="12" md="12">
  8. <h3 class="mb-5">{{ $t('my_subscription') }}</h3>
  9. <v-expansion-panels focusable multiple :value="[0,1]">
  10. <UiExpansionPanel id="informations" icon="fa-info">
  11. <v-container fluid class="container">
  12. <v-row>
  13. <v-simple-table>
  14. <tbody>
  15. <tr>
  16. <td>{{ $t('client_id') }}</td>
  17. <td>{{ dolibarrAccount ? dolibarrAccount.clientNumber : '-' }}</td>
  18. </tr>
  19. <tr>
  20. <td>{{ $t('version') }}</td>
  21. <td>{{ dolibarrAccount ? $t(dolibarrAccount.product) : '-' }}</td>
  22. </tr>
  23. <tr v-if="dolibarrAccount && dolibarrAccount.contract">
  24. <td>{{ $t('services') }}</td>
  25. <td>
  26. <div
  27. v-for="line in dolibarrAccount.contract.lines"
  28. :key="line.id"
  29. style="list-style: none;"
  30. >
  31. {{ line.serviceLabel }}
  32. </div>
  33. </td>
  34. </tr>
  35. <tr v-if="mobytStatus && mobytStatus.active">
  36. <td>{{ $t('remaining_sms_credit') }}</td>
  37. <td>
  38. {{ mobytStatus.money.toLocaleString($i18n.locale, { style: 'currency', currency: 'EUR' }) }}
  39. ({{ mobytStatus.amount }} SMS)
  40. </td>
  41. </tr>
  42. <tr v-if="organizationProfile.isCmf && organizationProfile.isArtistProduct">
  43. <td>{{ $t('paying_structure') }}</td>
  44. <td>
  45. CMF
  46. </td>
  47. </tr>
  48. </tbody>
  49. </v-simple-table>
  50. </v-row>
  51. </v-container>
  52. </UiExpansionPanel>
  53. <UiExpansionPanel id="bills" icon="fa-file">
  54. <v-container fluid class="container">
  55. <v-row>
  56. <v-simple-table v-if="!dolibarAccountFetch.pending && dolibarrAccount.bills.length > 0">
  57. <thead>
  58. <tr>
  59. <th>{{ $t('reference') }}</th>
  60. <th>{{ $t('date') }}</th>
  61. <th>{{ $t('taxExcludedAmount') }}</th>
  62. <th>{{ $t('status') }}</th>
  63. </tr>
  64. </thead>
  65. <tbody>
  66. <tr
  67. v-for="bill in dolibarrAccount.bills"
  68. :key="bill.id"
  69. >
  70. <td>{{ bill.ref }}</td>
  71. <td>{{ $moment(bill.date).format($moment.localeData($i18n.locale).longDateFormat('L')) }}</td>
  72. <td>{{ bill.taxExcludedAmount.toLocaleString($i18n.locale, { style: 'currency', currency: 'EUR' }) }}</td>
  73. <td>{{ bill.status === 1 ? $t('paid') : $t('unpaid') }}</td>
  74. </tr>
  75. </tbody>
  76. </v-simple-table>
  77. <div v-else class="ma-2">
  78. <i>{{ $t('no_bill_to_display') }}</i>
  79. </div>
  80. </v-row>
  81. </v-container>
  82. </UiExpansionPanel>
  83. <UiExpansionPanel id="more_features" icon="fa-plus">
  84. <v-container id="products-section" fluid class="container">
  85. <v-row>
  86. <v-simple-table>
  87. <template #default>
  88. <thead>
  89. <tr>
  90. <th v-if="organizationProfile.isArtistProduct">
  91. Opentalent Artist Premium
  92. </th>
  93. <th v-if="organizationProfile.isArtist">
  94. Opentalent School
  95. </th>
  96. <th v-if="organizationProfile.isSchoolProduct">
  97. Opentalent School Premium
  98. </th>
  99. <th>
  100. Sms
  101. </th>
  102. <th>
  103. Site internet
  104. </th>
  105. </tr>
  106. </thead>
  107. <tbody>
  108. <tr class="center-td-content">
  109. <td v-if="organizationProfile.isArtistProduct">
  110. <nuxt-img src="/images/Artist-Square.jpg" />
  111. </td>
  112. <td v-if="organizationProfile.isArtist">
  113. <nuxt-img src="/images/School-Square.jpg" />
  114. </td>
  115. <td v-if="organizationProfile.isSchoolProduct">
  116. <nuxt-img src="/images/School-Square.jpg" />
  117. </td>
  118. <td>
  119. <nuxt-img src="/images/sms_big.png" />
  120. </td>
  121. <td>
  122. <nuxt-img src="/images/nom-de-domaine.jpg" />
  123. </td>
  124. </tr>
  125. <tr>
  126. <!-- Opentalent Artist Premium -->
  127. <td v-if="organizationProfile.isArtistProduct">
  128. <p>
  129. Bénéficiez de plus de fonctionnalités avec la version
  130. <b>Opentalent Artist Premium</b>
  131. </p>
  132. <!-- Cmf member -->
  133. <div v-if="organizationProfile.isCmf">
  134. <p>
  135. Pour seulement 6,33 €.TTC par mois *
  136. </p>
  137. <p>
  138. <i>
  139. * Payable annuellement, soit 76 €.TTC / an.
  140. Offre réservée aux adhérents CMF (Prix public: 168€.TTC/an)
  141. </i>
  142. </p>
  143. </div>
  144. <!-- Not cmf member -->
  145. <div v-else>
  146. <p>
  147. Pour seulement 14 € TTC par mois *
  148. </p>
  149. <p>
  150. <i>
  151. * Payable annuellement soit 168 €.TTC/an
  152. </i>
  153. </p>
  154. </div>
  155. <p>
  156. <a href="https://www.opentalent.fr/uploads/opentalent/ficheproduit_Opentalentartist.pdf">
  157. Fiche produit Opentalent Artist Premium
  158. </a>
  159. </p>
  160. <p v-if="organizationProfile.isCmf">
  161. <a href="">
  162. Télécharger le bon de commande CMF
  163. </a>
  164. </p>
  165. <p v-else>
  166. <a href="">
  167. Télécharger le bon de commande
  168. </a>
  169. </p>
  170. </td>
  171. <!-- Opentalent School -->
  172. <td v-if="organizationProfile.isArtist">
  173. <p>
  174. Une solution économique adaptée à votre établissement d'enseignement
  175. artistique
  176. </p>
  177. <!-- Cmf member -->
  178. <div v-if="organizationProfile.isCmf">
  179. <p>A partir de 16.45€ TTC par mois *</p>
  180. <p>
  181. <i>
  182. * Payable annuellement, soit 198€ TTC par an
  183. Version <b>Opentalent School Standard</b> jusqu'à 69 élèves.
  184. Hors frais de licence d'utilisation et de formation.
  185. Offre réservée aux adhérents CMF (prix public: 358.80€ TTC par an)
  186. </i>
  187. </p>
  188. </div>
  189. <!-- Not cmf member -->
  190. <div v-else>
  191. <p>A partir de 29.90€ TTC par mois *</p>
  192. <p>
  193. <i>
  194. * Payable annuellement, soit 358 € TTC par an
  195. Version <b>Opentalent School Standard</b> jusqu'à 69 élèves.
  196. Hors frais de licence d'utilisation et de formation.
  197. </i>
  198. </p>
  199. </div>
  200. <p>
  201. <a href="https://www.opentalent.fr/uploads/opentalent/ficheproduit_Opentalentschool">
  202. Fiche produit Opentalent School
  203. </a>
  204. </p>
  205. <p>
  206. Essayez notre logiciel en toute liberté ! Contactez-nous sans plus tarder pour obtenir
  207. une présentation ainsi qu'un accès de démonstration.
  208. </p>
  209. <p>
  210. Contactez-nous au <a href="tel:+33972126017">0 972 126 017</a>, ou par mail à l'adresse
  211. <a href="mailto:contact@opentalent.fr">contact@opentalent.fr</a>
  212. </p>
  213. </td>
  214. <!-- Opentalent School Premium -->
  215. <td v-if="organizationProfile.isSchoolProduct">
  216. <p>
  217. Passez à la version <b>Opentalent School Premium</b> et bénéficiez:
  218. </p>
  219. <ul>
  220. <li>de comptes pour vos professeurs et élèves</li>
  221. <li>d'un site internet complet</li>
  222. </ul>
  223. <!-- Cmf member -->
  224. <div v-if="organizationProfile.isCmf">
  225. <p>A partir de 22.30€ TTC par mois *</p>
  226. <p>
  227. <i>* Payable annuellement, soit 267.60€ TTC par an
  228. Version <b>Opentalent School Premium</b> jusqu'à 69 élèves.
  229. Hors frais de licence d'utilisation et de formation.
  230. Offre réservée aux adhérents CMF (prix public: 438€ TTC/an)</i>
  231. </p>
  232. </div>
  233. <!-- Not cmf member -->
  234. <div v-else>
  235. <p>A partir de 36.50€ TTC par mois *</p>
  236. <p>
  237. <i>
  238. * Payable annuellement, soit 438€ TTC par an
  239. Version <b>Opentalent School Premium</b> jusqu'à 69 élèves.
  240. Hors frais de licence d'utilisation et de formation.
  241. </i>
  242. </p>
  243. </div>
  244. <p>
  245. <a href="https://www.opentalent.fr/uploads/opentalent/ficheproduit_Opentalentschool">
  246. Fiche produit Opentalent School
  247. </a>
  248. </p>
  249. <p>
  250. Contactez-nous au <a href="tel:+33972126017">0-972 126 017</a>, ou par mail à l'adresse
  251. <a href="mailto:contact@opentalent.fr">contact@opentalent.fr</a>
  252. </p>
  253. </td>
  254. <!-- SMS -->
  255. <td>
  256. <p>Envoyez des <b>SMS</b> directement depuis votre logiciel à vos membres / élèves</p>
  257. <!-- Cmf member -->
  258. <div v-if="organizationProfile.isCmf">
  259. <p>A partir de 0.10 €.TTC/sms *</p>
  260. <p><i>* pour 5000 SMS</i></p>
  261. <p>
  262. <a href="https://www.opentalent.fr/uploads/opentalent/Bon_commande_SMS_ouverture-CMF.pdf">
  263. Télécharger le bon de commande CMF
  264. </a>
  265. </p>
  266. </div>
  267. <!-- Not cmf member -->
  268. <div v-else>
  269. <p>A partir de 0.12 €.TTC/sms *</p>
  270. <p><i>* pour 5000 SMS</i></p>
  271. <p>
  272. <a href="https://www.opentalent.fr/uploads/opentalent/Bon_commande_SMS_ouverture-public.pdf">
  273. Télécharger le bon de commande
  274. </a>
  275. </p>
  276. </div>
  277. </td>
  278. <!-- Custom domain -->
  279. <td>
  280. <p>
  281. Bénéficiez de votre <b>propre nom de domaine</b> et 5 adresses email
  282. pour seulement 34.80 €.TTC / mois
  283. </p>
  284. <p>Exemple:</p>
  285. <table>
  286. <tr>
  287. <td style="width: 200px;">
  288. Nom de domaine:
  289. </td>
  290. <td>
  291. <i>ma-structure.fr</i>
  292. </td>
  293. </tr>
  294. <tr>
  295. <td>Adresse email associée: </td>
  296. <td>
  297. <i>contact@NomDeMaStructure.fr</i>
  298. </td>
  299. </tr>
  300. </table>
  301. </td>
  302. </tr>
  303. </tbody>
  304. </template>
  305. </v-simple-table>
  306. </v-row>
  307. </v-container>
  308. </UiExpansionPanel>
  309. </v-expansion-panels>
  310. </v-col>
  311. </LayoutContainer>
  312. </template>
  313. <script lang="ts">
  314. import { defineComponent, useFetch, useContext, ref, Ref } from '@nuxtjs/composition-api'
  315. import { $organizationProfile } from '~/services/profile/organizationProfile'
  316. import { QUERY_TYPE } from '~/types/enums'
  317. import {ApiResponse, DolibarrAccount, MobytUserStatus} from '~/types/interfaces'
  318. export default defineComponent({
  319. name: 'Subscription',
  320. setup () {
  321. const { store, $dataProvider } = useContext()
  322. const organizationProfile = $organizationProfile(store)
  323. const id: number = store.state.profile.organization.id
  324. const dolibarrAccount: Ref<DolibarrAccount | null> = ref(null)
  325. const mobytStatus: Ref<MobytUserStatus | null> = ref(null)
  326. // fetch the dolibarr account's data
  327. const {fetchState} = useFetch(async () => {
  328. try {
  329. const reponse:ApiResponse = await $dataProvider.invoke({
  330. type: QUERY_TYPE.DEFAULT,
  331. url: '/api/dolibarr/account/' + id
  332. })
  333. dolibarrAccount.value = reponse.data as DolibarrAccount
  334. } catch (Error) {
  335. // eslint-disable-next-line no-console
  336. console.error('Error: Dolibarr account not found')
  337. }
  338. })
  339. // fetch the mobyt status
  340. useFetch(async () => {
  341. try {
  342. const reponse:ApiResponse = await $dataProvider.invoke({
  343. type: QUERY_TYPE.DEFAULT,
  344. url: '/api/mobyt/status/' + id
  345. })
  346. mobytStatus.value = reponse.data as MobytUserStatus
  347. } catch (Error) {
  348. // eslint-disable-next-line no-console
  349. console.error('Error: Mobyt status not found')
  350. }
  351. })
  352. return {
  353. organizationProfile,
  354. dolibarrAccount,
  355. mobytStatus,
  356. dolibarAccountFetch : fetchState
  357. }
  358. }
  359. })
  360. </script>
  361. <style>
  362. #products-section table {
  363. table-layout: fixed;
  364. width: 100%;
  365. }
  366. #products-section table img {
  367. max-height: 250px;
  368. max-width: 100%;
  369. }
  370. #products-section tr.center-td-content td {
  371. text-align: center;
  372. }
  373. #products-section td {
  374. padding: 12px 18px;
  375. vertical-align: top;
  376. }
  377. </style>