Commit 5d432b2c authored by vdhoble's avatar vdhoble

domestic receipt changes


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@99476 ce508802-f39f-4f6c-b175-0d175dae99d5
parent a3d2afec
var currentDomName = "";
function onLoadWindow()
{
console.log("calling onLoadWindow!");
document.getElementById("popupFooter").innerHTML = document.getElementById("popupFooter").innerHTML + "Enter-Set Value <b class=\"seperator\">||</b> Esc- Cancel <b class=\"seperator\">||</b> UP & DOWN arrow - Navigation";
var table = document.getElementById("popupTable");
var tableLength = table.rows.length;
......@@ -40,6 +42,9 @@ function onLoadWindow()
document.onkeydown = onKeypressEvent;
function onKeypressEvent(e)
{
var keyID = (window.event) ? event.keyCode : e.keyCode;
......@@ -51,7 +56,9 @@ function onKeypressEvent(e)
var loc = window.location.href;
var pos = loc.indexOf("FIELDNAME=");
var pos1 = loc.indexOf("&OBJ_NAME");
fieldId = loc.substring(pos+10,pos1);
//alert("Field ID == "+fieldId);
parent.closePopWindow(fieldId,false);
return false;
break;
......@@ -69,12 +76,6 @@ function checkEvent( field,e )
var tableLength = table.rows.length;
var keyID = (window.event) ? event.keyCode : e.keyCode;
// alert("keyID :"+keyID);
if(keyID == "" || keyID == null || keyID == "undefined")
{
keyID = 13;
}
// alert("keyID@@@ :"+keyID);
switch (keyID)
{
//Down Key
......@@ -241,18 +242,6 @@ function checkEvent( field,e )
parent.closePopWindow(fieldId,true);
return false;
break;
//Enter doubleclick
case 0:
var loc = window.location.href;
var pos = loc.indexOf("FIELDNAME=");
var pos1 = loc.indexOf("&OBJ_NAME");
fieldId = loc.substring(pos+10,pos1);
domName = fieldId.substring(0,fieldId.lastIndexOf("."));
tableRowField = field.parentNode.parentNode;
parent.setPopValue(tableRowField,domName,fieldId);
parent.closePopWindow(fieldId,true);
return false;
break;
}
return false;
}
......@@ -591,3 +580,339 @@ function setValueInPopUp(xmlStr)
}
}
}
/*var global = new Array(); // final url string
var temp = new Array();
var popImgId ;
function addRow()
{
//alert("global id ==="+document.getElementById("domId").value);
popImgId = document.getElementById("domId").value;
//alert(popImgId);
first = popImgId.indexOf(".");
fname = popImgId.substring(0, pos1);
last = popImgId.lastIndexOf(".");
domIDCurrent = popImgId//parseInt(popImgId.substring(first + 1, last));
//alert("DOM ID CURRENT == "+domIDCurrent);
// input_obj = document.getElementsByTagName('input'); //input_obj = document.getElementsByTagName('input');
// loop through all collected objects
global = [];// emptying the global array
var table = document.getElementById("popupTable");
var tableLength = table.rows.length;
// input_obj = document.getElementsByTagName('input');
input_obj = document.getElementsByClassName('checkboxmain');
for (i = 0; i < input_obj.length ; i++)
{
//alert("table length === "+tableLength+ " input_obj["+i+"].type == "+input_obj[i].type+" input_obj["+i+"].checked value ==="+input_obj[i].checked);
// console.log("id of Selected=>"+input_obj[i].id);
// console.log("table length === "+tableLength+ " input_obj["+i+"].type == "+input_obj[i].type+" input_obj["+i+"].checked value ==="+input_obj[i].checked);
// if input object is checkbox and checkbox is checked then ...
if (input_obj[i].type === 'checkbox' && input_obj[i].checked === true)
{
// alert("Inside IF");
var table = document.getElementById("popupTable");
var curRowId = input_obj[i].id.substring(6);
// console.log("current row id ==== "+curRowId);
curRowId = parseInt(curRowId) + 1;
currentfield = table.rows[curRowId].children[0].children[0];//
// alert("current row id == "+curRowId+" currentfield==="+currentfield+ "refNo==="+table.rows[curRowId].children[1].children[0].value);//+" rcpAmt===="+table.rows[curRowId].children[3].children[0]
refNo = table.rows[curRowId].children[1].children[0];
rcpAmt = table.rows[curRowId].children[4].children[0];
var mergedField = refNo.value+"!@#"+rcpAmt.value;
// alert("Merged Field === "+mergedField);
global.push(mergedField);
}
}
//alert("Array=length==="+global.length);
var maxLineNo = 1;
var domID = 1;
for(var j = 0 ;j < (global.length);j++){
//alert("value of j "+j)
var popupVal = global[j];
temp = popupVal.split("!@#");
var refno = temp[0];
var rcpAmt = temp[1];
var tableParent = parent.document.getElementById("detailTable");
tableLength = tableParent.rows.length;
tableLength = tableLength + 1;
if(j == 0){
for (cnt = 1; cnt < tableLength-1; cnt++)
{
inputField = tableParent.rows[cnt].cells[0].getElementsByTagName("input")[0];
inputFieldID = inputField.id;
pos1 = inputFieldID.indexOf(".");
formId = inputFieldID.substring(0, pos1);
pos = inputFieldID.lastIndexOf(".");
image = tableParent.rows[cnt].cells[2].getElementsByTagName("img")[0];
imageId = image.id;
domID = parseInt(imageId.substring(pos1 + 1, pos));
//alert("Image ID == "+imageId);
alert("Dom ID == " +domID);
currLineNo = parseInt(parent.document.getElementById(formId + "." + domID + ".line_no").value.trim());
refSer = parent.document.getElementById(formId + "." + domID + ".ref_ser").value
//alert("currLineNo>>>>"+currLineNo);
if (currLineNo > maxLineNo)
{
maxLineNo = currLineNo;
}
//alert("insidinggggggg Addition");
// alert("Reference series *** "+refSer);
// alert("DOM ID ==== "+domID);
if(domID == domIDCurrent)
{
// parent.document.getElementById(formId + "." + domID + ".line_no").value = domID;
parent.document.getElementById(formId + "." + domID + ".ref_ser").value = refSer;
parent.document.getElementById(formId + "." + (domID) + ".ref_no").value = refno ;
parent.document.getElementById(formId + "." + domID + ".rcp_amt").value = rcpAmt;
parent.document.getElementById(formId + "." + (domID) + ".status").value = "N";
parent.document.getElementById(formId + "." + (domID) + ".updateFlag").value = "A";
}
}
}//j == 0
else{
++domID ;
//alert("Value of J == "+j+" Dom ID == "+domID);
var appendRow1 = tableParent.rows[tableLength - 2].cloneNode(true);
var table1 = tableParent.rows[0].parentNode;
table1.appendChild(appendRow1);
var rowFields = tableParent.rows[tableLength-1].getElementsByTagName("input");
//alert("rowFields>>>>>>>>>"+rowFields+"******length"+rowFields.length);
for (count = 0; count < rowFields.length; count++)
{
var fieldName = rowFields[count].id;
//alert("fieldName>>>>>>"+fieldName);
//alert("fieldName>>>>>>"+parent.document.getElementById(fieldName));
var pos1 = fieldName.indexOf(".");
formId = fieldName.substring(0, pos1);
pos = fieldName.lastIndexOf(".");
fieldName = fieldName.substring(pos + 1, fieldName.length);
rowFields[count].id = formId + "." + domID + "." + fieldName;
rowFields[count].name = formId + "." + domID + "." + fieldName;
if ( parent.document.getElementsByClassName("imgPopRefSr")[j] != undefined )
{
parent.document.getElementsByClassName("imgPopRefSr")[j].setAttribute("id", formId + "." + domID + ".popRefSer");
}
if ( parent.document.getElementsByClassName("imgPopRefNo")[j] != undefined )
{
parent.document.getElementsByClassName("imgPopRefNo")[j].setAttribute("id", formId + "." + domID + ".popRefNo");
}
if ( parent.document.getElementsByClassName("del")[j] != undefined )
{
parent.document.getElementsByClassName("del")[j].setAttribute("id", formId + "." + domID + ".btn");
}
rowFields[count].disabled = false;
}
var imgFields = tableParent.rows[tableLength - 1].getElementsByTagName("img");
//alert("imgFields>>>>>>>>>"+imgFields+"******length"+imgFields.length);
for (count1 = 0; count1 < imgFields.length; count1++)
{
var fieldNameImg = imgFields[count1].id;
//alert("fieldName>>>>>>"+fieldNameImg);
//alert("fieldName>>>>>>"+parent.document.getElementById(fieldName));
var pos1 = fieldNameImg.indexOf(".");
formId = fieldNameImg.substring(0, pos1);
pos = fieldNameImg.lastIndexOf(".");
//domID = maxLineNo + 1;
// alert("DOM ID == "+domID);
fieldNameImg = fieldNameImg.substring(pos + 1, fieldNameImg.length);
imgFields[count1].id = formId + "." + domID + "." + fieldNameImg;
//imgFields[count1].name = formId + "." + domID + "." + fieldNameImg;
imgFields[count1].disabled = false;
}
parent.document.getElementById(formId + "." + domID + ".line_no").value = domID;
parent.document.getElementById(formId + "." + domID + ".ref_ser").value = refSer;
parent.document.getElementById(formId + "." + (domID) + ".ref_no").value = refno ;
parent.document.getElementById(formId + "." + domID + ".rcp_amt").value = rcpAmt;
parent.document.getElementById(formId + "." + (domID) + ".status").value = "N";
parent.document.getElementById(formId + "." + (domID) + ".updateFlag").value = "A";
try
{
var tempLine_no = " " + domID;
tempLine_no = tempLine_no.substring(tempLine_no.length - 3,
tempLine_no.length);
alert("tempLine_no :"+tempLine_no);
parent.document.getElementById(formId + "." + domID + ".line_no").value = domID;
parent.document.getElementById(formId + "." + domID + ".line_no__ref").value = 1;
parent.document.getElementById(formId + "." + domID + ".rcp_amt").value = rcpAmt;
parent.document.getElementById(formId + "." + domID + ".ref_ser").value = '';
parent.document.getElementById(formId + "." + domID + ".ref_no").value = refno;
var objName = document.getElementById("OBJ_NAME").value;
alert("OBJ NAME******"+objName)
} catch (err)
{
alert("error>>>"+err);
}
parent.document.getElementById(formId + "." + domID + ".dbID").value = parent.document
.getElementById("pkValues").value
+ ":" + domID + ":";
inputElement = tableParent.rows[tableLength - 1].cells[0]
.getElementsByTagName("input")[0];
// alert("inputElement>>>>>"+inputElement);
inputElement.focus();
var element1 = parent.document.createElement("input");
element1.type = "hidden";
element1.name = formId + "." + domID + ".itm_default";
// onBlurFunction(element1);
}
// parent.closePopWindow(imageId,false);
}
alert("Dom id setting in global map.."+domID)
maxlineNoMap["detailTable"] = domID;
alert(maxlineNoMap["detailTable"]);
quitBox();//calling close window
}
*/
function onBlurFunction(field)
{
// alert("field :"+field);
//document.getElementById(field).value = fieldValue.toUpperCase();
if (field != null && ((field.getAttribute("isservercallonchange") != null && field.getAttribute("isservercallonchange") == "true") || field.name .indexOf("itm_default") != -1)) // CHECK FIELD IS SET FOR
// ITEM CHANGE OR NOT
{
//alert("IF!!!!!!!");
isSavePending = true;
createActionEventElement(field);
if (document.getElementById("ACTION") != null)
{
document.getElementById("ACTION").value = "post_item_change";
}
if (document.getElementById("FOCUSED_COL") != null)
{
document.getElementById("FOCUSED_COL").value = field.name;
currentField = field;
}
if (document.getElementById("forcedSave") != null)
{
document.getElementById("forcedSave").value = "false";
}
// window.setTimeout("xmlhttpPost('/ibase/E12SingleTranEditorServlet', 'form1', 'loading')",3000);
// alert("Server Call 2");
xmlhttpPost("/ibase/E12SingleTranEditorServlet", "form1", "");
//**Added new code by sachin on 11/04/14 * in onblur function\\\
/* if(document.getElementById("OBJ_NAME").value=="founditem_cd")
{
this.chkValidFoundData();
setTimeout(function(){document.getElementById("Detail1.1.barcode").focus();}, 1);
}*/
//** End Added new code by sachin on 11/04/14*\\\
}
}
var popRefSerId ;
function enterRefSer()
{
popRefSerId = document.getElementById("domIdRefSer").value;
//alert("ref ser id ="+popRefSerId);
domIDCurrent = popRefSerId//parseInt(popImgId.substring(first + 1, last));
// input_obj = document.getElementsByTagName('input'); //input_obj = document.getElementsByTagName('input');
// loop through all collected objects
global = [];// emptying the global array
var table = document.getElementById("popupTable");
var tableLength = table.rows.length;
// input_obj = document.getElementsByTagName('input');
input_obj = document.getElementsByClassName('radiobutton');
for (i = 0; i < input_obj.length ; i++)
{
if (input_obj[i].type === 'radio' && input_obj[i].checked === true)
{
var table = document.getElementById("popupTable");
var curRowId = input_obj[i].id.substring(8);
// alert("current row id ==== "+curRowId);
curRowId = parseInt(curRowId) + 1;
currentfield = table.rows[curRowId].children[1].children[0].value;//
// alert("current row id == "+curRowId+" currentfield==="+currentfield);//+" rcpAmt===="+table.rows[curRowId].children[3].children[0]
parent.document.getElementById("Detail2" + "." + popRefSerId + ".ref_ser").value = currentfield;
}
}
quitBox();//calling close window
}
function quitBox()
{
//alert("hii");
var tableParent = parent.document.getElementById("detailTable");
image = tableParent.rows[1].cells[2].getElementsByTagName("img")[0];
imageId = image.id;
parent.closePopWindow(imageId,false);
}
\ No newline at end of file
......@@ -6,6 +6,7 @@ var currentField = null;
var addRowCnt=0;
var numbers = /^[0-9.]+$/;
var maxlineNoMap = new Object();
function resizeVideoPage(){
......@@ -35,22 +36,22 @@ function windowOnLoad() // Perform the operation when window transaction page
//alert("pos :"+pos);
if(document.getElementById("Detail1.1.updateFlag").value == 'A')
{
document.getElementById("Detail1.1.chq_amt").value = '0.0';
document.getElementById("Detail2.1.rcp_amt").value = '0.0';
document.getElementById("Detail1.1.chq_amt").value = '0.00';
document.getElementById("Detail2.1.rcp_amt").value = '0.00';
}
else if(document.getElementById("Detail1.1.updateFlag").value == 'N')
{
if(document.getElementById("Detail1.1.chq_amt").value.indexOf(".") < 0)
{
document.getElementById("Detail1.1.chq_amt").value = document.getElementById("Detail1.1.chq_amt").value + '.0';
document.getElementById("Detail1.1.chq_amt").value = document.getElementById("Detail1.1.chq_amt").value + '.00';
}
if(document.getElementById("Detail1.1.exch_rate").value.indexOf(".") < 0)
{
document.getElementById("Detail1.1.exch_rate").value = document.getElementById("Detail1.1.exch_rate").value + '.0';
document.getElementById("Detail1.1.exch_rate").value = document.getElementById("Detail1.1.exch_rate").value + '.00';
}
if(document.getElementById("Detail2.1.rcp_amt").value.indexOf(".") < 0)
{
document.getElementById("Detail2.1.rcp_amt").value = document.getElementById("Detail2.1.rcp_amt").value + '.0';
document.getElementById("Detail2.1.rcp_amt").value = document.getElementById("Detail2.1.rcp_amt").value + '.00';
}
......@@ -163,12 +164,14 @@ function onKeyDownFun(field, e) // Key events for input on fields
break;
// F2 key event code 113
case 113:
/*case 113:
onBlurFunction(field);
alert("field =="+field.name);
popupHelp(field.name, KeyID);
return false;
break;
break;*/
// F6 key event code 117
case 117:
......@@ -210,7 +213,8 @@ function popupHelp(fieldID, KeyID) // Open Popup Logic for the event and field
{
field = document.getElementById(fieldID);
/*alert("field in pophelp"+field);
alert("KeyID == "+KeyID);*/
switch (KeyID)
{
// F9 Key for other calculation
......@@ -253,7 +257,23 @@ function popupHelp(fieldID, KeyID) // Open Popup Logic for the event and field
var pos = getAbsolutePosition(field);
var objName = document.getElementById("OBJ_NAME").value;
//alert("OBJNAME == "+objName);
var fieldName = field.name;
//alert("fieldName == "+fieldName);
//alert("Image ID === "+globalRefID);
pos1 = globalRefID.indexOf(".");
// formId = globalRefID.substring(0, pos1);
pos = globalRefID.lastIndexOf(".");
var popImgId = parseInt(globalRefID.substring(pos1 + 1, pos));
//alert("popImgIdRefSer==="+globalRefSerID);
//var popImgId = fieldName.substring(pos + 1, popImgLen.length);
// alert("popImgId == "+popImgId);
var pos = fieldName.lastIndexOf(".");
fieldName = fieldName.substring(pos + 1, fieldName.length);
keystring = document.getElementById(field.id).value;
......@@ -324,7 +344,7 @@ function popupHelp(fieldID, KeyID) // Open Popup Logic for the event and field
+ field.name
+ "&OBJ_NAME="
+ objName
+ "&KEYSTRING=:SITE_CODE:CUST_CODE&cust_code="+custCode1+"&site_code="+siteCode1+"&fieldName=ref_ser";
+ "&KEYSTRING=:SITE_CODE:CUST_CODE:POPIMGID_REFSER&cust_code="+custCode1+"&site_code="+siteCode1+"&fieldName=ref_ser&popImgIdRefSer="+globalRefSerID;
//+ "&KEYSTRING=:SITE_CODE";
......@@ -334,8 +354,8 @@ function popupHelp(fieldID, KeyID) // Open Popup Logic for the event and field
var custCode = document.getElementById("Detail1.1.cust_code").value;
var siteCode = document.getElementById("Detail1.1.site_code").value;
var index = fieldID.charAt(8);
var refSer = document.getElementById("Detail2."+index+".ref_ser").value;
/*var index = fieldID.charAt(8);*/
var refSer = document.getElementById("Detail2."+popImgId+".ref_ser").value;
//alert("custCode :"+custCode);
//alert("siteCode :"+siteCode);
//alert("refSer :"+refSer);
......@@ -346,7 +366,7 @@ function popupHelp(fieldID, KeyID) // Open Popup Logic for the event and field
+ "&OBJ_NAME="
+ objName
//+ "&KEYSTRING=:SITE_CODE:CUST_CODE&cust_code="+custCode+"&fieldName=ref_no";
+ "&KEYSTRING=:SITE_CODE:CUST_CODE:REF_SER&site_code="+siteCode+"&cust_code="+custCode+"&ref_ser="+refSer+"&fieldName=ref_no";
+ "&KEYSTRING=:SITE_CODE:CUST_CODE:REF_SER:POPIMGID&site_code="+siteCode+"&cust_code="+custCode+"&ref_ser="+refSer+"&fieldName=ref_no&popImgId="+popImgId;
}
......@@ -1043,17 +1063,98 @@ function setCalPopUpValue(domNameParent, domIdParent, parentFieldName,
function addAndRemoveDetail(tableName, flag, field)
{
//alert("flag>>>>"+flag+"tableName>>>>>"+tableName);
var table = document.getElementById(tableName);
var tableDelete = document.getElementById(tableName + "Delete")
tableLength = table.rows.length;
//alert("flag =["+flag+"], tableName =["+tableName+"]");
if(flag == "X")
{
var maxLineNoBfr = 1;
//alert("tableDelete.length =["+tableLength+"]");
for (cnt = 1; cnt <= tableLength-1; cnt++)
{
inputField = table.rows[cnt].cells[0].getElementsByTagName("input")[0];
inputFieldID = inputField.id;
pos1 = inputFieldID.indexOf(".");
formId = inputFieldID.substring(0, pos1);
pos = inputFieldID.lastIndexOf(".");
domID = parseInt(inputFieldID.substring(pos1 + 1, pos));
var currLineNo = parseInt(document.getElementById(formId + "." + domID + ".line_no").value.trim());
// alert("currLineNo =["+currLineNo+"]");
if (currLineNo > maxLineNoBfr)
{
maxLineNoBfr = currLineNo;
}
// alert("currLineNo =["+currLineNo+"]");
}
//maxLineNoBfr = maxLineNo;
maxlineNoMap[tableName] = maxLineNoBfr;
}
if(maxlineNoMap != null && maxlineNoMap[tableName] != undefined )
{
maxLineNoBfr = maxlineNoMap[tableName];
}
//alert("maxLineNoBfr =["+maxLineNoBfr+"]");
if (flag == "R")
{
if (tableLength > 1)
//alert("tableLength>>>>>>>>"+tableLength+"........FLAG == "+flag)
//alert("tableLength =["+tableLength+"]");
if(tableLength == 2)
{
// alert("row id"+ table.rows[tableLength - 1].cells[0].children[0]);
inputField = table.rows[1].cells[1].getElementsByTagName("input")[0];
//alert("inputField"+inputField.id);
//alert(document.getElementById(inputField.id).value);
var maxRowId = table.rows[tableLength - 1].cells[0].children[0].id;
//alert("maxRowId"+maxRowId);
pos1 = maxRowId.indexOf(".");
pos = maxRowId.lastIndexOf(".");
var maxRowId = parseInt(maxRowId.substring(pos1 + 1, pos));
var curRowId = field.parentNode.parentNode.rowIndex;
fieldId = field.id;
pos1 = fieldId.indexOf(".");
pos = fieldId.lastIndexOf(".");
var domId = 1;
formId = fieldId.substring(0, pos1);
fieldName = fieldId.substring(pos + 1, field.id.length);
// Delete row logic
isAdded = false;
//alert("domId =["+domId+"]");
//alert("status ::"+document.getElementById(formId + "." + (domId) + ".status"));
if (document.getElementById(formId + "." + (domId) + ".status").value == "N"
&& document.getElementById(formId + "." + (domId)
+ ".updateFlag").value == "A")
{
isAdded = true;
}
/*document.getElementById(formId + "." + (domId) + ".status").value = "O";
document.getElementById(formId + "." + (domId) + ".updateFlag").value = "D";*/
//alert("DOMID == "+domId)
document.getElementById(formId + "." + domId + ".line_no").value = domId;
document.getElementById(formId + "." + domId + ".line_no__ref").value = 1;
document.getElementById(formId + "." + domId + ".rcp_amt").value = 0.00;
document.getElementById(formId + "." + domId + ".ref_ser").value = '';
document.getElementById(formId + "." + domId + ".ref_no").value = '';
//}
}
if (tableLength > 2)
{
//alert("row id"+ table.rows[tableLength - 1].cells[0].children[0]);
var maxRowId = table.rows[tableLength - 1].cells[0].children[0].id;
//alert("maxRowId"+maxRowId);
pos1 = maxRowId.indexOf(".");
pos = maxRowId.lastIndexOf(".");
var maxRowId = parseInt(maxRowId.substring(pos1 + 1, pos));
......@@ -1066,6 +1167,9 @@ function addAndRemoveDetail(tableName, flag, field)
fieldName = fieldId.substring(pos + 1, field.id.length);
// Delete row logic
isAdded = false;
//alert("domId R=["+domId+"]");
//alert("status R::"+document.getElementById(formId + "." + (domId) + ".status").value);
//alert("updateFlag R::"+document.getElementById(formId + "." + (domId) + ".updateFlag").value);
if (document.getElementById(formId + "." + (domId) + ".status").value == "N"
&& document.getElementById(formId + "." + (domId)
+ ".updateFlag").value == "A")
......@@ -1074,6 +1178,10 @@ function addAndRemoveDetail(tableName, flag, field)
}
document.getElementById(formId + "." + (domId) + ".status").value = "O";
document.getElementById(formId + "." + (domId) + ".updateFlag").value = "D";
//alert("status AFTER R ::"+document.getElementById(formId + "." + (domId) + ".status").value);
//alert("updateFlag AFTER R::"+document.getElementById(formId + "." + (domId) + ".updateFlag").value);
var fieldLength = table.rows[curRowId]
.getElementsByTagName("input").length;
// for drop-down select box deletion
......@@ -1088,6 +1196,7 @@ function addAndRemoveDetail(tableName, flag, field)
table.rows[curRowId].getElementsByTagName("input")[cnt].style.visibility = "hidden";
}
//alert("isAdded =["+isAdded+"]");
if (isAdded)
{
table.deleteRow(curRowId);
......@@ -1119,22 +1228,32 @@ function addAndRemoveDetail(tableName, flag, field)
if (flag == "A")
{
/* Added New Code by Sachin on 11/2/14 for Cash Memo check tableLength is 12*/
/*
if(tableLength<12)
{
{*/
var maxLineNo = 1;
var domID = 1;
for (cnt = 0; cnt < tableLength; cnt++)
//alert("tableLength>>>>>"+tableLength);
tableLength = tableLength + 1;
//alert("tableLength>>>>>"+tableLength);
for (cnt = 1; cnt < tableLength-1; cnt++)
{
inputField = table.rows[cnt].cells[0].getElementsByTagName("input")[0];
//alert("inputField>>>>>"+inputField);
inputFieldID = inputField.id;
//alert("inputFieldID>>>>>>"+inputFieldID);
pos1 = inputFieldID.indexOf(".");
formId = inputFieldID.substring(0, pos1);
//alert("formId>>>>>>"+formId);
pos = inputFieldID.lastIndexOf(".");
domID = parseInt(inputFieldID.substring(pos1 + 1, pos));
// document.getElementById(formId + "." + domID + ".line_no__ref").value = 2;
currLineNo = parseInt(document.getElementById(formId + "." + domID + ".line_no").value.trim());
var currLineNo = parseInt(document.getElementById(formId + "." + domID + ".line_no").value.trim());
//alert("currLineNo>>>>"+currLineNo);
// alert("DOM ID == "+domID);
//alert("currLineNo :"+currLineNo)
//alert(document.getElementById(formId + "." + domID + ".ref_ser").value.trim().length);
//if(document.getElementById(formId + "." + domID + ".ref_ser").value.trim().length())
......@@ -1155,18 +1274,22 @@ function addAndRemoveDetail(tableName, flag, field)
alert("Please enter receipt amount");
return false;
}
if(document.getElementById(formId + "." + domID + ".rcp_amt").value <= 0)
/*if(document.getElementById(formId + "." + domID + ".rcp_amt").value <= 0)
{
alert("Please enter valid receipt amount");
return false;
}
}*/
if (currLineNo > maxLineNo)
{
maxLineNo = currLineNo;
//maxLineNo = currLineNo;
}
}
//alert("tableDelete.length =["+tableDelete.length+"]");
for (cnt = 0; cnt < tableDelete.length; cnt++)
{
inputField = table.rows[cnt].cells[0].getElementsByTagName("input")[0];
......@@ -1179,9 +1302,14 @@ function addAndRemoveDetail(tableName, flag, field)
+ ".line_no").value.trim());
if (currLineNo > maxLineNo)
{
maxLineNo = currLineNo;
//maxLineNo = currLineNo;
}
}
if(parseInt(maxLineNo) < parseInt(maxLineNoBfr))
{
maxLineNo = maxLineNoBfr;
}
//alert("maxLineNo>>>>>>"+maxLineNo);
if (tableLength == 1
&& table.rows[0].cells[0].getElementsByTagName("input")[0].disabled == true)
{
......@@ -1211,150 +1339,142 @@ function addAndRemoveDetail(tableName, flag, field)
} else
{
domID = maxLineNo + 1;
var appendRow1 = table.rows[tableLength - 1].cloneNode(true);
maxlineNoMap[tableName] = domID;
// alert("Dom id in else ..."+domID);
//alert("currLineNo == "+currLineNo);
var appendRow1 = table.rows[tableLength - 2].cloneNode(true);
var table1 = table.rows[0].parentNode;
table1.appendChild(appendRow1);
var rowFields = table.rows[tableLength]
.getElementsByTagName("input");
//alert("DOM ID == "+domID);
var rowFields = table.rows[tableLength - 1].getElementsByTagName("input");
//alert("rowFields>>>>>>>>>"+rowFields+"******length"+rowFields.length);
for (count = 0; count < rowFields.length; count++)
{
var fieldName = rowFields[count].id;
var isPrimaryKey = document.getElementById(fieldName)
.getAttribute("isPrimaryKey");
//alert("fieldName>>>>>>"+fieldName);
//alert("fieldName>>>>>>"+parent.document.getElementById(fieldName));
var pos1 = fieldName.indexOf(".");
formId = fieldName.substring(0, pos1);
pos = fieldName.lastIndexOf(".");
domID = maxLineNo + 1;
//domID = maxLineNo + 1;
// alert("DOM ID == "+domID);
fieldName = fieldName.substring(pos + 1, fieldName.length);
rowFields[count].id = formId + "." + domID + "." + fieldName;
;
rowFields[count].name = formId + "." + domID + "." + fieldName;
/*
if ( document.getElementsByClassName("imgPopRefSr")[count] != undefined )
{
document.getElementsByClassName("imgPopRefSr")[count].setAttribute("id", formId + "." + domID + ".popRefSer");
}
if ( document.getElementsByClassName("imgPopRefNo")[count] != undefined )
{
document.getElementsByClassName("imgPopRefNo")[count].setAttribute("id", formId + "." + domID + ".popRefNo");
}
if ( document.getElementsByClassName("del")[count] != undefined )
{
document.getElementsByClassName("del")[count].setAttribute("id", formId + "." + domID + ".btn");
}*/
rowFields[count].disabled = false;
// newly added if conditions
}
var objName = document.getElementById("OBJ_NAME").value;
if(objName == "porder_cd")
var imgFields = table.rows[tableLength - 1].getElementsByTagName("img");
//alert("imgFields>>>>>>>>>"+imgFields+"******length"+imgFields.length);
for (count1 = 0; count1 < imgFields.length; count1++)
{
var fieldNameImg = imgFields[count1].id;
/* alert("fieldName>>>>>>"+fieldNameImg);
alert("fieldName>>>>>>"+parent.document.getElementById(fieldName));
*/
var pos1 = fieldNameImg.indexOf(".");
formId = fieldNameImg.substring(0, pos1);
pos = fieldNameImg.lastIndexOf(".");
//domID = maxLineNo + 1;
var pordType = document.getElementById("Detail1.1.pord_type").value;
// for trading only first coulmn should be cloned
// alert("DOM ID == "+domID);
fieldNameImg = fieldNameImg.substring(pos + 1, fieldNameImg.length);
imgFields[count1].id = formId + "." + domID + "." + fieldNameImg;
//imgFields[count1].name = formId + "." + domID + "." + fieldNameImg;
// for Jobwork no rows should be cloned
if(pordType.trim() == "J")
{
if (fieldName != "tran_id" && isPrimaryKey != "true")
/*
if ( document.getElementsByClassName("imgPopRefSr")[count] != undefined )
{
rowFields[count].value = "";
}
document.getElementsByClassName("imgPopRefSr")[count].setAttribute("id", formId + "." + domID + ".popRefSer");
}
}
else if(objName != "porder_cd")
{
if (fieldName != "tran_id" && isPrimaryKey != "true")
if ( document.getElementsByClassName("imgPopRefNo")[count] != undefined )
{
rowFields[count].value = "";
document.getElementsByClassName("imgPopRefNo")[count].setAttribute("id", formId + "." + domID + ".popRefNo");
}
if ( document.getElementsByClassName("del")[count] != undefined )
{
document.getElementsByClassName("del")[count].setAttribute("id", formId + "." + domID + ".btn");
}
// end of newly added if conditions
*/
imgFields[count1].disabled = false;
}
document.getElementById(formId + "." + domID + ".status").value = "N";
document.getElementById(formId + "." + domID + ".updateFlag").value = "A";
//alert("domID Add =["+domID+"], maxLineNo =["+maxLineNo+"]");
//alert("status Add ::"+document.getElementById(formId + "." + (domID) + ".status").value);
//alert("updateFlag Add ::"+document.getElementById(formId + "." + (domID) + ".updateFlag").value);
document.getElementById(formId + "." + domID + ".line_no").value = domID;
document.getElementById(formId + "." + domID + ".line_no__ref").value = 1;
document.getElementById(formId + "." + (domID) + ".ref_no").value = '' ;
document.getElementById(formId + "." + domID + ".rcp_amt").value = 0.00;
document.getElementById(formId + "." + (domID) + ".status").value = "N";
document.getElementById(formId + "." + (domID) + ".updateFlag").value = "A";
try
{
var tempLine_no = " " + domID;
tempLine_no = tempLine_no.substring(tempLine_no.length - 3,
tempLine_no.length);
//alert("tempLine_no :"+tempLine_no);
document.getElementById(formId + "." + domID + ".line_no").value = tempLine_no;
document.getElementById(formId + "." + domID + ".line_no").value = domID;
document.getElementById(formId + "." + domID + ".line_no__ref").value = 1;
document.getElementById(formId + "." + domID + ".rcp_amt").value = 0.00;
document.getElementById(formId + "." + domID + ".ref_ser").value = '';
document.getElementById(formId + "." + domID + ".ref_no").value = '';
var objName = document.getElementById("OBJ_NAME").value;
if (objName == "grnentry_cd")
{
document.getElementById(formId + "." + domID+ ".line_no__ord").value = tempLine_no;
document.getElementById(formId + "." + domID + ".FS").value = "FS";
document.getElementById(formId + "." + domID + ".HS").value = "HS";
}
else if (objName == "porder_cd")
{
var pordType = document.getElementById("Detail1.1.pord_type").value;
if(pordType.trim() == "J" || pordType.trim() == "T")
{
document.getElementById(formId + "." + domID + ".FS").value = "FS";
document.getElementById(formId + "." + domID + ".HS").value = "HS";
}
}
else if(objName != "poschg")
{
document.getElementById(formId + "." + domID + ".site_code").value=document.getElementById(formId + ".1.site_code").value
document.getElementById(formId + "." + domID + ".loc_code").value=document.getElementById(formId + ".1.loc_code").value
}
// Add new code on dated 18/01/2014 by sachin
// alert("In aadd remove");
else if(objName="poschg")
{
/* Code Add By Dhanendra for Set Focus on barcode textbox 17Dec2014*/
document.getElementById(formId + "." + domID + ".bar_code").focus();
/* End Code By Dhanendra for Set Focus on barcode textbox 17Dec2014*/
document.getElementById(formId + "." + domID + ".curr_code").value="INR";
}
// End new code on dated 18/01/2014 by sachin
// alert("OBJ NAME******"+objName)
} catch (err)
{
alert("error>>>"+err);
}
// Add new code on dated 18/01/2014 by sachin
if (objName == "denomination")
{
document .getElementById(formId + "." + domID + ".curr_code").value = document .getElementById(formId + ".1.curr_code").value;
document.getElementById(formId + "." + domID + ".std_exrt").value = document .getElementById(formId + ".1.std_exrt").value;
}
// Add new code on dated 18/01/2014 by sachin
document.getElementById(formId + "." + domID + ".dbID").value = document
.getElementById("pkValues").value
+ ":" + domID + ":";
inputElement = table.rows[tableLength].cells[0]
inputElement = table.rows[tableLength - 2].cells[0]
.getElementsByTagName("input")[0];
// alert("inputElement>>>>>"+inputElement);
inputElement.focus();
var element1 = document.createElement("input");
element1.type = "hidden";
element1.name = formId + "." + domID + ".itm_default";
onBlurFunction(element1);
}
// onBlurFunction(element1);
}else
}
/*}else
{
alert("You can add only 12 bar code in cash memo");
}
*/
/* End Added New Code by Sachin on 11/2/14 for Cash Memo check tableLength is 12*/
}
......@@ -1448,7 +1568,6 @@ function isNumberKey(e)
}
function setValueToZero(fieldName)
{
......@@ -1460,17 +1579,17 @@ function setValueToZero(fieldName)
if (fieldValue.length <= 0 && num == -1)
{
document.getElementById(fieldName.name).value = '0.0';
document.getElementById(fieldName.name).value = '0.00';
}
else if(document.getElementById(fieldName.name).value == '0.0' && num == -1)
else if(document.getElementById(fieldName.name).value == '0.00' && num == -1)
{
document.getElementById(fieldName.name).value = '0.0';
document.getElementById(fieldName.name).value = '0.00';
}
else if(num == -1)
{
document.getElementById(fieldName.name).value = document.getElementById(fieldName.name).value+'.0'
document.getElementById(fieldName.name).value = document.getElementById(fieldName.name).value+'.00'
}
}
......@@ -1934,3 +2053,565 @@ function setValueInPopUp(xmlStr)
}
}
}
var globalRefID;
var globalRefSerID;
function callRow(field,flag) // Key events for input on fields
{
//alert("call row>>"+field+"<<<<<<>>>>>>>>"+flag);
isSavePending = false;
var tableName = "detailTable";
if(flag == 'P1')
{
//alert("Flag === "+flag+" field == "+field.id);
globalRefID = field.id;
popFieldID = field.id;
//alert("inputFieldID>>>>>>"+inputFieldID);
posref1 = popFieldID.indexOf(".");
formIdRef = popFieldID.substring(0, posref1);
//alert("formIdRef>>>>>>"+formIdRef);
pos = popFieldID.lastIndexOf(".");
domID = parseInt(popFieldID.substring(posref1 + 1, pos));
globalRefSerID = domID;
var accessField = formIdRef + "." + domID + "." +"ref_ser"
var key = 113;
//var accessField = document.getElementById("popRefSer").lastChild;
//alert(accessField.name);
popupHelp(accessField,key);
}
if(flag == 'P2')
{
//alert("Flag === "+flag+" field == "+field.id);
var key = 113;
globalRefID = field.id;
var accessFieldRefNo = document.getElementById("popRefNo").lastChild;
//alert(accessFieldRefNo.name);
popupHelp(accessFieldRefNo.name,key);
}
if(flag=='A')
{
var KeyID=115;
tableName = "detailTable";
}
if(flag=='R')
{
var KeyID=117;
tableName = "detailTable";
}
table = document.getElementById(tableName);
var tableLength = table.rows.length;
//alert("KeyID>>>>>>>"+KeyID);
switch (KeyID)
{
// F2 key event code 113
/*case 113:
onBlurFunction(field);
popupHelp(field.name, KeyID);
return false;
break;*/
// F6 key event code 117
case 117:
addRowCnt=tableLength-1;
addAndRemoveDetail("detailTable", "R", field);
return false;
break;
// F4 key event code 115
case 115:
addRowCnt=tableLength+1;
addAndRemoveDetail("detailTable", "A", field);
return false;
}
return true;
}
/****pophelp for customer code*****/
function getPopHelpList(icon)
{
var popupParam = icon.getAttribute("CUR_POPUP_PARAM");
//alert(popupParam);
var fldName = icon.getAttribute("CUR_FIELD_NAME");
//alert("fldName == "+fldName);
obj1 = document.getElementById(fldName);
var oldVal;
var coreMdlId=null;
if(popupParam != "")
{
var popUpParamString = popupParam;
//alert("popUpParamString =="+popUpParamString );
var curFieldName = fldName;
//alert("curFieldName == "+curFieldName);
oldVal = document.getElementById( curFieldName ).value;
if ( curFieldName.indexOf(".") != -1 )
{
curFieldName = curFieldName.substring(curFieldName.lastIndexOf(".")+1,curFieldName.length);
}
var urlParamString = "";
if(popUpParamString == "null")
{
urlParamString = "";
}
else
{
var paramFieldArray = popUpParamString.split(":");
////alert("paramFieldArray == "+paramFieldArray);
var objNameTemp = "";
var popUpParamStringTemp = "";
//for(ctr = 1; ctr &lt; paramFieldArray.length; ctr++)
for(ctr = 1; ctr < paramFieldArray.length; ctr++)
{
if( paramFieldArray[ctr].indexOf(".") != -1 )
{
objNameTemp = paramFieldArray[ctr].substring(paramFieldArray[ctr].indexOf(".")+1);
objNameTemp = objNameTemp.substring(objNameTemp.indexOf(".")+1).toLowerCase();
}
urlParamString += objNameTemp + "=" + escape((document.getElementById(paramFieldArray[ctr]) != undefined)?document.getElementById(paramFieldArray[ctr]).value:"")+"&";
popUpParamStringTemp = popUpParamStringTemp + ":" + objNameTemp;
}
}
urlParamString = urlParamString.substring(0, urlParamString.length - 1);
//alert("urlParamString == "+urlParamString)
//alert(popUpParamStringTemp);
var objName ="receipt_gen_wiz";
var url = "/ibase/webitm/jsp/PopUp.jsp?FIELDNAME="+escape(curFieldName)+"&KEYSTRING="+popUpParamStringTemp+"&"+urlParamString+"&CORE_MDL_ID="+coreMdlId+"&OBJ_NAME="+objName;
var fullwidth = eval(screen.width)/2+130;
var fullheight = screen.height - 100;
window.open(url,"","toolbar=no,status=yes,resizable=yes,scrollbars=yes,left=250,top=0,width="+fullwidth+",height="+fullheight);
}
}
function setSignBy()
{
//alert("call setSignBy ");
SIGN_BY="LOCHR";
}
function assignValue(value1)
{
obj1.value=value1;
}
/****pophelp for customer code*****/
var global = new Array(); // final url string
var temp = new Array();
var popImgId ;
function addRow()
{
var tableName = "detailTable";
//alert("global id ==="+document.getElementById("domId").value);
popImgId = document.getElementById("domId").value;
//alert(popImgId);
/*
first = popImgId.indexOf(".");
fname = popImgId.substring(0, pos1);
last = popImgId.lastIndexOf(".");*/
domIDCurrent = popImgId//parseInt(popImgId.substring(first + 1, last));
//alert("DOM ID CURRENT == "+domIDCurrent);
// input_obj = document.getElementsByTagName('input'); //input_obj = document.getElementsByTagName('input');
// loop through all collected objects
global = [];// emptying the global array
var table = document.getElementById("popupTable");
var tableLength = table.rows.length;
// input_obj = document.getElementsByTagName('input');
input_obj = document.getElementsByClassName('checkboxmain');
for (i = 0; i < input_obj.length ; i++)
{
//alert("table length === "+tableLength+ " input_obj["+i+"].type == "+input_obj[i].type+" input_obj["+i+"].checked value ==="+input_obj[i].checked);
// console.log("id of Selected=>"+input_obj[i].id);
// console.log("table length === "+tableLength+ " input_obj["+i+"].type == "+input_obj[i].type+" input_obj["+i+"].checked value ==="+input_obj[i].checked);
// if input object is checkbox and checkbox is checked then ...
if (input_obj[i].type === 'checkbox' && input_obj[i].checked === true)
{
// alert("Inside IF");
var table = document.getElementById("popupTable");
var curRowId = input_obj[i].id.substring(6);
// console.log("current row id ==== "+curRowId);
curRowId = parseInt(curRowId) + 1;
currentfield = table.rows[curRowId].children[0].children[0];//
// alert("current row id == "+curRowId+" currentfield==="+currentfield+ "refNo==="+table.rows[curRowId].children[1].children[0].value);//+" rcpAmt===="+table.rows[curRowId].children[3].children[0]
refNo = table.rows[curRowId].children[1].children[0];
rcpAmt = table.rows[curRowId].children[4].children[0];
var mergedField = refNo.value+"!@#"+rcpAmt.value;
// alert("Merged Field === "+mergedField);
global.push(mergedField);
}
}
//alert("Array=length==="+global.length);
var maxLineNo = 1;
var domID = 1;
var currLineNo = popImgId;
//alert("currLineNo =["+currLineNo+"]");
if (currLineNo > maxLineNoBfr)
{
maxLineNoBfr = currLineNo;
}
var maxLineNo = 1;
var maxLineNoBfr = 1;
for(var j = 0 ;j < (global.length);j++){
//alert("value of j "+j)
var popupVal = global[j];
temp = popupVal.split("!@#");
var refno = temp[0];
var rcpAmt = temp[1];
var tableParent = parent.document.getElementById("detailTable");
tableLength = tableParent.rows.length;
tableLength = tableLength + 1;
if(j == 0){
for (cnt = 1; cnt < tableLength-1; cnt++)
{
inputField = tableParent.rows[cnt].cells[0].getElementsByTagName("input")[0];
inputFieldID = inputField.id;
pos1 = inputFieldID.indexOf(".");
formId = inputFieldID.substring(0, pos1);
pos = inputFieldID.lastIndexOf(".");
image = tableParent.rows[cnt].cells[2].getElementsByTagName("img")[0];
imageId = image.id;
domID = parseInt(imageId.substring(pos1 + 1, pos));
//alert("Image ID == "+imageId);
/*alert("Dom ID == " +domID);*/
currLineNo = parseInt(parent.document.getElementById(formId + "." + domID + ".line_no").value.trim());
refSer = parent.document.getElementById(formId + "." + domID + ".ref_ser").value
//alert("currLineNo>>>>"+currLineNo);
if (currLineNo > maxLineNo)
{
maxLineNo = currLineNo;
}
//alert("insidinggggggg Addition");
// alert("Reference series *** "+refSer);
// alert("DOM ID ==== "+domID);
if(domID == domIDCurrent)
{
// parent.document.getElementById(formId + "." + domID + ".line_no").value = domID;
parent.document.getElementById(formId + "." + domID + ".ref_ser").value = refSer;
parent.document.getElementById(formId + "." + (domID) + ".ref_no").value = refno ;
parent.document.getElementById(formId + "." + domID + ".rcp_amt").value = rcpAmt;
/*parent.document.getElementById(formId + "." + (domID) + ".status").value = "N";
parent.document.getElementById(formId + "." + (domID) + ".updateFlag").value = "A";*/
}
}
}//j == 0
else{
/**************************
* New Logic for line no
*
*/
//alert("tableDelete.length =["+tableLength+"]");
/* for (cnt = 1; cnt <= tableLength-1; cnt++)
{
inputField = table.rows[cnt].cells[0].getElementsByTagName("input")[0];
inputFieldID = inputField.id;
pos1 = inputFieldID.indexOf(".");
formId = inputFieldID.substring(0, pos1);
pos = inputFieldID.lastIndexOf(".");
domID = parseInt(inputFieldID.substring(pos1 + 1, pos));*/
// alert("currLineNo =["+currLineNo+"]");
// }
//maxLineNoBfr = maxLineNo;
if(currLineNo < parent.maxlineNoMap[tableName])
{
domID = parent.maxlineNoMap[tableName];
//alert("New Dom ID :::: "+domID);
}
//alert("New Dom ID ::2222:: "+domID);
maxlineNoMap[tableName] = domID;
// alert("Dom id setting in global map.."+domID)
//maxlineNoMap[tableName] = maxLineNoBfr;
//}
if(maxlineNoMap != null && maxlineNoMap[tableName] != undefined )
{
/*alert("2373");*/
maxLineNoBfr = maxlineNoMap[tableName];
}
//alert("maxLineNoBfr =["+maxLineNoBfr+"]");
//alert("MaxLine No ::: 2401::"+maxLineNo);
if(parseInt(maxLineNo) < parseInt(maxLineNoBfr))
{
maxLineNo = maxLineNoBfr;
}
//alert("MaxLine No ::: 2409::"+maxLineNo);
domID = maxLineNo +1;
/*****************/
//++domID ;
//alert("Value of J == "+j+" Dom ID == "+domID);
var appendRow1 = tableParent.rows[tableLength - 2].cloneNode(true);
var table1 = tableParent.rows[0].parentNode;
table1.appendChild(appendRow1);
var rowFields = tableParent.rows[tableLength-1].getElementsByTagName("input");
//alert("rowFields>>>>>>>>>"+rowFields+"******length"+rowFields.length);
for (count = 0; count < rowFields.length; count++)
{
var fieldName = rowFields[count].id;
//alert("fieldName>>>>>>"+fieldName);
//alert("fieldName>>>>>>"+parent.document.getElementById(fieldName));
var pos1 = fieldName.indexOf(".");
formId = fieldName.substring(0, pos1);
pos = fieldName.lastIndexOf(".");
//alert("DOM ID == "+domID);
fieldName = fieldName.substring(pos + 1, fieldName.length);
rowFields[count].id = formId + "." + domID + "." + fieldName;
rowFields[count].name = formId + "." + domID + "." + fieldName;
/*if ( parent.document.getElementsByClassName("imgPopRefSr")[j] != undefined )
{
parent.document.getElementsByClassName("imgPopRefSr")[j].setAttribute("id", formId + "." + domID + ".popRefSer");
}
if ( parent.document.getElementsByClassName("imgPopRefNo")[j] != undefined )
{
parent.document.getElementsByClassName("imgPopRefNo")[j].setAttribute("id", formId + "." + domID + ".popRefNo");
}
if ( parent.document.getElementsByClassName("del")[j] != undefined )
{
parent.document.getElementsByClassName("del")[j].setAttribute("id", formId + "." + domID + ".btn");
}*/
rowFields[count].disabled = false;
}
var imgFields = tableParent.rows[tableLength - 1].getElementsByTagName("img");
//alert("imgFields>>>>>>>>>"+imgFields+"******length"+imgFields.length);
for (count1 = 0; count1 < imgFields.length; count1++)
{
var fieldNameImg = imgFields[count1].id;
//alert("fieldName>>>>>>"+fieldNameImg);
//alert("fieldName>>>>>>"+parent.document.getElementById(fieldName));
var pos1 = fieldNameImg.indexOf(".");
formId = fieldNameImg.substring(0, pos1);
pos = fieldNameImg.lastIndexOf(".");
//domID = maxLineNo + 1;
//alert("DOM ID == "+domID);
fieldNameImg = fieldNameImg.substring(pos + 1, fieldNameImg.length);
imgFields[count1].id = formId + "." + domID + "." + fieldNameImg;
//imgFields[count1].name = formId + "." + domID + "." + fieldNameImg;
imgFields[count1].disabled = false;
}
parent.document.getElementById(formId + "." + domID + ".line_no").value = domID;
parent.document.getElementById(formId + "." + domID + ".ref_ser").value = refSer;
parent.document.getElementById(formId + "." + (domID) + ".ref_no").value = refno ;
parent.document.getElementById(formId + "." + domID + ".rcp_amt").value = rcpAmt;
parent.document.getElementById(formId + "." + (domID) + ".status").value = "N";
parent.document.getElementById(formId + "." + (domID) + ".updateFlag").value = "A";
/* try
{
var tempLine_no = " " + domID;
tempLine_no = tempLine_no.substring(tempLine_no.length - 3,
tempLine_no.length);
alert("tempLine_no :"+tempLine_no);
parent.document.getElementById(formId + "." + domID + ".line_no").value = domID;
parent.document.getElementById(formId + "." + domID + ".line_no__ref").value = 1;
parent.document.getElementById(formId + "." + domID + ".rcp_amt").value = rcpAmt;
parent.document.getElementById(formId + "." + domID + ".ref_ser").value = '';
parent.document.getElementById(formId + "." + domID + ".ref_no").value = refno;
var objName = document.getElementById("OBJ_NAME").value;
alert("OBJ NAME******"+objName)
} catch (err)
{
alert("error>>>"+err);
}*/
parent.document.getElementById(formId + "." + domID + ".dbID").value = parent.document
.getElementById("pkValues").value
+ ":" + domID + ":";
inputElement = tableParent.rows[tableLength - 1].cells[0]
.getElementsByTagName("input")[0];
// alert("inputElement>>>>>"+inputElement);
inputElement.focus();
var element1 = parent.document.createElement("input");
element1.type = "hidden";
element1.name = formId + "." + domID + ".itm_default";
// onBlurFunction(element1);
}
// parent.closePopWindow(imageId,false);
}
parent.maxlineNoMap[tableName] = domID;
//alert("LAST VALUEEEE >>>"+parent.maxlineNoMap[tableName])
/*maxlineNoMap[tableName] = '';
maxlineNoMap[tableName] = domID;
alert(maxlineNoMap[tableName]);*/
quitBox();//calling close window
}
/********delete row with re index***try by vishakha****/
/*
function deleteReindex(obj)
{
alert("Current row id == "+obj.id);
var delID = obj.id;
first = delID.indexOf(".");
formId = delID.substring(0, first);
last = delID.lastIndexOf(".");
alert("Form Name == "+formId);
domIDCurrent = parseInt(delID.substring(first + 1, last));
alert("Current row deleted"+domIDCurrent);
var table = document.getElementById("detailTable");
tableLength = table.rows.length;
alert("Table Length == "+tableLength);
for (cnt = domIDCurrent; cnt < tableLength; cnt++)
{
alert("CoUNT == "+cnt);
// Delete row logic
isAdded = false;
if (document.getElementById(formId + "." + (cnt) + ".status").value == "N"
&& document.getElementById(formId + "." + (cnt)
+ ".updateFlag").value == "A")
{
isAdded = true;
}
document.getElementById(formId + "." + (cnt) + ".status").value = "O";
document.getElementById(formId + "." + (cnt) + ".updateFlag").value = "D";
if (isAdded)
{
table.deleteRow(cnt);
} else
{
tableDelete.appendChild(table.rows[cnt]);
}
if ( document.getElementById(formId + "." + (cnt+1) + ".line_no").id != undefined )
{
document.getElementById(formId + "." + (cnt+1) + ".line_no").id = formId + "." + cnt + ".line_no";
}
if ( document.getElementById(formId + "." + (cnt+1) + ".line_no").value != undefined )
{
document.getElementById(formId + "." + (cnt+1) + ".line_no").value = cnt;
}
if (document.getElementById(formId + "." + (cnt+1) + ".ref_ser").id != undefined )
{
document.getElementById(formId + "." + (cnt+1) + ".ref_ser").id = formId + "." + cnt + ".ref_ser";
}
if (document.getElementById(formId + "." + (cnt+1) + ".ref_no").id != undefined )
{
document.getElementById(formId + "." + (cnt+1) + ".ref_no").id = formId + "." + cnt + ".ref_no" ;
}
if (document.getElementById(formId + "." + (cnt+1) + ".rcp_amt").id != undefined )
{
document.getElementById(formId + "." + (cnt+1) + ".rcp_amt").id = formId + "." + cnt + ".rcp_amt";
}
if (document.getElementById(formId + "." + (cnt+1) + ".status").id != undefined )
{
document.getElementById(formId + "." + (cnt+1) + ".status").id = formId + "." + cnt + ".status";
}
if (document.getElementById(formId + "." + (cnt+1) + ".updateFlag").id != undefined )
{
document.getElementById(formId + "." + (cnt+1) + ".updateFlag").id = formId + "." + cnt + ".updateFlag";
}
if ( document.getElementsByClassName("imgPopRefSr")[j] != undefined )
{
document.getElementsByClassName("imgPopRefSr")[j].setAttribute("id", formId + "." + domID + ".popRefSer");
}
if ( document.getElementsByClassName("imgPopRefNo")[j] != undefined )
{
document.getElementsByClassName("imgPopRefNo")[j].setAttribute("id", formId + "." + domID + ".popRefNo");
}
if ( document.getElementsByClassName("del")[j] != undefined )
{
document.getElementsByClassName("del")[j].setAttribute("id", formId + "." + domID + ".btn");
}
}
alert("SUCCESS");
}
*/
\ No newline at end of file
<head><script type="text/javascript" src="../js/cd_popquery.js"></script>
<script type="text/javascript">
function myFunction(){
// console.log("MyFunction calling!");
var global = <%=request.getParameter("popImgId")%>
var globalRefSerId = <%= request.getParameter("popImgIdRefSer")%>
// alert("GLOBAL==="+global)
document.getElementById("domId").value = global;
document.getElementById("domIdRefSer").value = globalRefSerId;
// console.log("Calling alikign!");
var inputs =document.getElementsByTagName('input');
// alert(inputs);
for(var ins=0; ins<inputs.length; ins++){
if( !isNaN(inputs[ins].value)){
inputs[ins].style.textAlign = "right";
}}
}
</script></head>
<body onload="myFunction()">
<input type="hidden" name="domId" id = "domId" value='<%=request.getParameter("popImgId")%>' style="width:20px" />
<input type="hidden" name="domIdRefSer" id = "domIdRefSer" value='<%=request.getParameter("popImgId")%>' style="width:20px" />
</body>
<% System.out.println("****In PopUp.jsp****"); %>
<%@page import="ibase.webitm.bean.*, ibase.utility.CommonConstants"%>
<%@page import="ibase.webitm.utility.ITMException"%>
......@@ -15,12 +40,12 @@
{
System.out.println("==========CDPopUp.jsp=================");
// String value1 = request.getParameter("cust_code");
// System.out.println("value1 :"+value1);
String value1 = request.getParameter("cust_code");
System.out.println("value1 :"+value1);
// String value2 = request.getParameter("CUST_CODE");
String value2 = request.getParameter("CUST_CODE");
// System.out.println("value2 :"+value2);
System.out.println("value2 :"+value2);
String objName = null;
if( request.getParameter("OBJ_NAME") != null && ( request.getParameter("OBJ_NAME") != (String)session.getAttribute( "OBJ_NAME" ) ))
......@@ -53,7 +78,7 @@
System.out.println("st :"+st);
}
if(st != null && st.countTokens() > 1)
if( st != null && st.countTokens() > 1 )
{
System.out.println("============IF========");
parameters = new String[ st.countTokens() ];
......@@ -78,7 +103,7 @@
{
System.out.println("=============ELSE===========");
parameters = new String[1];
if( ( keyString != null ) && ( keyString.indexOf(".") != -1 ) )
if( ( keyString != null ) && ( keyString.indexOf( "." ) != -1 ) )
{
keyString = keyString.substring(keyString.indexOf(".")+1);
parameters[0] = request.getParameter(keyString);
......@@ -98,12 +123,16 @@
System.out.println("parameters :"+parameters);
System.out.println("parameters.length :"+parameters.length);
System.out.println("fieldName@@@@@@@ :"+request.getParameter("fieldName"));
System.out.println("Pop IMg Id === "+request.getParameter("popImgId"));
System.out.println("Pop IMg Id for Ref Ser=== "+request.getParameter("popImgIdRefSer"));
// String abc = request.getParameter("popImgId");
if(request.getParameter("fieldName").equals("ref_no"))
{
System.out.println("111"+request.getParameter("cust_code"));
parameters[0]= request.getParameter("site_code");
parameters[1]= request.getParameter("cust_code");
parameters[2]= request.getParameter("ref_ser");
parameters[3]= request.getParameter("popImgId");
}
if(request.getParameter("fieldName").equals("ref_ser"))
......@@ -112,6 +141,7 @@
System.out.println("cust_code :"+request.getParameter("cust_code"));
parameters[0]= request.getParameter("site_code");
parameters[1]= request.getParameter("cust_code");
parameters[2]= request.getParameter("popImgIdRefSer");
}
for(int i = 0; i < parameters.length; i++)
......@@ -134,19 +164,29 @@
}
String retHTMLStr = "";
if (("1").equalsIgnoreCase(CommonConstants.POPUP_TRANSFORM_FLAG) && request.getParameter("fieldName").equals("ref_no"))//prerna 14/04/2006
{
System.out.println("Starting XML Transformation ");
ValidateXMLInput vxi = new ValidateXMLInput();
retHTMLStr = ( new ibase.webitm.utility.GenericUtility() ).transformToString( CommonConstants.APPLICATION_CONTEXT + "webitm" + File.separator + "xsl" + File.separator + "cd_pophelp_chkbox.xsl", xmlString, CommonConstants.APPLICATION_CONTEXT + File.separator + "temp", "output", ".html" );
System.out.println("XML Transformation Completed");
}
else
{
if (("1").equalsIgnoreCase(CommonConstants.POPUP_TRANSFORM_FLAG))//prerna 14/04/2006
{
System.out.println("Starting XML Transformation ");
ValidateXMLInput vxi = new ValidateXMLInput();
retHTMLStr = ( new ibase.webitm.utility.GenericUtility() ).transformToString( CommonConstants.APPLICATION_CONTEXT + "webitm" + File.separator + "xsl" + File.separator + "receipt_popup.xsl", xmlString, CommonConstants.APPLICATION_CONTEXT + File.separator + "temp", "output", ".html" );
// retHTMLStr = ( new ibase.webitm.utility.GenericUtility() ).transformToString( CommonConstants.APPLICATION_CONTEXT + "webitm" + File.separator + "xsl" + File.separator + "cd_popup1.xsl", xmlString, CommonConstants.APPLICATION_CONTEXT + File.separator + "temp", "output", ".html" );
retHTMLStr = ( new ibase.webitm.utility.GenericUtility() ).transformToString( CommonConstants.APPLICATION_CONTEXT + "webitm" + File.separator + "xsl" + File.separator + "cd_popup.xsl", xmlString, CommonConstants.APPLICATION_CONTEXT + File.separator + "temp", "output", ".html" );
System.out.println("XML Transformation Completed");
}
else
{
System.out.println("NO Transformation ");
retHTMLStr = "<html></body><>center>NO DATA FOUND</center></body></html>";
}
}
out.println(retHTMLStr);
}
catch(Exception e)
......
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