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);
$totalsalary = $Data['PayDetails'][0]->LessAdvance;
$totalsalaryinwords = $this->convertNumber(round($totalsalary));
$totalsalary = $Data['PayDetails'][0]->TotalSalary;
$totalsalaryinwords = $this->convertNumberToWords(round($totalsalary));
$Data['amtinwords'] = $totalsalaryinwords;
@ -1190,11 +1190,12 @@ class Payslip extends BaseController
$fname = $Data['PayDetails'][0]->FName;
$filename = 'PayslipFor-' . $EmpID . ' ' . $fname . ' ' . $m . ' ' . $y;
$totalsalary = $Data['PayDetails'][0]->LessAdvance;
$totalsalaryinwords = $this->convertNumber(round($totalsalary));
$totalsalary = $Data['PayDetails'][0]->TotalSalary;
$totalsalaryinwords = $this->convertNumberToWords(round($totalsalary));
$Data['amtinwords'] = $totalsalaryinwords;
// print_r ($Data);
// exit();
// echo view("payslipgenerateprint", $Data);die;
$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()
{

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">
.num {
text-align: right;
@ -44,155 +21,173 @@
</div>
<!-- end page title -->
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-body">
<h4 class="header-title">Loan Details</h4>
<div class="row">
<div class="col-12">
<div class="p-2">
<form role="form" id="addemppaydate" action="<?php echo base_url() ?>emppaydate/addNewemppay" method="post" name="addform">
<div class="box-body">
<!-- Supplier Information -->
<div class="col-md-12" style="margin-bottom: 27px;">
<div class="row">
<div class="col-md-3">
<div class="form-group">
<span for="EmpID">Employee ID</span>
<font color="Red">*</font>
<div class="form-group">
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-body">
<h4 class="header-title">Loan Details</h4>
<div class="row">
<div class="col-12">
<div class="p-2">
<form role="form" id="addemppaydate" action="<?php echo base_url() ?>emppaydate/addNewemppay" method="post" name="addform">
<div class="box-body">
<!-- Supplier Information -->
<div class="col-md-12" style="margin-bottom: 27px;">
<div class="row">
<?php
$Employee = array("-1" => 'Select Employee');
<div class="col-md-3">
<div class="form-group">
<span for="EmpID">Employee ID</span>
<font color="Red">*</font>
<div class="form-group">
if (!empty($empdetails)) {
foreach ($empdetails as $emp) {
$EmpID = $emp->EmpID;
$Employee += array($EmpID => $emp->EmpID . "-" . $emp->FirstName);
}
}
<?php
$Employee = array("-1" => 'Select Employee');
$js = array('id' => 'emp');
echo form_dropdown('EmpID', $Employee, set_value('EmpID'), 'class="form-control"', $js);
if (!empty($empdetails)) {
foreach ($empdetails as $emp) {
$EmpID = $emp->EmpID;
$Employee += array($EmpID => $emp->EmpID . "-" . $emp->FirstName);
}
}
?>
</div>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<div class="form-group">
<span for="Pay_Data_ID">Loan Amount</span>
<input type="text" class="form-control num" id="Loan_Amount"
name="Loan_Amount" value="0.00" pattern="([0-9]{1,7}([.][0-9]{1,2})?)"
title="Minimum 4 digit,Maximum 6 Digit" onchange="duecalculation();">
</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>
$js = array('id' => 'emp');
echo form_dropdown('EmpID', $Employee, set_value('EmpID'), 'class="form-control"', $js);
?>
</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="form-group">
<div class="form-group">
<span for="Basic_Pay">No Of Due(s)</span>
<input type="text" value="0" class="form-control requried num"
id="no_of_due" name="no_of_due" value="" pattern="[0-9]{1,2}"
title="Minimum 1 digit,Maximum 2 Digit" readonly>
</div>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<div class="form-group">
<span for="Basic_Pay">Paid Amount</span>
<input type="text" value="0.00" class="form-control requried num"
id="Paid_Amount" name="Paid_Amount" value="0"
pattern="([0-9]{1,7}([.][0-9]{1,2})?)"
title="Minimum 1 digit,Maximum 2 Digit" readonly>
</div>
</div>
</div>
</div>
<input type="hidden" id="remaining_due" name="remaining_due" value="0">
<input type="hidden" id="paid_due" name="paid_due" value="0">
</div>
</div>
<div class="col-md-12 text-right">
<input type="reset" id="reset" class="btn btn-reset" style="background-color: red;color: white; margin-right: 15px;width: 80px;" value="Reset" />
<input type="submit" onmouseover="finalCheck();" value="Submit" class="btn btn-success">
</div>
</div>
</form>
</div>
</div>
<?php
$listErrors = session()->getFlashdata('listErrors');
if ($listErrors) {
?>
<div class="row">
<div class="col-md-12">
<div class="alert alert-danger alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<?php echo session()->getFlashdata('listErrors'); ?>
</div>
</div>
</div>
<?php } ?>
<div class="col-md-3">
<div class="form-group">
<div class="form-group">
<span for="Pay_Data_ID">Loan Amount</span>
<input type="text" class="form-control num" id="Loan_Amount"
name="Loan_Amount" value="0.00" pattern="([0-9]{1,7}([.][0-9]{1,2})?)"
title="Minimum 4 digit,Maximum 6 Digit" onchange="duecalculation();">
</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" value="0" class="form-control requried num"
id="no_of_due" name="no_of_due" value="" 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" 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="form-group">
<div class="form-group">
<span for="Basic_Pay">Paid Amount</span>
<input type="text" value="0.00" class="form-control requried num"
id="Paid_Amount" name="Paid_Amount" value="0"
pattern="([0-9]{1,7}([.][0-9]{1,2})?)"
title="Minimum 1 digit,Maximum 2 Digit" readonly>
</div>
</div>
</div>
</div>
<input type="hidden" id="remaining_due" name="remaining_due" value="0">
<input type="hidden" id="paid_due" name="paid_due" value="0">
</div>
</div>
<div class="col-md-12 text-right">
<input type="reset" id="reset" class="btn btn-reset" style="background-color: red;color: white; margin-right: 15px;width: 80px;" value="Reset" />
<input type="submit" onmouseover="finalCheck();" value="Submit" class="btn btn-success">
</div>
</div>
<?php
helper('form');
$error = session()->getFlashdata('error');
if ($error) {
?>
</form>
</div>
</div>
<?php
$listErrors = session()->getFlashdata('listErrors');
if ($listErrors) {
?>
<div class="row">
<div class="col-md-12">
<div class="alert alert-danger alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<?php echo session()->getFlashdata('error'); ?>
<?php echo session()->getFlashdata('listErrors'); ?>
</div>
<?php } ?>
<?php
$success = session()->getFlashdata('success');
if ($success) {
?>
<div class="alert alert-success alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<?php echo session()->getFlashdata('success'); ?>
</div>
<?php } ?>
<!-- end row -->
</div>
</div>
</div> <!-- end card -->
</div><!-- end col -->
<?php } ?>
</div>
<?php
helper('form');
$error = session()->getFlashdata('error');
if ($error) {
?>
<div class="alert alert-danger alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<?php echo session()->getFlashdata('error'); ?>
</div>
<?php } ?>
<?php
$success = session()->getFlashdata('success');
if ($success) {
?>
<div class="alert alert-success alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<?php echo session()->getFlashdata('success'); ?>
</div>
<?php } ?>
<!-- end row -->
</div>
</div> <!-- end card -->
</div><!-- end col -->
</div>
<!-- end row -->
</div> <!-- container -->
@ -202,55 +197,53 @@
<!--content-wrapper closed-->
<script src="<?php echo base_url(); ?>public/assets/js/addUser.js" type="text/javascript"></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() {
var totaldue = 0;
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 (due == 0) {
alert("Enter Monthly Due Amount....!");
$('#monthly_due').focus();
if (no_of_due == 0) {
alert("Enter No Of Due");
$('#no_of_due').focus();
} else {
totaldue = loan / due;
totalDueAmt = loan / no_of_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);
}
document.getElementById('monthly_due').value = Math.ceil(totalDueAmt);
}
} //else if(loan == "" || loan == 0)
//alert(totaldue);
}
dateCalulation();

View File

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

View File

@ -210,6 +210,27 @@ if (!empty($emppay)) {
</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="form-group">
<div class="form-group">
@ -218,16 +239,7 @@ if (!empty($emppay)) {
</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="form-group">
<div class="form-group">
@ -236,14 +248,7 @@ if (!empty($emppay)) {
</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="form-group">
<div class="form-group">
@ -326,33 +331,68 @@ 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() {
var totaldue = 0;
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 (due == 0) {
alert("Enter Monthly Due Amount....!");
$('#monthly_due').focus();
if (no_of_due == 0) {
alert("Enter No Of Due");
$('#no_of_due').focus();
} else {
totaldue = loan / due;
paid_due = document.getElementById('paid_due').value;
no_of_due = no_of_due - paid_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);
}
Paid_Amount = document.getElementById('Paid_Amount').value;
loan = loan - Paid_Amount
totalDueAmt = loan / no_of_due;
document.getElementById('monthly_due').value = Math.ceil(totalDueAmt);
document.getElementById('remaining_due').value = Math.ceil(no_of_due);
}
}
}
dateCalulation();
@ -426,5 +466,3 @@ if (!empty($emppay)) {
});
</script>
<script>
</script>

View File

@ -723,7 +723,7 @@
View Inward Gate Register</a>
</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="">
<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>

View File

@ -8,6 +8,31 @@
padding: 2px 4px;
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>
<?php
@ -177,7 +202,7 @@
</div>
<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;">
<thead style="background-color: #ddd;">
<tr>

File diff suppressed because one or more lines are too long