From c4e53a937d8645f6de69fddc625ea84742464da1 Mon Sep 17 00:00:00 2001 From: gandhimathi Bharathirajan Date: Fri, 7 Jul 2017 17:47:36 +0530 Subject: [PATCH] 'Newscreenaddedandissuefixed' --- application/controllers/MRIRcontroller.php | 19 +-- .../controllers/inwardgateregister.php | 8 + application/controllers/purchaseorder.php | 7 +- .../controllers/storerequisitionlist.php | 157 +++++++++--------- 4 files changed, 103 insertions(+), 88 deletions(-) diff --git a/application/controllers/MRIRcontroller.php b/application/controllers/MRIRcontroller.php index 629d1200..02038880 100755 --- a/application/controllers/MRIRcontroller.php +++ b/application/controllers/MRIRcontroller.php @@ -23,19 +23,7 @@ class MRIRcontroller extends BaseController $this->load->library('form_validation'); $this->isLoggedIn(); } - /** - * This function used to load the first screen of the user - */ - // public function index() - // { - // $this->global['pageTitle'] = 'Siddharth : Material Inspetion Report'; - // - // $this->loadViews("materialinspectionreport", $this->global, NULL , NULL); - // } - - - function materialinspectionreport($mrir='',$IGRNO='') { $this->global['pageTitle'] = 'Siddharth : Material Inspection Report'; @@ -46,6 +34,13 @@ class MRIRcontroller extends BaseController $this->loadViews("materialinspectionreport", $this->global,$data,NULL); + } + + public function viewmrirforbilling() + { + $this->global['pageTitle'] = 'Siddharth : Billing '; + + $this->loadViews("viewmrirforbilling", $this->global, NULL , NULL); } /*FOR Displaying IGR Values in Materialinspectionreport.php(view file) */ diff --git a/application/controllers/inwardgateregister.php b/application/controllers/inwardgateregister.php index 335d6c77..d93b5cb9 100755 --- a/application/controllers/inwardgateregister.php +++ b/application/controllers/inwardgateregister.php @@ -42,6 +42,14 @@ class inwardgateregister extends BaseController $this->loadViews("viewinwardgateregister",$this->global,$data,NULL); } + function viewIGRDetails() + { + $this->load->model('inwardgateregister_model'); + $this->global['pageTitle'] = 'Siddharth : Inward Gate Register Details'; + $data['IGR']= $this->inwardgateregister_model->igrListing(); + + $this->loadViews("viewIGRDetails",$this->global,$data,NULL); + } function addinwardgateregister() { diff --git a/application/controllers/purchaseorder.php b/application/controllers/purchaseorder.php index 81093bdd..4edc4537 100755 --- a/application/controllers/purchaseorder.php +++ b/application/controllers/purchaseorder.php @@ -41,7 +41,12 @@ class purchaseorder extends BaseController $this->loadViews("viewfullpurchaseorder", $this->global,Null); } - + function advancerequest() + { + $this->global['pageTitle'] = 'Siddharth : Advance Request'; + + $this->loadViews("Advancerequest", $this->global, NULL , NULL); + } function requisition() { $data['DeptList'] = $this->purchaseorder_model->getDepartmentListForAllReq(); diff --git a/application/controllers/storerequisitionlist.php b/application/controllers/storerequisitionlist.php index 47123697..62f4d344 100755 --- a/application/controllers/storerequisitionlist.php +++ b/application/controllers/storerequisitionlist.php @@ -28,20 +28,18 @@ class storerequisitionlist extends BaseController /*ADD Store requisition line item */ - function addstores($userId='',$MaterialCode='') + function addstores() { $this->global['pageTitle'] = 'Siddharth : StoreRequisition Listing'; - $this->load->model('storerequistion_model'); - $userId= $this->session->userdata ('userId'); + $userId= $this->session->userdata ('userId'); $data['DEPCode'] = $this->session->userdata('DEPCode'); $data['DepName'] = $this->session->userdata('DepartmentName'); - //print_r($data['cost']); + $data['cost'] = $this->storerequistion_model->getCostUser($userId); - $data['MaterialList'] = $this->storerequistion_model->getRawMaterialList($MaterialCode); - //$data['Store'] = $this->storerequistion_model->Storeall($userId); - + $data['MaterialList'] = $this->storerequistion_model->getRawMaterialList(); + $this->loadViews("addstorerequisitionslip", $this->global,$data,null); } @@ -50,13 +48,10 @@ class storerequisitionlist extends BaseController function addstore() { - $this->global['pageTitle'] = 'Siddharth : StoreRequisition Listing'; - - //$this->load->model('storerequistion_model'); + $this->global['pageTitle'] = 'Siddharth : StoreRequisition Listing'; $userId= $this->session->userdata ('userId'); $data['Store'] = $this->storerequistion_model->Storeall($userId); - //print_r($data['Store']); - //echo "Check point form con"; + $this->loadViews("storerequisition", $this->global,$data,null); } @@ -78,7 +73,7 @@ class storerequisitionlist extends BaseController } /* The Function Edit Store Requistion list */ - function EditStoreRequistion($MaterialCode='') + function EditStoreRequistion() { $StoreReqNo = $_GET['StoreReqNo']; @@ -86,13 +81,12 @@ class storerequisitionlist extends BaseController $this->global['pageTitle'] = 'Siddharth : StoreRequisition Listing'; $this->load->model('storerequistion_model'); $data['cost'] = $this->storerequistion_model->editRequistDetails($StoreReqNo); - // print_r( $data); + $data['MaterialList'] = $this->storerequistion_model->getRawMaterialList($MaterialCode); $data['DepName'] = $this->session->userdata('DepartmentName'); $data['LineItem']=$this ->storerequistion_model->editstorerequistions($StoreReqNo); - // $data['StoreReqNO'] = $StoreReqNo ; - //print_r($data['LineItem']); + $this->loadViews("editstorerequisition", $this->global,$data,null); } @@ -113,19 +107,20 @@ class storerequisitionlist extends BaseController /**This function is used to add new StoreRequestion to the system */ function addNewRequistion() - { - $Status= $_GET['ID']; - // $Requestedby = $_GET['RequestedBy']; - $CostCenter = $_GET['CostCenter']; - $DEPCode = $_GET['DEPCode']; + { + + + $CostCenter = $this->input->post('CostCenter'); + $DEPCode = $this->input->post('txtDepCode'); $CreateBy = $this->session->userdata ( 'userId' ); $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); $createddt = $dt->format('Y-m-d H:i:s'); $DeletedRow = $this->input->post('txtDeletedRow'); - $RowCount = $_GET['txtRowCount']; - //echo $RowCount; die(); + $RowCount = $this->input->post('txtRowCount'); + $Status = $this->input->post('txtStatus'); $Requestedby = $this->session->userdata ( 'EmpID' ); $comma_separated = explode(':', $DeletedRow); + //echo 'done'; $IsExists = $this->storerequistion_model->RequistionIsExists($Requestedby); if(count( $IsExists) == 0) @@ -219,38 +214,69 @@ class storerequisitionlist extends BaseController } + + //To issue Store Requistion + function issuestorerequisition() + { + + $this->global['pageTitle'] = 'Siddharth : Issue StoreRequisition'; + $this->load->model('storerequistion_model'); + + $StoreReqNo= $_GET['ReqNo']; + + $data['ReqItem'] = $this->storerequistion_model->getRequistItemList($StoreReqNo); + $data['ReqListDetails'] = $this->storerequistion_model->getRequistDetails($StoreReqNo); + //print_r($data['ReqItem']); + $this->loadViews("issueStoreRequistion", $this->global,$data,null); + + } + + function UpdateIssueRequistion() + { + $ReqNO = $this->input->post('txtReqNo'); + $RowCount = $this->input->post('txtRowCount'); + $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); + $createddt = $dt->format('Y-m-d H:i:s'); + + $ItemStatus = STORE_ISSUSED; + + for ($i = 1; $i <= $RowCount; $i++) + { + + $MaterialCode = $this->input->post('MaterialCode'.$i); +// echo $MaterialCode; + $IssuedQuantity = $this->input->post('txtIssuedQuantity'.$i); + + + // echo'Material issed'; + if(strlen($IssuedQuantity)>0) + { + $Remarks = $this->input->post('txtRemarks'.$i); + + //echo $IssuedQuantity; + $CreatedBy = $this->session->userdata('userId'); + + + $storerequisition = array('StoreReqNo'=>$ReqNO,'MaterialCode'=>$MaterialCode,'QuantityIssued'=>$IssuedQuantity,'Status'=>$ItemStatus,'StoreComments'=>$Remarks,'UpdatedOn'=>$createddt,'UpdatedBy'=>$CreatedBy); + + + $this->storerequistion_model->UpdateStoreRequistionItem($storerequisition,$ReqNO,$MaterialCode); + } + + } + + redirect('storerequisitionlisting','refresh'); + + //echo 'Updated successfully'; + + } /* this function use to search StoreRequistlist*/ function SearchRequistLists() { $userID = $this->session->userdata ( 'userId' ); - $ReqValue = $this->input->post('SearchDate'); - - $Dt = explode("-",$ReqValue); - - $FromDate =''; - $ToDate = ''; - $Status= ''; - if(count( $Dt)>1) - { - $FDate = $Dt[0]."-".$Dt[1]."-".$Dt[2]; - $TDate = $Dt[3]."-".$Dt[4]."-".$Dt[5]; - $FromDate = $this->getDateformat($FDate); - $ToDate = $this->getDateformat($TDate); - } - - $St = $this->input->post('STORE REQUISTION STATUS'); - - - if($St == "-1") - { - $Status = ''; - } - else - { - $Status = $St; - } + - $data['AppList'] = $this->storerequistion_model->getApproverRequistList($userID,$Status,$FromDate, $ToDate); + $data['AppList'] = $this->storerequistion_model->getApproverRequistList($userID); $this->global['pageTitle'] = 'Siddharth : ApprovalStoreRequisitionSlip'; $data['Status']= $this->storerequistion_model->getStatus(); @@ -302,10 +328,10 @@ class storerequisitionlist extends BaseController $StoreReqNo= $this->input->post('id'); - $result = $this->storerequistion_model->getRequistItemList($StoreReqNo); + $result = $this->storerequistion_model->getRequistItemListApproval($StoreReqNo); $ReqList = $this->storerequistion_model->getRequistDetails($StoreReqNo); - $DepNo = $ReqList[0]['DepartmentName']; - //$CostList = $this->requistion_model->GetCostCenterByDept($DepNo); + // $DepNo = $ReqList[0]['DepartmentName']; + $HTML=""; for ($i = 0; $i < count($result); $i++) { @@ -321,6 +347,7 @@ class storerequisitionlist extends BaseController ".$MaterialName." ".$UOM." ".$Quantity." + ".$Remarks." "; @@ -328,31 +355,11 @@ class storerequisitionlist extends BaseController //$index = $index + 1; } - $CostCode = ''; - $ReqType = ''; - $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); - $Year = $dt->format('Y'); - if(count($ReqList)>0) - { - $ReqType = $ReqList[0]['Requestedby']; - - $CostCode = $ReqList[0]['CostCenterName']; - //$AvlBudget=$ReqList[0]['CostCenterName']; - } - - $AvlBudget = $this->storerequistion_model->GetAvailableBudgetAmount($CostCode,$Year,$ReqType); - //print_r($result); - $AvilBudAmt = '0'; - if(count($AvlBudget)>0) - { - $AvilBudAmt = $AvlBudget[0]['BudgetAmount'] - $AvlBudget[0]['Totalvalue']; - } - //echo $AvilBudAmt; - die(json_encode(array('Items' =>$HTML,'Requist'=>$ReqList,'AvilBudAmount'=>number_format($AvilBudAmt,2)))); + //print_r($ReqList); + die(json_encode(array('Items' =>$HTML,'Requist'=>$ReqList))); } - //not completed function EditStoreRequisitions() {