done mrir issue
This commit is contained in:
parent
0b5e5ed05a
commit
571c4b6930
@ -211,9 +211,9 @@ public function viewmMaterialDistributionList()
|
||||
}
|
||||
|
||||
/* Values To Stored in DB (for update operation) */
|
||||
function updated_db()
|
||||
function updated_db()
|
||||
{
|
||||
|
||||
|
||||
$this->load->model('mrir_model');
|
||||
|
||||
$mrir_no = $this->input->post('MRIRNO');
|
||||
@ -229,6 +229,11 @@ public function viewmMaterialDistributionList()
|
||||
$updatemaster = $this->mrir_model->update_mrirmaster($updatemastervalues,$mrir_no);
|
||||
$strStatus = '';
|
||||
//echo "outside for loop";
|
||||
$CheckEmpty=0;
|
||||
$TotalRow=0;
|
||||
for($m=1;$m<=$RowCount ; $m++){
|
||||
$TotalRow=$TotalRow+$m;
|
||||
}
|
||||
for ($i = 1; $i <= $RowCount; $i++)
|
||||
{
|
||||
$ActualQty=trim($this->input->post('ActualQuantityReceived'.$i));
|
||||
@ -236,10 +241,12 @@ public function viewmMaterialDistributionList()
|
||||
$rejectquantity=trim($this->input->post('QuantityRejected'.$i));
|
||||
$MaterialCode = trim($this->input->post('MaterialCode'.$i));
|
||||
$Lineitm = trim($this->input->post('Lineitm'.$i));
|
||||
|
||||
|
||||
//echo $acceptquantity;
|
||||
if(strlen($acceptquantity)>0)
|
||||
if($rejectquantity==0)
|
||||
{
|
||||
$CheckEmpty=$CheckEmpty+$i;
|
||||
$strStatus = MRIR_APPROVED;
|
||||
$avlQty = 0;
|
||||
$getAvailableqty = $this->mrir_model->getItemQuantityFromStock(trim($MaterialCode));
|
||||
@ -255,7 +262,7 @@ public function viewmMaterialDistributionList()
|
||||
$this->mrir_model->UpdateStock($updatStock,trim($MaterialCode));
|
||||
|
||||
}
|
||||
elseif(strlen($acceptquantity)==0 && strlen($rejectquantity)>0)
|
||||
elseif($rejectquantity!=0)
|
||||
{
|
||||
$strStatus = MRIR_REJECTED;
|
||||
}
|
||||
@ -263,8 +270,7 @@ public function viewmMaterialDistributionList()
|
||||
|
||||
|
||||
$remark=$this->input->post('Remark'.$i);
|
||||
//echo $remark;
|
||||
//die();
|
||||
|
||||
$updateby=$this->session->userdata('userId');
|
||||
$date = new DateTime('now',new DateTimeZone('Asia/Kolkata'));
|
||||
$updateon = $date->format('Y-m-d H:i:s');
|
||||
@ -287,7 +293,16 @@ public function viewmMaterialDistributionList()
|
||||
$this->mrir_model->UpdatePOLineItem($POLineItem,$PONO,$MaterialCode);
|
||||
|
||||
}
|
||||
$this->mrir_model->UpdatePOMaster($PONO,$updateby);
|
||||
$PoMrirStatus='';
|
||||
|
||||
if($TotalRow==$CheckEmpty){
|
||||
$PoMrirStatus = MRIR_APPROVED;
|
||||
}
|
||||
else{
|
||||
$PoMrirStatus = MRIR_REJECTED;
|
||||
}
|
||||
|
||||
$this->mrir_model->UpdatePOMaster($PONO,$PoMrirStatus,$updateby);
|
||||
|
||||
echo "successfully updated :".$mrir_no;
|
||||
|
||||
|
||||
@ -142,7 +142,7 @@ class inwardgateregister extends BaseController
|
||||
//echo $PendingQty.'ReceivedQty'.$ReceivedQty;
|
||||
//echo ' ';
|
||||
|
||||
if(strlen($QuantityAsPerInvoice)>0)
|
||||
if(strlen($QuantityAsPerInvoice)>0 && $QuantityAsPerInvoice != '0')
|
||||
{
|
||||
$Remarks = $this->input->post('txtRemarks'.$i);
|
||||
$ItemStatus = '';
|
||||
|
||||
@ -301,22 +301,15 @@ TMD.QuantityRejected,ST.StatusName,TMD.Remarks,AdvanceAmount ');
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
function UpdatePOMaster($PONO,$updatedBy)
|
||||
function UpdatePOMaster($PONO,$PoMrirStatus,$updatedBy)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('T_PurchaseOrder_LineItem');
|
||||
$this->db->where('PONO',$PONO);
|
||||
$this->db->where('Status !=',MRIR_APPROVED);
|
||||
|
||||
$query = $this->db->get();
|
||||
|
||||
|
||||
if ($query->num_rows == 0) {
|
||||
|
||||
|
||||
$this->db->where('PONO', $PONO);
|
||||
$POStatus = array('status'=>MRIR_APPROVED,'UpdateBY'=>$updatedBy);
|
||||
$POStatus = array('status'=>$PoMrirStatus,'UpdateBY'=>$updatedBy);
|
||||
$this->db->update('T_PurchaseOrder_Master', $POStatus);
|
||||
}
|
||||
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -336,10 +336,16 @@ function Redirect()
|
||||
<script>
|
||||
function validate()
|
||||
{
|
||||
|
||||
var rowcount = $("#RowCount").val();
|
||||
|
||||
var Noval = 0;
|
||||
var isExceed = 0;
|
||||
var CheckEmpty=0;
|
||||
var TotalRow =0;
|
||||
for(m=1;m<=rowcount ; m++){
|
||||
TotalRow=TotalRow+m;
|
||||
}
|
||||
for(k=1;k<=rowcount ; k++)
|
||||
{
|
||||
|
||||
@ -355,8 +361,9 @@ function validate()
|
||||
|
||||
var RejectedQuantity = parseFloat( $('#RejectQuantity'+k).val() == '' ? '0.00' : $('#RejectQuantity'+k).val());
|
||||
|
||||
if(AcceptQuantity != '0.00')
|
||||
if($('#AcceptQuantity'+k).val() != '')
|
||||
{
|
||||
CheckEmpty=CheckEmpty+k;
|
||||
|
||||
if(ActualQty < (AcceptQuantity+RejectedQuantity))
|
||||
{
|
||||
@ -364,7 +371,14 @@ function validate()
|
||||
return false;
|
||||
}
|
||||
Noval = 1;
|
||||
|
||||
|
||||
}
|
||||
else if($('#AcceptQuantity'+k).val() == ''){
|
||||
$('#AcceptQuantity'+k).focus();
|
||||
exit();
|
||||
}
|
||||
|
||||
else if(RejectedQuantity != 0)
|
||||
{
|
||||
if(ActualQty < (AcceptQuantity+RejectedQuantity))
|
||||
@ -374,9 +388,14 @@ function validate()
|
||||
}
|
||||
// Noval = 1;
|
||||
}
|
||||
else{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//alert(Noval);
|
||||
if (Noval == 0 )
|
||||
if (TotalRow !=CheckEmpty)
|
||||
{
|
||||
|
||||
alert('Accepted Quantity/ Rejected Quantity is Empty.Please Enter the value');
|
||||
@ -395,7 +414,7 @@ function validate()
|
||||
}
|
||||
function setaccept(rowId)
|
||||
{
|
||||
|
||||
if($('#AcceptQuantity'+rowId).val()!=''){
|
||||
var accept = parseFloat($('#AcceptQuantity'+rowId).val());
|
||||
var tr= document.getElementById(rowId);
|
||||
var Actulqty = 0.0;
|
||||
@ -442,11 +461,20 @@ function setaccept(rowId)
|
||||
$('#status').val('<?php echo MRIR_REJECTED?>');
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
$('#RejectQuantity'+rowId).val('') ;
|
||||
$('#QuantityRejected'+rowId).val('') ;
|
||||
$('#QuantityAccepted'+rowId).val('') ;
|
||||
$('#AcceptQuantity'+rowId).val('') ;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function setreject(rowId)
|
||||
{
|
||||
|
||||
var tr= document.getElementById(rowId);
|
||||
var Actulqty = 0.0;
|
||||
|
||||
@ -455,7 +483,7 @@ function setreject(rowId)
|
||||
|
||||
Actulqty = parseFloat(cellval[6].innerHTML);
|
||||
var reject = parseFloat($('#RejectQuantity'+rowId).val());
|
||||
if(reject > Actulqty )
|
||||
if(reject > Actulqty)
|
||||
{
|
||||
alert("Reject Quantity is exceeding the Actual Quantity.Please change the AcceptQuantity ")
|
||||
$("#RejectQuantity"+rowId).focus();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user