Service status update

This commit is contained in:
gandhimathi Bharathirajan 2017-07-21 16:17:39 +05:30
parent 4d2e1f16ff
commit 32c9bec302

View File

@ -2,6 +2,60 @@
class purchaseorder_model extends CI_Model
{
function GetServicePOListforStatusUpdate()
{
$this->db->select('*');
$this->db->from('T_PurchaseOrder_Master');
$this->db->where('POType',SERVICE);
$this->db->where('status',PO_RELEASED);
$query = $this->db->get();
return $query->result();
}
function GetPODetailforBillingServicePO($PONO)
{
$subQuery ='select mast.ReqNo,mast.ReqDate,supp.SupplierName,PODate,st.StatusName as WorkStatus,ServiceWorkStatus,POMast.PaymentTerms,
POMast.ServiceWorkStatus,LineItem.*,mat.MaterialName,mat.UOM,emp.FirstName,emp.LastName,POMast.TotalOrderValue
from T_PurchaseOrder_Master POMast
join T_PurchaseOrder_LineItem LineItem on LineItem.PONO = POMast.PONO
join T_SupplierDetailsN supp on supp.SupplierID = POMast.SupplierID
join T_MaterialMaster mat on mat.MaterialCode = LineItem.MaterialCode
join T_Status Stat on Stat.StatusCode = POMast.Status
join T_Status st on st.StatusCode = POMast.ServiceWorkStatus
join T_Requestion_Master mast on mast.ReqNo = LineItem.ReqNo
join tbl_users users on users.userId = mast.CreatedBy
join T_Employee_Details emp on emp.EmpID = users.EmpID
where POMast.POType=? and POMast.PONO=?';
$query = $this->db->query($subQuery,array(SERVICE,$PONO));
return $query->result_array();
}
function GetServicePOListforBilling()
{
$subQuery ='select POMast.PONO,supp.SupplierName,PODate,POMast.PaymentTerms,POMast.ServiceWorkStatusRemarks,
LineItem.*,mat.MaterialName,mat.UOM,emp.FirstName,emp.LastName,Tax.TotalValue,Cost.CostCenterName
,Dept.DepartmentName from T_PurchaseOrder_Master POMast
join T_PurchaseOrder_LineItem LineItem on LineItem.PONO = POMast.PONO
join T_Service_Tax Tax on Tax.LineItemNo = LineItem.LineItemNo
join T_SupplierDetailsN supp on supp.SupplierID = POMast.SupplierID
join T_MaterialMaster mat on mat.MaterialCode = LineItem.MaterialCode
join T_Status Stat on Stat.StatusCode = POMast.Status
join T_Requestion_Master mast on mast.ReqNo = LineItem.ReqNo
join tbl_users users on users.userId = POMast.CreatedBy
join T_Employee_Details emp on emp.EmpID = users.EmpID
join T_DepartmentDetails Dept on Dept.DEPCode = emp.Departmentcode
join T_CostCenter_Master Cost on Cost.CostCenterCode=LineItem.CostCenterCode
where POMast.POType=? and ServiceWorkStatus=?';
$query = $this->db->query($subQuery,array(SERVICE,SERVICE_COMPLETED));
return $query->result();
}
/**
* This function is used to get the user listing count
* @param string $searchText : This is optional search text