delivery performance
This commit is contained in:
parent
1b6624cee9
commit
8ae4cdd58a
@ -294,3 +294,6 @@ $route['Addaction'] = "purchaseorder/Nonconfirmative";
|
||||
$route['ncrlist'] = "purchaseorder/Nonconfirmativelist";
|
||||
/* End of file routes.php */
|
||||
/* Location: ./application/config/routes.php */
|
||||
|
||||
|
||||
$route['DeliverPerformance']="user/deliver_perform";
|
||||
|
||||
@ -1376,6 +1376,40 @@ function Adduserdepartment()
|
||||
|
||||
$this->loadViews("404", $this->global, NULL, NULL);
|
||||
}
|
||||
//this function used to delivery performances
|
||||
|
||||
function deliver_perform()
|
||||
{
|
||||
// if ($this->input->post('btn_submit')) {
|
||||
|
||||
$this->global['pageTitle'] = 'Siddharth : Delivery Performance';
|
||||
|
||||
|
||||
$ab=$this->input->post('financialyear');
|
||||
|
||||
$fa=substr($ab,0,-5);
|
||||
$aa=substr($ab,5,5);
|
||||
$m=$this->input->post('month');
|
||||
|
||||
//print_r($prod);
|
||||
//die;
|
||||
|
||||
$data['fy']=$this->user_model->fincalYear();
|
||||
$data['per']=$this->user_model->deliver_perform($fa,$aa,$m);
|
||||
|
||||
// // print_r( $data['spurchse']);
|
||||
|
||||
$this->loadviews("deliver_perform",$this->global,$data,NULL);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@ -234,6 +234,59 @@ class User_model extends CI_Model
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
//this function used to delivery performances
|
||||
|
||||
function deliver_perform($fa,$aa,$m)
|
||||
{
|
||||
|
||||
|
||||
|
||||
$sql="select ip_invoices.*,ip_invoice_items.item_quantity as qty,
|
||||
ip_clients.* from ip_invoices
|
||||
join ip_clients on ip_clients.client_id=ip_invoices.client_id
|
||||
join ip_invoice_items on ip_invoice_items .invoice_id =ip_invoices.invoice_id
|
||||
join ip_invoice_custom icf on icf.invoice_id = ip_invoices.invoice_id
|
||||
where icf.invoice_custom_fieldid = 8 and ip_invoices.invoice_status_id != 1";
|
||||
|
||||
|
||||
|
||||
if ($fa and $aa != ''){
|
||||
|
||||
$sql.=" and (ip_invoices.invoice_date_created >= '".$fa."-04-01' and ip_invoices.invoice_date_created <= '".$aa."-03-31')";
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if ($m!= ''){
|
||||
|
||||
$sql.=" and monthname(ip_invoices.invoice_date_created) = '".$m."'";
|
||||
|
||||
}
|
||||
|
||||
|
||||
$query = $this->db->query($sql);
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function fincalYear()
|
||||
{
|
||||
$sql="SELECT
|
||||
CASE WHEN MONTH(invoice_date_created)>=4 THEN
|
||||
concat(YEAR(invoice_date_created), '-',YEAR(invoice_date_created)+1)
|
||||
ELSE concat(YEAR(invoice_date_created)-1,'-', YEAR(invoice_date_created)) END AS financial_year
|
||||
FROM ip_invoices
|
||||
GROUP BY financial_year ";
|
||||
|
||||
$query = $this->db->query($sql);
|
||||
//print_r($query->result());
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
309
application/views/deliver_perform.php
Normal file
309
application/views/deliver_perform.php
Normal file
@ -0,0 +1,309 @@
|
||||
|
||||
|
||||
<?php
|
||||
//print_r($fy);die();
|
||||
?>
|
||||
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.4.2/css/buttons.dataTables.min.css">
|
||||
<style>
|
||||
.dataTables_filter input {padding: 4px;}
|
||||
.dataTables_filter {
|
||||
width: 50%;
|
||||
float: right;
|
||||
text-align: right;
|
||||
}
|
||||
.dataTables_paginate {
|
||||
width: 50%;
|
||||
float: right;
|
||||
text-align: right;
|
||||
}
|
||||
div.dt-buttons {
|
||||
position: relative;
|
||||
float: right;
|
||||
|
||||
}
|
||||
.btn-success {
|
||||
background-color: #3c8dbc;
|
||||
border-color: #3c8dbc;
|
||||
}
|
||||
.col-md-offset-1 {
|
||||
margin-left: 2.333333%;
|
||||
|
||||
padding-top: 5px;
|
||||
}
|
||||
|
||||
</style>
|
||||
<div class="row" style="min-height: 600px;">
|
||||
<!-- Left col -->
|
||||
<div class="col-md-12">
|
||||
<!-- TABLE: LATEST ORDERS -->
|
||||
<div class="box box-info">
|
||||
<div class="box-header with-border">
|
||||
<center><h3 class="box-title"><p style="color:#3c8dbc"><b>Delivery Performance</b><br>
|
||||
<?php
|
||||
|
||||
if($this->input->post('financialyear')){
|
||||
$ab=$this->input->post('financialyear');
|
||||
echo '('.$ab.')';
|
||||
echo ' ';
|
||||
|
||||
}
|
||||
if($this->input->post('month')){
|
||||
$m=$this->input->post('month');
|
||||
echo '('.$m.')';
|
||||
echo ' ';
|
||||
}
|
||||
|
||||
?>
|
||||
</p></h3></center>
|
||||
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="panel-body">
|
||||
|
||||
<form method="post" action="<?php echo base_url($this->uri->uri_string()); ?>">
|
||||
|
||||
<div class="form-group has-feedback">
|
||||
|
||||
|
||||
|
||||
<div class="col-md-2">
|
||||
<label for="to_date">
|
||||
<?php echo 'Year'; ?>
|
||||
</label>
|
||||
<div class="input-group">
|
||||
<select class="form-control" id="financialyear" name="financialyear">
|
||||
<option value="">Select Year</option>
|
||||
<?php
|
||||
|
||||
|
||||
foreach($fy as $item):
|
||||
|
||||
{?>
|
||||
|
||||
<option value="<?php echo $item->financial_year;?>"><?php echo $item->financial_year ; ?></option>
|
||||
|
||||
|
||||
<?php } endforeach; ?>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label for="to_date">
|
||||
<?php echo 'Month'; ?>
|
||||
</label>
|
||||
<div class="input-group">
|
||||
<select class="form-control" id="month" name="month">
|
||||
<option value="">Select Month</option>
|
||||
<option value="January">January</option>
|
||||
<option value="February">February</option>
|
||||
<option value="March">March</option>
|
||||
<option value="April">April</option>
|
||||
<option value="May">May</option>
|
||||
<option value="June">June</option>
|
||||
<option value="July">July</option>
|
||||
<option value="August">August</option>
|
||||
<option value="September">September</option>
|
||||
<option value="October">October</option>
|
||||
<option value="November">November</option>
|
||||
<option value="December">December</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-md-2 col-md-offset-1"><br>
|
||||
<input type="submit" class="btn btn-success" name="btn_submit"
|
||||
value="View Report">
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div>
|
||||
<table class="table table-bordered table-hover" id="cc" style="font-size:14px;">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
|
||||
<th>S.No</th>
|
||||
<th>OrderedDate</th>
|
||||
<th>DispatchDate</th>
|
||||
<th>CustomerName</th>
|
||||
<th>InvoiceNumber</th>
|
||||
<th>OrderedQuantity</th>
|
||||
<th>DispatchQuantity</th>
|
||||
<th>Rating</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if(!empty($per)){
|
||||
$tr3=0;
|
||||
$tr4=0;
|
||||
$last = $this->uri->total_segments();
|
||||
$ab=$this->uri->segment($last);
|
||||
$i=0;
|
||||
foreach($per as $rel)
|
||||
{
|
||||
?>
|
||||
<tr>
|
||||
|
||||
<td style="text-align:right"><span><?php echo ++$i;?></span></td>
|
||||
<td ><?php
|
||||
$itemdate=date("d-m-Y",strtotime($rel->invoice_date_created));
|
||||
echo $itemdate;
|
||||
?>
|
||||
</td>
|
||||
<td ><?php
|
||||
$invoicedate=date("d-m-Y",strtotime($rel->invoice_date_created));
|
||||
echo $invoicedate;
|
||||
?>
|
||||
</td>
|
||||
|
||||
<td style="text-align:left;"><?php echo ($rel->client_name);?></td>
|
||||
<td style="text-align:center;"><?php echo ($rel->invoice_number); ?></td>
|
||||
|
||||
|
||||
<td class="amount"><?php
|
||||
|
||||
echo number_format(round($rel->qty));
|
||||
?></td>
|
||||
|
||||
<td class="amount"><?php
|
||||
$tr2= $tr2 + round($rel->qty);
|
||||
echo number_format(round($rel->qty));
|
||||
?></td>
|
||||
|
||||
|
||||
|
||||
|
||||
<td style="text-align:right;"><?php
|
||||
$OrderedQuantity= round($rel->qty);
|
||||
$DispatchQuantity= round($rel->qty);
|
||||
$Rating =$DispatchQuantity / $OrderedQuantity *100;
|
||||
|
||||
|
||||
echo number_format($Rating, 2, '.', ' ') ; ?></td>
|
||||
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
|
||||
?>
|
||||
</tbody>
|
||||
<tfoot width="100%">
|
||||
|
||||
</tfoot>
|
||||
<?php
|
||||
}
|
||||
|
||||
?>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box -->
|
||||
</div>
|
||||
<!-- /.col -->
|
||||
</div>
|
||||
|
||||
|
||||
<script src="https://cdn.datatables.net/buttons/1.4.2/js/dataTables.buttons.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/pdfmake.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/vfs_fonts.js"></script>
|
||||
<script src="https://cdn.datatables.net/buttons/1.4.2/js/buttons.html5.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/buttons/1.4.2/js/buttons.colVis.min.js"></script>
|
||||
|
||||
<script>
|
||||
|
||||
|
||||
// Bootstrap datepicker
|
||||
// Set up your table
|
||||
$(document).ready(function() {
|
||||
table = $('#cc').DataTable( {
|
||||
"dom": "<'row'<'col-md-6'l><'col-md-6'Bf>>" +
|
||||
"<'row'<'col-md-6'><'col-md-6'>>" +
|
||||
"<'row'<'col-md-12't>><'row'<'col-md-4'i><'col-md-8'p>>",
|
||||
buttons: [
|
||||
|
||||
{
|
||||
extend: 'excelHtml5',
|
||||
footer: 'true',
|
||||
//messageTop: $('h3').text(),
|
||||
title: $('h3').text(),
|
||||
exportOptions: {
|
||||
columns: ':visible'
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
'colvis'
|
||||
]
|
||||
} );
|
||||
} );
|
||||
$('#mySelect').on('change',function(){
|
||||
|
||||
table
|
||||
.column(4)
|
||||
.search(this.value)
|
||||
.draw();
|
||||
});
|
||||
|
||||
$( function() {
|
||||
//var dateFormat = "mm/dd/yy",
|
||||
from = $( "#min-date" )
|
||||
.datepicker({
|
||||
dateFormat: "dd-mm-yy",
|
||||
defaultDate: "+0d",
|
||||
changeMonth: true,
|
||||
//numberOfMonths: 1
|
||||
|
||||
})
|
||||
.on( "change", function() {
|
||||
to.datepicker("option", "minDate", getDate( this ) );
|
||||
}),
|
||||
to = $( "#max-date" ).datepicker({
|
||||
dateFormat: "dd-mm-yy",
|
||||
defaultDate: "+0d",
|
||||
changeMonth: true,
|
||||
//numberOfMonths: 1
|
||||
|
||||
})
|
||||
.on( "change", function() {
|
||||
from.datepicker( "option", "maxDate", getDate( this ) );
|
||||
});
|
||||
|
||||
function getDate( element ) {
|
||||
var date;
|
||||
|
||||
try {
|
||||
date = $.datepicker.parseDate( dateFormat, element.value );
|
||||
|
||||
} catch( error ) {
|
||||
date = null;
|
||||
}
|
||||
|
||||
return date;
|
||||
}
|
||||
} );
|
||||
|
||||
function Reset()
|
||||
{
|
||||
$('#mySelect').val('');
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
@ -44,6 +44,8 @@
|
||||
<a href="<?php echo base_url(); ?>Report_cumulative_inward" target="_blank" >Cumulative Report-Inward<p class="uk-text uk-margin-remove"></p></a>
|
||||
<a href="<?php echo base_url(); ?>Report_cumulative_raw" target="_blank" >Cumulative Report - Category Wise-Inward<p class="uk-text uk-margin-remove"></p></a>
|
||||
<a href="<?php echo base_url(); ?>Report_consolidate_category" target="_blank" >Consolidate Report - Category Wise-Inward<p class="uk-text-meta uk-margin-remove"></p></a>
|
||||
|
||||
<a href="<?php echo base_url(); ?>DeliverPerformance" target="_blank" > Report - DeliverPerformances<p class="uk-text-meta uk-margin-remove"></p></a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user