diff --git a/env.mjs b/env.mjs index 854034bfca..30a136ca98 100644 --- a/env.mjs +++ b/env.mjs @@ -16,6 +16,7 @@ export const env = { MANAGEMENT_FEES_BILLING_ITEM: process.env.MANAGEMENT_FEES_BILLING_ITEM, TRAINER_FEES_BILLING_ITEM: process.env.TRAINER_FEES_BILLING_ITEM, CONSULTING_PROGRAM_IDS: process.env.CONSULTING_PROGRAM_IDS, + BILLING_COMPANI_EMAIL: process.env.BILLING_COMPANI_EMAIL, }; export const parseEnv = environment => Object.keys(environment).reduce((acc, key) => { diff --git a/src/core/api/Courses.js b/src/core/api/Courses.js index c1cd4b031e..0d9fd5e5c4 100644 --- a/src/core/api/Courses.js +++ b/src/core/api/Courses.js @@ -8,6 +8,10 @@ export default { const courses = await alenviAxios.get(`${process.env.API_HOSTNAME}/courses`, { params }); return courses.data.data.courses; }, + async listTrainersBilling (params) { + const trainers = await alenviAxios.get(`${process.env.API_HOSTNAME}/courses/trainers-billing`, { params }); + return trainers.data.data.trainers; + }, async create (payload) { await alenviAxios.post(`${process.env.API_HOSTNAME}/courses`, payload); }, diff --git a/src/core/api/TrainerBills.js b/src/core/api/TrainerBills.js index 3fa1d42c1b..1b80cb6288 100644 --- a/src/core/api/TrainerBills.js +++ b/src/core/api/TrainerBills.js @@ -4,4 +4,8 @@ export default { async create (payload) { await alenviAxios.post(`${process.env.API_HOSTNAME}/trainerbills`, payload); }, + async list (params) { + const trainerBills = await alenviAxios.get(`${process.env.API_HOSTNAME}/trainerbills`, { params }); + return trainerBills.data.data.trainerBills; + }, }; diff --git a/src/core/components/ProfileTabs.vue b/src/core/components/ProfileTabs.vue index 8a72496469..9f62ac3d6e 100644 --- a/src/core/components/ProfileTabs.vue +++ b/src/core/components/ProfileTabs.vue @@ -36,7 +36,7 @@ export default { : false); const created = () => { - selectedTab.value = tabsContent.value.find(tab => tab.default).name; + selectedTab.value = tabsContent.value.find(tab => tab.default)?.name; }; created(); diff --git a/src/core/components/courses/ProfileBilling.vue b/src/core/components/courses/ProfileBilling.vue index c58c27ec9f..a9bc4d5ae5 100644 --- a/src/core/components/courses/ProfileBilling.vue +++ b/src/core/components/courses/ProfileBilling.vue @@ -71,11 +71,14 @@ @submit="validateBillCreation" :validations="v$.newBill" @hide="resetBillCreationModal" :loading="billCreationLoading" :payer-options="payerList" :error-messages="newBillErrorMessages" :trainees-quantity="traineesQuantity" :course="course" :companies-to-bill="companiesToBill" - :total-price-to-bill="totalPriceToBill" :bills-quantity="newBillsQuantity" /> + :total-price-to-bill="totalPriceToBill" :bills-quantity="newBillsQuantity" + :has-hourly-payment-plan="!!selectedHourlyPlanId" :has-payment-plan="!!selectedPlanId" /> ( + isSingleCourse.value ? get(course.value, 'subProgram.hourlyPaymentPlans', []) : [] + )); + + const isGlobalCertificationCourse = computed(() => course.value.certificateGenerationMode === GLOBAL); + + const hasOtherHourlyPaymentPlan = computed(() => !!selectedHourlyPlanId.value && courseBills.value + .some(bill => bill.hourlyPaymentPlan && bill.hourlyPaymentPlan !== selectedHourlyPlanId.value)); + const rules = computed(() => ({ course: { expectedBillsCount: { @@ -212,7 +227,8 @@ export default { newBill: { payer: { required }, mainFee: { - ...(newBillsQuantity.value === 1 && { price: { strictPositiveNumber, required } }), + ...(newBillsQuantity.value === 1 && !selectedHourlyPlanId.value && + !selectedPlanId.value && { price: { strictPositiveNumber, required } }), count: { required, strictPositiveNumber, integerNumber }, ...(course.value.type !== SINGLE && everyCompaniesToBillHasPrice.value && { ...(newBillsQuantity.value === 1 && @@ -225,6 +241,7 @@ export default { companiesToBill: { minArrayLength: minArrayLength(1) }, newBillsQuantity: { strictPositiveNumber, integerNumber, required }, selectedPlanId: { required: requiredIf(() => mode.value === PAYMENT_PLAN) }, + selectedHourlyPlanId: { required: requiredIf(() => mode.value === HOURLY_PAYMENT_PLAN) }, billsToUpdate: { _ids: { minArrayLength: minArrayLength(1) }, payer: { required: requiredIf(Object.keys(billsToUpdate.value).includes('payer')) }, @@ -237,7 +254,7 @@ export default { const v$ = useVuelidate( rules, - { course, newBill, companiesToBill, newBillsQuantity, billsToUpdate, selectedPlanId } + { course, newBill, companiesToBill, newBillsQuantity, billsToUpdate, selectedPlanId, selectedHourlyPlanId } ); const defaultDescription = computed(() => { @@ -425,10 +442,11 @@ export default { mainFee: { ...isSingleCourse.value && newBillsQuantity.value > 1 ? omit(newBill.value.mainFee, 'description') - : newBill.value.mainFee, + : omit(newBill.value.mainFee, selectedHourlyPlanId.value ? ['price'] : []), ...(newPrices.value.length && { price: newPrices.value }), }, ...((newBillsQuantity.value === 1 || isSingleCourse.value) && { maturityDate: newBill.value.maturityDate }), + ...selectedHourlyPlanId.value && { hourlyPaymentPlanId: selectedHourlyPlanId.value }, }); const validateBillCreation = async () => { @@ -455,6 +473,16 @@ export default { billCreationModal.value = false; companiesSelectionModal.value = true; }); + } else if (hasOtherHourlyPaymentPlan.value) { + $q.dialog({ + title: 'Confirmation', + message: 'Une autre tarification au réel est déjà utilisée sur une facture de cette formation, ' + + 'souhaitez-vous continuer ?', + html: true, + ok: true, + cancel: 'Annuler', + persistent: true, + }).onOk(() => addBill()); } else { await addBill(); } @@ -464,9 +492,15 @@ export default { if (mode.value === MANUAL) { v$.value.newBillsQuantity.$touch(); if (v$.value.newBillsQuantity.$error) return NotifyWarning('Champ invalide.'); - } else { + } else if (mode.value === PAYMENT_PLAN) { v$.value.selectedPlanId.$touch(); if (v$.value.selectedPlanId.$error) return NotifyWarning('Champ invalide.'); + } else { + v$.value.newBillsQuantity.$touch(); + v$.value.selectedHourlyPlanId.$touch(); + if (v$.value.newBillsQuantity.$error || v$.value.selectedHourlyPlanId.$error) { + return NotifyWarning('Champ invalide.'); + } } const courseBillsWithoutCreditNote = courseBills.value.filter(bill => !bill.courseCreditNote); @@ -495,7 +529,7 @@ export default { resetCompaniesSelectionModal(); } catch (e) { console.error(e); - if (e.status === 409) return NotifyNegative(e.data.message); + if ([403, 409].includes(e.status) && e.data.message) return NotifyNegative(e.data.message); NotifyNegative('Erreur lors de la création de la facture.'); } finally { billCreationLoading.value = false; @@ -507,9 +541,11 @@ export default { newBillsQuantity.value = 1; newPrices.value = []; selectedPlanId.value = null; + selectedHourlyPlanId.value = null; mode.value = MANUAL; v$.value.newBillsQuantity.$reset(); v$.value.selectedPlanId.$reset(); + v$.value.selectedHourlyPlanId.$reset(); } }; @@ -723,9 +759,11 @@ export default { watch(mode, (newMode) => { v$.value.newBillsQuantity.$reset(); v$.value.selectedPlanId.$reset(); + v$.value.selectedHourlyPlanId.$reset(); if (newMode === MANUAL) { selectedPlanId.value = null; - } else { + selectedHourlyPlanId.value = null; + } else if (newMode === PAYMENT_PLAN || (newMode === HOURLY_PAYMENT_PLAN && isGlobalCertificationCourse.value)) { newBillsQuantity.value = 1; } }); @@ -754,8 +792,11 @@ export default { newBillsQuantity, newPrices, selectedPlanId, + selectedHourlyPlanId, mode, paymentPlans, + hourlyPaymentPlans, + isGlobalCertificationCourse, // Validation v$, // Data diff --git a/src/core/components/courses/ProfileTraineeFollowUp.vue b/src/core/components/courses/ProfileTraineeFollowUp.vue index 08d10e2ab6..7bf5f9e970 100644 --- a/src/core/components/courses/ProfileTraineeFollowUp.vue +++ b/src/core/components/courses/ProfileTraineeFollowUp.vue @@ -147,6 +147,7 @@ import { END_COURSE, MONTHLY, MM_YYYY, + MONTH, } from '@data/constants'; import CompletionCertificateAdditionModal from 'src/modules/vendor/components/courses/CompletionCertificateAdditionModal'; @@ -514,11 +515,20 @@ export default { } }; - const validateCompletionCertificateDeletion = async (completionCertificateId) => { + const validateCompletionCertificateDeletion = async (completionCertificate) => { try { + const { _id: completionCertificateId, month } = completionCertificate; + const startOfMonth = CompaniDate(month, MM_YYYY).startOf(MONTH).toISO(); + const endOfMonth = CompaniDate(month, MM_YYYY).endOf(MONTH).toISO(); + const hourlyPaymentPlanMessage = (course.value.bills || []) + .filter(bill => bill.maturityDate && CompaniDate(bill.maturityDate).isSameOrBefore(endOfMonth) && + CompaniDate(bill.maturityDate).isSameOrAfter(startOfMonth)) + .some(bill => bill.hourlyPaymentPlan) + ? '
Si il y a une facture brouillon facturée au réel sur le mois, elle sera remise à 0.' + : ''; $q.dialog({ title: 'Confirmation', - message: 'Êtes-vous sûr(e) de vouloir supprimer ce document ?', + message: `Êtes-vous sûr(e) de vouloir supprimer ce document ?${hourlyPaymentPlanMessage}`, html: true, ok: true, cancel: 'Annuler', diff --git a/src/core/components/form/BankDetailInput.vue b/src/core/components/form/BankDetailInput.vue new file mode 100644 index 0000000000..f9cc969f35 --- /dev/null +++ b/src/core/components/form/BankDetailInput.vue @@ -0,0 +1,78 @@ + + + diff --git a/src/core/components/form/Input.vue b/src/core/components/form/Input.vue index fa9a6325fb..19b791e235 100644 --- a/src/core/components/form/Input.vue +++ b/src/core/components/form/Input.vue @@ -1,11 +1,11 @@ @@ -199,13 +235,15 @@ import { formatQuantity, getLastVersion } from '@helpers/utils'; import CompaniDuration from '@helpers/dates/companiDurations'; import CompaniDate from '@helpers/dates/companiDates'; import SubProgramCreationModal from 'src/modules/vendor/components/programs/SubProgramCreationModal'; -import SubProgramPriceVersionCreationModal from - 'src/modules/vendor/components/programs/SubProgramPriceVersionCreationModal'; -import SubProgramPriceVersionHistoryModal from - 'src/modules/vendor/components/programs/SubProgramPriceVersionHistoryModal'; +import SubProgramTrainerPriceVersionCreationModal from + 'src/modules/vendor/components/programs/SubProgramTrainerPriceVersionCreationModal'; +import SubProgramTrainerPriceVersionHistoryModal from + 'src/modules/vendor/components/programs/SubProgramTrainerPriceVersionHistoryModal'; import PaymentPlanAdditionModal from 'src/modules/vendor/components/programs/PaymentPlanAdditionModal'; import PaymentPlanEditionModal from 'src/modules/vendor/components/programs/PaymentPlanEditionModal'; import PaymentPlanListModal from 'src/modules/vendor/components/programs/PaymentPlanListModal'; +import HourlyPaymentPlanModal from 'src/modules/vendor/components/programs/HourlyPaymentPlanModal'; +import HourlyPaymentPlanListModal from 'src/modules/vendor/components/programs/HourlyPaymentPlanListModal'; import StepAdditionModal from 'src/modules/vendor/components/programs/StepAdditionModal'; import StepEditionModal from 'src/modules/vendor/components/programs/StepEditionModal'; import ActivityCreationModal from 'src/modules/vendor/components/programs/ActivityCreationModal'; @@ -221,6 +259,7 @@ import { useActivityCreationModal } from 'src/modules/vendor/composables/Activit import { useActivityReuseModal } from 'src/modules/vendor/composables/ActivityReuseModal'; import { useValidateUnlockingStepModal } from 'src/modules/vendor/composables/ValidateUnlockingStepModal'; import { usePaymentPlan } from 'src/modules/vendor/composables/PaymentPlan'; +import { useHourlyPaymentPlan } from 'src/modules/vendor/composables/HourlyPaymentPlan'; export default { name: 'ProfileContent', @@ -242,11 +281,13 @@ export default { 'published-dot': PublishedDot, 'ni-secondary-button': SecondaryButton, 'ni-bi-color-button': BiColorButton, - 'sub-program-price-version-creation-modal': SubProgramPriceVersionCreationModal, - 'sub-program-price-version-history-modal': SubProgramPriceVersionHistoryModal, + 'sub-program-trainer-price-version-creation-modal': SubProgramTrainerPriceVersionCreationModal, + 'sub-program-trainer-price-version-history-modal': SubProgramTrainerPriceVersionHistoryModal, 'payment-plan-addition-modal': PaymentPlanAdditionModal, 'payment-plan-edition-modal': PaymentPlanEditionModal, 'payment-plan-list-modal': PaymentPlanListModal, + 'hourly-payment-plan-modal': HourlyPaymentPlanModal, + 'hourly-payment-plan-list-modal': HourlyPaymentPlanListModal, }, setup (props) { const { profileId } = toRefs(props); @@ -257,11 +298,12 @@ export default { const areActivitiesVisible = ref({}); const tmpInput = ref(''); const modalLoading = ref(false); + const showPricing = ref({}); const areStepsLocked = ref({}); const currentStepId = ref(''); - const newSubProgramPriceVersion = ref({ prices: [], subProgram: {}, effectiveDate: '' }); - const subProgramPriceVersionCreationModal = ref(false); - const subProgramPriceVersionHistoryModal = ref(false); + const newSubProgramTrainerPriceVersion = ref({ prices: [], subProgram: {}, effectiveDate: '' }); + const subProgramTrainerPriceVersionCreationModal = ref(false); + const subProgramTrainerPriceVersionHistoryModal = ref(false); const selectedSubProgram = ref({}); // SubProgram Creation @@ -355,8 +397,23 @@ export default { deletePaymentPlan, } = usePaymentPlan(modalLoading, refreshProgram, program); - const currentPlanSubProgram = computed(() => (program.value.subPrograms || []) - .find(sp => sp._id === selectedSubProgramForPlan.value._id) || {}); + const { + hourlyPaymentPlanAdditionModal, + hourlyPaymentPlanEditionModal, + hourlyPaymentPlanListModal, + selectedSubProgramForHourlyPlan, + newHourlyPaymentPlan, + editedHourlyPaymentPlan, + v$: hourlyPaymentPlanValidations, + openHourlyPaymentPlanAdditionModal, + resetHourlyPaymentPlanAdditionModal, + openHourlyPaymentPlanListModal, + openHourlyPaymentPlanEditionModal, + resetHourlyPaymentPlanEditionModal, + addHourlyPaymentPlan, + editHourlyPaymentPlan, + deleteHourlyPaymentPlan, + } = useHourlyPaymentPlan(modalLoading, refreshProgram, program); const hasConsistentRoles = (prices) => { const pricesByStep = groupBy(prices, 'step'); @@ -365,7 +422,7 @@ export default { const rules = computed(() => ({ program: { subPrograms: { $each: helpers.forEach({ name: { required } }) } }, - newSubProgramPriceVersion: { + newSubProgramTrainerPriceVersion: { prices: { $each: helpers.forEach({ step: { required }, hourlyAmount: { required, strictPositiveNumber } }), hasConsistentRoles, @@ -374,42 +431,42 @@ export default { }, })); - const v$ = useVuelidate(rules, { program, newSubProgramPriceVersion }); + const v$ = useVuelidate(rules, { program, newSubProgramTrainerPriceVersion }); // SubProgram price version creation - const openPriceVersionCreationModal = (subProgram) => { + const openTrainerPriceVersionCreationModal = (subProgram) => { const steps = subProgram.steps.filter(s => s.type !== E_LEARNING); - const lastSubProgramPriceVersion = getLastVersion(subProgram.trainerPriceVersions || [], 'effectiveDate'); + const lastSubProgramTrainerPriceVersion = getLastVersion(subProgram.trainerPriceVersions || [], 'effectiveDate'); - newSubProgramPriceVersion.value = { - subProgram: { _id: subProgram._id, steps }, - prices: lastSubProgramPriceVersion - ? lastSubProgramPriceVersion.prices + newSubProgramTrainerPriceVersion.value = { + subProgram: { _id: subProgram._id, steps, trainerPriceVersionsCount: subProgram.trainerPriceVersions?.length }, + prices: lastSubProgramTrainerPriceVersion + ? lastSubProgramTrainerPriceVersion.prices : steps.map(s => ({ step: s._id, hourlyAmount: 100 })), effectiveDate: CompaniDate().startOf(DAY).toISO(), - minEffectiveDate: lastSubProgramPriceVersion - ? CompaniDate(lastSubProgramPriceVersion.effectiveDate).add('P1D').toISO() + minEffectiveDate: lastSubProgramTrainerPriceVersion + ? CompaniDate(lastSubProgramTrainerPriceVersion.effectiveDate).add('P1D').toISO() : '', }; - subProgramPriceVersionCreationModal.value = true; + subProgramTrainerPriceVersionCreationModal.value = true; }; - const resetSubProgramPriceVersionCreationModal = () => { - newSubProgramPriceVersion.value = { prices: [], subProgram: {}, effectiveDate: '' }; - v$.value.newSubProgramPriceVersion.$reset(); + const resetSubProgramTrainerPriceVersionCreationModal = () => { + newSubProgramTrainerPriceVersion.value = { prices: [], subProgram: {}, effectiveDate: '' }; + v$.value.newSubProgramTrainerPriceVersion.$reset(); }; - const addSubProgramPriceVersion = async (subProgramId) => { + const addSubProgramTrainerPriceVersion = async (subProgramId) => { try { modalLoading.value = true; - v$.value.newSubProgramPriceVersion.$touch(); - if (v$.value.newSubProgramPriceVersion.$error) return NotifyWarning('Champ(s) invalide(s).'); + v$.value.newSubProgramTrainerPriceVersion.$touch(); + if (v$.value.newSubProgramTrainerPriceVersion.$error) return NotifyWarning('Champ(s) invalide(s).'); await SubPrograms.update( subProgramId, - { ...omit(newSubProgramPriceVersion.value, ['subProgram', 'minEffectiveDate']) } + { ...omit(newSubProgramTrainerPriceVersion.value, ['subProgram', 'minEffectiveDate']) } ); - subProgramPriceVersionCreationModal.value = false; + subProgramTrainerPriceVersionCreationModal.value = false; } catch (e) { console.error(e); if (e.data.statusCode === 403 && e.data.message) return NotifyWarning(e.data.message); @@ -423,7 +480,7 @@ export default { // SubProgram price version history const openHistoryModal = (subProgram) => { selectedSubProgram.value = subProgram; - subProgramPriceVersionHistoryModal.value = true; + subProgramTrainerPriceVersionHistoryModal.value = true; }; // Unlocking step validation @@ -718,6 +775,10 @@ export default { created(); + const togglePricing = (subProgramId) => { + showPricing.value = { ...showPricing.value, [subProgramId]: !showPricing.value[subProgramId] }; + }; + return { // Data PUBLISHED, @@ -750,9 +811,9 @@ export default { validateUnlockingEditionModal, subProgramsReusingStepToBeUnlocked, stepToBeUnlocked, - subProgramPriceVersionCreationModal, - newSubProgramPriceVersion, - subProgramPriceVersionHistoryModal, + subProgramTrainerPriceVersionCreationModal, + newSubProgramTrainerPriceVersion, + subProgramTrainerPriceVersionHistoryModal, selectedSubProgram, // Computed v$, @@ -809,9 +870,9 @@ export default { getStepTypeIcon, CompaniDuration, getStepSubTitle, - openPriceVersionCreationModal, - resetSubProgramPriceVersionCreationModal, - addSubProgramPriceVersion, + openTrainerPriceVersionCreationModal, + resetSubProgramTrainerPriceVersionCreationModal, + addSubProgramTrainerPriceVersion, openHistoryModal, paymentPlanAdditionModal, paymentPlanEditionModal, @@ -819,7 +880,24 @@ export default { newPaymentPlan, editedPaymentPlan, paymentPlanValidations, - currentPlanSubProgram, + selectedSubProgramForPlan, + showPricing, + togglePricing, + selectedSubProgramForHourlyPlan, + hourlyPaymentPlanAdditionModal, + hourlyPaymentPlanEditionModal, + hourlyPaymentPlanListModal, + newHourlyPaymentPlan, + editedHourlyPaymentPlan, + hourlyPaymentPlanValidations, + openHourlyPaymentPlanAdditionModal, + resetHourlyPaymentPlanAdditionModal, + openHourlyPaymentPlanListModal, + openHourlyPaymentPlanEditionModal, + resetHourlyPaymentPlanEditionModal, + addHourlyPaymentPlan, + editHourlyPaymentPlan, + deleteHourlyPaymentPlan, openPaymentPlanAdditionModal, resetPaymentPlanAdditionModal, openPaymentPlanListModal, @@ -834,6 +912,22 @@ export default { diff --git a/src/modules/vendor/pages/ni/management/ELearningCourseProfile.vue b/src/modules/vendor/pages/ni/management/ELearningCourseProfile.vue index 2e352767f0..3a49bb0f4b 100644 --- a/src/modules/vendor/pages/ni/management/ELearningCourseProfile.vue +++ b/src/modules/vendor/pages/ni/management/ELearningCourseProfile.vue @@ -53,10 +53,15 @@ export default { const $store = useStore(); const course = computed(() => $store.state.course.course); const courseName = computed(() => get(course.value, 'tradeName')); - const headerInfo = computed(() => [{ - icon: 'hourglass_empty', - label: `Durée : ${CompaniDuration(course.value.totalTheoreticalDuration).format(LONG_DURATION_H_MM)}`, - }]); + const headerInfo = computed(() => [ + { + icon: 'hourglass_empty', + label: `Durée : ${CompaniDuration(course.value.totalTheoreticalDuration).format(LONG_DURATION_H_MM)}`, + }, + ...(get(course.value, 'subProgram.archivedAt') + ? [{ icon: 'circle', label: 'Archivé', iconClass: 'info-archived' }] + : []), + ]); const refreshCourse = async () => { try { diff --git a/src/modules/vendor/pages/ni/users/trainers/TrainerProfile.vue b/src/modules/vendor/pages/ni/users/trainers/TrainerProfile.vue index e7e2c0d122..e16e4f9965 100644 --- a/src/modules/vendor/pages/ni/users/trainers/TrainerProfile.vue +++ b/src/modules/vendor/pages/ni/users/trainers/TrainerProfile.vue @@ -16,7 +16,7 @@ import ProfileHeader from '@components/ProfileHeader'; import ProfileTabs from '@components/ProfileTabs'; import ProfileInfo from 'src/modules/vendor/components/trainers/ProfileInfo'; import ProfileContract from 'src/modules/vendor/components/trainers/ProfileContract'; -import VAEITrainerBillingInfos from 'src/modules/vendor/components/trainers/VAEITrainerBillingInfos'; +import TrainerBillingInfos from 'src/modules/vendor/components/trainers/TrainerBillingInfos'; import { formatIdentity } from '@helpers/utils'; import { TRAINER } from '@data/constants'; @@ -37,7 +37,7 @@ export default { const userIdentity = ref(''); const tabsContent = computed(() => { - const { isSingleCourseTrainer } = userProfile.value; + const { isSingleCourseTrainer, isCollectiveCourseTrainer } = userProfile.value; return [ { label: 'Infos personnelles', @@ -52,12 +52,12 @@ export default { default: defaultTab.value === 'contracts', component: ProfileContract, }, - ...isSingleCourseTrainer + ...(isSingleCourseTrainer || isCollectiveCourseTrainer) ? [{ label: 'Suivi des heures/ facturation', - name: 'vaeiTrainerBillingInfos', - default: defaultTab.value === 'vaeiTrainerBillingInfos', - component: VAEITrainerBillingInfos, + name: 'trainerBillingInfos', + default: defaultTab.value === 'trainerBillingInfos', + component: TrainerBillingInfos, }] : [], ]; diff --git a/src/modules/vendor/pages/trainers/administrative/Billing.vue b/src/modules/vendor/pages/trainers/administrative/Billing.vue deleted file mode 100644 index a9b29693a9..0000000000 --- a/src/modules/vendor/pages/trainers/administrative/Billing.vue +++ /dev/null @@ -1,35 +0,0 @@ - - - diff --git a/src/modules/vendor/pages/trainers/billing/TrainerBillsDashboard.vue b/src/modules/vendor/pages/trainers/billing/TrainerBillsDashboard.vue new file mode 100644 index 0000000000..c568450692 --- /dev/null +++ b/src/modules/vendor/pages/trainers/billing/TrainerBillsDashboard.vue @@ -0,0 +1,136 @@ + + + diff --git a/src/modules/vendor/pages/trainers/billing/TrainerBillsHistory.vue b/src/modules/vendor/pages/trainers/billing/TrainerBillsHistory.vue new file mode 100644 index 0000000000..b8f3047a27 --- /dev/null +++ b/src/modules/vendor/pages/trainers/billing/TrainerBillsHistory.vue @@ -0,0 +1,107 @@ + + + + + diff --git a/src/modules/vendor/router/routes.js b/src/modules/vendor/router/routes.js index 530e54f0db..4a4d7029b6 100644 --- a/src/modules/vendor/router/routes.js +++ b/src/modules/vendor/router/routes.js @@ -94,7 +94,7 @@ const routes = [ 'ni management single courses', ]; if (from.name === 'ni management blended courses info' && from.query.defaultTab === 'traineeFollowUp') { - to.query.defaultTab = 'vaeiTrainerBillingInfos'; + to.query.defaultTab = 'trainerBillingInfos'; } else if (blendedOrSingleCourses.includes(from.name)) { to.query.defaultTab = 'contracts'; } @@ -320,10 +320,19 @@ const routes = [ { path: 'trainers/billing', name: 'trainers billing', - component: () => import('src/modules/vendor/pages/trainers/administrative/Billing'), + component: () => import('src/modules/vendor/pages/trainers/billing/TrainerBillsDashboard'), meta: { cookies: ['alenvi_token', 'refresh_token'], - parent: 'administrative', + parent: 'billing', + }, + }, + { + path: 'trainers/billing/history', + name: 'trainers billing history', + component: () => import('src/modules/vendor/pages/trainers/billing/TrainerBillsHistory'), + meta: { + cookies: ['alenvi_token', 'refresh_token'], + parent: 'billing', }, }, {