diff --git a/frontend/src/components/mtfi/CurrentFeeVerification.vue b/frontend/src/components/mtfi/CurrentFeeVerification.vue
index d7c3ec8a..4c1104df 100644
--- a/frontend/src/components/mtfi/CurrentFeeVerification.vue
+++ b/frontend/src/components/mtfi/CurrentFeeVerification.vue
@@ -97,42 +97,42 @@
April:
-
May:
-
June:
-
July:
-
Aug:
-
Sept:
-
@@ -194,42 +194,42 @@
Oct:
-
Nov:
-
Dec:
-
Jan:
-
Feb:
-
Mar:
-
@@ -469,21 +469,18 @@ export default {
this.loading = true;
let fac = this.navBarList?.find(el => el.ccfriApplicationId == this.$route.params.urlGuid); //find the facility in navBar so we can look up the old CCFRI ID in userProfile
this.currentFacility = this.userProfileList?.find(el => el.facilityId == fac.facilityId); //facility from userProfile with old CCFRI
- await this.loadCCFRIFacility(this.currentFacility.ccfriApplicationId); //load the old ccfri into the store
- this.currentPcfCcfri = this.getCCFRIById(this.currentFacility.ccfriApplicationId); //set old CCFRI to display fees
+ this.currentPcfCcfri = await this.getPreviousApprovedFees({facilityId: this.currentFacility.facilityId, programYearId: this.programYearId});
this.currentPcfCcfri.childCareTypes = this.currentPcfCcfri.childCareTypes.filter(el => el.programYearId == this.programYearId); //filter so only current fiscal years appear
-
- await this.loadCCFisCCRIMedian(); //load the CCFRI median of the existing PCf (old) CCFRI
await this.loadCCFRIFacility(this.$route.params.urlGuid);
+ await this.loadCCFisCCRIMedian(); //load the CCFRI median of the existing PCf (old) CCFRI
await this.decorateWithCareTypes(this.CCFRIFacilityModel.facilityId);
let arr = [];
//sort the child care types so they match the cards of the old CCFRI fees
for (const childCareType of this.currentPcfCcfri.childCareTypes){
- let careCategory = this.CCFRIFacilityModel.childCareTypes.find(el => el.childCareCategoryId == childCareType.childCareCategoryId);
-
+ let careCategory = this.CCFRIFacilityModel.childCareTypes.find(el => el.childCareCategoryId == childCareType.childCareCategoryId && el.programYearId == this.programYearId);
//if this is the first time, the new CCFRI will not have any fees yet. Assign to 0 so they can be filled in and saved
if (!careCategory.feeFrequency){
let fees = {
@@ -530,7 +527,7 @@ export default {
},
methods: {
- ...mapActions('ccfriApp', ['saveCcfri', 'loadCCFRIFacility', 'getPreviousCCFRI', 'decorateWithCareTypes', 'getCcfriOver3percent', 'loadCCFisCCRIMedian' ]),
+ ...mapActions('ccfriApp', ['saveCcfri', 'loadCCFRIFacility', 'getPreviousApprovedFees', 'decorateWithCareTypes', 'getCcfriOver3percent', 'loadCCFisCCRIMedian' ]),
...mapActions('reportChanges', ['updateChangeRequestMTFI']),
...mapMutations('ccfriApp', ['setLoadedModel', 'setCCFRIFacilityModel']),
...mapMutations('navBar',['setNavBarCCFRIComplete','setNavBarValue']),
@@ -635,7 +632,6 @@ export default {
try {
if (this.hasModelChanged()){
this.processing = true;
- console.log('old ccfri', this.currentPcfCcfri.ccfriApplicationId);
this.setLoadedModel( deepCloneObject(this.CCFRIFacilityModel)); //when saving update the loaded model to look for changes
await this.saveCcfri({isFormComplete: this.isFormComplete(), hasRfi: this.getNavByCCFRIId(this.$route.params.urlGuid).hasRfi});
this.setNavBarCCFRIComplete({ ccfriId: this.$route.params.urlGuid, complete: this.isFormComplete()});
diff --git a/frontend/src/store/modules/ccfriApp.js b/frontend/src/store/modules/ccfriApp.js
index 9fda8db6..35c3275c 100644
--- a/frontend/src/store/modules/ccfriApp.js
+++ b/frontend/src/store/modules/ccfriApp.js
@@ -233,8 +233,7 @@ export default {
//console.log('da previous care type', previousCareType);
if (previousCareType) {
console.log('previousCare Type found, testing RFI median fees: ', previousCareType);
- //let difference = compareChildCareFees(careType, previousCareType);
- let allowedDifference = threePercentMedian[careType.childCareCategory];
+ let allowedDifference = threePercentMedian ? threePercentMedian[careType.childCareCategory] : null;
//console.log('difference', difference);
if (allowedDifference) {
console.log(`Testing RFI median difference using [${allowedDifference}] for [${careType.childCareCategory}]`);
@@ -283,7 +282,7 @@ export default {
throw e;
}
},
- async loadCCFRIFacility({getters, commit, dispatch}, ccfriId) {
+ async loadCCFRIFacility({getters, commit}, ccfriId) {
commit('setCcfriId', ccfriId);
let CCFRIFacilityModel = getters.getCCFRIById(ccfriId);
//console.log('what is loaded in loadFac', CCFRIFacilityModel);