under payslip - Bonusandincentive report menu added
This commit is contained in:
parent
5f98732aad
commit
2b5cf4661d
@ -78,6 +78,7 @@ $route['emppayListings/(:num)'] = 'emppaydate/emppayListing/$1';
|
||||
$route['attendance'] = 'monthlypay/attendanceLoad';
|
||||
$route['publicholidays'] = 'monthlypay/loadPublicholidays';
|
||||
$route['loanreports'] = 'payslip/loadLoanReport';
|
||||
$route['bonusreports'] = 'payslip/Bonusreport';
|
||||
|
||||
|
||||
// permission slip//
|
||||
|
||||
@ -21,10 +21,10 @@ class payslip extends BaseController
|
||||
parent::__construct();
|
||||
$this->load->model('payroll_model');
|
||||
$this->load->model('monthlypay_model');
|
||||
$this->load->library('form_validation');
|
||||
$this->load->library('form_validation');
|
||||
$this->isLoggedIn();
|
||||
}
|
||||
|
||||
|
||||
function phpAlert($msg) {
|
||||
echo '<script type="text/javascript">alert("' . $msg . '")</script>';
|
||||
}
|
||||
@ -1250,6 +1250,22 @@ $amountInWords = "Rupees " . $result ." Paise ". $points." Only";
|
||||
return $amountInWords;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function Bonusreport()
|
||||
{
|
||||
//echo"function in controller";
|
||||
|
||||
$this->global['pageTitle'] = 'Siddharth : Incentive and Bonus Reports';
|
||||
|
||||
$fin_year = $this->input->post('finyear');
|
||||
//echo "values are,".$year.$fin_year;
|
||||
$data['dropdownvalue'] = $fin_year;
|
||||
|
||||
$data['Reportvalue'] = $this->monthlypay_model->reportvalue($fin_year);
|
||||
|
||||
$this->loadViews("Bonusreport", $this->global,$data,NULL);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@ -347,7 +347,30 @@ join T_DepartmentDetails as Dep on Dep.DEPCode=Emp.Departmentcode where Emp.IsA
|
||||
$this->db->where('per.SNO',$SNO );
|
||||
$query =$this->db->get();
|
||||
return $query->result();
|
||||
}
|
||||
}
|
||||
|
||||
function reportvalue($fin_year)
|
||||
{
|
||||
|
||||
|
||||
$curr_split = explode('-',$fin_year);
|
||||
$pre_year = $curr_split[0];
|
||||
$curr_year = $curr_split[1];
|
||||
|
||||
$sql= "select T_Monthly_Pay_Inputs.EmpID,T_Employee_Details.FirstName,T_Employee_Details.LastName,sum(Incentives) as Incentives,sum(Festival_Bonus) as Bonus
|
||||
from T_Monthly_Pay_Inputs
|
||||
join T_Employee_Details on T_Monthly_Pay_Inputs.EmpID = T_Employee_Details.EmpID
|
||||
where
|
||||
substr(T_Monthly_Pay_Inputs.Month_Year,4) = ?
|
||||
and substr(T_Monthly_Pay_Inputs.Month_Year,1,2) >= 4
|
||||
or substr(T_Monthly_Pay_Inputs.Month_Year,4) = ?
|
||||
and substr(T_Monthly_Pay_Inputs.Month_Year,1,2) <= 3
|
||||
group by T_Monthly_Pay_Inputs.EmpID";
|
||||
|
||||
$query = $this->db->query($sql,array($pre_year,$curr_year));
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
214
application/views/Bonusreport.php
Normal file
214
application/views/Bonusreport.php
Normal file
@ -0,0 +1,214 @@
|
||||
<script src="<?php echo base_url()?>assets/tabletoexport/jquery.tableexport.v2.js"></script>
|
||||
<style>
|
||||
.ui-datepicker-trigger{
|
||||
border:none;
|
||||
background:none;
|
||||
}
|
||||
</style>
|
||||
<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">
|
||||
|
||||
<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>
|
||||
|
||||
$(function()
|
||||
{
|
||||
|
||||
});
|
||||
</script>
|
||||
<style type="text/css">
|
||||
.num {
|
||||
text-align:right;
|
||||
}
|
||||
</style>
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1>
|
||||
<center>Employee Incentive and Bonus Reports</center>
|
||||
</h1>
|
||||
</section>
|
||||
<section class="content" id="content">
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="box">
|
||||
|
||||
<div class="row">
|
||||
|
||||
<form id="formid">
|
||||
<div style="padding-top: 30px;padding-left: 30px;">
|
||||
<div class="col-md-3">
|
||||
<?php echo form_input('finyear',set_value('finyearttext'),'id="finyearttext"' ,'class="form-control"');?>
|
||||
|
||||
|
||||
<input type="button" id="finyear" value="Year">
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<input type="button" value="View Report" class="btn btn-primary" id="report">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<table id="monthlylistings" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
|
||||
<thead style="background-color:#ddf">
|
||||
<tr>
|
||||
|
||||
<th>S.No</th>
|
||||
<th>Employee Id</th>
|
||||
<th>Employee Name</th>
|
||||
<th>Incentives in ₹</th>
|
||||
<th>Festival Bonus in ₹</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$index=0;
|
||||
$total=0;
|
||||
$totalbonus=0;
|
||||
if(!empty($Reportvalue))
|
||||
{
|
||||
|
||||
foreach($Reportvalue as $record)
|
||||
{
|
||||
$index++;
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<tr>
|
||||
|
||||
<td style="text-align:right;" style="background-color:blue;"><?php echo $index; ?></td>
|
||||
<td style="text-align:right;"><?php echo $record->EmpID ?></td>
|
||||
<td><?php echo $record->FirstName ." ". $record->LastName ?></td>
|
||||
<!-- <td><?php echo $record->Incentives ?></td>
|
||||
<td><?php echo $record->Bonus ?></td> -->
|
||||
<td style="text-align:right;"><?php if(!empty($record->Incentives)){$total+=$record->Incentives; echo $record->Incentives;}else{echo "0.00";}?></td>
|
||||
<td style="text-align:right;"><?php if(!empty($record->Bonus)){$totalbonus+=$record->Bonus ;echo $record->Bonus;}else{echo "0.00";} ?></td>
|
||||
|
||||
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
</tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td><?php echo "Total" ?></td>
|
||||
<!-- <td style="text-align:right;" colspan="3"><?php echo "Total"; ?></td> -->
|
||||
<td style="text-align:right;"><?php echo number_format($total,2,'.',''); ?></td>
|
||||
<td style="text-align:right;"><?php echo number_format($totalbonus,2,'.','');?></td>
|
||||
|
||||
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div><!-- /.box-body -->
|
||||
</div><!-- /.box -->
|
||||
</div><!-- /.inital row -->
|
||||
</div><!-- /.12 md div closed -->
|
||||
</section><!-- /.content section closed -->
|
||||
</div><!-- /.content wrapper -->
|
||||
|
||||
<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/common.js" charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
/*-----------------on ready function ------------------------------- */
|
||||
$(function () {
|
||||
/*-----------------for data table ------------------------------ */
|
||||
var t = $('#monthlylistings').DataTable( {
|
||||
"columnDefs": [ {
|
||||
"searchable": false,
|
||||
"orderable": false,
|
||||
"targets": 0
|
||||
} ],
|
||||
"searching": true,
|
||||
"lengthChange": true,
|
||||
"info": true,
|
||||
"paging": true,
|
||||
"autoWidth": true,
|
||||
"order": [[ 0, 'asc' ]]
|
||||
} );
|
||||
/**---------------for table index value using datatable -------- */
|
||||
t.on( 'order.dt search.dt', function () {
|
||||
t.column(0, {search:'applied', order:'applied'}).nodes().each( function (cell, i) {
|
||||
cell.innerHTML = i+1;
|
||||
} );
|
||||
} ).draw();
|
||||
/**-----------------for date picker ---------------------------- */
|
||||
$("#finyear").datepicker(
|
||||
{
|
||||
|
||||
minViewMode: 1,
|
||||
//format: 'M-yyyy',
|
||||
|
||||
});
|
||||
/**----------------for change function using datepicker -------- */
|
||||
$("#finyear").change(function(){
|
||||
$("#finyearttext").val('');
|
||||
var date = $('#finyear').datepicker('getDate');
|
||||
$("#finyear").val("Year");
|
||||
var month = date.getMonth();
|
||||
var year = date.getFullYear();
|
||||
month++;
|
||||
if (month >= 4)
|
||||
{
|
||||
$("#finyear").val("Year");
|
||||
$("#finyearttext").val(year + '-' + (year+1));
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#finyear").val("Year");
|
||||
$("#finyearttext").val((year-1) + '-' + year);
|
||||
}
|
||||
|
||||
});
|
||||
/*------after reload display the value text box (fin_year text box)------- */
|
||||
//if(!empty($dropdownvalue)){
|
||||
var s = "<?php echo $dropdownvalue; ?>";
|
||||
$('#finyearttext').val(s);
|
||||
///}
|
||||
});
|
||||
/*-----------------on ready function ends here---------------------------- */
|
||||
|
||||
/*--------------------------for view report button------------------------ */
|
||||
$("#report").click(function(){
|
||||
|
||||
$("#formid").attr("method", "post");
|
||||
|
||||
$("#formid").attr("action", "<?php echo base_url() ?>payslip/Bonusreport");
|
||||
|
||||
$('#formid').submit();
|
||||
|
||||
|
||||
});
|
||||
|
||||
/*-----------------for export execl button------------------------------- */
|
||||
var name = "<?php echo 'Incentive and Bonus Report ( '.$dropdownvalue.' )' ?>";
|
||||
$("#monthlylistings").tableExport({
|
||||
bootstrap: true,
|
||||
separator: ",",
|
||||
headings: true,
|
||||
buttonContent: "Export",
|
||||
addClass: "",
|
||||
defaultClass: "btn",
|
||||
defaultTheme: "btn-default",
|
||||
type: "csv",
|
||||
fileName: name,
|
||||
position: "bottom",
|
||||
stripQuotes: true
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
@ -553,6 +553,11 @@ $(function() {
|
||||
<i class="fa fa-list-alt"></i> <span>Loan Reports</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="treeview">
|
||||
<a href="<?php echo base_url(); ?>bonusreports">
|
||||
<i class="fa fa-list-alt"></i> <span>Incentives And Bonus Reports</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user