MRIR issue fixed and PORelease screen issue Fixed
This commit is contained in:
parent
1bee5c83b3
commit
7b5728664a
@ -96,6 +96,7 @@ if(!empty($MRIRDetails))
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-12">
|
||||
|
||||
<!--<div class="col-md-2">
|
||||
<label for="MRIRNO">MRIR Number</label>
|
||||
<div class="form-group">
|
||||
@ -266,23 +267,24 @@ if(!empty($MRIRDetails))
|
||||
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<tr id="<?php echo $SNo?>">
|
||||
<td><?php echo $SNo?></td>
|
||||
<td><?php echo $record->MaterialCode?></td>
|
||||
<input type="hidden" name="<?php echo 'MaterialCode'.$SNo ?>" id="<?php echo 'MaterialCode'.$SNo ?>" value=" <?php echo $record->MaterialCode ?> "/>
|
||||
<input type="hidden" name="<?php echo 'Lineitm'.$SNo ?>" id="<?php echo 'Lineitm'.$SNo ?>" value=" <?php echo $record->MRIRItemNo ?> "/>
|
||||
<td><?php echo $record->MaterialName?></td>
|
||||
<td><?php echo $record->UOM?></td>
|
||||
<td class="num"><?php echo $record->Quantity?></td>
|
||||
<td class="num"><?php echo $record->QuantityAsPerInvoice?></td>
|
||||
<input type="hidden" name="<?php echo 'QuantityAsPerInvoice'.$SNo ?>" id="<?php echo 'QuantityAsPerInvoice'.$SNo ?>" />
|
||||
<td class="num"><?php echo $record->ActualQuantityReceived ?></td>
|
||||
<input type="hidden" name="<?php echo 'ActualQuantityReceived'.$SNo ?>" id="<?php echo 'ActualQuantityReceived'.$SNo ?>" />
|
||||
<td><input type="text" id="<?php echo 'AcceptQuantity'.$SNo;?>" name="<?php echo 'AcceptQuantity'.$SNo;?>" onchange="setaccept('<?php echo $SNo;?>');"></td>
|
||||
<input type="hidden" name="<?php echo 'QuantityAccepted'.$SNo ?>" id="<?php echo 'QuantityAccepted'.$SNo ?>" value=""/>
|
||||
<td><input type="text" id="<?php echo 'RejectQuantity'.$SNo;?>" name="<?php echo 'RejectQuantity'.$SNo;?>" onchange="setreject('<?php echo $SNo;?>');"></td>
|
||||
<input type="hidden" name="<?php echo 'QuantityRejected'.$SNo ?>" id="<?php echo 'QuantityRejected'.$SNo ?>" value=""/>
|
||||
<td class="num" id="<?php echo 'ActualQuantityReced'.$SNo ?>"><?php echo $record->ActualQuantityReceived ?></td>
|
||||
<input type="hidden" name="<?php echo 'ActualQuantityReceived'.$SNo ?>" id="<?php echo 'ActualQuantityReceived'.$SNo ?>" value="<?php echo $record->ActualQuantityReceived ?>"/>
|
||||
<td><input type="text" id="<?php echo 'AcceptQuantity'.$SNo;?>" name="<?php echo 'AcceptQuantity'.$SNo;?>" onchange="setaccept('<?php echo $SNo;?>');" value="<?php echo $record->QuantityAccepted?>"></td>
|
||||
<input type="hidden" name="<?php echo 'QuantityAccepted'.$SNo ?>" id="<?php echo 'QuantityAccepted'.$SNo ?>" />
|
||||
<td><input type="text" id="<?php echo 'RejectQuantity'.$SNo;?>" name="<?php echo 'RejectQuantity'.$SNo;?>" onchange="setreject('<?php echo $SNo;?>');" value="<?php echo $record->QuantityRejected?>"></td>
|
||||
<input type="hidden" name="<?php echo 'QuantityRejected'.$SNo ?>" id="<?php echo 'QuantityRejected'.$SNo ?>" />
|
||||
<td><input type="text" id="<?php echo 'Remark'.$SNo ?>" name="<?php echo 'Remark'.$SNo ?>" onchange="setremark('<?php echo $SNo;?>');"></td>
|
||||
<input type="hidden" name="<?php echo 'Remarks'.$SNo ?>" id="<?php echo 'Remarks'.$SNo ?>" />
|
||||
<input type="hidden" name="<?php echo 'Remarks1'.$SNo ?>" id="<?php echo 'Remarks1'.$SNo ?>" />
|
||||
</tr>
|
||||
<?php
|
||||
// $SNo++;
|
||||
@ -301,7 +303,8 @@ if(!empty($MRIRDetails))
|
||||
<?php } else {?>
|
||||
<a class="btn btn-primary" onclick="Redirect()">OK</a>
|
||||
<?php } ?>
|
||||
<input type="hidden" name="RowCount" id="RowCount " value="<?php echo $RowCount ?>" />
|
||||
<input type="hidden" name="RowCount" id="RowCount" value="<?php echo $RowCount ?>" />
|
||||
<input type="hidden" name="MRIRNO" id="MRIRNO " value="<?php echo $MRIRNO ?>" />
|
||||
<input type="hidden" name="status" id="status" />
|
||||
</div>
|
||||
</div>
|
||||
@ -331,11 +334,105 @@ function Redirect()
|
||||
|
||||
</script>
|
||||
<script>
|
||||
function validate()
|
||||
{
|
||||
var rowcount = $("#RowCount").val();
|
||||
|
||||
var Noval = 0;
|
||||
var isExceed = 0;
|
||||
for(k=1;k<=rowcount ; k++)
|
||||
{
|
||||
|
||||
var tr= document.getElementById(k);
|
||||
var ActualQty = 0.0;
|
||||
|
||||
|
||||
var cellval = tr.cells;
|
||||
|
||||
ActualQty = parseFloat(cellval[6].innerHTML);
|
||||
|
||||
var AcceptQuantity = parseFloat( $('#AcceptQuantity'+k).val() == '' ? '0.00' : $('#AcceptQuantity'+k).val());
|
||||
|
||||
var RejectedQuantity = parseFloat( $('#RejectQuantity'+k).val() == '' ? '0.00' : $('#RejectQuantity'+k).val());
|
||||
|
||||
if(AcceptQuantity != '0.00')
|
||||
{
|
||||
|
||||
if(ActualQty < (AcceptQuantity+RejectedQuantity))
|
||||
{
|
||||
isExceed = 1;
|
||||
return false;
|
||||
}
|
||||
Noval = 1;
|
||||
}
|
||||
else if(RejectedQuantity != 0)
|
||||
{
|
||||
if(ActualQty < (AcceptQuantity+RejectedQuantity))
|
||||
{
|
||||
isExceed = 1;
|
||||
return false;
|
||||
}
|
||||
// Noval = 1;
|
||||
}
|
||||
}
|
||||
alert(Noval);
|
||||
if (Noval == 0 )
|
||||
{
|
||||
|
||||
alert('Accepted Quantity/ Rejected Quantity is Empty.Please Enter the value');
|
||||
return false;
|
||||
|
||||
}
|
||||
else if(isExceed == 1 ){
|
||||
|
||||
alert("Accept/Reject Quantity is exceeding the Actual Quantity.Please correct the value to procced further ")
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
function setaccept(rowId)
|
||||
{
|
||||
//alert(rowId);
|
||||
|
||||
var accept = parseFloat($('#AcceptQuantity'+rowId).val());
|
||||
var tr= document.getElementById(rowId);
|
||||
var Actulqty = 0.0;
|
||||
|
||||
|
||||
var cellval = tr.cells;
|
||||
|
||||
Actulqty = parseFloat(cellval[6].innerHTML);
|
||||
|
||||
|
||||
var qtyAsperchellan = parseFloat($('#QuantityAsPerInvoice'+rowId).val());
|
||||
var rejected = (Actulqty - accept);
|
||||
|
||||
$('#RejectQuantity'+rowId).val(rejected) ;
|
||||
$('#QuantityRejected'+rowId).val(rejected) ;
|
||||
$('#QuantityAccepted'+rowId).val(accept) ;
|
||||
|
||||
if(accept > Actulqty)
|
||||
{
|
||||
alert("Accept Quantity is exceeding the Actual Quantity.Please change the AcceptQuantity ")
|
||||
$("#AcceptQuantity"+rowId).focus();
|
||||
$("#AcceptQuantity"+rowId).val('');
|
||||
$("#RejectQuantity"+rowId).val('');
|
||||
$("#QuantityRejected"+rowId).val('');
|
||||
return false;
|
||||
}
|
||||
else if(rejected > Actulqty )
|
||||
{
|
||||
alert("Reject Quantity is exceeding the Actual Quantity.Please change the AcceptQuantity ")
|
||||
$("#RejectQuantity"+rowId).focus();
|
||||
$("#RejectQuantity"+rowId).val('');
|
||||
$("#QuantityRejected"+rowId).val('');
|
||||
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(accept !='')
|
||||
{
|
||||
$('#status').val('<?php echo MRIR_APPROVED?>');
|
||||
@ -344,14 +441,29 @@ function setaccept(rowId)
|
||||
{
|
||||
$('#status').val('<?php echo MRIR_REJECTED?>');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function setreject(rowId)
|
||||
{
|
||||
var tr= document.getElementById(rowId);
|
||||
var Actulqty = 0.0;
|
||||
|
||||
|
||||
var cellval = tr.cells;
|
||||
|
||||
Actulqty = parseFloat(cellval[6].innerHTML);
|
||||
var reject = parseFloat($('#RejectQuantity'+rowId).val());
|
||||
|
||||
if(reject > Actulqty )
|
||||
{
|
||||
alert("Reject Quantity is exceeding the Actual Quantity.Please change the AcceptQuantity ")
|
||||
$("#RejectQuantity"+rowId).focus();
|
||||
$("#RejectQuantity"+rowId).val('');
|
||||
$("#QuantityRejected"+rowId).val('');
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function setremark(rowId)
|
||||
@ -364,6 +476,8 @@ function setremark(rowId)
|
||||
<script>
|
||||
function updatemrir()
|
||||
{
|
||||
if(validate())
|
||||
{
|
||||
$('#content').loader('show');
|
||||
//alert("update function worked ");
|
||||
$.ajax({
|
||||
@ -387,6 +501,7 @@ function updatemrir()
|
||||
}//success function closed
|
||||
|
||||
});//ajax function closed
|
||||
}
|
||||
}//update function closed
|
||||
|
||||
</script>
|
||||
@ -221,7 +221,7 @@ if(!empty($IGRDetails))
|
||||
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<tr id="<?php echo $SNo?>">
|
||||
|
||||
|
||||
<td><?php echo $SNo?></td>
|
||||
@ -251,7 +251,7 @@ if(!empty($IGRDetails))
|
||||
<div id="content"></div>
|
||||
<div class="col-md-1 col-md-offset-11">
|
||||
<a class="btn btn-primary" type="submit" onclick="savemrir()">Generate MRIR</a>
|
||||
<input type="hidden" name="RowCount" id="RowCount " value="<?php echo $RowCount ?>" />
|
||||
<input type="hidden" name="RowCount" id="RowCount" value="<?php echo $RowCount ?>" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@ -279,12 +279,77 @@ if(!empty($IGRDetails))
|
||||
|
||||
|
||||
<script>
|
||||
function validate()
|
||||
{
|
||||
var rowcount = $("#RowCount").val();
|
||||
//alert(rowcount);
|
||||
var Noval = 0;
|
||||
var isExceed = 0;
|
||||
for(k=1;k<=rowcount; k++)
|
||||
{
|
||||
var ActualQty = parseFloat( $('#ActualQuantity'+k).val() == '' ? '0.00' : $('#ActualQuantity'+k).val());
|
||||
//var RecQty = parseFloat( $('#txtReceivedQuantity'+k).val() == '' ? '0.00' : $('#txtReceivedQuantity'+k).val());
|
||||
//var OrderedQty =parseFloat($('#Quantity_1'+k).text());
|
||||
var tr= document.getElementById(k);
|
||||
var InvoiceQty = 0.0;
|
||||
|
||||
|
||||
var cellval = tr.cells;
|
||||
|
||||
InvoiceQty = parseFloat(cellval[5].innerHTML);
|
||||
|
||||
|
||||
// alert('act'+ActualQty);
|
||||
if(ActualQty != '0.00')
|
||||
{
|
||||
// alert('inside loop');
|
||||
if(ActualQty > InvoiceQty)
|
||||
{
|
||||
isExceed = 1;
|
||||
return false;
|
||||
}
|
||||
Noval = 1;
|
||||
}
|
||||
}
|
||||
//alert(Noval);
|
||||
if (Noval == 0 )
|
||||
{
|
||||
|
||||
alert('Actual Quantity is Empty.Please Enter the value');
|
||||
return false;
|
||||
|
||||
}
|
||||
else if(isExceed == 1 ){
|
||||
|
||||
alert("Actual Quantity is exceeding the Invoice Quantity.Please adjust for further Process ")
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
function setactual(rowId)
|
||||
{
|
||||
//alert(rowId);
|
||||
var tr= document.getElementById(rowId);
|
||||
var InvoiceQty = 0.0;
|
||||
|
||||
|
||||
var cellval = tr.cells;
|
||||
|
||||
InvoiceQty = parseFloat(cellval[5].innerHTML);
|
||||
|
||||
var actual = parseFloat($('#ActualQuantity'+rowId).val());
|
||||
//alert(actual);
|
||||
|
||||
|
||||
if(InvoiceQty < actual)
|
||||
{
|
||||
alert("Actual Quantity is exceeding the Invoice Quantity.Please change the Actual Quantity ")
|
||||
$("#ActualQuantity"+rowId).focus();
|
||||
$("#ActualQuantity"+rowId).val('');
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
function setremark(rowId)
|
||||
{
|
||||
@ -297,6 +362,8 @@ function setremark(rowId)
|
||||
<script>
|
||||
function savemrir()
|
||||
{
|
||||
if(validate())
|
||||
{
|
||||
//alert("save function worked ");
|
||||
$("#content").load('show');
|
||||
|
||||
@ -322,5 +389,6 @@ function setremark(rowId)
|
||||
|
||||
}//success function closed
|
||||
});//ajax closed
|
||||
}
|
||||
}//save function closed
|
||||
</script>
|
||||
@ -43,7 +43,7 @@ if(empty($Status))
|
||||
<th>Created By</th>
|
||||
<th>Department</th>
|
||||
<th>Created Date</th>
|
||||
<th>Available Budget Amount</th>
|
||||
|
||||
<th>Total Order Value</th>
|
||||
<th>Approved By</th>
|
||||
<th>Status</th>
|
||||
@ -82,7 +82,7 @@ if(empty($Status))
|
||||
$CreatedDate = $Cdt->format('d-m-Y');
|
||||
echo $CreatedDate;
|
||||
?></td>
|
||||
<td align="right"><?php echo $record->BudgetAmount ?> </td>
|
||||
|
||||
|
||||
<td align="right"><?php echo $record->TotalOrderValue ?></td>
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user