store updation
This commit is contained in:
parent
8b905a60d5
commit
5b2014048b
@ -115,6 +115,7 @@ define('STORE_OPEN', 'ST034');
|
||||
define('STORE_PENDINGAPPROVAL', 'ST035');
|
||||
define('STORE_APPROVAL', 'ST036');
|
||||
define('STORE_ISSUSED', 'ST037');
|
||||
define('STORE_PARTIALLYISSUSED', 'ST055');
|
||||
define('STORE_ONHOLD', 'ST038');
|
||||
define('STORE_REJECT', 'ST039');
|
||||
|
||||
|
||||
@ -135,7 +135,7 @@ class storerequisitionlist extends BaseController
|
||||
$StoreReqNo = $Req[0]['StoreReqNo'];
|
||||
//printf_r($ReqNumber);
|
||||
}
|
||||
echo $StoreReqNo;
|
||||
//echo $StoreReqNo;
|
||||
|
||||
|
||||
|
||||
@ -221,6 +221,8 @@ class storerequisitionlist extends BaseController
|
||||
// die();
|
||||
$ReqNO = $this->input->post('txtReqNo');
|
||||
$RowCount = $this->input->post('txtRowCount');
|
||||
//echo $RowCount;
|
||||
//die();
|
||||
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
||||
$createddt = $dt->format('Y-m-d H:i:s');
|
||||
|
||||
@ -229,7 +231,7 @@ class storerequisitionlist extends BaseController
|
||||
$UPdateon = $date->format('Y-m-d H:i:s');
|
||||
|
||||
|
||||
$ItemStatus = STORE_ISSUSED;
|
||||
//$ItemStatus = STORE_ISSUSED;
|
||||
|
||||
for ($i = 1; $i <= $RowCount; $i++)
|
||||
{
|
||||
@ -238,7 +240,36 @@ class storerequisitionlist extends BaseController
|
||||
// echo $MaterialCode;
|
||||
$IssuedQuantity = $this->input->post('txtIssuedQuantity'.$i);
|
||||
|
||||
|
||||
$Reqqty= $this->input->post('txtqty'.$i);
|
||||
// echo $Reqqty;
|
||||
// die();
|
||||
$savedqty=$this->storerequistion_model->getSavedQty($ReqNO,$MaterialCode);
|
||||
// if($reqstatus==)
|
||||
// print_r($savedqty);
|
||||
// die();
|
||||
$Qtyissued=0;
|
||||
foreach($savedqty as $Qty)
|
||||
{
|
||||
$Qtyissued=$Qty->QuantityIssued;
|
||||
}
|
||||
|
||||
$ActQty=$Qtyissued+$IssuedQuantity;
|
||||
// echo $ActQty;
|
||||
// die();
|
||||
|
||||
|
||||
if($Reqqty>$ActQty)
|
||||
{
|
||||
$ItemStatus = STORE_PARTIALLYISSUSED;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$ItemStatus = STORE_ISSUSED;
|
||||
}
|
||||
|
||||
//echo $ItemStatus;
|
||||
//die();
|
||||
// echo'Material issed';
|
||||
if(strlen($IssuedQuantity)>0)
|
||||
{
|
||||
@ -247,13 +278,18 @@ class storerequisitionlist extends BaseController
|
||||
$Remarks = $this->input->post('txtRemarks'.$i);
|
||||
|
||||
//echo $IssuedQuantity;
|
||||
//die ();
|
||||
$CreatedBy = $this->session->userdata('userId');
|
||||
|
||||
|
||||
$storerequisition = array('StoreReqNo'=>$ReqNO,'MaterialCode'=>$MaterialCode,'QuantityIssued'=>$IssuedQuantity,'Status'=>$ItemStatus,'StoreComments'=>$Remarks,'UpdatedOn'=>$createddt,'UpdatedBy'=>$CreatedBy);
|
||||
$storerequisition = array('StoreReqNo'=>$ReqNO,'MaterialCode'=>$MaterialCode,'QuantityIssued'=>$ActQty,'Status'=>$ItemStatus,'StoreComments'=>$Remarks,'UpdatedOn'=>$createddt,'UpdatedBy'=>$CreatedBy);
|
||||
|
||||
|
||||
//print_r($storerequisition);
|
||||
//die();
|
||||
|
||||
|
||||
$this->storerequistion_model->UpdateStoreRequistionItem($storerequisition,$ReqNO,$MaterialCode);
|
||||
$this->storerequistion_model->UpdateStoreRequistionItem($storerequisition,$ReqNO,$MaterialCode);
|
||||
|
||||
$getAvailableqty = $this->storerequistion_model->getItemQuantityFromStock(trim($MaterialCode));
|
||||
|
||||
@ -267,10 +303,41 @@ class storerequisitionlist extends BaseController
|
||||
$updatStock = array('Quantity'=>$BalanceQty,'Status'=>'0',
|
||||
'Remarks'=>'Stock Deducted For'.$ReqNO,'UpdatedOn'=>$UPdateon,'UpdatedBy'=>$UPdateby);
|
||||
|
||||
$this->storerequistion_model->UpdateStock($updatStock,trim($MaterialCode));
|
||||
|
||||
$this->storerequistion_model->UpdateStock($updatStock,trim($MaterialCode));
|
||||
|
||||
|
||||
|
||||
$StoreReqNo=$ReqNO;
|
||||
$reqstatus=$this->storerequistion_model->getstatuscount('ST037',$ReqNO);
|
||||
$reqstatuscount=0;
|
||||
//print_r($reqstatus);
|
||||
foreach ($reqstatus as $Req)
|
||||
{
|
||||
$reqstatuscount=$Req->SCount;
|
||||
}
|
||||
|
||||
|
||||
if($reqstatuscount==$RowCount)
|
||||
{
|
||||
$reqStatus=STORE_ISSUSED;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$reqStatus=STORE_PARTIALLYISSUSED;
|
||||
}
|
||||
|
||||
|
||||
// echo $reqstatuscount;
|
||||
|
||||
$updatestatus=array('Status' =>$reqStatus);
|
||||
|
||||
$this->storerequistion_model->updatestoremaster($updatestatus,$StoreReqNo);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
//die();
|
||||
@ -287,7 +354,7 @@ class storerequisitionlist extends BaseController
|
||||
|
||||
|
||||
$data['AppList'] = $this->storerequistion_model->getApproverRequistList($userID);
|
||||
|
||||
//print_r($data['AppList']);
|
||||
$this->global['pageTitle'] = 'Siddharth : ApprovalStoreRequisitionSlip';
|
||||
$data['Status']= $this->storerequistion_model->getStatus();
|
||||
|
||||
@ -350,13 +417,17 @@ class storerequisitionlist extends BaseController
|
||||
$MaterialName = $result[$i]['MaterialName'];
|
||||
$UOM = $result[$i]['UOM'];
|
||||
$Quantity = $result[$i]['QuantityRequired'];
|
||||
$IssuedQty=$result[$i]['QuantityIssued'];
|
||||
$Status=$result[$i]['StatusName'];
|
||||
$Remarks= $result[$i]['Remarks'];
|
||||
$HTML.="<tr id='".$i."'>
|
||||
<td align='left'>".$SNo."</td>
|
||||
<td align='left'>".$MaterialCode."</td>
|
||||
<td align='left'>".$MaterialName."</td>
|
||||
<td align='left'>".$UOM."</td>
|
||||
<td align='left'>".$Quantity."</td>
|
||||
<td align='left'>".$Quantity."</td>
|
||||
<td align='left'>".$IssuedQty."</td>
|
||||
<td align='left'>".$Status."</td>
|
||||
|
||||
<td align='left'>".$Remarks."</td>
|
||||
|
||||
@ -444,6 +515,9 @@ class storerequisitionlist extends BaseController
|
||||
{
|
||||
$ReqDetails = array('StoreReqNo'=>$StoreReqNo, 'MaterialCode'=>$MaterialCode,'QuantityRequired'=>$QuantityRequired,'Remarks'=>$Remarks,'Status'=>$StoreItemStatus,'UpdatedBy'=>$UpdatedBy,'UpdatedOn'=>$updatedDate);
|
||||
|
||||
//print_r($ReqDetails);
|
||||
//die();
|
||||
|
||||
$this->storerequistion_model->addstoreRequistion($ReqDetails);
|
||||
}
|
||||
else
|
||||
|
||||
@ -79,11 +79,12 @@ class storerequistion_model extends CI_Model
|
||||
$this->db->join('T_DepartmentDetails Dept','Dept.DEPCode = Sm.DepartmentCode');
|
||||
$this->db->join('T_Status St','St.StatusCode = Sm.Status');
|
||||
$this->db->where('Sm.Status ',STORE_APPROVAL);
|
||||
$this->db->or_where('Sm.Status ',STORE_PARTIALLYISSUSED);
|
||||
|
||||
$query = $this->db->get();
|
||||
$result = $query->result();
|
||||
|
||||
//print_r($this->db->last_query());
|
||||
// print_r($this->db->last_query());
|
||||
//print_r($result);
|
||||
return $result;
|
||||
|
||||
@ -93,6 +94,7 @@ class storerequistion_model extends CI_Model
|
||||
function addstoreRequistion($Request)
|
||||
{
|
||||
//print_r($Request);
|
||||
//die();
|
||||
$this->db->trans_start();
|
||||
$this->db->insert('T_Store_Requestion_Details',$Request);
|
||||
$insert_id = $this->db->affected_rows();
|
||||
@ -250,10 +252,11 @@ class storerequistion_model extends CI_Model
|
||||
function editstorerequistions($StoreReqNo)
|
||||
{
|
||||
|
||||
$this->db->select('StoreReqNo,Sr.MaterialCode,Sr.QuantityRequired,Sr.Status,Sr.Remarks,Mm.MaterialName,Mm.UOM ');
|
||||
$this->db->select('Sr.StoreReqNo,Sr.MaterialCode,Sr.QuantityRequired,Sr.Status,Sr.Remarks,Mm.MaterialName,Mm.UOM,Sr.QuantityIssued,STM.Status ');
|
||||
$this->db->from('T_Store_Requestion_Details Sr');
|
||||
$this->db->join('T_MaterialMaster Mm' ,' Mm.MaterialCode = Sr.MaterialCode');
|
||||
$this->db->where('StoreReqNo',$StoreReqNo);
|
||||
$this->db->join('T_Store_Requestion_Master STM' ,' STM.StoreReqNo = Sr.StoreReqNo');
|
||||
$this->db->where('Sr.StoreReqNo',$StoreReqNo);
|
||||
$query = $this->db->get();
|
||||
return $query->result();
|
||||
}
|
||||
@ -362,7 +365,7 @@ $this->db->select('StoreReqNo,Sr.CostCenterCode,Cc.CostCenterName
|
||||
function getRequistItemListApproval($StoreReqNo,$NoArray='')
|
||||
{
|
||||
|
||||
$subQuery = ' select Str.StoreReqNo,Str.MaterialCode,Str.QuantityRequired,Str.Remarks,Mat.MaterialName,Mat.UOM,Ss.StatusName
|
||||
$subQuery = ' select Str.StoreReqNo,Str.MaterialCode,Str.QuantityRequired,Str.Remarks,Mat.MaterialName,Mat.UOM,Ss.StatusName,Str.Status,Str.QuantityIssued
|
||||
from T_Store_Requestion_Details Str
|
||||
join T_MaterialMaster Mat on Mat.MaterialCode = Str.MaterialCode
|
||||
join T_Status Ss on Ss.StatusCode = Str.Status
|
||||
@ -393,14 +396,14 @@ $this->db->select('StoreReqNo,Sr.CostCenterCode,Cc.CostCenterName
|
||||
from T_Store_Requestion_Details Str
|
||||
join T_MaterialMaster Mat on Mat.MaterialCode = Str.MaterialCode
|
||||
join T_Status Ss on Ss.StatusCode = Str.Status
|
||||
join T_Store_Stockdetails St on St.MaterialCode=Str.MaterialCode
|
||||
left join T_Store_Stockdetails St on St.MaterialCode=Str.MaterialCode
|
||||
where Str.StoreReqNo =?';
|
||||
|
||||
|
||||
|
||||
|
||||
$query = $this->db->query($subQuery, array($StoreReqNo));
|
||||
// print_r($this->db->last_query());
|
||||
//print_r($this->db->last_query());
|
||||
|
||||
|
||||
return $query->result();
|
||||
@ -427,6 +430,42 @@ $this->db->select('StoreReqNo,Sr.CostCenterCode,Cc.CostCenterName
|
||||
|
||||
}
|
||||
|
||||
|
||||
function getSavedQty($ReqNO,$MaterialCode)
|
||||
{
|
||||
$subQuery='select QuantityIssued from T_Store_Requestion_Details
|
||||
where StoreReqNo=? and MaterialCode=?';
|
||||
|
||||
$query = $this->db->query($subQuery, array($ReqNO,$MaterialCode));
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function updatestoremaster($updatestatus,$StoreReqNo)
|
||||
{
|
||||
$this->db->where('StoreReqNo', $StoreReqNo);
|
||||
$this->db->update('T_Store_Requestion_Master', $updatestatus);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
function getstatuscount($Status,$StoreReqNo)
|
||||
{
|
||||
$this->db->select('count(Status) as SCount');
|
||||
$this->db->from('T_Store_Requestion_Details');
|
||||
|
||||
$this->db->where('Status', $Status);
|
||||
$this->db->where('StoreReqNo',$StoreReqNo);
|
||||
//$this->db->where('StoreReqNo', $StoreReqNo);
|
||||
|
||||
$query = $this->db->get();
|
||||
//print_r($this->db->last_query());
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
|
||||
/*this function used to get the all store requistion list view*/
|
||||
function Storeall($StoreReqNo,$IsArray='')
|
||||
{
|
||||
|
||||
@ -111,7 +111,9 @@
|
||||
<th>Item Code</th>
|
||||
<th>Item Description</th>
|
||||
<th>UOM</th>
|
||||
<th>Quantity</th>
|
||||
<th>Requested Quantity</th>
|
||||
<th>Issued Quantity</th>
|
||||
<th>Status</th>
|
||||
<th>Remarks</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@ -306,6 +306,86 @@ $(function() {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- View Line Item -->
|
||||
|
||||
<div class="modal fade" id="ViewItem" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
|
||||
<!-- Modal content-->
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<center><h4>View Line Item </h4></center>
|
||||
</div>
|
||||
<div align="left">
|
||||
|
||||
<div class="col-md-6">
|
||||
<label>Material Code</label>
|
||||
<div >
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'ViewMaterialCode','value' => set_value('ViewMaterialCode'),'id'=>'ViewMaterialCode', 'class' => 'form-control','readonly' => 'true' );
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<label>Description</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'ViewDescription','value' => set_value('ViewDescription'),'id'=>'ViewDescription', 'class' => 'form-control','readonly' => 'true' );
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label>UOM</label>
|
||||
<div>
|
||||
<?php
|
||||
$data = array('name' => 'ViewUOM','value' => set_value('ViewUOM'),'id'=>'ViewUOM', 'class' => 'form-control','readonly' => 'true' );
|
||||
echo form_input($data);
|
||||
?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label>Quantity</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'ViewQuantity','value' => set_value('EditQuantity'),'id'=>'ViewQuantity', 'class' => 'form-control' ,'onkeypress'=>'return isNumberKey(event)','maxlength'=>'20');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<label>Remarks</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'ViewRemarks','value' => set_value('ViewRemarks'),'id'=>'ViewRemarks', 'class' => 'form-control');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<!-- <a class="btn btn-info font EditItem" ID="EditItem" ><i class="fa fa-plus"></i> <span class="bold">Edit</span></a> -->
|
||||
<a class="btn btn-info" data-dismiss="modal" value="Cancel">cancel</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</table>
|
||||
@ -319,6 +399,7 @@ $(function() {
|
||||
<th>Description</th>
|
||||
<th>UOM</th>
|
||||
<th>Quantity</th>
|
||||
<th>Issued Quantity</th>
|
||||
<th>Remarks</th>
|
||||
<th>Action</th>
|
||||
</thead>
|
||||
@ -344,14 +425,28 @@ $(function() {
|
||||
<td align="left"><?php echo $record->UOM ?></td>
|
||||
|
||||
<td align="left"><?php echo $record->QuantityRequired ?></td>
|
||||
|
||||
<td align="left"><?php echo $record->QuantityIssued ?></td>
|
||||
|
||||
<!-- <td align="left"><?php echo $record->StatusName ?></td> -->
|
||||
<td align="left"><?php echo $record->Remarks ?></td>
|
||||
|
||||
<?php
|
||||
|
||||
if($record->Status == STORE_PENDINGAPPROVAL)
|
||||
{?>
|
||||
|
||||
|
||||
<td>
|
||||
<a data-id="<?php echo $index ; ?>" data-userid="<?php echo $index ; ?>" data-target='#EditItem' data-toggle="modal" href="#EditItem"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit the <?php echo $record->MaterialCode ; ?> Material details"></i> </a> <a onclick = "RemoveList(<?php echo $index ; ?>)" class="link" data-id="<?php echo $record->MaterialCode ; ?>" data-userid="<?php echo $index ; ?>" id="Del"><span class="glyphicon glyphicon-trash"></span></a>
|
||||
|
||||
|
||||
<a data-id="<?php echo $index ; ?>" data-userid="<?php echo $index ; ?>" data-target='#EditItem' data-toggle="modal" href="#EditItem"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit the <?php echo $record->MaterialCode ; ?> Material details"></i> </a> <a onclick = "RemoveList(<?php echo $index ; ?>)" class="link" data-id="<?php echo $record->MaterialCode ; ?>" data-userid="<?php echo $index ; ?>" id="Del"><span class="glyphicon glyphicon-trash"></span></a></td>
|
||||
<?php
|
||||
}else {?>
|
||||
|
||||
<td>
|
||||
<a data-id="<?php echo $index ; ?>" data-userid="<?php echo $index ; ?>" data-target='#ViewItem' data-toggle="modal" href="#ViewItem"><i class="fa fa-eye" data-toggle="tooltip" title="Click here to view the <?php echo $record->MaterialCode ; ?> Material details"></i> </a>
|
||||
</td>
|
||||
<?php
|
||||
}?>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
@ -414,6 +509,8 @@ elseif ($StatusCode==STORE_APPROVAL)
|
||||
|
||||
<td align="left"><%=Quantity%></td>
|
||||
|
||||
<td align="left"><%=IssuedQty%></td>
|
||||
|
||||
<td align="left"><%=Remarks%></td>
|
||||
<td>
|
||||
<a data-target='#EditItem' data-id="<%=index%>" data-userid="<%=index%>" data-toggle="modal" href="#EditItem"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit the <%=MaterialCode%> Material details"></i> </a> <a href='#' onclick = "RemoveList(<%=index%>)" class="link" data-id="<%=index%>" data-userid="<%=index%>" id="Del" ><span class="glyphicon glyphicon-trash"></span></a>
|
||||
@ -552,8 +649,7 @@ $("#mypo").on("shown.bs.modal", function(e) {
|
||||
$('.addClick').click(function()
|
||||
{
|
||||
|
||||
|
||||
if ($("#MaterialCode option:selected").val() =='-1' || $("#MaterialCode").val() == "0" )
|
||||
if ($("#MaterialCode option:selected").val() =='-1' )
|
||||
{
|
||||
alert('Please Select the MaterialCode ');
|
||||
return false;
|
||||
@ -578,14 +674,14 @@ $("#mypo").on("shown.bs.modal", function(e) {
|
||||
var UOM =$('#UOM').val();
|
||||
var Quantity =$('#Quantity').val();
|
||||
var Remarks=$('#Remarks').val();
|
||||
|
||||
var IssuedQty=0;
|
||||
|
||||
$('#MaterialCode option[value='+MaterialCode+']').remove();
|
||||
index = parseInt(index)+1;
|
||||
var template = jQuery("#tempList").html();
|
||||
|
||||
|
||||
$('#mytab').append(_.template(template,{index:temp,MaterialCode:MaterialCode,MaterialName:Description,UOM:UOM,Quantity:Quantity,Remarks:Remarks}));
|
||||
$('#mytab').append(_.template(template,{index:temp,MaterialCode:MaterialCode,MaterialName:Description,UOM:UOM,Quantity:Quantity,Remarks:Remarks,IssuedQty:IssuedQty}));
|
||||
|
||||
|
||||
var theForm = $(".requistion");
|
||||
@ -608,7 +704,7 @@ $("#mypo").on("shown.bs.modal", function(e) {
|
||||
|
||||
function clear()
|
||||
{
|
||||
|
||||
$('#MaterialCode').val('');
|
||||
$('#Description').val('');
|
||||
$('#UOM').val('');
|
||||
$('#Quantity').val('');
|
||||
@ -654,6 +750,22 @@ $("#EditItem").on("shown.bs.modal", function(e) {
|
||||
});
|
||||
|
||||
|
||||
$("#ViewItem").on("shown.bs.modal", function(e) {
|
||||
userid = $(e.relatedTarget).data('userid');
|
||||
// alert(userid);
|
||||
var tr= document.getElementById(userid);
|
||||
var cellval = tr.cells;
|
||||
//alert(x[1].innerHTML);
|
||||
$('#ViewMaterialCode').val(cellval[1].innerHTML);
|
||||
$('#ViewDescription').val(cellval[2].innerHTML);
|
||||
$('#ViewUOM').val(cellval[3].innerHTML);
|
||||
$('#ViewQuantity').val(cellval[4].innerHTML);
|
||||
$('#ViewRemarks').val(cellval[5].innerHTML);
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
$('.EditItem').click(function(){
|
||||
var editMaterialCode = $("#EditMaterialCode").val();
|
||||
var editDescription = $("#EditDescription").val();
|
||||
@ -668,7 +780,7 @@ $('.EditItem').click(function(){
|
||||
cellval[2].innerHTML = editDescription;
|
||||
cellval[3].innerHTML = editUOM;
|
||||
cellval[4].innerHTML = editQuantity;
|
||||
cellval[5].innerHTML = editRemarks;
|
||||
cellval[6].innerHTML = editRemarks;
|
||||
|
||||
$('#MaterialCode'+userid).val(editMaterialCode);
|
||||
$('#Description'+userid).val(editDescription);
|
||||
@ -1004,4 +1116,3 @@ function validate()
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
@ -149,8 +149,10 @@ span.highlight {
|
||||
<th>UOM</th>
|
||||
<th>Requested Quantity</th>
|
||||
<th>Available Stock</th>
|
||||
<th>Issued Qty</th>
|
||||
<th>Pending Qty</th>
|
||||
<th>Requester Remarks</th>
|
||||
<th>Issued Quantity</th>
|
||||
<th>Issuing Quantity</th>
|
||||
<th>Comments</th>
|
||||
</thead>
|
||||
<tbody id='mytab'>
|
||||
@ -175,6 +177,12 @@ span.highlight {
|
||||
<td align="left"><?php echo $record->UOM ?></td>
|
||||
|
||||
<td align="right"><?php echo $record->QuantityRequired ?></td>
|
||||
|
||||
<input type="hidden" name="<?php echo 'txtqty'.$index ?>" id="<?php echo 'txtqty'.$index ?>" value=<?php echo $record->QuantityRequired?>>
|
||||
|
||||
|
||||
<!-- <input type="hidden" name="<?php echo 'Reqnumber'.$index ?>" id="<?php echo 'Reqnumber'.$index ?>" value="<?php echo $record->ReqNo ; ?>" /> -->
|
||||
|
||||
<?php if(($record->Quantity)-($record->QuantityRequired)<=0)
|
||||
{?>
|
||||
<td align="right" style="color: red" ><?php echo $record->Quantity?></td>
|
||||
@ -185,28 +193,42 @@ span.highlight {
|
||||
<td align="right"><?php echo $record->Quantity?></td>
|
||||
<?
|
||||
}?>
|
||||
|
||||
|
||||
<td align="left"><?php echo $record->QuantityIssued ?></td>
|
||||
|
||||
<td align="left"><?php echo($record->QuantityRequired)-($record->QuantityIssued) ?></td>
|
||||
|
||||
<td align="left"><?php echo $record->Remarks ?></td>
|
||||
<td align="left"><?php echo $record->Remarks ?></td>
|
||||
<td align="left">
|
||||
|
||||
<?php if(($record->Quantity)-($record->QuantityRequired)>0)
|
||||
<?php if((($record->Quantity)-($record->QuantityRequired)>0)&&$record->StatusName!='ISSUED')
|
||||
{?>
|
||||
|
||||
|
||||
<input type="text" onchange="SaveIssueQuantity(<?php echo $index ?>,<?php echo $record->QuantityRequired ?>,<?php echo $record->QuantityIssued ?>)" id="<?php echo 'issuedQuantity'.$index ?>" name="<?php echo 'issuedQuantity'.$index ?>" class="form required" onkeypress="return isNumberKey(event);"value="<?php echo $record->QuantityIssued; ?>"> <?}
|
||||
|
||||
else
|
||||
{?>
|
||||
|
||||
|
||||
<input type="text" onchange="SaveIssueQuantity(<?php echo $index ?>,<?php echo $record->QuantityRequired ?>)" id="<?php echo 'issuedQuantity'.$index ?>" name="<?php echo 'issuedQuantity'.$index ?>" class="form required" onkeypress="return isNumberKey(event);"value="<?php echo $record->QuantityIssued; ?>"> <?}?>
|
||||
|
||||
|
||||
|
||||
<input type="text" onchange="SaveIssueQuantity(<?php echo $index ?>,<?php echo $record->QuantityRequired ?>,<?php echo $record->QuantityIssued ?>)" id="<?php echo 'issuedQuantity'.$index ?>" name="<?php echo 'issuedQuantity'.$index ?>" class="form required" readonly=true onkeypress="return isNumberKey(event);"value="<?php echo $record->QuantityIssued; ?>"><?}?>
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
<td align="left">
|
||||
|
||||
<?php if(($record->Quantity)-($record->QuantityRequired)>0)
|
||||
<?php if((($record->Quantity)-($record->QuantityRequired)>0)&&$record->StatusName!='ISSUED')
|
||||
{?>
|
||||
|
||||
<input type="text" onchange="SaveRemarks(<?php echo $index ?>)" id="<?php echo 'Comments'.$index ?>" name="<?php echo 'Comments'.$index ?>" class="form required" value="<?php echo $record->StoreComments; ?>" ><?}?>
|
||||
<input type="text" onchange="SaveRemarks(<?php echo $index ?>)" id="<?php echo 'Comments'.$index ?>" name="<?php echo 'Comments'.$index ?>" class="form required" value="<?php echo $record->StoreComments; ?>" ><?}
|
||||
|
||||
else{?>
|
||||
<input type="text" onchange="SaveRemarks(<?php echo $index ?>)" id="<?php echo 'Comments'.$index ?>" name="<?php echo 'Comments'.$index ?>" class="form required" readonly=true value="<?php echo $record->StoreComments; ?>" ><?}?>
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
@ -318,21 +340,21 @@ function isNumberKey(evt)
|
||||
var index = '1';
|
||||
var userid = '';
|
||||
|
||||
function SaveIssueQuantity(RowId,ReqQty)
|
||||
function SaveIssueQuantity(RowId,ReqQty,Issued)
|
||||
{
|
||||
//alert(ReqQty);
|
||||
//alert(Issued);
|
||||
var qty = $("#issuedQuantity"+RowId).val();
|
||||
|
||||
var maxqty=ReqQty-Issued;
|
||||
//alert(qty);
|
||||
if( qty != '')
|
||||
{
|
||||
if(qty <= ReqQty )
|
||||
if(qty <= (ReqQty-Issued) )
|
||||
{
|
||||
$("#txtIssuedQuantity"+RowId).val(qty);
|
||||
}
|
||||
else
|
||||
{
|
||||
alert('The Issued Quantity cannot be more than the Requested Quantity');
|
||||
alert('The Issued Quantity cannot be more than the Requested Quantity, Already Distributed Quantity is ' +Issued+ 'Maximun Qty can enter is '+maxqty);
|
||||
$("#issuedQuantity"+RowId).focus();
|
||||
$("#issuedQuantity"+RowId).val('');
|
||||
return false;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user