diff --git a/application/views/inwardgateregister.php b/application/views/inwardgateregister.php
index 7977dcbc..711967fd 100644
--- a/application/views/inwardgateregister.php
+++ b/application/views/inwardgateregister.php
@@ -378,51 +378,47 @@ function validate()
$('#PONO').change(function() {
removeHidden();
- $("#IGRappend").empty();
- $('#txtRowCount').val('');
+ $("#IGRappend").empty();
+ $('#txtRowCount').val('');
- var id = $('#PONO').val();
- var status= '';
- if(id != '-1')
- {
+ var id = $('#PONO').val();
+ var status= '';
+ if(id != '-1')
+ {
- $('#content').loader('show');
- var y = ;
+ $('#content').loader('show');
+ var y = ;
+
+ $.each(y, function(idx, obj) {
+ if(id == obj.PONO)
+ {
+ $("#po").val(obj.PONO);
+ $("#Sup").val(obj.SupplierName);
+ $("#del").val(obj.DeliveryDate);
+ status = obj.status;
+ ostatus= obj.OGR_Status;
+ }
+ });
+
- $.each(y, function(idx, obj) {
-
- if(id == obj.PONO)
- {
- $("#po").val(obj.PONO);
- $("#Sup").val(obj.SupplierName);
- //$("#Add").val(obj.Address);
- $("#del").val(obj.DeliveryDate);
- //$("#ser").val(obj.ServiceDescription);
- status = obj.status;
- ostatus= obj.OGR_Status;
- }
- });
-
-
- $.ajax({
- data:{id:id},
- type:"POST",
- url:"inwardgateregister/IGRITEM",
-
- success:function(data) {
+ $.ajax({
+ data:{id:id},
+ type:"POST",
+ url:"inwardgateregister/IGRITEM",
+
+ success:function(data) {
- //alert(data);
-
- $('#content').loader('hide');
- //alert(data);
- var trHTML = '';
- var j=0;
+ //alert(data);
+ $('#content').loader('hide');
+ //alert(data);
+ var trHTML = '';
+ var j=0;
$.each(JSON.parse(data), function (i, item) {
if(item.PendingQty !=0){
- i=i+1;
- j=j+1;
- trHTML += '
' +
- '| ' + j + ' | ' +
+ i=i+1;
+ j=j+1;
+ trHTML += '
' +
+ '| ' + j + ' | ' +
'' + item.MaterialCode + ' | ' +
'' + item.MaterialName + ' | ' +
'' + item.UOM + ' | ' +
@@ -433,71 +429,61 @@ function validate()
' | ' +
'
';
$('#txtRowCount').val(i);
-
+
$('').attr({
- type: 'hidden',
- id: 'MaterialCode'+i,
- value:item.MaterialCode,
- name: 'MaterialCode'+i
-}).appendTo('form');
-$('').attr({
- type: 'hidden',
- id: 'txtQuantityAsPerInvoice'+i,
- name: 'txtQuantityAsPerInvoice'+i
-}).appendTo('form');
-$('').attr({
- type: 'hidden',
- id: 'OrderedQuantity'+i,
-
- value:item.Quantity,
- name: 'OrderedQuantity'+i
+ type: 'hidden',
+ id: 'MaterialCode'+i,
+ value:item.MaterialCode,
+ name: 'MaterialCode'+i
+ }).appendTo('form');
+ $('').attr({
+ type: 'hidden',
+ id: 'txtQuantityAsPerInvoice'+i,
+ name: 'txtQuantityAsPerInvoice'+i
+ }).appendTo('form');
+ $('').attr({
+ type: 'hidden',
+ id: 'OrderedQuantity'+i,
+ value:item.Quantity,
+ name: 'OrderedQuantity'+i
+ }).appendTo('form');
- }).appendTo('form');
-
- $('').attr({
- type: 'hidden',
- id: 'txtReceivedQuantity'+i,
- name: 'txtReceivedQuantity'+i,
- value:item.ReceivedQuantity
- }).appendTo('form');
-
- $('').attr({
- type: 'hidden',
- id: 'txtRemarks'+i,
- name: 'txtRemarks'+i
- }).appendTo('form');
+ $('').attr({
+ type: 'hidden',
+ id: 'txtReceivedQuantity'+i,
+ name: 'txtReceivedQuantity'+i,
+ value:item.ReceivedQuantity
+ }).appendTo('form');
+ $('').attr({
+ type: 'hidden',
+ id: 'txtRemarks'+i,
+ name: 'txtRemarks'+i
+ }).appendTo('form');
+ $('').attr({
+ type: 'hidden',
+ id: 'txtPendingQty'+i,
+ name: 'txtPendingQty'+i,
+ value:item.PendingQty
+ }).appendTo('form');
- $('').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');
- }
- $("#IGRLink").show();
- }else{
- if(JSON.parse(data).length == 1 && item.PendingQty == 0){
- $("#IGRLink").hide();
- alert('The Order is completed!!');
- }
- }
+ if(item.PendingQty == 0.00)
+ {
+ $('#QuantityAsPerInvoice'+i).attr('readonly', 'true');
+ }
+ $("#IGRLink").show();
+ }else{
+ if(JSON.parse(data).length == 1 && item.PendingQty == 0){
+ $("#IGRLink").hide();
+ alert('The Order is completed!!');
+ }
+ }
});
-
- $("#IGRappend").empty();
-
+ $("#IGRappend").empty();
$('#IGRappend').append(trHTML);
-
-
}
});
@@ -518,7 +504,7 @@ $('').attr({
{
swal('Please Select the Purchase Order Number to Create IGR');
}
- });
+});
function SetRemarks(RowId)
{