From a0db8837cd2e62128adaf2fa548e6e7a77319b95 Mon Sep 17 00:00:00 2001 From: ulysse Date: Tue, 17 Nov 2026 16:35:06 +0100 Subject: [PATCH 1/3] COM-4331: cap elearning --- .../components/billing/CourseBillingCard.vue | 10 ++- .../MultipleCourseBillCreationModal.vue | 10 ++- .../programs/HourlyPaymentPlanListModal.vue | 10 ++- .../programs/HourlyPaymentPlanModal.vue | 74 ++++++++++++++++++- .../vendor/composables/HourlyPaymentPlan.js | 11 ++- 5 files changed, 106 insertions(+), 9 deletions(-) diff --git a/src/modules/vendor/components/billing/CourseBillingCard.vue b/src/modules/vendor/components/billing/CourseBillingCard.vue index 2e93948bc..482097a9d 100644 --- a/src/modules/vendor/components/billing/CourseBillingCard.vue +++ b/src/modules/vendor/components/billing/CourseBillingCard.vue @@ -206,7 +206,8 @@ import CourseCreditNotes from '@api/CourseCreditNotes'; import { NotifyNegative, NotifyPositive, NotifyWarning } from '@components/popup/notify'; import Button from '@components/Button'; import { useCourseBilling } from '@composables/courseBills'; -import { COMPANY, INTRA, SINGLE, DD_MM_YYYY, GROUP, COUNT_UNIT, LIST } from '@data/constants'; +import { COMPANY, INTRA, SINGLE, DD_MM_YYYY, GROUP, COUNT_UNIT, LIST, SHORT_DURATION_H_MM } from '@data/constants'; +import CompaniDuration from '@helpers/dates/companiDurations'; import { strictPositiveNumber, integerNumber, minDate } from '@helpers/vuelidateCustomVal'; import { add, toFixedToFloat } from '@helpers/numbers'; import { formatPrice, formatName, formatIdentity } from '@helpers/utils'; @@ -264,7 +265,12 @@ export default { if (!plan) return ''; const stepPrices = plan.prices.map(p => `${get(p, 'step.name', '')} : ${formatPrice(p.hourlyAmount)}/h`); - const eLearningPrice = plan.elearningPrice ? [`E-learning : ${formatPrice(plan.elearningPrice)}/h`] : []; + const limit = plan.elearningLimit && CompaniDuration(plan.elearningLimit).format(SHORT_DURATION_H_MM); + const eLearningLimit = limit ? ` (limite : ${limit})` : ''; + const eLearningPrice = plan.elearningPrice + ? [`E-learning : ${formatPrice(plan.elearningPrice)}/h${eLearningLimit}`] + : []; + return [...stepPrices, ...eLearningPrice].join(' - '); }; diff --git a/src/modules/vendor/components/billing/MultipleCourseBillCreationModal.vue b/src/modules/vendor/components/billing/MultipleCourseBillCreationModal.vue index 23124ae44..30d88ea9e 100644 --- a/src/modules/vendor/components/billing/MultipleCourseBillCreationModal.vue +++ b/src/modules/vendor/components/billing/MultipleCourseBillCreationModal.vue @@ -39,7 +39,8 @@ {{ price.step.name }} : {{ formatPrice(price.hourlyAmount) }} / h
- E-learning : {{ formatPrice(opt.elearningPrice) }} + E-learning : {{ formatPrice(opt.elearningPrice) }} / h + (limite : {{ formatLimit(opt.elearningLimit) }})
@@ -65,7 +66,8 @@ import Button from '@components/Button'; import ButtonToggle from '@components/ButtonToggle'; import OptionGroup from '@components/form/OptionGroup'; import { formatPrice } from '@helpers/utils'; -import { MANUAL, PAYMENT_PLAN, HOURLY_PAYMENT_PLAN } from '@data/constants'; +import CompaniDuration from '@helpers/dates/companiDurations'; +import { MANUAL, PAYMENT_PLAN, HOURLY_PAYMENT_PLAN, SHORT_DURATION_H_MM } from '@data/constants'; export default { name: 'MultipleCourseBillCreationModal', @@ -124,8 +126,11 @@ export default { value: plan._id, prices: plan.prices, elearningPrice: plan.elearningPrice, + elearningLimit: plan.elearningLimit, }))); + const formatLimit = limit => CompaniDuration(limit).format(SHORT_DURATION_H_MM); + const quantityErrorMessage = computed(() => { if (validations.value.newBillsQuantity.strictPositiveNumber.$response === false || validations.value.newBillsQuantity.integerNumber.$response === false) { @@ -176,6 +181,7 @@ export default { selectPlan, selectHourlyPlan, formatPrice, + formatLimit, }; }, }; diff --git a/src/modules/vendor/components/programs/HourlyPaymentPlanListModal.vue b/src/modules/vendor/components/programs/HourlyPaymentPlanListModal.vue index 8d0c3b41c..9c83c4bb3 100644 --- a/src/modules/vendor/components/programs/HourlyPaymentPlanListModal.vue +++ b/src/modules/vendor/components/programs/HourlyPaymentPlanListModal.vue @@ -20,7 +20,10 @@
{{ getStepName(price.step) }} : {{ price.hourlyAmount }} € / h
-
E-learning : {{ plan.elearningPrice }} €
+
+ E-learning : {{ plan.elearningPrice }} € / h + (limite : {{ formatLimit(plan.elearningLimit) }}) +
@@ -32,6 +35,8 @@ import { useQuasar } from 'quasar'; import { NotifyPositive } from '@components/popup/notify'; import Modal from '@components/modal/Modal'; import Button from '@components/Button'; +import CompaniDuration from '@helpers/dates/companiDurations'; +import { SHORT_DURATION_H_MM } from '@data/constants'; export default { name: 'HourlyPaymentPlanListModal', @@ -55,6 +60,8 @@ export default { const getStepName = stepId => (subProgram.value.steps || []).find(s => s._id === stepId)?.name || ''; + const formatLimit = limit => CompaniDuration(limit).format(SHORT_DURATION_H_MM); + const validateDeletion = (hourlyPaymentPlanId) => { $q.dialog({ title: 'Confirmation', @@ -73,6 +80,7 @@ export default { hide, input, getStepName, + formatLimit, validateDeletion, }; }, diff --git a/src/modules/vendor/components/programs/HourlyPaymentPlanModal.vue b/src/modules/vendor/components/programs/HourlyPaymentPlanModal.vue index 0131c51e8..3b303a038 100644 --- a/src/modules/vendor/components/programs/HourlyPaymentPlanModal.vue +++ b/src/modules/vendor/components/programs/HourlyPaymentPlanModal.vue @@ -19,6 +19,19 @@ +
+

Limite d'heures e-learning facturables (optionnelle)

+ +
+ +
+ + +
+