payslip model files

This commit is contained in:
venbatechnologies@gmail.com 2018-01-02 17:52:31 +05:30
parent 6dce4d99f3
commit 882e229744
4 changed files with 92 additions and 38 deletions

View File

@ -507,31 +507,68 @@ function totalimportpo ()
function importbudgt () function importbudgt ()
{ {
$sql="SELECT ROUND(sum(BudgetAmount),2) as totalimportbudget FROM T_CostCenter_Budget where BudgetType ='IMPORT' and YEAR(STR_TO_DATE(`BudgetYear`,'%Y')) = YEAR(NOW())"; if (date('m') >= 4)
{
$yearl = date('Y').'-'.(date('Y')+1);
} else {
$yearl = (date('Y')-1).'-'.date('Y');
}
$ab=$yearl;
$fa=substr($ab,0,-5);
$aa=substr($ab,5,5);
$sql="SELECT ROUND(sum(BudgetAmount),2) as totalimportbudget FROM T_CostCenter_Budget where BudgetType ='IMPORT' and date(CreatedDate) >= '".$fa."-04-01' and date(CreatedDate) <= '".$aa."-03-31'";
$query = $this->db->query($sql); $query = $this->db->query($sql);
return $query->result(); return $query->result();
} }
function capitalbud () function capitalbud ()
{ {
$sql="SELECT sum(BudgetAmount) as totalcapitalbudget FROM T_CostCenter_Budget where BudgetType ='CAPITAL' and YEAR(STR_TO_DATE(`BudgetYear`,'%Y')) = YEAR(NOW()) "; if (date('m') >= 4)
{
$yearl = date('Y').'-'.(date('Y')+1);
} else {
$yearl = (date('Y')-1).'-'.date('Y');
}
$ab=$yearl;
$fa=substr($ab,0,-5);
$aa=substr($ab,5,5);
$sql="SELECT sum(BudgetAmount) as totalcapitalbudget FROM T_CostCenter_Budget where BudgetType ='CAPITAL' and date(CreatedDate) >= '".$fa."-04-01' and date(CreatedDate) <= '".$aa."-03-31' ";
$query = $this->db->query($sql); $query = $this->db->query($sql);
return $query->result(); return $query->result();
} }
function servicebudgt () function servicebudgt ()
{ {
$sql="SELECT ROUND(sum(BudgetAmount),2) as totalservicebudget FROM T_CostCenter_Budget where BudgetType ='SERVICE' and YEAR(STR_TO_DATE(`BudgetYear`,'%Y')) = YEAR(NOW())"; if (date('m') >= 4)
{
$yearl = date('Y').'-'.(date('Y')+1);
} else {
$yearl = (date('Y')-1).'-'.date('Y');
}
$ab=$yearl;
$fa=substr($ab,0,-5);
$aa=substr($ab,5,5);
$sql="SELECT ROUND(sum(BudgetAmount),2) as totalservicebudget FROM T_CostCenter_Budget where BudgetType ='SERVICE' and date(CreatedDate) >= '".$fa."-04-01' and date(CreatedDate) <= '".$aa."-03-31'";
$query = $this->db->query($sql); $query = $this->db->query($sql);
return $query->result(); return $query->result();
} }
function revenuebudgt () function revenuebudgt ()
{ {
$sql="SELECT ROUND(sum(BudgetAmount),2) as totalrevenuebudget FROM T_CostCenter_Budget where BudgetType ='REVENUE' and YEAR(STR_TO_DATE(`BudgetYear`,'%Y')) = YEAR(NOW())"; if (date('m') >= 4)
{
$yearl = date('Y').'-'.(date('Y')+1);
} else {
$yearl = (date('Y')-1).'-'.date('Y');
}
$ab=$yearl;
$fa=substr($ab,0,-5);
$aa=substr($ab,5,5);
$sql="SELECT ROUND(sum(BudgetAmount),2) as totalrevenuebudget FROM T_CostCenter_Budget where BudgetType ='REVENUE' and date(CreatedDate) >= '".$fa."-04-01' and date(CreatedDate) <= '".$aa."-03-31'";
$query = $this->db->query($sql); $query = $this->db->query($sql);
return $query->result(); return $query->result();
} }
function typebal () function typebal ()
{ {
if (date('m') >= 4) if (date('m') >= 4)

View File

@ -18,6 +18,7 @@ class monthlypay_model extends CI_Model
$this->db->join('T_Employee_Details','T_Monthly_Pay_Inputs.EmpID=T_Employee_Details.EmpID'); $this->db->join('T_Employee_Details','T_Monthly_Pay_Inputs.EmpID=T_Employee_Details.EmpID');
$this->db->join('T_Payroll','T_Monthly_Pay_Inputs.EmpID=T_Payroll.EmpID','left'); $this->db->join('T_Payroll','T_Monthly_Pay_Inputs.EmpID=T_Payroll.EmpID','left');
$this->db->join('T_Loan_Master','T_Monthly_Pay_Inputs.EmpID=T_Loan_Master.EmpID','left'); $this->db->join('T_Loan_Master','T_Monthly_Pay_Inputs.EmpID=T_Loan_Master.EmpID','left');
$this->db->order_by('T_Employee_Details.EmpID','asc');
$this->db->where('Month_Year',$current); $this->db->where('Month_Year',$current);
$query = $this->db->get(); $query = $this->db->get();
@ -53,7 +54,8 @@ class monthlypay_model extends CI_Model
left join T_Attendance on T_Emp_Pay_Data.EmpID = T_Attendance.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 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 T_Employee_Details.DateofJoining <= CURRENT_DATE
and month(T_Attendance.Month_Year) = month(?)"; 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));
return $query->result(); return $query->result();
@ -121,6 +123,7 @@ class monthlypay_model extends CI_Model
$this->db->select('T_Attendance.*,T_Employee_Details.FirstName,T_Employee_Details.LastName'); $this->db->select('T_Attendance.*,T_Employee_Details.FirstName,T_Employee_Details.LastName');
$this->db->from('T_Attendance'); $this->db->from('T_Attendance');
$this->db->join('T_Employee_Details','T_Attendance.EmpID=T_Employee_Details.EmpID'); $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('Month_Year',$current);
$this->db->where('T_Employee_Details.IsActive',1); $this->db->where('T_Employee_Details.IsActive',1);

View File

@ -197,12 +197,15 @@ class Payroll_model extends CI_Model
function getReportforBank($bank,$payon) function getReportforBank($bank,$payon)
{ {
$this->db->distinct();
$this->db->select('Pay.*,Emp.FirstName as FName ,Emp.LastName as Lname,Emp.PANNo as Pan,Emp.BankBranchName as BankName,Emp.IFSCCode as IFSC,Bank.Address as BAddress'); $this->db->select('Pay.*,Emp.FirstName as FName ,Emp.LastName as Lname,Emp.PANNo as Pan,Emp.BankBranchName as BankName,Emp.IFSCCode as IFSC,Bank.Address as BAddress');
$this->db->from('T_Payroll Pay'); $this->db->from('T_Payroll Pay');
$this->db->join('T_Employee_Details Emp', 'Pay.EmpID = Emp.EmpID'); $this->db->join('T_Employee_Details Emp', 'Pay.EmpID = Emp.EmpID');
$this->db->join('T_Bank_Details Bank', 'Emp.BankBranchName = Bank.Bank_name'); $this->db->join('T_Bank_Details Bank', 'Emp.BankBranchName = Bank.Bank_name');
$this->db->order_by("Pay.EmpID", "asc");
$this->db->where('Emp.BankBranchName',$bank); $this->db->where('Emp.BankBranchName',$bank);
$this->db->where('Pay.PayOn',$payon); $this->db->where('Pay.PayOn',$payon);
$this->db->where('Pay.TotalSalary > 0');
$query = $this->db->get(); $query = $this->db->get();
return $query->result(); return $query->result();
} }
@ -210,10 +213,14 @@ class Payroll_model extends CI_Model
function getReportforPFESI($payon) function getReportforPFESI($payon)
{ {
$this->db->distinct();
$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->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->from('T_Payroll Pay');
$this->db->join('T_Employee_Details Emp', 'Pay.EmpID = Emp.EmpID'); $this->db->join('T_Employee_Details Emp', 'Pay.EmpID = Emp.EmpID');
$this->db->where('Pay.PayOn',$payon); $this->db->where('Pay.PayOn',$payon);
$this->db->where('Pay.EmployeeESI > 0 ');
$this->db->where('Pay.CompanyESI > 0');
$this->db->order_by("Pay.EmpID", "asc");
$query = $this->db->get(); $query = $this->db->get();
return $query->result(); return $query->result();
@ -417,7 +424,7 @@ class Payroll_model extends CI_Model
function getCompanyInformation() function getCompanyInformation()
{ {
$subQuery = "select CompanyName,replace(Address,',','<br>') as Address,GSTNO,PAN,ContactNumber,EmailAddress,AlternateContactNumber,companyWebsite,StateCode $subQuery = "select CompanyName,Address,GSTNO,PAN,ContactNumber,EmailAddress,AlternateContactNumber,companyWebsite,StateCode
from T_Company_Details "; from T_Company_Details ";
$query = $this->db->query($subQuery); $query = $this->db->query($subQuery);
//print_r($query->result());die(); //print_r($query->result());die();

View File

@ -1,21 +1,10 @@
<?php <?php $sample = array_merge($month,$fresh); ?>
// print_r($month);
// echo "-------------";
//print_r($fresh);
$sample = array_merge($month,$fresh);
?>
<script src="<?php echo base_url()?>assets/lightswitch/lightswitch/lib/jquery.tabletojson.js"></script> <script src="<?php echo base_url()?>assets/lightswitch/lightswitch/lib/jquery.tabletojson.js"></script>
<script src="<?php echo base_url()?>assets/lightswitch/lightswitch/lib/jquery.tabletojson.min.js"></script> <script src="<?php echo base_url()?>assets/lightswitch/lightswitch/lib/jquery.tabletojson.min.js"></script>
</script>
<script> <script>
$('html').bind('keypress', function(e) $('html').bind('keypress', function(e)
{ {
//alert('Key Pressed'); //alert('Key Pressed');
@ -224,21 +213,39 @@ $('html').bind('keypress', function(e)
<script type="text/javascript"> <script type="text/javascript">
$(function () { $(function () {
$('#monthlylisting').DataTable({
"paging": true, // $('#monthlylisting').DataTable({
"lengthChange": true, // "paging": true,
// "lengthChange": true,
// "searching": true,
// "ordering": true,
// "aaSorting": [[ 0, "asc" ]],
// "info": true,
// "autoWidth": true
// });
$(document).ready(function() {
var t = $('#monthlylistings').DataTable( {
"columnDefs": [ {
"searchable": false,
"orderable": false,
"targets": 0
} ],
"searching": true, "searching": true,
"ordering": true, "lengthChange": true,
"aaSorting": [[ 0, "asc" ]],
"info": true, "info": true,
"autoWidth": true "autoWidth": true,
"order": [[ 1, 'asc' ]]
});
} ); } );
t.on( 'order.dt search.dt', function () {
t.column(0, {search:'applied', order:'applied'}).nodes().each( function (cell, i) {
cell.innerHTML = i+1;
} );
} ).draw();
} );