diff --git a/application/controllers/payslip.php b/application/controllers/payslip.php
index 4b0566ba..dfae35e3 100755
--- a/application/controllers/payslip.php
+++ b/application/controllers/payslip.php
@@ -78,7 +78,7 @@ function phpAlert($msg) {
if($this->input->post('Bank_Report'))
{
$data['result'] = $this->payroll_model->getReportforBank($bank,$payon);
-
+ //print_r($data['result']);die();
$totamtwords = '';
$totalamt=0.00;
if(!empty($data['result'])){
@@ -88,7 +88,8 @@ function phpAlert($msg) {
}
}
$totamtwords = $this->convertNumber($totalamt);
- $data['BankName']=$bank;
+ $data['bankdetails']=$this->payroll_model->getBankInfo($bank);
+
$data['Totalamount']=$totalamt;
$data['Totalamtwords']=$totamtwords;
$data['PayMonth']=$month;
@@ -99,15 +100,24 @@ function phpAlert($msg) {
{
$data['PFESI'] = $this->payroll_model->getReportforPFESI($payon);
$data['PayMonth']=$month;
+ $data['companyinfo']=$this->payroll_model->getCompanyInformation();
+ //print_r($data['companyinfo']);die();
$totamtwords = '';
$totalamt=0.00;
+ $totemppf = 0.00;
+ $totemprpf = 0.00;
if(!empty($data['PFESI'])){
foreach($data['PFESI'] as $pf)
{
$totalamt += ($pf->PF + $pf->CompanyPF);
+ $totemppf += ($pf->PF);
+ $totemprpf += ($pf->CompanyPF);
+
}
}
$data['Totalamount']=$totalamt;
+ $data['TotalEmployeeContribution']=$totemppf;
+ $data['TotalEmployerContribution']=$totemprpf;
$totamtwords = $this->convertNumber($totalamt);
$data['Totalamtwords']=$totamtwords;
if(empty($excel)){
@@ -130,14 +140,16 @@ function phpAlert($msg) {
$this->excel->getActiveSheet()->setCellValue('D4', 'Employee Contribution');
$this->excel->getActiveSheet()->setCellValue('E4', 'Employeer Contribution');
- $this->excel->getActiveSheet()->setCellValue('F4', 'Total Amount');
+ $this->excel->getActiveSheet()->setCellValue('F4', 'No Of Days Worked');
+ $this->excel->getActiveSheet()->setCellValue('G4', 'OT Hrs Worked');
+ $this->excel->getActiveSheet()->setCellValue('H4', '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++){
+ for($col = ord('A'); $col <= ord('H'); $col++){
$this->excel->getActiveSheet()->getColumnDimension(chr($col))->setAutoSize(true);
$this->excel->getActiveSheet()->getStyle(chr($col))->getFont()->setSize(12);
@@ -149,6 +161,10 @@ function phpAlert($msg) {
$j=1;
$total=0;
$overall=0;
+ $totemp = 0;
+ $overallemp = 0;
+ $totemr = 0;
+ $overallemr = 0;
foreach($data['PFESI'] as $row){
$this->excel->getActiveSheet()->setCellValue('A' . (string)($i),$j);
@@ -160,15 +176,31 @@ function phpAlert($msg) {
$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()->setCellValue('C' . (string)($i+1),'Total');
+ $this->excel->getActiveSheet()->setCellValue('F' . (string)($i),number_format($row->NoofDaysWorked,2,'.',''));
$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('G' . (string)($i),number_format($row->OTperHours,2,'.',''));
+ $this->excel->getActiveSheet()->getStyle('G'.(string)($i))->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);
+
+
+ $total = $row->PF + $row->CompanyPF;
+ $totemp = $row->PF;
+ $totemr = $row->CompanyPF;
+ $overall=$overall + $total;
+ $overallemp = $overallemp + $totemp;
+ $overallemr = $overallemr + $totemr;
+ $this->excel->getActiveSheet()->setCellValue('H' . (string)($i),($total));
+ //$this->excel->getActiveSheet()->setCellValue('D' . (string)($i),($totemp));
+ //$this->excel->getActiveSheet()->setCellValue('E' . (string)($i),($totemr));
+ $this->excel->getActiveSheet()->getStyle('H'.(string)($i))->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);
+ $this->excel->getActiveSheet()->getStyle('H'.(string)($i))->getNumberFormat()->setFormatCode('0.00');
+ $this->excel->getActiveSheet()->setCellValue('H' . (string)($i+1),($overall));
+ $this->excel->getActiveSheet()->setCellValue('D' . (string)($i+1),($overallemp));
+ $this->excel->getActiveSheet()->setCellValue('E' . (string)($i+1),($overallemr));
+ $this->excel->getActiveSheet()->getStyle('H'.(string)($i+1))->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);
+ $this->excel->getActiveSheet()->getStyle('H'.(string)($i+1))->getNumberFormat()->setFormatCode('0.00');
//$this->excel->getActiveSheet()->setCellValue('A6','HI');
$i++;
$j++;
@@ -212,16 +244,24 @@ function phpAlert($msg) {
$data['PFESI'] = $this->payroll_model->getReportforPFESI($payon);
//print_r($data['PFESI']);die();
$data['PayMonth']=$month;
+ $data['companyinfo']=$this->payroll_model->getCompanyInformation();
+
$totamtwords = '';
$totalamt=0.00;
+ $totemppf = 0.00;
+ $totemprpf = 0.00;
if(!empty($data['PFESI'])){
foreach($data['PFESI'] as $pf)
{
$totalamt += ($pf->EmployeeESI + $pf->CompanyESI);
+ $totemppf += ($pf->EmployeeESI);
+ $totemprpf += ($pf->CompanyESI);
}
}
$data['Totalamount']=$totalamt;
- $totamtwords = $this->convertNumber($totalamt);
+ $totamtwords = $this->convertNumber($totalamt);
+ $data['TotalEmployeeContribution']=$totemppf;
+ $data['TotalEmployerContribution']=$totemprpf;
$data['Totalamtwords']=$totamtwords;
@@ -244,14 +284,17 @@ function phpAlert($msg) {
$this->excel->getActiveSheet()->setCellValue('D4', 'Employee Contribution');
$this->excel->getActiveSheet()->setCellValue('E4', 'Employeer Contribution');
- $this->excel->getActiveSheet()->setCellValue('F4', 'Total Amount');
+ $this->excel->getActiveSheet()->setCellValue('F4', 'No Of Days Worked');
+ $this->excel->getActiveSheet()->setCellValue('G4', 'OT Hrs Worked');
+
+ $this->excel->getActiveSheet()->setCellValue('H4', '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++){
+ for($col = ord('A'); $col <= ord('H'); $col++){
$this->excel->getActiveSheet()->getColumnDimension(chr($col))->setAutoSize(true);
$this->excel->getActiveSheet()->getStyle(chr($col))->getFont()->setSize(12);
@@ -263,6 +306,10 @@ function phpAlert($msg) {
$j=1;
$total=0;
$overall=0;
+ $totemp = 0;
+ $overallemp = 0;
+ $totemr = 0;
+ $overallemr = 0;
foreach($data['PFESI'] as $row){
$this->excel->getActiveSheet()->setCellValue('A' . (string)($i),$j);
@@ -274,15 +321,27 @@ function phpAlert($msg) {
$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');
+ $this->excel->getActiveSheet()->setCellValue('C' . (string)($i+1),'Total');
+ $this->excel->getActiveSheet()->setCellValue('F' . (string)($i),number_format($row->NoofDaysWorked,2,'.',''));
+ $this->excel->getActiveSheet()->getStyle('F'.(string)($i))->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);
+
+
+ $this->excel->getActiveSheet()->setCellValue('G' . (string)($i),number_format($row->OTperHours,2,'.',''));
+ $this->excel->getActiveSheet()->getStyle('G'.(string)($i))->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);
$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');
+ $totemp = $row->EmployeeESI;
+ $totemr = $row->CompanyESI;
+ $overallemp = $overallemp + $totemp;
+ $overallemr = $overallemr + $totemr;
+ $this->excel->getActiveSheet()->setCellValue('H' . (string)($i),($total));
+ $this->excel->getActiveSheet()->getStyle('H'.(string)($i))->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);
+ $this->excel->getActiveSheet()->getStyle('H'.(string)($i))->getNumberFormat()->setFormatCode('0.00');
+ $this->excel->getActiveSheet()->setCellValue('D' . (string)($i+1),($overallemp));
+ $this->excel->getActiveSheet()->setCellValue('E' . (string)($i+1),($overallemr));
+ $this->excel->getActiveSheet()->setCellValue('H' . (string)($i+1),($overall));
+ $this->excel->getActiveSheet()->getStyle('H'.(string)($i+1))->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);
+ $this->excel->getActiveSheet()->getStyle('H'.(string)($i+1))->getNumberFormat()->setFormatCode('0.00');
//$this->excel->getActiveSheet()->setCellValue('A6','HI');
$i++;
$j++;
@@ -348,7 +407,7 @@ function phpAlert($msg) {
{
$current = date("m-Y");
$data['month'] = $this-> monthlypay_model->monthlyListing($current);
- $data['fresh'] = $this-> monthlypay_model->getEmpPayDetails();
+ $data['fresh'] = $this-> monthlypay_model->getEmpPayDetails($current);
$this->global['pageTitle'] = 'Siddharth : Payroll Monthly Inputs';
$this->loadViews("monthlypayinputs", $this->global,$data,NULL);
@@ -361,7 +420,7 @@ function phpAlert($msg) {
$current = $this->input->post('param1');
$month = $this-> monthlypay_model->monthlyListing($current);
- $fresh = $this-> monthlypay_model->getEmpPayDetails();
+ $fresh = $this-> monthlypay_model->getEmpPayDetails($current);
$data = json_encode(array_merge($month,$fresh));
echo $data;
}
diff --git a/application/models/monthlypay_model.php b/application/models/monthlypay_model.php
index 36fe5ab5..d0207103 100755
--- a/application/models/monthlypay_model.php
+++ b/application/models/monthlypay_model.php
@@ -25,11 +25,18 @@ class monthlypay_model extends CI_Model
return $result;
}
- function getEmpPayDetails()
+ function getEmpPayDetails($current="")
{
- $this->db->select('T_Emp_Pay_Data.EmpID,T_Employee_Details.FirstName,T_Employee_Details.LastName');
+ $current = '01-'.$current;
+ //echo $current;
+ $current = date_create($current);
+ $current = date_format($current,"Y-m-d");
+ //echo $current;
+ $this->db->select('T_Emp_Pay_Data.EmpID,T_Employee_Details.FirstName,T_Employee_Details.LastName,T_Employee_Details.DateofJoining');
$this->db->from('T_Emp_Pay_Data');
- $this->db->join('T_Employee_Details','T_Emp_Pay_Data.EmpID=T_Employee_Details.EmpID');
+ $this->db->join('T_Employee_Details ','T_Emp_Pay_Data.EmpID=T_Employee_Details.EmpID');
+ $this->db->where('T_Employee_Details.DateofJoining <=',$current);
+ $this->db->order_by('EmpID','asc');
$query = $this->db->get();
$result = $query->result();
return $result;
diff --git a/application/models/payroll_model.php b/application/models/payroll_model.php
index e28a0614..060f618b 100755
--- a/application/models/payroll_model.php
+++ b/application/models/payroll_model.php
@@ -182,11 +182,15 @@ class Payroll_model extends CI_Model
return $query->result();
}
- function getBankInfo()
+ function getBankInfo($bank="")
{
$this->db->select('*');
$this->db->from('T_Bank_Details');
- //$this->db->order_by("Month_Year", "desc");
+ $this->db->where("Is_Active",1);
+ if(!empty($bank))
+ {
+ $this->db->where('Bank_name',$bank);
+ }
$query = $this->db->get();
return $query->result();
}
@@ -205,7 +209,7 @@ class Payroll_model extends CI_Model
function getReportforPFESI($payon)
{
- $this->db->select('Pay.EmployeeESI,Pay.PF,Pay.CompanyESI,Pay.CompanyPF,Emp.FirstName as FName ,Emp.LastName as Lname,Emp.PFNO,Emp.ESI');
+ $this->db->select('Pay.EmployeeESI,Pay.PF,Pay.CompanyESI,Pay.CompanyPF,Pay.NoofDaysWorked,Pay.OTperHours,Emp.FirstName as FName ,Emp.LastName as Lname,Emp.PFNO,Emp.ESI');
$this->db->from('T_Payroll Pay');
$this->db->join('T_Employee_Details Emp', 'Pay.EmpID = Emp.EmpID');
$this->db->where('Pay.PayOn',$payon);
@@ -215,7 +219,7 @@ class Payroll_model extends CI_Model
}
/* *//**
- * This function is used to get the PayOn details from T_Payroll_File
+ * This function is used to get the PayOn details from T_Payroll_FileOTperHours
* @return array $result : This is result of the query
*/
function getEmployeelist($Payon ='')
@@ -317,5 +321,17 @@ class Payroll_model extends CI_Model
return $result;
}
+
+
+ function getCompanyInformation()
+ {
+
+ $subQuery = "select CompanyName,replace(Address,',','
') as Address,GSTNO,PAN,ContactNumber,EmailAddress,AlternateContactNumber,companyWebsite,StateCode
+ from T_Company_Details ";
+ $query = $this->db->query($subQuery);
+ //print_r($query->result());die();
+ return $query->result();
+
+ }
}
?>
\ No newline at end of file
diff --git a/application/views/bankreportprint.php b/application/views/bankreportprint.php
index 9040decc..34ccd065 100755
--- a/application/views/bankreportprint.php
+++ b/application/views/bankreportprint.php
@@ -1,83 +1,98 @@
-BAddress;
- //die();
- }
- }
-
-
-?>
-
-
- For Your kindly information please credit employees salary of for Siddharth Indistries.Total Amount - Rs. - () with cheque No:123456789
- -Employee List given Below:
- -| Employee Name | -Salary Amount | -Ac No | -IFSC | -BANK Name | +SIDDHARTH INDUSTRIES | + |
168/1C3, Pennalur Pet Road, Goonipalayam Village Post, Uthukottai Taluk, Thiruvallur Dist-602026 Mobile: +91 99410 14891 / 9941014890 | E-mail: accounts@sidharthindustries.com |
+
+
+
|---|
To,
+The Branch Manager,
,
+
Dear Sir,
+Sub: Salary transfer of respective SB a/c through Account Transfer.
+Please find herewith enclosed a Cheque bearing No: _________________ dated ________________ for /- () Kindly transfer the same to the respective account holders mentioned below
+| Sno | +Employee Name | +Salary Amount | +Acc No | + +IFSC | + +Bank Name | + +|||||
| FName . " ".$data->Lname;?> | -LessAdvance,2,'.','');?> | -BankAccountNumber;?> | -IFSC;?> | -BankName;?> | ++ | FName . " ".$data->Lname;?> | +LessAdvance,2,'.','');?> | +BankAccountNumber;?> | +IFSC;?> | +BankName;?> |
Kindly do the needful,
Thanking you,
Yours faithfully.
K.Subramanian.
- For Your kindly information please credit employees ESI of for Siddharth Indistries. - - -
Employee List given Below:
+| Employee Name | -ESI Account No | -Employee ESI | -Company Share | -Total Amount | +||
|---|---|---|---|---|---|---|
| Sno | +ESI Account No | +Employee Contribution | +Employeer Contribution | +No of days Present | +OT hours | +Total |
| FName . " ".$data->Lname;?> | -ESI;?> | -EmployeeESI,2,'.','');?> | -CompanyESI,2,'.','');?> | -EmployeeESI + $data->CompanyESI),2,'.','');?> | + $index++; + ?> +||
| + | ESI;?> | +EmployeeESI,2,'.','');?> | +CompanyESI,2,'.','');?> | +NoofDaysWorked;?> | +OTperHours;?> | +EmployeeESI + $data->CompanyESI),2,'.','');?> | +
| Total | ++ | + | + | + | ||
Total:
+words:
+- For Your kindly information please credit employees PF of for Siddharth Indistries. - - -
Employee List given Below:
+| Employee Name | -PF Account No | -Employee PF | -Company Share | -Total Amount | +||
|---|---|---|---|---|---|---|
| Sno | +ESI Account No | +Employee Contribution | +Employeer Contribution | +No of days Present | +OT hours | +Total |
| FName . " ".$data->Lname;?> | -PFNO;?> | -PF,2,'.','');?> | -CompanyPF,2,'.','');?> | -PF + $data->CompanyPF),2,'.','');?> | +||
| + | PFNO;?> | +PF,2,'.','');?> | +CompanyPF,2,'.','');?> | +NoofDaysWorked;?> | +OTperHours;?> | +PF + $data->CompanyPF),2,'.','');?> | +
| Total | ++ | + | + | + | ||
Total:
+words:
+