PAYROLL EXCEL REPOT
This commit is contained in:
parent
900e2ccff9
commit
71b51bb358
@ -60,7 +60,17 @@ function phpAlert($msg) {
|
|||||||
$m = substr($payon,0,2);
|
$m = substr($payon,0,2);
|
||||||
$y = substr($payon,3);
|
$y = substr($payon,3);
|
||||||
$month = $monthsoptions[$m]."-".$y;
|
$month = $monthsoptions[$m]."-".$y;
|
||||||
|
$excel = $this->input->post('excel');
|
||||||
|
//echo $excel;
|
||||||
|
// if(empty($excel))
|
||||||
|
// {
|
||||||
|
// echo "PDF";
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// echo "EXCEL";
|
||||||
|
// }
|
||||||
|
// die();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -100,13 +110,107 @@ function phpAlert($msg) {
|
|||||||
$data['Totalamount']=$totalamt;
|
$data['Totalamount']=$totalamt;
|
||||||
$totamtwords = $this->convertNumber($totalamt);
|
$totamtwords = $this->convertNumber($totalamt);
|
||||||
$data['Totalamtwords']=$totamtwords;
|
$data['Totalamtwords']=$totamtwords;
|
||||||
|
if(empty($excel)){
|
||||||
$filename = 'PF Report for'.$payon.'pdf' ;
|
$filename = 'PF Report for'.$payon.'pdf' ;
|
||||||
$this->load->View("pfreportprint",$data);
|
$this->load->View("pfreportprint",$data);
|
||||||
}
|
// echo "PDF PART 1";
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
|
||||||
|
$this->load->library('excel');
|
||||||
|
// $this->global['pageTitle'] = 'Siddharth : PF Excel Report';
|
||||||
|
// $this->loadViews('pfexcel',$this->global,$data,NULL);
|
||||||
|
$this->excel->setActiveSheetIndex(0);
|
||||||
|
$this->excel->getActiveSheet()->setTitle('Employee PF Report ' . $data['PayMonth']);
|
||||||
|
$this->excel->getActiveSheet()->setCellValue('A1', 'Employee PF Report ' . $data['PayMonth']);
|
||||||
|
|
||||||
|
$this->excel->getActiveSheet()->setCellValue('A4', 'S.No.');
|
||||||
|
$this->excel->getActiveSheet()->setCellValue('B4', 'Employee Name');
|
||||||
|
$this->excel->getActiveSheet()->setCellValue('C4', 'PF Account No');
|
||||||
|
$this->excel->getActiveSheet()->setCellValue('D4', 'Employee Contribution');
|
||||||
|
|
||||||
|
$this->excel->getActiveSheet()->setCellValue('E4', 'Employeer Contribution');
|
||||||
|
$this->excel->getActiveSheet()->setCellValue('F4', 'Total Amount');
|
||||||
|
$this->excel->getActiveSheet()->mergeCells('A1:F1');
|
||||||
|
$this->excel->getActiveSheet()->getStyle('A1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
|
||||||
|
$this->excel->getActiveSheet()->getStyle('A1')->getFont()->setBold(true);
|
||||||
|
$this->excel->getActiveSheet()->getStyle('A1')->getFont()->setSize(16);
|
||||||
|
$this->excel->getActiveSheet()->getStyle('A1')->getFill()->getStartColor()->setARGB('#333');
|
||||||
|
|
||||||
|
for($col = ord('A'); $col <= ord('F'); $col++){
|
||||||
|
|
||||||
|
$this->excel->getActiveSheet()->getColumnDimension(chr($col))->setAutoSize(true);
|
||||||
|
$this->excel->getActiveSheet()->getStyle(chr($col))->getFont()->setSize(12);
|
||||||
|
$this->excel->getActiveSheet()->getStyle(chr($col))->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
|
||||||
|
|
||||||
|
}
|
||||||
|
// print_r($data['PFESI']);die();
|
||||||
|
$i=6;
|
||||||
|
$j=1;
|
||||||
|
$total=0;
|
||||||
|
$overall=0;
|
||||||
|
foreach($data['PFESI'] as $row){
|
||||||
|
|
||||||
|
$this->excel->getActiveSheet()->setCellValue('A' . (string)($i),$j);
|
||||||
|
$this->excel->getActiveSheet()->setCellValue('B' . (string)($i),$row->FName . $row->Lname);
|
||||||
|
$this->excel->getActiveSheet()->setCellValue('C' . (string)($i),$row->PFNO);
|
||||||
|
$this->excel->getActiveSheet()->setCellValue('D' . (string)($i),number_format($row->PF,2,'.',''));
|
||||||
|
$this->excel->getActiveSheet()->getStyle('D'.(string)($i))->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);
|
||||||
|
$this->excel->getActiveSheet()->getStyle('D'.(string)($i))->getNumberFormat()->setFormatCode('0.00');
|
||||||
|
$this->excel->getActiveSheet()->setCellValue('E' . (string)($i),number_format($row->CompanyPF,2,'.',''));
|
||||||
|
$this->excel->getActiveSheet()->getStyle('E'.(string)($i))->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);
|
||||||
|
$this->excel->getActiveSheet()->getStyle('E'.(string)($i))->getNumberFormat()->setFormatCode('0.00');
|
||||||
|
$this->excel->getActiveSheet()->setCellValue('E' . (string)($i+1),'Total');
|
||||||
|
$total = $row->PF + $row->CompanyPF;
|
||||||
|
$overall=$overall + $total;
|
||||||
|
$this->excel->getActiveSheet()->setCellValue('F' . (string)($i),($total));
|
||||||
|
$this->excel->getActiveSheet()->getStyle('F'.(string)($i))->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);
|
||||||
|
$this->excel->getActiveSheet()->getStyle('F'.(string)($i))->getNumberFormat()->setFormatCode('0.00');
|
||||||
|
$this->excel->getActiveSheet()->setCellValue('F' . (string)($i+1),($overall));
|
||||||
|
$this->excel->getActiveSheet()->getStyle('F'.(string)($i+1))->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);
|
||||||
|
$this->excel->getActiveSheet()->getStyle('F'.(string)($i+1))->getNumberFormat()->setFormatCode('0.00');
|
||||||
|
//$this->excel->getActiveSheet()->setCellValue('A6','HI');
|
||||||
|
$i++;
|
||||||
|
$j++;
|
||||||
|
}
|
||||||
|
$this->excel->getActiveSheet()->getProtection()->setSheet(true);
|
||||||
|
$this->excel->getActiveSheet()->getProtection()->setSort(true);
|
||||||
|
$this->excel->getActiveSheet()->getProtection()->setInsertRows(true);
|
||||||
|
$this->excel->getActiveSheet()->getProtection()->setFormatCells(true);
|
||||||
|
|
||||||
|
$filename='EmployeePFReport.xls';
|
||||||
|
header('Content-Type: application/vnd.ms-excel');
|
||||||
|
header('Content-Disposition: attachment;filename="'.$filename.'"');
|
||||||
|
header('Cache-Control: max-age=0');
|
||||||
|
$objWriter = PHPExcel_IOFactory::createWriter($this->excel, 'Excel5');
|
||||||
|
$objWriter->save('php://output');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if($this->input->post('ESI_Report'))
|
if($this->input->post('ESI_Report'))
|
||||||
{
|
{
|
||||||
$data['PFESI'] = $this->payroll_model->getReportforPFESI($payon);
|
$data['PFESI'] = $this->payroll_model->getReportforPFESI($payon);
|
||||||
|
//print_r($data['PFESI']);die();
|
||||||
$data['PayMonth']=$month;
|
$data['PayMonth']=$month;
|
||||||
$totamtwords = '';
|
$totamtwords = '';
|
||||||
$totalamt=0.00;
|
$totalamt=0.00;
|
||||||
@ -119,11 +223,86 @@ function phpAlert($msg) {
|
|||||||
$data['Totalamount']=$totalamt;
|
$data['Totalamount']=$totalamt;
|
||||||
$totamtwords = $this->convertNumber($totalamt);
|
$totamtwords = $this->convertNumber($totalamt);
|
||||||
$data['Totalamtwords']=$totamtwords;
|
$data['Totalamtwords']=$totamtwords;
|
||||||
|
|
||||||
|
|
||||||
|
if(empty($excel)){
|
||||||
$filename = 'ESI Report for'.$payon.'pdf';
|
$filename = 'ESI Report for'.$payon.'pdf';
|
||||||
$this->load->View("esireportprint",$data);
|
$this->load->View("esireportprint",$data);
|
||||||
|
// echo "PDF PART 1";
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
|
||||||
|
$this->load->library('excel');
|
||||||
|
|
||||||
|
$this->excel->setActiveSheetIndex(0);
|
||||||
|
$this->excel->getActiveSheet()->setTitle('Employee ESI Report ' . $data['PayMonth']);
|
||||||
|
$this->excel->getActiveSheet()->setCellValue('A1', 'Employee ESI Report ' . $data['PayMonth']);
|
||||||
|
|
||||||
|
$this->excel->getActiveSheet()->setCellValue('A4', 'S.No.');
|
||||||
|
$this->excel->getActiveSheet()->setCellValue('B4', 'Employee Name');
|
||||||
|
$this->excel->getActiveSheet()->setCellValue('C4', 'ESI Account No');
|
||||||
|
$this->excel->getActiveSheet()->setCellValue('D4', 'Employee Contribution');
|
||||||
|
|
||||||
|
$this->excel->getActiveSheet()->setCellValue('E4', 'Employeer Contribution');
|
||||||
|
$this->excel->getActiveSheet()->setCellValue('F4', 'Total Amount');
|
||||||
|
$this->excel->getActiveSheet()->mergeCells('A1:F1');
|
||||||
|
$this->excel->getActiveSheet()->getStyle('A1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
|
||||||
|
$this->excel->getActiveSheet()->getStyle('A1')->getFont()->setBold(true);
|
||||||
|
$this->excel->getActiveSheet()->getStyle('A1')->getFont()->setSize(16);
|
||||||
|
$this->excel->getActiveSheet()->getStyle('A1')->getFill()->getStartColor()->setARGB('#333');
|
||||||
|
|
||||||
|
for($col = ord('A'); $col <= ord('F'); $col++){
|
||||||
|
|
||||||
|
$this->excel->getActiveSheet()->getColumnDimension(chr($col))->setAutoSize(true);
|
||||||
|
$this->excel->getActiveSheet()->getStyle(chr($col))->getFont()->setSize(12);
|
||||||
|
$this->excel->getActiveSheet()->getStyle(chr($col))->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
|
||||||
|
|
||||||
|
}
|
||||||
|
// print_r($data['PFESI']);die();
|
||||||
|
$i=6;
|
||||||
|
$j=1;
|
||||||
|
$total=0;
|
||||||
|
$overall=0;
|
||||||
|
foreach($data['PFESI'] as $row){
|
||||||
|
|
||||||
|
$this->excel->getActiveSheet()->setCellValue('A' . (string)($i),$j);
|
||||||
|
$this->excel->getActiveSheet()->setCellValue('B' . (string)($i),$row->FName . $row->Lname);
|
||||||
|
$this->excel->getActiveSheet()->setCellValue('C' . (string)($i),$row->ESI);
|
||||||
|
$this->excel->getActiveSheet()->setCellValue('D' . (string)($i),number_format($row->EmployeeESI,2,'.',''));
|
||||||
|
$this->excel->getActiveSheet()->getStyle('D'.(string)($i))->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);
|
||||||
|
$this->excel->getActiveSheet()->getStyle('D'.(string)($i))->getNumberFormat()->setFormatCode('0.00');
|
||||||
|
$this->excel->getActiveSheet()->setCellValue('E' . (string)($i),number_format($row->CompanyESI,2,'.',''));
|
||||||
|
$this->excel->getActiveSheet()->getStyle('E'.(string)($i))->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);
|
||||||
|
$this->excel->getActiveSheet()->getStyle('E'.(string)($i))->getNumberFormat()->setFormatCode('0.00');
|
||||||
|
$this->excel->getActiveSheet()->setCellValue('E' . (string)($i+1),'Total');
|
||||||
|
$total = $row->EmployeeESI + $row->CompanyESI;
|
||||||
|
$overall=$overall + $total;
|
||||||
|
$this->excel->getActiveSheet()->setCellValue('F' . (string)($i),($total));
|
||||||
|
$this->excel->getActiveSheet()->getStyle('F'.(string)($i))->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);
|
||||||
|
$this->excel->getActiveSheet()->getStyle('F'.(string)($i))->getNumberFormat()->setFormatCode('0.00');
|
||||||
|
$this->excel->getActiveSheet()->setCellValue('F' . (string)($i+1),($overall));
|
||||||
|
$this->excel->getActiveSheet()->getStyle('F'.(string)($i+1))->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);
|
||||||
|
$this->excel->getActiveSheet()->getStyle('F'.(string)($i+1))->getNumberFormat()->setFormatCode('0.00');
|
||||||
|
//$this->excel->getActiveSheet()->setCellValue('A6','HI');
|
||||||
|
$i++;
|
||||||
|
$j++;
|
||||||
|
}
|
||||||
|
$this->excel->getActiveSheet()->getProtection()->setSheet(true);
|
||||||
|
$this->excel->getActiveSheet()->getProtection()->setSort(true);
|
||||||
|
$this->excel->getActiveSheet()->getProtection()->setInsertRows(true);
|
||||||
|
$this->excel->getActiveSheet()->getProtection()->setFormatCells(true);
|
||||||
|
$filename='EmployeePFReport.xls';
|
||||||
|
header('Content-Type: application/vnd.ms-excel');
|
||||||
|
header('Content-Disposition: attachment;filename="'.$filename.'"');
|
||||||
|
header('Cache-Control: max-age=0');
|
||||||
|
$objWriter = PHPExcel_IOFactory::createWriter($this->excel, 'Excel5');
|
||||||
|
$objWriter->save('php://output');
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(empty($excel)){
|
||||||
$php = $this->output->get_output();
|
$php = $this->output->get_output();
|
||||||
|
|
||||||
// Load library
|
// Load library
|
||||||
@ -145,12 +324,14 @@ function phpAlert($msg) {
|
|||||||
$font, 6, array(0,0,0));
|
$font, 6, array(0,0,0));
|
||||||
|
|
||||||
$dompdf->stream($filename);
|
$dompdf->stream($filename);
|
||||||
|
//echo "PDF PART 2";
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function used to load the first screen of the user
|
* This function used to load the first screen of the user
|
||||||
*/
|
*/
|
||||||
@ -355,7 +536,7 @@ function phpAlert($msg) {
|
|||||||
|
|
||||||
$this->global['pageTitle'] = 'Siddharth : Edit Employee Payslip';
|
$this->global['pageTitle'] = 'Siddharth : Edit Employee Payslip';
|
||||||
$data['PayInfo'] = $this->payroll_model->GetPayslipdata($PayOn,$EmpID);
|
$data['PayInfo'] = $this->payroll_model->GetPayslipdata($PayOn,$EmpID);
|
||||||
$this->loadViews("editPayslip", $this->global, $data , NULL);
|
$this->loadViews("editpayslip", $this->global, $data , NULL);
|
||||||
}
|
}
|
||||||
public function viewGenerator()
|
public function viewGenerator()
|
||||||
{
|
{
|
||||||
|
|||||||
4
application/logs/log-2017-10-11.php
Normal file
4
application/logs/log-2017-10-11.php
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ?>
|
||||||
|
|
||||||
|
ERROR - 2017-10-11 08:49:12 --> Severity: Warning --> DOMXPath::query(): Invalid expression C:\5.6\xampp\htdocs\SIA\SIANEW\siddharth_application\application\third_party\dompdf\include\stylesheet.cls.php 697
|
||||||
|
ERROR - 2017-10-11 08:49:12 --> Severity: Warning --> DOMXPath::query(): Invalid expression C:\5.6\xampp\htdocs\SIA\SIANEW\siddharth_application\application\third_party\dompdf\include\stylesheet.cls.php 697
|
||||||
@ -1 +1 @@
|
|||||||
<span style='color: #900'>4,096 KB</span> <span style='color: #090'>595.2981 ms</span><br />
|
<span style='color: #900'>14,080 KB</span> <span style='color: #090'>1,982.8620 ms</span><br />
|
||||||
@ -14,9 +14,15 @@ $("#bankreport").click(function(){
|
|||||||
|
|
||||||
var bank = $('#bank').val();
|
var bank = $('#bank').val();
|
||||||
var payon = $('#month').val();
|
var payon = $('#month').val();
|
||||||
|
var excel = $('#excel').is(":checked");
|
||||||
|
// alert(excel);
|
||||||
|
|
||||||
|
|
||||||
|
if(excel == true)
|
||||||
|
{
|
||||||
|
alert('Excel Report Not Available for Bank Report..!');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if(bank != '-1' && payon !='-1')
|
if(bank != '-1' && payon !='-1')
|
||||||
{
|
{
|
||||||
$('#content').loader('show');
|
$('#content').loader('show');
|
||||||
@ -27,6 +33,7 @@ $("#bankreport").click(function(){
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
alert('Select Bank Name and Pay Date');
|
alert('Select Bank Name and Pay Date');
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -144,6 +151,9 @@ $("#esireport").click(function(){
|
|||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-md-4 col-md-offset-6">
|
||||||
|
<input type="checkbox" class="" id="excel" name="excel" value="excel" /><span>Excel</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<br/>
|
<br/>
|
||||||
|
|||||||
@ -44,7 +44,7 @@ To<br> The bank Manager,<br>
|
|||||||
|
|
||||||
Sir/Madam,
|
Sir/Madam,
|
||||||
<br><br><p>
|
<br><br><p>
|
||||||
For Your kindly information please credit employees salary of <?php echo $PayMonth;?> for Siddharth Indistries.Total Amount i- <b>Rs.<?php echo number_format($Totalamount,2,'.','');?></b>
|
For Your kindly information please credit employees salary of <?php echo $PayMonth;?> for Siddharth Indistries.Total Amount - <b>Rs.<?php echo number_format($Totalamount,2,'.','');?></b>
|
||||||
<b>(<?php echo $Totalamtwords;?>)</b> with cheque <b>No:123456789</b></p>
|
<b>(<?php echo $Totalamtwords;?>)</b> with cheque <b>No:123456789</b></p>
|
||||||
|
|
||||||
<p>Employee List given Below:</p>
|
<p>Employee List given Below:</p>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user