Edit Requuistion issue Fixed
This commit is contained in:
parent
ace306aa35
commit
dff68e67e2
@ -8,7 +8,7 @@
|
|||||||
$DepartmentName = '';
|
$DepartmentName = '';
|
||||||
$Status = '';
|
$Status = '';
|
||||||
$CostCenterCode = '';
|
$CostCenterCode = '';
|
||||||
|
$RowCount = '';
|
||||||
|
|
||||||
if(!empty($ReqDetails))
|
if(!empty($ReqDetails))
|
||||||
{
|
{
|
||||||
@ -310,8 +310,8 @@ if(!empty($ReqDetails))
|
|||||||
?>
|
?>
|
||||||
<tr id="<?php echo $index ; ?>">
|
<tr id="<?php echo $index ; ?>">
|
||||||
<td align="left"><?php echo $index ; ?></td>
|
<td align="left"><?php echo $index ; ?></td>
|
||||||
<input type="hidden" name="<?php echo 'MaterialCode'.$index ?>" id="<?php echo 'MaterialCode'.$index ?>" value="<?php echo $record->MaterialCode ; ?>" />
|
<input type="hidden" name="<?php echo 'te'.$index ?>" id="<?php echo 'te'.$index ?>" value="<?php echo $record->MaterialCode ; ?>" />
|
||||||
<input type="hidden" name="<?php echo 'Quantity'.$index ?>" id="<?php echo 'Quantity'.$index ?>" value="<?php echo $record->Quantity ; ?>" />
|
<input type="hidden" name="<?php echo 'te'.$index ?>" id="<?php echo 'tes'.$index ?>" value="<?php echo $record->Quantity ; ?>" />
|
||||||
|
|
||||||
<td align="left"><?php echo $record->MaterialCode ; ?></td>
|
<td align="left"><?php echo $record->MaterialCode ; ?></td>
|
||||||
<td align="left"><?php echo $record->MaterialName ; ?></td>
|
<td align="left"><?php echo $record->MaterialName ; ?></td>
|
||||||
@ -327,9 +327,9 @@ if(!empty($ReqDetails))
|
|||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php }
|
<?php $RowCount = $index; }
|
||||||
?>
|
?>
|
||||||
<input type="hidden" name="txtRowCount" id="txtRowCount" value="<?php echo $index ; ?>"/>
|
|
||||||
<?php
|
<?php
|
||||||
}?>
|
}?>
|
||||||
</tbody>
|
</tbody>
|
||||||
@ -339,6 +339,7 @@ if(!empty($ReqDetails))
|
|||||||
<div align="right" style="padding-right:10px">
|
<div align="right" style="padding-right:10px">
|
||||||
<input type="hidden" name="txtStatus" id="txtStatus" />
|
<input type="hidden" name="txtStatus" id="txtStatus" />
|
||||||
<input type="hidden" name="txtDeletedRow" id="txtDeletedRow" />
|
<input type="hidden" name="txtDeletedRow" id="txtDeletedRow" />
|
||||||
|
<input type="hidden" name="txtRowCount" id="txtRowCount" value="<?php echo $RowCount ; ?>"/>
|
||||||
<?php if($Status == REQ_DRAFT)
|
<?php if($Status == REQ_DRAFT)
|
||||||
{ ?>
|
{ ?>
|
||||||
<a class="btn btn-primary Save" ID="Save" onclick="Save(0)" > <span class="bold">Save</span></a>
|
<a class="btn btn-primary Save" ID="Save" onclick="Save(0)" > <span class="bold">Save</span></a>
|
||||||
@ -377,6 +378,29 @@ function isNumberKey(evt)
|
|||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
|
|
||||||
|
var j=0;
|
||||||
|
var ReqLineItem = <?php echo json_encode($LineItem, JSON_PRETTY_PRINT) ?>;
|
||||||
|
$.each(ReqLineItem, function(idx, obj) {
|
||||||
|
|
||||||
|
//$("#SupAddress").val(obj.Address);
|
||||||
|
j= j +1 ;
|
||||||
|
$('<input>').attr({
|
||||||
|
type: 'hidden',
|
||||||
|
id: 'MaterialCode' + j,
|
||||||
|
name: 'MaterialCode'+ j,
|
||||||
|
value:obj.MaterialCode
|
||||||
|
|
||||||
|
}).appendTo('form');
|
||||||
|
|
||||||
|
$('<input>').attr({
|
||||||
|
type: 'hidden',
|
||||||
|
id: 'Quantity' + j,
|
||||||
|
name: 'Quantity'+ j,
|
||||||
|
value:obj.Quantity
|
||||||
|
}).appendTo('form');
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
$( ".datePicker" ).datepicker({ dateFormat: 'dd/mm/yy' });
|
$( ".datePicker" ).datepicker({ dateFormat: 'dd/mm/yy' });
|
||||||
|
|
||||||
//Initialize Select2 Elements
|
//Initialize Select2 Elements
|
||||||
@ -541,6 +565,8 @@ $("#UOM").val('');
|
|||||||
<td align="left"><%=UOM%></td>
|
<td align="left"><%=UOM%></td>
|
||||||
|
|
||||||
<td align="left"><%=Quantity%></td>
|
<td align="left"><%=Quantity%></td>
|
||||||
|
<td align="left">0.00</td>
|
||||||
|
<td align="left">NEW</td>
|
||||||
<td>
|
<td>
|
||||||
<a data-target='#EditItem' data-id="<%=index%>" data-userid="<%=index%>" data-toggle="modal" href="#EditItem"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit the <%=MaterialCode%> Material details"></i> </a> <a href='#' onclick = "DeleteRow(<%=index%>)" class="link" data-id="<%=index%>" data-userid="<%=index%>" id="Del" ><span class="glyphicon glyphicon-trash"></span></a>
|
<a data-target='#EditItem' data-id="<%=index%>" data-userid="<%=index%>" data-toggle="modal" href="#EditItem"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit the <%=MaterialCode%> Material details"></i> </a> <a href='#' onclick = "DeleteRow(<%=index%>)" class="link" data-id="<%=index%>" data-userid="<%=index%>" id="Del" ><span class="glyphicon glyphicon-trash"></span></a>
|
||||||
|
|
||||||
@ -579,7 +605,7 @@ else
|
|||||||
{
|
{
|
||||||
stat = '<?php echo REQ_PENDING_APPROVAL; ?>';
|
stat = '<?php echo REQ_PENDING_APPROVAL; ?>';
|
||||||
}
|
}
|
||||||
|
//alert($('#MaterialCode4').val());
|
||||||
|
|
||||||
if(validate())
|
if(validate())
|
||||||
{
|
{
|
||||||
@ -606,7 +632,7 @@ else
|
|||||||
$('#txtRowCount').val('');
|
$('#txtRowCount').val('');
|
||||||
$('#txtDeletedRow').val('');
|
$('#txtDeletedRow').val('');
|
||||||
|
|
||||||
window.location = "Requisition";
|
window.location = "Requisition";
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -767,10 +793,38 @@ $('.addClick').click(function(){
|
|||||||
|
|
||||||
var theForm = $(".requistion");
|
var theForm = $(".requistion");
|
||||||
|
|
||||||
addHidden(theForm,"MaterialCode"+temp,materialCode);
|
//addHidden(theForm,"MaterialCode"+temp,materialCode);
|
||||||
addHidden(theForm,"Description"+temp,materialName);
|
//addHidden(theForm,"Description"+temp,materialName);
|
||||||
addHidden(theForm,"UOM"+temp,uom);
|
//addHidden(theForm,"UOM"+temp,uom);
|
||||||
addHidden(theForm,"Quantity"+temp,quantity);
|
//addHidden(theForm,"Quantity"+temp,quantity);
|
||||||
|
|
||||||
|
$('<input>').attr({
|
||||||
|
type: 'hidden',
|
||||||
|
id: 'MaterialCode' + temp,
|
||||||
|
name: 'MaterialCode'+ temp,
|
||||||
|
value:materialCode
|
||||||
|
}).appendTo('form');
|
||||||
|
|
||||||
|
$('<input>').attr({
|
||||||
|
type: 'hidden',
|
||||||
|
id: 'Description' + temp,
|
||||||
|
name: 'Description'+ temp,
|
||||||
|
value:materialName
|
||||||
|
}).appendTo('form');
|
||||||
|
|
||||||
|
$('<input>').attr({
|
||||||
|
type: 'hidden',
|
||||||
|
id: 'UOM' + temp,
|
||||||
|
name: 'UOM'+ temp,
|
||||||
|
value:uom
|
||||||
|
}).appendTo('form');
|
||||||
|
|
||||||
|
$('<input>').attr({
|
||||||
|
type: 'hidden',
|
||||||
|
id: 'Quantity' + temp,
|
||||||
|
name: 'Quantity'+ temp,
|
||||||
|
value:quantity
|
||||||
|
}).appendTo('form');
|
||||||
|
|
||||||
$('#txtRowCount').val(temp);
|
$('#txtRowCount').val(temp);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user