From 9bf6fada144cff8d390d77d922678a789179696c Mon Sep 17 00:00:00 2001 From: gandhimathi Bharathirajan Date: Wed, 10 May 2017 10:50:56 +0530 Subject: [PATCH] Requistion Flow --- application/views/requisitionform.php | 596 +++++++++++++++++++---- application/views/requisitionlisting.php | 2 +- 2 files changed, 511 insertions(+), 87 deletions(-) diff --git a/application/views/requisitionform.php b/application/views/requisitionform.php index c6a07505..d354c558 100644 --- a/application/views/requisitionform.php +++ b/application/views/requisitionform.php @@ -1,25 +1,4 @@ - @@ -31,6 +10,11 @@

Siddharth Industries - Requisition Form

+
+ 'form-label-left requistion ','name' => 'requistion','id' => 'requistion'); + + echo form_open($this->config->base_url().'addNewcost/',$attributes); ?>
@@ -73,7 +57,7 @@ endforeach; } - echo form_dropdown('EmpID', $options,set_value('EmpID'),'id="EmpID"' ,'class = "form-control select2"','required="true"'); + echo form_dropdown('EmpID', $options,set_value('EmpID'),'id="EmpID"' ,'class = "form-control"','disabled="disabled"'); ?> @@ -84,7 +68,7 @@
'SupplierAddress','value' => set_value('SupplierAddress'),'id'=>'SupplierAddress', 'class' => 'form-control' ,'readonly' => 'true'); + $data = array('name' => 'DeptName','value' => set_value('DeptName'),'id'=>'DeptName', 'class' => 'form-control' ,'readonly' => 'true'); echo form_input($data); ?>
@@ -93,7 +77,7 @@
'SupplierAddress','value' => set_value('SupplierAddress'),'id'=>'SupplierAddress', 'class' => 'form-control' ,'readonly' => 'true'); + $data = array('name' => 'Designation','value' => set_value('Designation'),'id'=>'Designation', 'class' => 'form-control' ,'readonly' => 'true'); echo form_input($data); ?>
@@ -106,18 +90,17 @@
'Select Cost Center Name'); - //print_r( $options); - - if(!empty($CostCenter)) - { - foreach ($CostCenter as $CID): - - - $options[$CID->CostName] = $CID->CostName.' '.' - '.' '.$CID->Description; + //print_r( $options); + + if(!empty($Cost)) + { + foreach ($Cost as $SID): + // echo $SID->ConfigValue; + $Budget[$SID->CostCenterCode] = $SID->CostCenterCode; - endforeach; - } - + endforeach; + + } echo form_dropdown('CostCenter', $options,set_value('CostCenter'),'id="CostCenter"' ,'class = "form-control"'); ?> @@ -128,7 +111,7 @@
'BudgetAmount','value' => set_value('BudgetAmount'),'id'=>'BudgetAmount', 'class' => 'form-control' ,'readonly' => 'true'); + $data = array('name' => 'AvlBudgetAmount','value' => set_value('AvlBudgetAmount'),'id'=>'AvlBudgetAmount', 'class' => 'form-control' ,'readonly' => 'true'); echo form_input($data); ?>
@@ -140,10 +123,10 @@
- +
- + Add Line Item
-
+ -
- - +
+ + +
+ +
+ + @@ -231,49 +280,20 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - + + +
SNo Material Code Material NameAction
1001Waste SandTon100     -     - -
2002ResinLitre50     -     - -
3003ResinLitre100     -     - -
- - - + + +   Save + + +

@@ -284,17 +304,421 @@
\ No newline at end of file + +$('#CostCenter').change(function() { + + var id = $('#CostCenter').val(); + $("#AvlBudgetAmount").val(''); + var ReqType = $('#RequestType').val(); + if(id != '-1') + { + $('#content').loader('show'); + + $.ajax({ + data:{id:id}, + dataType: 'json', + type:"POST", + url:"requisitionform/getAvailableBudAmount?ReqType="+ReqType, + success:function(json) { + $('#content').loader('hide'); + $("#AvlBudgetAmount").val(json.Cost[0]['BudgetAmount']); + + } + + }); + + } + else + { + alert('Please select the Employee details'); + return false; + } + +}); + $('#RequestType').change(function() + { + + $('#txtRowCount').val(''); + $('#txtDeletedRow').val(''); + $("#Description").val(''); + $("#UOM").val(''); + removeHiddenRows($('#Items').find('tr').length); + var id = $('#RequestType').val(); + + if(id != '-1') + { + $('#content').loader('show'); + + $.ajax({ + data:{id:id}, + dataType: 'json', + type:"POST", + url:"requisitionform/getMaterialCode", + success:function(json) { + $('#content').loader('hide'); + + $("#MaterialCode").empty(); + $("#MaterialCode").append(json.Material); + // $("#Description").val(json.MaterialName); + //$("#UOM").val(json.UOM); + } + + }); + //$('#content').loader('hide'); + } + else + { + alert('Please select the RequestType'); + return false; + } + +}); +$('#MaterialCode').change(function() { + + var id = $('#MaterialCode').val(); + +$("#Description").val(''); +$("#UOM").val(''); + if(id != '-1') + { + $('#content').loader('show'); + + $.ajax({ + data:{id:id}, + dataType: 'json', + type:"POST", + url:"requisitionform/getMaterialDetails", + success:function(json) { + $('#content').loader('hide'); + //alert(json.MatDetail); + $("#Description").val(json.MatDetail[0]['MaterialName']); + $("#UOM").val(json.MatDetail[0]['UOM']); + } + + }); + //$('#content').loader('hide'); + } + else + { + alert('Please select the RequestType'); + return false; + } + +}); + + +}); + + + \ No newline at end of file diff --git a/application/views/requisitionlisting.php b/application/views/requisitionlisting.php index 63dbcc91..45796c3e 100644 --- a/application/views/requisitionlisting.php +++ b/application/views/requisitionlisting.php @@ -21,7 +21,7 @@ speed:500