Client changes : GWM

This commit is contained in:
Gowtham M 2024-12-20 08:21:18 +05:30
parent 2265da1f89
commit a33a830ebc
7 changed files with 412 additions and 260 deletions

View File

@ -1172,8 +1172,8 @@ class Payslip extends BaseController
$Data['PayDetails'] = $this->payroll_model->GetPayslipdata($Payon, $EmpID); $Data['PayDetails'] = $this->payroll_model->GetPayslipdata($Payon, $EmpID);
$totalsalary = $Data['PayDetails'][0]->LessAdvance; $totalsalary = $Data['PayDetails'][0]->TotalSalary;
$totalsalaryinwords = $this->convertNumber(round($totalsalary)); $totalsalaryinwords = $this->convertNumberToWords(round($totalsalary));
$Data['amtinwords'] = $totalsalaryinwords; $Data['amtinwords'] = $totalsalaryinwords;
@ -1190,11 +1190,12 @@ class Payslip extends BaseController
$fname = $Data['PayDetails'][0]->FName; $fname = $Data['PayDetails'][0]->FName;
$filename = 'PayslipFor-' . $EmpID . ' ' . $fname . ' ' . $m . ' ' . $y; $filename = 'PayslipFor-' . $EmpID . ' ' . $fname . ' ' . $m . ' ' . $y;
$totalsalary = $Data['PayDetails'][0]->LessAdvance; $totalsalary = $Data['PayDetails'][0]->TotalSalary;
$totalsalaryinwords = $this->convertNumber(round($totalsalary)); $totalsalaryinwords = $this->convertNumberToWords(round($totalsalary));
$Data['amtinwords'] = $totalsalaryinwords; $Data['amtinwords'] = $totalsalaryinwords;
// print_r ($Data); // print_r ($Data);
// exit(); // exit();
// echo view("payslipgenerateprint", $Data);die;
$html = view("payslipgenerateprint", $Data); $html = view("payslipgenerateprint", $Data);
} }
@ -1222,6 +1223,94 @@ class Payslip extends BaseController
} }
function convertNumberToWords($number) {
$numberWords = [
0 => "Zero",
1 => "One",
2 => "Two",
3 => "Three",
4 => "Four",
5 => "Five",
6 => "Six",
7 => "Seven",
8 => "Eight",
9 => "Nine",
10 => "Ten",
11 => "Eleven",
12 => "Twelve",
13 => "Thirteen",
14 => "Fourteen",
15 => "Fifteen",
16 => "Sixteen",
17 => "Seventeen",
18 => "Eighteen",
19 => "Nineteen",
20 => "Twenty",
30 => "Thirty",
40 => "Forty",
50 => "Fifty",
60 => "Sixty",
70 => "Seventy",
80 => "Eighty",
90 => "Ninety"
];
if ($number == 0) {
return $numberWords[0];
}
$word = '';
if ($number >= 10000000) {
$crore = floor($number / 10000000);
if ($crore > 0) {
$word .= $this->convertNumberToWords($crore) . " Crore ";
}
$number %= 10000000;
}
if ($number >= 100000) {
$lakh = floor($number / 100000);
if ($lakh > 0) {
$word .= $this->convertNumberToWords($lakh) . " Lakh ";
}
$number %= 100000;
}
if ($number >= 1000) {
$thousand = floor($number / 1000);
if ($thousand > 0) {
$word .= $this->convertNumberToWords($thousand) . " Thousand ";
}
$number %= 1000;
}
if ($number >= 100) {
$hundred = floor($number / 100);
if ($hundred > 0) {
$word .= $this->convertNumberToWords($hundred) . " Hundred ";
}
$number %= 100;
}
if ($number > 0) {
if ($word !== '') {
$word .= "and ";
}
if ($number <= 20) {
$word .= $numberWords[$number];
} else {
$word .= $numberWords[floor($number / 10) * 10];
if ($number % 10 > 0) {
$word .= " " . $numberWords[$number % 10];
}
}
}
return trim($word);
}
function updatePayslip() function updatePayslip()
{ {

View File

@ -1,28 +1,5 @@
<script>
$(document).ready(function() {
$("#loan_issued_date").datepicker({
minDate: 'now',
orientation: 'bottom',
// maxDate : 'now',
dateFormat: 'dd-mm-yy',
changeMonth: true,
changeYear: true,
yearRange: '-100:+0'
});
$("#due_started").datepicker({
minDate: 'now',
//maxDate : 'now',
dateFormat: 'dd-mm-yy',
changeMonth: true,
changeYear: true,
yearRange: '-100:+1'
});
});
</script>
<style type="text/css"> <style type="text/css">
.num { .num {
text-align: right; text-align: right;
@ -44,7 +21,7 @@
</div> </div>
<!-- end page title --> <!-- end page title -->
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
@ -57,6 +34,7 @@
<!-- Supplier Information --> <!-- Supplier Information -->
<div class="col-md-12" style="margin-bottom: 27px;"> <div class="col-md-12" style="margin-bottom: 27px;">
<div class="row"> <div class="row">
<div class="col-md-3"> <div class="col-md-3">
<div class="form-group"> <div class="form-group">
<span for="EmpID">Employee ID</span> <span for="EmpID">Employee ID</span>
@ -80,6 +58,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
<div class="form-group"> <div class="form-group">
<div class="form-group"> <div class="form-group">
@ -90,46 +69,62 @@
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-3">
<div class="form-group">
<div class="form-group">
<span for="EmpID">Loan Issue(d) Date</span>
<input type="text" class="form-control num" id="loan_issued_date"
name="loan_issued_date" value="" onchange="dateCalulation();">
</div>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<div class="form-group">
<span for="Basic_Pay">Monthly Due</span>
<input type="text" value="0.00" class="form-control num" id="monthly_due"
name="monthly_due" value="" pattern="([0-9]{1,7}([.][0-9]{1,2})?)"
title="Minimum 1 digit,Maximum 6 Digit" onchange="duecalculation();">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-3">
<div class="form-group">
<div class="form-group">
<span for="Basic_Pay">Due Started</span>
<input type="text" class="form-control requried num" id="due_started"
name="due_started" value="" onchange="dateCalulation();">
</div>
</div>
</div>
<div class="col-md-3"> <div class="col-md-3">
<div class="form-group"> <div class="form-group">
<div class="form-group"> <div class="form-group">
<span for="Basic_Pay">No Of Due(s)</span> <span for="Basic_Pay">No Of Due(s)</span>
<input type="text" value="0" class="form-control requried num" <input type="text" value="0" class="form-control requried num"
id="no_of_due" name="no_of_due" value="" pattern="[0-9]{1,2}" id="no_of_due" name="no_of_due" value="" pattern="[0-9]{1,2}"
title="Minimum 1 digit,Maximum 2 Digit" readonly> title="Minimum 1 digit,Maximum 2 Digit" onchange="duecalculation();">
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-3">
<div class="form-group">
<div class="form-group">
<span for="Basic_Pay">Monthly Due</span>
<input type="text" value="0.00" class="form-control num" id="monthly_due"
name="monthly_due" value="" pattern="([0-9]{1,7}([.][0-9]{1,2})?)"
title="Minimum 1 digit,Maximum 6 Digit" >
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-3">
<div class="form-group">
<div class="form-group">
<span for="EmpID">Loan Issue(d) Date</span>
<input
type="text"
name="loan_issued_date"
id="loan_issued_date"
class="form-control mt-2"
data-provide="datepicker"
data-date-format="M-yyyy"
data-date-min-view-mode="1"
value=""
/>
</div>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<div class="form-group">
<span for="Basic_Pay">Due Started</span>
<input type="date" class="form-control requried num" id="due_started"
name="due_started" value="" >
</div>
</div>
</div>
<div class="col-md-3"> <div class="col-md-3">
<div class="form-group"> <div class="form-group">
<div class="form-group"> <div class="form-group">
@ -192,7 +187,7 @@
<!-- end row --> <!-- end row -->
</div> </div>
</div> <!-- end card --> </div> <!-- end card -->
</div><!-- end col --> </div><!-- end col -->
</div> </div>
<!-- end row --> <!-- end row -->
</div> <!-- container --> </div> <!-- container -->
@ -202,55 +197,53 @@
<!--content-wrapper closed--> <!--content-wrapper closed-->
<script src="<?php echo base_url(); ?>public/assets/js/addUser.js" type="text/javascript"></script> <script src="<?php echo base_url(); ?>public/assets/js/addUser.js" type="text/javascript"></script>
<script> <script>
function calculalteHRA() {
//var empid=document.getElementById('emp').value;
//alert(empid);
var Totalsalary = document.getElementById('Total_salary').value;
var HRA = document.getElementById('HRA_Rate').value;
//if(EmpID == -1){alert("Select Employee ID..!");}
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;
}
}
$(document).ready(function() {
// $('#loan_issued_date').datepicker({
// format: "M-yyyy",
// minViewMode: 1,
// autoclose: true, // Ensures the datepicker closes after selection
// }).on('changeDate', function (e) {
// $(this).val(e.format('M-yyyy')); // Explicitly set the value to the input field
// });
$("#due_started").datepicker({
minDate: 'now',
//maxDate : 'now',
dateFormat: 'dd-mm-yy',
changeMonth: true,
changeYear: true,
yearRange: '-100:+1'
});
});
function duecalculation() { function duecalculation() {
var totaldue = 0; var totaldue = 0;
var loan = document.getElementById('Loan_Amount').value; var loan = document.getElementById('Loan_Amount').value;
var due = document.getElementById('monthly_due').value; var no_of_due = document.getElementById('no_of_due').value;
$('#remaining_due').val(no_of_due);
if (loan != 0) { if (loan != 0) {
if (due == 0) { if (no_of_due == 0) {
alert("Enter Monthly Due Amount....!"); alert("Enter No Of Due");
$('#monthly_due').focus(); $('#no_of_due').focus();
} else { } else {
totaldue = loan / due;
if (totaldue < 1) { totalDueAmt = loan / no_of_due;
alert("Please Enter Correct Due Amount..!");
$('#monthly_due').focus(); document.getElementById('monthly_due').value = Math.ceil(totalDueAmt);
} else {
document.getElementById('no_of_due').value = Math.ceil(totaldue);
var noofdues = document.getElementById('no_of_due').value;
$('#remaining_due').val(noofdues);
}
} }
} //else if(loan == "" || loan == 0) }
//alert(totaldue);
dateCalulation(); dateCalulation();

View File

@ -143,6 +143,9 @@ $currentday = date('d');
border: 1px solid #ccc; border: 1px solid #ccc;
padding: 2px 4px; padding: 2px 4px;
} }
.summary{
background-color: bisque;
}
/*style excel*/ /*style excel*/
.excel_cell { .excel_cell {
@ -371,7 +374,7 @@ $currentday = date('d');
</td> </td>
<td width="79" height="45" class="celda_normal"><?php echo $a->EmpID; ?> <td width="79" height="45" class="celda_normal"><?php echo $a->EmpID; ?>
</td> </td>
<td width="80" height="45" class="celda_normal"> <td width="80" height="45" class="celda_normal" style="text-align: left;">
<?php echo $a->FirstName; ?></td> <?php echo $a->FirstName; ?></td>
<?php for ($col = 1; $col <= $monthdays; $col++) { <?php for ($col = 1; $col <= $monthdays; $col++) {
@ -442,42 +445,42 @@ $currentday = date('d');
$flag2 = 0; $flag2 = 0;
$todayflag = 0; $todayflag = 0;
} ?> } ?>
<td class="celda_normal" id="<?php echo $row . 'TH'; ?>"> <td class="celda_normal summary" id="<?php echo $row . 'TH'; ?>">
<?php if (!empty($a->Total_WHrs)) { <?php if (!empty($a->Total_WHrs)) {
echo $a->Total_WHrs; echo $a->Total_WHrs;
} else { } else {
echo "0.00"; echo "0.00";
} ?> } ?>
</td> </td>
<td class="celda_normal" id="<?php echo $row . 'OTH'; ?>"> <td class="celda_normal summary" id="<?php echo $row . 'OTH'; ?>">
<?php if (!empty($a->Total_OTHrs)) { <?php if (!empty($a->Total_OTHrs)) {
echo $a->Total_OTHrs; echo $a->Total_OTHrs;
} else { } else {
echo "0.00"; echo "0.00";
} ?> } ?>
</td> </td>
<td class="celda_normal" id="<?php echo $row . 'PL'; ?>"> <td class="celda_normal summary" id="<?php echo $row . 'PL'; ?>">
<?php if (!empty($a->Paid_Leave)) { <?php if (!empty($a->Paid_Leave)) {
echo number_format($a->Paid_Leave, 2, '.', '.'); echo number_format($a->Paid_Leave, 2, '.', '.');
} else { } else {
echo "0.00"; echo "0.00";
} ?> } ?>
</td> </td>
<td class="celda_normal" id="<?php echo $row . 'DW'; ?>"> <td class="celda_normal summary" id="<?php echo $row . 'DW'; ?>">
<?php if (!empty($a->Days_Worked)) { <?php if (!empty($a->Days_Worked)) {
echo $a->Days_Worked; echo $a->Days_Worked;
} else { } else {
echo "0.00"; echo "0.00";
} ?> } ?>
</td> </td>
<td class="celda_normal" id="<?php echo $row . 'AB'; ?>"> <td class="celda_normal summary" id="<?php echo $row . 'AB'; ?>">
<?php if (!empty($a->Absent)) { <?php if (!empty($a->Absent)) {
echo $a->Absent; echo $a->Absent;
} else { } else {
echo "0.00"; echo "0.00";
} ?> } ?>
</td> </td>
<td class="celda_normal" id="<?php echo $row . 'TS'; ?>"> <td class="celda_normal summary" id="<?php echo $row . 'TS'; ?>">
<?php if (!empty($noofsundays)) { <?php if (!empty($noofsundays)) {
echo $noofsundays; echo $noofsundays;
} else { } else {

View File

@ -210,6 +210,27 @@ if (!empty($emppay)) {
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-3">
<div class="form-group">
<div class="form-group">
<span for="Basic_Pay">No Of Due(s)</span>
<input type="text" class="form-control requried num" id="no_of_due" name="no_of_due" value="<?php echo $No_of_dues; ?>" pattern="[0-9]{1,2}" title="Minimum 1 digit,Maximum 2 Digit" onchange="duecalculation();">
</div>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<div class="form-group">
<span for="Basic_Pay">Monthly Due</span>
<input type="text" class="form-control requried num" id="monthly_due" name="monthly_due" value="<?php echo $Monthly_due; ?>" pattern="([0-9]{1,7}([.][0-9]{1,2})?)" title="Minimum 4 digit,Maximum 6 Digit" readonly>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-3"> <div class="col-md-3">
<div class="form-group"> <div class="form-group">
<div class="form-group"> <div class="form-group">
@ -218,16 +239,7 @@ if (!empty($emppay)) {
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-3">
<div class="form-group">
<div class="form-group">
<span for="Basic_Pay">Monthly Due</span>
<input type="text" class="form-control requried num" id="monthly_due" name="monthly_due" value="<?php echo $Monthly_due; ?>" pattern="([0-9]{1,7}([.][0-9]{1,2})?)" title="Minimum 4 digit,Maximum 6 Digit" onchange="duecalculation();">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-3"> <div class="col-md-3">
<div class="form-group"> <div class="form-group">
<div class="form-group"> <div class="form-group">
@ -236,14 +248,7 @@ if (!empty($emppay)) {
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-3">
<div class="form-group">
<div class="form-group">
<span for="Basic_Pay">No Of Due(s)</span>
<input type="text" class="form-control requried num" id="no_of_due" name="no_of_due" value="<?php echo $No_of_dues; ?>" pattern="[0-9]{1,2}" title="Minimum 1 digit,Maximum 2 Digit" readonly>
</div>
</div>
</div>
<div class="col-md-3"> <div class="col-md-3">
<div class="form-group"> <div class="form-group">
<div class="form-group"> <div class="form-group">
@ -326,29 +331,64 @@ if (!empty($emppay)) {
// function duecalculation() {
// var totaldue = 0;
// var loan = document.getElementById('Loan_Amount').value;
// var due = document.getElementById('monthly_due').value;
// if (loan != 0) {
// if (due == 0) {
// alert("Enter Monthly Due Amount....!");
// $('#monthly_due').focus();
// } else {
// totaldue = loan / due;
// if (totaldue < 1) {
// alert("Please Enter Correct Due Amount..!");
// $('#monthly_due').focus();
// } else {
// document.getElementById('no_of_due').value = Math.ceil(totaldue);
// var noofdues = document.getElementById('no_of_due').value;
// $('#remaining_due').val(noofdues - $('#paid_due').val());
// // $('#Paid_Amount').val("0.00");
// // $('#paid_due').val(0);
// }
// }
// }
// dateCalulation();
// }
function duecalculation() { function duecalculation() {
var totaldue = 0; var totaldue = 0;
var loan = document.getElementById('Loan_Amount').value; var loan = document.getElementById('Loan_Amount').value;
var due = document.getElementById('monthly_due').value; var no_of_due = document.getElementById('no_of_due').value;
if (loan != 0) { if (loan != 0) {
if (due == 0) { if (no_of_due == 0) {
alert("Enter Monthly Due Amount....!"); alert("Enter No Of Due");
$('#monthly_due').focus(); $('#no_of_due').focus();
} else { } else {
totaldue = loan / due;
if (totaldue < 1) { paid_due = document.getElementById('paid_due').value;
alert("Please Enter Correct Due Amount..!"); no_of_due = no_of_due - paid_due;
$('#monthly_due').focus();
} else { Paid_Amount = document.getElementById('Paid_Amount').value;
document.getElementById('no_of_due').value = Math.ceil(totaldue); loan = loan - Paid_Amount
var noofdues = document.getElementById('no_of_due').value; totalDueAmt = loan / no_of_due;
$('#remaining_due').val(noofdues - $('#paid_due').val());
// $('#Paid_Amount').val("0.00");
// $('#paid_due').val(0); document.getElementById('monthly_due').value = Math.ceil(totalDueAmt);
}
document.getElementById('remaining_due').value = Math.ceil(no_of_due);
} }
} }
@ -426,5 +466,3 @@ if (!empty($emppay)) {
}); });
</script> </script>
<script>
</script>

View File

@ -723,7 +723,7 @@
View Inward Gate Register</a> View Inward Gate Register</a>
</div> </div>
<?php if(session()->get('roleText') == 'System Administrator' || session()->get('roleText') == 'Security'){?> <?php if(session()->get('roleText') == 'System Administrator' || session()->get('roleText') == 'Security' || session()->get('roleText') == 'Auditor'){?>
<div class=""> <div class="">
<a href="<?php echo base_url(); ?>ListIGR" class="dropdown-item"><i class="ri-file-list-3-line align-middle mr-1"></i> <a href="<?php echo base_url(); ?>ListIGR" class="dropdown-item"><i class="ri-file-list-3-line align-middle mr-1"></i>
Non IGR / Expense</a> Non IGR / Expense</a>

View File

@ -8,6 +8,31 @@
padding: 2px 4px; padding: 2px 4px;
text-align: center; text-align: center;
} }
.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;
}
</style> </style>
<?php <?php
@ -177,7 +202,7 @@
</div> </div>
<div style="overflow-x:scroll;"> <div style="overflow-x:scroll;">
<table id="monthlylistings" class="table table-bordered table-hover" <table id="monthlylistings" class="table table-bordered table-hover fht-table"
style="background-color:#fff;font-size:12px;white-space: nowrap;"> style="background-color:#fff;font-size:12px;white-space: nowrap;">
<thead style="background-color: #ddd;"> <thead style="background-color: #ddd;">
<tr> <tr>

File diff suppressed because one or more lines are too long