From 4d2e1f16ffaba9bac45b70758f6447a8727ee599 Mon Sep 17 00:00:00 2001 From: gandhimathi Bharathirajan Date: Fri, 21 Jul 2017 16:15:42 +0530 Subject: [PATCH] Service status update --- .../controllers/servicepurchaseorder.php | 80 ++++++++++++++++++- 1 file changed, 79 insertions(+), 1 deletion(-) diff --git a/application/controllers/servicepurchaseorder.php b/application/controllers/servicepurchaseorder.php index b645cb8e..38fee0d5 100755 --- a/application/controllers/servicepurchaseorder.php +++ b/application/controllers/servicepurchaseorder.php @@ -27,7 +27,85 @@ class servicepurchaseorder extends BaseController $this->isLoggedIn(); } - + function viewServicePOReportForBilling() + { + + $this->global['pageTitle'] = 'Siddharth : Service Purchase Order for Billing'; + + $data["Billing"] = $this->purchaseorder_model->GetServicePOListforBilling(); + + $this->loadViews("serviceporeport", $this->global,$data,null); + + } + + function UpdateServicePOStatus() + { + $this->global['pageTitle'] = 'Siddharth : Update Service PO Status'; + $data['PO'] = $this->purchaseorder_model->GetServicePOListforStatusUpdate(); + $data['WorkStatus']=$this->purchaseorder_model->getStatus(7); + //print_r($data['PO']); + + $this->loadViews("statusofservicepurchaseorder", $this->global,$data,Null); + + } + + + function getPODetails() + { + $PONO = $this->input->post('id'); + $result = $this->purchaseorder_model->GetPODetailforBillingServicePO($PONO); + $HTML=""; + for ($i = 0; $i < count($result); $i++) + { + $SNo = $i + 1; + $ReqNo = $result[$i]['ReqNo']; + $Reqedby = $result[$i]['FirstName']; + $ReqDate = $result[$i]['ReqDate']; + $SupplierID = $result[$i]['SupplierName']; + $Workstatus = $result[$i]['WorkStatus']; + $MaterialCode = $result[$i]['MaterialCode']; + $Description = $result[$i]['ServiceMaterialDescription']; + $UOM = $result[$i]['UOM']; + $Quantity = $result[$i]['Quantity']; + $Rate = $result[$i]['Rate']; + $rdate = new dateTime($result[$i]['ReqDate']); + $ReqDate = $rdate->format('d-m-Y'); + + + $HTML.=" + ".$SNo." + ". $ReqNo." + ".$Reqedby." + ".$ReqDate." + ".$SupplierID." + ".$MaterialCode." + ".$Description." + ".$UOM." + ".$Quantity." + ".$Rate." + + ".$Workstatus." + "; + } + + echo $HTML; + } + + function UpdateServiceStatus() + { + $PONO = $this->input->post('PONO'); + $WorkStatus = $this->input->post('WorkStatus'); + $Remarks = $this->input->post('Remarks'); + + $updatedBy = $this->session->userdata ( 'userId' ); + $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); + $updateddt = $dt->format('Y-m-d H:i:s'); + $POList = array('UpdateBY'=>$updatedBy,'UpdatedOn'=>$updateddt,'ServiceWorkStatusRemarks'=>$Remarks,'ServiceWorkStatus'=>$WorkStatus ); + + $POMaster = $this->purchaseorder_model->updatePOMaster($PONO,$POList); + + echo ""; + } // To get the available Budget Amount function AvilBudgetAmount() {