MRIR Rejected Status Implemetation

This commit is contained in:
gandhimathi Bharathirajan 2017-08-10 14:51:27 +05:30
parent 75f2e793c6
commit 264e953a4f

View File

@ -224,9 +224,9 @@ public function viewmMaterialDistributionList()
$UPdateon = $date->format('Y-m-d H:i:s');
$PONO = $this->input->post('PONO');
//this array to store the updated value in master table..
$updatemastervalues = array('MRIRStatus'=>$Status,'UpdateBY'=>$UPdateby,'UpdatedOn'=>$UPdateon);
$updatemaster = $this->mrir_model->update_mrirmaster($updatemastervalues,$mrir_no);
$strStatus = '';
$strStatus = '';
//echo "outside for loop";
$CheckEmpty=0;
@ -243,8 +243,7 @@ public function viewmMaterialDistributionList()
$Lineitm = trim($this->input->post('Lineitm'.$i));
//echo $acceptquantity;
if($rejectquantity==0)
if($acceptquantity != 0 )
{
$CheckEmpty=$CheckEmpty+$i;
$strStatus = MRIR_APPROVED;
@ -259,10 +258,11 @@ public function viewmMaterialDistributionList()
//echo 'Stock added for'.$mrir_no;
$updatStock = array('Quantity'=>($acceptquantity+$avlQty),'Status'=>'0','UpdatedOn'=>$UPdateon,'UpdatedBy'=>$UPdateby,'Remarks'=>'Stock added for '. $this->input->post('MRIRNO'));
$this->mrir_model->UpdateStock($updatStock,trim($MaterialCode));
}
elseif($rejectquantity!=0)
elseif($rejectquantity !=0 && $acceptquantity == 0)
{
$strStatus = MRIR_REJECTED;
}
@ -275,7 +275,7 @@ public function viewmMaterialDistributionList()
$date = new DateTime('now',new DateTimeZone('Asia/Kolkata'));
$updateon = $date->format('Y-m-d H:i:s');
//echo strlen($acceptquantity);
if(strlen($acceptquantity)<=0)
if(strlen($acceptquantity)<=0 && $acceptquantity == 0)
{
$rejectquantity = $ActualQty;
//echo 'Reject qty'.$rejectquantity;
@ -283,7 +283,7 @@ public function viewmMaterialDistributionList()
//this array to store the update value in child table..
$updatedetailvalues = array('UpdateBy'=>$updateby,'UpdatedOn'=>$updateon,'QuantityAccepted'=>$acceptquantity,'QuantityRejected'=>$rejectquantity,'Remarks'=>$remark,'MRIRStatus'=>$strStatus);
//print_r($updatedetailvalues);
// print_r($updatedetailvalues);
//die();
$updatedetails = $this->mrir_model->update_mrirdetail($updatedetailvalues,$Lineitm);
@ -301,9 +301,9 @@ public function viewmMaterialDistributionList()
else{
$PoMrirStatus = MRIR_REJECTED;
}
$updatemastervalues = array('MRIRStatus'=>$PoMrirStatus,'UpdateBY'=>$UPdateby,'UpdatedOn'=>$UPdateon);
$this->mrir_model->UpdatePOMaster($PONO,$PoMrirStatus,$updateby);
$updatemaster = $this->mrir_model->update_mrirmaster($updatemastervalues,$mrir_no);
echo "successfully updated :".$mrir_no;