Material inward Register

This commit is contained in:
venbatechnologies 2018-03-08 12:22:07 +05:30
parent dec9e33cda
commit 7a4bcc30c9
8 changed files with 480 additions and 4 deletions

View File

@ -244,6 +244,12 @@ $route['Report_cumulative_raw'] = "report/rawi_cumulative";
$route['Report_consolidate_category'] = "report/rawi_consolidate";
$route['Report_pending_purchase'] = "report/pending_purchase";
$route['Report_Material_inward_Register'] ="user/getMaterialInwardRegister";
$route['Empperform']="report/per";
// Company Information
@ -271,5 +277,21 @@ $route['addNewdepartment'] = "department/addNewdepartment";
$route['editOlddepartment'] = "department/viewdepartment";
$route['editOlddepartment/(:num)'] = "department/viewdepartment/$1";
$route['editdepartment'] = "department/editdepartment";
/* End of file routes.php */
/* Location: ./application/config/routes.php */
/* Location: ./application/config/routes.php */

View File

@ -1309,6 +1309,45 @@ function Adduserdepartment()
$this->loadViews("404", $this->global, NULL, NULL);
}
/////////////* this function used to Material Inward Register report controller parts*//////////////////////
function getMaterialInwardRegister()
{
$ab=$this->input->post('financialyear');
$fa=substr($ab,0,-5);
$aa=substr($ab,5,5);
$m=$this->input->post('month');
$data['getMaterialInwardRegister']=$this->user_model->getMaterialInwardRegister($fa,$aa,$m);
$data['finyear']=$this->user_model->finyear();
$this->global['pageTitle'] = 'Resico : MaterialInwardRegister';
$this->loadViews("Report_Material_inward_Register", $this->global,$data,NULL);
}
}
?>

View File

@ -176,7 +176,7 @@ ifnull(Po.Quantity,0) as POQTY,sta.StatusName
{
$this->db->select('MaterialCode, MaterialName,UOM');
$this->db->from('T_MaterialMaster');
//$this->db->where('MaterialType',$ReqType );
$this->db->where('IsActive',1);
$query = $this->db->get();
if($NotArray == '')

View File

@ -212,6 +212,87 @@ class User_model extends CI_Model
$query = $this->db->get();
return $query->result();
}
/* this function used to Material Inward Register report Model parts*/
function getMaterialInwardRegister($fa,$aa,$m)
{
$sql="select poli.Quantity,poli.ReceivedQuantity,poli.AmendmentQuantity,poli.Per,
igrm.DeliveryChellanOrInvoiceNo,igrm.DeliveryChellanDate,igrm.VehicleNo,igrm.IGRStatus,igrm.CreatedDate,mm.MaterialCode,
mm.MaterialName,sd.SupplierID,sd.SupplierName,sd.Address
from T_PurchaseOrder_LineItem as poli
join T_PurchaseOrder_Master as pom on pom.PONO =poli.PONO
join T_IGR_Master as igrm on igrm.PONO = poli.PONO
join T_IGR_Details as igrd on igrd.IGRNO = igrm.IGRNO
join T_MaterialMaster as mm on mm.MaterialCode = poli.MaterialCode
join T_SupplierDetailsN as sd on sd.SupplierID =pom.SupplierID
where igrm.IGRStatus ='ST027'";
if ($fa and $aa != ''){
$sql.=" and (igrm.CreatedDate >= '".$fa."-04-01' and igrm.CreatedDate <= '".$aa."-03-31')";
}
if ($m!= ''){
$sql.="and monthname(igrm.CreatedDate) = '".$m."'";
}
$sql.="order by igrm.CreatedDate";
$query = $this->db->query($sql);
return $query->result();
}
function finyear(){
$sql="SELECT
CASE WHEN MONTH(CreatedDate)>=4 THEN
concat(YEAR(CreatedDate), '-',YEAR(CreatedDate)+1)
ELSE concat(YEAR(CreatedDate)-1,'-', YEAR(CreatedDate)) END AS financial_year
FROM T_IGR_Details
GROUP BY financial_year";
$query = $this->db->query($sql);
return $query->result();
}
}

View File

@ -0,0 +1,333 @@
<!-- <link rel="stylesheet" href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css"> -->
<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: #5d0411;
border-color: #5d0411;
}
</style>
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content"><br/>
<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:#5d0411;"><b>Report - Material-Inward-Register</b><br><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 ="row"> -->
<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($finyear 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" style="padding:2%;">
<input type="submit" class="btn btn-success" name="btn_submit"
value="View Report">
</div> <!-- </div> -->
</div>
</form>
</div>
<div class="box-body">
<div>
<table class="table table-bordered table-hover" id="cc" style="font-size:12px;">
<thead>
<tr>
<th style="text-align:center">S.NO</th>
<th style="text-align:center">Date</th>
<th style="text-align:center">CustomerName</th>
<th style="text-align:center">Description</th>
<th style="text-align:center">Uom</th>
<th style="text-align:center">Invoice Quantity</th>
<th style="text-align:center">Received Quantity</th>
<th style="text-align:center">Shortage Quantity</th>
<th style="text-align:center">Excess Quantity</th>
<th style="text-align:center">Invoice Delivery Challan No</th>
<th style="text-align:center">invoice Delivery Challan Date</th>
<th style="text-align:center">Vehicle No</th>
<th style="text-align:center">Time Inward</th>
<!-- <th style="text-align:center">Time Outward</th> -->
</tr>
</thead>
<tbody>
<?php
$i=0;
foreach($getMaterialInwardRegister as $gmir)
{
?>
<tr>
<td style="text-align:center;"><?php echo ++$i;?></td>
<td ><?php
$CreatedDate=date("d-m-Y",strtotime($gmir->CreatedDate));
echo $CreatedDate;
?>
</td>
<!-- <td><?php echo $gmir->CreatedDate;?></td> -->
<td><?php echo $gmir->SupplierName;?></td>
<td><?php echo $gmir->MaterialName;?></td>
<td><?php echo $gmir->Per;?></td>
<td><?php echo $gmir->Quantity;?></td>
<td><?php echo $gmir->ReceivedQuantity;?></td>
<td style="text-align:right;"><?php
$Quantity= round($gmir->Quantity);
$ReceivedQuantity= round($gmir->ReceivedQuantity);
$Shortage=$Quantity - $ReceivedQuantity;
echo $Shortage; ?></td>
<!-- number_format($Rating, 2, '.', ' ') -->
<!-- h:i:sa -->
<td><?php echo $gmir->AmendmentQuantity;?></td>
<td><?php echo $gmir->DeliveryChellanOrInvoiceNo;?></td>
<td><?php echo $gmir->DeliveryChellanDate;?></td>
<td><?php echo $gmir->VehicleNo;?></td>
<td ><?php
$time=date("g:i",strtotime($gmir->DeliveryChellanDate));
echo $time;
?>
</td>
</tr>
<?php
}
?>
</tbody>
<tfoot width="100%">
<tr>
</tr>
</tfoot>
<?php
//}
?>
</table>
</div>
</div>
</div>
<!-- /.box -->
</div>
<!-- /.col -->
</div>
</section>
</div>
<!-- <script src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script> -->
<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: 'Report - Supplier-Wise',
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>

View File

@ -155,7 +155,7 @@
<div class="col-md-3">
<div class="form-group">
<label for="conversionfactor">Conversion Factor</label>
<input type="text" class="form-control" id="conversionfactor" name="conversionfactor" maxlength="255" onkeypress="return onlyAlphabets(event);">
<input type="text" class="form-control" id="conversionfactor" name="conversionfactor" maxlength="255" >
</div>
</div>
<div class="col-md-3">

View File

@ -161,7 +161,7 @@ if(!empty($materialDetails))
<div class="col-md-3">
<div class="form-group">
<label for="conversionfactor">Conversion Factor</label>
<input type="text" class="form-control" id="conversionfactor" name="conversionfactor" maxlength="255" value="<?php echo $conversionfactor;?>" onkeypress="return isNumberKey(event);">
<input type="text" class="form-control" id="conversionfactor" name="conversionfactor" maxlength="255" value="<?php echo $conversionfactor;?>" >
</div>
</div>
<div class="col-md-3">

View File

@ -53,6 +53,7 @@
<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(); ?>Report_Material_inward_Register" target="_blank" >Report - Material-Inward-Register<p class="uk-text-meta uk-margin-remove"></p></a>
</div>
</div>