stock history
This commit is contained in:
parent
de37cb51aa
commit
6de86b73f6
@ -339,6 +339,8 @@ $route['poresetview']="purchaseorder/poresetview";
|
||||
|
||||
$route['FinalProduct'] = "batchcard/FinalProductCalculation";
|
||||
|
||||
$route['FinalProductHistory'] = "batchcard/FinalProductHistory";
|
||||
|
||||
$route['FinalProductlisting'] = "batchcard/FinalProductlisting";
|
||||
|
||||
$route['MaterailAdjustment'] = "batchcard/MaterailAdjustment";
|
||||
|
||||
@ -1321,6 +1321,16 @@ class batchcard extends BaseController
|
||||
}
|
||||
|
||||
|
||||
|
||||
function FinalProductHistory()
|
||||
{
|
||||
|
||||
$data['inv_final_product'] = $this->batchcard_model->getinvoice_products();
|
||||
$this->global['pageTitle'] = 'Siddharth : Final Product';
|
||||
$this->loadViews("FinalProductHistory", $this->global,$data,NULL);
|
||||
}
|
||||
|
||||
|
||||
function MaterailAdjustment()
|
||||
{
|
||||
$data['MaterialCode'] = $this->batchcard_model->getMaterial();
|
||||
@ -1358,6 +1368,23 @@ class batchcard extends BaseController
|
||||
|
||||
|
||||
|
||||
function getFinishedProduct()
|
||||
{
|
||||
$starting_date = $this->input->post('from_date');
|
||||
$end_date = $this->input->post('to_date');
|
||||
$product_id = $this->input->post('productid');
|
||||
|
||||
$productlist = $this->batchcard_model->GetFinishedProductList($starting_date,$end_date,$product_id);
|
||||
|
||||
$obj=json_encode($productlist);
|
||||
echo $obj;
|
||||
|
||||
//print_r($productlist);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// function displaying_stockvalues()
|
||||
// {
|
||||
// $MaterialCode = $this->input->post('MaterialCode');
|
||||
@ -1459,7 +1486,7 @@ class batchcard extends BaseController
|
||||
$product_value = $this->input->post('values');
|
||||
$createdby = $this->session->userdata('userId');
|
||||
|
||||
$final_master =array('MaterialCode'=>$final_product,'Quantity'=>$final_qty,'Price'=>$product_value,'CreatedBy'=>$createdby,'ProductDate'=>$pdt);
|
||||
$final_master =array('MaterialCode'=>$final_product,'Quantity'=>$final_qty,'Price'=>$product_value,'CreatedBy'=>$createdby,'ProductDate'=>$pdt,'ProductType'=>'Inward');
|
||||
|
||||
$final_master_save =$this->batchcard_model->insert_final_product($final_master);
|
||||
|
||||
|
||||
@ -1108,6 +1108,29 @@ and CreatedOn >= ? and CreatedOn<=? and SupplierID=? group by Addqty';
|
||||
$r = $this->db->affected_rows();
|
||||
return $r;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function GetFinishedProductList($starting_date,$end_date,$product_id)
|
||||
{
|
||||
|
||||
|
||||
$subQuery ='select ip_products.product_id,ip_products.product_name,ip_invoices.invoice_id,ip_invoice_items.item_quantity,ip_invoice_items.item_price,ip_invoices.invoice_number as IDnumber,ip_invoices.receivedstatus as Type from ip_products join ip_invoice_items on ip_products.product_id = ip_invoice_items.item_product_id join ip_invoices on ip_invoice_items.invoice_id = ip_invoices.invoice_id
|
||||
join T_FinalProduct_Master on ip_products.product_id = T_FinalProduct_Master.MaterialCode where (ip_invoices.invoice_date_modified>=? and ip_invoices.invoice_date_modified<=? and ip_invoice_items.item_product_id=?) union
|
||||
|
||||
select ip_products.product_id,ip_products.product_name,T_FinalProduct_Master.FPId,T_FinalProduct_Master.Quantity,T_FinalProduct_Master.Price,T_FinalProduct_Master.FPId as IDnumber,T_FinalProduct_Master.ProductType as Type from ip_products join ip_invoice_items on ip_products.product_id = ip_invoice_items.item_product_id
|
||||
join T_FinalProduct_Master on ip_products.product_id = T_FinalProduct_Master.MaterialCode where
|
||||
(T_FinalProduct_Master.ProductDate<=? and T_FinalProduct_Master.ProductDate>=? and T_FinalProduct_Master.MaterialCode=?) group by FPId';
|
||||
|
||||
$query = $this->db->query($subQuery,array($starting_date,$end_date,$product_id,$end_date,$starting_date,$product_id));
|
||||
|
||||
//print_r($this->db->last_query());
|
||||
|
||||
|
||||
return $query->result_array();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
256
application/views/FinalProductHistory.php
Normal file
256
application/views/FinalProductHistory.php
Normal file
@ -0,0 +1,256 @@
|
||||
<style type="text/css">
|
||||
[contenteditable=true]:empty:before{
|
||||
content: attr(placeholder);
|
||||
display: block; /* For Firefox */
|
||||
|
||||
}
|
||||
</style>
|
||||
|
||||
<style type="text/css">
|
||||
.select2
|
||||
{
|
||||
width: 100% ! important;
|
||||
}
|
||||
.num{
|
||||
text-align:right;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
|
||||
$(function() {
|
||||
|
||||
|
||||
$("#DEPTFN").select2();
|
||||
|
||||
var MaxDate = '<?php echo $MaxPoDate;?>';
|
||||
var d = new Date(MaxDate);
|
||||
var t='<?php echo $CurrentDate;?>';
|
||||
var m=new Date(t);
|
||||
|
||||
$("#fromDate").datepicker({
|
||||
minDate : d,
|
||||
//maxDate : 'now',
|
||||
dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true,yearRange: '-100:+0'
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
$("#toDate").datepicker({
|
||||
minDate : d,
|
||||
//maxDate : 'now',
|
||||
dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true,yearRange: '-100:+0'
|
||||
});
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<!-- dsfdgfhggh -->
|
||||
|
||||
|
||||
<div class="content-wrapper">
|
||||
<section class="content" style="font-size: 12px;">
|
||||
<div id="content"></div>
|
||||
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<center><h3 class="box-title">Siddharth Industries - Final Product History</h3></center>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body">
|
||||
|
||||
|
||||
<div class="container-fluid">
|
||||
|
||||
<div id="content"></div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<?php
|
||||
$attributes = array('class' => 'form-label-left final_product ','name' => 'final_product','id' => 'final_product');
|
||||
|
||||
echo form_open($this->config->base_url().'/batchcard/Final+Product/',$attributes);
|
||||
?>
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-3">
|
||||
|
||||
<label>Final Product</label>
|
||||
|
||||
<?php
|
||||
|
||||
$options2= array("0"=>'Select Material');
|
||||
|
||||
if(!empty($inv_final_product))
|
||||
{
|
||||
foreach ($inv_final_product as $SID):
|
||||
|
||||
|
||||
$options2[$SID->product_id] = $SID->product_id.' '.' - '.' '.$SID->product_name;
|
||||
|
||||
endforeach;
|
||||
}
|
||||
|
||||
echo form_dropdown('DEPTFN', $options2,set_value('DEPTFN',$SupId),'id="DEPTFN"' ,'required="true"' ,'class="form-control select2');
|
||||
|
||||
?>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<label>From Date</label>
|
||||
<div class="input-group">
|
||||
<?php
|
||||
$data = array('name' => 'fromDate','value' => set_value('fromDate',$CurrentDate),'id'=>'fromDate', 'class' => 'form-control' ,'required' => 'true', 'onkeypress'=>'return false;');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-3">
|
||||
<label>To Date</label>
|
||||
<div class="input-group">
|
||||
<?php
|
||||
$data = array('name' => 'toDate','value' => set_value('toDate',$CurrentDate),'id'=>'toDate', 'class' => 'form-control' ,'required' => 'true', 'onkeypress'=>'return false;');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!-- <div class="col-md-3">
|
||||
|
||||
<div class="form-group">
|
||||
|
||||
<a class="btn btn-primary Save" ID="Save" onclick="Save()" > <span class="bold">Get Details</span></a>
|
||||
</div>
|
||||
|
||||
</div> -->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-12" >
|
||||
|
||||
<div class="col-md-offset-8">
|
||||
|
||||
<!-- <a class="btn btn-primary Save" ID="Save" onclick="GetDetail()" > <span class="bold">Get Details</span></a> -->
|
||||
|
||||
|
||||
<a class="btn btn-primary Save" ID="Save" onclick="GetDetail()" > <span class="bold">Go</span></a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table class="table table-striped table-condensed no-margin" id="tab">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Invoice ID/Final Product ID</th>
|
||||
<th>Product Code</th>
|
||||
<th>Product Name</th>
|
||||
<th>Price</th>
|
||||
<th>Quantity</th>
|
||||
<th>Type</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody id="table_value">
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
function GetDetail()
|
||||
{
|
||||
|
||||
// alert()
|
||||
var from_date = $('#fromDate').val();
|
||||
var fdate = from_date.split("-").reverse().join("-");
|
||||
var to_date = $('#toDate').val();
|
||||
var tdate = to_date.split("-").reverse().join("-");
|
||||
var product = $('#DEPTFN').val();
|
||||
|
||||
if(fdate !='' && product!= '' && tdate != '')
|
||||
{
|
||||
$.ajax(
|
||||
{
|
||||
|
||||
data:{productid:product,from_date:fdate,to_date:tdate},
|
||||
dataType:'json',
|
||||
type:"POST",
|
||||
url:"<?php echo base_url() ?>batchcard/getFinishedProduct",
|
||||
success:function(data)
|
||||
{
|
||||
|
||||
//alert(data);
|
||||
var tble='';
|
||||
$.each(data,function (i,item)
|
||||
{
|
||||
i=i+1;
|
||||
var datatype = '';
|
||||
var idno = '';
|
||||
|
||||
|
||||
if(item.Type == 'Inward')
|
||||
{
|
||||
datatype = "Final Product";
|
||||
idno = "FP"+item.IDnumber;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
datatype = "Invoice";
|
||||
idno = item.IDnumber;
|
||||
}
|
||||
|
||||
tble +='<tr class="amount">'+
|
||||
'<td>'+idno+'</td>'+
|
||||
'<td>'+item.product_id+'</td>'+
|
||||
'<td>'+item.product_name+'</td>'+
|
||||
'<td>'+item.item_price+'</td>'+
|
||||
'<td>'+item.item_quantity+'</td>'+
|
||||
'<td>'+datatype+'</td>'+
|
||||
'</tr>';
|
||||
|
||||
});
|
||||
|
||||
$("#table_value").html(tble);
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
alert('Please Select All The Values');
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
@ -402,7 +402,7 @@ display: none;
|
||||
<li class="treeview">
|
||||
<a href="#">
|
||||
<i class="fa fa-check-square-o"></i>
|
||||
<span>Store Details</span>
|
||||
<span>Stock Details</span>
|
||||
<span class="pull-right-container">
|
||||
<i class="fa fa-angle-down pull-right"></i>
|
||||
</span>
|
||||
@ -412,17 +412,27 @@ display: none;
|
||||
|
||||
|
||||
|
||||
<li class="treeview">
|
||||
<!-- <li class="treeview">
|
||||
<a href="<?php echo base_url(); ?>Stock">
|
||||
<i class="fa fa-dashboard"></i> <span>Stock</span>
|
||||
</a>
|
||||
</li>
|
||||
</li> -->
|
||||
<li>
|
||||
<a href="<?php echo base_url(); ?>FinalProduct">
|
||||
<i class="fa fa-dashboard"></i> <span>Final Product</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a href="<?php echo base_url(); ?>FinalProductHistory">
|
||||
<i class="fa fa-dashboard"></i> <span>Finished Product History</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a href="<?php echo base_url(); ?>FinalProduct">
|
||||
<i class="fa fa-dashboard"></i> <span>Final Product Listing</span>
|
||||
@ -463,11 +473,11 @@ else{
|
||||
<ul class="treeview-menu">
|
||||
|
||||
|
||||
<li class="treeview">
|
||||
<!-- <li class="treeview">
|
||||
<a href="<?php echo base_url(); ?>Stock">
|
||||
<i class="fa fa-dashboard"></i> <span>Stock </span>
|
||||
</a>
|
||||
</li>
|
||||
</li> -->
|
||||
|
||||
<li>
|
||||
<a href="<?php echo base_url(); ?>FinalProduct">
|
||||
@ -475,6 +485,15 @@ else{
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a href="<?php echo base_url(); ?>FinalProductHistory">
|
||||
<i class="fa fa-dashboard"></i> <span>Finished Product History</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="<?php echo base_url(); ?>FinalProductlisting">
|
||||
<i class="fa fa-dashboard"></i> <span>Final Product Listing</span>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user