GWM : loan master

This commit is contained in:
Smart 2024-09-24 16:30:58 +05:30
parent d416f74a83
commit 8550d370ce
3 changed files with 67 additions and 72 deletions

View File

@ -67,7 +67,7 @@ class Payslip extends BaseController
$PayOn = $this->request->getPost('payon');
$EmpId = $this->request->getPost('employee');
$res = $this->payroll_model->getMonthlyPayDetails($EmpId, $PayOn);
$result = $res[0];
@ -83,10 +83,13 @@ class Payslip extends BaseController
{
$loan_id = $result->Loan_ID;
if($result->Remaining_Due - 1 == 0){ $is_Active = 0; }else{ $is_Active = 1; }
$loan = [
'Paid_Due' => $result->Paid_Due + 1,
'Remaining_Due' => $result->Remaining_Due - 1,
'Paid_Amount' => $result->Paid_Amount + $result->Loan_Recovered,
'is_Active' => $is_Active
];
$loanHistory = [
@ -130,11 +133,16 @@ class Payslip extends BaseController
'ESINumber' => $result->ESINO,
'UANNO' => $result->PFNO,
];
// print_r($result);
// print_r($loan);
// print_r($loanHistory);
// print_r($data);
// die;
$insert = $this->payroll_model->insertPayroll($data);
if($insert){
if(count($loan)){
@ -703,7 +711,7 @@ class Payslip extends BaseController
$data['pf'] = $pf;
$data['over_time'] = $ot;
// dd($data);
$this->global['pageTitle'] = 'Payroll Monthly Inputs';
$this->loadViews("monthlypayinputs", $this->global, $data, NULL);
}

View File

@ -246,17 +246,30 @@ if (!empty($emppay)) {
<div class="form-group">
<div class="form-group">
<span for="Basic_Pay">Paid Amount</span>
<input type="text" class="form-control requried num" id="Paid_Amount" name="Paid_Amount" value="<?php echo $Paid_Amount; ?>" pattern="([0-9]{1,7}([.][0-9]{1,2})?)" title="Minimum 1 digit,Maximum 2 Digit" readonly>
<input type="text" class="form-control requried num" id="Paid_Amount" name="Paid_Amount" value="<?php echo $Paid_Amount; ?>" readonly>
</div>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<span for="">Paid Due</span>
<input type="text" class="form-control requried num" id="paid_due" name="paid_due" value="<?php echo $Paid_Due; ?>" readonly>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<span for="">Remaining Due</span>
<input type="text" class="form-control requried num" id="remaining_due" name="remaining_due" value="<?php echo $Remaining_Due; ?>" readonly>
</div>
</div>
</div>
<input type="hidden" id="remaining_due" name="remaining_due" value="<?php echo $Remaining_Due; ?>">
<input type="hidden" id="paid_due" name="paid_due" value="<?php echo $Paid_Due; ?>">
<!-- <input type="hidden" id="remaining_due" name="remaining_due" value="<?php echo $Remaining_Due; ?>">
<input type="hidden" id="paid_due" name="paid_due" value="<?php echo $Paid_Due; ?>"> -->
</div>
</div>
<div class="col-md-12 text-right">
<input type="button" class="btn btn-success" value="Delete" id="deleteemp" style="background-color:red ;color: white; margin-right: 15px;width: 80px;border:none;" />
<input type="button" class="btn btn-success" value="Delete" id="deleteemp" style="background-color:#ee4d4d;color:white;margin-right:15px;width:80px;border:none;" />
<input type="submit" onmouseover="finalCheck();" value="Submit" class="btn btn-success">
</div>
</div>
@ -308,27 +321,7 @@ if (!empty($emppay)) {
</div> <!-- content -->
<script>
function calculateBasic()
{
var Totalsalary = document.getElementById('Total_Salary').value;;
var HRA = document.getElementById('HRA_Rate').value;
if (HRA == '') {
alert("Please Enter HRA RATE..");
document.getElementById('HRA_Rate').focus();
} else if (Totalsalary == '') {
alert("Please Enter Total Salary..");
document.getElementById('Total_Salary').focus();
} else {
var temp = (Totalsalary * (HRA / 100));
var basic = Totalsalary - temp;
document.getElementById('Basic_Pay').value = basic;
document.getElementById('HRA_Amount').value = temp;
}
//alert(basic);
}
@ -351,14 +344,13 @@ if (!empty($emppay)) {
} else {
document.getElementById('no_of_due').value = Math.ceil(totaldue);
var noofdues = document.getElementById('no_of_due').value;
$('#remaining_due').val(noofdues);
$('#Paid_Amount').val("0.00");
$('#paid_due').val(0);
$('#remaining_due').val(noofdues - $('#paid_due').val());
// $('#Paid_Amount').val("0.00");
// $('#paid_due').val(0);
}
}
} //else if(loan == "" || loan == 0)
//alert(totaldue);
}
dateCalulation();
@ -366,7 +358,7 @@ if (!empty($emppay)) {
}
function dateCalulation() {
//alert('j');
var loanamount = document.getElementById('Loan_Amount').value;
if (loanamount == 0.00 || loanamount == "") {
$('#loan_issued_date').val("");
@ -377,17 +369,12 @@ if (!empty($emppay)) {
$('#Loan_Amount').val("0.00");
$('#paid_due').val(0);
$('#Paid_Amount').val("0.00");
}
}
function finalCheck() {
//alert("final check");
var loanamount = document.getElementById('Loan_Amount').value;
if (loanamount != "" && loanamount != 0.00) {
var idate = document.getElementById('loan_issued_date').value;
@ -413,9 +400,10 @@ if (!empty($emppay)) {
echo $emppay[0]->Loan_ID;
} ?>";
var i = confirm("Do You want to delete " + loanid + " from Loan Master?");
// alert(i);s
if (i) {
// $('#content').loader('show');
$('#loader').show();
$.ajax({
data: {
id: loanid
@ -426,7 +414,7 @@ if (!empty($emppay)) {
if (result) {
alert(result);
// $('#content').loader('hide');
$('#loader').hide();
window.location.href = "<?php echo base_url(); ?>emppayListings";
}

View File

@ -241,7 +241,7 @@
<?php echo $record->Designation; ?>
</td>
<td style="max-width:80px"><?php echo $record->NoofDays; ?></td>
<td style="max-width:80px;text-align:center;"><?php echo $record->NoofDays; ?></td>
<td id="dayWork<?php echo $index ?>"
<?php if (empty($record->Key)) {
@ -262,8 +262,8 @@
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->LOP_Days)) {
echo $record->LOP_Days;
} else {
@ -276,8 +276,8 @@
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->Paid_leave)) {
echo number_format($record->Paid_leave, 2, '.', '');
} else {
@ -290,8 +290,8 @@
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->OT_Hrs_Worked)) {
echo $record->OT_Hrs_Worked;
} else {
@ -299,45 +299,45 @@
} ?>
</td>
<td style="max-width:80px"><?php echo $record->TotalSalary; ?></td>
<td style="max-width:80px;text-align:right;"><?php echo $record->TotalSalary; ?></td>
<td style="max-width:80px">
<td style="max-width:80px;text-align:right;">
<?php $perDaySalary = $record->TotalSalary / $record->NoofDays;
echo number_format($perDaySalary, 2, '.', ''); ?>
</td>
<td style="max-width:80px">
<td style="max-width:80px;text-align:right;">
<?php $workedSalary = $perDaySalary * ($record->Days_worked + $record->sunday_count);
echo number_format($workedSalary, 2, '.', ''); ?>
</td>
<td style="max-width:80px">
<td style="max-width:80px;text-align:right;">
<?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;text-align:right;"><?php echo number_format($workedSalary, 2, '.', ''); ?></td>
<td style="max-width:80px">
<td style="max-width:80px;text-align:right;">
<?php $basicWorked = $workedSalary * 70 / 100;
echo number_format($basicWorked, 2, '.', ''); ?>
</td>
<td style="max-width:80px">
<td style="max-width:80px;text-align:right;">
<?php $hraWorked = $workedSalary * 30 / 100;
echo number_format($hraWorked, 2, '.', ''); ?>
</td>
<td style="max-width:80px">
<td style="max-width:80px;text-align:right;">
<?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="esiAmt<?php echo $index ?>" style="max-width:80px;text-align:right;"> <?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="pfAmt<?php echo $index ?>" style="max-width:80px;text-align:right;"> <?php echo $pf[$i]; ?> </td>
<td style="max-width:80px;text-align:right;"> <?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='true';"; } ?>
<?php if (!empty($record->Key)) { ?> title="Payslip Calculated"
@ -394,7 +394,7 @@
echo "contenteditable='false';";
} ?>
<?php if (!empty($record->Key)) { ?> title="Payslip Calculated"
style="text-align:right;color:blue;" <?php } ?>>
style="text-align:right;color:blue;" <?php }else{ ?>style="text-align:right;" <?php } ?>>
<?php if (!empty($record->Estimate)) {
echo $record->Estimate;
$estTotal[] = $record->Estimate;
@ -462,20 +462,19 @@
<tfoot>
<tr>
<th colspan="20"></th>
<th>Total</th>
<th id="monthloan">
<th id="monthloan" style="text-align:right;">
<?php echo isset($totalmonthloan) ? array_sum($totalmonthloan) : ''; ?>
</th>
<th id="other">
<?php echo isset($totalotherDet) ? array_sum($totalotherDet) : ''; ?></th>
<th id="fest">
<?php echo isset($totalfestival) ? array_sum($totalfestival) : ''; ?></th>
<th id="estsal"><?php echo isset($estTotal) ? array_sum($estTotal) : ''; ?></th>
<th id="other" style="text-align:right;">
<?php echo isset($totalotherDet) ? array_sum($totalotherDet) : ''; ?>
</th>
<th id="fest" style="text-align:right;">
<?php echo isset($totalfestival) ? array_sum($totalfestival) : ''; ?>
</th>
<th id="estsal" style="text-align:right;">
<?php echo isset($estTotal) ? array_sum($estTotal) : ''; ?>
</th>
</tr>
</tfoot>
</table>