Merge branch 'new_theme' of bitbucket.org:venbainformationtechnology/ria into new_theme
This commit is contained in:
commit
52a6005263
@ -1,20 +1,16 @@
|
||||
|
||||
<style>
|
||||
.celda_encabezado_general {
|
||||
background-color: #00a65a;
|
||||
border: 1px solid #ccc;
|
||||
color: #ffffff;
|
||||
font-weight: bold;
|
||||
padding: 2px 4px;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
<?php
|
||||
// $sample = array_merge($month, $fresh);
|
||||
// $show_hide_column_value = true;
|
||||
// echo '<pre>';
|
||||
// print_r($month);
|
||||
// print_r($fresh);
|
||||
// print_r($sample);
|
||||
// echo '<pre>';
|
||||
|
||||
// foreach ($sample as $s) {
|
||||
// if (!empty($s->Key)) {
|
||||
// $show_hide_column_value = false;
|
||||
// } else {
|
||||
// $show_hide_column_value = true;
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
$sample = $fresh;
|
||||
|
||||
$ex = explode('-', $dropdownvalue);
|
||||
@ -173,42 +169,35 @@
|
||||
|
||||
<div style="overflow-x:scroll;">
|
||||
<table id="monthlylistings" class="table table-bordered table-hover"
|
||||
style="background-color:#fff;font-size:12px">
|
||||
style="background-color:#fff;font-size:12px;white-space: nowrap;">
|
||||
<thead style="background-color: #ddd;">
|
||||
<tr>
|
||||
|
||||
<th>S.No</th>
|
||||
<th>Emp ID </th>
|
||||
<th>Employee </th>
|
||||
<th>DOJ</th>
|
||||
<th>Designation</th>
|
||||
<th>Total Days</th>
|
||||
<th>Days Worked</th>
|
||||
<th>LOP Days</th>
|
||||
<th>Paid Leave</th>
|
||||
<th>OT Hrs</th>
|
||||
|
||||
<th>Basic Salary</th>
|
||||
<th>Pre Day Salary</th>
|
||||
<th>Worked Salary</th>
|
||||
<th>Pre hr Salary</th>
|
||||
<th>Earned Salary</th>
|
||||
<th>Basic Salary(0.7)</th>
|
||||
<th>HRA Salary(0.3)</th>
|
||||
<th>Gross Salary</th>
|
||||
<th>ESI</th>
|
||||
<th>PF</th>
|
||||
<th>Over Time</th>
|
||||
|
||||
|
||||
|
||||
<th>Auto Loan Due ₹</th>
|
||||
|
||||
|
||||
<th>TDS Deductions in ₹</th>
|
||||
<th>Festival Bonus in ₹</th>
|
||||
|
||||
<th>Estimate in ₹</th>
|
||||
<th class="celda_encabezado_general">S.No</th>
|
||||
<th class="celda_encabezado_general">Emp ID </th>
|
||||
<th class="celda_encabezado_general">Employee </th>
|
||||
<th class="celda_encabezado_general">DOJ</th>
|
||||
<th class="celda_encabezado_general">Designation</th>
|
||||
<th class="celda_encabezado_general">Total Days</th>
|
||||
<th class="celda_encabezado_general">Days Worked</th>
|
||||
<th class="celda_encabezado_general">LOP Days</th>
|
||||
<th class="celda_encabezado_general">Paid Leave</th>
|
||||
<th class="celda_encabezado_general">OT Hrs</th>
|
||||
<th class="celda_encabezado_general">Total Salary</th>
|
||||
<th class="celda_encabezado_general">Per Day Salary</th>
|
||||
<th class="celda_encabezado_general">Worked Salary</th>
|
||||
<th class="celda_encabezado_general">Per hr Salary</th>
|
||||
<th class="celda_encabezado_general">Earned Salary</th>
|
||||
<th class="celda_encabezado_general">Basic Salary(0.7)</th>
|
||||
<th class="celda_encabezado_general">HRA Salary(0.3)</th>
|
||||
<th class="celda_encabezado_general">Gross Salary</th>
|
||||
<th class="celda_encabezado_general">ESI</th>
|
||||
<th class="celda_encabezado_general">PF</th>
|
||||
<th class="celda_encabezado_general">Over Time</th>
|
||||
<th class="celda_encabezado_general">Auto Loan Due ₹</th>
|
||||
<th class="celda_encabezado_general">TDS Deductions in ₹</th>
|
||||
<th class="celda_encabezado_general">Festival Bonus in ₹</th>
|
||||
<th class="celda_encabezado_general">Estimate in ₹</th>
|
||||
|
||||
|
||||
</tr>
|
||||
@ -231,36 +220,43 @@
|
||||
$index--;
|
||||
} else {
|
||||
array_push($testarray, $record->EmpID);
|
||||
?>
|
||||
?>
|
||||
|
||||
<tr class="lastvalue">
|
||||
<td style="text-align:right;" style="background-color:blue;">
|
||||
<?php echo $index; ?></td>
|
||||
<td style="max-width:80px"><?php echo $record->EmpID; ?></td>
|
||||
<td style="max-width:80px"><?php echo $record->FirstName; ?></td>
|
||||
<td style="max-width:80px">
|
||||
<td <?php if($record->is_management_team == 1){ ?> style="max-width:150px;background-color: #d8d8ea;" <?php }else{ ?> style="max-width:150px;" <?php } ?> >
|
||||
<?php echo $record->FirstName; ?>
|
||||
</td>
|
||||
<td style="max-width: 100px;">
|
||||
<?php
|
||||
echo $record->DateofJoining;
|
||||
// $date = DateTime::createFromFormat('Y-m-d H:i:s', $record->DateofJoining);
|
||||
// $newDateFormat = $date->format('d-m-Y');
|
||||
// echo $newDateFormat;
|
||||
$date = DateTime::createFromFormat('Y-m-d H:i:s', $record->DateofJoining);
|
||||
$newDateFormat = $date->format('d-m-Y');
|
||||
echo $newDateFormat;
|
||||
?>
|
||||
</td>
|
||||
<td style="max-width:80px"><?php echo $record->Designation; ?></td>
|
||||
|
||||
<td style="max-width: 150px;overflow: hidden;text-overflow: ellipsis;">
|
||||
<?php echo $record->Designation; ?>
|
||||
</td>
|
||||
|
||||
<td style="max-width:80px"><?php echo $record->NoofDays; ?></td>
|
||||
|
||||
<td id="dayWork<?php echo $index ?>"
|
||||
<?php if (empty($record->Key)) {
|
||||
echo "contenteditable='false';";
|
||||
} ?>
|
||||
<?php if (!empty($record->Key)) { ?> title="Payslip Calculated"
|
||||
style="text-align:right;color:blue;"
|
||||
<?php } else { ?>style="text-align:right;" <?php } ?>>
|
||||
style="text-align:center;color:blue;"
|
||||
<?php } else { ?>style="text-align:center;" <?php } ?>>
|
||||
<?php if (!empty($record->Days_worked)) {
|
||||
echo $record->Days_worked + $record->sunday_count;
|
||||
} else {
|
||||
echo "0.00";
|
||||
} ?>
|
||||
</td>
|
||||
|
||||
<td id="lopDay<?php echo $index ?>"
|
||||
<?php if (empty($record->Key)) {
|
||||
echo "contenteditable='false';";
|
||||
@ -274,6 +270,7 @@
|
||||
echo "0.00";
|
||||
} ?>
|
||||
</td>
|
||||
|
||||
<td id="paidLeave<?php echo $index ?>"
|
||||
<?php if (empty($record->Key)) {
|
||||
echo "contenteditable='false';";
|
||||
@ -287,6 +284,7 @@
|
||||
echo number_format(0.00, 2, '.', '');
|
||||
} ?>
|
||||
</td>
|
||||
|
||||
<td id="otHrsWork<?php echo $index ?>"
|
||||
<?php if (empty($record->Key)) {
|
||||
echo "contenteditable='false';";
|
||||
@ -302,59 +300,46 @@
|
||||
</td>
|
||||
|
||||
<td style="max-width:80px"><?php echo $record->TotalSalary; ?></td>
|
||||
|
||||
<td style="max-width:80px">
|
||||
<?php $perDaySalary = $record->TotalSalary / $record->NoofDays;
|
||||
echo number_format($perDaySalary, 2, '.', ''); ?>
|
||||
</td>
|
||||
|
||||
<td style="max-width:80px">
|
||||
<?php $workedSalary = $perDaySalary * ($record->Days_worked + $record->sunday_count);
|
||||
echo number_format($workedSalary, 2, '.', ''); ?>
|
||||
</td>
|
||||
|
||||
<td style="max-width:80px">
|
||||
<?php $perHrSalary = $perDaySalary / 8;
|
||||
echo number_format($perHrSalary, 2); ?>
|
||||
</td>
|
||||
|
||||
<td style="max-width:80px"><?php echo number_format($workedSalary, 2, '.', ''); ?></td>
|
||||
|
||||
<td style="max-width:80px">
|
||||
<?php $basicWorked = $workedSalary * 70 / 100;
|
||||
echo number_format($basicWorked, 2, '.', ''); ?>
|
||||
</td>
|
||||
|
||||
<td style="max-width:80px">
|
||||
<?php $hraWorked = $workedSalary * 30 / 100;
|
||||
echo number_format($hraWorked, 2, '.', ''); ?>
|
||||
</td>
|
||||
|
||||
<td style="max-width:80px">
|
||||
<?php echo number_format($basicWorked + $hraWorked, 2, '.', ''); ?></td>
|
||||
<?php echo number_format($basicWorked + $hraWorked, 2, '.', ''); ?>
|
||||
</td>
|
||||
|
||||
<td id="esiAmt<?php echo $index ?>" style="max-width:80px"> <?php echo $esi[$i]; ?> </td>
|
||||
|
||||
<td id="pfAmt<?php echo $index ?>" style="max-width:80px"> <?php echo $pf[$i]; ?> </td>
|
||||
|
||||
<td style="max-width:80px"> <?php echo $over_time[$i]; ?> </td>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- <td id="monthDue<?php echo $index ?>" onkeypress="return isNumber(event);" onkeyup="changeInput(event);"
|
||||
<?php if (empty($record->Key)) {
|
||||
echo "contenteditable='false';";
|
||||
} ?>
|
||||
<?php if (!empty($record->Key)) { ?> title="Payslip Calculated"
|
||||
style="text-align:right;color:blue;"
|
||||
<?php } else { ?>style="text-align:right;" <?php } ?>>
|
||||
|
||||
<?php if (!empty($record->Monthly_Due)) {
|
||||
echo $record->Monthly_Due;
|
||||
$totalmonthloan[] = $record->Monthly_Due;
|
||||
} else {
|
||||
echo number_format(0.00, 2, '.', '');
|
||||
} ?>
|
||||
|
||||
</td> -->
|
||||
|
||||
|
||||
<td id="monthDue<?php echo $index ?>" onkeypress="return isNumber(event);" onkeyup="changeInput(event);"
|
||||
<?php if (empty($record->Key)) {
|
||||
echo "contenteditable='true';";
|
||||
} ?>
|
||||
<?php if (empty($record->Key)) { echo "contenteditable='true';"; } ?>
|
||||
<?php if (!empty($record->Key)) { ?> title="Payslip Calculated"
|
||||
style="text-align:right;color:blue;"
|
||||
<?php } else { ?>style="text-align:right;" <?php } ?>>
|
||||
@ -368,7 +353,6 @@
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
<td id="otherDet<?php echo $index ?>" onkeypress="return isNumber(event);" onkeyup="changeInput(event);"
|
||||
<?php if (empty($record->Key)) {
|
||||
echo "contenteditable='true';";
|
||||
@ -530,21 +514,21 @@
|
||||
var totalmonthloan = [];
|
||||
|
||||
|
||||
$(function() {
|
||||
var i = 0;
|
||||
$('tr.lastvalue').each(function() {
|
||||
i = i + 1;
|
||||
estTotal[i] = $(this).find('td').eq(11).text();
|
||||
});
|
||||
// $(function() {
|
||||
// var i = 0;
|
||||
// $('tr.lastvalue').each(function() {
|
||||
// i = i + 1;
|
||||
// estTotal[i] = $(this).find('td').eq(11).text();
|
||||
// });
|
||||
|
||||
|
||||
|
||||
|
||||
var i = 0;
|
||||
$('tr.lastvalue').each(function() {
|
||||
i = i + 1;
|
||||
totalotherDet[i] = $(this).find('td').eq(9).text();
|
||||
});
|
||||
// var i = 0;
|
||||
// $('tr.lastvalue').each(function() {
|
||||
// i = i + 1;
|
||||
// totalotherDet[i] = $(this).find('td').eq(9).text();
|
||||
// });
|
||||
|
||||
|
||||
|
||||
@ -553,29 +537,29 @@
|
||||
|
||||
|
||||
|
||||
var i = 0;
|
||||
$('tr.lastvalue').each(function() {
|
||||
i = i + 1;
|
||||
totalmonthloan[i] = $(this).find('td').eq(7).text();
|
||||
});
|
||||
// var i = 0;
|
||||
// $('tr.lastvalue').each(function() {
|
||||
// i = i + 1;
|
||||
// totalmonthloan[i] = $(this).find('td').eq(7).text();
|
||||
// });
|
||||
|
||||
|
||||
|
||||
t.on('order.dt search.dt', function() {
|
||||
t.column(0, {
|
||||
search: 'applied',
|
||||
order: 'applied'
|
||||
}).nodes().each(function(cell, i) {
|
||||
cell.innerHTML = i + 1;
|
||||
});
|
||||
}).draw();
|
||||
// t.on('order.dt search.dt', function() {
|
||||
// t.column(0, {
|
||||
// search: 'applied',
|
||||
// order: 'applied'
|
||||
// }).nodes().each(function(cell, i) {
|
||||
// cell.innerHTML = i + 1;
|
||||
// });
|
||||
// }).draw();
|
||||
|
||||
var s = "<?php echo $drop; ?>";
|
||||
$('#monthyear').val(s);
|
||||
// var s = "<?php echo $drop; ?>";
|
||||
// $('#monthyear').val(s);
|
||||
|
||||
savebuttonvalidation();
|
||||
// savebuttonvalidation();
|
||||
|
||||
});
|
||||
// });
|
||||
|
||||
function isNumber(evt) {
|
||||
|
||||
@ -606,7 +590,7 @@
|
||||
alldata = JSON.stringify(alldata)
|
||||
// Parse the JSON string back into an array of objects
|
||||
alldata = JSON.parse(alldata);
|
||||
console.log(alldata);
|
||||
|
||||
// Filter out objects where "Emp ID" is empty
|
||||
alldata = alldata.filter(function(item) {
|
||||
return item["Emp ID"].trim() !== "";
|
||||
@ -626,15 +610,11 @@ console.log(alldata);
|
||||
type: "POST",
|
||||
url: "<?php echo base_url() ?>payslip/saveMonthlyData",
|
||||
success: function(data) {
|
||||
console.log(data);
|
||||
|
||||
|
||||
if (data) {
|
||||
|
||||
$('#loader').hide();
|
||||
alert(data);
|
||||
//console.log(data);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -703,14 +683,8 @@ console.log(alldata);
|
||||
var grandtotal = [];
|
||||
|
||||
function changeInput(event, k) {
|
||||
|
||||
|
||||
|
||||
|
||||
var str = event.target.id;
|
||||
var sno = str.substr(8);
|
||||
|
||||
|
||||
var dayWorks = parseFloat(document.getElementById('dayWork' + sno).textContent);
|
||||
var lopDay = parseFloat(document.getElementById('lopDay' + sno).textContent);
|
||||
var paidLeave = parseFloat(document.getElementById('paidLeave' + sno).textContent);
|
||||
@ -766,18 +740,18 @@ console.log(alldata);
|
||||
var dayWorkPaid = dayWorks + paidLeave;
|
||||
}
|
||||
|
||||
console.log("day" + dayWorkPaid);
|
||||
|
||||
var NoofDays = dayWorks + paidLeave + lopDay;
|
||||
console.log("monthday" + NoofDays);
|
||||
|
||||
var Food_Allowances = fAllow * dayWorks;
|
||||
// console.log("workedFA"+Food_Allowances);
|
||||
|
||||
|
||||
var daySalary = bpay / NoofDays;
|
||||
console.log("1daysalary " + daySalary);
|
||||
|
||||
var dayHra = hraAmt / NoofDays;
|
||||
console.log("1dayHRA" + dayHra);
|
||||
|
||||
var onehoursSalary = (daySalary + dayHra) / 8;
|
||||
console.log("onehours " + onehoursSalary);
|
||||
|
||||
|
||||
|
||||
var totSalayOT = 0;
|
||||
@ -786,21 +760,23 @@ console.log(alldata);
|
||||
} else {
|
||||
totSalayOT = 0;
|
||||
}
|
||||
console.log(totSalayOT);
|
||||
|
||||
|
||||
|
||||
|
||||
var currentDaySalary = daySalary * dayWorkPaid;
|
||||
console.log("11days salary" + currentDaySalary);
|
||||
|
||||
|
||||
var currentDayHra = dayHra * dayWorkPaid;
|
||||
console.log("11days hra" + currentDayHra);
|
||||
|
||||
|
||||
|
||||
|
||||
var current_loan_amt = 0;
|
||||
var autoLoan = parseFloat(monthDue);
|
||||
|
||||
var Balance_Amount = loanamt - paidamt;
|
||||
|
||||
if (autoLoan > Balance_Amount) {
|
||||
if (duedate <= finalpaydate) {
|
||||
current_loan_amt = Balance_Amount;
|
||||
@ -808,19 +784,19 @@ console.log(alldata);
|
||||
} else {
|
||||
current_loan_amt = autoLoan;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (parseFloat(Festival) == parseFloat(Festival)) {
|
||||
|
||||
var Festivals = parseFloat(Festival);
|
||||
//console.log("Festivals"+Festivals);
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (parseFloat(otherDet) == parseFloat(otherDet)) {
|
||||
|
||||
var otherDets = parseFloat(otherDet);
|
||||
//console.log("otherDets"+ otherDets);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -845,12 +821,9 @@ console.log(alldata);
|
||||
|
||||
|
||||
var empSalaryAdd = currentDaySalary + totSalayOT + currentDayHra + Festivals;
|
||||
console.log("empSalaryAdd " + empSalaryAdd);
|
||||
|
||||
var empSalarySub = current_loan_amt + esiAmount + pfAmount + otherDets;
|
||||
console.log("current_loan_amt " + current_loan_amt);
|
||||
console.log("esiAmount " + esiAmount);
|
||||
console.log("pfAmount " + pfAmount);
|
||||
console.log("otherDets " + otherDets);
|
||||
|
||||
|
||||
|
||||
var empMonthSalary = empSalaryAdd - empSalarySub
|
||||
@ -864,19 +837,16 @@ console.log(alldata);
|
||||
document.getElementById("empsal" + sno).innerHTML = cals;
|
||||
|
||||
|
||||
$.each(estTotal, function(i, value) {
|
||||
if (sno == i) {
|
||||
estTotal[i] = cals;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$.each(totalotherDet, function(i, value) {
|
||||
if (sno == i) {
|
||||
totalotherDet[i] = otherDet;
|
||||
}
|
||||
});
|
||||
|
||||
// $.each(estTotal, function(i, value) {
|
||||
// if (sno == i) {
|
||||
// estTotal[i] = cals;
|
||||
// }
|
||||
// });
|
||||
// $.each(totalotherDet, function(i, value) {
|
||||
// if (sno == i) {
|
||||
// totalotherDet[i] = otherDet;
|
||||
// }
|
||||
// });
|
||||
// $.each(totalmonthloan, function(i, value) {
|
||||
// if (sno == i) {
|
||||
// totalmonthloan[i] = loanRecd;
|
||||
@ -887,85 +857,47 @@ console.log(alldata);
|
||||
calculategrandtotal();
|
||||
|
||||
}
|
||||
var tempTotal = [];
|
||||
|
||||
function calculategrandtotal()
|
||||
{
|
||||
var AutoLoanDueIndex = 21;
|
||||
var AutoLoanDue = 0;
|
||||
$('#monthlylistings tbody tr').each(function() {
|
||||
var value = $(this).find('td').eq(AutoLoanDueIndex).text();
|
||||
AutoLoanDue += parseFloat(value) || 0;
|
||||
});
|
||||
$('#monthloan').text(AutoLoanDue);
|
||||
|
||||
function calculategrandtotal() {
|
||||
|
||||
|
||||
|
||||
var sum = 0;
|
||||
|
||||
for (var i = 0; i < tempTotal.length; i++) {
|
||||
sum += tempTotal[i] << 0;
|
||||
}
|
||||
|
||||
$('#inst').text(parseFloat(sum).toFixed(2));
|
||||
|
||||
$.each(totalotherDet, function(index, value) {
|
||||
//var res2 = value.split('-');
|
||||
tempTotal[index] = parseFloat(value);
|
||||
});
|
||||
|
||||
var sum = 0;
|
||||
|
||||
for (var i = 0; i < tempTotal.length; i++) {
|
||||
sum += tempTotal[i] << 0;
|
||||
}
|
||||
$('#other').text(parseFloat(sum).toFixed(2));
|
||||
|
||||
$.each(totalfestival, function(index, value) {
|
||||
//var res2 = value.split('-');
|
||||
tempTotal[index] = parseFloat(value);
|
||||
});
|
||||
|
||||
var sum = 0;
|
||||
|
||||
for (var i = 0; i < tempTotal.length; i++) {
|
||||
sum += tempTotal[i] << 0;
|
||||
}
|
||||
$('#fest').text(parseFloat(sum).toFixed(2));
|
||||
|
||||
|
||||
|
||||
$.each(estTotal, function(index, value) {
|
||||
//var res2 = value.split('-');
|
||||
tempTotal[index] = parseFloat(value);
|
||||
});
|
||||
|
||||
var sum = 0;
|
||||
|
||||
for (var i = 0; i < tempTotal.length; i++) {
|
||||
sum += tempTotal[i] << 0;
|
||||
}
|
||||
$('#estsal').text(parseFloat(sum).toFixed(2));
|
||||
|
||||
|
||||
|
||||
|
||||
$.each(totalmonthloan, function(index, value) {
|
||||
tempTotal[index] = parseFloat(value);
|
||||
});
|
||||
|
||||
var sum = 0;
|
||||
|
||||
for (var i = 0; i < tempTotal.length; i++) {
|
||||
sum += tempTotal[i] << 0;
|
||||
}
|
||||
$('#monthloan').text(parseFloat(sum).toFixed(2));
|
||||
var TDSDeductionsIndex = 22;
|
||||
var TDSDeductions = 0;
|
||||
$('#monthlylistings tbody tr').each(function() {
|
||||
var value = $(this).find('td').eq(TDSDeductionsIndex).text();
|
||||
TDSDeductions += parseFloat(value) || 0;
|
||||
});
|
||||
$('#other').text(TDSDeductions);
|
||||
|
||||
var FestivalBonusIndex = 23;
|
||||
var FestivalBonus = 0;
|
||||
$('#monthlylistings tbody tr').each(function() {
|
||||
var value = $(this).find('td').eq(FestivalBonusIndex).text();
|
||||
FestivalBonus += parseFloat(value) || 0;
|
||||
});
|
||||
$('#fest').text(FestivalBonus);
|
||||
|
||||
var EstimateIndex = 24;
|
||||
var Estimate = 0;
|
||||
$('#monthlylistings tbody tr').each(function() {
|
||||
var value = $(this).find('td').eq(EstimateIndex).text();
|
||||
Estimate += parseFloat(value) || 0;
|
||||
});
|
||||
$('#estsal').text(Estimate);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function show_hide_column(col_no, do_show) {
|
||||
var rows = document.getElementById('monthlylistings').rows;
|
||||
|
||||
for (var row = 0; row < rows.length; row++) {
|
||||
var cols = rows[row].cells;
|
||||
if (col_no >= 0 && col_no < cols.length) {
|
||||
cols[col_no].style.display = do_show ? '' : 'none';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
Loading…
Reference in New Issue
Block a user