Skip to content

Commit

Permalink
Merge pull request #452 from bcgov/bugfix-ccfri-1978
Browse files Browse the repository at this point in the history
Bugfixes for TEST
  • Loading branch information
vietle-cgi authored Oct 17, 2023
2 parents 0a021e4 + 85f593f commit b4c97c7
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 41 deletions.
13 changes: 7 additions & 6 deletions frontend/src/components/ccfriApplication/group/AddNewFees.vue
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
<v-container v-else class="ma-0 pa-0">
<v-row>
<v-col>
<label>If you only offer care for <strong>4 days or fewer </strong> per week, enter daily parent fees.</label><br>
<label>If you only offer care for <strong>4 days or fewer </strong> per week, select daily parent fee.</label><br>
<label>Enter your <strong>highest {{item.feeFrequency?.toLowerCase()}} parent fee before CCFRI is applied</strong> in every month below. If there is a month where you do not charge a parent fee, enter zero.</label>
</v-col>
</v-row>
Expand Down Expand Up @@ -460,7 +460,7 @@ export default {
...mapState('navBar', ['navBarList','changeRequestId']),
...mapState('ccfriApp', ['CCFRIFacilityModel', 'ccfriChildCareTypes', 'loadedModel', 'ccfriId']),
...mapGetters('ccfriApp', ['getClosureDateLength']),
...mapGetters('navBar', ['nextPath', 'previousPath', 'isChangeRequest', 'getNavByCCFRIId','isChangeRequest']),
...mapGetters('navBar', ['nextPath', 'previousPath', 'getNavByCCFRIId','isChangeRequest']),
...mapState('reportChanges',['userProfileChangeRequests']),
...mapGetters('reportChanges',['changeRequestStatus']),

Expand Down Expand Up @@ -565,9 +565,9 @@ export default {

},
async next() {
this.rfi3percentCategories = await this.getCcfriOver3percent();
console.log('rfi3percentCategories length ', this.rfi3percentCategories.length);
if (this.isRenewal) {
//do not call RFI fee caluclation on NEW PCF or CR NEW FAC
if (this.isRenewal && !this.isChangeRequest) {
console.log('calculating RFI');
this.rfi3percentCategories = await this.getCcfriOver3percent();
if (this.rfi3percentCategories.length > 0) {
if (this.currentFacility.hasRfi) {
Expand All @@ -584,7 +584,8 @@ export default {
this.$router.push(this.nextPath);
}
} else {
//Not renewal.
console.log("RFI calulation not needed.");
//Not renewal or CR
this.$router.push(this.nextPath);
}
},
Expand Down
20 changes: 10 additions & 10 deletions frontend/src/components/ccofApplication/family/FamilyFunding.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</v-col>
<v-col cols="12" md="6">
<v-text-field :disabled="isLocked" type="number" @wheel="$event.target.blur()" min="0" max="52" outlined required :rules="[...rules.required, rules.min(0), rules.max(52)]"
v-model.number="model.maxWeeksPerYear" @input="convertBlankNumberToNull(model,'maxWeeksPerYear')" label="Maximum of weeks per year you provide child care" />
v-model.number="model.maxWeeksPerYear" @input="convertBlankNumberToNull(model,'maxWeeksPerYear')" label="Maximum number of weeks per year you provide child care" />
</v-col>
</v-row>

Expand Down Expand Up @@ -95,22 +95,22 @@
<v-col cols="12" md="6">
<v-menu v-if="!isLocked" ref="menu1" v-model="model.menu1" :close-on-content-click="false" :nudge-right="40" :return-value.sync="model.hoursFrom" transition="scale-transition" offset-y max-width="290px" min-width="290px">
<template v-slot:activator="{ on, attrs }">
<v-text-field readonly outlined required :rules="rules.required" v-model="model.hoursFrom12hr" label="Facility hours of operation From" v-bind="attrs" v-on="on" />
<v-text-field readonly outlined required :rules="rules.required" v-model="model.hoursFrom12hr" label="Facility hours of operation from" v-bind="attrs" v-on="on" />
</template>
<v-time-picker v-if="model.menu1" v-model="model.hoursFrom" full-width @click:minute="$refs.menu1.save(model.hoursFrom); model.hoursFrom12hr = formatTime(model.hoursFrom)" :allowed-minutes="allowedStep" />
</v-menu>

<v-text-field v-if="isLocked" disabled outlined required v-model="model.hoursFrom12hr" label="Facility hours of operation From" />
<v-text-field v-if="isLocked" disabled outlined required v-model="model.hoursFrom12hr" label="Facility hours of operation from" />
</v-col>

<v-col cols="12" md="6">
<v-menu v-if="!isLocked" ref="menu2" v-model="model.menu2" :close-on-content-click="false" :nudge-right="40" :return-value.sync="model.hoursTo" transition="scale-transition" offset-y max-width="290px" min-width="290px">
<template v-slot:activator="{ on, attrs }">
<v-text-field readonly outlined required :rules="rules.required" v-model="model.hoursTo12hr" label="Facility hours of operation To" v-bind="attrs" v-on="on" />
<v-text-field readonly outlined required :rules="rules.required" v-model="model.hoursTo12hr" label="Facility hours of operation to" v-bind="attrs" v-on="on" />
</template>
<v-time-picker v-if="model.menu2" v-model="model.hoursTo" full-width @click:minute="$refs.menu2.save(model.hoursTo); model.hoursTo12hr = formatTime(model.hoursTo)" :allowed-minutes="allowedStep" />
</v-menu>
<v-text-field v-if="isLocked" disabled outlined required v-model="model.hoursTo12hr" label="Facility hours of operation To" />
<v-text-field v-if="isLocked" disabled outlined required v-model="model.hoursTo12hr" label="Facility hours of operation to" />

</v-col>
</v-row>
Expand Down Expand Up @@ -138,7 +138,7 @@
<v-container>
<v-row>
<v-col>
<v-radio-group required :rules="rules.required" :disabled="isLocked" row v-model="model.isExtendedHours" label="Do you regularly offer extended daily hours of child care (before 6 am, after 7pm or overnight)?">
<v-radio-group required :rules="rules.required" :disabled="isLocked" row v-model="model.isExtendedHours" label="Do you regularly offer extended daily hours of child care (before 6 am, after 7 pm or overnight)?">
<v-radio label="Yes" value="yes" />
<v-radio label="No" value="no" />
</v-radio-group>
Expand Down Expand Up @@ -186,11 +186,11 @@
</v-row>
<v-row class="padded-row">
<v-text-field :disabled="isLocked" outlined type="number" @wheel="$event.target.blur()"
v-model.number="model.extendedChildCareSchoolAge4OrLess" @input="convertBlankNumberToNull(model,'extendedChildCareSchoolAge4OrLess')" :rules="rules.notRequired" label="Family Child Care (School Age / School age care on School Grounds)" />
v-model.number="model.extendedChildCareSchoolAge4OrLess" @input="convertBlankNumberToNull(model,'extendedChildCareSchoolAge4OrLess')" :rules="rules.notRequired" label="Family Child Care (School Age / School Age Care on School Grounds)" />
</v-row>
<v-row class="padded-row">
<v-text-field :disabled="isLocked" outlined type="number" @wheel="$event.target.blur()"
v-model.number="model.multiAgeCare4OrLess" @input="convertBlankNumberToNull(model,'multiAgeCare4OrLess')" :rules="rules.notRequired" label="Multi-Age Care" />
v-model.number="model.multiAgeCare4OrLess" @input="convertBlankNumberToNull(model,'multiAgeCare4OrLess')" :rules="rules.notRequired" label="Multi-Age Child Care" />
</v-row>
</v-col>
<v-col cols="12" md="6">
Expand All @@ -205,11 +205,11 @@
</v-row>
<v-row class="padded-row">
<v-text-field :disabled="isLocked" outlined type="number" @wheel="$event.target.blur()"
v-model.number="model.extendedChildCareSchoolAge4OrMore" @input="convertBlankNumberToNull(model,'extendedChildCareSchoolAge4OrMore')" :rules="rules.notRequired" label="Family Child Care (School Age/ School age care on School Grounds)" />
v-model.number="model.extendedChildCareSchoolAge4OrMore" @input="convertBlankNumberToNull(model,'extendedChildCareSchoolAge4OrMore')" :rules="rules.notRequired" label="Family Child Care (School Age/ School Age Care on School Grounds)" />
</v-row>
<v-row class="padded-row">
<v-text-field :disabled="isLocked" outlined type="number" @wheel="$event.target.blur()"
v-model.number="model.multiAgeCare4more" @input="convertBlankNumberToNull(model,'multiAgeCare4more')" :rules="rules.notRequired" label="Multi-Age Care" />
v-model.number="model.multiAgeCare4more" @input="convertBlankNumberToNull(model,'multiAgeCare4more')" :rules="rules.notRequired" label="Multi-Age Child Care" />
</v-row>
</v-col>
</v-row>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@
</v-col>
</v-row>

<v-row>
<v-col cols="12" md="6">
<v-text-field :disabled="isLocked" outlined
:rules="validateIncorporationNumber(model.organizationType, model.incNumber)" v-model="model.incNumber"
label="Incorporation Number (as it appears in BC Corporate Registry)" />
</v-col>
</v-row>

<v-divider></v-divider>

<v-card-subtitle> Organization Mailing Address </v-card-subtitle>
Expand Down Expand Up @@ -86,15 +94,12 @@

<v-row>
<v-col cols="12" md="6">
<v-radio-group :disabled="isLocked" v-model="model.organizationType" :rules="rules.required" label="Type of Orgnization">
<v-card-subtitle> Type of Organization </v-card-subtitle>
<v-radio-group :disabled="isLocked" v-model="model.organizationType" :rules="rules.required" label="">
<v-radio v-for="item in this.filteredOrganizationList" :key="item.id" :label="item.name" :value="item.id"></v-radio>
</v-radio-group>
</v-col>
<v-col cols="12" md="6">
<v-text-field :disabled="isLocked" outlined
:rules="validateIncorporationNumber(model.organizationType, model.incNumber)" v-model="model.incNumber"
label="Incorporation Number (as it appears in BC Corporate Registry)" />
</v-col>

</v-row>
</v-container>
</v-card>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,9 @@

<v-row>
<v-col>
<v-card-subtitle> Type of Organization </v-card-subtitle>
<v-radio-group :disabled="isLocked" v-model="model.organizationType" :rules="rules.required"
label="Type of Organization">
label="">
<v-radio v-for="item in this.organizationTypeList" :key="item.id" :label="item.name" :value="item.id"></v-radio>
</v-radio-group>
</v-col>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/mtfi/CurrentFeeVerification.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

<br><br>
<div class="row pt-4 justify-center">
<span class="text-h6">Our records show this facility's approved parent fees for are as follows:</span>
<span class="text-h6">Our records show this facility's approved parent fees are as follows:</span>
</div>
<v-form ref="isValidForm" value="false" v-model="isValidForm">
<div v-if="loading">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<ul>
<li><a href='https://www2.gov.bc.ca/assets/gov/british-columbians-our-governments/services-policies-for-government/internal-corporate-services/finance-forms/fin-312-direct-deposit-application.pdf'>Update banking information</a></li>
</ul>
<p>Email: <a href="mailto:cccda@gov.bc.ca">cccda@gov.bc.ca</a></p>
<p>Email: <a href="mailto:ccdda@gov.bc.ca">ccdda@gov.bc.ca</a></p>
<p>Mailing address:</p>
Child Care Operating Funding<br />
PO Box 9965 Stn Prov Govt<br />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<ul>
<li><a href='https://www2.gov.bc.ca/assets/gov/british-columbians-our-governments/services-policies-for-government/internal-corporate-services/finance-forms/fin-312-direct-deposit-application.pdf'>Update banking information</a></li>
</ul>
<p>Email: <a href="mailto:cccda@gov.bc.ca">cccda@gov.bc.ca</a></p>
<p>Email: <a href="mailto:ccdda@gov.bc.ca">ccdda@gov.bc.ca</a></p>
<p>Mailing address:</p>
Child Care Operating Funding<br />
PO Box 9965 Stn Prov Govt<br />
Expand Down
28 changes: 13 additions & 15 deletions frontend/src/store/modules/ccfriApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,18 @@ function getProgramYear(selectedGuid, programYearList){
}

function getPreviousCareType(currentRFI, careType, previousProgramYearId, getters, rootState) {

if (currentRFI.prevYearFeesCorrect || (rootState.navBar.changeType == 'mtfi') && currentRFI.previousCcfriId ) {
let previousRFI = getters.getPreviousApprovedFeesByFacilityId(currentRFI.facilityId);
//console.log('CURRENTRFI', currentRFI);
// Lookup previous years approved parent fees for most RFI scenarios
if ((currentRFI.existingFeesCorrect == 100000000 && currentRFI.previousCcfriId) || (rootState.navBar.changeType == 'mtfi' && rootState.app.isRenewal ) ) {
let previousRFI = getters.getPreviousApprovedFeesByFacilityId({facilityId: currentRFI.facilityId, previousProgramYearId: previousProgramYearId});
return previousRFI.childCareTypes.find(item =>{ return (item.childCareCategoryId == careType.childCareCategoryId && item.programYearId == previousProgramYearId); });
}
//MTFI can be done on a new PCF or renewal - so it may not have previous CCFRI. If no previous CCFRI, base median off current year.
else if (rootState.navBar.changeType == 'mtfi' && !rootState.app.isRenewal ) {
//keep as elif because PCF RFI may call this but not satisfy the above if statement
else if(rootState.navBar.changeType == 'mtfi' && !rootState.app.isRenewal ){
return currentRFI.childCareTypes.find(item => { return (item.childCareCategoryId == careType.childCareCategoryId && item.programYearId == rootState.application.programYearId); });
}
else {
return currentRFI.childCareTypes.find(item => { return (item.childCareCategoryId == careType.childCareCategoryId && item.programYearId == previousProgramYearId); });
}
//else - this will return undefined and RFI will be not be triggered
}

function isOver3Percent(currentFees, previousFees, percentValue) {
Expand Down Expand Up @@ -101,8 +101,8 @@ export default {
getCCFRIMedianById: (state) => (ccfriId) => {
return state.ccfriMedianStore[ccfriId];
},
getPreviousApprovedFeesByFacilityId: (state) => (facilityId) => {
return state.previousFeeStore[facilityId];
getPreviousApprovedFeesByFacilityId: (state) => ({facilityId: facilityId, previousProgramYearId: programYearId}) => {
return state.previousFeeStore[`${facilityId}-${programYearId}`];
},
},
mutations: {
Expand All @@ -116,9 +116,9 @@ export default {
state.ccfriStore[ccfriId] = CCFRIFacilityModel;
}
},
addPreviousApprovedParentFees: (state, {facilityId, parentFeeModel} ) => {
addPreviousApprovedParentFees: (state, {facilityId, programYearId, parentFeeModel} ) => {
if (facilityId) {
state.previousFeeStore[facilityId] = parentFeeModel;
state.previousFeeStore[`${facilityId}-${programYearId}`] = parentFeeModel;
}
},
removeCCFRIFromStore:(state, ccfriId ) => {
Expand Down Expand Up @@ -207,7 +207,6 @@ export default {

try {
let res = await ApiService.apiAxios.patch('/api/application/parentfee/', payload);
console.log('the res is:' , res);
return res;
} catch (error) {
console.log(error);
Expand Down Expand Up @@ -313,13 +312,13 @@ export default {
}
},
async getPreviousApprovedFees({commit, state}, {facilityId, programYearId}) {
const prevFees = state.previousFeeStore[facilityId];
const prevFees = state.previousFeeStore[`${facilityId}-${programYearId}`];
if (prevFees) {
return prevFees;
} else {
try {
const response = await ApiService.apiAxios.get(`${ApiRoutes.CCFRI_FEES}/${facilityId}/year/${programYearId}`);
commit('addPreviousApprovedParentFees', {facilityId: facilityId, parentFeeModel: response.data});
commit('addPreviousApprovedParentFees', {facilityId: facilityId, programYearId: programYearId, parentFeeModel: response.data});
return response.data;
} catch(e) {
console.log(`Failed to get existing Facility with error - ${e}`);
Expand All @@ -337,7 +336,6 @@ export default {
let careTypes = [];
const currProgramYear = getProgramYear(ccofProgramYearId, programYearList);
const prevProgramYear = getProgramYear(currProgramYear.previousYearId, programYearList);

const prevCcfriApp = await dispatch('getPreviousApprovedFees', {facilityId: facilityId, programYearId: prevProgramYear.programYearId});

console.log(prevCcfriApp, 'in upper try');
Expand Down

0 comments on commit b4c97c7

Please sign in to comment.