From 9ce78518bbf4c4f2a78f00fb0f6ba8779f41a0fa Mon Sep 17 00:00:00 2001 From: Gaurav Gusain Date: Tue, 10 Sep 2024 21:26:04 +0530 Subject: [PATCH 1/2] minor fix --- .../assets/js/components/GrossCalculationSection.vue | 1 - .../views/employee/grossSalaryModal.blade.php | 11 ++++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Modules/Salary/Resources/assets/js/components/GrossCalculationSection.vue b/Modules/Salary/Resources/assets/js/components/GrossCalculationSection.vue index e4dd18e4ec..80edfda962 100644 --- a/Modules/Salary/Resources/assets/js/components/GrossCalculationSection.vue +++ b/Modules/Salary/Resources/assets/js/components/GrossCalculationSection.vue @@ -177,7 +177,6 @@ export default { if (!currentAggCtc) { return '-' } - console.log(currentAggCtc, amount) var ctcPercentage = ((amount - currentAggCtc)/currentAggCtc)*100; var formattedPercentage = ctcPercentage.toFixed(2); return formattedPercentage; diff --git a/Modules/Salary/Resources/views/employee/grossSalaryModal.blade.php b/Modules/Salary/Resources/views/employee/grossSalaryModal.blade.php index 96a1316a32..94ac255de3 100644 --- a/Modules/Salary/Resources/views/employee/grossSalaryModal.blade.php +++ b/Modules/Salary/Resources/views/employee/grossSalaryModal.blade.php @@ -94,6 +94,7 @@ }, methods: { updateProposedCtc(newProposedCtc) { + this.percentage = this.calculatePercentageIncement(newProposedCtc) this.proposedCtc = newProposedCtc; }, onEnteringCtc() { @@ -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; } } }); From c1e9450c1d8f848893d14ecb8876ea14a80c555d Mon Sep 17 00:00:00 2001 From: Gaurav Gusain Date: Tue, 10 Sep 2024 21:34:05 +0530 Subject: [PATCH 2/2] minor fix --- .../assets/js/components/GrossCalculationSection.vue | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Modules/Salary/Resources/assets/js/components/GrossCalculationSection.vue b/Modules/Salary/Resources/assets/js/components/GrossCalculationSection.vue index 80edfda962..3d05375ade 100644 --- a/Modules/Salary/Resources/assets/js/components/GrossCalculationSection.vue +++ b/Modules/Salary/Resources/assets/js/components/GrossCalculationSection.vue @@ -16,9 +16,12 @@
Applicable CTC (Due to financial calculation)
-
- - {{ this.formatCurrency(ctcAggregated) }} ({{ this.percentage(ctcAggregated)}}%) +
+
+ + {{ this.formatCurrency(ctcAggregated) }} +
+ ({{ this.percentage(ctcAggregated)}}%)