From c27c2dc7e5459ebe06f0d76b5a29f62451ff0295 Mon Sep 17 00:00:00 2001 From: Manon Palin Date: Mon, 16 Nov 2026 15:13:56 +0100 Subject: [PATCH 1/5] COM-4329 - flag old courses to paid --- .../billing/CollectiveCourseBillingItem.vue | 16 +++++++++++----- .../billing/CollectiveCoursesBillingCard.vue | 4 +++- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/modules/vendor/components/billing/CollectiveCourseBillingItem.vue b/src/modules/vendor/components/billing/CollectiveCourseBillingItem.vue index aaa7a80d0..bd2b04f41 100644 --- a/src/modules/vendor/components/billing/CollectiveCourseBillingItem.vue +++ b/src/modules/vendor/components/billing/CollectiveCourseBillingItem.vue @@ -6,10 +6,12 @@ {{ courseName }}
Honoraires prévus : {{ formatPrice(course.plannedSalary) }}
-
- Montant déjà facturé : {{ formatPrice(course.invoicedAmount) }} -
-
Montant réglé : {{ formatPrice(course.paidAmount) }}
+
{{ TRAINER_COURSE_BILLING_STATUS[course.status] }} le {{ formattedBillingDates }} @@ -17,7 +19,7 @@ {{ TRAINER_COURSE_BILLING_STATUS[course.status] }}
- @@ -62,6 +64,9 @@ export default { const isBilled = computed(() => hasPlannedSalary.value && [INVOICED, PAID].includes(course.value.status)); + // Courses ended before trainer billing was tracked in the app (01/10/2026) are paid without any bill + const isPaidBeforeBillingSystem = computed(() => course.value.status === PAID && !course.value.invoicedAmount); + const goToCourse = computed(() => ({ name: isTrainer.value ? 'trainers courses info' : 'ni management blended courses info', params: { courseId: course.value._id }, @@ -82,6 +87,7 @@ export default { courseName, hasPlannedSalary, isBilled, + isPaidBeforeBillingSystem, goToCourse, formattedBillingDates, // Methods diff --git a/src/modules/vendor/components/billing/CollectiveCoursesBillingCard.vue b/src/modules/vendor/components/billing/CollectiveCoursesBillingCard.vue index a950bbbb6..ba8648bc6 100644 --- a/src/modules/vendor/components/billing/CollectiveCoursesBillingCard.vue +++ b/src/modules/vendor/components/billing/CollectiveCoursesBillingCard.vue @@ -25,6 +25,7 @@ import { computed, ref, toRefs } from 'vue'; import { formatIdentity, formatPrice } from '@helpers/utils'; import { add, subtract, isGreaterThan, toNumber } from '@helpers/numbers'; +import { PAID } from '@data/constants'; import CollectiveCourseBillingItem from 'src/modules/vendor/components/billing/CollectiveCourseBillingItem'; export default { @@ -43,10 +44,11 @@ export default { const totals = computed(() => { const { invoiced, notInvoiced, paid } = (trainer.value.courses || []).reduce((acc, course) => { const remaining = subtract(course.plannedSalary || 0, course.invoicedAmount); + const isNotInvoiced = course.status !== PAID && isGreaterThan(remaining, 0); return { invoiced: add(acc.invoiced, course.invoicedAmount), - notInvoiced: isGreaterThan(remaining, 0) ? add(acc.notInvoiced, remaining) : acc.notInvoiced, + notInvoiced: isNotInvoiced ? add(acc.notInvoiced, remaining) : acc.notInvoiced, paid: add(acc.paid, course.paidAmount), }; }, { invoiced: 0, notInvoiced: 0, paid: 0 }); From d12e2f5ab6fbf95fe9bdf091424c9fdfe9b4239a Mon Sep 17 00:00:00 2001 From: Manon Palin Date: Tue, 17 Nov 2026 15:15:53 +0100 Subject: [PATCH 2/5] COM-4329 - fix reviews --- .../billing/CollectiveCourseBillingItem.vue | 4 +++- .../billing/CollectiveCoursesBillingCard.vue | 6 +++++- .../TrainerCollectiveCoursesBilling.vue | 17 ++++++++++++----- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/modules/vendor/components/billing/CollectiveCourseBillingItem.vue b/src/modules/vendor/components/billing/CollectiveCourseBillingItem.vue index bd2b04f41..5623d09be 100644 --- a/src/modules/vendor/components/billing/CollectiveCourseBillingItem.vue +++ b/src/modules/vendor/components/billing/CollectiveCourseBillingItem.vue @@ -5,8 +5,10 @@ {{ courseName }} -
Honoraires prévus : {{ formatPrice(course.plannedSalary) }}