'IGRissuefixed'
This commit is contained in:
parent
f7023852d4
commit
b0ff3ece4e
290
application/views/Editmaterialinspectionreport.php
Normal file
290
application/views/Editmaterialinspectionreport.php
Normal file
@ -0,0 +1,290 @@
|
||||
<?php
|
||||
$IGRNO="";
|
||||
$PONO="";
|
||||
$VehicleNo="";
|
||||
$CourierNo="";
|
||||
$DeliveryChellanOrInvoiceNo="";
|
||||
$SupplierName="";
|
||||
$DeliveryChellanDate="";
|
||||
$Address="";
|
||||
$CreatedBy="";
|
||||
$PODate="";
|
||||
$ServiceDescription="";
|
||||
|
||||
if(!empty($IGRDetails))
|
||||
{
|
||||
|
||||
foreach ($IGRDetails as $IGR)
|
||||
{
|
||||
$IGRNO = $IGR->IGRNO;
|
||||
$PONO = $IGR->PONO;
|
||||
$VehicleNo = $IGR->VehicleNo;
|
||||
$CourierNo= $IGR->CourierNo;
|
||||
$DeliveryChellanOrInvoiceNo=$IGR->DeliveryChellanOrInvoiceNo;
|
||||
$SupplierName=$IGR->SupplierName;
|
||||
$DeliveryChellanDate=$IGR->DeliveryChellanDate;
|
||||
$Address=$IGR->Address;
|
||||
$CreatedBy=$IGR->CreatedBy;
|
||||
$PODate=$IGR->PODate;
|
||||
$ServiceDescription=$IGR->ServiceDescription;
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
<script>
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
//$("#IGRNO").select2();
|
||||
$("#QualityIncharge").select2();
|
||||
$("#plantIncharge").select2();
|
||||
|
||||
});//ready closed.
|
||||
</script>
|
||||
|
||||
<script src="<?php echo base_url()?>assets/lib/jquery.tabletojson.js"></script>
|
||||
<script src="<?php echo base_url()?>assets/lib/jquery.tabletojson.min.js"></script>
|
||||
|
||||
|
||||
<style>
|
||||
.modal
|
||||
{
|
||||
padding-right:25% ! important;
|
||||
}
|
||||
.select2
|
||||
{
|
||||
width: 100% ! important;
|
||||
}
|
||||
.num{
|
||||
text-align:right;
|
||||
}
|
||||
.dataTables_wrapper {
|
||||
padding-bottom: 0px;
|
||||
}
|
||||
</style>
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1>
|
||||
<center>Siddharth Industries - Edit Material Receipt And Inspection Report (MRIR)<!-- MRIR Number Should come --></center>
|
||||
</h1>
|
||||
|
||||
<?php
|
||||
$attributes = array('class' => 'form-label-left MRIR ','name' => 'MRIR','id' => 'MRIR');
|
||||
//$this->config->base_url().'/MRIRscreen/generateMRIR/',$attributes
|
||||
echo form_open($this->config->base_url().'/MRIRscreen/generateMRIR/',$attributes); ?>
|
||||
</section>
|
||||
<section class="content"><br/>
|
||||
<div class="row">
|
||||
<div class="col-md-9">
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-4">
|
||||
<label for="IGRNO">Inward Gate Register Number</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'IGRNO','value' => set_value('IGRNO',$IGRNO),'id'=>'IGRNO', 'class' => 'form-control' ,'readonly' => 'true');
|
||||
echo form_input($data);
|
||||
|
||||
|
||||
?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="IGRNO">Inward Gate Register Date</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'IGRNO','value' => set_value('IGRNO',$IGRNO),'id'=>'IGRNO', 'class' => 'form-control' ,'readonly' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="SupplierName">Supplier Name </label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'SupplierName','value' => set_value('SupplierName',$SupplierName),'id'=>'SupplierName', 'class' => 'form-control' ,'readonly' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-4">
|
||||
|
||||
<label for="PONO">Purchase Order Number</label>
|
||||
<div class="form-group"><?php
|
||||
$data = array('name' => 'PONO','value' => set_value('PONO',$PONO),'id'=>'PONO', 'class' => 'form-control' ,'readonly' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="PODate">Purchase Order Date</label>
|
||||
<div class="from-group">
|
||||
<?php
|
||||
$data = array('name' => 'PODate','value' => set_value('PODate',$PODate),'id'=>'PODate', 'class' => 'form-control' ,'readonly' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="CreatedBy">Purchase Order Raised By</label>
|
||||
<div class="from-group"><?php
|
||||
$data = array('name' => 'CreatedBy','value' => set_value('CreatedBy',$CreatedBy),'id'=>'CreatedBy', 'class' => 'form-control' ,'readonly' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-4">
|
||||
<label for="DeliveryChellanOrInvoiceNo">Delivery Challan / Invoice Number</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
|
||||
$data = array('name' => 'DeliveryChellanOrInvoiceNo','value' => set_value('DeliveryChellanOrInvoiceNo',$DeliveryChellanOrInvoiceNo),'id'=>'DeliveryChellanOrInvoiceNo', 'class' => 'form-control num' ,'readonly' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="DeliveryChellanDate">Delivery Challan / Invoice Date </label>
|
||||
<div class="form-group"><?php
|
||||
$data = array('type'=>'date','name' => 'DeliveryChellanDate','value' => set_value('DeliveryChellanDate',$DeliveryChellanDate),'id'=>'DeliveryChellanDate', 'class' => 'form-control','readonly' => 'true');
|
||||
|
||||
echo form_input($data);
|
||||
?></div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label>Store Incharge</label>
|
||||
|
||||
<?php
|
||||
$data = array('name' => 'StoreIncharge','value' => set_value('StoreInchargeID',$name),'id'=>'StoreIncharge', 'class' => 'form-control' ,'readonly' => 'true');
|
||||
echo form_input($data);
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-4">
|
||||
<label for="VehicleNo">Vehicle Number</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'VehicleNo','value' => set_value('VehicleNo',$VehicleNo),'id'=>'VehicleNo', 'class' => 'form-control num', 'required'=>'true' ,'readonly' => 'true','align' => 'left');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="CourierNo">Courier Number</label>
|
||||
<div class="form-group"><?php
|
||||
$data = array('name' => 'CourierNo','value' => set_value('CourierNo',$CourierNo),'id'=>'CourierNo', 'class' => 'form-control num', 'required'=>'true' ,'readonly' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="col-md-12">
|
||||
<label for="Address">Supplier Address</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'Address','value' => set_value('Address',$Address),'id'=>'Address', 'class' => 'form-control' ,'readonly' => 'true' , 'rows'=>'4' ,'columns'=> '3');
|
||||
echo Form_textarea($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<label for="Address">Service Description</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'Address','value' => set_value('Address',$Address),'id'=>'Address', 'class' => 'form-control' ,'readonly' => 'true' , 'rows'=>'4' ,'columns'=> '3');
|
||||
echo Form_textarea($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row" style="padding:3%;">
|
||||
<div class="col-md-12">
|
||||
<table id="mytable" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
|
||||
<thead style="background-color:#ddf">
|
||||
<tr>
|
||||
<th>S.NO</th>
|
||||
<th>Item Code</th>
|
||||
<th>Material</th>
|
||||
<th>UOM</th>
|
||||
<th>Ordered Quantity</th>
|
||||
<th>Adviced Quantity as per the Challan</th>
|
||||
<th>Actual Quantity Received</th>
|
||||
<th>Accepted Quantity</th>
|
||||
<th>Rejected Quantity</th >
|
||||
<th>Remarks</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tbleAppend">
|
||||
<?php $SNo =1;
|
||||
|
||||
if(!empty($IGRDetails))
|
||||
|
||||
{
|
||||
|
||||
foreach($IGRDetails as $record)
|
||||
{
|
||||
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $SNo?></td>
|
||||
<td><?php echo $record->MaterialCode?></td>
|
||||
<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>
|
||||
<td class="num"><input type="text"></td>
|
||||
<td class="num"><input type="text"></td>
|
||||
<td><input type="text"></td>
|
||||
</tr>
|
||||
<?php
|
||||
$SNo++;
|
||||
|
||||
} }
|
||||
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="col-md-1 col-md-offset-10">
|
||||
<a class="btn btn-primary" type="submit" onclick="savemrir()">Update MRIR</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<script>
|
||||
|
||||
<!-- script for table , It works under the datatable plugin-->
|
||||
$(function () {
|
||||
$('#Inwardgateregistertable').DataTable({
|
||||
"paging": false,
|
||||
"lengthChange": false,
|
||||
"searching": false,
|
||||
"ordering": false,
|
||||
"info": false,
|
||||
"autoWidth": false
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
@ -54,6 +54,7 @@
|
||||
</section>
|
||||
<section class="content"><br/>
|
||||
<div class="row" style="padding-bottom:1%">
|
||||
<div id="content" > </div>
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-3">
|
||||
<?php
|
||||
@ -133,7 +134,7 @@
|
||||
<div class="col-md-3">
|
||||
<label>Vechicle NO</label>
|
||||
<?php
|
||||
$data = array('name' => 'VehicleNo','value' => set_value('VehicleNo'),'pattern=>"^[A-Z]{2}\s[0-9]{2}\s[A-Z]{2}\s[0-9]{4}$"','id'=>'VehicleNo', 'class' => 'form-control', 'required'=>'true','onchange'=>'validate_Vechicle();' );
|
||||
$data = array('name' => 'VehicleNo','value' => set_value('VehicleNo'),'pattern=>"^[A-Z]{2}\s[0-9]{2}\s[A-Z]{2}\s[0-9]{4}$"','id'=>'VehicleNo', 'class' => 'form-control', 'onchange'=>'validate_Vechicle();' );
|
||||
echo form_input($data);
|
||||
?>
|
||||
<span pattern="" required="true"></span>
|
||||
@ -141,7 +142,7 @@
|
||||
<div class="col-md-3">
|
||||
<label>Courier NO</label>
|
||||
<?php
|
||||
$data = array('name' => 'CourierNo','value' => set_value('CourierNo'),'id'=>'CourierNo', 'class' => 'form-control', 'required'=>'true' );
|
||||
$data = array('name' => 'CourierNo','value' => set_value('CourierNo'),'id'=>'CourierNo', 'class' => 'form-control' );
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
@ -159,7 +160,7 @@
|
||||
<th>Material</th>
|
||||
<th>UOM</th>
|
||||
<th>Ordered Quantity</th>
|
||||
<th>Adviced Quantity</th>
|
||||
<th>Advised Quantity</th>
|
||||
<th>Remarks</th>
|
||||
|
||||
</tr>
|
||||
@ -167,15 +168,7 @@
|
||||
<tbody id ="IGRappend">
|
||||
|
||||
</tbody>
|
||||
<!--<tr>
|
||||
<td>2</td>
|
||||
<td>Sand12</td>
|
||||
<td>wast sand</td>
|
||||
<td>kgs</td>
|
||||
<td class="num">1000</td>
|
||||
<td contenteditable="true" class="num">1000</td>
|
||||
<td contenteditable="true" class="num">Received</td>
|
||||
</tr>-->
|
||||
|
||||
|
||||
|
||||
|
||||
@ -204,14 +197,14 @@
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<center><h4>Inward Gate Register Number</h4></center>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-12"> <br/>
|
||||
<center>IGRNO Successfully Created</center>
|
||||
<center><label style="font-size:40px;" id="finaligr" >DEFAULT</label> <center>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<center>
|
||||
<button type="reset" value="Reset" onClick="window.location.reload()"> ok </button>
|
||||
<button type="reset" value="Reset" onClick="window.location.reload()"> OK</button>
|
||||
</center>
|
||||
</div><!-- footer div closed -->
|
||||
</div><!-- modal content div closed-->
|
||||
@ -266,33 +259,24 @@ function validate_Vechicle(){
|
||||
function validate()
|
||||
{
|
||||
var rowcount = $("#txtRowCount").val();
|
||||
var finald=0;
|
||||
var oldvalue=0;
|
||||
var exceed=0;
|
||||
//alert("validate rowcount " + rowcount);
|
||||
//$('#content').loader('show');
|
||||
for(i=1;i<=rowcount;i++)
|
||||
{
|
||||
//alert("inside for loop Row" + i);
|
||||
var v=v+i
|
||||
v =$("#QuantityAsPerInvoice"+i).val();
|
||||
//alert("new value"+ v);
|
||||
if(v !=''){
|
||||
var temp=$('#Quantity_1'+i).text();
|
||||
//alert("old value"+temp);
|
||||
|
||||
if(v <= temp){
|
||||
//alert('if');
|
||||
|
||||
}else{
|
||||
//alert('else');
|
||||
exceed++;
|
||||
}
|
||||
finald++;
|
||||
//alert('Have Value');
|
||||
}
|
||||
//alert("row one value" + v);
|
||||
}
|
||||
|
||||
var Noval = 0;
|
||||
var isExceed = 0;
|
||||
for(k=1;k<=rowcount ; k++)
|
||||
{
|
||||
var AdvisedQty =$("#QuantityAsPerInvoice"+k).val();
|
||||
var OrderedQty =$('#Quantity_1'+k).text();
|
||||
if(AdvisedQty != '')
|
||||
{
|
||||
if(OrderedQty < AdvisedQty)
|
||||
{
|
||||
isExceed = 1;
|
||||
return;
|
||||
}
|
||||
Noval = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if($('#PONO').val()=='-1')
|
||||
{
|
||||
@ -313,32 +297,23 @@ function validate()
|
||||
$('#InvoiceDate').focus();
|
||||
return false;
|
||||
}
|
||||
else if (rowcount!=finald )
|
||||
else if (Noval == 0 )
|
||||
{
|
||||
|
||||
alert('Please Enter Received Quantity Correctly');
|
||||
alert('Advised Quantity is Empty.Please Enter the value');
|
||||
return false;
|
||||
|
||||
}
|
||||
else if(exceed!=0 ){
|
||||
else if($('#VehicleNo').val() == '' && $('#CourierNo').val() == '')
|
||||
{
|
||||
alert('Please Enter the Vechicle / Courier Number');
|
||||
return false;
|
||||
}
|
||||
else if(isExceed == 1 ){
|
||||
|
||||
alert('Adviced quantity is exceeding the Ordered quantity!');
|
||||
return false;
|
||||
}
|
||||
|
||||
// else if (($('#VehicleNo').val() == '' ) && ($('#CourierNo').val() == '' ))
|
||||
// {
|
||||
// alert('Please Enter Vechicle Number or Please Enter CourierNo' );
|
||||
// }
|
||||
// else if($('#ReceivedQuantity'+i+).val() == '')
|
||||
// {
|
||||
// alert('Please Enter Received Quantity' );
|
||||
// }
|
||||
// else if ($('#Quantity' >= '#ReceivedQuantity').val()) {
|
||||
|
||||
// alert("Please Enter Correct Invoice Quantity");
|
||||
|
||||
// }
|
||||
alert("Advised Quantity is exceeding the Ordered Quantity.Please Contact Purchase Team for further Process ")
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
@ -363,58 +338,50 @@ return false;
|
||||
// $(function() {
|
||||
|
||||
$('#PONO').change(function() {
|
||||
$("#IGRappend").empty();
|
||||
|
||||
|
||||
var id = $('#PONO').val();
|
||||
|
||||
|
||||
|
||||
if(id != '-1')
|
||||
{
|
||||
|
||||
$('#content').loader('show');
|
||||
var y = <?php echo json_encode($PO_NO, JSON_PRETTY_PRINT) ?>;
|
||||
//alert(y);
|
||||
|
||||
$.each(y, function(idx, obj) {
|
||||
// alert(obj.PONO);
|
||||
|
||||
if(id == obj.PONO)
|
||||
{
|
||||
$("#po").val(obj.PONO);
|
||||
$("#Sup").val(obj.SupplierName);
|
||||
// alert(obj.SupplierName);
|
||||
$("#Add").val(obj.Address);
|
||||
$("#del").val(obj.DeliveryDate);
|
||||
$("#ser").val(obj.ServiceDescription);
|
||||
//alert(obj.ServiceDescription);
|
||||
//$("#item").text(obj.MaterialCode);
|
||||
|
||||
//$("MaterialName").text(obj.MaterialName);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
//alert(id);
|
||||
|
||||
$.ajax({
|
||||
data:{id:id},
|
||||
type:"POST",
|
||||
url:"<?php echo base_url() ?>inwardgateregister/IGRITEM",
|
||||
|
||||
success:function(data) {
|
||||
|
||||
// alert(data);
|
||||
|
||||
//var myData = JSON.parse('{"name":"hai"}');
|
||||
//alert("hao"+myData.name);
|
||||
//if(data)
|
||||
//{
|
||||
$('#content').loader('hide');
|
||||
//alert(data);
|
||||
var trHTML = '';
|
||||
//var rowcount=0;
|
||||
|
||||
$.each(JSON.parse(data), function (i, item) {
|
||||
|
||||
i=i+1;
|
||||
trHTML += '<tr>' +
|
||||
'<td align="right">' + i + '</td>' +
|
||||
'<td name="MaterialName" id="MaterialCode" onchange="test('+i+')">' + item.MaterialCode + '</td>' +
|
||||
'<td name="MaterialName" id="MaterialCode" >' + item.MaterialCode + '</td>' +
|
||||
'<td>' + item.MaterialName + '</td>' +
|
||||
'<td name="UOM">' + item.UOM + '</td>' +
|
||||
'<td align="right" name="Quantity1'+i+'" id="Quantity_1'+i+'">' + item.Quantity + '</td>' +
|
||||
'<td align="right" data-name="sel" ><input type="number" onchange="test('+i+')"id="QuantityAsPerInvoice'+ i +'" name="QuantityAsPerInvoice'+ i +'" class="form required" value=""></td>' +
|
||||
'<td><input type="text" id="Remark'+ i +'" name="Remark'+ i +'" class="form"> </td>' +
|
||||
'<td align="right" data-name="sel" ><input type="text" onchange="validateReceivedQuantity('+i+')"id="QuantityAsPerInvoice'+ i +'" name="QuantityAsPerInvoice'+ i +'" class="form required" value="" onkeypress="return isNumberKey(event);"></td>' +
|
||||
'<td><input type="text" id="Remark'+ i +'" name="Remark'+ i +'" class="form" onchange="SetRemarks('+i+')"> </td>' +
|
||||
'</tr>';
|
||||
$('#txtRowCount').val(i);
|
||||
|
||||
@ -424,127 +391,105 @@ return false;
|
||||
value:item.MaterialCode,
|
||||
name: 'MaterialCode'+i
|
||||
}).appendTo('form');
|
||||
$('<input>').attr({
|
||||
type: 'hidden',
|
||||
id: 'OrderedQuantity'+i,
|
||||
|
||||
value:item.Quantity,
|
||||
name: 'OrderedQuantity'+i
|
||||
|
||||
// $('<input>').attr({
|
||||
// type:'hidden',
|
||||
// id: 'QuantityAsPerInvoice'+i,
|
||||
// value:$("#QuantityAsPerInvoice"+i).val();
|
||||
// name: 'QuantityAsPerInvoice'+i
|
||||
// }).appendTo('form');
|
||||
}).appendTo('form');
|
||||
|
||||
$('<input>').attr({
|
||||
type: 'hidden',
|
||||
id: 'ReceivedQuantity'+i,
|
||||
name: 'ReceivedQuantity'+i,
|
||||
}).appendTo('form');
|
||||
|
||||
|
||||
|
||||
// $('<input>').attr({
|
||||
// type: 'hidden',
|
||||
// id: 'Remark'+i,
|
||||
|
||||
// name: 'Remarks'+i
|
||||
// }).appendTo('form');
|
||||
//rowcount++;
|
||||
$('<input>').attr({
|
||||
type: 'hidden',
|
||||
id: 'txtRemarks'+i,
|
||||
name: 'txtRemarks'+i
|
||||
}).appendTo('form');
|
||||
|
||||
});
|
||||
|
||||
//alert(trHTML);
|
||||
|
||||
|
||||
$("#IGRappend").empty();
|
||||
|
||||
//$("#IGRappend").append(trHTML);
|
||||
$('#Inwardgateregistertable > tbody').append(trHTML);
|
||||
//$('#txtRowCount').val(rowcount);
|
||||
|
||||
$('#IGRappend').append(trHTML);
|
||||
|
||||
}
|
||||
//$('#txtRowCount').val(rowcount);
|
||||
// var temp=$("#rowcount").val();
|
||||
// alert("HIDDEN:"+temp);
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
alert('Please Select the Purchase Order Number to Create IGR');
|
||||
}
|
||||
});
|
||||
// });
|
||||
|
||||
function test2(Rowid){
|
||||
//alert($('#MaterialCode'+Rowid).val());
|
||||
//alert($('#Quantity1'+Rowid).val());
|
||||
function SetRemarks(RowId)
|
||||
{
|
||||
var remks = $("#Remark"+RowId).val();
|
||||
if( remks != '')
|
||||
{
|
||||
$("#txtRemarks"+RowId).val(remks);
|
||||
}
|
||||
}
|
||||
function validateReceivedQuantity(Rowid){
|
||||
//alert(Rowid);
|
||||
var q =$("#QuantityAsPerInvoice"+Rowid).val();
|
||||
//alert(q);
|
||||
|
||||
var InvoiceQty =$("#QuantityAsPerInvoice"+Rowid).val();
|
||||
|
||||
var r =$("#Remark"+Rowid).val();
|
||||
//alert($("#Quantity"+Rowid).val());
|
||||
var s =($("#Quantity_1"+Rowid).text());
|
||||
// alert(q);
|
||||
//alert(s);
|
||||
//$('#txtRowCount').val(q);
|
||||
$('<input>').attr({
|
||||
type: 'hidden',
|
||||
id: 'Quantity'+Rowid,
|
||||
//pattern : '[0-9]'+Rowid,
|
||||
value:s,
|
||||
name: 'Quantity'+Rowid
|
||||
|
||||
var OrderedQty =($("#Quantity_1"+Rowid).text());
|
||||
|
||||
|
||||
|
||||
|
||||
if(InvoiceQty >= OrderedQty){
|
||||
|
||||
}).appendTo('form');
|
||||
//alert(s)
|
||||
$('<input>').attr({
|
||||
type: 'hidden',
|
||||
id: 'ReceivedQuantity'+Rowid,
|
||||
pattern : '[0-9]'+Rowid,
|
||||
//requried : 'true'+Rowid,
|
||||
value:q,
|
||||
name: 'ReceivedQuantity'+Rowid,
|
||||
}).appendTo('form');
|
||||
//alert(q);
|
||||
$('<input>').attr({
|
||||
type: 'hidden',
|
||||
id: 'Remarks'+Rowid,
|
||||
//pattern : '[a-z,A-Z]'+Rowid,
|
||||
value:r,
|
||||
name: 'Remarks'+Rowid
|
||||
}).appendTo('form');
|
||||
|
||||
|
||||
|
||||
// if ( q=='' || q=='0') {
|
||||
|
||||
// alert("Please Enter Correct Invoice Quantity");
|
||||
|
||||
// }
|
||||
|
||||
//else
|
||||
if(q >= s){
|
||||
|
||||
alert("Adviced qunatity is exceeding the Ordered quantity! ")
|
||||
alert("Advised Quantity is exceeding the Ordered Quantity.Please Contact Purchase Team for further Process ")
|
||||
$("#QuantityAsPerInvoice"+Rowid).focus();
|
||||
return false;
|
||||
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
alert("ok");
|
||||
$("#ReceivedQuantity"+Rowid).val(InvoiceQty);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
</script>
|
||||
// <script>
|
||||
// $(#QuantityAsPerInvoice+Rowid).validate({
|
||||
// rules: {
|
||||
// field1: "required"
|
||||
// },
|
||||
// messages: {
|
||||
// field1: "Please specify your name"
|
||||
// }
|
||||
// });
|
||||
// </script>
|
||||
<script>
|
||||
// function message() //for reload the page
|
||||
// {
|
||||
// alert("message worked");
|
||||
// window.location.reload();
|
||||
// }
|
||||
|
||||
<script>
|
||||
|
||||
function isNumberKey(evt)
|
||||
{
|
||||
var charCode = (evt.which) ? evt.which : evt.keyCode;
|
||||
if (charCode != 46 && charCode > 31
|
||||
&& (charCode < 48 || charCode > 57))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
function Save()
|
||||
{
|
||||
//alert("save function worked ");
|
||||
|
||||
if (validate())
|
||||
{
|
||||
|
||||
// alert($('#Inwardgateregistertable').rows.count);
|
||||
//alert(" if condition validation part ");
|
||||
$('#content').loader('show');
|
||||
$.ajax({
|
||||
@ -553,22 +498,19 @@ function Save()
|
||||
url:"<?php echo base_url() ?>inwardgateregister/addNewigr",
|
||||
|
||||
success:function(data) {
|
||||
//alert("success function worked");//....
|
||||
//console.log(data);
|
||||
//alert("before if condition");
|
||||
|
||||
if(data){
|
||||
// alert("after if condition");
|
||||
$('#IGRNO').val(data);
|
||||
alert("IGRNO"+data);
|
||||
alert(data);
|
||||
$('#content').loader('hide');
|
||||
$('#IGRNO').val(data);
|
||||
document.getElementById('finaligr').innerHTML=data;
|
||||
$('#generateIGR').modal('show');
|
||||
//window.location ="<?php echo base_url() ?>inwardgateregister/addNewigr";
|
||||
}
|
||||
else
|
||||
{
|
||||
alert("Error");
|
||||
}
|
||||
//var igrvalueno = $(this).serialize();
|
||||
|
||||
|
||||
}//success function closed
|
||||
});//ajax closed
|
||||
|
||||
@ -1,11 +1,4 @@
|
||||
<script>
|
||||
|
||||
// For table
|
||||
(function(l,q){var e=function(b,c){b.extend(!0,c.defaults,{dom:"<'row'<'col-sm-9'l><'col-sm-3'f>><'row'<'col-sm-12'tr>><'row'<'col-sm-9'i><'col-sm-3'p>>",renderer:"bootstrap"});b.extend(c.ext.classes,{sWrapper:"dataTables_wrapper form-inline dt-bootstrap",sFilterInput:"form-control input-sm",sLengthSelect:"form-control input-sm"});c.ext.renderer.pageButton.bootstrap=function(g,e,r,s,i,m){var t=new c.Api(g),u=g.oClasses,j=g.oLanguage.oPaginate,d,f,n=0,p=function(c,e){var k,h,o,a,l=function(a){a.preventDefault();
|
||||
b(a.currentTarget).hasClass("disabled")||t.page(a.data.action).draw(!1)};k=0;for(h=e.length;k<h;k++)if(a=e[k],b.isArray(a))p(c,a);else{f=d="";switch(a){case "ellipsis":d="…";f="disabled";break;case "first":d=j.sFirst;f=a+(0<i?"":" disabled");break;case "previous":d=j.sPrevious;f=a+(0<i?"":" disabled");break;case "next":d=j.sNext;f=a+(i<m-1?"":" disabled");break;case "last":d=j.sLast;f=a+(i<m-1?"":" disabled");break;default:d=a+1,f=i===a?"active":""}d&&(o=b("<li>",{"class":u.sPageButton+" "+
|
||||
f,id:0===r&&"string"===typeof a?g.sTableId+"_"+a:null}).append(b("<a>",{href:"#","aria-controls":g.sTableId,"data-dt-idx":n,tabindex:g.iTabIndex}).html(d)).appendTo(c),g.oApi._fnBindAction(o,{action:a},l),n++)}},h;try{h=b(q.activeElement).data("dt-idx")}catch(l){}p(b(e).empty().html('<ul class="pagination"/>').children("ul"),s);h&&b(e).find("[data-dt-idx="+h+"]").focus()};c.TableTools&&(b.extend(!0,c.TableTools.classes,{container:"DTTT btn-group",buttons:{normal:"btn btn-default",disabled:"disabled"},
|
||||
collection:{container:"DTTT_dropdown dropdown-menu",buttons:{normal:"",disabled:"disabled"}},print:{info:"DTTT_print_info"},select:{row:"active"}}),b.extend(!0,c.TableTools.DEFAULTS.oTags,{collection:{container:"ul",button:"li",liner:"a"}}))};"function"===typeof define&&define.amd?define(["jquery","datatables"],e):"object"===typeof exports?e(require("jquery"),require("datatables")):jQuery&&e(jQuery,jQuery.fn.dataTable)})(window,document);
|
||||
</script>
|
||||
|
||||
|
||||
<style>
|
||||
.modal
|
||||
@ -237,7 +230,7 @@ $("#Igrshow").on("shown.bs.modal", function(e) {
|
||||
'<td align="right" data-name="sel" >'+item.QuantityAsPerInvoice+'</td>' +
|
||||
'<td>'+ item.Remarks+ '</td>' +
|
||||
'</tr>';
|
||||
alert(item.QuantityAsPerInvoice);
|
||||
//alert(item.QuantityAsPerInvoice);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user