From eb18abab086fb5b2e23ac943852d6d4c79d3aa28 Mon Sep 17 00:00:00 2001 From: gandhimathi Bharathirajan Date: Sun, 30 Jul 2017 01:09:30 +0530 Subject: [PATCH] MRIR issue fixed and PORelease screen issue Fixed --- application/models/mrir_model.php | 15 ++++++++------- application/models/purchaseorder_model.php | 6 +++--- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/application/models/mrir_model.php b/application/models/mrir_model.php index f241f6f4..c05bed76 100755 --- a/application/models/mrir_model.php +++ b/application/models/mrir_model.php @@ -120,7 +120,7 @@ function ViewDistributionList() function edit_mrir($MrirNo) { $this->db->distinct(); - $this->db->select('TMM.MRIRNO,TMM.PONO,TMM.IGRNO,TMM.Createdon,TMD.ActualQuantityReceived,IGRM.DeliveryChellanOrInvoiceNo,IGRM.DeliveryChellanDate,IGRM.VehicleNo,IGRM.CourierNo,IGRM.CreatedDate,IGRD.QuantityAsPerInvoice,SUPP.SupplierName,SUPP.Address,POMR.PODate,POMR.DeliveryDate,POMR.ServiceDescription,TMD.MaterialCode,MM.MaterialName,MM.UOM,POLT.Quantity,POLT.ReceivedQuantity,ED.FirstName as PORasiedbyName,ED1.FirstName as MRIRRasiedbyName, ED2.FirstName as IGRRasiedbyName,TMM.MRIRStatus'); + $this->db->select('TMM.MRIRNO,TMM.PONO,TMM.IGRNO,TMM.Createdon,TMD.MRIRItemNo,TMD.ActualQuantityReceived,TMD.QuantityAccepted,TMD.QuantityRejected,IGRM.DeliveryChellanOrInvoiceNo,IGRM.DeliveryChellanDate,IGRM.VehicleNo,IGRM.CourierNo,IGRM.CreatedDate,IGRD.QuantityAsPerInvoice,SUPP.SupplierName,SUPP.Address,POMR.PODate,POMR.DeliveryDate,POMR.ServiceDescription,TMD.MaterialCode,MM.MaterialName,MM.UOM,POLT.Quantity,POLT.ReceivedQuantity,ED.FirstName as PORasiedbyName,ED1.FirstName as MRIRRasiedbyName, ED2.FirstName as IGRRasiedbyName,TMM.MRIRStatus'); $this->db->from ('T_MRIR_Master TMM'); $this->db->join ('T_MRIR_Details TMD','TMM.MRIRNO = TMD.MRIRNO','left');//to get IGRNO,PONO,MRIRNO,mrirdate, $this->db->join ('T_IGR_Master IGRM', 'IGRM.IGRNO = TMM.IGRNO','left');//to get actualquantity,deliverydate,Invoicedate,vechileno,courierno,igrdate, @@ -186,13 +186,14 @@ function ViewDistributionList() /* This function is used to update the value in MRIR detail table*/ - function update_mrirdetail($updatedetailvalues,$mrir_no) + function update_mrirdetail($updatedetailvalues,$Lineitm) { - $this->db->where('MRIRNO',$mrir_no); - $this->db->update('T_MRIR_Details',$updatedetailvalues); - $affectedRows = $this->db->affected_rows(); - - return $affectedRows; + + $this->db->where('MRIRItemNo',$Lineitm); + + $this->db->update('T_MRIR_Details',$updatedetailvalues); + + } diff --git a/application/models/purchaseorder_model.php b/application/models/purchaseorder_model.php index e686b661..85b4b278 100755 --- a/application/models/purchaseorder_model.php +++ b/application/models/purchaseorder_model.php @@ -1237,7 +1237,7 @@ function GetCurrencytype() { $this->db->distinct(); - $this->db->select('mast.PONO,mast.TotalOrderValue,st.StatusCode,st.StatusName,emp.FirstName,mast.CreatedDate,ccm.CostCenterName,ccm.CostCenterCode,mast.POType as ReqType,bud.BudgetAmount,mast.Remarks,DepartmentName,mast.ApprovedBy,(select EmpID from tbl_users where userId=mast.ApprovedBy )as EID, + $this->db->select('mast.PONO,mast.TotalOrderValue,st.StatusCode,st.StatusName,emp.FirstName,mast.CreatedDate,ccm.CostCenterName,ccm.CostCenterCode,mast.POType as ReqType,mast.Remarks,DepartmentName,mast.ApprovedBy,(select EmpID from tbl_users where userId=mast.ApprovedBy )as EID, (select FirstName from T_Employee_Details where EmpID=EID)as Approver'); $this->db->from('T_PurchaseOrder_Master mast'); // $this->db->order_by('mast.Status',"PO_CREATED"); @@ -1247,8 +1247,8 @@ function GetCurrencytype() $this->db->join('T_DepartmentDetails as Dep','Dep.DEPCode=emp.Departmentcode'); $this->db->join('T_PurchaseOrder_LineItem req', 'req.PONO= mast.PONO'); $this->db->join('T_Requestion_Master rmast','rmast.ReqNo=req.ReqNo'); - $this->db->join('T_CostCenter_Budget bud','bud.CostCenterCode = req.CostCenterCode and bud.BudgetType = rmast.ReqType'); - $this->db->join('T_CostCenter_Master ccm','ccm.CostCenterCode = req.CostCenterCode and ccm.CostCenterCode = bud.CostCenterCode'); + //$this->db->join('T_CostCenter_Budget bud','bud.CostCenterCode = req.CostCenterCode and bud.BudgetType = rmast.ReqType'); + $this->db->join('T_CostCenter_Master ccm','ccm.CostCenterCode = req.CostCenterCode'); // $this->db->where('mast.Status',PO_AMENDED); // EMERGENGY PO if($Amendment=='A'){ //A- Approved $this->db->or_where('mast.Status',PO_CREATED);//PO CREATED