Available budget amount and Service PO status update for requistion screen

This commit is contained in:
gandhimathi Bharathirajan 2017-09-04 12:12:05 +05:30
parent b805e31d23
commit 9f3ef6d65c

View File

@ -1504,15 +1504,41 @@ join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode
$this->db->set('Req.Status',$POStatus);
$this->db->where('Item.PONO',$PONO);
$this->db->update('T_PurchaseOrder_LineItem Item JOIN T_Requestion_Details Req ON Item.ReqNo= Req.ReqNo');
return TRUE;
return TRUE;
}
function UpdateReceivedQtyforServicePO($PONO)
function UpdateReceivedQtyforServicePO($PONO,$updateddt,$updatedBy)
{
$this->db->select('LineItemNo,MaterialCode');
$this->db->from('T_PurchaseOrder_LineItem');
$this->db->where('PONO ',$PONO );
$query = $this->db->get();
$result = $query->result();
if(!empty($result))
{
foreach ($result as $res)
{
$LineItemNo =$res->LineItemNo;
$MaterialCode = $res->MaterialCode;
//echo $LineItemNo;
$subQuery = 'update T_PurchaseOrder_LineItem
set ReceivedQuantity=Quantity, status=? where PONO=?';
$query = $this->db->query($subQuery,array(PO_SERVICE_COMPLETED,$PONO));
set ReceivedQuantity=Quantity, status=?,UpdatedOn=?,UpdateBY=? where PONO=? and LineItemNo=?';
$query = $this->db->query($subQuery,array(PO_SERVICE_COMPLETED,$updateddt,$updatedBy,$PONO,$LineItemNo));
$finddot = strpos($PONO,'.');
if($finddot = true)
{
$subQuery = 'update T_PurchaseOrder_LineItem
set ReceivedQuantity=Quantity, status=?,UpdatedOn=?,UpdateBY=? where PONO=substring(?,1,(case when INstr(?,?) > 0 then INstr(?,?)-1 else 0 end)) and MaterialCode=?';
$query = $this->db->query($subQuery,array(PO_SERVICE_COMPLETED,$updateddt,$updatedBy,$PONO,$PONO,'.',$PONO,'.',$MaterialCode));
}
}
}
}
}