currentstock

This commit is contained in:
gandhimathi 2018-05-31 14:31:52 +05:30
parent 1f86b079f3
commit d21d19ed95
6 changed files with 36 additions and 9 deletions

View File

@ -259,6 +259,7 @@ else
}
$data['materialDetails'] = $this->rawmaterialdetails_model->getMaterialDetails($RawMaterialID);
$data['currentstock'] = $this->rawmaterialdetails_model->getMaterialstock($RawMaterialID);
$data['materialType'] = $this->rawmaterialdetails_model->getmaterialType($MaterialType );
$data['materialCategory'] = $this->rawmaterialdetails_model->getmaterialCategory($MaterialCategory);
$data['UOMList'] = $this->rawmaterialdetails_model->getUOM($UOM);

View File

@ -119,6 +119,16 @@ class rawmaterialdetails_model extends CI_Model
return $query->result();
}
function getMaterialstock($MaterialCode)
{
$subquery="SELECT SUM(IF(Transaction_type='Add',Quantity,0)) - SUM(IF(Transaction_type='Reduce',Quantity,0))as remainingqty
FROM T_Material_stock_history
where MaterialCode='$MaterialCode'";
$query = $this->db->query($subquery);
return $query->result();
}
function getAssetcode()
{
$this->db->select('AssetCode,AssetName');

View File

@ -182,7 +182,7 @@ $(function() {
</div>
<div class="col-md-3">
<div class="form-group">
<label for="conversionfactor">Open Stock</label>
<label for="conversionfactor">Opening Stock</label>
<input type="text" class="form-control" id="openstock" name="openstock" maxlength="255">
</div>
</div>

View File

@ -129,8 +129,8 @@ foreach($financialyear as $item)
<th>PONO</th>
<th>Supplier Name</th>
<th>Total PO Amount (&#8377;)</th>
<th>Balance To Pay (&#8377;)</th>
<th>Amount Paid (&#8377;)</th>
<th>Balance payable (&#8377;)</th>
<th>Balance Paid (&#8377;)</th>
</tr>
</thead>
<tbody>

View File

@ -44,7 +44,7 @@ foreach($financialyear as $item)
<div class="box-body">
<form method="post" action="<?php echo base_url($this->uri->uri_string()); ?>">
<center><h3 class="box-title"><p style="color:#3c8dbc"><b>view Invoice</b></p></h3></center>
<center><h3 class="box-title"><p style="color:#3c8dbc"><b>View Invoice</b></p></h3></center>
@ -133,8 +133,8 @@ foreach($financialyear as $item)
<th>Invoice Number</th>
<th>Customer Name</th>
<th>Invoice Amount (&#8377;)</th>
<th>Balance To Received</th>
<th>AmountReceived</th>
<th> Balance Receivable</th>
<th> Amount Received</th>
</tr>
</thead>
<tbody>

View File

@ -51,6 +51,16 @@ if(!empty($materialDetails))
}
}
if(!empty($currentstock))
{
foreach ($currentstock as $MC)
{
// print_r($currentstock);
// die();
$currentstock =$MC->remainingqty;
}
}
?>
<script>
@ -211,7 +221,7 @@ $("#Date").datepicker({
?>
<div class="col-md-3">
<div class="form-group autoSearch" id="mc">
<label for="Matcate">Open Stock</label>
<label for="Matcate">Opening Stock</label>
<input type="text" class="form-control required " id="openstock" readonly name="openstock" value="<?php echo $openstock;?>" maxlength="255">
</div>
@ -223,7 +233,7 @@ $("#Date").datepicker({
?>
<div class="col-md-3">
<div class="form-group">
<label for="conversionfactor">Open Stock</label>
<label for="conversionfactor">Opening Stock</label>
<input type="text" class="form-control" id="openstock" name="openstock" maxlength="255">
</div>
</div>
@ -266,8 +276,14 @@ $("#Date").datepicker({
</div>
<div class="col-md-12">
<div class="col-md-3">
<div class="form-group">
<label for="conversionfactor">Current Stock</label>
<input type="text" class="form-control" id="currentstock" readonly value="<?php echo $currentstock; ?>" name="currentstock" maxlength="255">
</div>
</div>
<div class="col-md-6">
<div class="col-md-4">
<div class="form-group">
<label for="remarks">Remarks</label>
<input type="text" class="form-control" id="remarks" name="remarks" maxlength="255" value="<?php echo $remarks;?>">