subscription.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401
  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,2]">
  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. {{ $t('PRODUCT_ARTIST_PREMIUM') }}
  93. </th>
  94. <th v-if="organizationProfile.isArtist">
  95. {{ $t('PRODUCT_SCHOOL') }}
  96. </th>
  97. <th v-if="organizationProfile.isSchoolProduct">
  98. {{ $t('PRODUCT_SCHOOL_PREMIUM') }}
  99. </th>
  100. <th>
  101. {{ $t('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>{{ $t('PRODUCT_ARTIST_PREMIUM') }}</b>
  131. </p>
  132. <!-- Cmf member -->
  133. <div v-if="organizationProfile.isCmf">
  134. <p>
  135. <b>{{ $t('for_only_x_eur_ttc_by_month', { price: formatCurrency(7.25, 'EUR') }) }} *</b>
  136. </p>
  137. <p>
  138. <i>
  139. * {{ $t('yearly_paid_giving_x_eur_ttc_per_year', { price: formatCurrency(87.00, 'EUR') }) }}
  140. {{ $t('only_for_cmf_members') }} ({{ $t('public_price_x_ttc_a_year', { price: formatCurrency(168.00, 'EUR') }) }})
  141. </i>
  142. </p>
  143. </div>
  144. <!-- Not a cmf member -->
  145. <div v-else>
  146. <p>
  147. <b>{{ $t('for_only_x_eur_ttc_by_month', { price: formatCurrency(14.00, 'EUR') }) }} *</b>
  148. </p>
  149. <p>
  150. <i>
  151. * {{ $t('yearly_paid_giving_x_eur_ttc_per_year', { price: formatCurrency(168.00, 'EUR') }) }}
  152. </i>
  153. </p>
  154. </div>
  155. <p>
  156. <a href="https://www.opentalent.fr/uploads/opentalent/ficheproduit_Opentalentartist.pdf">
  157. {{ $t('product_sheet') }} : {{ $t('PRODUCT_ARTIST_PREMIUM') }}
  158. </a>
  159. </p>
  160. <p v-if="organizationProfile.isCmf">
  161. <a href="">
  162. <b>{{ $t('download_cmf_order_form') }}</b>
  163. </a>
  164. </p>
  165. <p v-else>
  166. <a href="">
  167. <b>{{ $t('download_order_form') }}</b>
  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: formatCurrency(16.45, 'EUR') }) }} *</p>
  179. <p>
  180. <i>
  181. * {{ $t('yearly_paid_giving_x_eur_ttc_per_year', { price: formatCurrency(198, 'EUR') }) }}
  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: formatCurrency(358.80, 'EUR') }) }})
  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: formatCurrency(29.90, 'EUR') }) }} *</p>
  191. <p>
  192. <i>
  193. * {{ $t('yearly_paid_giving_x_eur_ttc_per_year', { price: formatCurrency(358, 'EUR') }) }}
  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>{{ $t('PRODUCT_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><b>{{ $t('starting_from_x_eur_ttc_per_month', { price: formatCurrency(26.50, 'EUR') }) }} *</b></p>
  225. <p>
  226. <i>
  227. * {{ $t('yearly_paid_giving_x_eur_ttc_per_year', { price: formatCurrency(318.00, 'EUR') }) }}
  228. {{ $t('version_x_up_to_x_students', { product: $t('PRODUCT_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: formatCurrency(529.20, 'EUR') }) }})
  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: formatCurrency(44.10, 'EUR') }) }} *</p>
  237. <p>
  238. <i>
  239. * {{ $t('yearly_paid_giving_x_eur_ttc_per_year', { price: formatCurrency(529.20, 'EUR') }) }}
  240. {{ $t('version_x_up_to_x_students', { product: $t('PRODUCT_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') }} {{ $t('PRODUCT_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><b>{{ $t('send_sms_from_app_to_your_members') }}</b></p>
  258. <!-- Cmf member -->
  259. <div v-if="organizationProfile.isCmf">
  260. <p><b>{{ $t('starting_from_x_eur_ttc_per_sms', { price: formatCurrency(0.10, 'EUR') }) }} *</b></p>
  261. <p><i>* {{ $t('for_x_sms', { amount: '5000' }) }}</i></p>
  262. <p>
  263. <b>
  264. <a href="https://www.opentalent.fr/uploads/opentalent/Bon_commande_SMS_ouverture-CMF.pdf">
  265. {{ $t('download_cmf_order_form') }}
  266. </a>
  267. </b>
  268. </p>
  269. </div>
  270. <!-- Not cmf member -->
  271. <div v-else>
  272. <p><b>{{ $t('starting_from_x_eur_ttc_per_ssm', { price: formatCurrency(0.12, 'EUR') }) }} *</b></p>
  273. <p><i>* {{ $t('for_x_sms', { amount: '5000' }) }}</i></p>
  274. <p>
  275. <b>
  276. <a href="https://www.opentalent.fr/uploads/opentalent/Bon_commande_SMS_ouverture-public.pdf">
  277. {{ $t('download_order_form') }}
  278. </a>
  279. </b>
  280. </p>
  281. </div>
  282. </td>
  283. <!-- Custom domain -->
  284. <td>
  285. <b>{{ $t('get_your_own_domain_and_up_to_five_emails_for_only_x_eur_ttc_per_month', { price: formatCurrency(34.80, 'EUR') }) }}</b>
  286. <br/>
  287. <p>{{ $t('example') }} :</p>
  288. <table>
  289. <tr>
  290. <td style="width: 200px;">
  291. {{ $t('domain_name') }} :
  292. </td>
  293. <td>
  294. <i>{{ $t('dummy_domain_name') }}</i>
  295. </td>
  296. </tr>
  297. <tr>
  298. <td>{{ $t('associated_mail_address') }} : </td>
  299. <td>
  300. <i>{{ $t('dummy_email_address') }}</i>
  301. </td>
  302. </tr>
  303. </table>
  304. </td>
  305. </tr>
  306. </tbody>
  307. </template>
  308. </v-simple-table>
  309. </v-row>
  310. </v-container>
  311. </UiExpansionPanel>
  312. </v-expansion-panels>
  313. </v-col>
  314. </LayoutContainer>
  315. </template>
  316. <script lang="ts">
  317. import { defineComponent, useFetch, useContext, ref, Ref } from '@nuxtjs/composition-api'
  318. import { $organizationProfile } from '~/services/profile/organizationProfile'
  319. import { QUERY_TYPE } from '~/types/enums'
  320. import { ApiResponse, DolibarrAccount } from '~/types/interfaces'
  321. export default defineComponent({
  322. name: 'Subscription',
  323. setup () {
  324. const { store, $dataProvider } = useContext()
  325. const organizationProfile = $organizationProfile(store)
  326. const id: number = store.state.profile.organization.id
  327. const dolibarrAccount: Ref<DolibarrAccount | 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. return {
  342. organizationProfile,
  343. dolibarrAccount,
  344. dolibarrAccountFetch: fetchState
  345. }
  346. },
  347. methods: {
  348. formatCurrency(value: Number, currency: string): string {
  349. return value.toLocaleString(this.$i18n.locale, { style: 'currency', currency: currency })
  350. }
  351. }
  352. })
  353. </script>
  354. <style>
  355. #products-section table {
  356. table-layout: fixed;
  357. width: 100%;
  358. }
  359. #products-section table img {
  360. max-height: 250px;
  361. max-width: 100%;
  362. }
  363. #products-section tr.center-td-content td {
  364. text-align: center;
  365. }
  366. #products-section td {
  367. padding: 12px 18px;
  368. vertical-align: top;
  369. }
  370. </style>