'Newscreenaddedandissuefixed'

This commit is contained in:
gandhimathi Bharathirajan 2017-07-07 17:47:36 +05:30
parent 9ba8c46c51
commit c4e53a937d
4 changed files with 103 additions and 88 deletions

View File

@ -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) */

View File

@ -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()
{

View File

@ -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();

View File

@ -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
<td align='left'>".$MaterialName."</td>
<td align='left'>".$UOM."</td>
<td align='left'>".$Quantity."</td>
<td align='left'>".$Remarks."</td>
</tr>";
@ -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()
{