subscription.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412
  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="margin-bottom-20">
  9. {{ $t('my_subscription') }}
  10. </h3>
  11. <v-expansion-panels focusable multiple :value="[0,1]">
  12. <UiExpansionPanel id="informations" icon="fa-info">
  13. <v-container fluid class="container">
  14. <v-row>
  15. <v-simple-table>
  16. <tbody>
  17. <tr>
  18. <td>{{ $t('client_id') }}</td>
  19. <td>{{ dolibarrAccount ? dolibarrAccount.clientNumber : '-' }}</td>
  20. </tr>
  21. <tr>
  22. <td>{{ $t('version') }}</td>
  23. <td>{{ dolibarrAccount ? $t(dolibarrAccount.product) : '-' }}</td>
  24. </tr>
  25. <tr v-if="dolibarrAccount && dolibarrAccount.contract">
  26. <td>{{ $t('services') }}</td>
  27. <td>
  28. <div
  29. v-for="line in dolibarrAccount.contract.lines"
  30. :key="line.id"
  31. style="list-style: none;"
  32. >
  33. {{ line.serviceLabel }}
  34. </div>
  35. </td>
  36. </tr>
  37. <tr v-if="mobytStatus && mobytStatus.active">
  38. <td>{{ $t('remaining_sms_credit') }}</td>
  39. <td>
  40. {{ mobytStatus.money.toLocaleString($i18n.locale, { style: 'currency', currency: 'EUR' }) }}
  41. ({{ mobytStatus.amount }} SMS)
  42. </td>
  43. </tr>
  44. <tr v-if="organizationProfile.isCmf && organizationProfile.isArtistProduct">
  45. <td>{{ $t('paying_structure') }}</td>
  46. <td>
  47. CMF
  48. </td>
  49. </tr>
  50. </tbody>
  51. </v-simple-table>
  52. </v-row>
  53. </v-container>
  54. </UiExpansionPanel>
  55. <UiExpansionPanel id="bills" icon="fa-file">
  56. <v-container fluid class="container">
  57. <v-row>
  58. <v-simple-table v-if="!dolibarrAccountFetch.pending && dolibarrAccount && dolibarrAccount.bills">
  59. <thead>
  60. <tr>
  61. <th>{{ $t('reference') }}</th>
  62. <th>{{ $t('date') }}</th>
  63. <th>{{ $t('taxExcludedAmount') }}</th>
  64. <th>{{ $t('status') }}</th>
  65. </tr>
  66. </thead>
  67. <tbody>
  68. <tr
  69. v-for="bill in dolibarrAccount.bills"
  70. :key="bill.id"
  71. >
  72. <td>{{ bill.ref }}</td>
  73. <td>{{ $moment(bill.date).format($moment.localeData($i18n.locale).longDateFormat('L')) }}</td>
  74. <td>{{ bill.taxExcludedAmount.toLocaleString($i18n.locale, { style: 'currency', currency: 'EUR' }) }}</td>
  75. <td>{{ bill.status === 1 ? $t('paid') : $t('unpaid') }}</td>
  76. </tr>
  77. </tbody>
  78. </v-simple-table>
  79. <div v-else class="ma-2">
  80. <i>{{ $t('no_bill_to_display') }}</i>
  81. </div>
  82. </v-row>
  83. </v-container>
  84. </UiExpansionPanel>
  85. <UiExpansionPanel id="more_features" icon="fa-plus">
  86. <v-container id="products-section" fluid class="container">
  87. <v-row>
  88. <v-simple-table>
  89. <template #default>
  90. <thead>
  91. <tr>
  92. <th v-if="organizationProfile.isArtistProduct">
  93. Opentalent Artist Premium
  94. </th>
  95. <th v-if="organizationProfile.isArtist">
  96. Opentalent School
  97. </th>
  98. <th v-if="organizationProfile.isSchoolProduct">
  99. Opentalent School Premium
  100. </th>
  101. <th>
  102. Sms
  103. </th>
  104. <th>
  105. {{ $t('website') }}
  106. </th>
  107. </tr>
  108. </thead>
  109. <tbody>
  110. <tr class="center-td-content">
  111. <td v-if="organizationProfile.isArtistProduct">
  112. <nuxt-img src="/images/Artist-Square.jpg" />
  113. </td>
  114. <td v-if="organizationProfile.isArtist">
  115. <nuxt-img src="/images/School-Square.jpg" />
  116. </td>
  117. <td v-if="organizationProfile.isSchoolProduct">
  118. <nuxt-img src="/images/School-Square.jpg" />
  119. </td>
  120. <td>
  121. <nuxt-img src="/images/sms_big.png" />
  122. </td>
  123. <td>
  124. <nuxt-img src="/images/nom-de-domaine.jpg" />
  125. </td>
  126. </tr>
  127. <tr>
  128. <!-- Opentalent Artist Premium -->
  129. <td v-if="organizationProfile.isArtistProduct">
  130. <p>
  131. {{ $t('get_more_functionalities_with_version') }} <b>Opentalent Artist Premium</b>
  132. </p>
  133. <!-- Cmf member -->
  134. <div v-if="organizationProfile.isCmf">
  135. <p>
  136. {{ $t('for_only_x_eur_ttc_by_month', { price: '6,33' }) }} *
  137. </p>
  138. <p>
  139. <i>
  140. * {{ $t('yearly_paid_giving_x_eur_ttc_per_year', { price: '76' }) }}
  141. {{ $t('only_for_cmf_members') }} ({{ $t('public_price_x_ttc_a_year', { price: '168' }) }})
  142. </i>
  143. </p>
  144. </div>
  145. <!-- Not cmf member -->
  146. <div v-else>
  147. <p>
  148. {{ $t('for_only_x_eur_ttc_by_month', { price: '14' }) }} *
  149. </p>
  150. <p>
  151. <i>
  152. * {{ $t('yearly_paid_giving_x_eur_ttc_per_year', { price: '168' }) }}
  153. </i>
  154. </p>
  155. </div>
  156. <p>
  157. <a href="https://www.opentalent.fr/uploads/opentalent/ficheproduit_Opentalentartist.pdf">
  158. {{ $t('product_sheet') }} Opentalent Artist Premium
  159. </a>
  160. </p>
  161. <p v-if="organizationProfile.isCmf">
  162. <a href="">
  163. {{ $t('download_cmf_order_form') }}
  164. </a>
  165. </p>
  166. <p v-else>
  167. <a href="">
  168. {{ $t('download_order_form') }}
  169. </a>
  170. </p>
  171. </td>
  172. <!-- Opentalent School -->
  173. <td v-if="organizationProfile.isArtist">
  174. <p>
  175. {{ $t('a_suitable_solution_for_your_artistic_school') }}
  176. </p>
  177. <!-- Cmf member -->
  178. <div v-if="organizationProfile.isCmf">
  179. <p>{{ $t('starting_from_x_eur_ttc_per_month', { price: '16,45' }) }} *</p>
  180. <p>
  181. <i>
  182. * {{ $t('yearly_paid_giving_x_eur_ttc_per_year', { price: '198' }) }}
  183. {{ $t('version_x_up_to_x_students', { product: 'Opentalent School Standard', max_students: '69' }) }}
  184. {{ $t('excluding_license_and_training_fees') }}.
  185. {{ $t('only_for_cmf_members') }} ({{ $t('public_price_x_ttc_a_year', { price: '358,80' }) }})
  186. </i>
  187. </p>
  188. </div>
  189. <!-- Not a cmf member -->
  190. <div v-else>
  191. <p>{{ $t('starting_from_x_eur_ttc_per_month', { price: '29,90' }) }} *</p>
  192. <p>
  193. <i>
  194. * {{ $t('yearly_paid_giving_x_eur_ttc_per_year', { price: '358' }) }}
  195. {{ $t('version_x_up_to_x_students', { product: 'Opentalent School Standard', max_students: '69' }) }}
  196. {{ $t('excluding_license_and_training_fees') }}.
  197. </i>
  198. </p>
  199. </div>
  200. <p>
  201. <a href="https://www.opentalent.fr/uploads/opentalent/ficheproduit_Opentalentschool">
  202. {{ $t('product_sheet') }} Opentalent School
  203. </a>
  204. </p>
  205. <p>
  206. {{ $t('freely_try_our_software') }} !
  207. {{ $t('contact_us_for_show_and_demo') }}.
  208. </p>
  209. <p>
  210. {{ $t('contact_us_at') }} <a href="tel:+33972126017">0 972 126 017</a>, {{ $t('or_by_mail_at') }}
  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. {{ $t('switch_to_version') }} <b>Opentalent School Premium</b> {{ $t('and_benefit') }}:
  218. </p>
  219. <ul>
  220. <li>{{ $t('of_accounts_for_teachers_and_students') }}</li>
  221. <li>{{ $t('of_a_complete_website') }}</li>
  222. </ul>
  223. <!-- Cmf member -->
  224. <div v-if="organizationProfile.isCmf">
  225. <p>{{ $t('starting_from_x_eur_ttc_per_month', { price: '22,30' }) }} *</p>
  226. <p>
  227. <i>
  228. * {{ $t('yearly_paid_giving_x_eur_ttc_per_year', { price: '267,60' }) }}
  229. {{ $t('version_x_up_to_x_students', { product: 'Opentalent School Premium', max_students: '69' }) }}
  230. {{ $t('excluding_license_and_training_fees') }}.
  231. {{ $t('only_for_cmf_members') }} ({{ $t('public_price_x_ttc_a_year', { price: '438' }) }})
  232. </i>
  233. </p>
  234. </div>
  235. <!-- Not cmf member -->
  236. <div v-else>
  237. <p>{{ $t('starting_from_x_eur_ttc_per_month', { price: '36,50' }) }} *</p>
  238. <p>
  239. <i>
  240. * {{ $t('yearly_paid_giving_x_eur_ttc_per_year', { price: '438' }) }}
  241. {{ $t('version_x_up_to_x_students', { product: 'Opentalent School Premium', max_students: '69' }) }}
  242. {{ $t('excluding_license_and_training_fees') }}.
  243. </i>
  244. </p>
  245. </div>
  246. <p>
  247. <a href="https://www.opentalent.fr/uploads/opentalent/ficheproduit_Opentalentschool">
  248. {{ $t('product_sheet') }} Opentalent School
  249. </a>
  250. </p>
  251. <p>
  252. {{ $t('contact_us_at') }} <a href="tel:+33972126017">0 972 126 017</a>, {{ $t('or_by_mail_at') }}
  253. <a href="mailto:contact@opentalent.fr">contact@opentalent.fr</a>
  254. </p>
  255. </td>
  256. <!-- SMS -->
  257. <td>
  258. <p>{{ $t('send_sms_from_app_to_your_members') }}</p>
  259. <!-- Cmf member -->
  260. <div v-if="organizationProfile.isCmf">
  261. <p>{{ $t('starting_from_x_eur_ttc_per_sms', { price: '0,10' }) }} *</p>
  262. <p><i>* {{ $t('for_x_sms', { amount: '5000' }) }}</i></p>
  263. <p>
  264. <a href="https://www.opentalent.fr/uploads/opentalent/Bon_commande_SMS_ouverture-CMF.pdf">
  265. {{ $t('download_cmf_order_form') }}
  266. </a>
  267. </p>
  268. </div>
  269. <!-- Not cmf member -->
  270. <div v-else>
  271. <p>{{ $t('starting_from_x_eur_ttc_per_sms', { price: '0,12' }) }} *</p>
  272. <p><i>* {{ $t('for_x_sms', { amount: '5000' }) }}</i></p>
  273. <p>
  274. <a href="https://www.opentalent.fr/uploads/opentalent/Bon_commande_SMS_ouverture-public.pdf">
  275. {{ $t('download_order_form') }}
  276. </a>
  277. </p>
  278. </div>
  279. </td>
  280. <!-- Custom domain -->
  281. <td>
  282. <p>
  283. {{ $t('get_your_own_domain_and_up_to_five_emails_for_only_x_eur_ttc_per_month', { price: '34,80' }) }}
  284. </p>
  285. <p>{{ $t('example') }} :</p>
  286. <table>
  287. <tr>
  288. <td style="width: 200px;">
  289. {{ $t('domain_name') }} :
  290. </td>
  291. <td>
  292. <i>{{ $t('dummy_domain_name') }}</i>
  293. </td>
  294. </tr>
  295. <tr>
  296. <td>{{ $t('associated_mail_address') }} : </td>
  297. <td>
  298. <i>{{ $t('dummy_email_address') }}</i>
  299. </td>
  300. </tr>
  301. </table>
  302. </td>
  303. </tr>
  304. </tbody>
  305. </template>
  306. </v-simple-table>
  307. </v-row>
  308. </v-container>
  309. </UiExpansionPanel>
  310. </v-expansion-panels>
  311. </v-col>
  312. </LayoutContainer>
  313. </template>
  314. <script lang="ts">
  315. import { defineComponent, useFetch, useContext, ref, Ref } from '@nuxtjs/composition-api'
  316. import { $organizationProfile } from '~/services/profile/organizationProfile'
  317. import { QUERY_TYPE } from '~/types/enums'
  318. import { ApiResponse, DolibarrAccount, MobytUserStatus } from '~/types/interfaces'
  319. import '@/lang/content/subscription/fr-FR'
  320. export default defineComponent({
  321. name: 'Subscription',
  322. setup () {
  323. const { store, $dataProvider } = useContext()
  324. const organizationProfile = $organizationProfile(store)
  325. const id: number = store.state.profile.organization.id
  326. const dolibarrAccount: Ref<DolibarrAccount | null> = ref(null)
  327. const mobytStatus: Ref<MobytUserStatus | null> = ref(null)
  328. // fetch the dolibarr account's data
  329. const { fetchState } = useFetch(async () => {
  330. try {
  331. const response:ApiResponse = await $dataProvider.invoke({
  332. type: QUERY_TYPE.DEFAULT,
  333. url: '/api/dolibarr/account/' + id
  334. })
  335. dolibarrAccount.value = response.data as DolibarrAccount
  336. } catch (Error) {
  337. // eslint-disable-next-line no-console
  338. console.error('Error: Dolibarr account not found')
  339. }
  340. })
  341. // fetch the mobyt status
  342. useFetch(async () => {
  343. try {
  344. const response:ApiResponse = await $dataProvider.invoke({
  345. type: QUERY_TYPE.DEFAULT,
  346. url: '/api/mobyt/status/' + id
  347. })
  348. mobytStatus.value = response.data as MobytUserStatus
  349. } catch (Error) {
  350. // eslint-disable-next-line no-console
  351. console.error('Error: Mobyt status not found')
  352. }
  353. })
  354. return {
  355. organizationProfile,
  356. dolibarrAccount,
  357. mobytStatus,
  358. dolibarrAccountFetch: fetchState
  359. }
  360. }
  361. })
  362. </script>
  363. <style>
  364. #products-section table {
  365. table-layout: fixed;
  366. width: 100%;
  367. }
  368. #products-section table img {
  369. max-height: 250px;
  370. max-width: 100%;
  371. }
  372. #products-section tr.center-td-content td {
  373. text-align: center;
  374. }
  375. #products-section td {
  376. padding: 12px 18px;
  377. vertical-align: top;
  378. }
  379. </style>