Payslippdffine and HRdashboard issues

This commit is contained in:
venbatechnologies 2018-01-16 13:16:54 +05:30
parent b2a92bb728
commit 63c519ee40
4 changed files with 295 additions and 731 deletions

View File

@ -786,6 +786,8 @@ function getEmployee()
*/ */
public function PrintPdf() public function PrintPdf()
{ {
$filename=" ";
$html=""; $html="";
$All = $this->input->post('All'); $All = $this->input->post('All');
if($All == '') if($All == '')
@ -802,11 +804,16 @@ function getEmployee()
else else
{ {
$Payon = $this->input->post('PayOn'); $Payon = $this->input->post('PayOn');
$m =date("M", mktime(0, 0, 0, $Payon, 10));
//$y =date("Y",mktime(0, 0, 0, $Payon, 10));
//$m=date("M-Y",mktime(0,0,0,$month,1,$year));
$y=substr($Payon,3);
//echo "Payon" . $Payon; //echo "Payon" . $Payon;
if($All != '') if($All != '')
{ {
$filename='PayslipFor-'.$m.'-'.$y;
$result = $this->payroll_model->getEmpAll($Payon); $result = $this->payroll_model->getEmpAll($Payon);
// print_r($result); // print_r($result);
// die(); // die();
@ -843,6 +850,9 @@ function getEmployee()
$EmpID = $this->input->post('Employee'); $EmpID = $this->input->post('Employee');
//echo "EmpID" . $EmpID; //echo "EmpID" . $EmpID;
$Data['PayDetails'] = $this->payroll_model->GetPayslipdata($Payon,$EmpID); $Data['PayDetails'] = $this->payroll_model->GetPayslipdata($Payon,$EmpID);
$fname=$Data['PayDetails'][0]->FName;
$filename='PayslipFor-'.$EmpID.' '.$fname.' '.$m.' '.$y;
$totalsalary =$Data['PayDetails'][0]->LessAdvance; $totalsalary =$Data['PayDetails'][0]->LessAdvance;
$totalsalaryinwords = $this->convertNumber(round($totalsalary)); $totalsalaryinwords = $this->convertNumber(round($totalsalary));

File diff suppressed because it is too large Load Diff

View File

@ -80,6 +80,14 @@ where Month_Year = ? and att.EmpID in (select EmpID from T_Attendance)";
return $query->result_array(); return $query->result_array();
} }
function yesterdayAllPersentEmpSalary($WH,$OT,$date)
{
// echo $date;
$sql="select EmpID,".$WH.",".$OT." from T_Attendance where Month_Year = ? and EmpID in (select EmpID from T_Attendance)";
$query = $this->db->query($sql,array($date));
//return
return $query->result_array();
}
function attendance($EmpID,$dates) function attendance($EmpID,$dates)
@ -166,17 +174,27 @@ $sql= "select * FROM T_Emp_Pay_Data where EmpID = ?;";
// $sql = 'select sum(NoofDays) as TotalWorkingDays,sum(Days_worked) as DaysWorked from T_Attendance where // $sql = 'select sum(NoofDays) as TotalWorkingDays,sum(Days_worked) as DaysWorked from T_Attendance where
// case // case
// when (month(Month_Year) >=4) then // when (month(Month_Year) >=4) then
// (YEAR(Month_Year) = YEAR(CURRENT_DATE) and MONTH(Month_Year) >= ? ) or ( YEAR(Month_Year) = YEAR(CURRENT_DATE)+1 and MONTH(Month_Year) <= 3 )end and EmpID = ? and month(Month_Year) != month(current_date())'; // (YEAR(Month_Year) = YEAR(CURRENT_DATE) and MONTH(Month_Year) >= ? ) or ( YEAR(Month_Year) = YEAR(CURRENT_DATE)+1 and MONTH(Month_Year) <= 3 )end and EmpID = ? and month(Month_Year) != month(current_date())
// else
// (YEAR(Month_Year) = YEAR(CURRENT_DATE)-1 and MONTH(Month_Year) >= ? ) or ( YEAR(Month_Year) = YEAR(CURRENT_DATE) and MONTH(Month_Year) <= 3 )';
$sql = ' select sum(NoofDays) as TotalWorkingDays,sum(Days_worked) as DaysWorked from T_Attendance where
case
when (MONTH(CURRENT_DATE) >=4) then
((YEAR(Month_Year) = YEAR(CURRENT_DATE) and MONTH(Month_Year) >= ? )) and EmpID = ? and month(Month_Year) != MONTH(CURRENT_DATE)
else
((YEAR(Month_Year) = YEAR(CURRENT_DATE)-1 and MONTH(Month_Year) >=4 and ? >= 4) or ( YEAR(Month_Year) = YEAR(CURRENT_DATE) and MONTH(Month_Year) <= 3 and ? <=3 )) and Month(Month_Year) >= ? and EmpID = ? and month(Month_Year) != MONTH(CURRENT_DATE)
end';
$sql='select sum(NoofDays) as TotalWorkingDays,sum(Days_worked) as DaysWorked from T_Attendance /*$sql='select sum(NoofDays) as TotalWorkingDays,sum(Days_worked) as DaysWorked from T_Attendance
where EmpID= ? and (MONTH(Month_Year) >=4) or (MONTH(Month_Year) <3) where EmpID= ? and (MONTH(Month_Year) >=4) or (MONTH(Month_Year) <3)
and (YEAR(Month_Year) = YEAR(CURRENT_DATE) and MONTH(Month_Year) >= ? )or ( YEAR(Month_Year) = YEAR(CURRENT_DATE)+1 and MONTH(Month_Year) <= 3 ) and (YEAR(Month_Year) = YEAR(CURRENT_DATE) and MONTH(Month_Year) >= ? )or ( YEAR(Month_Year) = YEAR(CURRENT_DATE)+1 and MONTH(Month_Year) <= 3 )
and MONTH(Month_Year) != MONTH(current_date())'; and MONTH(Month_Year) != MONTH(current_date())';*/
$query= $this->db->query($sql,array($EmpID,$MONTH)); $query= $this->db->query($sql,array($MONTH,$EmpID,$MONTH,$MONTH,$MONTH,$EmpID));
return $query->result(); return $query->result();

View File

@ -53,20 +53,23 @@ if(!empty($EmpCount))
<?php <?php
} }
?> ?>
<!-- HR Start part to--> <!-- HR Start part to-->
<script> <script>
$( function() $( function()
{ {
$( "#datepick" ).datepicker({maxDate: 'Date-1', dateFormat: 'dd-mm-yy' }).val(); //$( "#datepick" ).datepicker({maxDate: 'Date-1', dateFormat: 'dd-mm-yy' }).val();
//$( "#datepic" ).datepicker({maxDate: 'Date-1', dateFormat: 'dd-mm-yy' }).val(); //$( "#datepic" ).datepicker({maxDate: 'Date-1', dateFormat: 'dd-mm-yy' }).val();
// $("#datepic").datepicker({ defaultDate: '-2m'}); // $("#datepic").datepicker({ defaultDate: '-2m'});
$('#datepick').datepicker({maxDate: 'Date-1', dateFormat: 'dd-mm-yy' }).datepicker('setDate',new Date());
} ); } );
</script> </script>
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() $(document).ready(function()
@ -182,7 +185,7 @@ if(!empty($EmpCount))
<a class="small-box-footer"> <p><strong>SALARY COST</strong></p></a> <a class="small-box-footer"> <p><strong>SALARY COST</strong></p></a>
<div class="inner" style="padding: 14px;"> <div class="inner" style="padding: 14px;">
<h3 ><div class="fa fa-rupee" id="today_salary" style="font-size:bold"><!-- <b><?php echo $employeeSalary;?></b> --> <h3 ><div class="fa fa-rupee" id="today_salary" style="font-size:bold"> <b><?php echo $employeeSalary;?></b>
</div></h3> </div></h3>
<input type="text" id="datepick" placeholder="Select Date" style="color:#000;width:30%" /> <input type="text" id="datepick" placeholder="Select Date" style="color:#000;width:30%" />
@ -208,12 +211,13 @@ if(!empty($EmpCount))
<a href="#" class="small-box-footer"> <p> <strong>TOTAL EMPLOYEES ABSENT</strong> </p></a> <a href="#" class="small-box-footer"> <p> <strong>TOTAL EMPLOYEES ABSENT</strong> </p></a>
<h3> <h3>
<div class="inner" id="today_abs" > <div class="inner" id="today_abs" >
<!-- <h3> <?php echo $today_abs;?></h3> --> <h3> <?php echo $today;?></h3>
0
</div></h3>
</div></h3>
<p>ABSENT</p><br> <p>ABSENT</p><br>
<div class="icon"> <div class="icon">
@ -437,20 +441,20 @@ if(!empty($EmpCount))
<div class="inner" id ="abs_name"> <div class="inner" id ="abs_name">
<!-- <h3> <?php echo $today_abs;?></h3> --> <!-- <h3> <?php echo $abs_name;?></h3>
-->
</div> </div>
<!-- <?php <?php
// if(!empty($absname)){ if(!empty($abs_name)){
// foreach ($absname as $abs) { foreach ($abs_name as $abs) {
// echo $abs.'<br/>'; echo $abs.'<br/>';
?> ?>
<?php// } <?php }
// }?> --> }?>
@ -609,26 +613,11 @@ $('#datepick').change(function() {
}); });
//$('#datepic').change(function() {
// $('#datepic').datepicker({
// onSelect: function(d,i){
// if(d !== i.lastVal){
// $(this).change();
// }
// }
// });
// $("#datepic").datepicker({
// onSelect: function(dateText) {
// display("Select the Employee");
// }
// });
</script> </script>
<!-- \\\\\\\\\\\\\\\ HR END of the part ////////////////////////--> <!-- \\\\\\\\\\\\\\\ HR END of the part ////////////////////////-->
<!-- Dashboard for admin--> <!-- Dashboard for admin-->
<?php <?php
if($role == ROLE_ADMIN && $DEPCode != MANAGEMENT && $DEPCode != HR) if($role == ROLE_ADMIN && $DEPCode != MANAGEMENT && $DEPCode != HR)