monthwise Bonusandincentive report

This commit is contained in:
venbatechnologies@gmail.com 2018-01-18 19:35:29 +05:30
parent 2b5cf4661d
commit 130a65eb05
4 changed files with 232 additions and 8 deletions

View File

@ -1260,12 +1260,25 @@ $amountInWords = "Rupees " . $result ." Paise ". $points." Only";
$fin_year = $this->input->post('finyear');
//echo "values are,".$year.$fin_year;
$data['dropdownvalue'] = $fin_year;
$data['finyear'] = $fin_year;
$data['Reportvalue'] = $this->monthlypay_model->reportvalue($fin_year);
$this->loadViews("Bonusreport", $this->global,$data,NULL);
}
function MonthwiseBonusreport()
{
//echo"in controller";
$EmployeeID = $_GET['EID'];
$Fin_year = $_GET['Finyear'];
$data['finyear'] = $Fin_year;
//echo $EmployeeID;
//echo $Fin_year;
$this->global['pageTitle'] = 'Siddharth : Monthwise Incentive and Bonus Reports';
$data['MonthwiseReport'] = $this->monthlypay_model->Monthwisereportvalue($Fin_year,$EmployeeID);
//print_r($data['MonthwiseReport']);
$this->loadViews("Bonusreportmonthwise", $this->global,$data,NULL);
}
}
?>

View File

@ -370,6 +370,25 @@ join T_DepartmentDetails as Dep on Dep.DEPCode=Emp.Departmentcode where Emp.IsA
$query = $this->db->query($sql,array($pre_year,$curr_year));
return $query->result();
}
function Monthwisereportvalue($Fin_year,$EmployeeID)
{
$curr_split = explode('-',$Fin_year);
$pre_year = $curr_split[0];
$curr_year = $curr_split[1];
$sql= "select T_Monthly_Pay_Inputs.EmpID,T_Monthly_Pay_Inputs.Month_Year,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
and T_Monthly_Pay_Inputs.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.Month_Year";
$query = $this->db->query($sql,array($EmployeeID,$pre_year,$curr_year));
return $query->result();
}

View File

@ -85,11 +85,9 @@
<tr>
<td style="text-align:right;" style="background-color:blue;"><?php echo $index; ?></td>
<td style="text-align:right;"><?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><a href="<?php echo base_url().'payslip/MonthwiseBonusreport/?EID='.$record->EmpID.'&Finyear='.$finyear ?>" data-toggle="tooltip" title="Click here to View Employee monthwise incentive/bonus report details"><?php echo $record->FirstName ." ". $record->LastName ?></a></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>
@ -175,8 +173,8 @@ $(function () {
});
/*------after reload display the value text box (fin_year text box)------- */
//if(!empty($dropdownvalue)){
var s = "<?php echo $dropdownvalue; ?>";
//if(!empty($finyear)){
var s = "<?php echo $finyear; ?>";
$('#finyearttext').val(s);
///}
});
@ -195,7 +193,7 @@ $('#formid').submit();
});
/*-----------------for export execl button------------------------------- */
var name = "<?php echo 'Incentive and Bonus Report ( '.$dropdownvalue.' )' ?>";
var name = "<?php echo 'Incentive and Bonus Report ( '.$finyear.' )' ?>";
$("#monthlylistings").tableExport({
bootstrap: true,
separator: ",",

View File

@ -0,0 +1,194 @@
<script src="<?php echo base_url()?>assets/tabletoexport/jquery.tableexport.v2.js"></script>
<style>
.ui-datepicker-trigger{
border:none;
background:none;
}
</style>
<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>
<style type="text/css">
.num {
text-align:right;
}
</style>
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<center><strong>" <?php echo $MonthwiseReport[0]->EmpID ?> - <?php echo $MonthwiseReport[0]->FirstName ." ". $MonthwiseReport[0]->LastName ?> "</strong> - Monthwise 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="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>Month Year</th>
<th>Incentives in </th>
<th>Festival Bonus in </th>
</tr>
</thead>
<tbody>
<?php
$index=0;
$total=0;
$totalbonus=0;
if(!empty($MonthwiseReport))
{
foreach($MonthwiseReport as $record)
{
$index++;
?>
<tr>
<td style="text-align:right;"><?php echo $index; ?></td>
<td style="text-align:right;"><?php echo $record->EmpID ?></td>
<td><?php echo $record->FirstName ." ". $record->LastName ?></td>
<td><?php
$split_val = explode('-',$record->Month_Year);
$month_val = $split_val[0];
$year_val = $split_val[1];
$monthName = date("M", mktime(0, 0, 0, $month_val, 10));
echo $monthName . " , ".$year_val
?></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></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 employee = "<?php echo $MonthwiseReport[0]->EmpID ?> - <?php echo $MonthwiseReport[0]->FirstName ." ". $MonthwiseReport[0]->LastName ?>";
var fin_year = "<?php echo $finyear ?>";
var name = "<?php echo 'Incentive and Bonus month Report for '.$MonthwiseReport[0]->EmpID.''.$MonthwiseReport[0]->FirstName ." ". $MonthwiseReport[0]->LastName.' ( '.$finyear.' )' ?>";
$("#monthlylistings").tableExport({
bootstrap: true,
separator: ",",
headings: true,
buttonContent: "Export",
addClass: "",
defaultClass: "btn",
defaultTheme: "btn-default",
type: "csv",
fileName: name,
position: "bottom",
stripQuotes: true
});
</script>