HR module changes : GWM

This commit is contained in:
Gowtham M 2024-12-21 15:32:37 +05:30
parent 6846386fc7
commit 17481b7375
4 changed files with 112 additions and 27 deletions

View File

@ -144,14 +144,14 @@ class Monthlypay extends BaseController
$publicholidaysarray = $this->monthlypay_model->getPublicHoldays($current);
$string = "attendance";
$data['noofsundays'] = $noofsundays;
$data['noofpublicholidays'] = count($publicholidaysarray);
$data['noofpublicholidays'] = count($publicholidaysarray) ? count($publicholidaysarray) : 0;
$data['publicholidaysarray'] = $publicholidaysarray;
$data['sundayarray'] = $sundayarray;
$data['monthdays'] = $monthdays;
$data['datefordropdown'] = $current;
$data['attendance'] = $this->monthlypay_model->monthlyAttendance($current);
$data['emppay'] = $this->monthlypay_model->getEmpPayDetails($current, $string);
// dd($data);
$this->global['pageTitle'] = 'Monthly Attendance';
$this->loadViews("attendance", $this->global, $data, NULL);
}

View File

@ -1143,8 +1143,51 @@
document.getElementById('Basic_Pay').value = basic;
document.getElementById('HRA_Amount').value = temp;
}
deductionCalculation();
}
function deductionCalculation()
{
const salaryField = document.getElementById("Total_salary");
const esiCheckbox = document.getElementsByName("esi_applicable")[0];
const pfCheckbox = document.getElementsByName("pf_applicable")[0];
const tdsCheckbox = document.getElementsByName("tds_applicable")[0];
const salary = parseFloat(salaryField.value);
if (!isNaN(salary)) {
// ESI Checkbox: Check and set value
if (salary < 21000) {
esiCheckbox.checked = true;
esiCheckbox.value = "1";
} else {
esiCheckbox.checked = false;
esiCheckbox.value = "0";
}
// PF Checkbox: Check and set value
if (salary > 15000) {
pfCheckbox.checked = true;
pfCheckbox.value = "1";
} else {
pfCheckbox.checked = false;
pfCheckbox.value = "0";
}
// TDS Checkbox: Check and set value
if (salary * 12 > 730000) {
tdsCheckbox.checked = true;
tdsCheckbox.value = "1";
} else {
tdsCheckbox.checked = false;
tdsCheckbox.value = "0";
}
}
}
function removeContact(button) {
$(button).closest('.pad').remove();
$('#filesContainer .a1').hide();

View File

@ -177,30 +177,30 @@ $currentday = date('d');
padding-right: 30% ! important;
}
.fht-table th:nth-child(1),
.fht-table th:nth-child(2),
.fht-table th:nth-child(3)
{
position: sticky;
left: 0;
background-color: #00a65a;
z-index: 2;
border-right: 2px solid #ddd;
color: #ffffff;
}
.fht-table th:nth-child(1),
.fht-table th:nth-child(2),
.fht-table th:nth-child(3)
{
position: sticky;
left: 0;
background-color: #00a65a;
z-index: 2;
border-right: 2px solid #ddd;
color: #ffffff;
}
.fht-table td:nth-child(1),
.fht-table td:nth-child(2),
.fht-table td:nth-child(3)
{
position: sticky;
left: 0;
background-color: #ffffff;
z-index: 2;
border-right: 2px solid #ddd;
color: #0e0b0b;
}
.fht-table td:nth-child(1),
.fht-table td:nth-child(2),
.fht-table td:nth-child(3)
{
position: sticky;
left: 0;
background-color: #ffffff;
z-index: 2;
border-right: 2px solid #ddd;
color: #0e0b0b;
}
</style>
<div class="content-page">
<div class="content">
@ -460,8 +460,8 @@ $currentday = date('d');
} ?>
</td>
<td class="celda_normal summary" id="<?php echo $row . 'PL'; ?>">
<?php if (!empty($a->Paid_Leave)) {
echo number_format($a->Paid_Leave, 2, '.', '.');
<?php if (!empty($noofpublicholidays)) {
echo number_format($noofpublicholidays, 2, '.', '.');
} else {
echo "0.00";
} ?>
@ -831,8 +831,9 @@ $currentday = date('d');
2); // == ''?0:parseFloat(totalworkingHrs));
document.getElementById(totalothrsid).textContent = parseFloat(TotalOT).toFixed(
2); // == ''?0:parseFloat(totalOTHrs));
document.getElementById(paidleaveid).textContent = parseFloat(paidleave).toFixed(2);
document.getElementById(paidleaveid).textContent = parseFloat(publicholidays).toFixed(2);
document.getElementById(daysworkedid).textContent = parseFloat((totalworkingHrs / 8)).toFixed(2);
absent = (absent) ? (absent - publicholidays) : 0;
document.getElementById(absentid).textContent = parseFloat(absent).toFixed(2);
}

View File

@ -1754,6 +1754,47 @@ if (!empty($EmpDetails)) {
document.getElementById('Basic_Pay').value = basic;
document.getElementById('HRA_Amount').value = temp;
}
deductionCalculation();
}
function deductionCalculation()
{
const salaryField = document.getElementById("Total_salary");
const esiCheckbox = document.getElementsByName("esi_applicable")[0];
const pfCheckbox = document.getElementsByName("pf_applicable")[0];
const tdsCheckbox = document.getElementsByName("tds_applicable")[0];
const salary = parseFloat(salaryField.value);
if (!isNaN(salary)) {
// ESI Checkbox: Check and set value
if (salary < 21000) {
esiCheckbox.checked = true;
esiCheckbox.value = "1";
} else {
esiCheckbox.checked = false;
esiCheckbox.value = "0";
}
// PF Checkbox: Check and set value
if (salary > 15000) {
pfCheckbox.checked = true;
pfCheckbox.value = "1";
} else {
pfCheckbox.checked = false;
pfCheckbox.value = "0";
}
// TDS Checkbox: Check and set value
if (salary * 12 > 730000) {
tdsCheckbox.checked = true;
tdsCheckbox.value = "1";
} else {
tdsCheckbox.checked = false;
tdsCheckbox.value = "0";
}
}
}
function removeContact(button) {