Commit 277f69c3 authored by smestry's avatar smestry

Updated js for product wizard


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@104058 ce508802-f39f-4f6c-b175-0d175dae99d5
parent f9852251
...@@ -146,7 +146,7 @@ ...@@ -146,7 +146,7 @@
function makeRequest( url, setColumnValues ) function makeRequest( url, setColumnValues )
{ {
var sURL = unescape(window.location); var sURL = unescape(window.location);
if( ! isServerBusy ) if( ! isServerBusy )
{ {
isServerBusy = true; isServerBusy = true;
...@@ -202,7 +202,19 @@ ...@@ -202,7 +202,19 @@
// Changed by Sneha on 25-10-2016, for customer item reference [Start] // Changed by Sneha on 25-10-2016, for customer item reference [Start]
if(setColumnValues == "custItemRef") if(setColumnValues == "custItemRef")
{ {
setCustItemRefVal(xmldoc); // from prodWiz_Form_I.js setCustItemRefVal(xmldoc);
}
else if(setColumnValues == "defaultValues")
{
setDefaultValue(xmldoc);
}
else if(setColumnValues == "getDefaultValues")
{
setDefaultValueFromJSON(xmldoc);
}
else if(setColumnValues == "defaultBarcode")
{
document.getElementById("barcode_flag").value = xmldoc;
} }
else else
{ {
...@@ -536,7 +548,7 @@ ...@@ -536,7 +548,7 @@
// Changed by Sneha on 25-10-2016, for customer item reference [Start] // Changed by Sneha on 25-10-2016, for customer item reference [Start]
function setCustItemRef() function setCustItemRef()
{ {
action = "CUST_ITEM_REF" var action = "CUST_ITEM_REF";
var url = "/ibase/ProdWizItemChangeServlet?ACTION="+action; var url = "/ibase/ProdWizItemChangeServlet?ACTION="+action;
makeRequest( url, "custItemRef"); makeRequest( url, "custItemRef");
} }
...@@ -567,27 +579,104 @@ ...@@ -567,27 +579,104 @@
// Changed by Sneha on 25-10-2016, for customer item reference [End] // Changed by Sneha on 25-10-2016, for customer item reference [End]
function checkDate() // Changed by Sneha on 23-11-2016, to set default values [Start]
{ function defaultValues()
{
var action = "SET_DEFAULT_VALUES";
var url = "/ibase/ProdWizItemChangeServlet?ACTION="+action;
makeRequest( url, "defaultValues");
}
function setDefaultValue(xmldoc)
{
document.getElementById("default_value_status").value = xmldoc;
if(xmldoc == "Y")
{
isServerBusy = false;
var action = "GET_DEFAULT_VALUES";
var url = "/ibase/ProdtWizDefaultValuesServlet?ACTION="+action;
makeRequest( url, "getDefaultValues");
}
}
function setDefaultValueFromJSON(json)
{
var jsonData = JSON.parse(json);
//alert("dimension_desc======>>"+jsonData[i].dimension_desc);
for(var obj in jsonData)
{
if(jsonData.hasOwnProperty(obj))
{
for(var prop in jsonData[obj])
{
if(jsonData[obj].hasOwnProperty(prop))
{
//alert(prop + ':' + jsonData[obj][prop]);
if(document.getElementById(prop).nodeName == "DIV")
{
document.getElementById(prop).innerHTML = jsonData[obj][prop];
}
else if(document.getElementById(prop).nodeName == "INPUT")
{
document.getElementById(prop).value = jsonData[obj][prop];
}
}
}
}
}
}
function setLanguageDescr()
{
var maxId = $('#langList tbody tr').length;
var default_value_status = document.getElementById("default_value_status").value;
//alert(default_value_status);
if(default_value_status == "Y")
{
var item_prnt = document.getElementById("Detail1.1.item_parnt").value;
var descr = document.getElementById("Detail1.1.descr").value;
for(var i = 0; i <= maxId; i++)
{
document.getElementById("langCodeDesc"+i).value = item_prnt + " " + descr;
}
}
}
// Changed by Sneha on 23-11-2016, to set default values [End]
// Changed by Sneha on 24-11-2016, to auto generate barcode [Start]
function defaultBarcodeFlag()
{
var action = "SET_DEFAULT_BARCODE_FLAG";
var url = "/ibase/ProdWizItemChangeServlet?ACTION="+action;
makeRequest( url, "defaultBarcode");
}
// Changed by Sneha on 24-11-2016, to auto generate barcode [End]
function checkDate()
{
var dateString = document.purchase.txndt.value; var dateString = document.purchase.txndt.value;
var myDate = new Date(dateString); var myDate = new Date(dateString);
var today = new Date(); var today = new Date();
if (document.purchase.txndt.value == "") if (document.purchase.txndt.value == "")
{ {
//something is wrong //something is wrong
alert('REQUIRED FIELD ERROR: Please enter date in field!') alert('REQUIRED FIELD ERROR: Please enter date in field!')
return false; return false;
}
else if (myDate>today)
{
//something else is wrong
alert('You cannot enter a date in the future!')
return false;
}
// if script gets this far through all of your fields
// without problems, it's ok and you can submit the form
return true;
} }
else if (myDate>today)
{
//something else is wrong
alert('You cannot enter a date in the future!')
return false;
}
// if script gets this far through all of your fields
// without problems, it's ok and you can submit the form
return true;
}
function searchData(textObj, eve) function searchData(textObj, eve)
...@@ -641,4 +730,10 @@ ...@@ -641,4 +730,10 @@
tableObj.rows[i].style.display = "none"; tableObj.rows[i].style.display = "none";
} }
} }
} }
\ No newline at end of file
\ No newline at end of file
...@@ -396,7 +396,7 @@ ...@@ -396,7 +396,7 @@
var cust_item_ref_status = document.getElementById("cust_item_ref_status").value; var cust_item_ref_status = document.getElementById("cust_item_ref_status").value;
if(cust_item_ref_status == "Y") if(cust_item_ref_status == "Y")
{ {
document.getElementById("Detail3."+idNum+".phy_attrib_4").value = document.getElementById("Detail3.0.item_parent").value + document.getElementById("Detail3."+idNum+".phy_attrib_2").value + fieldValue; document.getElementById("Detail3."+idNum+".phy_attrib_4").value = document.getElementById("Detail3.0.item_parent").value + " - " + document.getElementById("Detail3."+idNum+".phy_attrib_2").value + " - " + fieldValue;
} }
// Changed by Sneha on 28-10-2016, to set value in the field cust item ref [End] // Changed by Sneha on 28-10-2016, to set value in the field cust item ref [End]
...@@ -433,7 +433,7 @@ ...@@ -433,7 +433,7 @@
var cust_item_ref_status = document.getElementById("cust_item_ref_status").value; var cust_item_ref_status = document.getElementById("cust_item_ref_status").value;
if(cust_item_ref_status == "Y") if(cust_item_ref_status == "Y")
{ {
document.getElementById("Detail3."+idNum+".phy_attrib_4").value = document.getElementById("Detail3.0.item_parent").value + document.getElementById("Detail3."+idNum+".phy_attrib_2").value + size; document.getElementById("Detail3."+idNum+".phy_attrib_4").value = document.getElementById("Detail3.0.item_parent").value + " - " + document.getElementById("Detail3."+idNum+".phy_attrib_2").value + " - " + size;
} }
// Changed by Sneha on 28-10-2016, to set value in the field cust item ref [End] // Changed by Sneha on 28-10-2016, to set value in the field cust item ref [End]
...@@ -1996,6 +1996,7 @@ ...@@ -1996,6 +1996,7 @@
// 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()
{ {
//alert("----- inside addItem -----"); //alert("----- inside addItem -----");
rowId = maxId; rowId = maxId;
...@@ -2044,6 +2045,14 @@ ...@@ -2044,6 +2045,14 @@
var tradeMark = document.getElementById("Detail3."+rowId+".trade_mark").value; var tradeMark = document.getElementById("Detail3."+rowId+".trade_mark").value;
var taxChap = document.getElementById("Detail3."+rowId+".tax_chap").value;//Changed by wasim on 03-08-2016 for tax chapter var taxChap = document.getElementById("Detail3."+rowId+".tax_chap").value;//Changed by wasim on 03-08-2016 for tax chapter
defaultBarcodeFlag();
//alert("valueFromServlet for defaultBarcodeFlag --->>"+valueFromServlet);
if(valueFromServlet == "Y")
{
defaultBarcodeVal();
//alert("valueFromServlet for defaultBarcodeVal -3333333-->>"+valueFromServlet);
}
//alert("itemCode---"+itemCode); //alert("itemCode---"+itemCode);
//itmparntChangeNew(itemCode, "GET_ITEM_DESCR"); //itmparntChangeNew(itemCode, "GET_ITEM_DESCR");
...@@ -2211,7 +2220,7 @@ ...@@ -2211,7 +2220,7 @@
+"<input type='hidden' value='"+tradeMark+"' name='Detail3."+maxRowId+".trade_mark' " +"<input type='hidden' value='"+tradeMark+"' name='Detail3."+maxRowId+".trade_mark' "
+"id='Detail3."+maxRowId+".trade_mark' maxlength='25' />" +"id='Detail3."+maxRowId+".trade_mark' maxlength='25' />"
+"<div style='float:left;width: 85%;text-align:center;' id='trade_mark."+maxRowId+"' onkeypress='return false;'" +"<div style='float:left;width: 85%;text-align:left;' id='trade_mark."+maxRowId+"' onkeypress='return false;'"
+"onkeydown='javascript:openSearchPopup(event, '"+maxRowId+"','0','trade_mark', 'Trade&#160;Mark', '"+maxRowId+"');'> " +"onkeydown='javascript:openSearchPopup(event, '"+maxRowId+"','0','trade_mark', 'Trade&#160;Mark', '"+maxRowId+"');'> "
+ tradeMark + tradeMark
+"</div>" +"</div>"
...@@ -2222,14 +2231,14 @@ ...@@ -2222,14 +2231,14 @@
+"</td>" +"</td>"
// Tax // Tax
+"<td style='text-align:center;'>" +"<td style='text-align:left;'>"
+"<input type='hidden' name='Detail3."+maxRowId+".tax'" +"<input type='hidden' name='Detail3."+maxRowId+".tax'"
+"id='Detail3."+maxRowId+".tax' maxlength='10' value='"+tax+"' >" +"id='Detail3."+maxRowId+".tax' maxlength='10' value='"+tax+"' >"
+"<input type='hidden' name='Detail3."+maxRowId+".tax_descr'" +"<input type='hidden' name='Detail3."+maxRowId+".tax_descr'"
+"id='Detail3."+maxRowId+".tax_descr' maxlength='10' value='"+taxDescr+"' >" +"id='Detail3."+maxRowId+".tax_descr' maxlength='10' value='"+taxDescr+"' >"
+"<div style='float:left;width: 85%;text-align:center;' id='tax."+maxRowId+"' contenteditable='false' onkeypress='return false;'" +"<div style='float:left;width: 85%;text-align:left;' id='tax."+maxRowId+"' contenteditable='false' onkeypress='return false;'"
+"onkeydown='javascript:openSearchPopup(event, '"+maxRowId+"','0','tax_desc', 'Tax&#160;Code', '"+maxRowId+"');'>" +"onkeydown='javascript:openSearchPopup(event, '"+maxRowId+"','0','tax_desc', 'Tax&#160;Code', '"+maxRowId+"');'>"
+ taxDescr + taxDescr
+"</div>" +"</div>"
...@@ -2247,7 +2256,7 @@ ...@@ -2247,7 +2256,7 @@
+"<input type='hidden' name='Detail3."+maxRowId+".tax_chap'" +"<input type='hidden' name='Detail3."+maxRowId+".tax_chap'"
+"id='Detail3."+maxRowId+".tax_chap' maxlength='10' value='"+taxChap+"' >" +"id='Detail3."+maxRowId+".tax_chap' maxlength='10' value='"+taxChap+"' >"
+"<div style='float:left;width: 85%;text-align:center;' id='tax_chap."+maxRowId+"' contenteditable='false' onkeypress='return false;'" +"<div style='float:left;width: 85%;text-align:left;' id='tax_chap."+maxRowId+"' contenteditable='false' onkeypress='return false;'"
+"onkeydown='javascript:openSearchPopup(event, '"+maxRowId+"','0','tax_chap', 'Tax&#160;Chapter', '"+maxRowId+"');'>" +"onkeydown='javascript:openSearchPopup(event, '"+maxRowId+"','0','tax_chap', 'Tax&#160;Chapter', '"+maxRowId+"');'>"
+ taxChap + taxChap
+"</div>" +"</div>"
...@@ -2312,7 +2321,7 @@ ...@@ -2312,7 +2321,7 @@
+"<input type='hidden' value='"+locType+"' name='Detail3."+maxRowId+".loc_type'" +"<input type='hidden' value='"+locType+"' name='Detail3."+maxRowId+".loc_type'"
+"id='Detail3."+maxRowId+".loc_type' maxlength='10'/>" +"id='Detail3."+maxRowId+".loc_type' maxlength='10'/>"
+"<div style='float:left;width:85%;text-align:center;' id='loc_code."+maxRowId+"' contenteditable='true' onkeypress='return false;'" +"<div style='float:left;width:85%;text-align:left;' id='loc_code."+maxRowId+"' contenteditable='true' onkeypress='return false;'"
+"onkeydown='javascript:openSearchPopup(event, '"+maxRowId+"','0','loc_codeII', 'Location', '"+maxRowId+"');'>" +"onkeydown='javascript:openSearchPopup(event, '"+maxRowId+"','0','loc_codeII', 'Location', '"+maxRowId+"');'>"
+ locCode + locCode
+"</div>" +"</div>"
...@@ -2329,7 +2338,7 @@ ...@@ -2329,7 +2338,7 @@
+"<input type='hidden' class='editInputClass' value='"+packSizeDescr+"' name='Detail3."+maxRowId+".pack_size_descr' " +"<input type='hidden' class='editInputClass' value='"+packSizeDescr+"' name='Detail3."+maxRowId+".pack_size_descr' "
+"id='Detail3."+maxRowId+".pack_size_descr' />" +"id='Detail3."+maxRowId+".pack_size_descr' />"
+"<a href='#' id='Detail3."+maxRowId+".packListLink' style='color: black' onclick=openPopup(event,this.id,'pack');>Click&#160;for&#160;Pack&#160;Details</a>" +"<a href='#' id='Detail3."+maxRowId+".packListLink' style='color: black; font-size:12px;' onclick=openPopup(event,this.id,'pack');>Click&#160;for&#160;Pack&#160;Details</a>"
+"</td>" +"</td>"
// Price List // Price List
...@@ -2337,7 +2346,7 @@ ...@@ -2337,7 +2346,7 @@
+"<input type='hidden' class='editInputClass' value='"+priceListDtl+"' name='Detail3."+maxRowId+".price_list_dtl' " +"<input type='hidden' class='editInputClass' value='"+priceListDtl+"' name='Detail3."+maxRowId+".price_list_dtl' "
+"id='Detail3."+maxRowId+".price_list_dtl' />" +"id='Detail3."+maxRowId+".price_list_dtl' />"
+"<a href='#' id='Detail3."+maxRowId+".prodPriceLink' style='color: black;text-align:center;' onclick=openPopup(event,this.id,'price');>Click&#160;for&#160;PriceList</a>" +"<a href='#' id='Detail3."+maxRowId+".prodPriceLink' style='color: black;text-align:center;font-size:12px;' onclick=openPopup(event,this.id,'price');>Click&#160;for&#160;PriceList</a>"
+"</td>" +"</td>"
// Supplier List // Supplier List
...@@ -2345,7 +2354,7 @@ ...@@ -2345,7 +2354,7 @@
+"<input type='hidden' class='editInputClass' name='Detail3."+maxRowId+".supp_item_dtl' " +"<input type='hidden' class='editInputClass' name='Detail3."+maxRowId+".supp_item_dtl' "
+"id='Detail3."+maxRowId+".supp_item_dtl' value='"+suppItemDtl+"' />" +"id='Detail3."+maxRowId+".supp_item_dtl' value='"+suppItemDtl+"' />"
+"<a href='#' id='Detail3."+maxRowId+".suppListLink' style='color: black;' onclick=openPopup(event,this.id,'supp');>Click&#160;for&#160;Supplier&#160;Details</a>" +"<a href='#' id='Detail3."+maxRowId+".suppListLink' style='color: black;font-size:12px;' onclick=openPopup(event,this.id,'supp');>Click&#160;for&#160;Supplier&#160;Details</a>"
+"</td>" +"</td>"
// Language List value='"+languageDtl+"' // Language List value='"+languageDtl+"'
...@@ -2353,7 +2362,7 @@ ...@@ -2353,7 +2362,7 @@
+"<input type='hidden' class='editInputClass' name='Detail3."+maxRowId+".language_dtl'" +"<input type='hidden' class='editInputClass' name='Detail3."+maxRowId+".language_dtl'"
+"id='Detail3."+maxRowId+".language_dtl' />" +"id='Detail3."+maxRowId+".language_dtl' />"
+"<a href='#' id='Detail3."+maxRowId+".language_dtl' onclick=openPopup(event,this.id,'lang'); style='color: black'>Click&#160;for&#160;Language&#160;Details</a>" +"<a href='#' id='Detail3."+maxRowId+".language_dtl' onclick=openPopup(event,this.id,'lang'); style='color: black;font-size:12px;'>Click&#160;for&#160;Language&#160;Details</a>"
+"<input type='hidden' class='editInputClass' value='"+language+"' name='Detail3."+maxRowId+".language'" +"<input type='hidden' class='editInputClass' value='"+language+"' name='Detail3."+maxRowId+".language'"
+"id='Detail3."+maxRowId+".language' />" +"id='Detail3."+maxRowId+".language' />"
...@@ -2364,12 +2373,15 @@ ...@@ -2364,12 +2373,15 @@
+"</tr>"; +"</tr>";
$('#SKUItemId tbody').append(row); $('#SKUItemId tbody').append(row);
//document.getElementById("Detail3."+ maxRowId +".editDescr").value = valueFromServlet; //document.getElementById("Detail3."+ maxRowId +".editDescr").value = valueFromServlet;
document.getElementById("Detail3."+ maxRowId +".descr").value = itemParntDescr; document.getElementById("Detail3."+ maxRowId +".descr").value = itemParntDescr;
//document.getElementById("Detail3."+ maxRowId +".descr").innerHTML = itemParntDescr; //document.getElementById("Detail3."+ maxRowId +".descr").innerHTML = itemParntDescr;
document.getElementById("Detail3."+ maxRowId +".language_dtl").value = languageDtl; document.getElementById("Detail3."+ maxRowId +".language_dtl").value = languageDtl;
document.getElementById("Detail3."+ maxRowId +".item_barcode").value = valueFromServlet;
document.getElementById("Detail3."+ maxRowId +".descr").focus(); document.getElementById("Detail3."+ maxRowId +".descr").focus();
// Changed by Sneha on 28-10-2016, for customer item reference [Start] // Changed by Sneha on 28-10-2016, for customer item reference [Start]
var cust_item_ref_status = document.getElementById("cust_item_ref_status").value; var cust_item_ref_status = document.getElementById("cust_item_ref_status").value;
if(cust_item_ref_status == "Y") if(cust_item_ref_status == "Y")
...@@ -2745,4 +2757,23 @@ ...@@ -2745,4 +2757,23 @@
tableObj.rows[i].style.display = "none"; tableObj.rows[i].style.display = "none";
} }
} }
} }
\ No newline at end of file
// Changed by Sneha on 24-11-2016, to auto generate barcode [Start]
function defaultBarcodeFlag()
{
var action = "SET_DEFAULT_BARCODE_FLAG";
var url = "/ibase/ProdWizItemChangeServlet?ACTION="+action;
makeRequestNew( url, "defaultBarcode");
}
function defaultBarcodeVal()
{
var action = "GET_DEFAULT_BARCODE_VAL";
var url = "/ibase/ProdWizItemChangeServlet?ACTION="+action;
makeRequestNew( url, "");
}
// Changed by Sneha on 24-11-2016, to auto generate barcode [End]
\ No newline at end of file
...@@ -863,4 +863,15 @@ ...@@ -863,4 +863,15 @@
document.getElementById("prodWizFormII").action = "/ibase/ProdWizHandlerServlet"; document.getElementById("prodWizFormII").action = "/ibase/ProdWizHandlerServlet";
document.getElementById("prodWizFormII").submit(); document.getElementById("prodWizFormII").submit();
} }
\ No newline at end of file
function doHideMsg(str)
{
document.getElementById(str).style.display = 'none';
}
\ No newline at end of file
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