Commit 12cfbc96 authored by cpatil's avatar cpatil

modify for last line not delete


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@101628 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 70cf9f26
...@@ -16,7 +16,7 @@ function resizeVideoPage(){ ...@@ -16,7 +16,7 @@ function resizeVideoPage(){
window.resizeTo(width, height); window.resizeTo(width, height);
window.moveTo(((screen.width - width) / 2), ((screen.height - height) / 2)); window.moveTo(((screen.width - width) / 2), ((screen.height - height) / 2));
} }
function upperCase(fieldId) function upperCase(fieldId)
...@@ -28,7 +28,7 @@ function upperCase(fieldId) ...@@ -28,7 +28,7 @@ function upperCase(fieldId)
} }
function windowOnLoad() // Perform the operation when window transaction page function windowOnLoad() // Perform the operation when window transaction page
// load //load
{ {
//alert("update flag :"+document.getElementById("Detail1.1.updateFlag").value); //alert("update flag :"+document.getElementById("Detail1.1.updateFlag").value);
//alert("chq_amt :"+document.getElementById("Detail1.1.chq_amt").value); //alert("chq_amt :"+document.getElementById("Detail1.1.chq_amt").value);
...@@ -41,18 +41,18 @@ function windowOnLoad() // Perform the operation when window transaction page ...@@ -41,18 +41,18 @@ function windowOnLoad() // Perform the operation when window transaction page
} }
else if(document.getElementById("Detail1.1.updateFlag").value == 'N') else if(document.getElementById("Detail1.1.updateFlag").value == 'N')
{ {
if(document.getElementById("Detail1.1.chq_amt").value.indexOf(".") < 0) /*if(document.getElementById("Detail2.1.chq_amt") == null || document.getElementById("Detail1.1.chq_amt").value.indexOf(".") < 0)
{ {
document.getElementById("Detail1.1.chq_amt").value = document.getElementById("Detail1.1.chq_amt").value + '.00'; 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) if(document.getElementById("Detail2.1.exch_rate") == null || document.getElementById("Detail1.1.exch_rate").value.indexOf(".") < 0)
{ {
document.getElementById("Detail1.1.exch_rate").value = document.getElementById("Detail1.1.exch_rate").value + '.00'; 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) if(document.getElementById("Detail2.1.rcp_amt") == null || document.getElementById("Detail2.1.rcp_amt").value.indexOf(".") < 0)
{ {
document.getElementById("Detail2.1.rcp_amt").value = document.getElementById("Detail2.1.rcp_amt").value + '.00'; document.getElementById("Detail2.1.rcp_amt").value = document.getElementById("Detail2.1.rcp_amt").value + '.00';
} }*/
} }
...@@ -213,7 +213,7 @@ function popupHelp(fieldID, KeyID) // Open Popup Logic for the event and field ...@@ -213,7 +213,7 @@ function popupHelp(fieldID, KeyID) // Open Popup Logic for the event and field
{ {
field = document.getElementById(fieldID); field = document.getElementById(fieldID);
/*alert("field in pophelp"+field); /*alert("field in pophelp"+field);
alert("KeyID == "+KeyID);*/ alert("KeyID == "+KeyID);*/
switch (KeyID) switch (KeyID)
{ {
...@@ -377,7 +377,7 @@ function popupHelp(fieldID, KeyID) // Open Popup Logic for the event and field ...@@ -377,7 +377,7 @@ function popupHelp(fieldID, KeyID) // Open Popup Logic for the event and field
return true; return true;
} }
function getAbsolutePosition(element) // get the absolute position of current function getAbsolutePosition(element) // get the absolute position of current
// element or field //element or field
{ {
var r = { var r = {
x : element.offsetLeft, x : element.offsetLeft,
...@@ -394,6 +394,21 @@ function getAbsolutePosition(element) // get the absolute position of current ...@@ -394,6 +394,21 @@ function getAbsolutePosition(element) // get the absolute position of current
function saveData(field) // save data logic function saveData(field) // save data logic
{ {
var retVal = checkRefNoDuplicate();
//alert("retVal..........["+retVal+"]");
if(! retVal)
{
//alert("Duplcate yupeee...........");
return false;
}
var retVal1 = checkRcpAmount();
//alert("retVal..........["+retVal+"]");
if(! retVal1)
{
//alert("amount exceed...........");
return false;
}
//alert("savedata!zzzz!!"); //alert("savedata!zzzz!!");
//alert("addRowCnt :"+addRowCnt); //alert("addRowCnt :"+addRowCnt);
//alert("field :"+field); //alert("field :"+field);
...@@ -577,7 +592,7 @@ function getquerystring(formname) ...@@ -577,7 +592,7 @@ function getquerystring(formname)
return qstr; return qstr;
} }
// Data save messages handling //Data save messages handling
function showMessage(messageStr) function showMessage(messageStr)
{ {
...@@ -1117,24 +1132,26 @@ function addAndRemoveDetail(tableName, flag, field) ...@@ -1117,24 +1132,26 @@ function addAndRemoveDetail(tableName, flag, field)
//alert(document.getElementById(inputField.id).value); //alert(document.getElementById(inputField.id).value);
var maxRowId = table.rows[tableLength - 1].cells[0].children[0].id; var maxRowId = table.rows[tableLength - 1].cells[0].children[0].id;
//alert("maxRowId"+maxRowId);
pos1 = maxRowId.indexOf("."); pos1 = maxRowId.indexOf(".");
pos = maxRowId.lastIndexOf("."); pos = maxRowId.lastIndexOf(".");
var maxRowId = parseInt(maxRowId.substring(pos1 + 1, pos)); var maxRowId = parseInt(maxRowId.substring(pos1 + 1, pos));
var curRowId = field.parentNode.parentNode.rowIndex; var curRowId = field.parentNode.parentNode.rowIndex;
//alert("maxRowId["+maxRowId+"]curRowId["+curRowId+"]");
fieldId = field.id; fieldId = field.id;
pos1 = fieldId.indexOf("."); pos1 = fieldId.indexOf(".");
pos = fieldId.lastIndexOf("."); pos = fieldId.lastIndexOf(".");
var domId = 1; //var domId = 1;
var domId = maxRowId;
formId = fieldId.substring(0, pos1); formId = fieldId.substring(0, pos1);
fieldName = fieldId.substring(pos + 1, field.id.length); fieldName = fieldId.substring(pos + 1, field.id.length);
// Delete row logic // Delete row logic
isAdded = false; isAdded = false;
//alert("domId =["+domId+"]"); //alert("domId =["+domId+"]");
//alert("status ::"+document.getElementById(formId + "." + (domId) + ".status")); //alert("status ::"+document.getElementById(formId + "." + (domId) + ".status"));
if (document.getElementById(formId + "." + (domId) + ".status").value == "N" if ( document.getElementById(formId + "." + (domId) + ".status") != null &&
&& document.getElementById(formId + "." + (domId) document.getElementById(formId + "." + (domId) + ".status").value == "N"
+ ".updateFlag").value == "A") && document.getElementById(formId + "." + (domId)+ ".updateFlag") != null
&& document.getElementById(formId + "." + (domId)+ ".updateFlag").value == "A")
{ {
isAdded = true; isAdded = true;
} }
...@@ -1142,11 +1159,25 @@ function addAndRemoveDetail(tableName, flag, field) ...@@ -1142,11 +1159,25 @@ function addAndRemoveDetail(tableName, flag, field)
document.getElementById(formId + "." + (domId) + ".updateFlag").value = "D";*/ document.getElementById(formId + "." + (domId) + ".updateFlag").value = "D";*/
//alert("DOMID == "+domId) //alert("DOMID == "+domId)
document.getElementById(formId + "." + domId + ".line_no").value = domId; var cnt1=0;
for (cnt1 = 1; cnt1 <= 100; cnt1++)
{
if( document.getElementById(formId + "." + cnt1 + ".ref_ser") != null )
{
//alert("cnt1 == "+cnt1)
document.getElementById(formId + "." + cnt1 + ".line_no").value = cnt1;
document.getElementById(formId + "." + cnt1 + ".line_no__ref").value = 1;
document.getElementById(formId + "." + cnt1 + ".rcp_amt").value = 0.00;
document.getElementById(formId + "." + cnt1 + ".ref_ser").value = '';
document.getElementById(formId + "." + cnt1 + ".ref_no").value = '';
/* document.getElementById(formId + "." + domId + ".line_no").value = domId;
document.getElementById(formId + "." + domId + ".line_no__ref").value = 1; document.getElementById(formId + "." + domId + ".line_no__ref").value = 1;
document.getElementById(formId + "." + domId + ".rcp_amt").value = 0.00; document.getElementById(formId + "." + domId + ".rcp_amt").value = 0.00;
document.getElementById(formId + "." + domId + ".ref_ser").value = ''; document.getElementById(formId + "." + domId + ".ref_ser").value = '';
document.getElementById(formId + "." + domId + ".ref_no").value = ''; document.getElementById(formId + "." + domId + ".ref_no").value = '';
*/ }
}
//} //}
} }
...@@ -1179,6 +1210,10 @@ function addAndRemoveDetail(tableName, flag, field) ...@@ -1179,6 +1210,10 @@ function addAndRemoveDetail(tableName, flag, field)
document.getElementById(formId + "." + (domId) + ".status").value = "O"; document.getElementById(formId + "." + (domId) + ".status").value = "O";
document.getElementById(formId + "." + (domId) + ".updateFlag").value = "D"; document.getElementById(formId + "." + (domId) + ".updateFlag").value = "D";
document.getElementById(formId + "." + domId + ".rcp_amt").value = 0.00;
document.getElementById(formId + "." + domId + ".ref_ser").value = '';
document.getElementById(formId + "." + domId + ".ref_no").value = '';
//alert("status AFTER R ::"+document.getElementById(formId + "." + (domId) + ".status").value); //alert("status AFTER R ::"+document.getElementById(formId + "." + (domId) + ".status").value);
//alert("updateFlag AFTER R::"+document.getElementById(formId + "." + (domId) + ".updateFlag").value); //alert("updateFlag AFTER R::"+document.getElementById(formId + "." + (domId) + ".updateFlag").value);
...@@ -1475,7 +1510,7 @@ function addAndRemoveDetail(tableName, flag, field) ...@@ -1475,7 +1510,7 @@ function addAndRemoveDetail(tableName, flag, field)
element1.name = formId + "." + domID + ".itm_default"; element1.name = formId + "." + domID + ".itm_default";
// onBlurFunction(element1); // onBlurFunction(element1);
} }
/*}else /*}else
{ {
...@@ -1483,7 +1518,6 @@ function addAndRemoveDetail(tableName, flag, field) ...@@ -1483,7 +1518,6 @@ function addAndRemoveDetail(tableName, flag, field)
} }
*/ */
/* End Added New Code by Sachin on 11/2/14 for Cash Memo check tableLength is 12*/ /* End Added New Code by Sachin on 11/2/14 for Cash Memo check tableLength is 12*/
} }
if (flag == "X") if (flag == "X")
{ {
...@@ -1546,13 +1580,13 @@ function getNextFocusField(formname,currentField) ...@@ -1546,13 +1580,13 @@ function getNextFocusField(formname,currentField)
} }
// Add New function by sachine on dated 18/01/2013 //Add New function by sachine on dated 18/01/2013
// End New function by sachin on dated 18/2014 //End New function by sachin on dated 18/2014
// End new function //End new function
//Added new fucntion by sachin 6/03/13 //Added new fucntion by sachin 6/03/13
...@@ -1944,7 +1978,7 @@ function getUrlVars(domName,field) { ...@@ -1944,7 +1978,7 @@ function getUrlVars(domName,field) {
} }
return vars; return vars;
} }
function onServerCallFun(field) function onServerCallFun(field)
{ {
...@@ -2152,69 +2186,69 @@ function callRow(field,flag) // Key events for input on fields ...@@ -2152,69 +2186,69 @@ function callRow(field,flag) // Key events for input on fields
function getPopHelpList(icon) function getPopHelpList(icon)
{ {
var popupParam = icon.getAttribute("CUR_POPUP_PARAM"); var popupParam = icon.getAttribute("CUR_POPUP_PARAM");
//alert(popupParam); // alert(popupParam);
var fldName = icon.getAttribute("CUR_FIELD_NAME"); var fldName = icon.getAttribute("CUR_FIELD_NAME");
//alert("fldName == "+fldName); // alert("fldName == "+fldName);
obj1 = document.getElementById(fldName); obj1 = document.getElementById(fldName);
var oldVal; var oldVal;
var coreMdlId=null; var coreMdlId=null;
if(popupParam != "") if(popupParam != "")
{ {
var popUpParamString = popupParam; var popUpParamString = popupParam;
//alert("popUpParamString =="+popUpParamString ); // alert("popUpParamString =="+popUpParamString );
var curFieldName = fldName; var curFieldName = fldName;
//alert("curFieldName == "+curFieldName); // alert("curFieldName == "+curFieldName);
oldVal = document.getElementById( curFieldName ).value; oldVal = document.getElementById( curFieldName ).value;
if ( curFieldName.indexOf(".") != -1 ) if ( curFieldName.indexOf(".") != -1 )
{ {
curFieldName = curFieldName.substring(curFieldName.lastIndexOf(".")+1,curFieldName.length); curFieldName = curFieldName.substring(curFieldName.lastIndexOf(".")+1,curFieldName.length);
} }
var urlParamString = ""; var urlParamString = "";
if(popUpParamString == "null") if(popUpParamString == "null")
{ {
urlParamString = ""; urlParamString = "";
} }
else else
{ {
var paramFieldArray = popUpParamString.split(":"); var paramFieldArray = popUpParamString.split(":");
////alert("paramFieldArray == "+paramFieldArray); //// alert("paramFieldArray == "+paramFieldArray);
var objNameTemp = ""; var objNameTemp = "";
var popUpParamStringTemp = ""; var popUpParamStringTemp = "";
//for(ctr = 1; ctr &lt; paramFieldArray.length; ctr++) // for(ctr = 1; ctr &lt; paramFieldArray.length; ctr++)
for(ctr = 1; ctr < paramFieldArray.length; ctr++) for(ctr = 1; ctr < paramFieldArray.length; ctr++)
{ {
if( paramFieldArray[ctr].indexOf(".") != -1 ) if( paramFieldArray[ctr].indexOf(".") != -1 )
{ {
objNameTemp = paramFieldArray[ctr].substring(paramFieldArray[ctr].indexOf(".")+1); objNameTemp = paramFieldArray[ctr].substring(paramFieldArray[ctr].indexOf(".")+1);
objNameTemp = objNameTemp.substring(objNameTemp.indexOf(".")+1).toLowerCase(); objNameTemp = objNameTemp.substring(objNameTemp.indexOf(".")+1).toLowerCase();
} }
urlParamString += objNameTemp + "=" + escape((document.getElementById(paramFieldArray[ctr]) != undefined)?document.getElementById(paramFieldArray[ctr]).value:"")+"&"; urlParamString += objNameTemp + "=" + escape((document.getElementById(paramFieldArray[ctr]) != undefined)?document.getElementById(paramFieldArray[ctr]).value:"")+"&";
popUpParamStringTemp = popUpParamStringTemp + ":" + objNameTemp; popUpParamStringTemp = popUpParamStringTemp + ":" + objNameTemp;
} }
} }
urlParamString = urlParamString.substring(0, urlParamString.length - 1); urlParamString = urlParamString.substring(0, urlParamString.length - 1);
//alert("urlParamString == "+urlParamString) // alert("urlParamString == "+urlParamString)
//alert(popUpParamStringTemp); // alert(popUpParamStringTemp);
var objName ="receipt_gen_wiz"; 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 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 fullwidth = eval(screen.width)/2+130;
var fullheight = screen.height - 100; var fullheight = screen.height - 100;
window.open(url,"","toolbar=no,status=yes,resizable=yes,scrollbars=yes,left=250,top=0,width="+fullwidth+",height="+fullheight); window.open(url,"","toolbar=no,status=yes,resizable=yes,scrollbars=yes,left=250,top=0,width="+fullwidth+",height="+fullheight);
} }
} }
function setSignBy() function setSignBy()
{ {
//alert("call setSignBy "); // alert("call setSignBy ");
SIGN_BY="LOCHR"; SIGN_BY="LOCHR";
} }
function assignValue(value1) function assignValue(value1)
{ {
obj1.value=value1; obj1.value=value1;
} }
...@@ -2229,7 +2263,7 @@ function addRow() ...@@ -2229,7 +2263,7 @@ function addRow()
//alert("global id ==="+document.getElementById("domId").value); //alert("global id ==="+document.getElementById("domId").value);
popImgId = document.getElementById("domId").value; popImgId = document.getElementById("domId").value;
//alert(popImgId); //alert(popImgId);
/* /*
first = popImgId.indexOf("."); first = popImgId.indexOf(".");
fname = popImgId.substring(0, pos1); fname = popImgId.substring(0, pos1);
last = popImgId.lastIndexOf(".");*/ last = popImgId.lastIndexOf(".");*/
...@@ -2276,11 +2310,11 @@ function addRow() ...@@ -2276,11 +2310,11 @@ function addRow()
} }
} }
//alert("Array=length==="+global.length); // alert("Array=length==="+global.length);
var maxLineNo = 1; var maxLineNo = 1;
var domID = 1; var domID = 1;
var currLineNo = popImgId; var currLineNo = popImgId;
//alert("currLineNo =["+currLineNo+"]"); // alert("currLineNo =["+currLineNo+"]");
if (currLineNo > maxLineNoBfr) if (currLineNo > maxLineNoBfr)
{ {
maxLineNoBfr = currLineNo; maxLineNoBfr = currLineNo;
...@@ -2290,7 +2324,7 @@ var currLineNo = popImgId; ...@@ -2290,7 +2324,7 @@ var currLineNo = popImgId;
var maxLineNoBfr = 1; var maxLineNoBfr = 1;
for(var j = 0 ;j < (global.length);j++){ for(var j = 0 ;j < (global.length);j++){
//alert("value of j "+j) //alert("value of j "+j)
...@@ -2396,7 +2430,7 @@ for(var j = 0 ;j < (global.length);j++){ ...@@ -2396,7 +2430,7 @@ for(var j = 0 ;j < (global.length);j++){
//maxlineNoMap[tableName] = maxLineNoBfr; // maxlineNoMap[tableName] = maxLineNoBfr;
//} //}
if(maxlineNoMap != null && maxlineNoMap[tableName] != undefined ) if(maxlineNoMap != null && maxlineNoMap[tableName] != undefined )
...@@ -2457,7 +2491,7 @@ for(var j = 0 ;j < (global.length);j++){ ...@@ -2457,7 +2491,7 @@ for(var j = 0 ;j < (global.length);j++){
var imgFields = tableParent.rows[tableLength - 1].getElementsByTagName("img"); var imgFields = tableParent.rows[tableLength - 1].getElementsByTagName("img");
//alert("imgFields>>>>>>>>>"+imgFields+"******length"+imgFields.length); // alert("imgFields>>>>>>>>>"+imgFields+"******length"+imgFields.length);
for (count1 = 0; count1 < imgFields.length; count1++) for (count1 = 0; count1 < imgFields.length; count1++)
{ {
var fieldNameImg = imgFields[count1].id; var fieldNameImg = imgFields[count1].id;
...@@ -2490,7 +2524,7 @@ for(var j = 0 ;j < (global.length);j++){ ...@@ -2490,7 +2524,7 @@ for(var j = 0 ;j < (global.length);j++){
parent.document.getElementById(formId + "." + domID + ".rcp_amt").value = rcpAmt; parent.document.getElementById(formId + "." + domID + ".rcp_amt").value = rcpAmt;
parent.document.getElementById(formId + "." + (domID) + ".status").value = "N"; parent.document.getElementById(formId + "." + (domID) + ".status").value = "N";
parent.document.getElementById(formId + "." + (domID) + ".updateFlag").value = "A"; parent.document.getElementById(formId + "." + (domID) + ".updateFlag").value = "A";
/* try /* try
{ {
var tempLine_no = " " + domID; var tempLine_no = " " + domID;
tempLine_no = tempLine_no.substring(tempLine_no.length - 3, tempLine_no = tempLine_no.substring(tempLine_no.length - 3,
...@@ -2524,16 +2558,16 @@ for(var j = 0 ;j < (global.length);j++){ ...@@ -2524,16 +2558,16 @@ for(var j = 0 ;j < (global.length);j++){
} }
// parent.closePopWindow(imageId,false); // parent.closePopWindow(imageId,false);
} }
parent.maxlineNoMap[tableName] = domID; parent.maxlineNoMap[tableName] = domID;
//alert("LAST VALUEEEE >>>"+parent.maxlineNoMap[tableName]) // alert("LAST VALUEEEE >>>"+parent.maxlineNoMap[tableName])
/*maxlineNoMap[tableName] = ''; /*maxlineNoMap[tableName] = '';
maxlineNoMap[tableName] = domID; maxlineNoMap[tableName] = domID;
alert(maxlineNoMap[tableName]);*/ alert(maxlineNoMap[tableName]);*/
setCummBalPop(); setCummBalPop();
quitBox();//calling close window quitBox();//calling close window
} }
...@@ -2541,14 +2575,14 @@ function setCummBalPop() ...@@ -2541,14 +2575,14 @@ function setCummBalPop()
{ {
var rcpAmt = 0.00; var rcpAmt = 0.00;
var table = parent.document.getElementById("detailTable"); var table = parent.document.getElementById("detailTable");
tableLength = table.rows.length; tableLength = table.rows.length;
//alert("Table Length == "+tableLength); // alert("Table Length == "+tableLength);
for(cnt = 1;cnt < tableLength ; cnt++) for(cnt = 1;cnt < tableLength ; cnt++)
{ {
inputField = table.rows[cnt].cells[0].getElementsByTagName("input")[0]; inputField = table.rows[cnt].cells[0].getElementsByTagName("input")[0];
...@@ -2576,12 +2610,11 @@ for(cnt = 1;cnt < tableLength ; cnt++) ...@@ -2576,12 +2610,11 @@ for(cnt = 1;cnt < tableLength ; cnt++)
function setCummBal() function setCummBal()
{ {
var rcpAmt = 0.00;
var rcpAmt = 0.00; var table = document.getElementById("detailTable");
var table = document.getElementById("detailTable"); tableLength = table.rows.length;
tableLength = table.rows.length; // alert("Table Length == "+tableLength);
//alert("Table Length == "+tableLength); for(cnt = 1;cnt < tableLength ; cnt++)
for(cnt = 1;cnt < tableLength ; cnt++)
{ {
//alert("cnt>>>>>>>>>>"+cnt) //alert("cnt>>>>>>>>>>"+cnt)
...@@ -2597,8 +2630,6 @@ for(cnt = 1;cnt < tableLength ; cnt++) ...@@ -2597,8 +2630,6 @@ for(cnt = 1;cnt < tableLength ; cnt++)
//alert("DOM ID "+domID); //alert("DOM ID "+domID);
var receiptAmt = document.getElementById("Detail2" + "." + domID + ".rcp_amt").value ; var receiptAmt = document.getElementById("Detail2" + "." + domID + ".rcp_amt").value ;
var rcpAmt = parseInt(rcpAmt) + parseInt(receiptAmt); var rcpAmt = parseInt(rcpAmt) + parseInt(receiptAmt);
//alert(rcpAmt); //alert(rcpAmt);
...@@ -2611,6 +2642,116 @@ for(cnt = 1;cnt < tableLength ; cnt++) ...@@ -2611,6 +2642,116 @@ for(cnt = 1;cnt < tableLength ; cnt++)
} }
function checkRefNoDuplicate()
{
var refNoArray = new Array();
var cnt=0;
var table = document.getElementById("detailTable");
tableLength = table.rows.length;
// alert("Table Length == "+tableLength);
for(cnt = 1;cnt < tableLength ; cnt++)
{
//alert("cnt>>>>>>>>>>"+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));
//alert("DOM ID "+domID);
var refNo = document.getElementById("Detail2" + "." + domID + ".ref_no").value ;
var lineNo = document.getElementById("Detail2" + "." + domID + ".line_no").value ;
var status = document.getElementById("Detail2" + "." + domID + ".status").value;
var updateFlag = document.getElementById("Detail2" + "." + domID + ".updateFlag").value;
//alert("lineNo["+lineNo+"]refNo["+refNo+"]status["+status+"]updateFlag["+updateFlag+"]");
if( refNo != null )
{
var index = -1;
index = refNoArray.indexOf(refNo.trim());
//alert("refNo["+refNo+"]>>>>refNoArray["+refNoArray+"]::>>>index["+index+"]");
//if( index == null || index == "" || index < 0 || index == -1 )
/*if( index < 0 || index == -1 )
{
index = -1
}*/
//alert("=======>>>> index ["+index+"]");
//if( index == null || index == "" || index < 0 || index == -1 )
if( index < 0 || index == -1 )
{
//alert("addd.........");
refNoArray[refNoArray.length] = refNo.trim();
}
else
{
//alert("duplicate found............");
alert("Duplicate reference no ["+refNo.trim()+"]...");
return false;
}
}
}
return true;
}
function checkRcpAmount()
{
var totalRcpAmt = 0;
var cnt=0;
var table = document.getElementById("detailTable");
tableLength = table.rows.length;
// alert("Table Length == "+tableLength);
//var chkAmt = document.getElementById("Detail1" + "." + domID + ".chq_amt").value ;
var chqAmt = document.getElementById("Detail1.1.chq_amt").value ;
//alert("@@@@@@@@ chqAmt["+chqAmt+"]");
if( isNaN(chqAmt))
{
chqAmt = 0;
}
for(cnt = 1;cnt < tableLength ; cnt++)
{
//alert("cnt>>>>>>>>>>"+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));
//alert("DOM ID "+domID);
var rcpAmt = document.getElementById("Detail2" + "." + domID + ".rcp_amt").value ;
if( isNaN(rcpAmt))
{
rcpAmt = 0;
}
//alert("cnt["+cnt+"]===>>> rcpAmt["+rcpAmt+"]");
totalRcpAmt = eval(totalRcpAmt) + eval(rcpAmt);
}
//alert("totalRcpAmt ["+totalRcpAmt+"] > chqAmt ["+chqAmt+"]");
if( totalRcpAmt > chqAmt )
{
//alert("duplicate found............");
alert("Receipt Amount is greater then cheque amount.. ["+totalRcpAmt+"]...");
return false;
}
return true;
}
/********delete row with re index***try by vishakha****/ /********delete row with re index***try by vishakha****/
/* /*
function deleteReindex(obj) function deleteReindex(obj)
...@@ -2694,4 +2835,4 @@ alert("Table Length == "+tableLength); ...@@ -2694,4 +2835,4 @@ alert("Table Length == "+tableLength);
} }
alert("SUCCESS"); alert("SUCCESS");
} }
*/ */
\ No newline at end of file \ 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