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
......@@ -202,7 +202,19 @@
// Changed by Sneha on 25-10-2016, for customer item reference [Start]
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
{
......@@ -536,7 +548,7 @@
// Changed by Sneha on 25-10-2016, for customer item reference [Start]
function setCustItemRef()
{
action = "CUST_ITEM_REF"
var action = "CUST_ITEM_REF";
var url = "/ibase/ProdWizItemChangeServlet?ACTION="+action;
makeRequest( url, "custItemRef");
}
......@@ -567,6 +579,83 @@
// Changed by Sneha on 25-10-2016, for customer item reference [End]
// 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;
......@@ -642,3 +731,9 @@
}
}
}
\ No newline at end of file
......@@ -396,7 +396,7 @@
var cust_item_ref_status = document.getElementById("cust_item_ref_status").value;
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]
......@@ -433,7 +433,7 @@
var cust_item_ref_status = document.getElementById("cust_item_ref_status").value;
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]
......@@ -1996,6 +1996,7 @@
// Changed by Sneha on 30/03/2016, add new item [Start]
function addItem()
{
//alert("----- inside addItem -----");
rowId = maxId;
......@@ -2044,6 +2045,14 @@
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
defaultBarcodeFlag();
//alert("valueFromServlet for defaultBarcodeFlag --->>"+valueFromServlet);
if(valueFromServlet == "Y")
{
defaultBarcodeVal();
//alert("valueFromServlet for defaultBarcodeVal -3333333-->>"+valueFromServlet);
}
//alert("itemCode---"+itemCode);
//itmparntChangeNew(itemCode, "GET_ITEM_DESCR");
......@@ -2211,7 +2220,7 @@
+"<input type='hidden' value='"+tradeMark+"' name='Detail3."+maxRowId+".trade_mark' "
+"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+"');'> "
+ tradeMark
+"</div>"
......@@ -2222,14 +2231,14 @@
+"</td>"
// Tax
+"<td style='text-align:center;'>"
+"<td style='text-align:left;'>"
+"<input type='hidden' name='Detail3."+maxRowId+".tax'"
+"id='Detail3."+maxRowId+".tax' maxlength='10' value='"+tax+"' >"
+"<input type='hidden' name='Detail3."+maxRowId+".tax_descr'"
+"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+"');'>"
+ taxDescr
+"</div>"
......@@ -2247,7 +2256,7 @@
+"<input type='hidden' name='Detail3."+maxRowId+".tax_chap'"
+"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+"');'>"
+ taxChap
+"</div>"
......@@ -2312,7 +2321,7 @@
+"<input type='hidden' value='"+locType+"' name='Detail3."+maxRowId+".loc_type'"
+"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+"');'>"
+ locCode
+"</div>"
......@@ -2329,7 +2338,7 @@
+"<input type='hidden' class='editInputClass' value='"+packSizeDescr+"' name='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>"
// Price List
......@@ -2337,7 +2346,7 @@
+"<input type='hidden' class='editInputClass' value='"+priceListDtl+"' name='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>"
// Supplier List
......@@ -2345,7 +2354,7 @@
+"<input type='hidden' class='editInputClass' name='Detail3."+maxRowId+".supp_item_dtl' "
+"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>"
// Language List value='"+languageDtl+"'
......@@ -2353,7 +2362,7 @@
+"<input type='hidden' class='editInputClass' name='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'"
+"id='Detail3."+maxRowId+".language' />"
......@@ -2364,12 +2373,15 @@
+"</tr>";
$('#SKUItemId tbody').append(row);
//document.getElementById("Detail3."+ maxRowId +".editDescr").value = valueFromServlet;
document.getElementById("Detail3."+ maxRowId +".descr").value = itemParntDescr;
//document.getElementById("Detail3."+ maxRowId +".descr").innerHTML = itemParntDescr;
document.getElementById("Detail3."+ maxRowId +".language_dtl").value = languageDtl;
document.getElementById("Detail3."+ maxRowId +".item_barcode").value = valueFromServlet;
document.getElementById("Detail3."+ maxRowId +".descr").focus();
// Changed by Sneha on 28-10-2016, for customer item reference [Start]
var cust_item_ref_status = document.getElementById("cust_item_ref_status").value;
if(cust_item_ref_status == "Y")
......@@ -2746,3 +2758,22 @@
}
}
}
// 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
......@@ -864,3 +864,14 @@
document.getElementById("prodWizFormII").submit();
}
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