FIX_igr : ps
This commit is contained in:
parent
f861d6635d
commit
16bbefe30c
@ -21,6 +21,10 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
//jquery for vechicle masking
|
||||||
|
// $(document).ready(function(){
|
||||||
|
// Inputmask("A{2,3} 9{1,2} A{1,2} 9{4}").mask($("#VehicleNo"));
|
||||||
|
// });
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
@ -55,12 +59,8 @@
|
|||||||
|
|
||||||
<div class="content-wrapper" style="min-height:537px;">
|
<div class="content-wrapper" style="min-height:537px;">
|
||||||
<section class="content-header">
|
<section class="content-header">
|
||||||
<div class="pull-right hidden-xs">
|
|
||||||
<!-- <b><?php // $date = date('Y-m-d H:i:s'); echo $date; ?> </b> -->
|
|
||||||
<b><div id="clock"></div></b>
|
|
||||||
</div>
|
|
||||||
<h1>
|
<h1>
|
||||||
<center> Inward Gate Register</center>
|
<center> Inward Gate Register </center>
|
||||||
</h1>
|
</h1>
|
||||||
</section>
|
</section>
|
||||||
<section class="content" style="margin: 15px;"><br/>
|
<section class="content" style="margin: 15px;"><br/>
|
||||||
@ -95,12 +95,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
echo form_dropdown('PONO', $options,set_value('PONO'),'id="PONO"' ,'class="form-control select2"' , 'required="true"');
|
echo form_dropdown('PONO', $options,set_value('PONO'),'id="PONO"' ,'class="form-control select2"' , 'required="true"');
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<input type="hidden" name="hiddenIsOpenOrder" id="hiddenIsOpenOrder"/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<input type="hidden" name="hiddenIsOpenOrder" id="hiddenIsOpenOrder"/>
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<label>Supplier Name </label>
|
<label>Supplier Name </label>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
@ -115,15 +113,15 @@
|
|||||||
|
|
||||||
|
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<label>Invoice Number</label>
|
<label>Invoice Number <!-- Delivery Challan/Inv No --></label>
|
||||||
<?php
|
<?php
|
||||||
$data = array('name' => 'InvoiceNo','value' => set_value('InvoiceNo'),'id'=>'InvoiceNo', 'class' => 'form-control', 'required=>"true"' );
|
$data = array('name' => 'InvoiceNo','value' => set_value('InvoiceNo'),'id'=>'InvoiceNo', 'class' => 'form-control', 'required=>"true"','onkeypress'=>'return isNumberKey(event);' );
|
||||||
|
|
||||||
echo form_input($data);
|
echo form_input($data);
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<label>Invoice Date</label>
|
<label>Invoice Date <!-- Delivery Challan/Inv Date --></label>
|
||||||
<?php
|
<?php
|
||||||
$data = array('name' => 'InvoiceDate','value' => set_value('InvoiceDate'),'id'=>'InvoiceDate', 'class' => 'form-control num', 'required'=>'true' );
|
$data = array('name' => 'InvoiceDate','value' => set_value('InvoiceDate'),'id'=>'InvoiceDate', 'class' => 'form-control num', 'required'=>'true' );
|
||||||
echo form_input($data);
|
echo form_input($data);
|
||||||
@ -148,6 +146,7 @@
|
|||||||
$data = array('name' => 'VehicleNo','value' => set_value('VehicleNo'), 'id'=>'VehicleNo', 'class' => 'form-control', 'maxlength' => '20' );
|
$data = array('name' => 'VehicleNo','value' => set_value('VehicleNo'), 'id'=>'VehicleNo', 'class' => 'form-control', 'maxlength' => '20' );
|
||||||
echo form_input($data);
|
echo form_input($data);
|
||||||
?>
|
?>
|
||||||
|
<!-- <span pattern="" required="true"></span> -->
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<label>Driver Name</label>
|
<label>Driver Name</label>
|
||||||
@ -163,8 +162,16 @@
|
|||||||
echo form_input($data);
|
echo form_input($data);
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- <div class="col-md-3">
|
||||||
|
<label>Courier No</label>
|
||||||
|
<?php
|
||||||
|
// $data = array('name' => 'CourierNo','value' => set_value('CourierNo'),'id'=>'CourierNo', 'class' => 'form-control','onkeypress'=>'return isNumberKey(event);' );
|
||||||
|
// echo form_input($data);
|
||||||
|
?>
|
||||||
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<!-- <div class="col-md-12">
|
<!-- <div class="col-md-12">
|
||||||
<div class="col-md-offset-4">
|
<div class="col-md-offset-4">
|
||||||
<div class="box-header">
|
<div class="box-header">
|
||||||
@ -180,17 +187,15 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-12" style="margin: 10px 0;">
|
<div class="col-md-12" style="margin-top: 10px;">
|
||||||
|
|
||||||
<!-- <input type="button" class="btn btn-success" id ="addemorebutton" value=" + ADD FILES.."> -->
|
<!-- <input type="button" class="btn btn-primary" id ="addemorebutton" value=" + ADD FILES.."> -->
|
||||||
|
|
||||||
|
|
||||||
<!-- <div id="newsdiv"></div>this div for add more section -->
|
<!-- <div id="newsdiv"></div>this div for add more section -->
|
||||||
<input type="hidden" name="hidecounters" id="hidecounters" value="0" />
|
<input type="hidden" name="hidecounters" id="hidecounters" value="0" />
|
||||||
<input type="hidden" name="hideconstants" id="hideconstants" value="0" />
|
<input type="hidden" name="hideconstants" id="hideconstants" value="0" />
|
||||||
<input type="hidden" name="hideIGRStatus" id="hideIGRStatus" value="0" />
|
<input type="hidden" name="hideIGRStatus" id="hideIGRStatus" value="0" />
|
||||||
<input type="hidden" name="hideIGRRemarks" id="hideIGRRemarks" value="" />
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -199,17 +204,19 @@
|
|||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
|
|
||||||
<table id="Inwardgateregistertable" class="table table-bordered table-hover editabletable IGR_Line" style="background-color:#fff;font-size:12px;">
|
<table id="Inwardgateregistertable" class="table table-bordered table-hover editabletable IGR_Line" style="background-color:#fff;font-size:12px;">
|
||||||
<thead >
|
<thead style="background-color:#ddf">
|
||||||
<tr>
|
<tr>
|
||||||
<th>S.No</th>
|
<th>S.No</th>
|
||||||
<th>Item Code</th>
|
<th>Item Code</th>
|
||||||
<th>Material</th>
|
<th>Material</th>
|
||||||
<th>UOM</th>
|
<th>UOM</th>
|
||||||
<th>Ordered Quantity</th>
|
<th>Ordered Quantity</th>
|
||||||
<th>Received Quantity</th>
|
<th>Received Quantity</th>
|
||||||
<th>Balance Quantity</th>
|
<th>Pending Quantity</th>
|
||||||
<th>Pending Quantity</th>
|
<th>Advised Quantity</th>
|
||||||
<th>Remarks</th>
|
|
||||||
|
<th>Remarks</th>
|
||||||
|
<th> </th>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@ -229,7 +236,7 @@
|
|||||||
<!--<table id="specialtable" class="table table-hover table-bordered" style="background-color:#fff;font-size:12px;" >-->
|
<!--<table id="specialtable" class="table table-hover table-bordered" style="background-color:#fff;font-size:12px;" >-->
|
||||||
|
|
||||||
|
|
||||||
<!--<thead >
|
<!--<thead style="background-color:#ddf">
|
||||||
<tr>
|
<tr>
|
||||||
<th>MaterialCode1</th>
|
<th>MaterialCode1</th>
|
||||||
<th>DeliveryChallanDate</th>
|
<th>DeliveryChallanDate</th>
|
||||||
@ -246,68 +253,14 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<button class="btn btn-success" id='IGRLink' type="submit" name='IGRLink' onclick="filecheck();">Generate IGR</button>
|
<button class="btn btn-primary" id='IGRLink' type="submit" name='IGRLink' onclick="filecheck();">Generate IGR</button>
|
||||||
|
|
||||||
|
|
||||||
</div> -->
|
</div> -->
|
||||||
<div class="container">
|
<div class="col-md-4 col-md-offset-8">
|
||||||
<div class="form-group row">
|
|
||||||
<label for="GrossWeight" class="col-md-2 col-form-label">Gross Weight</label>
|
|
||||||
<div class="col-md-3">
|
|
||||||
<?php
|
|
||||||
$data = array('name' => 'GrossWeight', 'value' => set_value('GrossWeight'), 'id' => 'GrossWeight', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event);', 'maxlength' => '50', 'onchange' => 'WeightDiffer(this);');
|
|
||||||
echo form_input($data);
|
|
||||||
?>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-3">
|
|
||||||
<?php
|
|
||||||
$data = array('name' => 'GrossWeightDate', 'value' => set_value('GrossWeightDate'), 'id' => 'GrossWeightDate', 'class' => 'form-control', 'readonly' => true);
|
|
||||||
echo form_input($data);
|
|
||||||
?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group row">
|
|
||||||
<label for="TareWeight" class="col-md-2 col-form-label">Tare Weight</label>
|
|
||||||
<div class="col-md-3">
|
|
||||||
<?php
|
|
||||||
$data = array('name' => 'TareWeight', 'value' => set_value('TareWeight'), 'id' => 'TareWeight', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event);', 'maxlength' => '50', 'onchange' => 'WeightDiffer(this);');
|
|
||||||
echo form_input($data);
|
|
||||||
?>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-3">
|
|
||||||
<?php
|
|
||||||
$data = array('name' => 'TareWeightDate', 'value' => set_value('TareWeightDate'), 'id' => 'TareWeightDate', 'class' => 'form-control', 'readonly' => true);
|
|
||||||
echo form_input($data);
|
|
||||||
?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group row">
|
|
||||||
<label for="NetWeight" class="col-md-2 col-form-label">Net Weight</label>
|
|
||||||
<div class="col-md-3">
|
|
||||||
<?php
|
|
||||||
$data = array('name' => 'NetWeight', 'value' => set_value('NetWeight'), 'id' => 'NetWeight', 'class' => 'form-control', 'maxlength' => '50', 'readonly' => true);
|
|
||||||
echo form_input($data);
|
|
||||||
?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<?php if ($DEPCode == ADMIN) { $class = "col-md-5 col-md-offset-7"; }else{ $class="col-md-4 col-md-offset-8";} ?>
|
|
||||||
<div class="<?php echo $class; ?>">
|
|
||||||
<input type="file" name="browseFiles1" id="images1" onchange="Copyfilenames(this.name); "><br>
|
<input type="file" name="browseFiles1" id="images1" onchange="Copyfilenames(this.name); "><br>
|
||||||
<?php if (($DEPCode == SECURITY || $DEPCode == ADMIN)) { ?>
|
|
||||||
<button class="btn btn-success" id='IGRDraftLink' type="submit" name='IGRDraftLink' onclick="filecheck(0);">Draft IGR</button>
|
<button class="btn btn-success" id='IGRDraftLink' type="submit" name='IGRDraftLink' onclick="filecheck(0);">Draft IGR</button>
|
||||||
<?php } if (($DEPCode == SECURITY || $DEPCode == ADMIN && 1)) { ?>
|
<button class="btn btn-success" id='IGRLink' type="submit" name='IGRLink' onclick="filecheck(1);">Generate IGR</button>
|
||||||
<button class="btn btn-success" id='IGRCreatedLink' type="submit" name='IGRCreatedLink' onclick="filecheck(1);">Generate IGR</button>
|
|
||||||
<?php } if ($DEPCode == ADMIN) { ?>
|
|
||||||
<button class="btn btn-success" id='IGRCompleteLink' type="submit" name='IGRCompleteLink' onclick="filecheck(2);">Complete IGR</button>
|
|
||||||
<?php } if ($DEPCode == ADMIN) { ?>
|
|
||||||
<button class="btn btn-success" id='IGRCancelLink' type="submit" name='IGRCancelLink' onclick="filecheck(3);">Cancel IGR</button>
|
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -323,7 +276,7 @@
|
|||||||
|
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
|
|
||||||
<div class="modal-header">
|
<div class="modal-header" style="background-color: #3c8dbc;color:#fff;">
|
||||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||||
<center><h4>Inward Gate Register Number</h4></center>
|
<center><h4>Inward Gate Register Number</h4></center>
|
||||||
</div>
|
</div>
|
||||||
@ -343,6 +296,79 @@
|
|||||||
</div><!-- modal fade closed-->
|
</div><!-- modal fade closed-->
|
||||||
<!-- new modal ended-->
|
<!-- new modal ended-->
|
||||||
|
|
||||||
|
<div class="modal fade" id="WeightCalculator" role="dialog">
|
||||||
|
<div class="modal-dialog modal_style">
|
||||||
|
<!-- Modal content-->
|
||||||
|
<div class="modal-content">
|
||||||
|
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||||
|
<center><h4>Weight Calculator</h4><div id="material"></div></center>
|
||||||
|
<div class="pull-right hidden-xs">
|
||||||
|
<b><div id="clock"></div></b>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-12"> <br/>
|
||||||
|
|
||||||
|
<!-- <center><label style="font-size:40px;">Default</label> </center> -->
|
||||||
|
<!-- <div class="container"> -->
|
||||||
|
<div class="form-group row">
|
||||||
|
<label for="GrossWeight" class="col-md-2 col-form-label">Gross Weight</label>
|
||||||
|
<div class="col-md-5">
|
||||||
|
<?php
|
||||||
|
$data = array('name' => 'GrossWeight', 'value' => set_value('GrossWeight'), 'id' => 'GrossWeight', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event);', 'maxlength' => '50', 'onchange' => 'WeightDiffer(this);' , 'placeholder' => 'Gross Weight Value (A)');
|
||||||
|
echo form_input($data);
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-5">
|
||||||
|
<?php
|
||||||
|
$data = array('name' => 'GrossWeightDate', 'value' => set_value('GrossWeightDate'), 'id' => 'GrossWeightDate', 'class' => 'form-control', 'readonly' => true , 'placeholder' => 'Gross Weight Date/Timing');
|
||||||
|
echo form_input($data);
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group row">
|
||||||
|
<label for="TareWeight" class="col-md-2 col-form-label">Tare Weight</label>
|
||||||
|
<div class="col-md-5">
|
||||||
|
<?php
|
||||||
|
$data = array('name' => 'TareWeight', 'value' => set_value('TareWeight'), 'id' => 'TareWeight', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event);', 'maxlength' => '50', 'onchange' => 'WeightDiffer(this);' ,'placeholder' => 'Enter your username','placeholder' => 'Tare Weight Value (B)');
|
||||||
|
echo form_input($data);
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-5">
|
||||||
|
<?php
|
||||||
|
$data = array('name' => 'TareWeightDate', 'value' => set_value('TareWeightDate'), 'id' => 'TareWeightDate', 'class' => 'form-control', 'readonly' => true , 'placeholder' => 'Tare Weight Date/Timing',);
|
||||||
|
echo form_input($data);
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group row">
|
||||||
|
<label for="NetWeight" class="col-md-2 col-form-label">Net Weight</label>
|
||||||
|
<div class="col-md-5">
|
||||||
|
<input type="hidden" id="CurrentInx" name="CurrentInx" readonly>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
$data = array('name' => 'NetWeight', 'value' => set_value('NetWeight'), 'id' => 'NetWeight', 'class' => 'form-control', 'maxlength' => '50', 'readonly' => true , 'placeholder' => 'Net Weight Value (A-B)');
|
||||||
|
echo form_input($data);
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- </div> -->
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<center>
|
||||||
|
<a class="btn btn-primary" onclick="modalSave()"> <span class="bold">Save</span>
|
||||||
|
<a class="btn btn-primary" data-dismiss="modal" value="Close">Close</a>
|
||||||
|
</center>
|
||||||
|
</div><!-- footer div closed -->
|
||||||
|
</div><!-- modal content div closed-->
|
||||||
|
</div><!-- modal content closed-->
|
||||||
|
</div><!-- modal fade closed-->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -370,13 +396,13 @@ function validate()
|
|||||||
var isExceed = 0;
|
var isExceed = 0;
|
||||||
for(k=1;k<=rowcount ; k++)
|
for(k=1;k<=rowcount ; k++)
|
||||||
{
|
{
|
||||||
var PendingQty = parseFloat( $('#QuantityAsPerInvoice'+k).val() == '' ? '0.00' : $('#QuantityAsPerInvoice'+k).val());
|
var AdvisedQty = parseFloat( $('#QuantityAsPerInvoice'+k).val() == '' ? '0.00' : $('#QuantityAsPerInvoice'+k).val());
|
||||||
var RecQty = parseFloat( $('#txtReceivedQuantity'+k).val() == '' ? '0.00' : $('#txtReceivedQuantity'+k).val());
|
var RecQty = parseFloat( $('#txtReceivedQuantity'+k).val() == '' ? '0.00' : $('#txtReceivedQuantity'+k).val());
|
||||||
var OrderedQty =parseFloat($('#Quantity_1'+k).text());
|
var OrderedQty =parseFloat($('#Quantity_1'+k).text());
|
||||||
if(PendingQty != '0.00')
|
if(AdvisedQty != '0.00')
|
||||||
{
|
{
|
||||||
|
|
||||||
if(OrderedQty < (PendingQty+RecQty))
|
if(OrderedQty < (AdvisedQty+RecQty))
|
||||||
{
|
{
|
||||||
isExceed = 1;
|
isExceed = 1;
|
||||||
return false;
|
return false;
|
||||||
@ -414,13 +440,13 @@ function validate()
|
|||||||
else if (Noval == 0 )
|
else if (Noval == 0 )
|
||||||
{
|
{
|
||||||
|
|
||||||
alert('Pending Quantity is Empty.Please Enter the value');
|
alert('Advised Quantity is Empty.Please Enter the value');
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
else if(isExceed == 1 ){
|
else if(isExceed == 1 ){
|
||||||
|
|
||||||
alert("Pending Quantity is exceeding the Ordered Quantity.Please Contact Purchase Team for further Process ")
|
alert("Advised Quantity is exceeding the Ordered Quantity.Please Contact Purchase Team for further Process ")
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -456,6 +482,12 @@ function validate()
|
|||||||
$("#txtReceivedQuantity"+k).remove();
|
$("#txtReceivedQuantity"+k).remove();
|
||||||
$("#txtRemarks"+k).remove();
|
$("#txtRemarks"+k).remove();
|
||||||
$("#txtPendingQty"+k).remove();
|
$("#txtPendingQty"+k).remove();
|
||||||
|
|
||||||
|
$("#txtGrossWeight"+k).remove();
|
||||||
|
$("#txtGrossWeightDate"+k).remove();
|
||||||
|
$("#txtTareWeight"+k).remove();
|
||||||
|
$("#txtTareWeightDate"+k).remove();
|
||||||
|
$("#txtNetWeight"+k).remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -471,10 +503,6 @@ function validate()
|
|||||||
|
|
||||||
$('#content').loader('show');
|
$('#content').loader('show');
|
||||||
var y = <?php echo json_encode($PO_NO, JSON_PRETTY_PRINT) ?>;
|
var y = <?php echo json_encode($PO_NO, JSON_PRETTY_PRINT) ?>;
|
||||||
console.log("427");
|
|
||||||
console.log(y);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$.each(y, function(idx, obj) {
|
$.each(y, function(idx, obj) {
|
||||||
|
|
||||||
@ -487,6 +515,7 @@ function validate()
|
|||||||
$("#po").val(obj.PONO);
|
$("#po").val(obj.PONO);
|
||||||
$("#Sup").val(obj.SupplierName);
|
$("#Sup").val(obj.SupplierName);
|
||||||
$("#hiddenIsOpenOrder").val(obj.IsOpenOrder);
|
$("#hiddenIsOpenOrder").val(obj.IsOpenOrder);
|
||||||
|
|
||||||
//$("#Add").val(obj.Address);
|
//$("#Add").val(obj.Address);
|
||||||
$("#del").val(obj.DeliveryDate);
|
$("#del").val(obj.DeliveryDate);
|
||||||
//$("#ser").val(obj.ServiceDescription);
|
//$("#ser").val(obj.ServiceDescription);
|
||||||
@ -495,7 +524,6 @@ function validate()
|
|||||||
formatted_PODate = obj.formatted_PODate;
|
formatted_PODate = obj.formatted_PODate;
|
||||||
formatted_IsOpenOrder = obj.formatted_IsOpenOrder;
|
formatted_IsOpenOrder = obj.formatted_IsOpenOrder;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -504,6 +532,7 @@ function validate()
|
|||||||
data:{id:id},
|
data:{id:id},
|
||||||
type:"POST",
|
type:"POST",
|
||||||
url:"<?php echo base_url() ?>inwardgateregister/IGRITEM",
|
url:"<?php echo base_url() ?>inwardgateregister/IGRITEM",
|
||||||
|
|
||||||
success:function(data) {
|
success:function(data) {
|
||||||
|
|
||||||
//alert(data);
|
//alert(data);
|
||||||
@ -511,62 +540,130 @@ function validate()
|
|||||||
$('#content').loader('hide');
|
$('#content').loader('hide');
|
||||||
//alert(data);
|
//alert(data);
|
||||||
var trHTML = '';
|
var trHTML = '';
|
||||||
var j=0;
|
|
||||||
var showTable = false;
|
var j=0;
|
||||||
// var startDate = formatted_PODate ? new Date(formatted_PODate) : null;
|
var showTable = false;
|
||||||
// var currentDate = new Date();
|
|
||||||
|
|
||||||
|
|
||||||
$.each(JSON.parse(data), function (i, item) {
|
$.each(JSON.parse(data), function (i, item) {
|
||||||
|
showTable = true;
|
||||||
|
|
||||||
// if(item.PendingQty != 0){
|
if(showTable){
|
||||||
// showTable = true;
|
|
||||||
// }
|
|
||||||
// if (startDate && endDate && currentDate >= startDate && currentDate <= endDate) {
|
|
||||||
// showTable = true;
|
|
||||||
// }
|
|
||||||
showTable = true;
|
|
||||||
if(showTable){
|
|
||||||
i=i+1;
|
i=i+1;
|
||||||
j=j+1;
|
j=j+1;
|
||||||
trHTML += '<tr>' +
|
trHTML += '<tr>' +
|
||||||
'<td align="right">' + j + '</td>' +
|
'<td align="right">' + j + '</td>' +
|
||||||
'<td name="MaterialName" id="MaterialCode" >' + item.MaterialCode + '</td>' +
|
'<td name="MaterialName" id="MaterialCode" >' + item.MaterialCode + '</td>' +
|
||||||
'<td>' + item.MaterialName + '</td>' +
|
'<td>' + item.MaterialName + '</td>' +
|
||||||
'<td name="UOM">' + item.UOM + '</td>' +
|
'<td name="UOM">' + item.UOM + '</td>' +
|
||||||
'<td name="Quantity1'+i+'" id="Quantity_1'+i+'">' + item.Quantity + '</td>' +
|
'<td name="Quantity1'+i+'" id="Quantity_1'+i+'">' + item.Quantity + '</td>' +
|
||||||
'<td name="ReceivedQuantity'+i+'" id="ReceivedQuantity'+i+'">'+ item.ReceivedQuantity +'</td>'+
|
'<td name="ReceivedQuantity'+i+'" id="ReceivedQuantity'+i+'">'+ item.ReceivedQuantity +'</td>'+
|
||||||
'<td data-name="sel" ><input type="text" onchange="validateReceivedQuantity('+i+')"id="QuantityAsPerInvoice'+ i +'" name="QuantityAsPerInvoice'+ i +'" value="" onkeypress="return isNumberKey(event);"></td>' +
|
|
||||||
'<td name="PendingQuantity'+i+'" id="PendingQuantity'+i+'">'+ item.PendingQty +'</td>'+
|
'<td name="PendingQuantity'+i+'" id="PendingQuantity'+i+'">'+ item.PendingQty +'</td>'+
|
||||||
|
'<td data-name="sel" ><input type="text" onchange="validateReceivedQuantity('+i+')"id="QuantityAsPerInvoice'+ i +'" name="QuantityAsPerInvoice'+ i +'" value="" onkeypress="return isNumberKey(event);"></td>' +
|
||||||
|
|
||||||
'<td><input type="text" id="Remark'+ i +'" name="Remark'+ i +'" class="form" onchange="SetRemarks('+i+')"> </td>' +
|
'<td><input type="text" id="Remark'+ i +'" name="Remark'+ i +'" class="form" onchange="SetRemarks('+i+')"> </td>' +
|
||||||
|
'<td><a target="_blank" data-toggle="modal" data-target="#WeightCalculator" title="Weight Calculator" data-index="'+i+'" data-material="'+item.MaterialName+'"><i class="fa fa-solid fa-calculator" style="text-align: center;"></i></a> </td>' +
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
'</tr>';
|
'</tr>';
|
||||||
$('#txtRowCount').val(i);
|
$('#txtRowCount').val(i);
|
||||||
$('<input>').attr({type: 'hidden',id: 'MaterialCode'+i,value:item.MaterialCode,name: 'MaterialCode'+i}).appendTo('form');
|
|
||||||
$('<input>').attr({type: 'hidden',id: 'txtQuantityAsPerInvoice'+i,name: 'txtQuantityAsPerInvoice'+i}).appendTo('form');
|
|
||||||
$('<input>').attr({type: 'hidden',id: 'OrderedQuantity'+i,value:item.Quantity,name: 'OrderedQuantity'+i}).appendTo('form');
|
|
||||||
$('<input>').attr({type: 'hidden',id: 'txtReceivedQuantity'+i,name: 'txtReceivedQuantity'+i,value:item.ReceivedQuantity}).appendTo('form');
|
|
||||||
$('<input>').attr({type: 'hidden',id: 'txtRemarks'+i,name: 'txtRemarks'+i}).appendTo('form');
|
|
||||||
$('<input>').attr({type: 'hidden',id: 'txtPendingQty'+i,name: 'txtPendingQty'+i,value:item.PendingQty}).appendTo('form');
|
|
||||||
//alert(item.PendingQty);
|
|
||||||
if(item.PendingQty == 0.00)
|
|
||||||
{
|
|
||||||
//alert('inside if');
|
|
||||||
$('#QuantityAsPerInvoice'+i).attr('readonly', 'true');
|
|
||||||
// $('#txtEditFreight').attr('readonly', 'true');
|
|
||||||
}
|
|
||||||
$("#IGRCreatedLink").show();
|
|
||||||
|
|
||||||
}else{
|
$('<input>').attr({
|
||||||
|
type: 'hidden',
|
||||||
|
id: 'MaterialCode'+i,
|
||||||
|
value:item.MaterialCode,
|
||||||
|
name: 'MaterialCode'+i
|
||||||
|
}).appendTo('form');
|
||||||
|
$('<input>').attr({
|
||||||
|
type: 'hidden',
|
||||||
|
id: 'txtQuantityAsPerInvoice'+i,
|
||||||
|
name: 'txtQuantityAsPerInvoice'+i
|
||||||
|
}).appendTo('form');
|
||||||
|
$('<input>').attr({
|
||||||
|
type: 'hidden',
|
||||||
|
id: 'OrderedQuantity'+i,
|
||||||
|
|
||||||
if(JSON.parse(data).length == 1 && item.PendingQty == 0){
|
value:item.Quantity,
|
||||||
$("#IGRCreatedLink").hide();
|
name: 'OrderedQuantity'+i
|
||||||
//alert('The Order is new completed!!');
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}).appendTo('form');
|
||||||
|
|
||||||
});
|
$('<input>').attr({
|
||||||
|
type: 'hidden',
|
||||||
|
id: 'txtReceivedQuantity'+i,
|
||||||
|
name: 'txtReceivedQuantity'+i,
|
||||||
|
value:item.ReceivedQuantity
|
||||||
|
}).appendTo('form');
|
||||||
|
|
||||||
|
$('<input>').attr({
|
||||||
|
type: 'hidden',
|
||||||
|
id: 'txtRemarks'+i,
|
||||||
|
name: 'txtRemarks'+i
|
||||||
|
}).appendTo('form');
|
||||||
|
|
||||||
|
$('<input>').attr({
|
||||||
|
type: 'hidden',
|
||||||
|
id: 'txtPendingQty'+i,
|
||||||
|
name: 'txtPendingQty'+i,
|
||||||
|
value:item.PendingQty
|
||||||
|
}).appendTo('form');
|
||||||
|
$('<input>').attr({
|
||||||
|
type: 'hidden',
|
||||||
|
id: 'txtGrossWeight' + i,
|
||||||
|
value: item.GrossWeight,
|
||||||
|
name: 'txtGrossWeight' + i
|
||||||
|
}).appendTo('form');
|
||||||
|
$('<input>').attr({
|
||||||
|
type: 'hidden',
|
||||||
|
id: 'txtGrossWeightDate' + i,
|
||||||
|
value: item.GrossWeightDate,
|
||||||
|
name: 'txtGrossWeightDate' + i
|
||||||
|
}).appendTo('form');
|
||||||
|
$('<input>').attr({
|
||||||
|
type: 'hidden',
|
||||||
|
id: 'txtTareWeight' + i,
|
||||||
|
value: item.TareWeight,
|
||||||
|
name: 'txtTareWeight' + i
|
||||||
|
}).appendTo('form');
|
||||||
|
$('<input>').attr({
|
||||||
|
type: 'hidden',
|
||||||
|
id: 'txtTareWeightDate' + i,
|
||||||
|
value: item.TareWeightDate,
|
||||||
|
name: 'txtTareWeightDate' + i
|
||||||
|
}).appendTo('form');
|
||||||
|
$('<input>').attr({
|
||||||
|
type: 'hidden',
|
||||||
|
id: 'txtNetWeight' + i,
|
||||||
|
value: item.NetWeight,
|
||||||
|
name: 'txtNetWeight' + i
|
||||||
|
}).appendTo('form');
|
||||||
|
|
||||||
|
//alert(item.PendingQty);
|
||||||
|
if(item.PendingQty == 0.00)
|
||||||
|
{
|
||||||
|
//alert('inside if');
|
||||||
|
$('#QuantityAsPerInvoice'+i).attr('readonly', 'true');
|
||||||
|
// $('#txtEditFreight').attr('readonly', 'true');
|
||||||
|
}
|
||||||
|
$("#IGRLink").show();
|
||||||
|
|
||||||
|
} else{
|
||||||
|
|
||||||
|
|
||||||
|
if(JSON.parse(data).length == 1 && item.PendingQty == 0){
|
||||||
|
|
||||||
|
$("#IGRLink").hide();
|
||||||
|
//alert('The Order is new completed!!');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -582,14 +679,15 @@ function validate()
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
if((status == '<?php echo IGR_CREATED ?>' || status == '<?php echo MRIR_CREATED ?>' || status == '<?php echo MRIR_APPROVED ?>') && ((hiddenIsOpenOrder === null || hiddenIsOpenOrder === "")) )
|
if((status == '<?php echo IGR_CREATED ?>' || status == '<?php echo MRIR_CREATED ?>' || status == '<?php echo MRIR_APPROVED ?>'))
|
||||||
{
|
{
|
||||||
alert('The Order is completed!!');
|
alert('The Order is completed!!');
|
||||||
$("#IGRCreatedLink").hide();
|
|
||||||
|
$("#IGRLink").hide();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$("#IGRCreatedLink").show();
|
$("#IGRLink").show();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -612,41 +710,43 @@ function validateReceivedQuantity(Rowid){
|
|||||||
|
|
||||||
var InvoiceQty = parseFloat( $('#QuantityAsPerInvoice'+Rowid).val() == '' ? '0.00' : $('#QuantityAsPerInvoice'+Rowid).val());
|
var InvoiceQty = parseFloat( $('#QuantityAsPerInvoice'+Rowid).val() == '' ? '0.00' : $('#QuantityAsPerInvoice'+Rowid).val());
|
||||||
|
|
||||||
var PendingQty = parseFloat( $('#PendingQuantity'+Rowid).text() == '' ? '0.00' : $('#PendingQuantity'+Rowid).text());
|
var PendingQty = parseFloat( $('#PendingQuantity'+Rowid).text() == '' ? '0.00' : $('#PendingQuantity'+Rowid).text());
|
||||||
|
|
||||||
var RecQty = parseFloat( $('#txtReceivedQuantity'+Rowid).val() == '' ? '0.00' : $('#txtReceivedQuantity'+Rowid).val());
|
var RecQty = parseFloat( $('#txtReceivedQuantity'+Rowid).val() == '' ? '0.00' : $('#txtReceivedQuantity'+Rowid).val());
|
||||||
|
|
||||||
var OrderedQty =parseFloat($("#Quantity_1"+Rowid).text());
|
var OrderedQty =parseFloat($("#Quantity_1"+Rowid).text());
|
||||||
|
|
||||||
var r =$("#Remark"+Rowid).val();
|
var r =$("#Remark"+Rowid).val();
|
||||||
|
// alert(RecQty);
|
||||||
|
//alert(InvoiceQty);
|
||||||
|
if((InvoiceQty+RecQty) > OrderedQty){
|
||||||
|
|
||||||
if (parseInt(OrderedQty) !== 0) {
|
alert("Advised Quantity is exceeding the Ordered Quantity.Please Contact Purchase Team for further Process ")
|
||||||
if((InvoiceQty+RecQty) > OrderedQty){
|
|
||||||
alert("Pending Quantity is exceeding the Ordered Quantity.Please Contact Purchase Team for further Process ")
|
|
||||||
$("#QuantityAsPerInvoice"+Rowid).focus();
|
$("#QuantityAsPerInvoice"+Rowid).focus();
|
||||||
$("#QuantityAsPerInvoice"+Rowid).val('');
|
$("#QuantityAsPerInvoice"+Rowid).val('');
|
||||||
return false;
|
return false;
|
||||||
} else if(((InvoiceQty+RecQty) - OrderedQty) > 0.00){
|
|
||||||
|
|
||||||
|
}
|
||||||
|
else if(((InvoiceQty+RecQty) - OrderedQty) > 0.00){
|
||||||
alert("Order is completed.")
|
alert("Order is completed.")
|
||||||
$("#QuantityAsPerInvoice"+Rowid).focus();
|
$("#QuantityAsPerInvoice"+Rowid).focus();
|
||||||
$('#QuantityAsPerInvoice'+Rowid).val('');
|
$('#QuantityAsPerInvoice'+Rowid).val('');
|
||||||
return false;
|
return false;
|
||||||
} else {
|
}
|
||||||
// alert(RecQty);
|
|
||||||
$('#PendingQuantity'+Rowid).text((OrderedQty - (InvoiceQty+RecQty)).toFixed(2));
|
else {
|
||||||
$('#txtPendingQty'+Rowid).val(OrderedQty - (InvoiceQty+RecQty));
|
// alert(RecQty);
|
||||||
$("#ReceivedQuantity"+Rowid).val(InvoiceQty+RecQty);
|
$('#PendingQuantity'+Rowid).text((OrderedQty - (InvoiceQty+RecQty)).toFixed(2));
|
||||||
$("#txtQuantityAsPerInvoice"+Rowid).val(InvoiceQty);
|
$('#txtPendingQty'+Rowid).val(OrderedQty - (InvoiceQty+RecQty));
|
||||||
// InvoiceQty
|
$("#ReceivedQuantity"+Rowid).val(InvoiceQty+RecQty);
|
||||||
|
$("#txtQuantityAsPerInvoice"+Rowid).val(InvoiceQty);
|
||||||
|
// InvoiceQty
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$('#PendingQuantity'+Rowid).text((OrderedQty - (InvoiceQty+RecQty)).toFixed(2));
|
|
||||||
$('#txtPendingQty'+Rowid).val(OrderedQty - (InvoiceQty+RecQty));
|
|
||||||
$("#ReceivedQuantity"+Rowid).val(InvoiceQty+RecQty);
|
|
||||||
$("#txtQuantityAsPerInvoice"+Rowid).val(InvoiceQty);
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -664,11 +764,7 @@ function isNumberKey(evt)
|
|||||||
|
|
||||||
function Save(status)
|
function Save(status)
|
||||||
{
|
{
|
||||||
alert("save function worked "+status);
|
// alert("save function worked "+status);
|
||||||
if(status == '3'){
|
|
||||||
$('#cancelIGR').modal('show');
|
|
||||||
}
|
|
||||||
|
|
||||||
//alert("save function worked ");
|
//alert("save function worked ");
|
||||||
// var file = $('#images'+counterConstants).val()
|
// var file = $('#images'+counterConstants).val()
|
||||||
|
|
||||||
@ -904,21 +1000,6 @@ function Copyfilenames(id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function WeightDiffer(element)
|
|
||||||
{
|
|
||||||
// console.log(element);
|
|
||||||
var v1 = $("#GrossWeight").val();
|
|
||||||
var v2 = $("#TareWeight").val();
|
|
||||||
var v3 = v1-v2;
|
|
||||||
$("#NetWeight").val(v3);
|
|
||||||
if (element.id === 'GrossWeight') {
|
|
||||||
$("#GrossWeightDate").val($("#clock").text());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (element.id === 'TareWeight') {
|
|
||||||
$("#TareWeightDate").val($("#clock").text());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -966,4 +1047,99 @@ function removeRows(inputs) {
|
|||||||
|
|
||||||
setInterval(updateTime, 1000); // Update every second
|
setInterval(updateTime, 1000); // Update every second
|
||||||
updateTime(); // Initial call to display time immediately
|
updateTime(); // Initial call to display time immediately
|
||||||
</script>
|
function WeightDiffer(element)
|
||||||
|
{
|
||||||
|
// console.log(element);
|
||||||
|
var v1 = $("#GrossWeight").val();
|
||||||
|
var v2 = $("#TareWeight").val();
|
||||||
|
var v3 = v1-v2;
|
||||||
|
$("#NetWeight").val(v3);
|
||||||
|
if (element.id === 'GrossWeight') {
|
||||||
|
$("#GrossWeightDate").val($("#clock").text());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (element.id === 'TareWeight') {
|
||||||
|
$("#TareWeightDate").val($("#clock").text());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
$("#WeightCalculator").on("shown.bs.modal", function(e) {
|
||||||
|
var inx = $(e.relatedTarget).data('index');
|
||||||
|
var material = $(e.relatedTarget).data('material');
|
||||||
|
|
||||||
|
document.getElementById('material').textContent = " ( "+material+" )";
|
||||||
|
|
||||||
|
|
||||||
|
// Clear the modal inputs
|
||||||
|
$("#GrossWeight").val('');
|
||||||
|
$("#GrossWeightDate").val('');
|
||||||
|
$("#TareWeight").val('');
|
||||||
|
$("#TareWeightDate").val('');
|
||||||
|
$("#NetWeight").val('');
|
||||||
|
|
||||||
|
// Retrieve values from hidden inputs
|
||||||
|
var v1 = $("#txtGrossWeight" + inx).val();
|
||||||
|
var v2 = $("#txtGrossWeightDate" + inx).val();
|
||||||
|
var v3 = $("#txtTareWeight" + inx).val();
|
||||||
|
var v4 = $("#txtTareWeightDate" + inx).val();
|
||||||
|
var v5 = $("#txtNetWeight" + inx).val();
|
||||||
|
|
||||||
|
|
||||||
|
// Debugging alerts
|
||||||
|
// console.log("v1:", v1);
|
||||||
|
// console.log("v2:", v2);
|
||||||
|
// console.log("v3:", v3);
|
||||||
|
// console.log("v4:", v4);
|
||||||
|
// console.log("v5:", v5);
|
||||||
|
console.log("Selected values for index:", typeof inx,inx);
|
||||||
|
|
||||||
|
// Set modal inputs with the retrieved values
|
||||||
|
$("#GrossWeight").val(v1);
|
||||||
|
$("#GrossWeightDate").val(v2);
|
||||||
|
$("#TareWeight").val(v3);
|
||||||
|
$("#TareWeightDate").val(v4);
|
||||||
|
$("#NetWeight").val(v5);
|
||||||
|
$("#CurrentInx").val(inx);
|
||||||
|
});
|
||||||
|
|
||||||
|
function modalSave() {
|
||||||
|
var v1 = $("#GrossWeight").val();
|
||||||
|
var v2 = $("#GrossWeightDate").val();
|
||||||
|
var v3 = $("#TareWeight").val();
|
||||||
|
var v4 = $("#TareWeightDate").val();
|
||||||
|
var v5 = $("#NetWeight").val();
|
||||||
|
var v6 = $("#CurrentInx").val();
|
||||||
|
|
||||||
|
// Debugging alerts
|
||||||
|
// console.log("v1:", v1);
|
||||||
|
// console.log("v2:", v2);
|
||||||
|
// console.log("v3:", v3);
|
||||||
|
// console.log("v4:", v4);
|
||||||
|
// console.log("v5:", v5);
|
||||||
|
if (v6 !== undefined && v6 !== '') {
|
||||||
|
console.log("Saving values for index:", v6);
|
||||||
|
|
||||||
|
// Set the values back to the hidden inputs
|
||||||
|
$("#txtGrossWeight" + v6).val(v1);
|
||||||
|
$("#txtGrossWeightDate" + v6).val(v2);
|
||||||
|
$("#txtTareWeight" + v6).val(v3);
|
||||||
|
$("#txtTareWeightDate" + v6).val(v4);
|
||||||
|
$("#txtNetWeight" + v6).val(v5);
|
||||||
|
|
||||||
|
// Clear modal inputs
|
||||||
|
$("#GrossWeight").val('');
|
||||||
|
$("#GrossWeightDate").val('');
|
||||||
|
$("#TareWeight").val('');
|
||||||
|
$("#TareWeightDate").val('');
|
||||||
|
$("#NetWeight").val('');
|
||||||
|
|
||||||
|
// Close the modal
|
||||||
|
$("#WeightCalculator").modal('hide');
|
||||||
|
} else {
|
||||||
|
console.log("Saving values for index: undefined");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
Loading…
Reference in New Issue
Block a user