Requistion Flow

This commit is contained in:
gandhimathi Bharathirajan 2017-05-10 13:35:50 +05:30
parent 3f7df8d6ab
commit 0510719349

View File

@ -31,7 +31,13 @@ class requisitionform extends BaseController
{ {
$this->global['pageTitle'] = 'Siddharth : Requisition Listing'; $this->global['pageTitle'] = 'Siddharth : Requisition Listing';
$this->loadViews("requisitionlisting", $this->global, NULL); $userID = $this->session->userdata ( 'userId' );
$data['ReqList'] = $this->requistion_model->getRequistListUserID($userID);
$data['Status'] = $this->requistion_model->CheckDraftStatus($userID);
$this->loadViews("requisitionlisting", $this->global, $data, NULL);
} }
/** /**
* This function used to load the first screen of the requisition Form * This function used to load the first screen of the requisition Form
@ -45,8 +51,11 @@ class requisitionform extends BaseController
$data['EmpList'] = $this->requistion_model->getAllEmployees(); $data['EmpList'] = $this->requistion_model->getAllEmployees();
// $data['MaterialList'] = $this->requistion_model->getRawMaterialList(); $userID = $this->session->userdata ( 'userId' );
$data['Emp'] = $this->requistion_model->getEmpIdByUserID($userID);
$data['CostCenter'] = $this->requistion_model->getCostCenterUserID($userID);
$this->loadViews("requisitionform", $this->global, $data,null); $this->loadViews("requisitionform", $this->global, $data,null);
} }
@ -173,16 +182,29 @@ class requisitionform extends BaseController
//echo count($comma_separated); //echo count($comma_separated);
//echo $RowCount. " Status:". $Status; //echo $RowCount. " Status:". $Status;
$IsExists = $this->requistion_model->RequistionIsExists($Requestedby);
if(count( $IsExists) == 0)
{
$Request = array('ReqType'=>$RequestType, 'Requestedby'=>$Requestedby,'ReqDate'=>$createddt,'Status'=>$Status,'CreatedDate'=>$createddt,'CreatedBy'=>$CreateBy); $Request = array('ReqType'=>$RequestType, 'Requestedby'=>$Requestedby,'ReqDate'=>$createddt,'Status'=>$Status,'CreatedDate'=>$createddt,'CreatedBy'=>$CreateBy);
$Req = $this->requistion_model->addRequistion($Request); $Req = $this->requistion_model->addRequistion($Request);
}
else
{
$Request = array('ReqType'=>$RequestType, 'Requestedby'=>$Requestedby,'ReqDate'=>$createddt,'Status'=>$Status,'CreatedDate'=>$createddt,'CreatedBy'=>$CreateBy);
$UpdateReq = $this->requistion_model->UpdateRequistion($Request,$IsExists[0]['ReqNo']);
}
$ReqNumber = ''; $ReqNumber = '';
if(count($Req)>0) if(count($Req)>0)
{ {
$ReqNumber = $Req[0]['ReqNo']; $ReqNumber = $Req[0]['ReqNo'];
} }
//print_r($comma_separated); else
// $ReqNumber = 'REQ0001'; {
$ReqNumber = $IsExists[0]['ReqNo'];
}
$SkipInsert = False; $SkipInsert = False;
for ($i = 1; $i <= $RowCount; $i++) for ($i = 1; $i <= $RowCount; $i++)
{ {