diff --git a/application/controllers/amendmentpurchaseorder.php b/application/controllers/amendmentpurchaseorder.php index b3897f09..8df6e127 100755 --- a/application/controllers/amendmentpurchaseorder.php +++ b/application/controllers/amendmentpurchaseorder.php @@ -316,6 +316,27 @@ class amendmentpurchaseorder extends BaseController $APO=$this->purchaseorder_model->updateAmendPOMaster($PONO,$PODetail); $LineItemStatus = REQITEM_NEW; + + + + + $igrvalue = $this->purchaseorder_model->selectigrmaster($PONO); + + + $po = ''; + if(count($igrvalue) >0) + { + $igrno = $igrvalue[0]->IGRNO; + $po =$igrvalue[0]->PONO; + + } + + if($PONO == $po) + { + $NewPOno = array('PONO' =>$NewPO); + $this->purchaseorder_model->updateigrmaster($igrno,$NewPOno); + } + for ($i = 1; $i <= $RowCount; $i++) { @@ -487,11 +508,11 @@ class amendmentpurchaseorder extends BaseController $CAD="".$MaterialCode.""; $CAD.=$CAD2; } - // $ReceivedQty = $this->purchaseorder_model->GetLineItemReceivedQty($PONO,$MaterialCode); - // if(count($ReceivedQty)>0) - // { - // $RecQtyvalue = $ReceivedQty[0]['ReceivedQuantity']; - // } + $ReceivedQty = $this->purchaseorder_model->GetLineItemReceivedQty($PONO,$MaterialCode); + if(count($ReceivedQty)>0) + { + $RecQtyvalue = $ReceivedQty[0]['ReceivedQuantity']; + } $POLineItemList = array('PONO'=>$NewPO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'ReceivedQuantity'=>$RecQtyvalue,'Quantity'=>$Quantity,'Per'=>$per,'ServiceMaterialDescription'=>$servicematerialdescription,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$updatedBy,'CreatedDate'=>$updateddt,'CostCenterCode'=>$CostCenter,'ServiceFrequency'=>$ServiceFrequency,'AmendedDetails'=>$CAD); @@ -615,6 +636,25 @@ class amendmentpurchaseorder extends BaseController $APO=$this->purchaseorder_model->updateAmendPOMaster($PONO,$PODetail); $LineItemStatus = REQITEM_NEW; + + + $igrvalue = $this->purchaseorder_model->selectigrmaster($PONO); + + + $po = ''; + if(count($igrvalue) >0) + { + $igrno = $igrvalue[0]->IGRNO; + $po =$igrvalue[0]->PONO; + + } + + if($PONO == $po) + { + $NewPOno = array('PONO' =>$NewPO); + $this->purchaseorder_model->updateigrmaster($igrno,$NewPOno); + } + for ($i = 1; $i <= $RowCount; $i++) @@ -650,12 +690,12 @@ class amendmentpurchaseorder extends BaseController $LineItemNo = ''; $RecQtyvalue=0.00; $rowspanvalue=0; - // $ReceivedQty = $this->purchaseorder_model->GetLineItemReceivedQty($PONO,$MaterialCode); + $ReceivedQty = $this->purchaseorder_model->GetLineItemReceivedQty($PONO,$MaterialCode); - // if(count($ReceivedQty)>0) - // { - // $RecQtyvalue = $ReceivedQty[0]['ReceivedQuantity']; - // } + if(count($ReceivedQty)>0) + { + $RecQtyvalue = $ReceivedQty[0]['ReceivedQuantity']; + } if($Quantity != $beforeQuantity) { @@ -852,6 +892,25 @@ class amendmentpurchaseorder extends BaseController $LineItemStatus = REQITEM_NEW; + + + $igrvalue = $this->purchaseorder_model->selectigrmaster($PONO); + + + $po = ''; + if(count($igrvalue) >0) + { + $igrno = $igrvalue[0]->IGRNO; + $po =$igrvalue[0]->PONO; + + } + + if($PONO == $po) + { + $NewPOno = array('PONO' =>$NewPO); + $this->purchaseorder_model->updateigrmaster($igrno,$NewPOno); + } + for ($i = 1; $i <= $RowCount; $i++) { @@ -1201,6 +1260,26 @@ class amendmentpurchaseorder extends BaseController $APO=$this->purchaseorder_model->updateAmendPOMaster($PONO,$PODetail); $LineItemStatus = REQITEM_NEW; + + + + $igrvalue = $this->purchaseorder_model->selectigrmaster($PONO); + + + $po = ''; + if(count($igrvalue) >0) + { + $igrno = $igrvalue[0]->IGRNO; + $po =$igrvalue[0]->PONO; + + } + + if($PONO == $po) + { + $NewPOno = array('PONO' =>$NewPO); + $this->purchaseorder_model->updateigrmaster($igrno,$NewPOno); + } + for ($i = 1; $i <= $RowCount; $i++) { diff --git a/application/models/purchaseorder_model.php b/application/models/purchaseorder_model.php index ab91f684..8f5bfd46 100644 --- a/application/models/purchaseorder_model.php +++ b/application/models/purchaseorder_model.php @@ -166,6 +166,36 @@ Where IGRM.PONO = ? '; return $myfile; } + /*--------------------------------------------------*/ +/* this function used parendpo igr values get inward report display */ +function updateigrmaster($igrno,$NewPOno) + + { + // $this->db->insert('T_IGR_Master',$IGRaddvalues); + // $myfile=$this->db->affected_rows(); + // return $myfile; + + $this->db->where('IGRNO',$igrno); + $this->db->update('T_IGR_Master',$NewPOno); + $insert_id = $this->db->affected_rows(); + return $insert_id; +} + +function selectigrmaster($PONO) +{ + +$this->db->select('*'); +$this->db->from('T_IGR_Master'); +$this->db->where('PONO',$PONO); + $query = $this->db->get(); + return $query->result(); + +} + + +/*--------------------------------------------------*/ + + function getfunction($pono)