History detatails added

This commit is contained in:
gandhimathi Bharathirajan 2017-08-18 12:54:09 +05:30
parent fe29c8253a
commit 968b02f11c
2 changed files with 13 additions and 2 deletions

View File

@ -60,7 +60,7 @@ class mrir_model extends CI_Model
}
function ViewDistributionList()
{
$subQuery = 'select distinct POL.MaterialCode, MR.PONO,REQ.ReqNo,MM.MaterialName,MM.UOM,
$subQuery = 'select distinct ReqLine.MaterialCode, MR.PONO,REQ.ReqNo,MM.MaterialName,MM.UOM,
EMP.FirstName,DD.DEPCode,DD.DepartmentName,ReqLine.Quantity as RequestedQty,POL.Quantity
as OrderedQuantity ,sum(MD.ActualQuantityReceived) as ActualReceivedqty,sum(MD.QuantityAccepted) as
AcceptedQty,REQ.ReqDate,ReqLine.Status as ReqStatus,st.StatusName,ReqLine.Remarks
@ -71,7 +71,7 @@ function ViewDistributionList()
MM.MaterialCode = POL.MaterialCode join
T_Employee_Details EMP on EMP.EmpID = REQ.Requestedby join T_Status st on
st.StatusCode = ReqLine.Status join T_DepartmentDetails DD on DD.DEPCode = EMP.Departmentcode where
POL.status in (?,?) and ReqLine.Status not in(?) group by POL.MaterialCode ,POL.PONO';
POL.status in (?,?) and ReqLine.Status not in(?) group by ReqLine.MaterialCode ,POL.PONO';
$query = $this->db->query($subQuery,array(MRIR_APPROVED,PARTIAL_MRIRAPPROVED,REQITEM_NEW));
//print_r($this->db->last_query());
return $query->result();

View File

@ -65,6 +65,17 @@ class store_model extends CI_Model
}
function GetStockHisory($MaterialCode)
{
$this->db->select('Quantity,ActualQuantity,Remarks,updatedOn');
$this->db->from('T_Store_Stockdetails_History');
$this->db->where('MaterialCode',$MaterialCode);
$query = $this->db->get();
$result = $query;
return $result->result_array();
}
}