edit description
This commit is contained in:
parent
374df9d2f1
commit
129ef94f6f
@ -482,6 +482,10 @@ class requisitionform extends BaseController
|
|||||||
|
|
||||||
/* Table value update and Insert in the table */
|
/* Table value update and Insert in the table */
|
||||||
//echo "RowCOunt:" .$RowCount;
|
//echo "RowCOunt:" .$RowCount;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$SkipInsert = False;
|
$SkipInsert = False;
|
||||||
for ($i = 1; $i <= $RowCount; $i++)
|
for ($i = 1; $i <= $RowCount; $i++)
|
||||||
{
|
{
|
||||||
@ -503,18 +507,22 @@ class requisitionform extends BaseController
|
|||||||
|
|
||||||
if($SkipInsert == "False")
|
if($SkipInsert == "False")
|
||||||
{
|
{
|
||||||
|
|
||||||
$MaterialCode = $this->input->post('MaterialCode'.$i);
|
$MaterialCode = $this->input->post('MaterialCode'.$i);
|
||||||
$Quantity = $this->input->post('Quantity'.$i);
|
$Quantity = $this->input->post('Quantity'.$i);
|
||||||
|
$otherD =$this->input->post('otherD'.$i);
|
||||||
|
//echo $otherD;
|
||||||
|
|
||||||
$IsExists = $this->requistion_model->LineItemIsExists($ReqNumber,$MaterialCode);
|
$IsExists = $this->requistion_model->LineItemIsExists($ReqNumber,$MaterialCode);
|
||||||
if(count( $IsExists) == 0)
|
if(count( $IsExists) == 0)
|
||||||
{
|
{
|
||||||
$ReqDetails = array('ReqNo'=>$ReqNumber, 'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'UpdatedBy'=>$UpdatedBy,'UpdatedOn'=>$updatedDate);
|
$ReqDetails = array('ReqNo'=>$ReqNumber, 'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'UpdatedBy'=>$UpdatedBy,'UpdatedOn'=>$updatedDate,'MaterialDescription'=>$otherD);
|
||||||
|
|
||||||
$this->requistion_model->addRequistionDetails($ReqDetails,$ReqNumber);
|
$this->requistion_model->addRequistionDetails($ReqDetails,$ReqNumber);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$ReqDetails = array('ReqNo'=>$ReqNumber, 'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'UpdatedBy'=>$UpdatedBy,'UpdatedOn'=>$updatedDate);
|
$ReqDetails = array('ReqNo'=>$ReqNumber, 'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'UpdatedBy'=>$UpdatedBy,'UpdatedOn'=>$updatedDate,'MaterialDescription'=>$otherD);
|
||||||
|
|
||||||
$this->requistion_model->UpdateRequistionLineItem($ReqDetails,$ReqNumber,$MaterialCode);
|
$this->requistion_model->UpdateRequistionLineItem($ReqDetails,$ReqNumber,$MaterialCode);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -297,6 +297,23 @@ if(!empty($ReqPOType))
|
|||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-md-6" id="otherDescription" >
|
||||||
|
<label>Other Description</label>
|
||||||
|
<div class="form-group">
|
||||||
|
<?php
|
||||||
|
$data = array('name' => 'otherD','value' => set_value('otherD'),'id'=>'otherD', 'class' => 'form-control' ,'rows' => '5', 'cols' => '70','maxlength' => '500');
|
||||||
|
echo Form_textarea($data);
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<label>UOM</label>
|
<label>UOM</label>
|
||||||
<div>
|
<div>
|
||||||
@ -360,6 +377,25 @@ if(!empty($ReqPOType))
|
|||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-md-6" id="EditotherDescription">
|
||||||
|
<label>Other Description</label>
|
||||||
|
<div class="form-group">
|
||||||
|
<?php
|
||||||
|
// $data = array('name' => 'EditotherD','value' => set_value('EditotherD'),'id'=>'EditotherD', 'class' => 'form-control','readonly'=>'true' );
|
||||||
|
// echo form_input($data);
|
||||||
|
|
||||||
|
$data = array('name' => 'EditotherD','value' => set_value('EditotherD'),'id'=>'EditotherD', 'class' => 'form-control' ,'rows' => '5', 'cols' => '70','maxlength' => '500');
|
||||||
|
echo Form_textarea($data);
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<label>UOM</label>
|
<label>UOM</label>
|
||||||
<div>
|
<div>
|
||||||
@ -417,6 +453,8 @@ if(!empty($ReqPOType))
|
|||||||
foreach($LineItem as $record)
|
foreach($LineItem as $record)
|
||||||
{
|
{
|
||||||
$index = $index + 1;
|
$index = $index + 1;
|
||||||
|
$materialdesc=$record->MaterialDescription;
|
||||||
|
//echo $materialdesc;
|
||||||
?>
|
?>
|
||||||
<tr id="<?php echo $index ; ?>">
|
<tr id="<?php echo $index ; ?>">
|
||||||
<td align="left"><?php echo $index ; ?></td>
|
<td align="left"><?php echo $index ; ?></td>
|
||||||
@ -511,6 +549,10 @@ $(function() {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$('#otherDescription').hide();
|
||||||
|
$('#EditotherDescription').hide();
|
||||||
|
|
||||||
$( ".datePicker" ).datepicker({ dateFormat: 'dd/mm/yy' });
|
$( ".datePicker" ).datepicker({ dateFormat: 'dd/mm/yy' });
|
||||||
|
|
||||||
//Initialize Select2 Elements
|
//Initialize Select2 Elements
|
||||||
@ -614,9 +656,20 @@ $('#drpMaterial').change(function() {
|
|||||||
|
|
||||||
var id = $('#drpMaterial').val();
|
var id = $('#drpMaterial').val();
|
||||||
|
|
||||||
|
// var skillsSelect = document.getElementById("drpMaterial");
|
||||||
|
// var selectedText = skillsSelect.options[skillsSelect.selectedIndex].text;
|
||||||
|
|
||||||
|
var value = $("#drpMaterial option:selected").text();
|
||||||
|
answer = value.replace(/[^a-z]/gi, '');
|
||||||
|
var converttext = answer.toUpperCase();
|
||||||
|
//alert(converttext)
|
||||||
|
|
||||||
$("#Description").val('');
|
$("#Description").val('');
|
||||||
$("#UOM").val('');
|
$("#UOM").val('');
|
||||||
if(id != '-1')
|
if(id != '-1')
|
||||||
|
{
|
||||||
|
|
||||||
|
if((converttext != 'SERVICE'))
|
||||||
{
|
{
|
||||||
$('#content').loader('show');
|
$('#content').loader('show');
|
||||||
|
|
||||||
@ -633,6 +686,12 @@ $("#UOM").val('');
|
|||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$('#otherDescription').show();
|
||||||
|
}
|
||||||
//$('#content').loader('hide');
|
//$('#content').loader('hide');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -888,19 +947,29 @@ $('.addClick').click(function(){
|
|||||||
var materialName = $("#Description").val();
|
var materialName = $("#Description").val();
|
||||||
var uom = $("#UOM").val();
|
var uom = $("#UOM").val();
|
||||||
var quantity = $("#Quantity").val();
|
var quantity = $("#Quantity").val();
|
||||||
|
var materialdescription= $('#otherD').val();
|
||||||
|
|
||||||
$('#drpMaterial option[value='+materialCode+']').remove();
|
$('#drpMaterial option[value='+materialCode+']').remove();
|
||||||
$('#Description').val('');
|
$('#Description').val('');
|
||||||
$('#UOM').val('');
|
$('#UOM').val('');
|
||||||
$('#Quantity').val('');
|
$('#Quantity').val('');
|
||||||
|
$('#otherD').val('')
|
||||||
|
|
||||||
index = parseInt(index)+1;
|
index = parseInt(index)+1;
|
||||||
|
|
||||||
|
|
||||||
var template = jQuery("#tempList").html();
|
var template = jQuery("#tempList").html();
|
||||||
|
|
||||||
|
if(materialdescription == '')
|
||||||
|
{
|
||||||
$('#tempAppend').append(_.template(template,{index:temp,MaterialCode:materialCode,MaterialName:materialName,UOM:uom,Quantity:quantity}));
|
$('#tempAppend').append(_.template(template,{index:temp,MaterialCode:materialCode,MaterialName:materialName,UOM:uom,Quantity:quantity}));
|
||||||
|
}
|
||||||
|
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$('#tempAppend').append(_.template(template,{index:temp,MaterialCode:materialCode,MaterialName:materialdescription,UOM:uom,Quantity:quantity}));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var theForm = $(".requistion");
|
var theForm = $(".requistion");
|
||||||
@ -938,6 +1007,13 @@ $('.addClick').click(function(){
|
|||||||
value:quantity
|
value:quantity
|
||||||
}).appendTo('form');
|
}).appendTo('form');
|
||||||
|
|
||||||
|
$('<input>').attr({
|
||||||
|
type: 'hidden',
|
||||||
|
id: 'otherD' + temp,
|
||||||
|
name: 'otherD'+ temp,
|
||||||
|
value:materialdescription
|
||||||
|
}).appendTo('form');
|
||||||
|
|
||||||
$('#txtRowCount').val(temp);
|
$('#txtRowCount').val(temp);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -965,11 +1041,35 @@ $("#EditItem").on("shown.bs.modal", function(e) {
|
|||||||
// alert(userid);
|
// alert(userid);
|
||||||
var tr= document.getElementById(userid);
|
var tr= document.getElementById(userid);
|
||||||
var cellval = tr.cells;
|
var cellval = tr.cells;
|
||||||
|
|
||||||
|
//var desc=cellval[2].innerHTML;
|
||||||
|
var check=cellval[2].innerHTML;
|
||||||
|
var upcheck= check.toUpperCase();
|
||||||
|
|
||||||
|
var decs= <?php echo json_encode($materialdesc, JSON_PRETTY_PRINT) ?>;
|
||||||
|
//alert(decs)
|
||||||
|
|
||||||
|
if(upcheck=='SERVICE')
|
||||||
|
{
|
||||||
|
$('#EditotherDescription').show();
|
||||||
|
$('#EditotherD').val(decs)
|
||||||
|
}
|
||||||
|
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$('#EditotherDescription').hide();
|
||||||
|
$('#EditotherD').val('')
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
//alert(x[1].innerHTML);
|
//alert(x[1].innerHTML);
|
||||||
$('#EditMaterialCode').val(cellval[1].innerHTML);
|
$('#EditMaterialCode').val(cellval[1].innerHTML);
|
||||||
$('#EditDescription').val(cellval[2].innerHTML);
|
$('#EditDescription').val(cellval[2].innerHTML);
|
||||||
$('#EditUOM').val(cellval[3].innerHTML);
|
$('#EditUOM').val(cellval[3].innerHTML);
|
||||||
$('#EditQuantity').val(cellval[4].innerHTML);
|
$('#EditQuantity').val(cellval[4].innerHTML);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.EditClick').click(function(){
|
$('.EditClick').click(function(){
|
||||||
|
|||||||
@ -548,7 +548,7 @@ $("#UOM").val('');
|
|||||||
if(id != '-1')
|
if(id != '-1')
|
||||||
{
|
{
|
||||||
|
|
||||||
if(checkanswer != 'OTHERS')
|
if((checkanswer != 'SERVICE'))
|
||||||
{
|
{
|
||||||
$('#content').loader('show');
|
$('#content').loader('show');
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user