- TECH_ARCHITECTURE.md: technical blueprint for the new platform - AI_LAYER_DESIGN_NOTES.md: AI agent, event/action, SQL and audit design - Axpert 11.2 web runtime source, structure exports and release notes (reference) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 line
47 KiB
JavaScript
1 line
47 KiB
JavaScript
/*https://web.agile-labs.com/minZIP/*//*version=3.9.1*/function _typeof(e){"@babel/helpers - typeof";return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var expressiontype="",prerow="",frmno="",expFldname="",rno=0,rowno="",constword=!1,wordstring="",wordtype="c",brackets="",bcount=0,wordlist=new Array,p=0,z=0,params=new Array,pos,varlist=new Array,valuelist=new Array,funclist=new Array,enc64List,dec64List;function CallFunction(e,t){if("length"==e||"getlength"==e)result="n"+Length(t[0]);else if("substr"==e)result="s"+SubStr(t[0],t[1],t[2]);else if("abs"==e)result="n"+PAbs(t[0]);else if("iif"==e){var r=IfFun(t[0],t[1],t[2]);result=isNaN(r)?"s"+r:"n"+r}else if("findcharpos"==e)result="n"+FindCharPos(t[0],t[1]);else if("chkuniqchar"==e)result="s"+ChkUniqChar(t[0]);else if("trimall"==e||"trim"==e)result="s"+TrimAll(t[0]);else if("extractnum"==e)result="n"+ExtractNum(t[0]);else if("mods"==e)result="n"+Mods(t[0],t[1]);else if("lastdayofmonth"==e)result="d"+LastDayOfMonth(t[0]);else if("daysinmonth"==e)result="n"+DaysInMonth(t[0],t[1]);else if("validencodedate"==e)result="d"+ValidEncodeDate(t[0],t[1],t[2]);else if("getinteger"==e)result="n"+GetInteger(t[0]);else if("addtomonth"==e)result="d"+AddToMonth(t[0],t[1]);else if("addtodate"==e)result="d"+AddToDate(t[0],t[1]);else if("timeelapsed"==e)result="s"+TimeElapsed(t[0],t[1]);else if("dayselapsed"==e)result="n"+DaysElapsed(t[0],t[1]);else if("mandy"==e)result="s"+MandY(t[0]);else if("findandreplace"==e)result="s"+FindAndReplace(t[0],t[1],t[2]);else if("removecommas"==e)result="s"+removeCommas(t[0]);else if("getnthstring"==e)result="s"+GetNthString(t[0],t[1]);else if("roundoff"==e||"round"==e)result="n"+RoundOff(t[0],t[1]);else if("insertcommas"==e)result="n"+InsertCommas(t[0]);else if("leftpad"==e)result="s"+LeftPad(t[0],t[1],t[2]);else if("rightpad"==e)result="s"+RightPad(t[0],t[1],t[2]);else if("pad"==e)result="s"+Pad(t[0],t[1],t[2]);else if("getseperatorcount"==e)result="n"+GetSeperatorCount(t[0],t[1]);else if("val"==e)result="n"+Val(t[0]);else if("str"==e)result="s"+Str(t[0]);else if("uppercase"==e||"upper"==e)result="s"+UpperCase(t[0]);else if("lowercase"==e||"lower"==e)result="s"+LowerCase(t[0]);else if("isvarempty"==e)result="s"+IsVarEmpty(t[0]);else if("getvarvalue"==e)result="s"+GetVarValue(t[0]);else if("amtword"==e)result="s"+Amt_Word(t[0]);else if("evaluatepower"==e)result="n"+EvaluatePower(t[0],t[1]);else if("infixtopostfix"==e)result="s"+InfixToPostfix(t[0]);else if("postfixtoinfix"==e)result="s"+PostfixToInfix(t[0]);else if("postfixeval"==e)result="n"+PostfixEval(t[0]);else if("inputprecedence"==e)result="n"+InputPrecedence(t[0]);else if("stackprecedence"==e)result="n"+StackPrecedence(t[0]);else if("isoperator"==e)result="s"+ISOperator(t[0]);else if("encode"==e)result="s"+Encode(t[0]);else if("decode"==e)result="s"+Decode(t[0]);else if("dtoc"==e)result="s"+DTOC(t[0]);else if("ctod"==e)result="d"+CTOD(t[0]);else if("cmonthyear"==e)result="d"+CMonthYear(t[0]);else if("stuff"==e)result="s"+Stuff(t[0],t[1],t[2]);else if("rnd"==e)result="n"+Rnd(t[0],t[1]);else if("isemptyvalue"==e)result="s"+IsEmptyValue(t[0],t[1]);else if("formatval"==e)result="n"+FormatVal(t[0],t[1]);else if("formataccamount"==e)result="n"+FormatAccAmount(t[0],t[1],t[2],t[3],t[4]);else if("formatamount"==e)result="n"+FormatAmount(t[0],t[1],t[2],t[3],t[4]);else if("triminbetwnspaces"==e)result="s"+TrimInbetwnSpaces(t[0]);else if("date"==e)result="d"+TodaysDate();else if("time"==e)result="s"+Time();else if("isempty"==e)result="s"+ISEMPTY(t[0]);else if("datediff"==e)result="n"+DateDiff(t[0],t[1]);else if("checkemail"==e)result="s"+CheckEmail(t[0]);else if("convertmd5"==e)result="s"+MD5(t[0]);else if("total"==e)result="n"+Total(t[0]);else if("curramtword"==e)result="s"+CurrAmtWord(t[0],t[1],t[2],t[3],t[4]);else if("str"==e)result="s"+str(t[0]);else if("getvalue"==e){var n="undefined"!=typeof t[2]&&t[2];result=GetGridCellValue(t[0],t[1],n)}else"makedate"==e?result="d"+makedate(t[0],t[1],t[2]):"getallvalues"==e?result="s"+GetAllValues(t[0],t[1]):"dayofdate"==e?result="n"+DayOfDate(t[0]):"yearofdate"==e?result="n"+YearOfDate(t[0]):"monthofdate"==e?result="n"+MonthOfDate(t[0]):"getmin"==e?result="n"+GetMinValue(t[0]):"getmax"==e?result="n"+GetMaxValue(t[0]):"getrowcount"==e?result="n"+GetRowCount(t[0]):"sumtill"==e?(isSumTillGrid!=undefined&&(isSumTillGrid=!0),result="n"+SumTill(t[0],t[1],t[2],t[3],t[4])):"sum"==e?result="n"+Sum(t[0],t[1],t[2]):"regvar"==e?result="s"+RegisterVariables(t[0],t[1],t[2]):"getrow"==e?result="n"+GetRow(t[0],t[1],t[2]):"getsubtotal"==e?result="n"+SubTotal(t[0],t[1]):"getmod"==e?result="n"+GetMod(t[0],t[1]):"getold"==e?result="s"+GetOld(t[0],t[1]):"ceil"==e||"axpceil"==e?result="n"+AxCeil(t[0]):"floor"==e||"axpfloor"==e?result="n"+AxFloor(t[0]):"networkdays"==e?result="n"+NetworkDays(t[0],t[1],t[2]):"days360"==e?result="n"+Days360(t[0],t[1],t[2]):"setfont"==e?result="s"+SetAxFont(t[0],t[1],t[2],t[3]):"axhidecontrols"==e?result="s"+AxHideControls(t[0]):"axunhidecontrols"==e?result="s"+AxUnhideControls(t[0]):"axenablecontrols"==e?result="s"+AxEnableControls(t[0]):"axdisablecontrols"==e?result="s"+AxDisableControls(t[0]):"setvalue"==e?result="s"+AxSetValue(t[0],t[1],t[2]):"axvalueexits"==e?result="n"+AxValueExits(t[0],t[1],t[2],t[3]):"axaddrow"==e?result="s"+AxAddRow(t[0]):"loadform"==e?result="s"+LoadForm(t[0],t[1],t[2],t[3]):"loadformanddata"==e?result="s"+LoadFormAndData(t[0],t[1],t[2],t[3]):"loadiview"==e?result="s"+LoadIView(t[0],t[1],t[2],t[3]):"loadpage"==e?result="s"+LoadPage(t[0],t[1],t[2],t[3]):"openpage"==e&&(result="s"+OpenPage(t[0],t[1],t[2],t[3]));return result}function SetAxFont(e,t,r,n){var a,l="";if(a=GetDcNo(e),parseInt(a,10)>0){if("true"==DCIsGrid[a-1].toLowerCase()){var i=parseInt(GetDcRowCount(a),10);if(i>0)if(applyFontListView)for(var s=0;s<i;s++)l=e+GetClientRowNo(s+1,a)+"F"+a,SetAxFontCondition($("#"+l),t?r:n);else l=e+GetRowNoHelper(AxActiveRowNo)+"F"+a,SetAxFontCondition($("#"+l),t?r:n)}else l=e+"000"+"F"+a,SetAxFontCondition($("#"+l),t?r:n)}return"MessageSetAxFont"}function SetAxFontCondition(e,t){if(""!=t){ResetAxFont(e),t=t.split(",");for(var r=0;r<t.length;r++){var n=t[r].split("=");switch(n[0].toLowerCase()){case"fontname":e.css("font-family",n[1]);break;case"fontsize":e.css("font-size",n[1]+"pt");break;case"fontstyle":for(var a=0;a<n[1].toLowerCase().length;a++)switch(n[1].toLowerCase()[a]){case"b":e.css("font-weight","bold");break;case"i":e.css("font-style","italic");break;case"u":"line-through"==e.css("text-decoration")?e.css("text-decoration","line-through underline"):e.css("text-decoration","underline");break;case"s":"underline"==e.css("text-decoration")?e.css("text-decoration","underline line-through"):e.css("text-decoration","line-through")}break;case"fontcolor":"undefined"!=typeof isSpecialRow&&isSpecialRow?e.css("color",n[1]):e.css("color",AxClColors[n[1]]);break;case"backcolor":AxClColors[n[1]]?e.css("background",AxClColors[n[1]]):0==n[1].indexOf("#")?e.css("background",n[1]):e.css("background","")}}}else ResetAxFont(e)}function ResetAxFont(e){e.css("font-family",""),e.css("font-weight",""),e.css("font-style",""),e.css("text-decoration",""),e.css("color",""),e.css("background","")}function GetOld(e,t){var r="",n=GetDcNo(e),a=e+GetRowNoHelper(t)+"F"+n,l=$j.inArray(a,FldLoadedFields);return-1!=l&&(r=FldLoadedValues[l]),r}function CheckEval(e,t){if("eval("==e.substring(0,5).toLowerCase()){isEvalGrid=!0;var r,n=e.substring(5,e.indexOf(")"));if(-1!=(r=GetFieldIndex(n))&&(n=FNames[r].toString()),n=n+t+"F"+GetDcNo(n),document.getElementById(n)){if("select-one"==document.getElementById(n).type){var a=document.getElementById(n).selectedIndex;return document.getElementById(n).options[a].value}return document.getElementById(n).value}return""}return e}function Evaluate(a,b,Expstr,exprtype,fromIview){""!=Expstr&&(Expstr=Expstr.replace(/♦/g,",")),expressiontype=exprtype,prerow=b;var i=0,tem="";varlist=new Array,valuelist=new Array,wordlist=new Array;var w=0;expFldname=a;var trid=transid,fIndx=a.lastIndexOf("F");-1!=fIndx&&(rowno=a.substring(fIndx-3,a.length));var curActiveRowNo=0;"undefined"!=typeof AxActiveRowNo&&(curActiveRowNo=parseInt(AxActiveRowNo));var activerowno=0==curActiveRowNo?parseInt(a.substring(fIndx-3,fIndx),10):curActiveRowNo;rno=rowno.substring(0,3),rno=parseInt(rno),frmno=rowno.substring(rowno.length-1,rowno.length),Expstr=CheckEval(Expstr,b);var expression=Expstr;if(Parameters.length>1)for(var pki=0;pki<Parameters.length;pki++){var list=Parameters[pki].toString();list=list.split("~"),varlist[w]=list[0].toString(),valuelist[w]=list[1].toString(),w++}varlist[w]="activerow",valuelist[w]=activerowno;var tempvar=new Array,tempval=new Array,vi=0,ji=0,Isfound=!1,tempcount=0;expression=TrimAll(expression),expression+=" ";for(var ch=expression.split(""),j=0;j<ch.length;j++)if("{"!=ch[j])if("}"!=ch[j])if(constword)wordstring+=ch[j];else{var t;if(isDelimiter(ch[j])||isOperator(ch[j])){var chrstate=!1;tem=wordstring,tem=tem.toLowerCase();var temp2="";if(""!=tem&&isNaN(tem)){var templ="";if(isNaN(rowno.substring(rowno.length-1,rowno.length))||"activerow"==tem||"activeprow"==tem.toString())"activerow"==tem?(templ=activerowno,wordlist[i]="n"+templ,i++,wordstring=""):"activeprow"==tem?(templ=GetClientRowNo(AxActivePRow,AxActivePDc),wordlist[i]="n"+templ.replace(/^0+/,""),i++,wordstring=""):templ=wordstring;else{var dcNo=GetDcNo(wordstring);if(fromIview==undefined&&(wordstring=GetExactFieldName(wordstring)),templ=wordstring+"000F"+dcNo,temp2=wordstring,document.getElementById(templ))templ=templ;else{var dcNo=GetDcNo(wordstring),clientRow="";IsDcPopGrid(dcNo)?(clientRow=GetClientRowNo(AxActiveRowNo,AxActiveDc),templ=wordstring+clientRow+"F"+AxActiveDc):TstructHasPop&&IsDcParentGrid(dcNo)?""!=AxActivePRow&&""!=AxActivePDc?(clientRow=GetClientRowNo(AxActivePRow,AxActivePDc),templ=wordstring+clientRow+"F"+AxActivePDc):(clientRow=GetClientRowNo(AxActiveRowNo,AxActiveDc),templ=wordstring+clientRow+"F"+AxActiveDc):templ=wordstring+rowno,document.getElementById(templ)?templ=templ:"Iview"==document.title||void 0!==fromIview&&"table"==fromIview||(templ=wordstring+b+"F"+AxActiveDc)}}var elevalue="";if(document.getElementById(templ)&&"activerow"!=tem){if(chrstate=!0,elevalue=fromIview!=undefined?document.getElementById(templ).value:GetFieldValue(templ),"select-one"==document.getElementById(templ).type){var fldValSplit=elevalue.split(",,");elevalue=fldValSplit[0]}else if("checkbox"==document.getElementById(templ).type){var isGrid=IsGridField(temp2),chkboxValues=document.getElementById(templ).alt,chkboxVal=chkboxValues.split(",");chkboxVal=$j.grep(chkboxVal,function(e){return e}),document.getElementById(templ).checked&&(elevalue=chkboxVal.length>1?1==isGrid?chkboxVal[0].toString():"T":1==isGrid?chkboxVal[1].toString():""!=document.getElementById(templ).value&&"T"==document.getElementById(templ).value?"T":"F")}elevalue+="";var fldInd=$j.inArray(wordstring,FNames),fldDType="";-1!=fldInd&&(fldDType=FDataType[fldInd].toString()),""!=fldDType?"Date/Time"==fldDType?s="d"+elevalue:"Character"==fldDType?s="s"+elevalue:("Numeric"==fldDType&&elevalue.length>3&&-1!=elevalue.indexOf(",")&&(elevalue=removeCommas(document.getElementById(templ).value)),""==elevalue&&(elevalue=0),s="n"+elevalue,1==s.length&&(s="n0")):isNaN(elevalue)?s="s"+elevalue:(""==elevalue&&(elevalue=0),elevalue=elevalue,s="n"+elevalue,1==s.length&&(s="n0")),wordlist[i]=s,i++}else if("undefined"!=typeof ChangedTblFields&&-1!=$j.inArray(templ,ChangedTblFields)){chrstate=!0;var fldTblIndex=$j.inArray(templ,ChangedTblFields),tblVal=ChangedTblFieldVals[fldTblIndex].split("~");tblVal=tblVal[b],void 0===tblVal&&(tblVal=""),s=-1!=tblVal.indexOf("/")?"d"+tblVal:isNaN(tblVal)||""==tblVal?"s"+tblVal:"n"+tblVal,wordlist[i]=s,i++}else{templ=wordstring;for(var k=0;k<varlist.length;k++)if(templ==varlist[k].toLowerCase()){chrstate=!0,elevalue=valuelist[k];var dtlenth=elevalue.split("/");2==dtlenth[0].length&&"undefined"!=typeof dtlenth[1]&&2==dtlenth[1].length&&"undefined"!=typeof dtlenth[2]&&4==dtlenth[2].length?s="d"+elevalue:isNaN(elevalue)?s="s"+elevalue:(""==elevalue&&(elevalue=0),elevalue=elevalue,s="n"+elevalue,1==s.length&&(s="n0")),wordlist[i]=s,i++;break}if(!chrstate&&"undefined"!=typeof RegVarFldList&&RegVarFldList.length>0&&$.each(RegVarFldList,function(e,t){if(t.startsWith(templ+":"))return chrstate=!0,wordlist[i]=t.split(":")[1]+t.split(":")[2],void i++}),!chrstate&&"undefined"!=typeof paramValuesArray&&Object.keys(paramValuesArray).length>0){var valueArr=getCaseInSensitiveJsonProperty(paramValuesArray,templ);if(valueArr.length>0){chrstate=!0,elevalue=valueArr[0];var dtlenth=elevalue.split("/");2==dtlenth[0].length&&"undefined"!=typeof dtlenth[1]&&2==dtlenth[1].length&&"undefined"!=typeof dtlenth[2]&&4==dtlenth[2].length?s="d"+elevalue:isNaN(elevalue)?s="s"+elevalue:(""==elevalue&&(elevalue=0),elevalue=elevalue,s="n"+elevalue,1==s.length&&(s="n0")),wordlist[i]=s,i++}}}}for(var r=0;r<funclist.length;r++)if(wordstring.toLowerCase()==funclist[r].toString().toLowerCase()){chrstate=!0,s="f"+funclist[r],wordlist[i]=s,i++;break}chrstate||""!=wordstring&&(t=isNaN(wordstring)?"s":"n",wordlist[i]=t+wordstring,i++),wordstring=""}if("("!=ch[j])")"!=ch[j]?isOperator(ch[j])?(wordlist[i]="o"+ch[j],i++):" "!=ch[j]&&(","!=ch[j]?wordstring+=ch[j]:(wordlist[i]="l,",i++,wordstring="")):("("==brackets.charAt(brackets.length-1)?(wordlist[i]="b)",i++):(wordlist[i]="e",i++),brackets=brackets.slice(0,-1));else{if(wordlist.length>0){var fchar=wordlist[wordlist.length-1];fchar=fchar.substr(0,1),brackets+="f"==fchar?"f":"("}else brackets+="(";wordlist[i]="b(",i++}}else 1==bcount?(constword=!1,s="c"+wordstring,wordlist[i]=s,i++,bcount=0,wordstring=""):(bcount--,wordstring+=ch[j]);else bcount>0?wordstring+=ch[j]:(constword=!0,wordstring=""),bcount++;for(var fun=!0,i=0;i<wordlist.length;i++)"sFIELDCHANGED"!=wordlist[i]&&"sfieldchanged"!=wordlist[i].toString().toLowerCase()||(fun=!1);if(fun){EvalFun();var s=GetExprString();if(""==s)return"";try{var res=eval(s)}catch(ex){try{var res=eval("'"+s+"'")}catch(exp){res=""}}return"Infinity"==res&&(res=0),res}return!0}function EvalFun(){for(var i=wordlist.length-1;i>=0;i--){ch=wordlist[i];var strch=ch;ch=ch.split("");var firstchar=ch[0],EvalString="",EvalType="",ExtEvalString="",EvalResult="",ParamIndx=0;if("f"==firstchar){for(delete wordlist[i+1],j=i+2,exprEvalFun="",functionname=strch.substr(1,strch.length),functionname=functionname.toLowerCase();"e"!=wordlist[j];){var value="";if(""!=wordlist[j]&&null!=wordlist[j])if(ch=wordlist[j],strch=ch,ch=ch.split(""),firstchar=ch[0],value=strch.substr(1,strch.length),"b("==wordlist[j])EvalType="",ExtEvalString+="(";else if("b)"==wordlist[j])""!=ExtEvalString?(EvalResult=GetEvalResult(EvalString,EvalType),ExtEvalString=ExtEvalString+EvalResult+")"):(EvalString+=")",EvalResult=GetEvalResult(EvalString,EvalType)),EvalString="",EvalType="";else if("o<"==wordlist[j]||"o>"==wordlist[j]||"o="==wordlist[j]||"o#"==wordlist[j]){var op=ch[1];"="==op?op="==":"#"==op&&(op="!="),EvalString+=op}else if("o+"==wordlist[j]||"o-"==wordlist[j]||"o*"==wordlist[j]||"o/"==wordlist[j]){var op=ch[1];""!=EvalString?EvalString+=op:""!=ExtEvalString&&(ExtEvalString+=op)}else if("o"==firstchar){var op=ch[1];EvalResult=GetEvalResult(EvalString,EvalType),ExtEvalString=ExtEvalString+EvalResult+op+op,EvalString="",EvalType=""}else if("l,"==wordlist[j])EvalResult=GetEvalResult(EvalString,EvalType),""!=EvalResult?("d"==EvalType?ExtEvalString=ExtEvalString+'"'+EvalResult+'"':ExtEvalString+=EvalResult,EvalResult=GetEvalResult(ExtEvalString,EvalType)):null!=EvalResult&&(ExtEvalString+=EvalResult,EvalResult=GetEvalResult(ExtEvalString,EvalType)),params[ParamIndx]=EvalResult,ParamIndx++,EvalResult="",EvalType="",EvalString="",ExtEvalString="";else{if("n"==firstchar)null!=value&&""!=value||(value=0),EvalString+=value,EvalType="n";else if("d"==firstchar)EvalType="d",""==value&&(value="01/01/1900"),EvalString=EvalString+'"'+value+'"';else if("s"==firstchar)if(-1!=value.indexOf("/")&&3==value.split("/").length||"d"==EvalType){value=value.replace(/\"/g,"");var dtlenth=value.split("/");2==dtlenth[0].length&&2==dtlenth[1].length&&4==dtlenth[2].length?(EvalType="d",EvalString=EvalString+'"'+value+'"'):'"'!=value.substr(0,1)?(EvalType="s",EvalString=EvalString+'"'+value+'"'):(EvalType="s",EvalString+=value)}else'"'!=value.substr(0,1)?(EvalType="s",EvalString=EvalString+'"'+value+'"'):(EvalType="s",EvalString+=value);else if("c"==firstchar)if(-1!=value.indexOf("/")&&3==value.split("/").length){var dtlenth=value.split("/");2==dtlenth[0].length&&2==dtlenth[1].length&&4==dtlenth[2].length?(EvalType="d",EvalString=EvalString+'"'+value+'"'):'"'!=value.substr(0,1)?EvalString=EvalString+'"'+value+'"':EvalString+=value}else'"'!=value.substr(0,1)?EvalString=EvalString+'"'+value+'"':EvalString+=value;params[ParamIndx]=EvalString}if(delete wordlist[j],j++,"e"==wordlist[j]){try{""!=EvalString?params[ParamIndx]=eval(EvalString):""!=ExtEvalString&&(params[ParamIndx]=eval(ExtEvalString))}catch(expFldname){params[ParamIndx]=EvalString}"Infinity"!=params[ParamIndx]&&"NaN"!=params[ParamIndx]||(params[ParamIndx]=0)}}delete wordlist[j],wordlist[i]=CallFunction(functionname,params),params=new Array,ParamIndx=0,z=0}}}function GetEvalResult(EvalString,EvalType){var Result="";if("d"==EvalType)if(-1!=EvalString.indexOf("<")||-1!=EvalString.indexOf(">")||-1!=EvalString.indexOf("==")||-1!=EvalString.indexOf("!=")||-1!=EvalString.indexOf("-")){var Operator=-1!=EvalString.indexOf("<")?"<":-1!=EvalString.indexOf(">")?">":-1!=EvalString.indexOf("==")?"==":-1!=EvalString.indexOf("!=")?"!=":-1!=EvalString.indexOf("-")?"-":"",Date1=EvalString.split(Operator)[0],Date2=EvalString.split(Operator)[1];Date1=Date1.replace(new RegExp('"',"gi"),""),Date2=Date2.replace(new RegExp('"',"gi"),""),Operator="=="==Operator?"=":Operator,Result="-"==Operator?SubtractDate(Date1,Date2,Operator):CompareDate(Date1,Date2,Operator)}else try{Result=eval(EvalString)}catch(expFldname){Result=EvalString}else try{Result=eval(EvalString)}catch(expFldname){Result=EvalString}return"Infinity"!=Result&&"NaN"!=Result||(Result=0),Result==undefined&&(Result=EvalString),Result}function GetExprString(){for(var e="",t="",r=0;r<wordlist.length;r++)if(""!=wordlist[r]&&null!=wordlist[r]){ch=wordlist[r];var n=ch;ch=ch.split("");var a=ch[0];"e"==a?t=")":"s"==a||"c"==a?t='"'!=ch[1]?'"'+n.substr(1,n.length)+'"':""==n.substr(1,n.length)?'"'+n.substr(1,n.length)+'"':n.substr(1,n.length):"d"==a?t='"'+n.substr(1,n.length)+'"':"n"==a?(t=n.substr(1,n.length),parseInt(t)<0&&(t="("+t+")")):t=n.substr(1,n.length),e+=t}return e}function isOperator(e){return"+"==e||"-"==e||"*"==e||"/"==e||"^"==e||"="==e||">"==e||"<"==e||"#"==e||"&"==e||"|"==e||"$"==e}function isDelimiter(e){return" "==e||"("==e||")"==e||","==e}function ReturnDMYOfDate(e,t){if(0==IsValidDate(e)){e=e.toString();var r=new Array;r=e.split("/");var n=0;return"dd/mm/yyyy"==dateString?"day"==t?n=parseInt(r[0],10):"month"==t?n=parseInt(r[1],10):"year"==t&&(n=parseInt(r[2],10)):"day"==t?n=parseInt(r[1],10):"month"==t?n=parseInt(r[0],10):"year"==t&&(n=parseInt(r[2],10)),n}return 0}function MonthOfDate(e){return ReturnDMYOfDate(e,"month")}function YearOfDate(e){return ReturnDMYOfDate(e,"year")}function IsValidDate(dtStr){if(""!=dtStr&&dtStr!=dateString){var daysInMonth=DaysArray(12),pos1=dtStr.indexOf(dtCh),pos2=dtStr.indexOf(dtCh,pos1+1),strDay=0,strMonth=0,glCulture=eval(callParent("glCulture"));glCulture!=undefined&&"en-us"==glCulture?(strMonth=dtStr.substring(0,pos1),strDay=dtStr.substring(pos1+1,pos2)):(strDay=dtStr.substring(0,pos1),strMonth=dtStr.substring(pos1+1,pos2));var strYear=dtStr.substring(pos2+1);strYr=strYear,"0"==strDay.charAt(0)&&strDay.length>1&&(strDay=strDay.substring(1)),"0"==strMonth.charAt(0)&&strMonth.length>1&&(strMonth=strMonth.substring(1));for(var i=1;i<=3;i++)"0"==strYr.charAt(0)&&strYr.length>1&&(strYr=strYr.substring(1));var month=parseInt(strMonth,10),day=parseInt(strDay,10),year=parseInt(strYr,10);return-1==pos1||-1==pos2?1:strMonth.length<1||month<1||month>12?2:strDay.length<1||day<1||day>31||2==month&&day>daysInFebruary(year)||day>daysInMonth[month]?3:4!=strYear.length||0==year||year<minYear||year>maxYear?4:-1!=dtStr.indexOf(dtCh,pos2+1)||0==isInteger(stripCharsInBag(dtStr,dtCh))?5:0}return-1}function DayOfDate(e){return ReturnDMYOfDate(e,"day")}function IfFun(e,t,r){return e?isNaN(t)?'"'+t+'"':t:r}function Length(e){return e.toString().length}function SubStr(e,t,r){return 0==t||"0"==t?t=0:t-=1,r=t+r,""!=e&&0!=e&&(e=e.toString().substring(t,r)),e}function PAbs(e){return Math.abs(e)}function FindCharPos(e,t){var r=e.indexOf(t);if(-1!=r)return r;showAlertDialog("error",2033,"client")}function ChkUniqChar(e){new Array;var t,r,n=e.length,a=0;for(t=0;t<n;t++)for(r=t+1;r<n;r++)e.charAt(t)==e.charAt(r)&&a++;return a>0}function TrimAll(e){for(;" "==e.substring(0,1);)e=e.substring(1,e.length);for(;" "==e.substring(e.length-1,e.length);)e=e.substring(0,e.length-1);return e}function ExtractNum(e){return e.replace(/\D/g,"")}function Mods(e,t){return e%t}function LastDayOfMonth(e){try{if(""!=e){var t=e.toString().split("/"),r="",n="",a="";"dd/mm/yyyy"==dateString?(a=t[0].toString(),r=t[1].toString(),n=t[2].toString()):(a=t[1].toString(),r=t[0].toString(),n=t[2].toString());var l;new Date(parseInt(n,10),parseInt(r,10)-1,parseInt(a,10));return l=DaysInMonth(n,r=parseInt(r,10)),ConstructDate(new Date(parseInt(n,10),parseInt(r,10)-1,parseInt(l,10)))}return""}catch(i){return""}}function IsLeapYear(e){return 29==new Date(e,1,29).getDate()}function ConstructDate(e){return"dd/mm/yyyy"==dateString?resultDate=("0"+e.getDate()).slice(-2)+"/"+("0"+(e.getMonth()+1)).slice(-2)+"/"+e.getFullYear():resultDate=("0"+(e.getMonth()+1)).slice(-2)+"/"+("0"+e.getDate()).slice(-2)+"/"+e.getFullYear(),resultDate}function DaysInMonth(e,t){return 1==(t=parseInt(t,10))||3==t||5==t||7==t||8==t||10==t||12==t?31:4==t||6==t||9==t||11==t?30:IsLeapYear(parseInt(e,10))?29:28}function ValidEncodeDate(e,t,r){return new Date(e,t-1,r)}function GetInteger(e){var t=0;return isNaN(e)||(t=parseInt(e)),t}function AddToMonth(e,t){if(""!=e&&"0"!=e){var r=GetDateObj(e);if(null!=r)return r.setMonth(r.getMonth()+parseInt(t,10)),ConstructDate(r)}return 0}function AddToDate(e,t){if(""!=e){var r=GetDateObj(e);if(null!=r)return r.setDate(r.getDate()+parseInt(t,10)),ConstructDate(r)}return 0}function Time(){return(new Date).toTimeString()}function GetDateObj(e){if(""!=e&&-1!=e.toString().indexOf("/")){var t=e.toString().split("/"),r="",n="",a="";return"dd/mm/yyyy"==dateString?(a=t[0].toString(),r=t[1].toString(),n=t[2].toString()):(a=t[1].toString(),r=t[0].toString(),n=t[2].toString()),isNaN(a)||isNaN(r)||isNaN(n)?null:new Date(parseInt(n,10),parseInt(r,10)-1,parseInt(a,10))}return""}function TimeElapsed(e,t){if(""!=e&&""!=t){date1=GetDateObj(e);var r=GetDateObj(t);if(null!=date1&&null!=r){var n=r.getTime()-date1.getTime(),a=(trunc(n/36e5),trunc(n/6e4),trunc(n/1e3),Math.floor(n/864e5));n=864e5*a;var l=Math.floor(n/36e5);n=36e5*l;var i=Math.floor(n/6e4);n=6e4*i;var s=Math.floor(n/1e3);return a+" day"+(1!=a?"s":"")+", "+l+" hour"+(1!=l?"s":"")+", "+i+" minute"+(1!=i?"s":"")+", "+s+" second"+(1!=s?"s":"")}return""}return""}function trunc(e){return Math[e>0?"floor":"ceil"](e)}function DaysElapsed(e,t){try{if("01/01/1900"==e&&(e=""),"01/01/1900"==t&&(t=""),""!=e&&""!=t){var r=GetDateObj(e),n=GetDateObj(t);if(null!=r&&null!=n){var a=new Date(Date.UTC(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate(),0,0,0)),l=new Date(Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate(),0,0,0));return l>a?Math.floor((l-a)/864e5):l==a?0:Math.floor((a-l)/864e5)}}return 0}catch(i){return""}}function MandY(e){if(0!=e&&""!=e){var t=GetDateObj(e);if(null!=t){var r=t.getMonth()+1;return r=PrefixZero(r),t.getFullYear()+""+r}}return""}function FindAndReplace(e,t,r){return strReplaceAll=e.replace(new RegExp(t,"gi"),r),strReplaceAll}function removeCommas(e){return e==undefined||""==e?"0":e=(e=e.toString()).replace(/,/g,"")}function GetNthString(e,t){return e=e.substring(t)}function RoundOff(e,t){var r=Math.pow(10,t);return Math.round(e*r)/r}function InsertCommas(e){var t=parseFloat(e);isNaN(t)&&(t=0);var r="";return t<0&&(r="-"),t=Math.abs(t),t=parseInt(100*(t+.005)),t/=100,s=new String(t),s.indexOf(".")<0&&(s+=".00"),s.indexOf(".")==s.length-2&&(s+="0"),s=r+s,CommaFormatted(s)}function CommaFormatted(e){var t="";-1==e.toString().indexOf(".")&&(e+=".");var r="";(t=e.split(".")).length>1&&(r=t[1].toString());var n=parseInt(t[0]);if(isNaN(n))return"";var a="";e<0&&(a="-"),n=Math.abs(n);var l=new String(n);for(t=[];l.length>3;){var i=l.substr(l.length-3);t.unshift(i),l=l.substr(0,l.length-3)}return l.length>0&&t.unshift(l),l=t.join(","),e=a+(e=r.length<1?l:l+"."+r)}function LeftPad(e,t,r){var n=String(e);for(r||(r="0");n.length<t;)n.length==t?n+=r:n=r+n;return n}function RightPad(e,t,r){var n=String(e);for(r||(r="0");n.length<t;)n.length==t?n=r+n:n+=r;return n}function Pad(e,t,r){var n=String(e);for(r||(r="0");n.length<t;)(n=r+n).length<t&&(n+=r);return n}function GetSeperatorCount(e,t){return e.toString().split(t).length-1}function Val(e){var t=e.toString();if(-1!=t.indexOf("{")||-1!=t.indexOf("}")){var r=t.replace(/^\{?([^\}])/,"");t=(r=r.split(")"))[0]}return t=removeCommas(t),parseFloat(t)}function Str(e){var t="";return isNaN(e)?showAlertDialog("error",2034,"client"):t=e.toString(),t}function UpperCase(e){var t=e.toString();return"0"==t?t="":t.toUpperCase()}function LowerCase(e){return e.toString().toLowerCase()}function IsVarEmpty(e){return""==e.toString()}function GetVarValue(e){return e.valueOf()}function Amt_Word(e){var t="";if(e!=undefined){if(0==e.length)return showAlertDialog("warning",2035,"client"),!0;t=toWords(e)}return t}function ValidateAmount(e){var t=e;t=Math.floor(t);var r=new String(t);if(numReversed=r.split(""),actnumber=numReversed.reverse(),!(Number(t)>=0))return!1;if(0==Number(t))return"";if(actnumber.length>9)return showAlertDialog("warning",2037,"client"),!1;var n=["Zero","One","Two","Three","Four","Five"," Six"," Seven"," Eight","Nine"],a=["Ten","Eleven","Twelve","Thirteen","Fourteen","Fifteen","Sixteen","Seventeen","Eighteen","Nineteen"],l=["dummy","Ten","Twenty","Thirty","Forty","Fifty","Sixty","Seventy","Eighty","Ninety"],s=numReversed.length,o=new Array,u="";for(j=0,i=0;i<s;i++){switch(i){case 0:0==actnumber[i]||1==actnumber[i+1]?o[j]="":o[j]=n[actnumber[i]],o[j]=o[j];break;case 1:d();break;case 2:0==actnumber[i]?o[j]="":0!=actnumber[i-1]&&0!=actnumber[i-2]?o[j]=n[actnumber[i]]+" Hundred and":o[j]=n[actnumber[i]]+" Hundred";break;case 3:0==actnumber[i]||1==actnumber[i+1]?o[j]="":o[j]=n[actnumber[i]],(0!=actnumber[i+1]||actnumber[i]>0)&&(o[j]=o[j]+" Thousand");break;case 4:d();break;case 5:"0"==actnumber[i]||1==actnumber[i+1]?o[j]="":o[j]=n[actnumber[i]],(0!=actnumber[i+1]||actnumber[i]>0)&&(o[j]=o[j]+" Lakh");break;case 6:d();break;case 7:"0"==actnumber[i]||1==actnumber[i+1]?o[j]="":o[j]=n[actnumber[i]],(0!=actnumber[i+1]||actnumber[i]>0)&&(o[j]=o[j]+" Crore");break;case 8:d()}j++}function d(){0==actnumber[i]?o[j]="":1==actnumber[i]?o[j]=a[actnumber[i-1]]:o[j]=l[actnumber[i]]}for(o.reverse(),i=0;i<o.length;i++)""!=o[i]?u+=" "+o[i]:u+=""+o[i];return u}function toWords(e){var t=ValidateAmount(e),r="",n=e;e=n;var a=(n=n.toString()).indexOf(".");return-1!=a?(r=0==(n=n.substring(a+1,n.length)).length||"00"==n?"Zero paisa Only":ValidateAmount(e=n)+" paisa Only",""==t?r:" Rupees"+t+" and "+r):" Rupees"+t+" Only"}function curtoWords(e){var t=ValidateAmount(e),r="",n=e;e=n;var a=(n=n.toString()).indexOf(".");return-1!=a?(r=0==(n=n.substring(a+1,n.length)).length||"00"==n?"Zero paisa":ValidateAmount(e=n)+" paisa",""==t?r:t+" and "+r):t}function EvaluatePower(e,t){var r=t.value;return Math.pow(e,r)}function push_stack(e,t){e[e.length]=t}function pop_stack(e){var t=e[e.length-1];return delete e[e.length-1],e.length--,t}function isOperand(e){return!isOperator(e)&&"("!=e&&")"!=e}function topStack(e){return e[e.length-1]}function isEmpty(e){return 0==e.length}function prcd(e){return"^"==e?5:"*"==e||"/"==e?4:"+"==e||"-"==e?3:"("==e?2:")"==e?1:void 0}function InfixToPostfix(e){var t=new Array,r=new Array,n=0;e=e.split("");for(var a=0;a<e.length;a++){if(isOperand(e[a])&&(t[n]=e[a],n++),isOperator(e[a])){if("^"!=e[a])for(;!isEmpty(r)&&prcd(e[a])<=prcd(topStack(r));)t[n]=topStack(r),pop_stack(r),n++;else for(;!isEmpty(r)&&prcd(e[a])<prcd(topStack(r));)t[n]=topStack(r),pop_stack(r),n++;push_stack(r,e[a])}if("("==e[a]&&push_stack(r,e[a]),")"==e[a]){for(;"("!=topStack(r);)t[n]=pop_stack(r),n++;pop_stack(r)}}for(;!isEmpty(r);)"("==topStack(r)?pop_stack(r):t[t.length]=pop_stack(r);var l="";for(a=0;a<t.length;a++)l+=t[a];return l}function PostfixToInfix(e){var t=new Array;e=e.split("");for(var r=0;r<e.length;r++)if(isOperand(e[r]))push_stack(t,e[r]);else{var n=topStack(t);pop_stack(t);var a=topStack(t)+e[r]+n;pop_stack(t),push_stack(t,a)}return topStack(t)}function PostfixSubEval(e,t,r){var n;return"+"==r&&(n=e+t),"-"==r&&(n=e-t),"*"==r&&(n=e*t),"/"==r&&(n=e/t),"^"==r&&(n=Math.pow(e,t)),n}function PostfixEval(e){var t=new Array;e=e.split("");for(var r=0;r<e.length;r++)if(isOperand(e[r]))push_stack(t,e[r]);else{var n=parseFloat(topStack(t));pop_stack(t);var a=PostfixSubEval(parseFloat(topStack(t)),n,e[r]);pop_stack(t),push_stack(t,a)}return topStack(t)}function InputPrecedence(e){var t=11;return t=parseInt(t),")"==e?t=0:"|"==e?t=1:"&"==e?t=3:"+"==e||"-"==e?t=5:"*"==e||"/"==e?t=7:"^"==e||">"==e||"<"==e||"#"==e||"$"==e?t=10:"("==e?t=13:t}function StackPrecedence(e){var t=12;return t=parseInt(t),"("==e?t=0:"|"==e?t=2:"&"==e?t=4:"+"==e||"-"==e?t=6:"*"==e||"/"==e?t=8:"^"==e||">"==e||"="==e||"<"==e||"#"==e||"$"==e?t=9:t}function ISOperator(e){return"+"==e||"-"==e||"*"==e||"/"==e||"<"==e||">"==e||"="==e||"#"==e||"&"==e||"|"==e||"$"==e}function initBase64(){var e;for(enc64List=new Array,dec64List=new Array,e=0;e<26;e++)enc64List[enc64List.length]=String.fromCharCode(65+e);for(e=0;e<26;e++)enc64List[enc64List.length]=String.fromCharCode(97+e);for(e=0;e<10;e++)enc64List[enc64List.length]=String.fromCharCode(48+e);for(enc64List[enc64List.length]="+",enc64List[enc64List.length]="/",e=0;e<128;e++)dec64List[dec64List.length]=-1;for(e=0;e<64;e++)dec64List[enc64List[e].charCodeAt(0)]=e}function Encode(e){for(var t,r,n,a,l,i,s,o=0,u=-1,d=e.split(""),c="";0==o;)t="undefined"!=typeof d[++u]?d[u].charCodeAt(0):(o=1,0),r="undefined"!=typeof d[++u]?d[u].charCodeAt(0):(o+=1,0),n="undefined"!=typeof d[++u]?d[u].charCodeAt(0):(o+=1,0),a=enc64List[t>>2],l=enc64List[(3&t)<<4|r>>4],i=enc64List[(15&r)<<2|n>>6],s=enc64List[63&n],o>=1&&(s="="),2==o&&(i="="),o<3&&(c+=a+l+i+s);for(var f="";c.length>76;)f+=c.substring(0,76)+"\n",c=c.substring(76);return f+=c}function Decode(e){var t=0,r=0,n=0,a=0,l=0,i=0,s=e.split(""),o="",u=0;do{a=s[u++].charCodeAt(0),l=dec64List[a],a>=0&&a<128&&-1!=l&&(i%4==0?t=l<<2:i%4==1?(t|=l>>4,r=(15&l)<<4):i%4==2?(r|=l>>2,n=(3&l)<<6):n|=l,++i%4==0&&(o+=String.fromCharCode(t)+String.fromCharCode(r)+String.fromCharCode(n)))}while("undefined"!=typeof s[u]);return o+=i%4==3?String.fromCharCode(t)+String.fromCharCode(r):i%4==2?String.fromCharCode(t):""}function PrefixZero(e){return 1==e.toString().length&&(e="0"+e),e}function DTOC(e){if(""!=e&&e!=undefined&&"01/01/1900"!=e){var t=GetDateObj(e);if(null!=t){var r=t.getMonth()+1;r=PrefixZero(r);var n=t.getFullYear(),a=t.getDate();return a=PrefixZero(a),"dd/mm/yyyy"==dateString?resultDate=a+"/"+r+"/"+n:resultDate=r+"/"+a+"/"+n,resultDate.toString()}}return""}function CTOD(e){return DTOC(e)}function CMonthYear(e){try{if(""!=e&&"0"!=e){var t=GetDateObj(e);if(null!=t){t.valueOf();var r=t.getMonth(),n=t.getFullYear();return(r=new Array("January","February","March","April","May","June","July","August","September","October","November","December")[r])+" "+n}}return""}catch(a){return""}}function Stuff(e,t,r){var n=_typeof(e),a=e.toString();return"T"==IsEmptyValue(a,n)&&showAlertDialog("error",2038,"client"),a=a.substring(0,r)+t+a.substring(parseInt(r))}function Rnd(e,t){var r=parseFloat(e),n=parseInt(t),a=parseInt(100*r),l=parseInt(n/2),i=a-n*parseInt(a/n),s=(i>=l?a+n-i:a-i)/100;return isNaN(s)?0:s}function IsEmptyValue(e,t){var r="F";return"01/01/1900"==e&&(e=""),""==e||null==e?r="T":"object"==t&&isNaN(e)?r="T":"d"!=t||"dd/mm/yyyy"!=e&&"01/01/1900"!=e?"n"==t&&"0"==parseFloat(e)&&(r="T"):r="T",GetVarValue(r),r}function FormatVal(e,t){t=t>0?Math.pow(10,t):Math.pow(10,2);var r=parseFloat(e);isNaN(r)&&(r=0);var n="";r<0&&(n="-"),r=Math.abs(r),r=parseInt((r+.005)*t),r/=t,s=new String(r),s.indexOf(".")<0&&(s+=".00"),s.indexOf(".")==s.length-2&&(s+="0"),s=n+s,CommaFormatted(s)}function FormatAccAmount(e,t,r,n,a){var l=0;l=e<0?-1*parseFloat(e):e;var i=0,o=n.toString(),u=a.toString();o.toLowerCase(),o=TrimAll(o),u.toLowerCase(),t=t>0?Math.pow(10,t):Math.pow(10,2);var d=parseFloat(l);isNaN(d)&&(d=0);var c="";return d<0&&(c="-"),d=Math.abs(d),d=parseInt((d+.005)*t),d/=t,s=new String(d),s.indexOf(".")<0&&(s+=".00"),s.indexOf(".")==s.length-2&&(s+="0"),s=c+s,i="true"==r?CommaFormatted(s):addCommas(s),"a"==o||"e"==o?e<0&&"br"==u?i="("+i+")":e<0&&(i=i+" "+u):"l"!=o&&"i"!=o||(e>0&&"br"==u?i="("+i+")":e>0&&(i=i+" "+u)),i}function FormatAmount(e,t,r,n,a){var l=0;l=e<0?-1*parseFloat(e):e;var i=0;t=t>0?Math.pow(10,t):Math.pow(10,2);var o=parseFloat(l);isNaN(o)&&(o=0);var u="";return o<0&&(u="-"),o=Math.abs(o),o=parseInt((o+.005)*t),o/=t,s=new String(o),s.indexOf(".")<0&&(s+=".00"),s.indexOf(".")==s.length-2&&(s+="0"),s=u+s,i="true"==r?CommaFormatted(s):addCommas(s),"br"==n||"br"==a?e<0&&(i="("+i+")"):i=e<0?i+" "+n:i+" "+a,i=TrimAll(i)}function TrimInbetwnSpaces(e){return e=e.replace(/\s/g,"")}function TodaysDate(){var e=new Date,t=e.getMonth()+1;t=PrefixZero(t);var r=e.getFullYear(),n=e.getDate(),a=(n=PrefixZero(n))+"/"+t+"/"+r,l=callParentNew("glCulture");return l!=undefined&&"en-us"==l&&(a=GetDateStr(a,"mm/dd/yyyy","dd/mm/yyyy")),a}function ISEMPTY(e){return""==e||"dd/mm/yyyy"==e||"01/01/1900"==e?"T":"F"}function Round(e){return Math.round(e)}function DateDiff(e,t){return DaysElapsed(e,t)}function ReplaceSpecialCharInDate(e){return-1!=e.indexOf("(")&&(e=e.replace(/\(/g,"")),-1!=e.indexOf(")")&&(e=e.replace(/\)/g,"")),e}function CompareDate(e,t,r){if(e=ReplaceSpecialCharInDate(e),t=ReplaceSpecialCharInDate(t),"!="==r)return""==e&&(e="01/01/1900"),""==t&&(t="01/01/1900"),e!=t;if(""!=e&&""!=t){var n=GetDateObj(e),a=GetDateObj(t);if(null!=n&&null!=a){if("<"==r)return n<a;if(">"==r)return n>a;if("="==r)return n==a}}return""}function SubtractDate(e,t,r){e=ReplaceSpecialCharInDate(e),t=ReplaceSpecialCharInDate(t);var n=0;if(""!=e&&""!=t){var a=GetDateObj(e),l=GetDateObj(t);if(null!=a&&null!=l)n=new Date(a-l)/1e3/60/60/24}return n}function CheckEmail(e){var t=new RegExp("^[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+.[a-zA-Z]{2,4}$").test(e);if(t)return t;showAlertDialog("warning",2039,"client")}function Total(e){var t,r=0;if(t=GetDcNo(e),parseInt(t,10)>0)for(var n=parseInt(GetDcRowCount(t),10),a=1;a<=n;a++){var l=GetClientRowNo(a,t);if(expFldname=e+l+"F"+t,($("#"+expFldname).hasClass("labelInp")||1===$("textarea[id='EDIT~"+expFldname+"']").length||1===$("#"+expFldname).length)&&document.getElementById(expFldname)){var i=0;""!=document.getElementById(expFldname).value&&"***"!=document.getElementById(expFldname).value&&""!=(i=document.getElementById(expFldname).value.length>3&&-1!=document.getElementById(expFldname).value.indexOf(",")?removeCommas(document.getElementById(expFldname).value):document.getElementById(expFldname).value)&&(r+=parseFloat(i))}}return r}function CurrAmtWord(e,t,r,n,a){if(void 0!==e){var l=(e+="").split("."),i=curtoWords(l[0]);if(l[1]!=undefined){if(l[1].length<a)for(var s=l[1].length;s<a;s++)l[1]=l[1]+"0";var o=curtoWords(parseInt(l[1],10));return""!=i?t+""+i+" and "+r+" "+o+" only":r+" "+o+" only"}return t+""+i+" only"}}function str(e){if(isNaN(e)){var t="",r=e+rowno;if(document.getElementById(r)&&(t=document.getElementById(r).value),""!=t)return t}}function makedate(e,t,r){e=PrefixZero(e),t=PrefixZero(t);return"dd/mm/yyyy"==dateString?e+"/"+t+"/"+r:t+"/"+e+"/"+r}funclist.push("abs","addtodate","addtomonth","amtword"),funclist.push("checkemail","chkuniqchar","cmonthyear","convertmd5","ctod","curramtword"),funclist.push("date","datediff","dayofdate","dayselapsed","daysinmonth","decode","dtoc"),funclist.push("encode","evaluatepower","extractnum"),funclist.push("findandreplace","findcharpos","formataccamount","formatamount","formatval"),funclist.push("getallvalues","getinteger","getlength","getmax","getmin","getmod","getnthstring","getrow","getrowcount","getseperatorcount","getsubtotal","getold","getvalue","getvarvalue"),funclist.push("iif","infixtopostfix","inputprecedence","insertcommas","isempty","isemptyvalue","isoperator","isvarempty"),funclist.push("lastdayofmonth","leftpad","length","lower","lowercase"),funclist.push("makedate","mods","monthofdate"),funclist.push("pad","postfixeval","postfixtoinfix"),funclist.push("regvar","removecommas","rightpad","rnd","round","roundoff"),funclist.push("setfont","stackprecedence","str","stuff","substr","sum","sumtill"),funclist.push("time","timeelapsed","trim","trimall","triminbetwnspaces","total"),funclist.push("upper","uppercase"),funclist.push("val","validencodedate"),funclist.push("yearofdate"),funclist.push("floor","ceil","networkdays","days360","axpfloor","axpceil"),funclist.push("axhidecontrols","axunhidecontrols","axenablecontrols","axdisablecontrols","setvalue","axvalueexits","axaddrow","loadform","loadformanddata","loadiview","loadpage","openpage"),initBase64();var dtCh="/",curDate=new Date,cYear=curDate.getFullYear(),minYear=cYear-100,maxYear=cYear+100;function isInteger(e){var t;for(t=0;t<e.length;t++){var r=e.charAt(t);if(r<"0"||r>"9")return!1}return!0}function stripCharsInBag(e,t){var r,n="";for(r=0;r<e.length;r++){var a=e.charAt(r);-1==t.indexOf(a)&&(n+=a)}return n}function daysInFebruary(e){return e%4!=0||e%100==0&&e%400!=0?28:29}function DaysArray(e){for(var t=1;t<=e;t++)this[t]=31,4!=t&&6!=t&&9!=t&&11!=t||(this[t]=30),2==t&&(this[t]=29);return this}function isDate(e){var t=IsValidDate(e);return 1==t?(showAlertDialog("warning",2040,"client"),!1):2==t?(showAlertDialog("warning",2041,"client"),!1):3==t?(showAlertDialog("warning",2042,"client"),!1):4==t?(showAlertDialog("warning",2043,"client"),!1):5!=t||(showAlertDialog("warning",2044,"client"),!1)}function SubSumTill(e,t,r,n,a){if("-1"==n||"-1"==a)return 0;var l,i=0;l=GetDcNo(e);var s=GetPopRows(AxActivePDc,a,l),o=s.split(",");if(""==s||0==o.length)return 0;for(var u=1;u<=n;){var d=o[u-1],c=r+d+"F"+l,f="";GetFieldValue(e+d+"F"+l),""!=(f=GetFieldValue(c))&&(f=removeCommas(f),i+=parseFloat(f)),u++}return i}function SumTill(e,t,r,n,a){if(a!=undefined)return SubSumTill(e,t,r,n,a);var l,i=0;l=GetDcNo(e);for(var s=parseInt(n,10),o=parseInt(GetDcRowCount(l),10),u=1;u<=o&&!(u>s);u++){var d=GetClientRowNo(u,l),c=e+d+"F"+l,f=r+d+"F"+l,v="";if(document.getElementById(c)){if(v=GetFieldValue(c),""==t)t=GetFieldValue(e+(n-1)+"F"+l);if(v==t){var p=GetFieldValue(f);""!=p&&(p=removeCommas(p),i+=parseFloat(p))}}}return i}function Sum(criFld,criFldVal,sumFld){var sumVal=0,dcno=0;dcno=GetDcNo(criFld);for(var rcount=parseInt(GetDcRowCount(dcno),10),i=1;i<=rcount;i++){var newRowNo=GetClientRowNo(i,dcno),criFldname=criFld+newRowNo+"F"+dcno,newSumFld=sumFld+newRowNo+"F"+dcno,criItemVal=GetFieldValue(criFldname);if(criItemVal==criFldVal){var sumFldVal=document.getElementById(newSumFld);if(sumFldVal){var sum=GetFieldValue(newSumFld);sumFldVal=removeCommas(sum),"***"!=sumFldVal&&(sumVal+=eval(sumFldVal))}}}return sumVal}function AxCeil(e){return Math.ceil(e)}function AxFloor(e){return Math.floor(e)}function NetworkDays(e,t,r){var n=new GetDateObj(e),a=new GetDateObj(t);if(n>a)return-1;for(var l=0;n<=a;)0!=n.getDay()&&6!=n.getDay()&&l++,n.setDate(n.getDate()+1);return r&&r!=undefined&&""!=r||(r=0),l-r}function Days360(e,t,r){var n=GetDateObj(e),a=GetDateObj(t),l="";if(""!=n&&""!=a){if(r)31==n.getDate()&&n.setDate(30),31==a.getDate()&&a.setDate(30);else{var i=new Date(e),s=new Date(i.getFullYear(),i.getMonth()+1,0);n.getDate()==s.getDate()&&n.setDate(30),a.getDate()==s.getDate()&&n.getDate()<30&&a.setDate(30)}l=30*(12*(a.getFullYear()-n.getFullYear())+(a.getMonth()-n.getMonth()))+a.getDate()-n.getDate()}return l}function GetAllValues(e,t){var r,n="",a="",l=0;r=GetDcNo(e);for(var i=parseInt(GetDcRowCount(r),10),s=0;s<=i;s++){var o=GetClientRowNo(s,r);if(expFldname=e+o+"F"+r,document.getElementById(expFldname))if(0==l){if("***"!=(n=document.getElementById(expFldname).value)&&""!=n)n=n.split(",,")[0].toString(),l++}else if("***"!=(a=document.getElementById(expFldname).value)&&""!=a)n+=","+a.split(",,")[0].toString()}return n}function GetMinValue(e){var t;t=GetDcNo(e);for(var r="",n=parseInt(GetDcRowCount(t),10),a=new Array,l=1;l<=n;l++){var i=GetClientRowNo(l,t);expFldname=e+i+"F"+t,a[l]=document.getElementById(expFldname).value}r=a.getMin();for(var s=1;s<a.length;s++)if(a[s]==r){r=s;break}return r}function GetMaxValue(e){var t;t=GetDcNo(e);for(var r="",n=parseInt(GetDcRowCount(t),10),a=new Array,l=1;l<=n;l++){var i=GetClientRowNo(l,t);expFldname=e+i+"F"+t,a[l-1]=document.getElementById(expFldname).value}r=Math.max.apply(Math,a);for(var s=1;s<a.length;s++)if(a[s]==r){r=s;break}return r}function GetRowCount(e){var t;t=GetDcNo(e);return isMobile&&!axInlineGridEdit?parseInt(GetDcRowCount(t),10)-1:parseInt(GetDcRowCount(t),10)}function GetGridCellValue(e,t,r){var n,a,l="";a=GetFieldIndex(e),l=FDataType[a],n=GetDcNo(e),r||(t=GetClientRowNo(t,n));var i=GetRowNoHelper(t);IsDcGrid(n)||"1"!=t||(i="000");var s=e+i+"F"+n,o="";return""!=i&&document.getElementById(s)&&(o=$j("#"+s).val(),o="numeric"==l.toLowerCase()?removeCommas(o):o),""==o&&"numeric"==l.toLowerCase()&&(o="0"),o="numeric"==l.toLowerCase()?"n"+o:"s"+o}function RegisterVariables(e,t,r){isEvalGrid=!0;var n=!1;if(""!=e){for(var a=0;a<varlist.length;a++)if(varlist[a]==e){valuelist[a]=r,n=!0;break}n||(varlist.push(e),valuelist.push(r));var l=!1;$.each(RegVarFldList,function(n,a){if(a.startsWith(e+":"))return RegVarFldList[n]=e+":"+t+":"+r,void(l=!0)}),0==l&&RegVarFldList.push(e+":"+t+":"+r)}return""}function GetActiveRow(e){var t=0,r=0;if(""!=e){var n=e.toString().lastIndexOf("F");if(-1!=parseInt(n,10)){var a=e.toString().substring(0,n);t=e.toString().substring(n+1);for(var l=parseInt(a.toString().substring(a.toString().length-3),10)-1;l>0;l--){var i=GetRowNoHelper(l),s=e.toString().lastIndexOf("F"),o=e.substring(0,s-3)+i+"F"+t;document.getElementById(o)&&"***"!=document.getElementById(o).value&&r++}}}return r}function GetRow(e,t,r){GetFieldIndex(e);var n="",a=GetDcNo(e),l=parseInt(GetDcRowCount(a),10),i=0,s="";for(i=1;i<=l;i++)if(s=GetClientRowNo(i,a),s=GetRowNoHelper(s),r!=undefined){r=(r=GetClientRowNo(AxActivePRow,AxActivePDc)).substring(0,r.indexOf("F"));var o=GetPopRows(AxActivePDc,r,a);o=o.split(",");for(var u=0;u<o.length;u++)if(s!=o[u]);else{n=e+s+"F"+a;if(GetFieldValue(n)==t)return parseInt(s,10)}}else{n=e+s+"F"+a;if(GetFieldValue(n)==t)return GetDbRowNo(parseInt(s,10),a)}return-1}function SubTotal(e,t){var r=GetDcNo(e),n=0,a=GetPopRows(AxActivePDc,t,r);a=a.split(",");for(var l=0;l<a.length;l++){var i=e+a[l]+"F"+r;n+=parseFloat(removeCommas(GetFieldValue(i)))}return n}function GetMod(e,t){return 0==t?0:e%t}function IsPopGridField(e){var t,r=-1;t=e.lastIndexOf("F");if(-1!=document.title.toLowerCase().indexOf("tstruct")){var n=e.substring(t+1,e.length);if(n!=undefined||""!=n)for(var a=0;a<PopGridDCs.length;a++)PopGridDCs[a]==n&&(r=a)}return r}function GetActiveParentRow(e,t){for(var r=e.lastIndexOf("F"),n=e.substring(r-3,r),a=e.substring(r+1),l=PopParentDCs[t],i=PopParentFlds[t].toString().split(","),s=new Array,o=new Array,u="",d="",c=0;c<i.length;c++)s[c]=i[c].toString().trim(),u=GetSubFieldId("sub"+a+"_"+i[c].toString(),n,a),d=GetFieldValue(u),o[c]=d;var f="row"+l+"temF0",v=0,p=-1;document.getElementById(f)?(v=document.getElementById(f).value,v=parseInt(v,10)):v=2;for(var g=1;g<v;g++){for(var m=!0,h=GetRowNoHelper(g),w=0;w<s.length;w++)if(u=s[w]+h+"F"+l,(d=GetFieldValue(u))!=o[w]){m=!1;break}if(m){p=g;break}}return p}function RandomNo(){return Math.floor(9e9*Math.random())+1e9}function AxHideControls(e){return"hide~"+e}function AxUnhideControls(e){return"show~"+e}function AxEnableControls(e){return"enable~"+e}function AxDisableControls(e){return"disable~"+e}function AxSetValue(e,t,r){return"setvalue~"+e+"♦"+t+"♦"+r}function AxValueExits(e,t,r,n){var a="";if(0==IsGridField(t))a=t+"000F"+e;else{var l=AxActiveRowNo;""==l&&(l="001"),a=t+l+"F"+e}var i=GetFieldValue(a),s="0";return""!=i?$("#gridHd"+r+" tbody tr").each(function(e,t){return isMobile||i!=$j(this).find("textarea[id^="+n+"]").val()?isMobile&&i==$j(this).find("textarea[id^=gr"+n+"]").val()?(s=GetFieldsRowNo($j(this).find("textarea[id^=gr"+n+"]").attr("id")),s=parseInt(s),!1):void 0:(s=GetFieldsRowNo($j(this).find("textarea[id^="+n+"]").attr("id")),s=parseInt(s),!1)}):s="-1",""==AxOldValue?AxOldValueOnChange=i:AxOldValueOnChange=AxOldValue,s}function AxAddRow(e){return"axaddrow~dc"+e}function EvalExprSet(e){var t,r,n,a,l,i="",s=0,o=0;if(""!=e){var u=!0,d=!1,c=!1;try{for(var f=new Array,v=new Array;s<e.length;)if(a=(t=e[s]).trimStart(),""==t||a.startsWith("//"))s++;else if(l=a.split(" ")[0],c&&"endloop"!=l.toLowerCase())s++;else{if("if"==l.toLowerCase())d=u=p="T"==(p=Evaluate("","",n="IIF("+(n=(a=a.substr(2)).trim())+",{T},{F})","vexpr"));else if("elseif"==l.toLowerCase()){if(u=!d&&1!=u)d=u=p="T"==(p=Evaluate("","",n="IIF("+(n=(a=a.substr(6)).trim())+",{T},{F})","vexpr"))}else if("else"==l.toLowerCase())d?u=!1:d=u=1!=u;else if("end"==l.toLowerCase())u=!0,d=!1;else if("endloop"==l.toLowerCase()){if(c)c=!1,v.splice(0,f.length),f.splice(0,f.length);else(p="T"==(p=Evaluate("","",n="IIF("+(n=v[f.length-1])+",{T},{F})","vexpr")))?s=f[f.length-1]:(v.splice(0,f.length),f.splice(0,f.length))}else if("while"==l.toLowerCase()){(p="T"==(p=Evaluate("","","IIF("+(n=(a=a.substr(5)).trim())+",{T},{F})","vexpr")))?(f.push(parseInt(s)),v.push(n)):(c=!0,u=1!=u,d=!1)}else if("break"==l.toLowerCase())c=!0,u=!0,d=!1;else if(u){if(r="",(o=t.indexOf(":="))>-1&&(r=(r=t.substr(0,o)).trim(),t=t.substr(o+2,t.length)),""==r){i=Evaluate("","",t,"vexpr");break}var p=Evaluate("","",t,"vexpr"),g="n";isNaN(p)&&(g="c"),Evaluate("","","regvar({"+r+"},{"+g+"},{"+p+"})","vexpr")}s++}}catch(m){}}return i}function LoadForm(e,t,r,n){return"LoadForm♠"+e+"♠"+(t=ParseParamValues(t))+"♠"+r+"♠"+n}function LoadFormAndData(e,t,r,n){return"LoadFormAndData♠"+e+"♠"+(t=ParseParamValues(t))+"♠"+r+"♠"+n}function LoadIView(e,t,r,n){return"LoadIView♠"+e+"♠"+(t=ParseParamValues(t))+"♠"+r+"♠"+n}function LoadPage(e,t,r,n){return"LoadPage"+e+"♠"+(t=ParseParamValues(t))+"♠"+r+"♠"+n}function OpenPage(e,t,r,n){return"OpenPage♠"+e+"♠"+(t=ParseParamValues(t))+"♠"+r+"♠"+n}function ParseParamValues(e){var t=e.replace(/~/g,"♦");if(""!=t){if(t.indexOf(":")>-1){var r="";return t.split("♦").forEach(function(e){r+=e.split("=")[0];var t=e.split("=")[1];if(t=t.substring(1),GetFieldIndex(t)>-1){var n="",a=GetDcNo(t);n=IsDcGrid(a)?GetFieldValue(t+"001F"+a):GetFieldValue(t+"000F"+a),r+="="+n+","}else{var l=Parameters.filter(function(e){return e.startsWith(t+"~")})[0];void 0!==l&&(r+="="+l.split("~")[1]+",")}}),""!=r&&(r=r.slice(0,-1)),r}return t}return""}Array.prototype.getMax=function(){for(var e,t=10,r=this.length,n=1,a=0;n<r;++n)"number"!=typeof(e=this[n])&&""==e||"***"==e||(a=t=Math.max(t,e));return a},Array.prototype.getMin=function(){for(var e,t=1e7,r=this.length,n=1,a=0;n<r;++n)"number"!=typeof(e=this[n])&&""==e||"***"==e||(a=t=Math.min(t,e));return a}; |