Commit d4fdcfef authored by smestry's avatar smestry

W15LKAT004, Updated the js file for validation of Size, Color, Dimension item.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@101394 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 9b53c91a
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
var httpRequestNew; var httpRequestNew;
var isServerBusyNew = false; var isServerBusyNew = false;
var parserNew; var parserNew;
var rowId = "";
// Changed by Sneha on 07-04-2016, for item description [End] // Changed by Sneha on 07-04-2016, for item description [End]
function getAppDateFormat() function getAppDateFormat()
...@@ -1468,13 +1469,52 @@ ...@@ -1468,13 +1469,52 @@
document.getElementById(""+element.id).value = (parseFloat(element.value)).toFixed(2); document.getElementById(""+element.id).value = (parseFloat(element.value)).toFixed(2);
return true; return true;
} }
// Working
function checkSKUValidation( actionValue ) function checkSKUValidation( actionValue )
{ {
var formNo = document.getElementById("FORM_NO").value; var formNo = document.getElementById("FORM_NO").value;
var maxId = $('#SKUItemId tbody tr').length; var maxId = $('#SKUItemId tbody tr').length;
var barCodes = []; var barCodes = [];
// Changed by Sneha on 25-04-2016, for checking of Size/Color/Dimension of exisiting and new item [Start]
var itemDescr = new Array();
var count = 0;
alert("maxId===>>"+maxId);
alert("rowId===>>"+rowId);
//var rowId = (rowId=="") ? rowId=="0" : rowId;
if(maxId > rowId && rowId!= "")
{
for( dbID = 1; dbID <= maxId; dbID++)
{
var descr = document.getElementById("Detail3."+dbID+".descr").value;
itemDescr.push(descr);
//alert("itemDescr===>>"+itemDescr);
}
rowId++;
descr = document.getElementById("Detail3."+rowId+".descr").value;
//alert("descr===>>"+descr);
for (var i = 0; i <= itemDescr.length; i++)
{
if (itemDescr[i] == descr)
{
count++;
//alert("count====>>"+count);
if(count>1)
{
alert("Size/Color/Dimension can't be same as exisiting item.");
count = 0;
document.getElementById("Detail3."+rowId+".size_code_pophelp").focus();
return false;
}
}
}
}
// Changed by Sneha on 25-04-2016, for checking of Size/Color/Dimension of exisiting and new item [End]
for( dbID = 1; dbID <= maxId; dbID++) for( dbID = 1; dbID <= maxId; dbID++)
{ {
...@@ -1564,18 +1604,21 @@ ...@@ -1564,18 +1604,21 @@
} }
barCodes.push(document.getElementById("Detail"+formNo+"."+dbID+".item_barcode").value); barCodes.push(document.getElementById("Detail"+formNo+"."+dbID+".item_barcode").value);
} }
// Added by Samadhan on 28/12/2015 for check duplicate barcodes end // Added by Samadhan on 28/12/2015 for check duplicate barcodes end
} }
} }
//Changed by Sneha on 26-04-2016, validation for size, color, dimension [Start] //Changed by Sneha on 26-04-2016, validation for size, color, dimension [Start]
var itemCode = document.getElementById("Detail3.1.item_code").value; if(maxId > rowId && rowId!= "")
getItmAttribute(itemCode, maxId, "GET_ITEM_ATTRIBUTE");
//alert("valueFromServlet---"+valueFromServlet);
if(valueFromServlet == "Y")
{ {
alert("Size, Color, Dimension cannot be same as exisiting Item."); var itemCode = document.getElementById("Detail3.1.item_code").value;
document.getElementById("Detail3."+maxId+".size_code_pophelp").focus(); getItmAttribute(itemCode, maxId, "GET_ITEM_ATTRIBUTE");
return false; //alert("valueFromServlet---"+valueFromServlet);
if(valueFromServlet == "Y")
{
alert("Size, Color, Dimension cannot be same as exisiting Item.");
document.getElementById("Detail3."+maxId+".size_code_pophelp").focus();
return false;
}
} }
//Changed by Sneha on 26-04-2016, validation for size, color, dimension [End] //Changed by Sneha on 26-04-2016, validation for size, color, dimension [End]
...@@ -1666,7 +1709,8 @@ ...@@ -1666,7 +1709,8 @@
// Changed by Sneha on 30/03/2016, add new item [Start] // Changed by Sneha on 30/03/2016, add new item [Start]
function addItem() function addItem()
{ {
var rowId = maxId; rowId = maxId;
if(document.getElementById("maxRowId").value == "") if(document.getElementById("maxRowId").value == "")
{ {
document.getElementById("rowId").value = maxId.trim(); document.getElementById("rowId").value = maxId.trim();
...@@ -1965,8 +2009,7 @@ ...@@ -1965,8 +2009,7 @@
+"</tr>"; +"</tr>";
$('#SKUItemId tbody').append(row); $('#SKUItemId tbody').append(row);
} }
function itmparntChangeNew(itemCode, action) function itmparntChangeNew(itemCode, action)
...@@ -1990,7 +2033,6 @@ ...@@ -1990,7 +2033,6 @@
var url = "/ibase/ProdWizItemChangeServlet?ITEMCODE="+itemCode+"&PHYATTRIBUTE1="+phyAttribute1+"&PHYATTRIBUTE2="+phyAttribute2+"&PHYATTRIBUTE3="+phyAttribute3+"&ACTION="+action; var url = "/ibase/ProdWizItemChangeServlet?ITEMCODE="+itemCode+"&PHYATTRIBUTE1="+phyAttribute1+"&PHYATTRIBUTE2="+phyAttribute2+"&PHYATTRIBUTE3="+phyAttribute3+"&ACTION="+action;
makeRequestNew( url, setColumnValues); makeRequestNew( url, setColumnValues);
} }
function makeRequestNew( url, setColumnValues ) function makeRequestNew( url, setColumnValues )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment