adjustment list
This commit is contained in:
parent
c3439d9d41
commit
fd8dfca1e9
@ -1340,6 +1340,20 @@ class batchcard extends BaseController
|
||||
// echo $Supplier;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function displaying_stockvalues()
|
||||
{
|
||||
$MaterialCode = $this->input->post('MaterialCode');
|
||||
$date = $this->input->post('date');
|
||||
|
||||
$Qtyarray = $this->batchcard_model->GettotalQty($MaterialCode,$date);
|
||||
//print_r($Qtyarray);
|
||||
$obj=json_encode($Qtyarray);
|
||||
echo $obj;
|
||||
|
||||
}
|
||||
|
||||
function addNewMaterialHistory()
|
||||
{
|
||||
$supplier = $this->input->post('supplier');
|
||||
|
||||
@ -610,6 +610,46 @@ class batchcard_model extends CI_Model
|
||||
}
|
||||
|
||||
|
||||
|
||||
function GettotalQty($MaterialCode,$date)
|
||||
{
|
||||
echo $model;
|
||||
$dt = date('d',strtotime($date));
|
||||
$year = date('Y', strtotime($date));
|
||||
$month = date('m', strtotime($date));
|
||||
if($month<04)
|
||||
{
|
||||
//echo "b4finance";
|
||||
$newyr = $year - 1;
|
||||
$startdate = $newyr.'-'.'04'.'-'.'01';
|
||||
|
||||
//echo $startdate;
|
||||
}
|
||||
else
|
||||
{
|
||||
//echo "after Finance";
|
||||
$startdate = $year.'-'.'04'.'-'.'01';
|
||||
// echo $startdate;
|
||||
}
|
||||
|
||||
$nedt= $dt;
|
||||
|
||||
$newdate=$year.'-'.$month.'-'.$nedt;
|
||||
|
||||
$subQuery='select T_MaterialMaster.MaterialName,T_Material_stock_history.MaterialCode,ifnull((select ifnull(sum(Quantity),0) as AddQty from T_Material_stock_history
|
||||
where Transaction_type = "Add" and MaterialCode=?),0) as Addqty,
|
||||
ifnull((select ifnull(sum(Quantity),0) as ReduceQty from T_Material_stock_history where Transaction_type = "Reduce"
|
||||
and MaterialCode=?),0) as ReduceQty from T_Material_stock_history join T_MaterialMaster on T_Material_stock_history.MaterialCode=T_MaterialMaster.MaterialCode where T_Material_stock_history.MaterialCode=?
|
||||
and CreatedOn >= ? and CreatedOn<=? group by Addqty';
|
||||
|
||||
$query = $this->db->query($subQuery,array($MaterialCode,$MaterialCode,$MaterialCode,$startdate,$newdate));
|
||||
//print_r($this->db->last_query());
|
||||
return $query->result_array();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
function GetNetQty($MaterialCode,$date,$Supplier)
|
||||
{
|
||||
//echo $date;
|
||||
|
||||
@ -1196,10 +1196,10 @@ $(function() {
|
||||
<script type="text/html" id="packable">
|
||||
<tr id="<%=counterindex%>">
|
||||
<td align="left"><%=counterindex%></td>
|
||||
<td align="left" id="packmaterial<%=rootindex%>"><%=Material%></td>
|
||||
<td align="left" id="packsuppliername<%=rootindex%>"><%=Supplier%></td>
|
||||
<td align="left" id="packQuantiy<%=rootindex%>"><%=Quantity%></td>
|
||||
<td align="left" id="packmaterialPrice<%=rootindex%>"><%=Price%></td>
|
||||
<td align="left" id="packmaterial<%=counterindex%>"><%=Material%></td>
|
||||
<td align="left" id="packsuppliername<%=counterindex%>"><%=Supplier%></td>
|
||||
<td align="left" id="packQuantiy<%=counterindex%>"><%=Quantity%></td>
|
||||
<td align="left" id="packmaterialPrice<%=counterindex%>"><%=Price%></td>
|
||||
|
||||
|
||||
<td>
|
||||
|
||||
@ -427,7 +427,7 @@ $(function() {
|
||||
|
||||
<input type="hidden" name="<?php echo 'rawprice'.$index ?>" id="<?php echo 'rawprice'.$index ?>" value="<?php echo $raw->Price ; ?>" readonly/>
|
||||
|
||||
<td> <a data-target='#EditItem' data-id="<?php echo $index ; ?>" data-userid="<?php echo $index ; ?>" data-toggle="modal" href="#EditItem"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit;"></i> </a> <a href='#' onclick = "DeleteactionRow(<?php echo $index?>);" class="link" data-id="<?php echo $index ; ?>" data-userid="<?php echo $index ; ?>" id="Del" ><span class="glyphicon glyphicon-trash"></span></a></td>
|
||||
<td> <a data-target='#EditItem' data-id="<?php echo $index ; ?>" data-userid="<?php echo $index ; ?>" data-toggle="modal" href="#EditItem"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit;"></i> </a> <!-- <a href='#' onclick = "DeleteactionRow(<?php echo $index?>);" class="link" data-id="<?php echo $index ; ?>" data-userid="<?php echo $index ; ?>" id="Del" ><span class="glyphicon glyphicon-trash"></span></a> --></td>
|
||||
</tr>
|
||||
<?php }} ?>
|
||||
|
||||
@ -665,7 +665,7 @@ $(function() {
|
||||
<td id="consumaterialPrice<?php echo $inde?>"><?php echo $cou->Price?></td>
|
||||
<td>
|
||||
|
||||
<a data-target='#EditRootCausemodal' data-id="<?php echo $inde ; ?>" data-userid="<?php echo $inde ; ?>" data-toggle="modal" href="#EditRootCausemodal"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit;"></i> </a> <a href='#' onclick = "DeleteCounterRow(<?php echo $in ; ?>)" class="link" data-id="<?php echo $inde ; ?>" data-userid="<?php echo $in ; ?>" id="Del" ><span class="glyphicon glyphicon-trash"></span></a>
|
||||
<a data-target='#EditRootCausemodal' data-id="<?php echo $inde ; ?>" data-userid="<?php echo $inde ; ?>" data-toggle="modal" href="#EditRootCausemodal"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit;"></i> </a> <!-- <a href='#' onclick = "DeleteCounterRow(<?php echo $in ; ?>)" class="link" data-id="<?php echo $inde ; ?>" data-userid="<?php echo $in ; ?>" id="Del" ><span class="glyphicon glyphicon-trash"></span></a> -->
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
@ -912,7 +912,7 @@ $(function() {
|
||||
<td id="packmaterialPrice<?php echo $intt?>"><?php echo $pac->Price?></td>
|
||||
<td>
|
||||
|
||||
<a data-target='#EditCounter' data-id="<?php echo $intt ; ?>" data-userid="<?php echo $intt ; ?>" data-toggle="modal" href="#EditCounter"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit;"></i> </a> <a href='#' onclick = "DeleteCounterRow(<?php echo $intt ; ?>)" class="link" data-id="<?php echo $intt ; ?>" data-userid="<?php echo $intt ; ?>" id="Del" ><span class="glyphicon glyphicon-trash"></span></a>
|
||||
<a data-target='#EditCounter' data-id="<?php echo $intt ; ?>" data-userid="<?php echo $intt ; ?>" data-toggle="modal" href="#EditCounter"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit;"></i> </a> <!-- <a href='#' onclick = "DeleteCounterRow(<?php echo $intt ; ?>)" class="link" data-id="<?php echo $intt ; ?>" data-userid="<?php echo $intt ; ?>" id="Del" ><span class="glyphicon glyphicon-trash"></span></a> -->
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@ -1173,7 +1173,7 @@ $(function() {
|
||||
<input type="hidden" name="<?php echo 'Copprice'.$ind ?>" id="<?php echo 'Copprice'.$ind ?>" value="<?php echo $dis['Price'] ; ?>" readonly/>
|
||||
|
||||
|
||||
<td> <a data-target='#EditCoproduct' data-id="<?php echo $ind ; ?>" data-userid="<?php echo $ind ; ?>" data-toggle="modal" href="#EditCoproduct"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit;"></i> </a> <a href='#' onclick = "DeleteactionRow(<?php echo $ind?>);" class="link" data-id="<?php echo $ind ; ?>" data-userid="<?php echo $ind ; ?>" id="Del" ><span class="glyphicon glyphicon-trash"></span></a></td>
|
||||
<td> <a data-target='#EditCoproduct' data-id="<?php echo $ind ; ?>" data-userid="<?php echo $ind ; ?>" data-toggle="modal" href="#EditCoproduct"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit;"></i> </a> <!-- <a href='#' onclick = "DeleteactionRow(<?php echo $ind?>);" class="link" data-id="<?php echo $ind ; ?>" data-userid="<?php echo $ind ; ?>" id="Del" ><span class="glyphicon glyphicon-trash"></span></a> --></td>
|
||||
</tr>
|
||||
<?php } }?>
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
<th>Material Code</th>
|
||||
<th>Supplier Name</th>
|
||||
<th>Adjusted Qty</th>
|
||||
<th>Adjustment</th>
|
||||
<!-- <th>Adjustment</th> -->
|
||||
<th>Adjusted On</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
@ -42,7 +42,7 @@
|
||||
<tr id="<?php echo $index ; ?>">
|
||||
<td><?php echo $index ; ?></td>
|
||||
<td><?php echo "Adj".$record->AdjustmentId ?></td>
|
||||
<td><?php echo $record->MaterialCode."-".$record->MaterialName; ?></td>
|
||||
<td><a data-toggle="modal" data-target="#materialreport" data-userid="<?php echo $record->MaterialCode ?>" data-id="<%=index%>" data-dismiss="modal"><?php echo $record->MaterialCode."-".$record->MaterialName; ?></a></td>
|
||||
<td><?php echo $record->SupplierID."-".$record->SupplierName; ?></td>
|
||||
<td><?php echo $record->Quantity ?></td>
|
||||
|
||||
@ -74,6 +74,83 @@
|
||||
<!-- /.col -->
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="modal fade" id="materialreport" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<!-- Modal content-->
|
||||
<form>
|
||||
<div class="modal-content" style="width:900px;">
|
||||
<div class="modal-header" style="background-color: #3c8dbc;color:#fff;">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<center><h4>Material Adjustment Report</h4></center>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<!-- <div class="col-md-3">
|
||||
<label>Material :</label>
|
||||
</div> -->
|
||||
<div class="col-md-3">
|
||||
<label>Material :</label>
|
||||
<?php
|
||||
|
||||
$data = array('name' => 'material','value' => set_value('material'),'id'=>'material', 'class' => 'form-control','readonly'=>'true');
|
||||
echo form_input($data);echo"<br>";
|
||||
?>
|
||||
|
||||
|
||||
</div>
|
||||
<!-- <div class="col-md-3">
|
||||
<label> Purchase Order Number:</label>
|
||||
</div> -->
|
||||
<div class="col-md-3">
|
||||
<label> Inward Quantity:</label>
|
||||
<?php
|
||||
|
||||
$data = array('name' => 'Outqty','value' => set_value('Outqty'),'id'=>'Outqty', 'class' => 'form-control','readonly'=>'true');
|
||||
echo form_input($data);echo"<br>";
|
||||
?>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!-- <div class="col-md-3">
|
||||
<label> Purchase Order Number:</label>
|
||||
</div> -->
|
||||
<div class="col-md-3">
|
||||
<label> Outward Quantity:</label>
|
||||
<?php
|
||||
|
||||
$data = array('name' => 'invqty','value' => set_value('invqty'),'id'=>'invqty', 'class' => 'form-control','readonly'=>'true');
|
||||
echo form_input($data);echo"<br>";
|
||||
?>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="modal-footer">
|
||||
<a class="btn btn-primary" data-dismiss="modal" value="Cancel">Cancel</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
@ -94,3 +171,55 @@
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$("#materialreport").on("shown.bs.modal", function(e)
|
||||
{
|
||||
var MaterialCode = $(e.relatedTarget).data('userid');
|
||||
//var date =
|
||||
|
||||
var today = new Date();
|
||||
var dd = today.getDate();
|
||||
var mm = today.getMonth()+1; //January is 0!
|
||||
var yyyy = today.getFullYear();
|
||||
|
||||
if(dd<10) {
|
||||
dd = '0'+dd
|
||||
}
|
||||
|
||||
if(mm<10) {
|
||||
mm = '0'+mm
|
||||
}
|
||||
|
||||
today = yyyy + '-' + mm + '-' + dd;
|
||||
//alert(today);
|
||||
|
||||
$('#Outqty').val("");
|
||||
$('#invqty').val("");
|
||||
$('#material').val("");
|
||||
|
||||
$.ajax({
|
||||
|
||||
data:{MaterialCode:MaterialCode,date:today},
|
||||
type:"POST",
|
||||
url:"<?php echo base_url() ?>batchcard/displaying_stockvalues",
|
||||
success:function(data){
|
||||
|
||||
//alert(data);
|
||||
|
||||
$.each(JSON.parse(data),function (i,item) {
|
||||
|
||||
$('#Outqty').val(item.Addqty);
|
||||
$('#invqty').val(item.ReduceQty);
|
||||
$('#material').val(item.MaterialCode+"-"+item.MaterialName);
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user