date joining issues in payroll and attendances

This commit is contained in:
venbatechnologies@gmail.com 2018-01-09 20:41:01 +05:30
parent 0b78006b1b
commit 7bd9b639ad
8 changed files with 160 additions and 47 deletions

View File

@ -688,10 +688,27 @@ function phpAlert($msg) {
function payslipLisiting()
{
$curr_year = date('Y');
$curr_month =date('m');
$curr_monthyear = $curr_month.'-'.$curr_year;
$this->global['pageTitle'] = 'Siddharth : Payslip Listing';
$data['PayInfo'] = $this->payroll_model->GetPayslipdata();
$data['dropdownvalue'] = $curr_monthyear;
$this->loadViews("paysliplist", $this->global, $data , NULL);
}
function reload_paysliplist()
{
$pre_monthyear = $this->input->post('month');
$this->global['pageTitle'] = 'Siddharth : Payslip Listing';
$data['PayInfo'] = $this->payroll_model->GetPayslipdata($pre_monthyear);
$data['dropdownvalue'] = $pre_monthyear;
$this->loadViews("paysliplist", $this->global, $data , NULL);
}
function editPayslip($EmpID,$PayOn)
{

View File

@ -199,12 +199,13 @@ class supplier extends BaseController
{
$pan = $this->input->post('panno');
$gst = $this->input->post('GSTNo');
$this->form_validation->set_rules('SupplierName','Supplier Name','trim|required');
$this->form_validation->set_rules('Address','Address','trim|required|');
$this->form_validation->set_rules('ContactNumber','Contact Number','trim|required|max_length[13]');
$this->form_validation->set_rules('AlternateContactNumber','Alternate Contact Number','trim|max_length[13]');
$this->form_validation->set_rules('emailid','emailid', 'valid_email|max_length[128]|required');
$this->form_validation->set_rules('TIN','TIN','trim|required|max_length[11]');
$this->form_validation->set_rules('TIN','TIN','trim|max_length[11]');
if($pan=='')
{
$this->form_validation->set_rules('panno', 'panno', 'trim|max_length[10]');
@ -213,7 +214,14 @@ class supplier extends BaseController
{
$this->form_validation->set_rules('panno', 'panno', 'trim|max_length[10]|callback_checkPanValidate');
}
$this->form_validation->set_rules('GSTNo','GSTNo','trim|requried|max_length[15]|callback_checkGstValidate');
if($gst=='')
{
$this->form_validation->set_rules('GSTNo','GSTNo','trim|max_length[15]');
}
else
{
$this->form_validation->set_rules('GSTNo','GSTNo','trim|max_length[15]|callback_checkGstValidate');
}
if($this->form_validation->run() == FALSE)
{
@ -318,7 +326,8 @@ class supplier extends BaseController
* This function is used to edit the Supplier information
*/
function editsupplier()
{ $pan = $this->input->post('panno');
{ $pan = $this->input->post('panno');
$gst = $this->input->post('GSTNo');
$this->form_validation->set_rules('SupplierName','Supplier Name','trim|required');
$this->form_validation->set_rules('Address','Address','trim|required|');
$supplierID = $this->input->post('SupplierID');
@ -326,7 +335,7 @@ class supplier extends BaseController
$this->form_validation->set_rules('ContactNumber','Contact Number','trim|required|max_length[13]');
$this->form_validation->set_rules('AlternateContactNumber','Alternate Contact Number','trim|max_length[13]');
$this->form_validation->set_rules('emailid','emailid','valid_email|max_length[128]|required');
$this->form_validation->set_rules('TIN','TIN','trim|required|max_length[11]');
$this->form_validation->set_rules('TIN','TIN','trim|max_length[11]');
if($pan=='')
{
$this->form_validation->set_rules('panno', 'panno', 'trim|max_length[10]');
@ -336,7 +345,14 @@ class supplier extends BaseController
$this->form_validation->set_rules('panno', 'panno', 'trim|max_length[10]|callback_checkPanValidateSupplier');
}
$this->form_validation->set_rules('GSTNo','GSTNo','trim|requried|max_length[15]|callback_checkGstValidateSupplier');
if($gst=='')
{
$this->form_validation->set_rules('GSTNo','GSTNo','trim|max_length[15]');
}
else
{
$this->form_validation->set_rules('GSTNo','GSTNo','trim|max_length[15]|callback_checkGstValidateSupplier');
}

View File

@ -31,15 +31,34 @@ class monthlypay_model extends CI_Model
function getEmpPayDetails($current="",$s="")
{
$this->db->select('T_Employee_Details.EmpID,T_Employee_Details.FirstName,T_Employee_Details.LastName,T_Employee_Details.DateofJoining');
$this->db->from('T_Employee_Details');
//$this->db->join('T_Emp_Pay_Data','T_Emp_Pay_Data.EmpID=T_Employee_Details.EmpID','Left');
$this->db->where('T_Employee_Details.IsActive',1);
$this->db->order_by('EmpID','asc');
$query = $this->db->get();
// $this->db->select('T_Employee_Details.EmpID,T_Employee_Details.FirstName,T_Employee_Details.LastName,T_Employee_Details.DateofJoining');
// $this->db->from('T_Employee_Details');
// //$this->db->join('T_Emp_Pay_Data','T_Emp_Pay_Data.EmpID=T_Employee_Details.EmpID','Left');
// $this->db->where('T_Employee_Details.IsActive',1);
// $this->db->order_by('EmpID','asc');
// $query = $this->db->get();
// $result = $query->result();
// return $result;
$month_val = date('m',strtotime($current));
$year_val = date('Y',strtotime($current));
$date_val =cal_days_in_month(CAL_GREGORIAN,$month_val,$year_val);
//$monthyear_val = date('Y-m',strtotime($current));
$lastdate = $year_val.'-'.$month_val.'-'.$date_val;
$sql = "select Emp.EmpID, Emp.FirstName,Emp.LastName,Emp.DateofJoining,Emp.IsActive
from T_Employee_Details as Emp
where Emp.DateofJoining <= ?
and Emp.IsActive = 1
order by Emp.EmpID
asc ";
$query = $this->db->query($sql,array($lastdate));
$result = $query->result();
return $result;
}
function getEmpPayDetailsforMonthInputs($current="")
@ -54,11 +73,11 @@ class monthlypay_model extends CI_Model
left join T_Payroll on T_Employee_Details.EmpID = T_Payroll.EmpID
left join T_Attendance on T_Emp_Pay_Data.EmpID = T_Attendance.EmpID
left join T_Loan_Master on T_Emp_Pay_Data.EmpID = T_Loan_Master.EmpID and T_Loan_Master.is_Active = 1
where T_Employee_Details.DateofJoining <= CURRENT_DATE
where month(T_Employee_Details.DateofJoining) <= month(?) and year(T_Employee_Details.DateofJoining) <= year(?)
and month(T_Attendance.Month_Year) = month(?)
order by T_Employee_Details.EmpID";
$query = $this->db->query($sql,array($current));
$query = $this->db->query($sql,array($current,$current,$current));
return $query->result();
}
@ -121,18 +140,37 @@ class monthlypay_model extends CI_Model
function monthlyAttendance($current="")
{
$this->db->select('T_Attendance.*,T_Employee_Details.FirstName,T_Employee_Details.LastName');
$this->db->from('T_Attendance');
$this->db->join('T_Employee_Details','T_Attendance.EmpID=T_Employee_Details.EmpID');
$this->db->order_by('T_Attendance.EmpID', 'asc');
$this->db->where('Month_Year',$current);
$this->db->where('T_Employee_Details.IsActive',1);
// $this->db->select('T_Attendance.*,T_Employee_Details.FirstName,T_Employee_Details.LastName');
// $this->db->from('T_Attendance');
// $this->db->join('T_Employee_Details','T_Attendance.EmpID=T_Employee_Details.EmpID');
// $this->db->order_by('T_Attendance.EmpID', 'asc');
// $this->db->where('Month_Year',$current);
// $this->db->where('T_Employee_Details.IsActive',1);
$query = $this->db->get();
// $query = $this->db->get();
$result = $query->result();
// $result = $query->result();
return $result;
// return $result;
$month_val = date('m',strtotime($current));
$year_val = date('Y',strtotime($current));
$sql = "select Emp.DateofJoining, Emp.FirstName,Emp.LastName,Att.*
from T_Attendance as Att
join T_Employee_Details as Emp
on Emp.EmpID = Att.EmpID
where year(Emp.DateofJoining) <= year(?)
and month(Emp.DateofJoining) <= month(?)
and Emp.IsActive = 1
and Att.Month_Year = ?
order by Att.EmpID
asc ";
$query = $this->db->query($sql,array($current,$current,$current));
$result = $query->result();
return $result;
}
function saveMonthlyData_model($data)
{

View File

@ -405,8 +405,8 @@ $(function() {
<span for="PAN">PAN</span> <!--<span class="badge">*</span>-->
<input type="text" id="panno" maxlength="10" pattern="([A-Za-z]){5}([0-9]){4}([A-Za-z]){1}" name="panno" style="text-transform:uppercase;" onchange="validatePAN();" class="form-control" title="Please Enter 5 Character and 4 digit numbers and 1 Character format (Character should be in caps)" onkeypress="return alpha(event)" style="text-transform: uppercase"> </div>
<div class="col-md-3 pad">
<span for="TIN">TIN</span><span class="badge">*</span>
<input type="text" class="form-control required" pattern="(.){11,11}" id="TIN" name="TIN" minlength="11" maxlength="11" onkeypress="return isNumberKey(event)" required title="Please Enter 11 digit Number">
<span for="TIN">TIN</span><!--<span class="badge">*</span>-->
<input type="text" class="form-control required" pattern="(.){11,11}" id="TIN" name="TIN" minlength="11" maxlength="11" onkeypress="return isNumberKey(event)" title="Please Enter 11 digit Number">
</div>
<div class="col-md-3 pad">
<span for="UANumber">UA Number</span>
@ -429,8 +429,8 @@ $(function() {
<input id="dateofCST" name="dateofCST" onkeypress="return false;" maxlength="10" class="form-control">
</div>
<div class="col-md-3 pad">
<span for="GSTNo">GST Number</span><span class="badge">*</span>
<input type="text" id="GSTNo" name="GSTNo" class="form-control" maxlength="15" required onchange="validateGST();" style="text-transform:uppercase;" pattern="([0-9]){2}([A-Za-z]){5}([0-9]){4}([A-Za-z]){1}([0-9]){1}([Zz]){1}([A-Za-z0-9]){1}" title="Please Enter 2 Digit Number and 5 Character and 4 Digit Numbers and 1 Character and 1 Number and 'Z' and 1 Number or Character" onkeypress="return alpha(event)">
<span for="GSTNo">GST Number</span><!--<span class="badge">*</span> -->
<input type="text" id="GSTNo" name="GSTNo" class="form-control" maxlength="15" onchange="validateGST();" style="text-transform:uppercase;" pattern="([0-9]){2}([A-Za-z]){5}([0-9]){4}([A-Za-z]){1}([0-9]){1}([Zz]){1}([A-Za-z0-9]){1}" title="Please Enter 2 Digit Number and 5 Character and 4 Digit Numbers and 1 Character and 1 Number and 'Z' and 1 Number or Character" onkeypress="return alpha(event)">
</div>
<div class="col-md-3 pad">
<span for="Range">GST Range</span><!--<span class="badge">*</span>-->
@ -603,17 +603,17 @@ if($("#Address").val().length < 1)
return false;
}
if($("#TIN").val().length < 1)
{
alert('Please Enter TIN number');
$("#TIN").focus();
return false;
}
if(!validateGST())
{
$('#GSTNo').focus();
return false;
}
// if($("#TIN").val().length < 1)
// {
// alert('Please Enter TIN number');
// $("#TIN").focus();
// return false;
// }
// if(!validateGST())
// {
// $('#GSTNo').focus();
// return false;
// }
if(!validateEmail())
{

View File

@ -498,8 +498,8 @@ function onlyAlphabets(evt) {
<input type="text" id="panno" maxlength="10" name="panno" onchange="validatePAN();" class="form-control" value="<?php echo $PAN;?>" title="Please Enter 5 Character and 4 digit numbers and 1 Character format (Character must be in caps format)" pattern="([A-Za-z]){5}([0-9]){4}([A-Za-z]){1}" onkeypress="return alpha(event)" style="text-transform:uppercase;">
</div>
<div class="col-md-3 pad">
<span for="TIN">TIN</span><span class="badge">*</span>
<input type="text" class="form-control required" value="<?php echo $TIN;?>" pattern="(.){11,11}" id="TIN" name="TIN" minlength="11" maxlength="11" onkeypress="return isNumberKey(event)" title="Please Enter 11 digit Number">
<span for="TIN">TIN</span><!--<span class="badge">*</span>-->
<input type="text" class="form-control" value="<?php echo $TIN;?>" pattern="(.){11,11}" id="TIN" name="TIN" minlength="11" maxlength="11" onkeypress="return isNumberKey(event)" title="Please Enter 11 digit Number">
</div>
<div class="col-md-3 pad">
<span for="UANumber">UA Number</span>
@ -522,9 +522,9 @@ function onlyAlphabets(evt) {
<input id="dateofCST" name="dateofCST" value="<?php echo $CSTDate;?>" onkeypress="return false;" maxlength="10" class="form-control">
</div>
<div class="col-md-3 pad">
<span for="GSTNo">GST Number</span><span class="badge">*</span>
<span for="GSTNo">GST Number</span><!--<span class="badge">*</span>-->
<!-- <input type="text" id="GSTNo" name="GSTNo" onchange="validateGST();" required maxlength="15" class="form-control" value="<?php echo $GSTNO;?>" pattern="(?=.*[0-9]).{2}(?=.*[A-Za-z]).{5}(?=.*[0-9]).{4}(?=.*[A-Za-z]).{1}(?=.*[0-9]).{1}(?=.*[Zz]).{1}(?=.*[A-Za-z0-9]).{1}" style="text-transform:uppercase;" title="Please Enter 2 Digit Number and 5 Character and 4 Digit Numbers and 1 Character and 1 Number and 'Z' Character and 1 Number (or) Character " onkeypress="return alpha(event)"> -->
<input type="text" id="GSTNo" name="GSTNo" onchange="validateGST();" required maxlength="15" class="form-control" value="<?php echo $GSTNO;?>" pattern="([0-9]){2}([A-Za-z]){5}([0-9]){4}([A-Za-z]){1}([0-9]){1}([Zz]){1}([A-Za-z0-9]){1}" style="text-transform:uppercase;" title="Please Enter 2 Digit Number and 5 Character and 4 Digit Numbers and 1 Character and 1 Number and 'Z' Character and 1 Number (or) Character " onkeypress="return alpha(event)">
<input type="text" id="GSTNo" name="GSTNo" onchange="validateGST();" maxlength="15" class="form-control" value="<?php echo $GSTNO;?>" pattern="([0-9]){2}([A-Za-z]){5}([0-9]){4}([A-Za-z]){1}([0-9]){1}([Zz]){1}([A-Za-z0-9]){1}" style="text-transform:uppercase;" title="Please Enter 2 Digit Number and 5 Character and 4 Digit Numbers and 1 Character and 1 Number and 'Z' Character and 1 Number (or) Character " onkeypress="return alpha(event)">
</div>
<div class="col-md-3 pad">
@ -704,7 +704,7 @@ if($("#Address").val().length < 1)
return false;
}
if($("#TIN").val().length < 1)
/* if($("#TIN").val().length < 1)
{
alert('Please Enter TIN number');
$("#TIN").focus();
@ -714,7 +714,7 @@ if(!validateGST())
{
$('#GSTNo').focus();
return false;
}
}*/
}

View File

@ -1,4 +1,11 @@
<?php //print_r($PayInfo);?>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.5.0/js/bootstrap-datepicker.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.5.0/css/bootstrap-datepicker.css" rel="stylesheet">
<?php //print_r($PayInfo);
$datefordropdown = date_create($datefordropdown);
$datefordropdown = date_format($datefordropdown,'m-Y');
date_default_timezone_set('Asia/Kolkata');
?>
<style type="text/css">
.num {
text-align:right;
@ -15,6 +22,22 @@
<div class="row">
<div class="col-md-2">
<?php
$attributes = array('id' => 'paylist');
echo form_open('paysliplist', $attributes);
$today = date('m-Y');
$data = array('type' => 'text','name' => 'month','id' => 'month','value' => $datefordropdown,'class' => 'form-control select2');
echo form_input($data);
?>
</div>
<div class="col-md-2">
<input id="changemonth" value="Change Month" class="btn btn-primary" title='click here to view payslip Data'>
</div>
<div class="col-xs-12">
<div class="box">
<div class="box-header">
@ -41,7 +64,7 @@
</tr>
</thead>
<tbody id="tbody">
<?php
if(!empty($PayInfo))
{
@ -74,6 +97,7 @@
}
}
?>
</tbody>
</table>
</div><!-- /.box-body -->
@ -90,6 +114,14 @@
$(function () {
$("#month").datepicker({
minViewMode: 1,
format: 'mm-yyyy'
});
var dropdown = "<?php echo $dropdownvalue; ?>";
$('#month').val(dropdown);
$('#monthlylistings').DataTable({
"paging": true,
"lengthChange": true,
@ -101,4 +133,14 @@
});
});
$('#changemonth').on("click", function(){
$("#paylist").attr("method", "post");
$("#paylist").attr("action", "<?php echo base_url() ?>payslip/reload_paysliplist");
$("#paylist").submit();
});
</script>

View File

@ -52,7 +52,7 @@ if(!empty($companyinfo))
<thead>
<tr style="height: 21px;">
<th style="text-align: center;"><strong>Sno</strong></th>
<th style="text-align: center;"><strong>E Account No</strong></th>
<th style="text-align: center;"><strong>PF Account No</strong></th>
<th style=" text-align: center;"><strong>Employee Contribution</strong></th>
<th style=" text-align: center;"><strong>Employeer Contribution</strong></th>
<th style=" text-align: center;"><strong>No of days Present</strong></th>

View File

@ -18,7 +18,7 @@
<div class="row">
<div class="col-xs-12">
<table class="table table-bordered table-hover" id="datatable" style="background-color:#fff;font-size:11px;" >
<table class="table table-bordered table-hover" id="datatable" style="background-color:#fff;font-size:11px !important;" >
<thead style="background-color:#ddf">
<tr>
<th>Supplier ID</th>