subscription.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394
  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>
  38. <td>{{ $t('remaining_sms_credit') }}</td>
  39. <td>
  40. <UiDisplayMobytStatus />
  41. </td>
  42. </tr>
  43. <tr v-if="organizationProfile.isCmf && organizationProfile.isArtistProduct">
  44. <td>{{ $t('paying_structure') }}</td>
  45. <td>
  46. CMF
  47. </td>
  48. </tr>
  49. </tbody>
  50. </v-simple-table>
  51. </v-row>
  52. </v-container>
  53. </UiExpansionPanel>
  54. <UiExpansionPanel id="bills" icon="fa-file">
  55. <v-container fluid class="container">
  56. <v-row>
  57. <v-simple-table v-if="!dolibarrAccountFetch.pending && dolibarrAccount && dolibarrAccount.bills">
  58. <thead>
  59. <tr>
  60. <th>{{ $t('reference') }}</th>
  61. <th>{{ $t('date') }}</th>
  62. <th>{{ $t('taxExcludedAmount') }}</th>
  63. <th>{{ $t('status') }}</th>
  64. </tr>
  65. </thead>
  66. <tbody>
  67. <tr
  68. v-for="bill in dolibarrAccount.bills"
  69. :key="bill.id"
  70. >
  71. <td>{{ bill.ref }}</td>
  72. <td>{{ $moment(bill.date).format($moment.localeData($i18n.locale).longDateFormat('L')) }}</td>
  73. <td>{{ bill.taxExcludedAmount.toLocaleString($i18n.locale, { style: 'currency', currency: 'EUR' }) }}</td>
  74. <td>{{ bill.status === 1 ? $t('paid') : $t('unpaid') }}</td>
  75. </tr>
  76. </tbody>
  77. </v-simple-table>
  78. <div v-else class="ma-2">
  79. <i>{{ $t('no_bill_to_display') }}</i>
  80. </div>
  81. </v-row>
  82. </v-container>
  83. </UiExpansionPanel>
  84. <UiExpansionPanel id="more_features" icon="fa-plus">
  85. <v-container id="products-section" fluid class="container">
  86. <v-row>
  87. <v-simple-table>
  88. <template #default>
  89. <thead>
  90. <tr>
  91. <th v-if="organizationProfile.isArtistProduct">
  92. Opentalent Artist Premium
  93. </th>
  94. <th v-if="organizationProfile.isArtist">
  95. Opentalent School
  96. </th>
  97. <th v-if="organizationProfile.isSchoolProduct">
  98. Opentalent School Premium
  99. </th>
  100. <th>
  101. Sms
  102. </th>
  103. <th>
  104. {{ $t('website') }}
  105. </th>
  106. </tr>
  107. </thead>
  108. <tbody>
  109. <tr class="center-td-content">
  110. <td v-if="organizationProfile.isArtistProduct">
  111. <nuxt-img src="/images/Artist-Square.jpg" />
  112. </td>
  113. <td v-if="organizationProfile.isArtist">
  114. <nuxt-img src="/images/School-Square.jpg" />
  115. </td>
  116. <td v-if="organizationProfile.isSchoolProduct">
  117. <nuxt-img src="/images/School-Square.jpg" />
  118. </td>
  119. <td>
  120. <nuxt-img src="/images/sms_big.png" />
  121. </td>
  122. <td>
  123. <nuxt-img src="/images/nom-de-domaine.jpg" />
  124. </td>
  125. </tr>
  126. <tr>
  127. <!-- Opentalent Artist Premium -->
  128. <td v-if="organizationProfile.isArtistProduct">
  129. <p>
  130. {{ $t('get_more_functionalities_with_version') }} <b>Opentalent Artist Premium</b>
  131. </p>
  132. <!-- Cmf member -->
  133. <div v-if="organizationProfile.isCmf">
  134. <p>
  135. {{ $t('for_only_x_eur_ttc_by_month', { price: '6.33' }) }} *
  136. </p>
  137. <p>
  138. <i>
  139. * {{ $t('yearly_paid_giving_x_eur_ttc_per_year', { price: '76' }) }}
  140. {{ $t('only_for_cmf_members') }} ({{ $t('public_price_x_ttc_a_year', { price: '168' }) }})
  141. </i>
  142. </p>
  143. </div>
  144. <!-- Not cmf member -->
  145. <div v-else>
  146. <p>
  147. {{ $t('for_only_x_eur_ttc_by_month', { price: '14' }) }} *
  148. </p>
  149. <p>
  150. <i>
  151. * {{ $t('yearly_paid_giving_x_eur_ttc_per_year', { price: '168' }) }}
  152. </i>
  153. </p>
  154. </div>
  155. <p>
  156. <a href="https://www.opentalent.fr/uploads/opentalent/ficheproduit_Opentalentartist.pdf">
  157. {{ $t('product_sheet') }} Opentalent Artist Premium
  158. </a>
  159. </p>
  160. <p v-if="organizationProfile.isCmf">
  161. <a href="">
  162. {{ $t('download_cmf_order_form') }}
  163. </a>
  164. </p>
  165. <p v-else>
  166. <a href="">
  167. {{ $t('download_order_form') }}
  168. </a>
  169. </p>
  170. </td>
  171. <!-- Opentalent School -->
  172. <td v-if="organizationProfile.isArtist">
  173. <p>
  174. {{ $t('a_suitable_solution_for_your_artistic_school') }}
  175. </p>
  176. <!-- Cmf member -->
  177. <div v-if="organizationProfile.isCmf">
  178. <p>{{ $t('starting_from_x_eur_ttc_per_month', { price: '16.45' }) }} *</p>
  179. <p>
  180. <i>
  181. * {{ $t('yearly_paid_giving_x_eur_ttc_per_year', { price: '198' }) }}
  182. {{ $t('version_x_up_to_x_students', { product: 'Opentalent School Standard', max_students: '69' }) }}
  183. {{ $t('excluding_license_and_training_fees') }}.
  184. {{ $t('only_for_cmf_members') }} ({{ $t('public_price_x_ttc_a_year', { price: '358.80' }) }})
  185. </i>
  186. </p>
  187. </div>
  188. <!-- Not a cmf member -->
  189. <div v-else>
  190. <p>{{ $t('starting_from_x_eur_ttc_per_month', { price: '29.90' }) }} *</p>
  191. <p>
  192. <i>
  193. * {{ $t('yearly_paid_giving_x_eur_ttc_per_year', { price: '358' }) }}
  194. {{ $t('version_x_up_to_x_students', { product: 'Opentalent School Standard', max_students: '69' }) }}
  195. {{ $t('excluding_license_and_training_fees') }}.
  196. </i>
  197. </p>
  198. </div>
  199. <p>
  200. <a href="https://www.opentalent.fr/uploads/opentalent/ficheproduit_Opentalentschool">
  201. {{ $t('product_sheet') }} Opentalent School
  202. </a>
  203. </p>
  204. <p>
  205. {{ $t('freely_try_our_software') }} !
  206. {{ $t('contact_us_for_show_and_demo') }}.
  207. </p>
  208. <p>
  209. {{ $t('contact_us_at') }} <a href="tel:+33972126017">0 972 126 017</a>, {{ $t('or_by_mail_at') }}
  210. <a href="mailto:contact@opentalent.fr">contact@opentalent.fr</a>
  211. </p>
  212. </td>
  213. <!-- Opentalent School Premium -->
  214. <td v-if="organizationProfile.isSchoolProduct">
  215. <p>
  216. {{ $t('switch_to_version') }} <b>Opentalent School Premium</b> {{ $t('and_benefit') }}:
  217. </p>
  218. <ul>
  219. <li>{{ $t('of_accounts_for_teachers_and_students') }}</li>
  220. <li>{{ $t('of_a_complete_website') }}</li>
  221. </ul>
  222. <!-- Cmf member -->
  223. <div v-if="organizationProfile.isCmf">
  224. <p>{{ $t('starting_from_x_eur_ttc_per_month', { price: '22,30' }) }} *</p>
  225. <p>
  226. <i>
  227. * {{ $t('yearly_paid_giving_x_eur_ttc_per_year', { price: '267,60' }) }}
  228. {{ $t('version_x_up_to_x_students', { product: 'Opentalent School Premium', max_students: '69' }) }}
  229. {{ $t('excluding_license_and_training_fees') }}.
  230. {{ $t('only_for_cmf_members') }} ({{ $t('public_price_x_ttc_a_year', { price: '438' }) }})
  231. </i>
  232. </p>
  233. </div>
  234. <!-- Not cmf member -->
  235. <div v-else>
  236. <p>{{ $t('starting_from_x_eur_ttc_per_month', { price: '36,50' }) }} *</p>
  237. <p>
  238. <i>
  239. * {{ $t('yearly_paid_giving_x_eur_ttc_per_year', { price: '438' }) }}
  240. {{ $t('version_x_up_to_x_students', { product: 'Opentalent School Premium', max_students: '69' }) }}
  241. {{ $t('excluding_license_and_training_fees') }}.
  242. </i>
  243. </p>
  244. </div>
  245. <p>
  246. <a href="https://www.opentalent.fr/uploads/opentalent/ficheproduit_Opentalentschool">
  247. {{ $t('product_sheet') }} Opentalent School
  248. </a>
  249. </p>
  250. <p>
  251. {{ $t('contact_us_at') }} <a href="tel:+33972126017">0 972 126 017</a>, {{ $t('or_by_mail_at') }}
  252. <a href="mailto:contact@opentalent.fr">contact@opentalent.fr</a>
  253. </p>
  254. </td>
  255. <!-- SMS -->
  256. <td>
  257. <p>{{ $t('send_sms_from_app_to_your_members') }}</p>
  258. <!-- Cmf member -->
  259. <div v-if="organizationProfile.isCmf">
  260. <p>{{ $t('starting_from_x_eur_ttc_per_sms', { price: '0.10' }) }} *</p>
  261. <p><i>* {{ $t('for_x_sms', { amount: '5000' }) }}</i></p>
  262. <p>
  263. <a href="https://www.opentalent.fr/uploads/opentalent/Bon_commande_SMS_ouverture-CMF.pdf">
  264. {{ $t('download_cmf_order_form') }}
  265. </a>
  266. </p>
  267. </div>
  268. <!-- Not cmf member -->
  269. <div v-else>
  270. <p>{{ $t('starting_from_x_eur_ttc_per_sms', { price: '0.12' }) }} *</p>
  271. <p><i>* {{ $t('for_x_sms', { amount: '5000' }) }}</i></p>
  272. <p>
  273. <a href="https://www.opentalent.fr/uploads/opentalent/Bon_commande_SMS_ouverture-public.pdf">
  274. {{ $t('download_order_form') }}
  275. </a>
  276. </p>
  277. </div>
  278. </td>
  279. <!-- Custom domain -->
  280. <td>
  281. <p>
  282. {{ $t('get_your_own_domain_and_up_to_five_emails_for_only_x_eur_ttc_per_month', { price: '34,80' }) }}
  283. </p>
  284. <p>{{ $t('example') }} :</p>
  285. <table>
  286. <tr>
  287. <td style="width: 200px;">
  288. {{ $t('domain_name') }} :
  289. </td>
  290. <td>
  291. <i>{{ $t('dummy_domain_name') }}</i>
  292. </td>
  293. </tr>
  294. <tr>
  295. <td>{{ $t('associated_mail_address') }} : </td>
  296. <td>
  297. <i>{{ $t('dummy_email_address') }}</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 } 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. // fetch the dolibarr account's data
  326. const { fetchState } = useFetch(async () => {
  327. try {
  328. const response: ApiResponse = await $dataProvider.invoke({
  329. type: QUERY_TYPE.DEFAULT,
  330. url: '/api/dolibarr/account/' + id
  331. })
  332. dolibarrAccount.value = response.data as DolibarrAccount
  333. } catch (Error) {
  334. // eslint-disable-next-line no-console
  335. console.error('Error: Dolibarr account not found')
  336. }
  337. })
  338. return {
  339. organizationProfile,
  340. dolibarrAccount,
  341. dolibarrAccountFetch: fetchState
  342. }
  343. }
  344. })
  345. </script>
  346. <style>
  347. #products-section table {
  348. table-layout: fixed;
  349. width: 100%;
  350. }
  351. #products-section table img {
  352. max-height: 250px;
  353. max-width: 100%;
  354. }
  355. #products-section tr.center-td-content td {
  356. text-align: center;
  357. }
  358. #products-section td {
  359. padding: 12px 18px;
  360. vertical-align: top;
  361. }
  362. </style>