Requistion Approval

This commit is contained in:
venbatechnologies 2017-07-27 19:26:27 +05:30
parent 9d6c5fdf83
commit 051c1c97c4
7 changed files with 24 additions and 41 deletions

View File

@ -283,10 +283,12 @@ class requistion_model extends CI_Model
function getRequistDetails($ReqID,$NoArray='') function getRequistDetails($ReqID,$NoArray='')
{ {
$subQuery = 'select distinct ReqNo,ReqType,Status,Requestedby,DATE_FORMAT(mast.CreatedDate, "%d-%m-%Y") as CreatedDate,Schedule_Type,NumberOfService,Service_Period ,emp.FirstName,emp.EmpID,emp.Designation, Dept.DEPCode,Dept.DepartmentName,DATE_FORMAT(mast.ReqDate, "%d-%m-%Y") as ReqDate,CostCenterCode $subQuery = 'select distinct ReqNo,ReqType,Status,Requestedby,DATE_FORMAT(mast.CreatedDate, "%d-%m-%Y") as CreatedDate,Schedule_Type,NumberOfService,Service_Period ,emp.FirstName,emp.EmpID,emp.Designation, Dept.DEPCode,Dept.DepartmentName,DATE_FORMAT(mast.ReqDate, "%d-%m-%Y") as ReqDate,mast.CostCenterCode,Cost.CostCenterName
from T_Requestion_Master mast from T_Requestion_Master mast
join T_CostCenter_Master Cost on Cost.CostCenterCode = mast.CostCenterCode
join T_Employee_Details emp on mast.Requestedby = emp.EmpID join T_Employee_Details emp on mast.Requestedby = emp.EmpID
join T_DepartmentDetails Dept on emp.Departmentcode = Dept.DEPCode join T_DepartmentDetails Dept on emp.Departmentcode = Dept.DEPCode
where ReqNo=?'; where ReqNo=?';
$query = $this->db->query($subQuery, array($ReqID)); $query = $this->db->query($subQuery, array($ReqID));

View File

@ -298,16 +298,17 @@ class storerequistion_model extends CI_Model
* This function is used to get the List of Store Requist details to the approver * This function is used to get the List of Store Requist details to the approver
* @return array $result : This is result of the query * @return array $result : This is result of the query
*/ */
function getApproverRequistList($UserID) function getApproverRequistList($UserID)
{ {
// echo 'UserId: '.$UserID . 'From: '.$FromDate .'TO: '. $ToDate. 'Status: '. $Status; // echo 'UserId: '.$UserID . 'From: '.$FromDate .'TO: '. $ToDate. 'Status: '. $Status;
$subQuery = 'select distinct Str.StoreReqNo,Str.Requestedby,Str.ReqDate,Str.Status,Str.CreatedDate,Str.Comments,St.StatusName $subQuery = ' select distinct Str.StoreReqNo,Str.Requestedby,Str.ReqDate,Str.Status,Str.CreatedDate,Str.Comments,St.StatusName,Emp.FirstName
from T_Store_Requestion_Master Str from T_Store_Requestion_Master Str
join T_Status St on St.StatusCode = Str.Status join T_Status St on St.StatusCode = Str.Status
join T_Employee_Details Emp on Emp.Departmentcode =Str.DepartmentCode -- join T_Employee_Details Emp on Emp.Departmentcode =Str.DepartmentCode
join T_DepartmentDetails Dept on Dept.DEPCode = Emp.Departmentcode join T_Employee_Details Emp on Emp.EmpID =Str.Requestedby
join T_DepartmentDetails Dept on Dept.DEPCode = Emp.Departmentcode
where Str.Status not in(?,?,?) and Emp.Departmentcode in (select DEPCode from T_DepartmentDetails where HeadDept= where Str.Status not in(?,?,?) and Emp.Departmentcode in (select DEPCode from T_DepartmentDetails where HeadDept=
(select HeadDept from T_DepartmentDetails where DEPCode = (select Departmentcode from T_Employee_Details where (select HeadDept from T_DepartmentDetails where DEPCode = (select Departmentcode from T_Employee_Details where
EmpID=(select EmpID from tbl_users where userId=?))))'; EmpID=(select EmpID from tbl_users where userId=?))))';
@ -325,12 +326,13 @@ class storerequistion_model extends CI_Model
* This function is used to get the Store Requsition List for the login user * This function is used to get the Store Requsition List for the login user
* @return array $result : This is result of the query * @return array $result : This is result of the query
*/ */
function getRequistDetails($StoreReqNo='') function getRequistDetails($StoreReqNo='')
{ {
$subQuery = 'select Str.StoreReqNo,Str.Requestedby,Str.ReqDate,Dept.DEPCode,Dept.DepartmentName,Cm.CostCenterCode,Cm.CostCenterName from T_Store_Requestion_Master Str $subQuery = ' select Str.StoreReqNo,Str.Requestedby,Str.ReqDate,Dept.DEPCode,Dept.DepartmentName,Cm.CostCenterCode,Cm.CostCenterName,Emp.FirstName from T_Store_Requestion_Master Str
join T_DepartmentDetails Dept on Dept.DEPCode = Str.DepartmentCode join T_DepartmentDetails Dept on Dept.DEPCode = Str.DepartmentCode
join T_CostCenter_Master Cm on Cm.CostCenterCode =Str.CostCenterCode join T_CostCenter_Master Cm on Cm.CostCenterCode =Str.CostCenterCode
join T_Employee_Details Emp on Emp.EmpID =Str.Requestedby
where StoreReqNo =? '; where StoreReqNo =? ';

View File

@ -165,7 +165,7 @@
?> ?>
<tr id="<?php echo $index ?>" > <tr id="<?php echo $index ?>" >
<td><a data-toggle="modal" data-target="#myModal" data-id="<%=index%>" data-userid="<?php echo $record->StoreReqNo ?>" ><u><?php echo $record->StoreReqNo ?></u></a></td> <td><a data-toggle="modal" data-target="#myModal" data-id="<%=index%>" data-userid="<?php echo $record->StoreReqNo ?>" ><u><?php echo $record->StoreReqNo ?></u></a></td>
<td><?php echo $record->Requestedby?></td> <td><?php echo $record->FirstName?></td>
<td ><?php $Cdt = new DateTime($record->ReqDate); <td ><?php $Cdt = new DateTime($record->ReqDate);
$ReqDate= $Cdt->format('d-m-Y'); $ReqDate= $Cdt->format('d-m-Y');
echo $ReqDate; echo $ReqDate;
@ -256,7 +256,7 @@ function Reset()
if(json.Requist != '') if(json.Requist != '')
{ {
//alert(json.Requist[0]['Requestedby']) ; //alert(json.Requist[0]['Requestedby']) ;
$("#Requestedby").val(json.Requist[0]['Requestedby']); $("#Requestedby").val(json.Requist[0]['FirstName']);
$("#ReqDate").val(json.Requist[0]['ReqDate']); $("#ReqDate").val(json.Requist[0]['ReqDate']);
$("#Desigination").val(json.Requist[0]['DepartmentName']); $("#Desigination").val(json.Requist[0]['DepartmentName']);
$("#CostCenter").val(json.Requist[0]['CostCenterName']); $("#CostCenter").val(json.Requist[0]['CostCenterName']);

View File

@ -180,7 +180,7 @@ if(!empty($Emp))
</div> </div>
</div> </div>
</div>
<div class="container-fluid"> <div class="container-fluid">
<table class="table table-bordered" style="border:1px solid #333"> <table class="table table-bordered" style="border:1px solid #333">

View File

@ -310,10 +310,10 @@ $("#myModal").on("shown.bs.modal", function(e) {
$('#content').loader('hide'); $('#content').loader('hide');
//alert(data); //alert(data);
$("#ReqType").val(json.Requist[0]['ReqType']); $("#ReqType").val(json.Requist[0]['ReqType']);
$("#ReqBy").val(json.Requist[0]['Requestedby']); $("#ReqBy").val(json.Requist[0]['FirstName']);
$("#ReqDate").val(json.Requist[0]['CreatedDate']); $("#ReqDate").val(json.Requist[0]['CreatedDate']);
$("#Desigination").val(json.Requist[0]['Designation']); $("#Desigination").val(json.Requist[0]['Designation']);
$("#CostCenter").val(json.Requist[0]['CostCenterCode']); $("#CostCenter").val(json.Requist[0]['CostCenterName']);
$("#AvlBudgetAmount").val(json.AvilBudAmount); $("#AvlBudgetAmount").val(json.AvilBudAmount);
$("#tbleAppend").append(json.Items); $("#tbleAppend").append(json.Items);

View File

@ -120,21 +120,11 @@
<br/> <br/>
<div class="col-md-12"> <div class="col-md-12">
<div class="col-md-3"> <div class="col-md-3">
<label>Supplier and Address :</label> <label>Supplier Name:</label>
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
<input type="text" id="Supplier" readonly> <input type="text" id="Supplier" readonly>
<textarea rows="3" cols="21" id="Add1" readonly> </div>
</textarea><br/>
</div>
<div class="col-md-3">
<label>Comments Of Special Instructions :</label>
</div>
<div class="col-md-3">
<textarea rows="4" cols="21" id="ser" readonly>
</textarea>
</div>
</div> </div>
<!-- Table to show the line item of po --> <!-- Table to show the line item of po -->
<div id="content" > </div> <div id="content" > </div>
@ -154,7 +144,7 @@
</table> </table>
<div class="modal-footer"> <div class="modal-footer">
<a class="btn btn-info" data-dismiss="modal" value="Cancel">Cancel</a> <a class="btn btn-primary" data-dismiss="modal" value="Cancel">Cancel</a>
</div> </div>
</div> </div>
</form> </form>

View File

@ -164,28 +164,17 @@
<div class="col-md-12"> <div class="col-md-12">
<div class="col-md-3"> <div class="col-md-3">
<label>Supplier and Address :</label> <label>Supplier Name :</label>
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
<?php <?php
$data = array('name' => 'SupplierName','value' => set_value('SupplierName'),'id'=>'SupplierName', 'class' => 'form-control','readonly'=>'true'); $data = array('name' => 'SupplierName','value' => set_value('SupplierName'),'id'=>'SupplierName', 'class' => 'form-control','readonly'=>'true');
echo form_input($data); echo"<br>"; echo form_input($data);
$data = array('name' => 'Address','value' => set_value('Address'),'id'=>'Address','class' =>'form-control','rows' => '4','cols' => '50','style' => 'width:100%' ,'readonly'=>'true');
echo form_textarea($data); echo"<br>";
?> ?>
</div> </div>
<div class="col-md-3">
<label>Comments Of Special Instructions :</label>
</div>
<div class="col-md-3">
<?php
$data = array('name' => 'Remarks','value' => set_value('Remarks'),'id'=>'Remarks', 'class' => 'form-control','readonly'=>'true');
echo form_input($data); echo"<br>";
?>
</div>
</div> </div>
<div> <div>
@ -235,7 +224,7 @@
</div> </div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<a class="btn btn-info" data-dismiss="modal" value="Cancel">Cancel</a> <a class="btn btn-primary" data-dismiss="modal" value="Cancel">Cancel</a>
</div> </div>
</div> </div>
</form> </form>