Skip to content

Commit

Permalink
Merge pull request #3703 from ColoredCow/fix/pecentage-in-appraisal-m…
Browse files Browse the repository at this point in the history
…odal

Update percetage when selecting CTC suggestions
  • Loading branch information
GauravGusain98 authored Sep 10, 2024
2 parents e411a27 + c1e9450 commit f9b235a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@
<input hidden type="number" step="0.01" v-model="ctcAggregated" name="ctcAggregated" class="form-control bg-light" min="0" required>
<div class="pl-6 col-md-5">
<div class="leading-none fz-24 d-flex align-items-center text-nowrap">Applicable CTC <small class="fz-12 ml-2">(Due to financial calculation)</small></div>
<div class="fz-24 mt-2">
<i class="fa fa-rupee"></i>
<span>{{ this.formatCurrency(ctcAggregated) }} ({{ this.percentage(ctcAggregated)}}%)</span>
<div class="fz-24 mt-2 d-flex align-items-center">
<div>
<i class="fa fa-rupee"></i>
<span>{{ this.formatCurrency(ctcAggregated) }} </span>
</div>
<span class="fz-16 ml-1"> ({{ this.percentage(ctcAggregated)}}%)</span>
</div>
</div>
<div class="form-group pl-6 col-md-5">
Expand Down Expand Up @@ -177,7 +180,6 @@ export default {
if (!currentAggCtc) {
return '-'
}
console.log(currentAggCtc, amount)
var ctcPercentage = ((amount - currentAggCtc)/currentAggCtc)*100;
var formattedPercentage = ctcPercentage.toFixed(2);
return formattedPercentage;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
},
methods: {
updateProposedCtc(newProposedCtc) {
this.percentage = this.calculatePercentageIncement(newProposedCtc)
this.proposedCtc = newProposedCtc;
},
onEnteringCtc() {
Expand All @@ -113,11 +114,19 @@
if (Number.isFinite(percentageIncrease)) {
const ctcValue = currentCtc * (1 + percentageIncrease / 100);
console.log(ctcValue)
this.proposedCtc = Math.round(ctcValue);
} else {
this.proposedCtc = '';
}
},
calculatePercentageIncement(amount) {
var currentAggCtc = this.currentAggCtc;
if (!currentAggCtc) {
return '-'
}
var ctcPercentage = ((amount - currentAggCtc)/currentAggCtc)*100;
var formattedPercentage = ctcPercentage.toFixed(2);
return formattedPercentage;
}
}
});
Expand Down

0 comments on commit f9b235a

Please sign in to comment.