Files
kwenter/AW_11.2.0.0_release1/Js/main-tstruct.min.js
Suriyakumarvijayanayagam 949f78f6d0 Initial import: Axpert 11.2 reference material and platform blueprint
- 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>
2026-09-25 16:22:58 +05:30

1 line
156 KiB
JavaScript

/*https://web.agile-labs.com/minZIP/*//*version=3.9.1*/function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?_arrayLikeToArray(e,t):void 0}}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,a=new Array(t);i<t;i++)a[i]=e[i];return a}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 isMozilla,objDiv=null,originalDivHTML="",DivID="",over=!1,addHeader="",fillGridDatatbl="",shouldFaceUser=!1,flipCamera=!1,gridDummyRows=!1,gridDummyRowVal=new Array,AxpGridForm="popup",fldmultiSelectdep=!1,depNotBoundFld="",axplatlongFldName="",axpfilepathold="",axpScanBarFldFocus="",axpScriptaddrowres="",axpScriptIsAddrow=!0,dcLayoutType="default",isDcLayoutSelected=!1,formLabelJSON=[],buttonFieldFontJSON=[],regVarFldExp=new Array,select2EventType="",select2IsOpened=!1,select2IsFocused=!1,setDesProp={},forceRowedit=!1,isGridFileUploadOnLoad=!1,wizardHidenDcNos=[],gridRowEditOnLoad=!1,dynamicMobileResolution=function(){$(".grid-stack").hasClass("dynamicRunMode")&&((window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<=renderGridOptions.minWidth?$(".grid-stack").addClass("grid-stack-one-column-mode"):0==$(".tileLayoutDiv").length&&$(".grid-stack").removeClass("grid-stack-one-column-mode"))};function swicthCompressMode(e){appGlobalVarsObject._CONSTANTS.compressedMode?void 0!==e&&""!=e?($(".compressedModeUI .inline-edit").each(function(e,t){$(t).find(".form-check-label").addClass("col-form-label-sm"),$(t).find(".form-check-input").removeClass("h-40px w-40px"),$(t).find(".selection .select2-selection").addClass("form-select-sm"),$(t).find(".select2-hidden-accessible").addClass("form-select-sm"),$(t).find(".edit-mode-content").addClass("input-group-sm"),$(t).find(".edit-mode-content .input-group").addClass("input-group-sm")}),$(".compressedModeUI table.customSetupTableMN tr textarea,.compressedModeUI table.customSetupTableMN tr label").addClass("py-0 min-h-25px h-25px"),$(".compressedModeUI table.customSetupTableMN").removeClass("mt-6").addClass("table-sm"),$(".compressedModeUI .dvdcframe .gridIconBtns a").addClass("btn-sm"),$(".compressedModeUI table.customSetupTableMN .form-check").addClass("py-0")):($(".compressedModeUI .input-group").each(function(e,t){$(t).addClass("input-group-sm"),$(t).find(".form-check-label").addClass("col-form-label-sm"),$(t).find(".form-check-input").removeClass("h-40px w-40px"),$(t).find(".selection .select2-selection").addClass("form-select-sm"),$(t).find(".select2-hidden-accessible").addClass("form-select-sm"),$(t).find(".form-check-input").parents(".agform").addClass("d-flex"),staticRunMode||$(t).find(".form-check-input").parents(".grid-stack-item").addClass("d-flex")}),$(".compressedModeUI .inline-edit").each(function(e,t){$(t).find(".form-check-label").addClass("col-form-label-sm"),$(t).find(".form-check-input").removeClass("h-40px w-40px"),$(t).find(".selection .select2-selection").addClass("form-select-sm"),$(t).find(".select2-hidden-accessible").addClass("form-select-sm")}),$(".compressedModeUI table.customSetupTableMN tr textarea,.compressedModeUI table.customSetupTableMN tr label").addClass("py-0 min-h-25px h-25px"),$(".compressedModeUI .labelcol").removeClass("row"),$(".compressedModeUI .fld-wrap3 label").addClass("col-form-label-sm m-0 p-0"),$(".compressedModeUI .agform").addClass("px-1"),$(".compressedModeUI table.customSetupTableMN").removeClass("mt-6").addClass("table-sm"),$(".compressedModeUI .toolbarRightMenu a,.compressedModeUI .toolbarRightMenu button").addClass("btn-sm"),$(".compressedModeUI .toolbarRightMenu a span,.compressedModeUI .toolbarRightMenu button span").addClass("material-icons-2"),$(".compressedModeUI .BottomToolbarBar a").addClass("btn-sm"),$(".compressedModeUI .BottomToolbarBar a span").addClass("material-icons-style material-icons-2"),$(".compressedModeUI .tstructBottomLeftButton a span").addClass("material-icons-style material-icons-2"),$(".compressedModeUI .tstructBottomLeftButton div.btn").addClass("btn-sm")):($(".content table.customSetupTableMN tr:not(.inline-edit) textarea,.content table.customSetupTableMN tr:not(.inline-edit) label").addClass("py-2 min-h-35px h-35px"),$(".content table.customSetupTableMN").removeClass("table-sm").addClass("mt-6"),$(".content .dvdcframe .gridIconBtns a").removeClass("btn-sm"),$(".content table.customSetupTableMN .form-check").addClass("py-2"),$(".content .dropzone").parent(".form-control").removeClass("p-0").addClass("p-1"),$(".content .form-check-input").parents(".agform").addClass("d-flex"),staticRunMode||$(".content .form-check-input").parents(".grid-stack-item").addClass("d-flex"))}function getlatlongitude(){try{var e=getRedisString("hybridinfo",callParentNew("hybridGUID"));if(""!=e){var t=JSON.parse(e);e=t.location.coords.latitude+","+t.location.coords.longitude;var i=axplatlongFldName+"000F"+GetDcNo(axplatlongFldName);SetFieldValue(i,e),UpdateFieldArray(i,"000",e,"parent"),MainBlur($j("#"+i)),$j("#"+i).blur()}}catch(a){}}function pinItemToTaskbar(e){var t=$(e).clone();if(t.find("a > i").remove(),t.hasClass("dropdown-submenu")){if(t.removeClass("dropdown-submenu"),t.children("a").append('<span class="icon-arrows-down"></span>'),"filterWrapper"==t.attr("id")||"modern"!=AxpTstButtonStyle&&"ivirCButtonsWrapper"==t.attr("id")?t.find("ul").hasClass("dropdown-menu")&&t.find("ul").removeClass("dropdown-menu"):(t.addClass("dropdown"),t.find("ul").removeAttr("style"),t.find("a#tasks")&&t.find("li").addClass("liTaskItems")),"ivirCButtonsWrapper"==t.attr("id")){var i=t.find("ul a:not(.active):eq(0)");$(i).find(".customIcon").removeClass("customIcon"),$(i).html($(i).html().replace($(i).text(),"")),t.html(i.clone())}}else t.addClass("actionWrapper");t.removeClass("waves-effect").removeClass("waves-block"),t.attr("id")&&t.attr("id","pinned"+t.attr("id")),$.each(t.find("*"),function(e,t){$(t).attr("id")&&$(t).attr("id","pinned"+$(t).attr("id"))}),$("#pinnediconsUl").append(t),setPinedIconContainerWidth()}function setPinedIconContainerWidth(){var e=$("#breadcrumb").outerWidth(!0)+$(".toolbarRightMenu").outerWidth(!0)+50;"undefined"!=typeof isAxpertPopup&&isAxpertPopup&&(e+=35),$(".modernButtonOptions #pinnedsearchBar").css({width:"calc(100vw - ".concat(e,"px)"),"max-width":"calc(100vw - ".concat(e,"px)")});var t=$("#pinnediconsUl").outerWidth(!0),i=0;$("ul#pinnediconsUl").children("li").each(function(){if((i+=$(this).outerWidth(!0))>t)return $(this).hide(),$(this).nextAll().hide(),!1;$(this).show(),$(this).nextAll().show()})}function hideacoptions(){isMobile&&($(".autoClickddl").parent(".edit").removeAttr("style"),$(".autoinputtxtclear").hide(),$(".virtualKeyboard").hide())}function getLocation(){var e={};if(findGetParameter("recordid")>0)e.latitude=$("#latitude000F"+GetDcNo("latitude")).val()||0,e.longitude=$("#longitude000F"+GetDcNo("longitude")).val()||0;else try{var t=callParentNew("ok");t&&(e=JSON.parse(t.getAndroidLocation()))}catch(i){}return($.isEmptyObject(e)||0==e.latitude||0==e.longitude)&&navigator.geolocation?navigator.geolocation.getCurrentPosition(showPosition):showPosition({coords:{latitude:e.latitude,longitude:e.longitude}})}function showPosition(e){var t="",i="";if(e&&e.coords&&0!=e.coords.latitude&&0!=e.coords.latitude&&!IsGridField("latitude")&&!IsGridField("longitude")){var a=GetDcNo("latitude"),r=GetDcNo("longitude");t="latitude000F"+a,i="longitude000F"+r,""==$("#"+t).val()&&($("#"+t).val(e.coords.latitude),UpdateFieldArray(t,"000",$("#"+t).val(),"parent")),""==$("#"+i).val()&&($("#"+i).val(e.coords.longitude),UpdateFieldArray(i,"000",$("#"+i).val(),"parent"));var o=callParentNew("googleMapsApiKey"),n={css:[],js:["https://maps.googleapis.com/maps/api/js?key=".concat(callParentNew("googleMapsApiKey"))]};-1!=$.inArray("latlongmap",FNames)&&o&&loadAndCall({files:n,callBack:function(){if(google){var e=GetDcNo("latlongmap"),a=$("#"+("latlongmap000F"+e)),r=center={lat:parseFloat($("#"+t).val()),lng:parseFloat($("#"+i).val())};(new google.maps.Geocoder).geocode({location:r},function(e,t){if("OK"===t&&e[0]&&(a.val(e[0].formatted_address).trigger("blur"),a.is("textarea"))){var i=new google.maps.Map(a.hide().before('<div class="'.concat(a.attr("class"),' style="').concat(a.attr("style"),'"></div>')).prev()[0],{zoom:8,center:center}),o=new google.maps.InfoWindow;i.setZoom(11);var n=new google.maps.Marker({position:r,map:i});o.setContent(e[0].formatted_address),o.open(i,n)}})}}})}return""!=$("#".concat(t)).val()&&""!=$("#".concat(i)).val()}function AxpFileFields(){"undefined"!=typeof AxpFileUploadFields&&AxpFileUploadFields.length>0?callParentNew("tstAxpFileFlds=",!0):callParentNew("tstAxpFileFlds=",!1)}function SetFieldSetCarryValue(){"0"!=recordid||"Save"!=AxActiveAction&&"New"!=AxActiveAction||("undefined"!=typeof FSetCarry&&FSetCarry.forEach(function(e){var t=GetDcNo(e);if(!IsDcGrid(t)){var i=e+"000F"+t;$.each(SetCarryFlds,function(e,a){if(a.split("♠")[0]==i){SetFieldValue(i,a.split("♠")[1]);var r=GetFieldsRowNo(i),o=GetDbRowNo(r,t);UpdateFieldArray(i,o,a.split("♠")[1],"parent","AutoComplete")}})}}),SetCarryFlds=new Array)}function GetFldSetCarryValue(){try{SetCarryFlds.length>0&&(SetCarryFlds=new Array),"undefined"!=typeof FSetCarry&&FSetCarry.forEach(function(e){var t=GetDcNo(e);if(!IsDcGrid(t)){var i=e+"000F"+t;SetCarryFlds.push(i+"♠"+$("#"+i).val())}})}catch(e){}}function OnMobileNewTst(){$("#wizardTstructWrapper wizardWrapper").remove(),$.each(DCIsGrid,function(e,t){"True"===t&&$("#wrapperForEditFields"+(e+1)+" .btnMobile").remove()})}function checkIfFormChanges(){return $(".grid-stack ").hasClass("dirty")?isFormChange=!0:isFormChange=!1,isFormChange}function SetAutoCompAccess(e,t){try{t==undefined?$j("input.fldFromSelect:disabled").parent().find("i").css("display","none"):"enabled"==e?t.parent().find("i").css("display","inline-block"):t.parent().find("i").css("display","none")}catch(i){console.log("SetAutoCompAccess-action"+e+"-msg"+i.message)}}function makeFieldInitCap(e){var t=GetFldNamesIndx("axp_initcap"),i="";if(-1!=t&&(GetExpressionType("axp_initcap",t),i=Expressions[t].toString()),""!=i){i=i.split(",");for(var a=0;a<i.length;a++)e?$("#DivFrame"+e).find('input[id*="'+i[a]+'"]').length>0&&$("#DivFrame"+e).find('input[id*="'+i[a]+'"]').addClass("initCapField"):$("input[id^='"+i[a]+"']").length>0&&$("input[id^='"+i[a]+"']").addClass("initCapField")}}function BeforeWindowClose(){FNames.filter(function(e){return e.toLowerCase().startsWith("axp_weight_")}).length>0&&appGlobalVarsObject._CONSTANTS.isHybrid&&closeWeightScalePort(),draftTimer&&window.clearInterval(draftTimer),window.parent.globalChange&&SetFormDirty(!1),window.opener&&!window.opener.closed&&window.opener.parent.tstructPop&&""!=AxActiveAction&&(window.opener.parent.tstructPop=!1,ReloadListView(window.opener.parent.listViewPage));var e=$j("#recordid000F0").val();if("0"!=e&&0==AxIsTstructLocked&&callParentNew("isLockOnRead"))try{ASB.WebService.UnlockTStructRecord(tst,e,!1)}catch(a){}if(1==axpRefreshParent&&(window.opener.document.title="Iview")){var t=window.opener.document.getElementById("hdnparamValues").value,i="ivtoivload.aspx?ivname="+window.opener.iName;i=i+"&"+t.replace(/¿/g,"&").replace(/~/g,"=")+"&axp_refresh=true",window.opener.document.getElementById("hdnIvRefresh").value="true",window.opener.document.location.href=i,navigator.userAgent.toUpperCase().indexOf("CHROME")>-1&&window.opener.document.getElementById("button1").click()}callParentNew("removeOverlayFromBody()","function")}function CheckCustomTStSave(){var e=$j("#axp_savedirective000F1"),t="",i="",a="";(t=e.val())!=undefined&&(t.indexOf("$")>-1&&(t=GetPopUpVal(t)),t.indexOf("~")>-1?(a=t.split("~"))[1]!=undefined&&(i=a[1].split("*"),a[0]!=undefined&&""!=a[0]&&(a.indexOf("iview")>-1?(axCustomTstAction="ivtoivload.aspx?ivname="+i[0],i[1]!=undefined&&""!=i[1]&&(axCustomTstAction+="&"+i[1])):a.indexOf("tstruct")>-1&&(axCustomTstAction="tstruct.aspx?transid="+i[0],i[1]!=undefined&&""!=i[1]&&(axCustomTstAction+="&"+i[1])))):axCustomTstAction=e.val())}function GetPopUpVal(e){var t=e.indexOf("$"),i=e.indexOf("*");return AxPopup=i>-1?e.substring(t+1,i):e.substring(t+1),e=e.replace("$"+AxPopup,"")}function LoadEvents(dvId){$('[data-toggle="tooltip"]').tooltip(),WizardKtInit(),createEditors();var autoDiv=dvId==undefined?"#divDc1":dvId;DropzoneInit(dvId),HeaderAttachFiles(),KTApp.initBootstrapPopovers(),createCheckListTokens(dvId),$j("input:not([id=searstr],[class=AxAddRows],[class=AxSearchField],.flatpickr-input,.gridRowChk),select:not([id=selectbox]),textarea:not(#txtCommentWF):not(.labelInp)").focus(function(){MainFocus($j(this))});var glType=eval(callParent("gllangType")),dtpkrRTL=!1;dtpkrRTL="ar"==glType;var glCulture=eval(callParent("glCulture")),dtFormat="d/m/Y";"en-us"==glCulture&&(dtFormat="m/d/Y"),$(".flatpickr-input").parent(".input-group").flatpickr({dateFormat:dtFormat,disableMobile:"true",wrap:!0,onChange:function(e,t,i){MainBlur($(i.element).find("input"))}}),$(".tstOnlyTime").parent(".input-group").flatpickr({enableTime:!0,noCalendar:!0,dateFormat:"H:i K",disableMobile:"true",wrap:!0,onChange:function(e,t,i){MainBlur($(i.element).find("input"))}}),$(document).off("mousedown.designer").on("mousedown.designer",".tstructDesignMode .grid-stack-item, .tstructDesignMode .ui-resizable",function(){setSelectedDesignElement(this)}),$(document).off("dragstop.designer").on("dragstop.designer",".tstructDesignMode.grid-stack",function(e,t){selectedDesignObject.elem=e.target}),$(document).off("change.designer").on("change.designer",".tstructDesignMode.grid-stack",function(e,t){setSelectedDesignElement(selectedDesignObject.elem)}),$(document).off("dragstart.designer resizestart.designer").on("dragstart.designer resizestart.designer",".tstructDesignMode.grid-stack",function(e,t){$(this).addClass("dirty"),changeStatus("notSaved")}),$(document).off("gsresizestop.designer").on("gsresizestop.designer",".tstructDesignMode.grid-stack",function(e,t){var i=$(t).attr("data-gs-height"),a=gsiPixels(i);gsiHeight={height:(isMobile?a+10:a).toString()+"px"}}),$j("textarea:not(#comment):not(.labelInp,.select2-search__field),[id]:text:not([id=searstr],[class=AxAddRows],[class=AxSearchField],.flatpickr-input,.gridHdrChk),[id][type=number]:not([id=searstr],[class=AxAddRows],[class=AxSearchField]),:password").blur(function(e){"design"!=theMode&&MainBlur($j(this))}),$j(document).mousedown(function(e){""!=e.target.id?(blurNextPreventElement=new Object,blurNextPreventId=e.target.id):(blurNextPreventId="",blurNextPreventElement=e.target)}),$j("select:not(#ddlSearch,#selectbox,.fldFromSelect):not(#designLayoutSelector)").change(function(){if(-1==$j(this).find(":selected").text().indexOf("+ Add"))MainBlur($j(this)),$j(this).blur(),$j(this).focus();else if(null!=$j(this).val()||$j(this).val()!=undefined){var ddlrefval=$j(this).val();$j(this).val(""),eval(ddlrefval)}}),$j(":checkbox:not([class=chkAllList],.gridHdrChk,.gridRowChk):not(.tokenSelectAll):not(#ckbCompressedMode):not(#ckbStaticRunMode):not(#ckbWizardDC):not('[id^=ckbGridStretch]'),:radio").not(".chkShwSel").change(function(){MainBlur($j(this))}),$j("textarea:not(.labelInp)").keydown(function(e){LimitText($j(this))}),$j("textarea:not(.labelInp)").keyup(function(){LimitText($j(this))}),$j(".number").keypress(function(e){return CheckNumeric(e,$j(this).val())}),$j("#searchoverrelay").unbind("keypress").keypress(function(e){if(13==e.keyCode&&!valid_submit())return!1}),$j(".axpImg").click(function(){if("Cancelled"!=tstructCancelled){var e=$j(this)[0].id;null==document.getElementById(e).onclick&&UploadImg(e)}}),$j(".signaturePad").click(function(){if("Cancelled"!=tstructCancelled){var e=$j(this)[0].id;null==document.getElementById(e).onclick&&openSignaturePad(e)}}),$j(".divBarQrScan").click(function(){if("Cancelled"!=tstructCancelled){var e=$j(this).parent().find("input")[0].id;null==document.getElementById(e).onclick&&openBarQrScanner(e)}}),$(".axpBtn").off("click.axpBtn").on("click.axpBtn",function(){var e=$j(this);if(e.length>0){var t=GetFieldsRowNo(e[0].id),i=GetFieldsDcNo(e[0].id);RegisterActiveRow(t,i),CallAction(e[0].id)}}),$j(".rowdelete").click(function(){DeleteCurrentRow($j(this))}),$j(".subGrid").click(function(){ShowPopUp($j(this))}),$j("#taskListPopUp").hide(),$j(".AxAddRows").blur(function(){if(!this.value||isNaN(this.value))return this.value="1"}),$j(".achklist").click(function(){$j(this).parent().next(".chkListBdr").toggle()}),$j(".spandate").click(function(){$j(this).prev().focus()}),$j(".spanTime").click(function(){$j(this).prev().find("input").focus()}),$(document).on("keypress",dvId+" .form-group span.fa-paperclip",function(e){"13"==e.which&&$(this).click()}),$j(".rowdelete img").hover(function(){$j(this).attr("src","../axpimages/icons/16x16/delete.png")},function(){$j(this).attr("src","../axpimages/icons/16x16/delete-fade.png")}),1==parent.MainNewEdit&&$j("html").addClass("makeFullHeight");try{$j("#popupIframeRemodal",parent.document).attr("src")!=undefined&&$j(document).keyup(function(e){27===e.keyCode&&(IsFormDirty&&0===$("#bootstrapModal").length?$.confirm({theme:"modern",closeIcon:!1,title:eval(callParent("lcm[155]")),content:eval(callParent("lcm[121]")),escapeKey:"buttonB",onContentReady:function(){disableBackDrop("bind")},buttons:{buttonA:{text:eval(callParent("lcm[164]")),btnClass:"btn btn-primary",action:function(){$j(".remodal-close",parent.document).click()}},buttonB:{text:eval(callParent("lcm[192]")),btnClass:"btn btn-bg-light btn-color-danger btn-active-light-danger",action:function(){return disableBackDrop("destroy"),!0}}}}):1===$("#bootstrapModal").length||$j(".remodal-close",parent.document).click())})}catch(ex){console.log(ex.message)}$==undefined&&($=$j),jQuery.browser={},jQuery.browser.msie=!1,jQuery.browser.version=0,navigator.userAgent.match(/MSIE ([0-9]+)\./)&&(jQuery.browser.msie=!0,jQuery.browser.version=RegExp.$1),$j(".clsPrps").length>0?$j("#tgPurpose").css("display","inline-block"):$j("#tgPurpose").css("display","none"),$j("input.number").on("input",function(){var e=$j(this).val(),t=$j(this).attr("id");if(t!=undefined){var i=GetFieldsName(t),a=$j.inArray(i,FNames);if(a!=undefined&&a>-1){var r=FMaxLength[a],o=FDecimal[a];if("Numeric"==FDataType[a]&&o!=undefined&&o>0){var n=r-o-1;if(-1==e.indexOf("."))e.length>n&&$j(this).val(e.slice(0,n));else if(-1!=e.indexOf(".")){var l=e.substring(0,e.indexOf(".")),s=e.substring(e.indexOf(".")+1,e.length);l.length>n&&(l=l.slice(0,n)),s.length>o&&(s=s.slice(0,o)),$j(this).val(l+"."+s)}}}}}),$(document).off("click",".weightScaleIcon").on("click",".weightScaleIcon",function(){var e=this;if(appGlobalVarsObject._CONSTANTS.isHybrid){getRedisString("HybridWeightScaleInfo",callParentNew("hybridGUID"));$(this).parent(".weightScale").parent().children("input").focus();try{ShowDimmer(!0),ASB.WebService.NotifyHybridForWeightScale(callParentNew("hybridGUID"),function(t){"success"==t?getHybridWeightScaleInfo($(e).parent(".weightScale").parent().children("input").attr("id")):(ShowDimmer(!1),showAlertDialog("error","Error occurred while fetching weight. Please try again."))},function(e){ShowDimmer(!1),showAlertDialog("error","Error occurred while fetching weight. Please try again.")})}catch(t){ShowDimmer(!1),showAlertDialog("error","Exception occurred while fetching weight.")}}else showAlertDialog("error","Please close the application and login again.")}),$(document).off("change",".tstfldImage").on("change",".tstfldImage",function(e){TstFldImageUpload(e.target)}),$j(".fldImageCamera").click(function(){var e=$(".fldImageCamera").parent(".image-input").find("input").attr("id");UploadCaptureImage(e)}),"undefined"!=typeof AxpCameraOption&&("undefined"==typeof AxpCameraOption||""!=AxpCameraOption&&"true"==AxpCameraOption)||$(".fldImageCamera").removeClass("d-none")}function WizardKtInit(){if("undefined"!=typeof isWizardTstruct&&isWizardTstruct){var e=document.querySelector("#wbdrHtml"),t=new KTStepper(e);t.on("kt.stepper.click",function(e){var t=$(e.element).find(".flex-column.current").attr("id").slice(8);if(t<e.getClickedStepIndex()){if(!ValidateBeforeSubmit(t))return!1;e.goTo(e.getClickedStepIndex())}else e.goTo(e.getClickedStepIndex())}),t.on("kt.stepper.next",function(e){var t=$(e.element).find(".flex-column.current").attr("id").slice(8),i=$(e.element).find(".flex-column.current").nextAll(".flex-column");if(!(wizardHidenDcNos.length>0))return!!ValidateBeforeSubmit(t)&&e.goNext();var a=!1;return i.each(function(){var t=$(this).attr("id");if(t=parseInt(t.slice(8)),!wizardHidenDcNos.includes(t))return a=!0,!1;e.goNext()}),a?!!ValidateBeforeSubmit(t)&&e.goNext():void 0}),t.on("kt.stepper.previous",function(e){$(e.element).find(".flex-column.current").attr("id").slice(8);var t=$(e.element).find(".flex-column.current").prevAll(".flex-column");if(wizardHidenDcNos.length>0){var i=!1;t.each(function(){var t=$(this).attr("id");if(t=parseInt(t.slice(8)),!wizardHidenDcNos.includes(t))return i=!0,!1;e.goPrevious()}),i&&e.goPrevious()}else e.goPrevious()})}}function createCheckListTokens(e){$((e?"#"+e:"")+" .form-select.multiFldChklist:not(span)").each(function(){var e=$(this).data("valuelist"),t="object"==_typeof(e)?e:_toConsumableArray(new Set($(this).data("valuelist").split($(this).data("separator"))));if(""!=t){var i=$.map(t,function(e){return{id:e,text:e}});$(this).select2({data:i}).on("select2:unselect select2:select",function(e){var t=$(this).attr("id"),i=$(this).val();if(void 0!==$(this).data("separator")&&i.length>1){var a=$(this).data("separator");i=i.join(a)}GetFieldsRowFrameNo(t);var r=GetFieldsDcNo(t),o=GetDbRowNo(GetFieldsRowNo(t),r);UpdateFieldArray(t,o,i,"parent","AutoComplete")})}})}function checkAllCheckBoxTokens(e){var t=$("#"+$(e).parents("ul").data("hiddenAutoComp")),i=$(e).parents(".input-group").find(".tokenfield input.multiFldChk");if(t==i)var a=i;else a=t;if($(e).is(":checked")){var r=a.data("valuelist");a.tokenfield("setTokens","string"==typeof r?r.split(a.data("separator")):r)}else a.val(""),a.tokenfield("setTokens",[]);try{i.data("bs.tokenfield").$input.trigger("blur")}catch(o){}}function ShowPopUp(e){var t=e.attr("id"),i=e.parent().find("input");0==i.length&&(i=e.parent().find("select")),OpenPopUp(i.attr("id"),t)}function FocusOnFirstField(e){if("form"==e)for(var t=$j('[id*="divDc"]'),i=0;i<t.length;i++)if($j(t[i]).is(":visible")){e=t[i].id.substring(t[i].id.indexOf("divDc")+5);break}var a="";if(a=IsDcGrid(e)?"#wrapperForEditFields"+e:"#divDc"+e,$j(a).length>0){try{-1!=$j.inArray("1",TabDCs)||isMobile?isMobile&&$("#wizardBodyContent").length&&$("#wizardBodyContent").scrollTop(0):$j(a).focus()}catch(o){}var r=getFirstFocusElement(a);if(r!=undefined&&r.length>0&&!isMobile)return r.focus(),r;if(isMobile&&$("#wizardBodyContent").length)$("#wizardBodyContent").scrollTop(0);else if(isMobile&&axInlineGridEdit)return r.focus(),r}}function SetFocusAfterSaveOnLoad(){var e=focusAfterSaveOnLoad;focusAfterSaveOnLoad="";GetFieldsName(e);var t=GetFieldsDcNo(e);if(IsDcGrid(t)){var i=e.substring(e.lastIndexOf("F")-3,e.lastIndexOf("F"));$("#ank"+t).length>0&&!$("#ank"+t).parent().hasClass("active")?($("#ank"+t).click(),setTimeout(function(){$("#gridHd"+t+" tbody tr[id=sp"+t+"R"+i+"F"+t+"]").find(".glyphicon-pencil").parent().click(),setTimeout(function(){$j("#"+e).focus()},50)},300)):$("#ank"+t).length>0&&$("#ank"+t).parent().hasClass("active")&&($("#gridHd"+t+" tbody tr[id=sp"+t+"R"+i+"F"+t+"]").find(".glyphicon-pencil").parent().click(),setTimeout(function(){$j("#"+e).focus()},50))}else $("#ank"+t).length>0&&!$("#ank"+t).parent().hasClass("active")?($("#ank"+t).click(),setTimeout(function(){$j("#"+e).focus()},210)):$j("#"+e).focus()}function DisplaySearchDlg(){$j(window).keydown(function(e){OpenSearchPop(e)}),window.parent&&$j(window.parent).keydown(function(e){OpenSearchPop(e)})}function LockTstruct(){Readonlyform(),$j("#icons").find("*").attr("disabled",!0),$j("#icons").find("*").prop("disabled",!0),$j(".search").length>0&&$j(".search").removeProp("disabled"),$j(".add").length>0&&$j(".add").find("*").removeProp("disabled"),$j(".pdf").length>0&&$j(".pdf").find("*").removeProp("disabled"),$j(".listview").length>0&&$j(".listview").find("*").removeProp("disabled")}function loadingNew(){Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler)}function EndRequestHandler(e,t){if(t.get_error()==undefined){if($j("#goval").length>0){var i=$j("#goval");"go"==i.val()&&(FillDiv("Show"),$j("#searstr").val(DecodeUrlSplChars($j("#hdnSearchStr").val())),i.val("d"))}ShowDimmer(!1);var a=$j("#hdnHtml"),r=$j("#hdnFilename");"Save"==a.val()&&(showAlertDialog("success",2028,"client",r.val()),a.val(""))}else showAlertDialog("error",2029,"client",t.get_error().message)}function displaysearchDiv(e,t){$j("#"+e).show(),$j("#"+e).addClass("Pagebody Bordercolor"),$j("#searchoverrelay").parent().removeClass("d-none"),$j("#searchoverrelay").css("display","block"),Resizewindow()}function FillDiv(e){"Show"==e?$("#srchcontent").removeClass("d-none"):$("#srchcontent").addClass("d-none"),Resizewindow()}function Pagination(){$j("#goval").val("go"),ShowDimmer(!0)}function Closediv(){$j("#Panel1").hide(),$j("#srchcontent").addClass("d-none"),$j("#searchoverrelay").parent().addClass("d-none"),$j("#searchoverrelay").css("display","none")}function hiddenFloatingDiv(e){document.getElementById(e).style.display="none",document.getElementById("dimmer").style.display="none",DivID="",Resizewindow()}function Resizewindow(){document.getElementById("closeimg")}function togglesrchselect(){var e=!1;e=!!document.getElementById("searchall").checked;for(var t=0;t<document.getElementById("s1").options.length;t++){var i="search"+t;document.getElementById(i).checked=e}}function PopupfadeTo(e,t){e=$j("#"+e.id),t<=100&&(t<0?(t=100,document.body.style.cursor="default"):(document.body.style.cursor="Hand",t=65),SetOpacity(e,t))}function valid_submit(){GetCurrentTime("Tstruct load on Search Go button click(ajax call)"),$j("#goval").val("go");var e=$j("#searstr");if(txtVal=CheckUrlSplChars(e.val()),ValidateSrchFlds()){$j("#hdnSearchStr").val(txtVal),$j("#searstr").val("");var t=$j("#btnGo");t.length>0&&(GetProcessTime(),$j("#hdnbElapsTimeGo").val(callParentNew("browserElapsTime")),t.click())}else""!=txtVal&&null!=txtVal&&txtVal!=undefined||showAlertDialog("warning",2007,"client")}function DecodeUrlSplChars(e){return e=(e=(e=(e=(e=(e=e.replace(/&/g,"&amp;")).replace(/%25/g,"%")).replace(/%26/g,"&")).replace(/%27/g,"'")).replace(/%22/g,'"')).replace(/%23/g,"#")}function ValidateSrchFlds(){var e=$j("#ddlSearch").val(),t=$j.inArray(e,FNames),i=$j.trim($j("#searstr").val());if(-1!=t&&""!=i){if("Date/Time"==FDataType[t]){var a=$j("#searstr");return isDate(a.val())?(a.focus(),!0):(a.focus(),!1)}return!0}return!1}function loadTstruct(e){WireElapsTime(serverprocesstime,requestProcess_logtime),ShowDimmer(!0),ResetNavGlobalVariables(),AxWaitCursor(!0);try{window.parent.isSessionCleared||window.opener||(ASB.WebService.ClearNavigationSession(),window.parent.isSessionCleared=!0),window.opener?window.opener.parent.disableNavigation=!0:window.parent.disableNavigation=!0,GetLoadData(e,"")}catch(t){Closediv()}}$j(document).ready(function(){if("undefined"!=typeof isTstPostBackVal&&""!=isTstPostBackVal||WireElapsTime(serverprocesstime,requestProcess_logtime),AxpGridForm=""!=AxpGridFormCols?AxpGridFormCols.split("♠")[0]:"popup","design"==theMode&&($(callParentNew("splitIcon","id")).css({display:""}).removeClass("hide"),$(callParentNew("spiltHeading","class")).css({display:""}).removeClass("hide")),tstReadOnly=!1,"function"==typeof commonReadyTasks&&commonReadyTasks(),"undefined"!=typeof isTstPostBackVal&&""!=isTstPostBackVal){var resval=isTstPostBackVal.split("*$*"),wBdrHtml=resval[0];$("#wBdr").html(""),$("#wBdr").prepend(wBdrHtml);var toolBarHtml=resval[1];if(("undefined"==typeof isWizardTstruct||0==isWizardTstruct)&&"False"==IsObjCustomHtml){$("#tstIcons").html(""),$("#tstIcons").prepend(toolBarHtml),$("#iconsNewOptionIcon").after(""),$("#iconsNewOptionIcon").after(toolBarHtml),$("#tstModernOpenIcons").html("");var modenFooter=resval[2];""!=modenFooter&&($("#tstModernOpenIcons").prepend(modenFooter.split("♦")[0]),btnfooteropenlist=modenFooter.split("♦")[1],btnfooteropenlist.indexOf("<li>")>-1&&(btnfooteropenlist=""))}}$("#btnSaveTst").prop({value:callParentNew("lcm")[392],title:eval(callParent("lcm[392]"))}),$("#New").prop({value:callParentNew("lcm")[393],title:eval(callParent("lcm[393]"))}),SetFormDirty(!1),AxpIviewDisableSplit=AxpIviewDisableSplit.toLowerCase(),compressedMode=appGlobalVarsObject._CONSTANTS.compressedMode,isMobile||"false"!=isTstPop.toLowerCase()?($(callParentNew("split-btn","class")).addClass("hide"),$(callParentNew("split-btn-vertical","class")).addClass("hide")):AxpIviewDisableSplit!=undefined&&"false"==AxpIviewDisableSplit?($(callParentNew("split-btn","class")).css({display:""}).removeClass("hide"),$(callParentNew("split-btn-vertical","class")).css({display:""}).removeClass("hide")):"true"===AxpIviewDisableSplit?($(callParentNew("splitIcon","id")).addClass("hide"),$(callParentNew("spiltHeading","class")).addClass("hide")):""===AxpIviewDisableSplit&&($(callParentNew("splitIcon","id")).css({display:""}).removeClass("hide"),$(callParentNew("spiltHeading","class")).css({display:""}).removeClass("hide")),"true"==AxpIsAutoSplit.toLowerCase()&&!1===callParentNew("isTstructSplited")&&callParentNew("assocateIframe(true)","function");var glangType=eval(callParent("gllangType"));"ar"===glangType&&$("[data-toggle=popover]").each(function(){$(this).data("placement","left")}),$==undefined&&($=$j);try{if(DCIsPopGrid.indexOf("True")>-1)return void(window.location.href="err.aspx?errmsg=Axpertweb 11.0 popgrid (subgrid) is not supporting, please change the definition and try again..");AxBeforeTstLoad()}catch(ex){$j("div#wBdr").show(),ShowDimmer(!1)}var t0=performance.now();AxStartTime=new Date,$(document).on("click","#icons,#btnSaveTst,.BottomToolbarBar a",function(e){if(actionCallFlag!=actionCallbackFlag)return e.stopPropagation,e.preventDefault(),void $("#icons,#btnSaveTst,.BottomToolbarBar a").css({"pointer-events":"none"})});try{hideDiscardButton(),switchTstructMode(),GetFormDetails(),loadingNew(),LoadGridScript(),AxAutoGenDeps=GetDependentArray(),AddVisTabDcsInArray(),OnTstructLoad(),SetFieldSetCarryValue(),AxpFileFields(),"undefined"!=typeof isTstPostBackVal&&""!=isTstPostBackVal&&(isTstPostBackVal="",recordid=$("#axp_recid1000F1").val(),$j("#recordid000F0").val($("#axp_recid1000F1").val()))}catch(ex){$j("div#wBdr").show(),ShowDimmer(!1)}"ARABIC"==gl_language&&$j("#pagebdy").css("direction","rtl"),SetGridBtnAccess(),"design"!=mode&&LoadEvents(),$(window).resize(dynamicMobileResolution),CheckCustFooter(),CheckCustomTStSave(),SetAutoCompAccess(""),"undefined"!=typeof focusAfterSaveOnLoad&&""!=focusAfterSaveOnLoad?SetFocusAfterSaveOnLoad():FocusOnFirstField("form"),SetFocusFormControl();try{"axpwf"==transid&&tstwfcomments(),AxAfterTstLoad()}catch(ex){}if(AxIsTstructLocked&&LockTstruct(),jQuery.browser={},jQuery.browser.msie=!1,jQuery.browser.version=0,navigator.userAgent.match(/MSIE ([0-9]+)\./)&&(jQuery.browser.msie=!0,jQuery.browser.version=RegExp.$1),$j(".clsPrps").length>0?$j("#tgPurpose").css("display","inline-block"):$j("#tgPurpose").css("display","none"),$('[data-toggle="popover"]').popover({container:"body"}),checkSuccessAxpertMsg(),eval(callParent("isPrintPDFClick"))&&$j(".printhtmltopdf").click(),eval(callParent("isSaveAndPrintClick"))){var isSPValues=[];isSPValues=eval(callParent("isSavePrintValues")),OpenPdfFile(isSPValues[0],isSPValues[1],isSPValues[2],isSPValues[3],""),eval(callParent("isSaveAndPrintClick")+"= false"),eval(callParent("isSavePrintValues")+"=[]")}makeFieldInitCap();var t1=performance.now();if($("div").scroll(function(){$("#ui-datepicker-div").hide()}),$("[data-axp-url]").each(function(){$(this).after("<br/>"),inputId=$(this).attr("for"),text=$(this).text(),$(this).text(""),$("#"+inputId).attr("type","hidden"),urlValue=$("#"+inputId).val(),url=""==$("#"+inputId).val()?"javascript:void(0);":"window.open('"+urlValue+"','newwindow','width=600,height=500')",$("#"+inputId).after("<a style='cursor:pointer' onclick="+url+">"+text+"</a>")}),"undefined"!=typeof btnfooterlist&&""!=btnfooterlist&&$("#ftbtn_iList").attr("onClick",btnfooterlist),"undefined"!=typeof btnfooteropenlist&&""!=btnfooteropenlist&&"False"==IsObjCustomHtml&&($("#dvFooter").hide(),$.each(btnfooteropenlist.split(","),function(e,t){""!=t&&$("#"+t).removeClass("d-none")}),"0"!=recordid&&$("#ftbtn_iSave").removeAttr("class").addClass("btn btn-white btn-color-gray-700 btn-active-primary d-inline-flex align-items-center shadow-sm me-2 dwbIvBtnbtm")),"undefined"!=typeof dvRefreshFromLoadModern&&"true"==dvRefreshFromLoadModern&&$("#dvRefreshFromLoadModern").show(),"undefined"!=typeof hideToolBar&&hideToolBar&&0==$("#design").length&&"design"!=theMode){var srchBarHt=28;$("#searchBar").hide(),$(".dvheightframe").first().css("top","0px"),"undefined"!=typeof isWizardTstruct&&isWizardTstruct?$("#wizardBodyContent").height($("#wizardBodyContent").height()+srchBarHt):(srchBarHt=srchBarHt+5+8,$("#pagebdy").height($("#pagebdy").height()+srchBarHt),$(".dvheightframe").first().attr("style",$(".dvheightframe").first().attr("style")+";height:"+($(".dvheightframe").first().height()+srchBarHt)+"px !important;"))}var curFrameObj=$(window.frameElement);if(("axpiframe"===curFrameObj.attr("id")||"homePageDynamicFrame"===curFrameObj.attr("id")||curFrameObj.attr("id").startsWith("homePageFrame"))&&(iframeindex=1,$j("#goback").hide()),callParentNew("IsfieldaddInDesignMode")&&(callParentNew("IsfieldaddInDesignMode=",!1),$(".grid-stack").addClass("dirty")),isMobile&&"none"==mobileCardLayout&&($("#wizardHeader").addClass("mobileHeader"),$.each(DCIsGrid,function(e,t){if("True"===t){$("#wrapperForEditFields"+(e+1)).removeClass("d-none"),$("#wrapperForEditFields"+(e+1)).addClass("mobilewrapperForEditFields"),0!=$(".wrapperForGridData"+(e+1)+" table tbody tr").length||axInlineGridEdit||$("#colScroll"+(e+1)).hide(),axInlineGridEdit&&$(".editWrapTr").hide(),$(".editLayoutFooter").hide(),$("#DivFrame".concat(e+1," .newgridbtn")).addClass("d-none");var i=$("#DivFrame".concat(e+1," .newgridbtn>ul")).html();$("#wrapperForEditFields".concat(e+1)).append('<div class="clearfix"></div><div class="grdButtons btnMobile d-none"><ul class="left">'.concat(i,"</ul></div>")),$("#wrapperForEditFields".concat(e+1," .btnMobile")).find("#viewGrid".concat(e+1)).addClass("d-none")}})),$(document).off("focus",".select2.select2-container"),$(document).on("focus",".select2.select2-container",function(e){var t=e.originalEvent,i=$(this).find(".select2-selection--single").length>0;t&&i&&("open"==select2EventType?(select2EventType="",select2IsOpened=!1,select2IsFocused=!1):select2IsOpened?select2EventType="click":(select2IsFocused=!0,select2EventType="tab"),$(this).siblings("select:enabled").select2("open"))}),$j("input:not([id=searstr],[class=AxAddRows],[class=AxSearchField]),select:not([id=selectbox]),textarea:not(#txtCommentWF):not(.labelInp),input[type=checkbox],li.dropdown-chose").bind("keydown",function(e){var t=e.keyCode||e.which,i=$(this);if(!$(this).hasClass("fldFromSelect"))if(9!=t||e.shiftKey){if(9==t&&e.shiftKey){var a;o=$(this).closest("[class*=fldindex]").data("dataindex");void 0!==$(this).attr("id")?a=$(this).attr("id").substring($(this).attr("id").lastIndexOf("F")+1,$(this).attr("id").length):$(this).hasClass("tokenSelectAll")&&(a=$(this).closest("div").attr("name").substring($(this).closest("div").attr("name").lastIndexOf("F")+1,$(this).closest("div").attr("name").length));n=[];$(this).closest("#divDc"+a).find(".grid-stack-item").find("[class*=fldindex]").each(function(e,t){var i=GetFieldsName($(this).find("input:not([id=searstr],[class=AxAddRows],[class=AxSearchField]),select:not([id=selectbox]),textarea:not(#txtCommentWF):not(.labelInp),input[type=checkbox]").attr("id")),a=$j.inArray(i,FNames);"none"!=$(this).css("display")&&"F"!=GetFieldProp(a,"tabStop")&&n.push($(this).data("dataindex"))}),n.sort(function(e,t){return e-t}).reverse(),$.each(n,function(t,r){if(o>r){var l=$j(i).closest("#divDc"+a).find("[data-dataindex="+r+"]").find("input:not([id=searstr],[class=AxAddRows],[class=AxSearchField]),select:not([id=selectbox]),textarea:not(#txtCommentWF):not(.labelInp),input[type=checkbox]");if(void 0===$("#"+$(l).attr("id")).attr("disabled")&&void 0===$("#"+$(l).attr("id")).attr("readonly")){if(!$("#"+$(l).attr("id")).hasClass("axpImg")&&!$("#"+$(l).attr("id")).hasClass("fldmultiSelect"))return 4!=$(l).length&&($("#"+$(l).attr("id")).focus().select(),e.preventDefault(),!1);if($("#"+$(l).attr("id")).hasClass("fldmultiSelect"))return 4!=$(l).length&&($("#"+$(l).attr("id")).parent(".dropdown-mul").find(".fldmultiSelectInput").click(),e.preventDefault(),!1)}else n.length-1==t&&$(".tstructMainBottomFooter a:visible:eq(0)").focus()}})}}else{var r,o=$(this).closest("[class*=fldindex]").data("dataindex");void 0!==$(this).attr("id")?r=$(this).attr("id").substring($(this).attr("id").lastIndexOf("F")+1,$(this).attr("id").length):$(this).hasClass("tokenSelectAll")&&(r=$(this).closest("div").attr("name").substring($(this).closest("div").attr("name").lastIndexOf("F")+1,$(this).closest("div").attr("name").length));var n=[];$(this).closest("#divDc"+r).find(".grid-stack-item").find("[class*=fldindex]").each(function(e,t){var i=GetFieldsName($(this).find("input:not([id=searstr],[class=AxAddRows],[class=AxSearchField]),select:not([id=selectbox]),textarea:not(#txtCommentWF):not(.labelInp),input[type=checkbox]").attr("id")),a=$j.inArray(i,FNames);"none"!=$(this).css("display")&&"F"!=GetFieldProp(a,"tabStop")&&n.push($(this).data("dataindex"))}),n.sort(function(e,t){return e-t}),$.each(n,function(t,a){if(o<a){var l=$j(i).closest("#divDc"+r).find("[data-dataindex="+a+"]").find("input:not([id=searstr],[class=AxAddRows],[class=AxSearchField]),select:not([id=selectbox]),textarea:not(#txtCommentWF):not(.labelInp),input[type=checkbox]");if(void 0===$("#"+$(l).attr("id")).attr("disabled")&&void 0===$("#"+$(l).attr("id")).attr("readonly")){if(!$("#"+$(l).attr("id")).hasClass("axpImg")&&!$("#"+$(l).attr("id")).hasClass("fldmultiSelect"))return 4!=$(l).length&&($("#"+$(l).attr("id")).focus().select(),e.preventDefault(),!1);if($("#"+$(l).attr("id")).hasClass("fldmultiSelect"))return 4!=$(l).length&&($("#"+$(l).attr("id")).parent(".dropdown-mul").find(".fldmultiSelectInput").click(),e.preventDefault(),!1)}else n.length-1==t&&$(".tstructMainBottomFooter a:visible:eq(0)").focus()}})}}),setTimeout(function(){if("undefined"!=typeof isWizardTstruct&&isWizardTstruct){$("#wizardTstructWrapper").outerHeight(!0),$("#toolBarBtns").outerHeight();var e=$("#wizardBodyFooterWrapper").outerHeight(!0);$("#wizardHeader").outerHeight(!0)}else{e=$("#heightframe").outerHeight(!0),$("#dvlayout").outerHeight(!0);var t=$(".tstructMainBottomFooter").outerHeight(!0);if("axglo"==transid)$("#heightframe").css({height:"calc(100vh - 95px)"});else{if($("body").hasClass("formLayoutWidth")){var i=$("#wBdr").outerHeight(!0);i<e?$(".tstructMainBottomFooter").css({bottom:"".concat(e-(i+t),"px")}):$(".tstructMainBottomFooter").css({bottom:"-".concat(t,"px")})}if(!isMobile&&$("#DivFrame1").outerHeight()<$("#heightframe").outerHeight()){if($("#tabsCont2 .dvdcframe").length>0){var a=$("#tabsCont2 .dvdcframe").height()+$("#myTab").outerHeight(!0)+($("#heightframe").outerHeight(!0)-$("#DivFrame1").outerHeight(!0)-$("#tabsCont2").parents(".wrapper").outerHeight(!0)-20);$("#tabsCont2 .dvdcframe").css({"min-height":a})}$.each(DCIsGrid,function(e){"False"==DCIsGrid[e]&&0!=e&&$("#DivFrame"+(e+1)).addClass("nonGridDcTab")})}}}},50),"design"!=theMode&&isMobile&&-1!=$.inArray("axp_latlong",FNames)){var llIndex=$.inArray("axp_latlong",FNames);axplatlongFldName=FNames[llIndex],callParentNew("LocationInfoAPI()","function")}if("design"!=theMode&&-1!=$.inArray("latitude",FNames)&&-1!=$.inArray("longitude",FNames))var counter=0,intervalID=setInterval(function(){10==++counter&&clearInterval(intervalID);var e="latitude000F".concat(GetDcNo("latitude")),t="longitude000F".concat(GetDcNo("longitude"));""==$("#".concat(e)).val()&&""==$("#".concat(t)).val()&&!0===getLocation()&&clearInterval(intervalID)},1e3);if(breadCrumbStr){var brcList="";breadCrumbStr.split(" > ").forEach(function(e){""!=e&&(brcList+='<li class="breadcrumb-item text-muted">'+e+"</li>")}),$("#breadcrumb-panel").append('<ul class="breadcrumb fw-bold fs-base my-1">'+brcList+'<li class="breadcrumb-item text-dark">'+$("#breadcrumb-panel h1").text()+"</li></ul>")}if(isMobile&&($("#breadcrumb-panel").attr({"data-toggle":"popover","data-placement":"bottom","data-content":""}),$("#breadcrumb-panel[data-toggle=popover]").popover({content:$(".menuBreadCrumb").length>1?$(".menuBreadCrumb").text():$(".tstivCaption ").text(),container:"body"})),"undefined"!=typeof AutosaveDraft&&"true"==AutosaveDraft&&""!=savedraftKeyCreatedtime&&(window.location.href.includes("act")||window.location.href.includes("recordid")||loadSavedDraft(savedraftKeyCreatedtime),savedraftKeyCreatedtime=""),"undefined"!=typeof AutosaveDraft&&"true"==AutosaveDraft&&""!=AutosaveDraftTime&&(draftSetTimeoutObj=setInterval(SaveAsDraft,parseInt(AutosaveDraftTime))),"undefined"!=typeof gridScrollBar&&"true"==gridScrollBar){$("#heightframe").css({"overflow-x":"scroll"}),$(".griddivColumn").css({"padding-left":"0",width:"100%",overflow:"inherit"});var gridMainWidth=$(".griddivColumn .customSetupTableMN").width()+($(".griddivColumn .customSetupTableMN").parents(".dvdcframe").outerWidth()-$(".griddivColumn .customSetupTableMN").parents(".dvdcframe").width());$(".griddivColumn .customSetupTableMN").parents(".dvdcframe").css({width:gridMainWidth}),$(".griddivColumn").parents().find(".dcTitle").css({display:"block"}),$("body").hasClass("btextDir-rtl")?$(".griddivColumn").parents().find(".newgridbtn").css({float:"right"}):$(".griddivColumn").parents().find(".newgridbtn").css({float:"left"})}"undefined"!=typeof gridFixedHeader&&"true"==gridFixedHeader&&$(".griddivColumn ").addClass("gridFixedHeader"),hideacoptions(),$("input.fldFromSelect").off("click"),$("input.fldFromSelect").on("click",function(){if(isMobile){var e=$(this).attr("id");""!=e&&$("#"+e).hasClass("fldFromSelect")&&$("#"+e).removeClass("fldFromSelect")}}),appGlobalVarsObject._CONSTANTS.compressedMode&&appGlobalVarsObject.methods.toggleCompressModeUI($("body")),swicthCompressMode(),$(".fldCustTableIcon").off("click.fldCustTableIcona"),$(".fldCustTableIcon").on("click.fldCustTableIcona",function(e){FieldTypeTable(e,this)}),$(".fldCustTable ").off("keydown.fldtblA"),$(".fldCustTable ").on("keydown.fldtblA",function(e){13==e.keyCode&&FieldTypeTable(e,this)}),$(".toggle-password").click(function(){$(this).toggleClass("fa-eye fa-eye-slash");var e=$($(this).attr("toggle"));"password"==e.attr("type")?e.attr("type","text"):e.attr("type","password")}),$("#searchBar").on("click","ul.dropdown-menu [data-toggle=dropdown]",function(e){e.preventDefault(),e.stopPropagation(),$(this).parent().siblings().removeClass("open"),$(this).parent().toggleClass("open")}),isMobile&&($("body").addClass("isMobile"),$("#design").hide()),$("#iconsNew .right").off("click.subMenu",".dropdown-submenu a").on("click.subMenu",".dropdown-submenu a",function(e){var t=$(this).next("ul");$.each($("#iconsUl ul").not(t),function(e,t){$(t).is(":visible")&&$(t).hide()}),$(this).next("ul").toggle(),e.stopPropagation(),e.preventDefault()}),$("#iconsNew .right.dropdown").off("click.menu").on("click.menu",function(e){isMobile&&$(".pinIcon, .iconUIPin").hide(),$(this).hasClass("open")&&$(this).find(".dropdown-submenu ul.dropdown-menu").hide()}),$(".imageFileUpload").parents().find(".flex-root").parent().addClass("d-flex flex-column"),GetProcessTime(),GetTotalElapsTime(),$(".modernButtonOptions #iconsUl > li.dropdown-submenu").on("click",function(e){$("#iconsUl > li:visible").index(this)%3==0?$(this).find("ul").css({left:"0px"}):$("#iconsUl > li:visible").index(this)%3==1?$(this).find("ul").css({left:"-110px"}):$("#iconsUl > li:visible").index(this)%3==2&&$(this).find("ul").css({left:"-223px"})}),barCodeScannerInit()}),$(document).on("click",".virtualKeyboard",function(){$(this).parent().children("input").attr("onfocus",function(e,t){return"blur()"==t?null:"blur()"}),$(this).parent().children("input").focus(),$(this).children().toggleClass("green")}),window.onbeforeunload=BeforeWindowClose,document.all||document.captureEvents(Event.MOUSEMOVE);var iX=0,iY=0;function getPosition(e){document.all?(iX=event.clientX+document.body.scrollLeft,iY=event.clientY+document.body.scrollTop):(iX=e.pageX,iY=e.pageY)}function findPosX(e){var t=0;if(e.offsetParent)for(;e.offsetParent;)t+=e.offsetLeft,e=e.offsetParent;else e.x&&(t+=e.x);return t}function findPosY(e){var t=0;if(e.offsetParent)for(;e.offsetParent;)t+=e.offsetTop,e=e.offsetParent;else e.y&&(t+=e.y);return t}function FindCtrlPos(e){"string"==typeof e&&(e=document.getElementById(e));var t=e;jQuery(e).offset();iX=findPosX(t)+t.clientWidth+1,iY=findPosY(t)+t.clientHeight+1}function ShowTooltipDiv(){document.getElementById?div=document.getElementById("dvTip"):document.all&&(div=document.all.dvTip),""==div.style.display&&div.offsetWidth!=undefined&&div.offsetHeight!=undefined&&(div.style.display=0!=div.offsetWidth&&0!=elem.offsetHeight?"block":"none"),div.style.display="block",div.style.left=iX+"px",div.style.top=iY+"px"}var regexFld=new RegExp("^[a-zA-z0-9_]+$");function ShowTooltip(e,t){HideTooltip();var i=0,a="",r=new Array,o="";for(i=0;i<FNames.length;i++)if(FNames[i]==e){var n=(a=FToolTip[i]).indexOf("<h>");if(-1!=n){var l=a.indexOf("</h>");o="<a class='curHand' id='lblTip' onclick='javascript:HyperlinkToolTip(\""+a.substring(n+3,l)+"\");'>"+a.substring(0,n)+" </a>",a=a.substring(l+4,a.length)}""!=a&&(r=a.split("/"));break}var s=0,d=t.attr("id"),c=t.value;for(s=0;s<r.length;s++)if(""!=r[s])if(-1==r[s].toString().indexOf(":"))r[s]=r[s].trim(),r[s].trim();else{var p=new Array,u=r[s],f="",h=0,m="",v=!1;for(h=0;h<=u.length;h++)if(":"==(m=u.charAt(h)))if("+"==u.charAt(h+1)){var g=u.substring(u.indexOf(":+"),u.indexOf("+:")+2);g=(g=g.replace(":+","")).replace("+:",""),g=Evaluate(d,c,g,"expr"),p.push(g),h=u.indexOf("+:")+2}else v=!0,""!=f&&p.push(f),f="";else{if(1==v){var b=regexFld.test(m);if(0==b){var w=GetFieldsRowFrameNo(d);b=GetFieldValue(f+w),p.push(b),f="",v=!1}}f+=m}""!=f&&p.push(f);var $=0;for(r[s]="",$=0;$<p.length;$++)r[s]+=p[$]}if(r.length>0){FindCtrlPos(d);var C=$j("#dvInnerTip");a="";for(i=0;i<r.length;i++)""!=r[i]&&(a+=r[i]+"<br/>");""!=o?(C.html("<br/>"+o+" "+a),ShowTooltipDiv()):""!=a&&(C.html("<br/>"+a),ShowTooltipDiv())}}function HideTooltip(){var e=$j("#dvTip");e.length>0&&e.hide()}document.onkeypress=function(e){27==e.keyCode&&HideTooltip()};var hlTipProps="",hlTipParmUrl="",hlTipUrl="",hlTipParamXml="";function HyperlinkToolTip(e){hlTipParmUrl="";var t="",i=new Array;new Array;i=e.split(",");var a="",r="",o="",n=new Array;if(i.length>0)for(var l=0;l<i.length;l++)"type"==(n=i[l].split("="))[0]?(temp=n[1],temp.startsWith("t")?(hlTipUrl="tstruct.aspx?act=open&transid=",r="t"):temp.startsWith("i")&&(hlTipUrl="ivtoivload.aspx?ivname=",r="i")):"name"==n[0]?(hlTipUrl+=n[1],t=n[1]):"popup"==n[0]?a=n[1]:"refresh"==n[0]?n[1]:"load"==n[0]?o=n[1]:"param"==n[0]&&CreatParamUrl(i[l]);if(hlTipProps=r+","+o+","+a,"t"==r&&""!=t&&o.startsWith("t"))try{ASB.WebService.GetRecordId(t,hlTipParamXml,SuccessGetRecId,OnException)}catch(s){}else GetUrl()}function SuccessGetRecId(e,t){var i="0";if(""!=e){var a=$j.parseXML(e),r=$j(a);r.find("recordid").length>0&&(i=r.find("recordid").text())}GetUrl(i)}function GetUrl(rId){var pType="",load="",openWin="",newWindow;if(""!=hlTipProps){var strHlProps=hlTipProps.split(",");pType=strHlProps[0],load=strHlProps[1],openWin=strHlProps[2]}if(""!=hlTipUrl)if("t"==pType&&rId!=undefined&&"0"!=rId&&load.startsWith("t")?hlTipUrl+="&recordid="+rId:hlTipUrl+=hlTipParmUrl,openWin.startsWith("t"))try{newWindow=window.open(hlTipUrl,"MyPopUp","resizable=yes")}catch(ex){showAlertDialog("warning",eval(callParent("lcm[356]")))}else window.document.location.href=hlTipUrl}function CreatParamUrl(e){var t="";""!=hlTipProps&&(t=hlTipProps.split(",")[0]);if(hlTipParmUrl="",-1!=(a=e.indexOf("param="))){e.indexOf("=");e=e.substring(6,e.length)}if(arrParam=e.split("~"),arrParam.length>0)for(var i=0;i<arrParam.length;i++){var a=arrParam[i].indexOf("="),r=arrParam[i].substring(a+1,arrParam[i].count),o=arrParam[i].substring(0,a);if(r.startsWith(":")){r=r.substring(1,r.length);IsGridField(r);var n="";if(IsGridField(r)){var l=r+GetRowNoHelper(AxActiveRowNo)+"F"+AxActiveDc;n=GetFieldValue(l)}else{l=r+"000F"+GetDcNo(r);n=GetFieldValue(l)}}else r.startsWith("{")?(-1!=r.indexOf("{")&&(r=r.replace("{","")),-1!=r.indexOf("}")&&(r=r.replace("}","")),n=r.endsWith("*d")?r.substring(0,r.length-2):r):n=r;hlTipParamXml=hlTipParamXml+"<"+o+">"+n+"</"+o+">","i"==t&&""!=n?hlTipUrl=hlTipUrl+"&"+o+"="+n:""!=n&&(hlTipParmUrl=hlTipParmUrl+"&"+o+"="+n)}}function GetSetTtipHgt(e){var t=$j("#dvInnerTip"),i=$j("#dvTip");"new"==e?(t.height()<50&&t.height("50"),t.width()<100&&t.width("100"),i.height()<50&&i.height("50"),i.width()<100&&i.width("100")):(t.css("height","auto"),t.css("width","auto"),i.css("height","auto"),i.css("width","auto"))}var tmpFldName="";function DisplayPickList(e){ShowDimmer(!0),AxWaitCursor(!0);var t,i=e.attr("id").split("~"),a=i[t=2==i.length?1:0].substring(0,i[t].lastIndexOf("F")-3),r="",o=$j("#"+i[t]);if(o.attr("readonly")!=undefined||o.attr("disabled")!=undefined)return ShowDimmer(!1),void AxWaitCursor(!1);o.length>0&&(AxOldValue=o.val(),r=o.val()),totalPLRows=0,curPageNo=1;var n=$j("#hdnPickFldId");-1==e.attr("id").indexOf("~")?n.val("img~"+e.attr("id")):n.val(e.attr("id")),AxFromAssociated=!0,GetPickListData(a,r,curPageNo.toString(),pageSize.toString(),i[t])}function ShowPickList(){$j("#pickDimmer").css("display","none");var e,t=$j("#hdnPickFldId").val().split("~");e=2==t.length?1:0,FindCtrlPos(i=document.getElementById(t[e]));var i,a=(i=$j("#"+t[e])).width()+19,r=(i.height(),$j("#dvPickList")),o=GetFieldsDcNo(t[e]);IsDcGrid(o);r.width(a),r.show();$(".dvheightframe ").scrollLeft();var n=$(".dvheightframe ").scrollTop();axInlineGridEdit&&(n-=36);var l=i.offset().top-i.parents("."+(axInlineGridEdit?"input":"form")+"-group").outerHeight()+n;r.css("top",l+"px"),r.css("left",i.offset().left+"px"),$("#dvPickList .pickLstResultCntnr").length>0&&$("#dvPickList .pickLstResultCntnr").offset().top+$("#dvPickList .pickLstResultCntnr").outerHeight()-$(".dvheightframe").offset().top>$(".dvheightframe").outerHeight()&&$(".dvheightframe").animate({scrollTop:$("#dvPickList .pickLstResultCntnr").offset().top+$("#dvPickList .pickLstResultCntnr").outerHeight()-$(".dvheightframe").offset().top-$(".dvheightframe").outerHeight()+$(".dvheightframe").scrollTop()},100)}function CheckHeight(e,t){var i=$j("#middle1",parent.document),a=document.body.offsetHeight,r=e+t;r>a&&(a+=r-a,i.height(a+10))}function GetPickListData(e,t,i,a,r){currentPickList=r,initialSrchVal=t;var o="";if(arrRefreshDcs.length>0)for(var n=0;n<arrRefreshDcs.length;n++){var l=arrRefreshDcs[n].split(":");o=l[1].replace("dc","")+","+l[0].replace("dc","")}t=CheckSpecialCharsInStr(t);var s=GetFieldsDcNo(r);AxActiveRowNo=parseInt(GetFieldsRowNo(r),10),AxActiveRowNo=GetDbRowNo(AxActiveRowNo,s);var d=AxActiveRowNo,c="";""!=AxActivePRow&&""!=AxActivePDc&&(c=AxActivePDc+"~"+AxActivePRow);var p="";IsParentField(e,s)&&(p=GetSubGridInfoForParent(s,AxActiveRowNo));try{ASB.WebService.GetSearchResult(ChangedFields,ChangedFieldDbRowNo,ChangedFieldValues,DeletedDCRows,e,t,i.toString(),a.toString(),tstDataId,s,d,c,p,o,SuccGetSearchResult,OnException)}catch(f){AxWaitCursor(!1),ShowDimmer(!1);var u=f.name+"^♠^"+f.message;showAlertDialog("error",2030,"client",u)}}function GetTdFrameNo(){var e=$j("#hdnPickFldId").val();return GetFieldsDcNo(e)}var pickStatus=!0,selectedRow=0;function SuccGetSearchResult(result,eventArgs){if(!CheckSessionTimeout(result)){var hdnFilter=$j("#hdnFiltered"),resultArr;if(hdnFilter.val("true"),""!=result&&"<error>"!=result.substring(0,7)){TogglePrevNextLink("inline");var tableStr="";if(-1!=result.indexOf("♣")){var totRowStr=result.split("♣");totalPLRows=parseInt(totRowStr[0],10),totalPLRows/pageSize%1>0?noOfPLPages=Math.floor(totalPLRows/pageSize)+1:noOfPLPages=totalPLRows/pageSize,resultArr=totRowStr[1].split("¿")}else resultArr=result.split("¿");var dv=$j("#dvPickHead");if(resultArr!=undefined&&""!=resultArr){tableStr="<table id='tblPickData' data-pick='"+currentPickList+"' class='pickGridData'>";for(var i=0;i<resultArr.length;i++){var tdId="axPickTd00"+(i+1)+"F"+GetTdFrameNo(),pickValue=CheckSpecialCharsInHTML(resultArr[i]);if(-1!=resultArr[i].toString().indexOf("^")){var displayText=resultArr[i].toString().split("^")[1];tableStr+="<tr><td id ="+tdId+" onclick='javascript:SetPickVal(\""+pickValue+"\")' class='handCur'><a>"+displayText+"</td></tr>"}else displayText=resultArr[i].toString(),-1!=pickValue.indexOf("\\")?(pickValue=pickValue.replace("\\","\\\\"),tableStr+="<tr><td id ="+tdId+" onclick='javascript:SetPickVal(\""+pickValue+"\")' class='handCur' ><a>"+displayText+"</td></tr>"):tableStr+="<tr><td id ="+tdId+" onclick='javascript:SetPickVal(\""+pickValue+"\")' class='handCur'><a>"+displayText+"</td></tr>"}dv.length>0&&dv.html(tableStr),$j("#tblPickData tr").length>0&&$j("#tblPickData tr:nth-child(1)").addClass("active")}else if(dv.length>0){var cutMsg=eval(callParent("lcm[0]"));dv.html("<span>"+cutMsg+"</span>")}SetPrevNextLinks(),document.getElementById("advancebtn").style.visibility="visible",document.getElementById("advancesrch").style.visibility="visible"}else{tableStr="<table style='width:100%;height:auto;' id='tblPickData' cellpadding='1' cellspacing='1'>",tableStr+="</table>",document.getElementById("advancebtn").style.visibility="hidden",document.getElementById("advancesrch").style.visibility="hidden";var cutMsg=eval(callParent("lcm[0]"));tableStr+='<span style="font-size: 12px;">'+cutMsg+"</span>",TogglePrevNextLink("none");var dv=$j("#dvPickHead");dv.length>0&&dv.html(tableStr)}pickListRowCount=$j("#tblPickData tbody tr").length,pickListRowCount>1&&$j(".inputClass2").keydown(function(e){if(40==e.which){if(selectedRow<pickListRowCount){0==$j("#tblPickData tr:nth-child("+selectedRow+++")").length&&(selectedRow=2),$j("#tblPickData tr").removeClass("pickbg"),$j("#tblPickData tr:nth-child("+selectedRow+")").addClass("pickbg");for(var t=0,i=0;i<selectedRow;i++)t+=$j("#tblPickData tr:nth-child("+i+")").height();t+20>$j("#dvPickHead").height()&&$j("#dvPickHead").scrollTop($j("#dvPickHead")[0].scrollHeight)}}else if(38==e.which){if(selectedRow>2){0==$j("#tblPickData tr:nth-child("+selectedRow--+")").length&&selectedRow++,$j("#tblPickData tr").removeClass("pickbg"),$j("#tblPickData tr:nth-child("+selectedRow+")").addClass("pickbg"),1==selectedRow&&e.preventDefault();for(t=0,i=pickListRowCount;i>=selectedRow;i--)t+=$j("#tblPickData tr:nth-child("+i+")").height();if(t+10>$j("#dvPickHead").height()){var a=selectedRow-1;$j("#dvPickHead").scrollTop($j("#tblPickData tr:nth-child("+a+")").height())}}}else 39==e.which?$j("#nextPick").attr("onclick")!=undefined&&""!=$j("#nextPick").attr("onclick")&&(GetData("next"),$j("#dvPickHead").scrollTop(0),selectedRow=1):37==e.which?$j("#prevPick").attr("onclick")!=undefined&&""!=$j("#prevPick").attr("onclick")&&(GetData("prev"),selectedRow=1,$j("#dvPickHead").scrollTop(0)):27!=e.which&&9!=e.which||(HidePLDiv(!1),selectedRow=0);e.which=-1}),$j(document).keypress(function(e){if(-1!=e.keyCode){if(13==e.keyCode){var t=GetActivePickListId(),i=GetFieldsDcNo(t),a=GetFieldsRowNo(t);if(AxActiveRowNo=GetDbRowNo(a,i),$j("#dvPickList").is(":visible")){var r="#axPickTd00"+--selectedRow+"F"+GetTdFrameNo();if($j(r).length>0){var o=$j(r).find("a")[0].innerText;o==undefined&&(o=$j(r).find("a")[0].textContent),SetPickVal(o),pickStatus=!1}selectedRow=0}}e.which=-1}}),$j(document).click(function(e){"nextPick"!=e.target.id&&"prevPick"!=e.target.id&&"curHand"!=e.target.className&&"hdrRow"!=e.target.className&&("nextPick"==e.target.parentElement.id||"prevPick"==e.target.parentElement.id?$j("#pickDimmer").css("display","block"):HidePLDiv(!1),selectedRow=0)}),currentPickList="",ShowPickList(),ShowDimmer(!1),AxWaitCursor(!1)}}function GetActivePickListId(){var e=$j("#hdnPickFldId").val().split("~");return e[e.length>1?1:0]}function HidePLDiv(e){if(1==e){var t=$j("#hdnPickFldId").val();if(""!=t&&-1!=t.indexOf("~")){var i="#"+t.split("~")[1];$j(i).focusNextInputField()}}var a=$j("#dvPickList");a.length>0&&a.hide()}function GetData(e){"prev"==e&&curPageNo>1?curPageNo-=1:"next"==e&&curPageNo<noOfPLPages&&(curPageNo+=1);var t=$j("#hdnPickFldId");if(t.length>0){var i=t.val();if(""!=i&&-1!=i.indexOf("~")){var a=i.split("~");GetPickListData(a[1].substring(0,a[1].lastIndexOf("F")-3),$j("#"+a[1]).val(),curPageNo.toString(),pageSize.toString(),a[1])}}}function TogglePrevNextLink(e){var t=$j("#prevPick"),i=$j("#nextPick");"block"==e||"inline"==e?(t.show(),i.show()):(t.hide(),i.hide())}function SetPrevNextLinks(){var e=$j("#prevPick"),t=$j("#nextPick"),i=$j("#tblPickData");1==curPageNo?(e.attr("disabled","disabled"),e.css("display","none"),e.removeAttr("onclick")):(e.attr("disabled",!1),e.css("color","black"),t.css("color","black"),e.attr("onclick","javascript:GetData('prev')")),curPageNo<noOfPLPages?(t.attr("disabled",!1),t.css("color","black"),t.attr("onclick","javascript:GetData('next')")):curPageNo>=noOfPLPages?(t.attr("disabled","disabled"),t.css("display","none"),t.removeAttr("onclick")):(i.attr("disabled","disabled"),i.removeAttr("onclick"))}function SetPickVal(e){var t=$j("#hdnPickFldId");if(t){var i=t.val().split("~"),a=i[i.length>1?1:0],r=$j("#"+a);if($j("#pickfld000F0").val(a),-1!=e.indexOf("^")){GetFieldsRowFrameNo(a);var o=$j("#pickIdVal_"+a),n=e.split("^");o.val(n[0]),e=n[1]}e=RepSpecialCharsInHTML(e),r.val(e);try{r.focus()}catch(l){}AxFromAssociated=!0}HidePLDiv(!1)}function CallSearchOpen(){if(window.chrome&&$j("#HdnAxAdvPickSearch").val("true"),ShowDimmer(!0),AxWaitCursor(!0),HidePLDiv(!1),$j("#hdnPickFldId")){var e=$j("#hdnPickFldId").val(),t=$j("#"+e);$j(".pickimg").each(function(){$j(this).attr("id")==e&&(t=$j(this))}),t.length>0&&SearchOpen(t)}AxWaitCursor(!1)}$j.fn.focusNextInputField=function(){return this.each(function(){setTimeout(function(){var e=$(this);if(axInlineGridEdit&&!$($(e).closest("div")).hasClass("form-group"))var t=$j(e).parents("input:eq(0),body").find('button,input[type!="hidden"],textarea,select');else t=$j(e).parents("form:eq(0),body").find('button,input[type!="hidden"],textarea,select');var i=t.index(e);if(i>-1&&i+1<t.length){var a=t.eq(i+1),r=a.prop("disabled");if(1==r||"disabled"==r||"togCol"==a.prop("class"))t.eq(i+1).focusNextInputField();else if(axInlineGridEdit&&!$(e.closest("div")).hasClass("form-group")){var o=t.eq(i).closest("td").attr("data-focus-index");t.eq(i).closest("tr").attr("last-focus-index")!=o&&(o=parseInt(o)+1),$j(e).parents("input:eq(0),body").find("td[data-focus-index='"+o+"']").find("input").focus()}else isMobile||t.eq(i+1).focus()}return!1},0)})};var fcontrols=new Array,found=!1,process=!1,fc=0,ch,strch,cmdfchar,cresult=!0,cond="",skip,fld,count=0,cont=!1,fldExtn="",isobject=!1,btnObject=!1,firstFldDc="NONGRID",secFldDc="NONGRID",isFieldBtn=!1,arrVisibleTabDcs=new Array;function DoFormControl(e){var t,i=GetFieldsName(e),a=GetFieldsDcNo(e),r=GetFieldsRowNo(e),o=IsDcGrid(a);if(fldExtn=r+"F"+a,firstFldDc=o?"GRID":"NONGRID",0==fcontrols.length)for(var n=0;n<Formcontrols.length;n++){var l=Formcontrols[n];l.startsWith("f")&&(t=l.substr(1,l.length),fcontrols[fc]=t,fc++)}found=!1;for(var s=0;s<fcontrols.length;s++)if(fcontrols[s]==i){found=!0;break}process=!1,found&&EvaluateFormControl(i)}function AddVisTabDcsInArray(){for(var e=PagePositions.length,t=0;t<e;t++)arrVisibleTabDcs.push("")}function DoFormControlOnload(){if(0==fcontrols.length)for(var e=0;e<Formcontrols.length;e++){var t=Formcontrols[e];t.startsWith("f")&&(v=t.substr(1,t.length),fcontrols[fc]=v,fc++)}try{var i=$j("#recordid000F0").val();""==i&&(i="0");for(var a=0;a<fcontrols.length;a++)("0"==i&&"_On Form Load"==fcontrols[a]||"0"!=i&&"_On Data Load"==fcontrols[a])&&EvaluateFormControl(fcontrols[a])}catch(r){console.log(r.message)}}function EvaluateFormControl(e){for(var t=0;t<Formcontrols.length;t++)if(a=Formcontrols[t],strch=a,a=a.split(""),"1"==(cmdfchar=strch.startsWith("10")||strch.startsWith("11")||strch.startsWith("12")?a[0]+a[1]:a[0])&&a.length>1&&("0"==a[1]||"1"==a[1])&&"d"==a[2]&&"c"==a[3]?(cmdfchar=a[0]+a[1],fldname=strch.substr(2,strch.length)):fldname="10"==cmdfchar||"11"==cmdfchar||"12"==cmdfchar?strch.substr(2,strch.length):strch.substr(1,strch.length),"f"!=cmdfchar||fldname!=e)if("e"!=cmdfchar||1!=process){if(0!=process){if(3==cmdfchar&&1==cresult){t+=1,"''"==(i=(i=Formcontrols[t]).substring(1,i.length))&&(i="");if(":"==(a=i.split(""))[0]){if("yes",i=i.substring(1,i.length),i=GetComponentName(GetExactFieldName(i),fldExtn),!($j("#"+i).length>0))continue;i=GetFieldValue(i)}CallProcessFormControl(fldname,fldExtn,"3",i)}else if(12==cmdfchar&&1==cresult){var i;t+=1,"''"==(i=(i=Formcontrols[t]).substring(2,i.length))&&(i="");var a;if(":"==(a=i.split(""))[0]){if("yes",i=i.substring(1,i.length),i=GetComponentName(GetExactFieldName(i),fldExtn),!($j("#"+i).length>0))continue;i=GetFieldValue(i)}CallProcessFormControl(fldname,fldExtn,"12",i)}else if(1!=cmdfchar&&2!=cmdfchar&&4!=cmdfchar&&5!=cmdfchar&&6!=cmdfchar&&7!=cmdfchar&&8!=cmdfchar&&9!=cmdfchar&&10!=cmdfchar&&11!=cmdfchar||1!=cresult){if("c"==cmdfchar)if("if"==fldname){count=0;try{cresult=Getcondition(t),(skip=cresult)&&(count=1),t+=3}catch(r){}}else"elseif"==fldname?(skip?(cresult=!1,count=3):cresult=!cresult,cresult&&(cresult=Getcondition(t),(skip=cresult)&&(count=2)),t+=3):"else"==fldname?skip=cresult=1!=skip&&!cresult:"and"==fldname?(cresult=cresult&&Getcondition(t),1==count&&1==count&&0==cresult&&(skip=!1),2==count&&(skip=2==count&&1==cresult),3==count&&(skip=!0),t+=3):"or"==fldname?(cresult=cresult||Getcondition(t),1==count&&1==count&&0==cresult&&(skip=!1),2==count&&(skip=2==count&&1==cresult),3==count&&(skip=!0),t+=3):"end"==fldname&&(cresult=!0,skip=!1)}else CallProcessFormControl(fldname,fldExtn,cmdfchar.toString())}}else process=!1;else process=!0}function CallProcessFormControl(e,t,i,a){if("4"==i||"5"==i||"dc"==e.substring(0,2)&&("8"==i||"9"==i||"10"==i||"11"==i))ProcessFormControl(e,i,a);else{e=GetExactFieldName(e);var r=GetDcNo(e),o=IsDcGrid(r);if(secFldDc=o?"GRID":"NONGRID","NONGRID"==firstFldDc&&"NONGRID"==secFldDc||"GRID"==firstFldDc&&"NONGRID"==secFldDc)ProcessFormControl(e=e+"000F"+r,i,a);else if("NONGRID"==firstFldDc&&"GRID"==secFldDc)for(var n=GetDcRowCount(r),l=1;l<=n;l++){ProcessFormControl(e+GetRowNoHelper(l)+"F"+r,i,a)}else if("GRID"==firstFldDc&&"GRID"==secFldDc){ProcessFormControl(e=e+GetClientRowNo(AxActiveRowNo,r)+"F"+r,i,a)}else ProcessFormControl(e=e,i,a)}}function ProcessFormControl(e,t,i){isFieldBtn=!1,-1!=e.indexOf(".")&&e.replace(".","\\.");var a=$j("#"+e);if("4"==t||"5"==t||"dc"==e.substr(0,2)&&("8"==t||"9"==t||"10"==t||"11"==t)){var r=e.substr(2);0==(a=$j("#DivFrame"+e.toString().substring(2))).length&&-1!=$j.inArray(r,TabDCs)&&(a=$j("#ank"+r))}var o=GetFieldsRowNo(e),n=GetFieldsDcNo(e),l=GetDbRowNo(o,n),s=!1;if(a.length<=0){var d,c=e;-1!=e.toString().indexOf("F")&&(c=e.substring(0,e.lastIndexOf("F")-3)),$j(".axpBtn,.axpBtnCustom").each(function(){if($j(this).attr("id")==c)return a=$j(this),isFieldBtn=!0,!1}),$j(".action img").each(function(){if($j(this).attr("id")==c)return d=$j(this),isFieldBtn=!0,!1});var p=!1;$j(".AxpTstBtn input,img").each(function(){if($j(this).attr("value")==c||$j(this).attr("id")=="AxpTstBtn_"+c)return d=$j(this),isFieldBtn=!0,p=!0,!1}),"remove"==c.toLowerCase()?c="delete":"list view"==c.toLowerCase()?c="listview":"new"==c.toLowerCase()&&(c="add"),"save"==c.toLowerCase()&&(s=!0),$j("#icons").find("a").each(function(){($j(this).attr("class")==c.toLowerCase()||"undefined"!=typeof btnName&&$j(this).text()==btnName)&&(a=$j(this),isFieldBtn=!0)}),isFieldBtn||$j("#nextprevicons").find("a").each(function(){$j(this).attr("class")==c.toLowerCase()&&(a=$j(this),isFieldBtn=!0)}),d!=undefined&&d.length>0&&(a=d.parent(0)),p&&(a=d)}if(a.length>0)switch(t){case"1":if(isFieldBtn)s?EnableSaveBtn(!0):EnableDisableBtns(a,!0);else{if(1==IsPickListField(a.attr("id")))(f=document.getElementById("img~"+a.attr("id"))).disabled=!1,f.className="input-group-addon handCur pickimg";if(0==a.val()&&"select-one"!=a.prop("type")&&a.val(""),a.attr("title")==dateString&&""==a.val()&&a.val(dateString),"checkbox"==a.attr("type"))EnableDisableCheckbox(a.attr("id"),!1);else(a.attr("id").startsWith("rtf_")||a.attr("id").startsWith("rtfm_")||a.attr("id").startsWith("fr_rtf_")||"Rich Text"==GetDWBFieldType(GetFieldsName(a.attr("id"))))&&($j("#cke_"+a.attr("id")).prop("disabled",!1),a.css("display","none"),$j("#cke_"+a.attr("id")).removeAttr("disabled")),"axpImg"==a.attr("class")&&a.attr("onclick",null),a.prop("disabled",!1),a.prop("readOnly",!1),a.removeAttr("readOnly"),SetAutoCompAccess("enabled",a)}break;case"2":if(isFieldBtn)s?EnableSaveBtn(!1):EnableDisableBtns(a,!1);else{if(1==IsPickListField(a.attr("id")))(f=document.getElementById("img~"+a.attr("id"))).disabled=!0,f.className="pickimg input-group-addon handCur";if(a.attr("title")!=dateString||a.val()!=dateString&&"''"!=a.val()||a.val(""),"checkbox"==a.attr("type"))EnableDisableCheckbox(a.attr("id"),!0);else(a.attr("id").startsWith("rtf_")||a.attr("id").startsWith("rtfm_")||a.attr("id").startsWith("fr_rtf_")||"Rich Text"==GetDWBFieldType(GetFieldsName(a.attr("id"))))&&($j("#cke_"+a.attr("id")).attr("disabled","disabled"),a.css("display","none"),$j("#cke_"+a.attr("id")).prop("readonly",!0)),"axpImg"==a.attr("class")&&a.attr("onclick","callnull"),a.prop("disabled",!0),a.attr("readOnly","readOnly"),SetAutoCompAccess("disabled",a)}break;case"3":var u=GetDcNo(fldname);if($j("#"+e).hasClass("multiFldChk")&&""==i.trim())if(IsDcGrid(u))$j("input[id="+e+"]").each(function(){$j(this).removeAttr("checked"),$j(this).prop("checked",!1)});else try{$("#"+e).val(""),$("#"+e).data("valuelist",""),$("#"+e).tokenfield("setTokens",[])}catch(g){}else CallSetFieldValue(e,i);UpdateFieldArray(e,l,i,"parent","");break;case"4":if("dc"==fldname.substr(0,2))ShowingDc(u=parseInt(fldname.substr(2,fldname.length),10),"enable");break;case"5":if("dc"==fldname.substr(0,2))ShowingDc(u=parseInt(fldname.substr(2,fldname.length),10),"disable");break;case"6":if(isFieldBtn)s?EnableSaveBtn(!0):EnableDisableBtns(a,!0);else{if(1==IsPickListField(a.attr("id")))(f=document.getElementById("img~"+a.attr("id"))).disabled=!1,f.className="input-group-addon handCur pickimg";a.prop("disabled",!1),a.prop("readOnly",!1),isFieldBtn||a.removeClass("dis"),a[0].children[0].className="handCur"}break;case"7":if(isFieldBtn)s?EnableSaveBtn(!1):EnableDisableBtns(a,!1);else{var f;if(1==IsPickListField(a.attr("id")))(f=document.getElementById("img~"+a.attr("id"))).disabled=!0,f.className="input-group-addon pickimg";a.prop("disabled",!0),a.prop("readOnly",!1),a.addClass("dis"),a[0].children[0].className=""}break;case"8":if("dc"==fldname.substr(0,2)){u=parseInt(fldname.substr(2,fldname.length),10);"undefined"!=typeof isWizardTstruct&&isWizardTstruct?ToggleWizardDc(u,"hide"):ShowingDc(u,"hide")}else{HideShowField(fldname,"hide");var h=GetFieldIndex(fldname),m=GetDWBFieldType("",h);(fldname.startsWith("axptm_")||fldname.startsWith("axpdbtm_")||""!=m&&"time"==m.toLowerCase())&&$j("#"+a.attr("id")+" .tstOnlyTime").removeClass("hasDatepicker")}break;case"9":if("dc"==fldname.substr(0,2)){u=parseInt(fldname.substr(2,fldname.length),10);"undefined"!=typeof isWizardTstruct&&isWizardTstruct?ToggleWizardDc(u,"show"):ShowingDc(u,"show")}else{HideShowField(fldname,"show");h=GetFieldIndex(fldname),m=GetDWBFieldType("",h);(fldname.startsWith("axptm_")||fldname.startsWith("axpdbtm_")||""!=m&&"time"==m.toLowerCase())&&$j("#"+a.attr("id")+" .tstOnlyTime").addClass("hasDatepicker")}break;case"10":if("dc"==fldname.substr(0,2))ShowingDc(u=parseInt(fldname.substr(2,fldname.length),10),"hidepopdc");break;case"11":if("dc"==fldname.substr(0,2))ShowingDc(u=parseInt(fldname.substr(2,fldname.length),10),"showpopdc");break;case"12":u=GetDcNo(fldname);IsDcGrid(u)?($("#gridHd"+u+" th[id='th-"+fldname+"']").text(i),$("#wrapperForEditFields"+u+" label[for='"+e+"']").text(i)):"checkbox"==$j("#"+e).attr("type")?$("label[for='"+e+"'] span").text(i):$("label[for='"+e+"']").text(i);break;default:return}else if(EnableDisableField(e,t,"0"),("4"==t||"5"==t)&&"dc"==fldname.substr(0,2)){var v="";v="4"==t?"enable":"disable";u=parseInt(fldname.substr(2,fldname.length),10);-1==$j.inArray(u+"~"+v,DisabledDcs)&&DisabledDcs.push(u+"~"+v)}}function EnableDisableCheckbox(e,t){$j("#chkAll_"+e).prop("disabled",t),$j("#chkAll_"+e).attr("readOnly",t),$j("input:checkbox[id='"+e+"']").each(function(){$j(this).prop("disabled",t),$j(this).attr("readOnly",t)})}function EnableDisableField(e,t,i){"1"==i?ProcessFormControl(e,t,""):-1==$j.inArray(e+"~"+t,AxFormContDisableFlds)&&AxFormContDisableFlds.push(e+"~"+t)}function HideShowField(e,t){var i=GetDcNo(e),a="";if(IsDcGrid(i)){"hide"==t?$j("#th-"+e).hide():$j("#th-"+e).show();var r;r=GetDcRowCount(i);getGridFldType(e,i);for(var o=1;o<=r;o++){var n;if((a=$j("#"+e+GetClientRowNo(o,i)+"F"+i)).length>0)if("hide"==t)a.hide(),inputValue.css("display","none"),a.parent().hide(),(n=a.attr("data-style"))!=undefined&&a.attr("data-style",n.indexOf("display: inline")>0?n.replace("display: inline;","display: none;"):n.indexOf("display: none")>0?n:n+"display: none;"),$j("#dvGrid"+e).length&&$j("#dvGrid"+e).hide(),a.closest(".gridElement").length&&a.closest(".gridElement").hide(),!a.parent().is("td")&&a.parent().parent().length&&a.parent().parent().is("td")&&a.parent().parent().hide();else a.show(),a.parent().show(),inputValue.css("display","inline"),(n=a.attr("data-style"))!=undefined&&a.attr("data-style",n.indexOf("display: inline")>0?n:n+"display: inline;"),$j("#dvGrid"+e)&&$j("#dvGrid"+e).show(),a.closest(".gridElement").length&&a.closest(".gridElement").show(),!a.parent().is("td")&&a.parent().parent().length&&a.parent().parent().is("td")&&a.parent().parent().show();else-1==$j.inArray(e+"~"+t,AxFormContHiddenFlds)&&AxFormContHiddenFlds.push(e+"~"+t)}}else{if((a=$j("#dv"+e)).length>0)if("hide"==t)a.hide().parents(".grid-stack-item").hide();else{a.show().parents(".grid-stack-item").show();var l=a.find(":input");l.css("visibility"),l.css("visibility","")}else-1==$j.inArray(e+"~"+t,AxFormContHiddenFlds)&&AxFormContHiddenFlds.push(e+"~"+t)}}var inputValue="",s;function getGridFldType(e,t){var i=0==$("#gridHd"+t+" tbody tr").length?1:$("#gridHd"+t+" tbody tr").length,a=(inputValue=$j("#"+e+GetClientRowNo(i,t)+"F"+t)).closest(".gridElement");return eleType="",a.find("span.picklist").length>0?(eleType="pickList",hiddenData=a.find("span.picklist input[type = hidden]").attr("id")+"~"+a.find("span.picklist input[type = hidden]").val()):a.find("input.grdAttach").length>0?(eleType="gridattach",isAttachMentExist=!0):a.find("input.date").length>0?eleType="datepicker":inputValue.hasClass("fldFromSelect")?(inputValue.hasClass("fastdll")?eleType="fromselect-select":eleType="fromselect-pick",eleType=inputValue.hasClass("isrefreshsave")?eleType+"~isrefreshsave":eleType):(eleType=inputValue[0].nodeName.toLowerCase(),"input"==eleType&&"checkbox"==inputValue[0].type&&(eleType="checkbox"),"input"==eleType&&inputValue.hasClass("number")&&(eleType="numeric")),eleType}function Getcondition(i){var isfld=!1,expFldname1="",fieldVal="";s=Formcontrols[i+1];var firstChar=s.substring(0,1);":"==firstChar&&(s=s.substring(1,s.length)),s=GetExactFieldName(s),fld=GetComponentName(s,fldExtn),cond=GetCondFldValue(fld),""==cond&&(cond="''");var op=Formcontrols[i+2];"et"==op&&(op="=="),"net"==op&&(op="!="),"gt"==op&&(op=">"),"lt"==op&&(op="<"),"gtoet"==op&&(op=">="),"ltoet"==op&&(op="<="),cond+=op,s=Formcontrols[i+3];var firstChar=s.substring(0,1);return":"==firstChar&&(s=s.substring(1,s.length),s=GetExactFieldName(s),s=GetComponentName(s,fldExtn),s=GetCondFldValue(s)),s=TrimAll(s),s=s.replace(/\s/g,""),isNaN(s)&&(s=s.replace(/\"/g,""),s='"'+s+'"'),cond+=s,result=eval(cond),result}function GetComponentName(e,t){var i=GetDcNo(e),a=IsDcGrid(i);if(""==t)r=a?e+"001F"+i:e+"000F"+i;else var r=e+t;return document.getElementById(r)||(r=a?e+"001F"+i:e+"000F"+i),r}function GetCondFldValue(e){var t="";if($j("#"+e).length>0)t=GetFieldValue(e);else{var i=0;if(Parameters.length>1)for(var a=1;a<Parameters.length;a++){var r=Parameters[a].toString();r=r.split("~"),varlist[i]=r[0].toString(),valuelist[i]=r[1].toString(),i++}for(var o=0;o<varlist.length;o++)if(s==varlist[o]){t=valuelist[o];break}}return(t=t!=undefined?t.replace(/\s/g,""):"''")==dateString&&(t="''"),isNaN(t)&&(t='"'+t+'"'),t}function ShowingDc(e,t,i){IsDcGrid(e);var a=parseInt(e,10),r="visible",o="glyphicon glyphicon-chevron-down icon-arrows-down",n="show",l="hand";if("hide"==(t=t.toString().toLowerCase()))r="hidden","none",o="glyphicon glyphicon-chevron-up icon-arrows-up",n="show",l="default","true";else if("show"==t){var s=GetTabDcIndexPagePos(a);-1!=s&&(""==arrVisibleTabDcs[s]?(arrVisibleTabDcs[s]=a,!0):!1),r="visible","block",o="glyphicon glyphicon-chevron-down icon-arrows-down",n="hide",l="hand","false"}var d=$j("#dcButspan"+e);d.length>0&&(d.attr("alt",n),d.attr("class",o),d.css("visibility",r),d.css("cursor",l)),$j(".fbutton").each(function(){"hide"==t?$j(this).prop("disabled",!0):$j(this).prop("disabled",!1)});var c=$j("#DivFrame"+e),p="";c.length>0?("showpopdc"!=t&&"hidepopdc"!=t||(createPopDcDialog(e,c),void 0!==fld||null!=fld||""!=fld?p=fld:parseInt(dcno,10)>0&&("true"==DCIsGrid[dcno-1].toLowerCase()?(rowNo=GetRowNoHelper(AxActiveRowNo),p=AxActiveField+rowNo+"F"+GetDcNo(AxActiveField)):(rowNo="000",p=AxActiveField+rowNo+"F"+GetDcNo(AxActiveField)))),"show"==t?c.removeClass("d-none"):"hide"==t?c.addClass("d-none"):"showpopdc"==t?("complete"==document.readyState&&c.dialog("open"),c.find("#head"+e).find("a[onclick^='javascript:ShowDc(']").hide(),$("#"+p).parent().next().hasClass("ShowPopDc")||$('<span class="fa fa-external-link ShowPopDc" onclick="ShowingDc(\''+e+"','showpopdc'); return false;\"></span>").insertAfter($("#"+p).parent())):"hidepopdc"==t?("complete"==document.readyState&&c.dialog("close"),$("#"+p).parent().next().hasClass("ShowPopDc")&&$("#"+p).parent().next().remove()):"enable"==t?($j("#DivFrame"+e).find("input,textarea, img, select, a").removeAttr("disabled"),$j("#DivFrame"+e).find(".rowdelete").removeClass("disabledelete"),$j("#wrapperForEditFields"+e).show(),$j("#gridToggleBtn"+e).removeClass("disables").prop("disables",!1),$j("#DivFrame"+e).find(".rowadd").removeClass("disableadd"),$j("#DivFrame"+e).find(".fillcls").removeClass("disablefill"),$j("#gridAddBtn"+e).prop("disabled",!1),$j("#wrapperForEditFields"+e).find(".editLayoutFooter button").removeClass("disabled").prop("disabled",!1),$j("[id ^= 'fillgrid']").prop("disabled",!1).removeClass("disabled"),$j("#gridHd"+e+" tbody tr").removeClass("disableTheRow"),$j("#gridHd"+e+" tbody tr").find(".glyphicon.glyphicon-pencil,.glyphicon.glyphicon-trash").removeClass("disabled").prop("disabled",!1).parent().removeClass("disabled").prop("disabled",!1),$("#gridAddBtn"+e).next().find(":button").attr("disabled",!1).on("click"),$j("#DivFrame"+e+" .newgridbtn ul li").css("pointer-events","")):"disable"==t&&($j("#DivFrame"+e).find("input,textarea, img, select, a").not(".subGrid,.chkShwSel").attr("disabled",!0),$j("#DivFrame"+e).find("a img").removeClass("handCur"),$j("#DivFrame"+e).find("img").attr("onclick","javascript:void(0);"),$j("#DivFrame"+e).find(".dvImgClear .icon-arrows-remove").attr("onclick","javascript:void(0);"),$j("#DivFrame"+e).find(":button").removeClass("handCur"),$j("#DivFrame"+e).find(".rowdelete").addClass("disabledelete"),$j("#DivFrame"+e).find(".rowadd").addClass("disableadd"),$j("#gridAddBtn"+e).prop("disabled",!0),$j("#clearThisDC"+e).prop("disabled",!0).find(".gridActs").addClass("disabled"),$j("#wrapperForEditFields"+e).hide(),$j("#gridToggleBtn"+e).addClass("disabled").prop("disabled",!0),$j("#DivFrame"+e).find(".fillcls").addClass("disablefill"),$j("[id ^= 'fillgrid']").prop("disabled",!0).addClass("disabled"),$j("#wrapperForEditFields"+e).find(".editLayoutFooter button").addClass("disabled").prop("disabled",!0),$j("#colScroll"+e+" table tbody tr").addClass("disableTheRow"),$j("#colScroll"+e+" table tbody tr").find(".glyphicon.glyphicon-pencil,.glyphicon.glyphicon-trash").addClass("disabled").prop("disabled",!0).parent().addClass("disabled").prop("disabled",!0),$("#gridAddBtn"+e).next().find(":button").attr("disabled",!0).off("click"),$j("#DivFrame"+e+" .newgridbtn ul li").css("pointer-events","none"),$j("#DivFrame"+e).find(".upload-icon").hover(function(){$(this).css("cursor","not-allowed")}).attr("onclick","javascript:void(0)"),$j("#DivFrame"+e).find(".attach-files .grdAttach, .grdAttach").hover(function(){$(this).css("cursor","not-allowed")}).attr("onclick","javascript:void(0)"),$j("#DivFrame"+e).find(".attachment-count").removeAttr("disabled"))):"disable"!=t&&"enable"!=t||-1==$j.inArray(e+"~"+t,DisabledDcs)&&DisabledDcs.push(e+"~"+t);var u=$j("#li"+e);if(u.length>0&&("show"==t?u.removeClass("d-none"):"hide"==t&&u.addClass("d-none")),u.hasClass("active")&&"hide"==t){var f=GetFirstTabDcNo(e);-1!=f&&$j("#ank"+f).click()}}function createPopDcDialog(e,t){var i=.97*$(window).width();$(window).height();"complete"==document.readyState&&(t.dialog({modal:!0,autoOpen:!1,width:i,open:function(){$(".ui-widget-overlay").bind("click",function(){t.dialog("close")})},close:function(){$(this).dialog("close"),$(this).dialog("destroy"),t.hide()},buttons:[{text:"Save",click:function(){ValidateBeforeSubmit(e)&&t.dialog("close")},"class":"ui-button ui-corner-all ui-widget hotbtn"},{text:"Cancel",click:function(){ClearFieldsInDC(e),t.dialog("close")},"class":"coldbtn btn",style:"background: antiquewhite"}]}),$(".ui-dialog-titlebar").hide(),0==t.find("div:eq(0) button").length&&t.find("div:eq(0)").prepend('<button class="remodal-close icon-basic-remove" style="color:rgba(76, 53, 53, 0.61);"></button>'),$(".remodal-close").bind("click",function(){t.dialog("close")}))}function createDataGridDialog(e){createBootstrapModal("divDc"+e+" #gridheaddiv","DC"+e+" ","wrapperForEditFields"+e,"","","97%")}function clearDataGrid(editGridDC){var isExitDummy=!1;if(gridDummyRowVal.length>0&&gridDummyRowVal.map(function(e){e.split("~")[0]==editGridDC&&(isExitDummy=!0)}),isExitDummy)return!1;if($j("#clearThisDC"+editGridDC).find("a[disabled='disabled']").length>0)return!1;if($j("#chkallgridrow"+editGridDC).prop("checked"))if($(".wrapperForGridData"+editGridDC+" table tbody tr").length>0){var cutMsg=eval(callParent("lcm[25]"));cutMsg=cutMsg.replace("{0}",GetDcCaption(editGridDC));var glType=eval(callParent("gllangType")),isRTL=!1;isRTL="ar"==glType;var rid=$j("#recordid000F0").val();if("0"!=rid)var clearThisDCGrid=$.confirm({theme:"modern",closeIcon:!1,rtl:isRTL,title:eval(callParent("lcm[155]")),onContentReady:function(){$(".jconfirm-buttons .hotbtn").focus(),disableBackDrop("bind")},backgroundDismiss:"false",escapeKey:"buttonB",content:cutMsg,buttons:{buttonA:{text:eval(callParent("lcm[164]")),btnClass:"btn btn-primary",action:function(){clearThisDCGrid.close();var e=GetDcRowCount(editGridDC);DeleteAllRows(editGridDC,e),ShowDimmer(!1),$("#chkallgridrow"+editGridDC).prop("checked",!1),$("#clearThisDC"+editGridDC).addClass("disabled")}},buttonB:{text:eval(callParent("lcm[192]")),btnClass:"btn btn-bg-light btn-color-danger btn-active-light-danger",action:function(){AxWaitCursor(!1),ShowDimmer(!1),disableBackDrop("destroy")}}}});else{var fDcRowCount=GetDcRowCount(editGridDC);DeleteAllRows(editGridDC,fDcRowCount),ShowDimmer(!1),$("#chkallgridrow"+editGridDC).prop("checked",!1),$("#clearThisDC"+editGridDC).addClass("disabled")}}else showAlertDialog("info",2004,"client");else $j("input[name=chkItem"+editGridDC+"]:checked").length>0&&DeleteSelectedRows(editGridDC)}function DeleteSelectedRows(editGridDC){var glType=eval(callParent("gllangType")),isRTL=!1;isRTL="ar"==glType;var cutMsg=eval(callParent("lcm[5]")),rid=$j("#recordid000F0").val();if("0"!=rid)$.confirm({theme:"modern",title:eval(callParent("lcm[155]")),content:cutMsg,escapeKey:"buttonB",rtl:isRTL,onContentReady:function(){disableBackDrop("bind")},buttons:{buttonA:{text:eval(callParent("lcm[279]")),btnClass:"btn btn-primary",action:function(){try{var e=$j("input[name=chkItem"+editGridDC+"]:checked").length,t=0;$j("input[name=chkItem"+editGridDC+"]:checked").each(function(){t++;var i=$j(this).attr("id"),a=i.substr(7,i.lastIndexOf("F")-3);axInlineGridEdit&&updateInlineGridRowValues(),t==e?DeleteGridRow(editGridDC,a,undefined):DeleteGridRow(editGridDC,a,"all")})}catch(i){AxWaitCursor(!1)}}},buttonB:{text:eval(callParent("lcm[280]")),btnClass:"btn btn-bg-light btn-color-danger btn-active-light-danger",action:function(){}}}});else try{var chkdCount=$j("input[name=chkItem"+editGridDC+"]:checked").length,loopCount=0;$j("input[name=chkItem"+editGridDC+"]:checked").each(function(){loopCount++;var e=$j(this).attr("id"),t=e.substr(7,e.lastIndexOf("F")-3);axInlineGridEdit&&updateInlineGridRowValues(),loopCount==chkdCount?DeleteGridRow(editGridDC,t,undefined):DeleteGridRow(editGridDC,t,"all")})}catch(ex){AxWaitCursor(!1)}if(arrRefreshDcs.length>0)for(var i=0;i<arrRefreshDcs.length;i++){var arrDcNos=arrRefreshDcs[i].split(":");if(arrDcNos[1]=="dc"+editGridDC){arrRefreshFldDirty[i]=!0;break}}OnRowChangeSetHeight(editGridDC),checkTableBodyWidths(editGridDC),"True"==isTstPop&&TstructTabEventsInPopUP("")}function GetFirstTabDcNo(e){var t=0;for(t=0;t<PagePositions.length;t++)if(-1!=PagePositions[t].toString().indexOf(",")){var i=PagePositions[t].toString().split(","),a=0;for(a=0;a<i.length;a++)if(e==i[a])return i[0]}return-1}function EnableDisableDc(e,t){var i=IsDcGrid(e),a=(parseInt(e,10),!1),r="hand";"Enable"==t?(a=!1,r="hand"):"Disable"==t&&(a="disabled",r="default");var o=$j("#dcButspan"+e);if(o.length>0&&(o.attr("alt","hide"),o.attr("class","glyphicon glyphicon-chevron-down icon-arrows-down"),o.attr("disabled",a),o.css("cursor",r)),i){var n=$j("#DivFrame"+e);n.length>0&&("Enable"==t?n.attr("disbaled",!1):n.attr("disbaled","disbaled"))}else{var l=$j("#DivFrame"+e);if(l.length>0)"Enable"==t?l.attr("disbaled",!1):l.attr("disbaled","disbaled");else{var s=$j("#tab-"+e);s.length>0&&("Enable"==t?s.attr("disbaled",!1):s.attr("disbaled","disbaled"))}}}function AddGroup(e,t){fillDcname=e;var i=GetDcRowCount(e);if(1==parseInt(i,10)){var a=t+GetClientRowNo("001",e)+"F"+e,r=GetFieldValue(a);""!=r&&UpdateFieldArray(a,"001",r,"")}var o=$j("#recordid000F0").val();ArrActionLog="AddGroup-DcNo-"+e+"-KeyColumn-"+t+"-Recordid-"+o;var n=GetFormatGridIndex(e);if(-1!=n){var l=DcMultiSelect[n].toString().toLowerCase();try{if("true"==l)ASB.WebService.GetAddGroupsHtml(ChangedFields,ChangedFieldDbRowNo,ChangedFieldValues,DeletedDCRows,e,transid,tstDataId,SuccessGetFillGridMS,OnException);else{var s=GetDeletedRows(),d=GetChangedRows(),c=$j("#recordid000F0").val();ShowDimmer(!0),ASB.WebService.ExecuteAction(ChangedFields,ChangedFieldDbRowNo,ChangedFieldValues,DeletedDCRows,ArrActionLog,c,transid,e,"","",s,d,tstDataId,SuccExecActionValue,OnException)}}catch(u){AxWaitCursor(!1);var p=u.name+"^♠^"+u.message;showAlertDialog("error",2030,"client",p)}}}$j.curCSS=function(e,t,i){$j(e).css(t,i)};var fillGridDc="",fillOrAdd="",AxActivefillGridName="",dialogObj;function FillGrid(frNo,addGroup,fillGridName,fastFill){GetCurrentTime("Tstruct FillGrid button click(ws call)"),fastFill!=undefined||(fastFill=!1);var IsConfirm=!1;AxStartTime=new Date,AxStartTime=GetAxDate(AxStartTime);var stTime=new Date;try{AxBeforeFillGrid()}catch(ex){}if(AxActivefillGridName=fillGridName,-1==$j("[name="+fillGridName+"]").attr("class").indexOf("disablefill")){var vallist=new Array;fillGridDc=frNo;var ind=$j.inArray(fillGridName,FillGridName),dcIdx=$j.inArray(frNo,DCFrameNo),isExitDummy=!1;if(gridDummyRowVal.length>0&&gridDummyRowVal.map(function(e){e.split("~")[0]==fillGridDc&&(isExitDummy=!0)}),"APPEND"==FillCondition[ind]&&$("#gridHd"+frNo+" tbody tr").length>0&&isExitDummy)UpdateFieldArray(axpIsRowValid+frNo+"001F"+frNo,GetDbRowNo("001",frNo),"false","parent","fillgrid");else if("INIT"==FillCondition[ind]){if($("#gridHd"+frNo+" tbody tr").length>0&&!isExitDummy){IsConfirm=!0;var cutMsg=eval(callParent("lcm[26]")),glType=eval(callParent("gllangType")),isRTL=!1;isRTL="ar"==glType;var FillGridCB=$.confirm({theme:"modern",closeIcon:!1,title:eval(callParent("lcm[155]")),onContentReady:function(){disableBackDrop("bind")},backgroundDismiss:"false",rtl:isRTL,escapeKey:"buttonB",content:cutMsg,buttons:{buttonA:{text:eval(callParent("lcm[164]")),btnClass:"btn btn-primary",action:function(){GetCurrentTime("Tstruct FillGrid button click(ws call)"),FillGridCB.close(),gridDummyRowVal.length>0&&gridDummyRowVal.map(function(e){e.split("~")[0]==fillGridDc&&gridDummyRowVal.splice($.inArray(e,gridDummyRowVal),1),gridRowEditOnLoad=!1}),FillGridAfterConfirm(fastFill)}},buttonB:{text:eval(callParent("lcm[192]")),btnClass:"btn btn-bg-light btn-color-danger btn-active-light-danger",action:function(){disableBackDrop("destroy"),AxWaitCursor(!1),ShowDimmer(!1)}}}})}}else"AOWE"==FillCondition[ind]&&$("#gridHd"+frNo+" tbody tr").length>0&&!isExitDummy&&"True"==DCHasDataRows[dcIdx]&&(IsConfirm=!0,ShowDialog("warning",5003,"client"));0==IsConfirm&&FillGridAfterConfirm(fastFill)}function FillGridAfterConfirm(e){AxWaitCursor(!0),ShowDimmer(!0);var t="";-1!=ind&&(ashow=FillAutoShow[ind],multiselect=FillMultiSelect[ind].toString().toLowerCase(),t=FillParamFld[ind]),""!=FillSourceDc[ind]&&"true"==multiselect&&(multiselect="false");var i="";if(""!=t&&"true"==multiselect)for(var a=t.toString().split(","),r=0;r<a.length;r++){var o=IsGridField(a[r]),n=GetDcNo(a[r]);if(1==o){var l=GetDcRowCount(n);l=parseInt(l,10);for(var s=1;s<=l;s++){if(s=GetRowNoHelper(s),a[r]=GetExactFieldName(a[r]),$j("#"+a[r]+s+"F"+n)){var d=a[r].toString()+s+"F"+n,c=GetFieldValue(d,"fillGrid");c=CheckSpecialCharsInStr(c),i+="<"+a[r]+" rowno='"+s+"' >"+c+"</"+a[r]+">"}}}else{d=a[r].toString()+"000F"+n;if($("#"+d).length>0){c=GetFieldValue(d,"fillGrid");c=CheckSpecialCharsInStr(c),i+="<"+a[r]+">"+c+"</"+a[r]+">"}else{(c=CheckGlobalVars(a[r].toString()))==a[r].toString()?i+="<"+a[r]+"></"+a[r]+">":i+="<"+a[r]+">"+c+"</"+a[r]+">"}}}var p="fill";if(addGroup&&""!=addGroup&&(p=addGroup),fillOrAdd=p,"true"==multiselect)if(e){var u="t";try{callBackFunDtls="FillGridAfterConfirm♠"+e,GetProcessTime(),ASB.WebService.GetFastFillGridData(frNo,fillGridName,transid,p,tstDataId,u,SuccessGetFillGridMS,OnException)}catch(ex){AxWaitCursor(!1);var f=ex.name+"^♠^"+ex.message;showAlertDialog("error",2030,"client",f)}}else{u="t";""!=FillGridVExpr[ind]&&(u=EvalPrepared("","000",FillGridVExpr[ind],"expr")),i="<tid>"+transid+"</tid><dc>"+frNo+"</dc>"+i;try{callBackFunDtls="FillGridAfterConfirm♠"+e,GetProcessTime(),ASB.WebService.GetFillGridData(i,ChangedFields,ChangedFieldDbRowNo,ChangedFieldValues,DeletedDCRows,frNo,fillGridName,transid,p,tstDataId,u,SuccessGetFillGridMS,OnException)}catch(ex){AxWaitCursor(!1);f=ex.name+"^♠^"+ex.message;showAlertDialog("error",2030,"client",f),UpdateExceptionMessageInET("GetFillGridData exception : "+ex.message)}}else{IsFormDirty||SetFormDirty(!0);try{changeFillGridDc=frNo,callBackFunDtls="FillGridAfterConfirm♠"+e,GetProcessTime(),ASB.WebService.DoGetFillGridNonMS(ChangedFields,ChangedFieldDbRowNo,ChangedFieldValues,DeletedDCRows,frNo,fillGridName,tstDataId,SuccessFillGridNonMS,OnException)}catch(ex){AxWaitCursor(!1);f=ex.name+"^♠^"+ex.message;showAlertDialog("error",2030,"client",f),UpdateExceptionMessageInET("DoGetFillGridNonMS exception : "+ex.message),GetProcessTime(),GetTotalElapsTime()}}var h=new Date;AxTimeBefSerCall=h-stTime}}var fgHt=400,fgWid=400;function SuccessGetFillGridMS(result,eventArgs){if(""!=result){var serverprocesstime=result.split("*♠♠*")[0],requestProcess_logtime=result.split("*♠♠*")[1];result=result.split("*♠♠*")[2],WireElapsTime(serverprocesstime,requestProcess_logtime,!0)}if(-1===result.toLowerCase().indexOf("access violation")){if(CheckSessionTimeout(result))return;try{AxBeforeFillPopUp()}catch(ex){}var fillTitle="";if(fillTitle="FILL"==fillOrAdd?"FILL "+GetDcCaption(fillGridDc):"ADD "+GetDcCaption(fillGridDc),""==result){var cutMsg=eval(callParent("lcm[0]"));result="<label>"+cutMsg+"</label>"}var resSplit=result.split("*♠*");ChangedFields=new Array,ChangedFieldDbRowNo=new Array,ChangedFieldValues=new Array,DeletedDCRows=new Array;var tablehtml=resSplit[0].toString();if($j("#dvFillGrid").html(tablehtml),resSplit.length>1&&""!=resSplit[1].toString()){var fgSize=resSplit[1].toString(),fgsizeSplit=fgSize.split(",");try{fgHt=fgsizeSplit[2].toString(),fgWid=fgsizeSplit[3].toString()}catch(e){}"0"!=fgHt&&"0"!=fgWid||(fgHt=400,fgWid=400);var modalData="";modalData+=$j("#dvFillGrid").wrap('<p id="bootstrapModalWrapP"/>').parent().html(),$j("#bootstrapModalWrapP").html(""),buttons={count:2,button1:{name:eval(callParent("lcm[281]")),"function":"ProcessFillGrid("+fillGridDc+", '"+AxActivefillGridName+"')","class":"btn hotbtn",id:"modalCnfirmbtn"},button2:{name:eval(callParent("lcm[192]")),"class":"btn coldbtn"}};var myModal=new BSModal("dvFillGrid",fillTitle,modalData,function(){},function(){});myModal.changeSize("fullscreen"),myModal.okBtn.innerText=eval(callParent("lcm[281]")),myModal.okBtn.setAttribute("onClick","ProcessFillGrid('"+fillGridDc+"','"+AxActivefillGridName+"')"),myModal.cancelBtn.innerText=eval(callParent("lcm[192]")),jQuery("table[id^=tblFillGrid]").length&&bindUpdownEvents(jQuery("table[id^=tblFillGrid]").attr("id"),"multiple"),$("#wrapperForMainNewData",window.parent.document).hide()}else{var modalData="",buttons={count:1,button1:{name:eval(callParent("lcm[281]")),"class":"btn hotbtn"}};modalData+=$j("#dvFillGrid").wrap('<p id="bootstrapModalWrapP"/>').parent().html(),createBootstrapModal("dvFillGrid",fillTitle,modalData,buttons),jQuery("table[id^=tblFillGrid]").length&&bindUpdownEvents(jQuery("table[id^=tblFillGrid]").attr("id"),"multiple"),$("#wrapperForMainNewData",window.parent.document).hide()}$("#bootstrapModal").ready(function(){try{var glCulture=eval(callParent("glCulture")),dtFormat="DD/MM/YYYY";"en-us"==glCulture&&(dtFormat="MM/DD/YYYY"),$.fn.dataTable.moment(dtFormat)}catch(ex){}fillGridDatatbl=$("table[id^=tblFillGrid]").DataTable({fixedHeader:!0,dom:'<"pull-left"f><"pull-right"l>tip',columnDefs:[{orderable:!1,targets:0}],aaSorting:"undefined"!=typeof fillGridDataQueryOrder&&"true"==fillGridDataQueryOrder.toString()?[]:[[1,"asc"]],language:{search:"_INPUT_",searchPlaceholder:"Search..."},scrollCollapse:!0,lengthMenu:"undefined"!=typeof fillGridDataShowAll&&"true"==fillGridDataShowAll.toString()?[[-1,500,100],["All",500,100]]:[[100,500,-1],[100,500,"All"]],autoWidth:!1}),$("#dvFillGrid .dataTables_filter input[type=search]").addClass("serachdatatbl form-control"),$("#dvFillGrid .dataTables_length select").removeClass("form-control input-sm selectPaddingFix").addClass("showentries");for(var theadtext=$(".gridData.customSetupTableMN.dataTable thead tr th"),i=1;i<theadtext.length;i++){var temptext=theadtext[i].innerHTML;temptext=temptext.toLowerCase(),$(".gridData.customSetupTableMN.dataTable thead tr th")[i].innerHTML=capitalizeFirstLetter(temptext)}}),AxWaitCursor(!1),ShowDimmer(!1)}else AxWaitCursor(!1),ShowDimmer(!1),$("#reloaddiv").show(),$("#dvlayout").hide();GetProcessTime(),GetTotalElapsTime()}function capitalizeFirstLetter(e){return e.charAt(0).toUpperCase()+e.slice(1)}function GetDcCaption(e){e="dc"+e;var t="",i=$j.inArray(e,DCName);return-1!=i&&(t=DCCaption[i]),t}function SuccessFillGridNonMS(e,t){if(""!=e){var i=e.split("*♠♠*")[0],a=e.split("*♠♠*")[1];e=e.split("*♠♠*")[2],WireElapsTime(i,a,!0)}if(-1===e.toLowerCase().indexOf("access violation")){gridDummyRowVal.length>0&&gridDummyRowVal.map(function(e){e.split("~")[0]==fillGridDc&&gridDummyRowVal.splice($.inArray(e,gridDummyRowVal),1),gridRowEditOnLoad=!1});var r=new Date;if(CheckSessionTimeout(e))return;""!=e&&ParseServiceResult(e,"FillGrid");var o=$j("#axp_colmerge_"+fillGridDc+"000F1");null!=(o=o.val())&&""!=o&&o!=undefined&&GetGridDcTable(o,fillGridDc);try{AxAfterFillGrid()}catch(s){}if(changeEditLayoutIds(FillGridFillRows,FillGridCurrentDC,"fillGrid"),EvaluateSetFont(fillGridDc),showAttachmentPopover(),"true"==AxLogTimeTaken){var n=(new Date).getTime()-r.getTime();CreateTimeLog(AxStartTime,AxTimeBefSerCall,n,ASBTotal,ASBDbTime,"FillGridNonMS")}if(setDesignedLayout("#divDc"+fillGridDc),FocusOnFirstGridField(fillGridDc),isMobile&&"none"==mobileCardLayout){$("#wrapperForEditFields"+fillGridDc).removeClass("d-none"),$("#wrapperForEditFields"+fillGridDc).addClass("mobilewrapperForEditFields"),0!=$(".wrapperForGridData"+fillGridDc+" table tbody tr").length||axInlineGridEdit||$("#colScroll"+fillGridDc).hide(),axInlineGridEdit&&$(".editWrapTr").hide(),$(".editLayoutFooter").hide(),$("#DivFrame".concat(fillGridDc," .newgridbtn")).addClass("d-none");var l=$("#DivFrame".concat(fillGridDc," .newgridbtn>ul")).html();$("#wrapperForEditFields".concat(fillGridDc)).append('<div class="clearfix"></div><div class="grdButtons btnMobile"><ul class="left">'.concat(l,"</ul></div>")),$("#wrapperForEditFields".concat(fillGridDc," .btnMobile")).find("#viewGrid".concat(fillGridDc)).addClass("d-none"),$(".dcTitle").hide().nextAll("hr.hrline").hide();try{"undefined"!=typeof designObj&&null!=designObj[0]&&null!=designObj[0].selectedLayout&&""!=designObj[0].selectedLayout&&"tile"==designObj[0].selectedLayout&&$(".dcTitle").show().nextAll("hr.hrline").show()}catch(s){}}}else AxWaitCursor(!1),ShowDimmer(!1),$("#reloaddiv").show(),$("#dvlayout").hide();GetProcessTime(),GetTotalElapsTime()}var addGroupDc="";function ProcessAddGroup(e){addGroupDc=e;var t=$j("#tblFillGrid"+e),i="";t.find(".fgChk").each(function(){if($j(this).prop("checked")!=undefined&&0==$j(this).prop("disabled")){var e=$j(this).val().split("¿");i+=""==i?e[0].toString():"¿"+e[0].toString()}});var a=GetDcClientRows(e).getMaxVal(),r=parseInt(a,10)+1,o=GetRowNoHelper(r);try{ASB.WebService.GetNewGroupsHtml(e,transid,i,o,tstDataId,SuccAddGroups)}catch(l){AxWaitCursor(!1);var n=l.name+"^♠^"+l.message;showAlertDialog("error",2030,"client",n)}}function SuccAddGroups(e,t){if(!CheckSessionTimeout(e)&&""!=addGroupDc){var i=e.split("♣");$j("#gridDc"+addGroupDc).html();if($j("#gridDc"+addGroupDc+" > tbody:last").append(i[1]),""!=i[0])for(var a=new Array,r=i[0].toString().split(","),o=0;o<r.length;o++)UpdateDcRowArrays(addGroupDc,r[o],"Add"),UpdateKeyColValues(addGroupDc,r[o]);ResetRowCount(addGroupDc,r.length),ResetGridRowsStyle(addGroupDc),a.push("#DivFrame"+addGroupDc),AssignJQueryEvents(a),AxWaitCursor(!1),dialogObj&&(dialogObj.dialog("close"),$("#wrapperForMainNewData",window.parent.document).show())}}function ResetRowCount(e,t){var i=parseInt($j("#hdnRCntDc"+addGroupDc).val(),10);SetRowCount(addGroupDc,i+t)}function UpdateKeyColValues(e,t){var i=GetFormatGridIndex(e);if(-1!=i){var a=DcKeyColumns[i],r=($j("#"+a+t+"F"+e),GetFieldValue(a+t+"F"+e)),o=GetDbRowNo(t,e);UpdateFieldArray(a+t+"F"+e,o,r,"parent")}}function ProcessFormatStaticFill(e){fillDcname=e,AxWaitCursor(!0);var t=$j("#tblFillGrid"+e),i="",a="",r="",o=$j.inArray("dc"+e,DCName),n="";-1!=o&&(n=DcKeyColumns[o]),t.find(".fgChk").each(function(){if($j(this).prop("checked")!=undefined)for(var e=$j(this).val().split("¿"),t=0;t<e.length;t++){var i=e[t].split("♣");0==t&&i[0]==n&&(r=i[0]),i[0]==r&&(""==a?a=i[1]:a+=","+i[1])}}),i=i.replace(/&/g,"&amp;");$j("#recordid000F0").val();try{ASB.WebService.ExecuteFormatFill(transid,e,a,tstDataId,SuccExecActionValue)}catch(s){AxWaitCursor(!1);var l=s.name+"^♠^"+s.message;showAlertDialog("error",2030,"client",l)}}function ProcessFormatFill(e){fillDcname=e,AxWaitCursor(!0);var t=$j("#tblFillGrid"+e),i="",a="",r="",o="";if(t.find(".fgChk").each(function(){if($j(this).prop("checked")!=undefined)for(var e=$j(this).val().split("¿"),t=0;t<e.length;t++){var i=e[t].split("♣");0==t&&"selection"==i[0].substring(1)&&(r=i[0],o=i[0].substring(0,1)),i[0]==r&&("n"!=o?""==a?a="'"+i[1]+"'":a+=",'"+i[1]+"'":""==a?a=i[1]:a+=","+i[1])}}),""==a)return showAlertDialog("warning",2005,"client"),void AxWaitCursor(!1);i=(i="<selections>"+a+"</selections>").replace(/&/g,"&amp;");var n=$j("#recordid000F0").val(),l=$j("#recordid000F0").val();ArrActionLog="FillFormatGrid-DcNo-"+e+"-Selected groups-"+a+"-Recordid-"+l;var s=GetDeletedRows(),d=GetChangedRows();try{ASB.WebService.ExecuteAction(ChangedFields,ChangedFieldDbRowNo,ChangedFieldValues,DeletedDCRows,ArrActionLog,n,transid,e,i,a,s,d,tstDataId,SuccExecActionValue,OnException)}catch(p){AxWaitCursor(!1);var c=p.name+"^♠^"+p.message;showAlertDialog("error",2030,"client",c)}}function SuccExecActionValue(e,t){ArrActionLog="",CheckSessionTimeout(e)||(""!=e&&ParseServiceResult(e,"Action"),dialogObj&&(dialogObj.dialog("close"),$("#wrapperForMainNewData",window.parent.document).show()))}function ProcessFillGrid(e,t){GetCurrentTime("Tstruct Process FillGrid Ok button click(ws call)"),gridDummyRowVal.length>0&&gridDummyRowVal.map(function(t){t.split("~")[0]==e&&gridDummyRowVal.splice($.inArray(t,gridDummyRowVal),1),gridRowEditOnLoad=!1}),AxStartTime=new Date,AxStartTime=GetAxDate(AxStartTime);var i=new Date;fillDcname=e,ShowDimmer(!0),AxWaitCursor(!0),IsFormDirty||SetFormDirty(!0);$j("#tblFillGrid"+e);var a="",r="";if(0!=$('input[name="chkItem"]:checked').length,fillGridDatatbl.rows().every(function(){var e=this.node(),t=($(e).find("td"),$(e).find('td input[type="checkbox"]'));if(t.is(":checked")){r=t.val(),a+="<row>";for(var i=r.split("¿"),o=0;o<i.length;o++){var n=i[o].split("♣"),l=CheckSpecialCharsInStr(n[1]);a+="<"+n[0]+">"+l+"</"+n[0]+">"}a+="</row>"}}),"<GridList></GridList>"!=(a="<GridList>"+a+"</GridList>"))try{changeFillGridDc=e,callBackFunDtls="ProcessFillGrid♠"+e+"♠"+t,GetProcessTime(),ASB.WebService.DoGetFillGrid(ChangedFields,ChangedFieldDbRowNo,ChangedFieldValues,DeletedDCRows,e,t,a,tstDataId,SuccGetResultValue,OnException)}catch(l){AxWaitCursor(!1),ShowDimmer(!1),dialogObj&&(dialogObj.dialog("close"),$("#wrapperForMainNewData",window.parent.document).show());var o=l.name+"^♠^"+l.message;showAlertDialog("error",2030,"client",o),UpdateExceptionMessageInET("DoGetFillGridWS exception : "+l.message),GetProcessTime(),GetTotalElapsTime()}else ShowDimmer(!1),AxWaitCursor(!1),dialogObj&&(dialogObj.dialog("close"),$("#wrapperForMainNewData",window.parent.document).show()),GetProcessTime(),GetTotalElapsTime();var n=new Date;AxTimeBefSerCall=n-i,AxActivefillGridName=""}function SuccGetResultValue(e,t){if(""!=e){var a=e.split("*♠♠*")[0],r=e.split("*♠♠*")[1];e=e.split("*♠♠*")[2],WireElapsTime(a,r,!0)}if(-1===e.toLowerCase().indexOf("access violation")){var o=new Date;if(CheckSessionTimeout(e))return;if(ParseServiceResult(e,"FillGrid"),"Approved"!=appstatus&&"Rejected"!=appstatus&&"design"!=theMode&&DoFormControlOnload(),"Approved"!=appstatus&&"Rejected"!=appstatus&&"design"!=theMode){var n=$j("#recordid000F0").val();DoScriptFormControl("",""!=n&&"0"!=n?"On Data Load":"On Form Load")}var l=$(".wrapperForGridData"+fillDcname+" table tbody tr td").find("textarea[id^=dc"+fillDcname+"_image]"),s=$(".wrapperForGridData"+fillDcname+" table tbody tr td").find("textarea[id^=axp_gridattach_]"),d=$(".wrapperForGridData"+fillDcname+" table tbody tr td").find("textarea[class^=axpAttach]");l.length>0&&l.each(function(e,t){if("gridattach"==$(t).attr("data-type")){var i=$("textarea#"+$(t).attr("id")).text();""!=i&&i!=undefined&&(ConstructAttachHTML(i,$(t).attr("id"),"FillGrid"),showAttachmentPopover())}}),s.length>0&&s.each(function(e,t){var i=$("textarea#"+$(t).attr("id")).text();ConstructAttachHTML(i,$(t).attr("id"),"FillGrid"),showAttachmentPopover()}),d.length>0&&d.each(function(e,t){if("gridattach"==$(t).attr("data-type")){var i=$("textarea#"+$(t).attr("id")).text();""!=i&&i!=undefined&&(ConstructAxpAttachHTML(i,$(t).attr("id"),"FillGrid"),showAttachmentPopover())}});var c=$j("#axp_colmerge_"+fillDcname+"000F1");null!=(c=c.val())&&""!=c&&c!=undefined&&GetGridDcTable(c,fillDcname);try{AxAfterFillGrid()}catch(m){}fillgridColOptVisibility(fillDcname),EvaluateSetFont(fillDcname),changeEditLayoutIds(FillGridFillRows,FillGridCurrentDC,"fillGrid"),axInlineGridEdit&&UpdateDcRowArrays(FillGridCurrentDC,GetRowNoHelper(parseInt(FillGridFillRows,10)+1),"Add");var p=GetGridFields(FillGridCurrentDC),u=getNewEditRowNo(FillGridCurrentDC);if(AxActiveRowNo=parseInt(u),AxActiveDc=FillGridCurrentDC,"undefined"!=typeof wsPerfEnabled&&wsPerfEnabled?CallEvaluateOnAddPerf(FillGridCurrentDC,GetRowNoHelper(parseInt(FillGridFillRows,10)+1),p,"FillGrid"):CallEvaluateOnAdd(FillGridCurrentDC,GetRowNoHelper(parseInt(FillGridFillRows,10)+1),p,"FillGrid"),AxWaitCursor(!1),dialogObj&&(dialogObj.dialog("close"),$("#wrapperForMainNewData",window.parent.document).show()),"true"==AxLogTimeTaken){var f=(new Date).getTime()-o.getTime();CreateTimeLog(AxStartTime,AxTimeBefSerCall,f,ASBTotal,ASBDbTime,"FillGridMS")}if(setDesignedLayout("#divDc"+fillDcname),FocusOnFirstGridField(fillDcname),customAlignTstructFlds([],FillGridCurrentDC),$j("textarea[id^='axpvalid']").each(function(){DoFormControlPrivilege($j(this).attr("id"),$j(this).val())}),isMobile&&"none"==mobileCardLayout){$("#wrapperForEditFields"+fillDcname).removeClass("d-none"),$("#wrapperForEditFields"+fillDcname).addClass("mobilewrapperForEditFields"),0!=$(".wrapperForGridData"+fillDcname+" table tbody tr").length||axInlineGridEdit||$("#colScroll"+fillDcname).hide(),axInlineGridEdit&&$(".editWrapTr").hide(),$(".editLayoutFooter").hide(),$("#DivFrame".concat(fillDcname," .newgridbtn")).addClass("d-none");var h=$("#DivFrame".concat(fillDcname," .newgridbtn>ul")).html();$("#wrapperForEditFields".concat(fillDcname)).append('<div class="clearfix"></div><div class="grdButtons btnMobile"><ul class="left">'.concat(h,"</ul></div>")),$("#wrapperForEditFields".concat(i+1," .btnMobile")).find("#viewGrid".concat(i+1)).addClass("d-none"),$(".dcTitle").hide().nextAll("hr.hrline").hide();try{"undefined"!=typeof designObj&&null!=designObj[0]&&null!=designObj[0].selectedLayout&&""!=designObj[0].selectedLayout&&"tile"==designObj[0].selectedLayout&&$(".dcTitle").show().nextAll("hr.hrline").show()}catch(m){}}}else AxWaitCursor(!1),ShowDimmer(!1),$("#reloaddiv").show(),$("#dvlayout").hide();GetProcessTime(),GetTotalElapsTime()}function ClearFldArrays(){ChangedFields.length=0,ChangedFieldDbRowNo.length=0,ChangedFieldValues.length=0,DeletedDCRows.length=0}function ParseServiceResult(e,t){if(""!=e){ClearFldArrays();var i=e.split("*♠*"),a=e.split("*♠*~");if(i[0]!=undefined)try{AssignLoadValues(i[0].toString(),t)}catch(d){AxWaitCursor(!1),ShowDimmer(!1)}if(i[2]!=undefined){try{var r=designObj,o=JSON.parse(i[2]);if($.isEmptyObject(o))designObj=r;else{var n=designObj[0].dcs.map(function(e,t){return e.dc_id}).indexOf(o.dc_id);n>-1?designObj[0].dcs[n]=o:designObj[0].dcs=_.sortBy([].concat(_toConsumableArray(designObj[0].dcs),[o]),"dc_id")}}catch(d){designObj=r}jsonText=JSON.stringify(designObj,null,"")}if(i[1]!=undefined)if(i[1].substring(0,ErrLength)==ErrStr){var l=i[1].substring(ErrLength,i[1].length-8);AxWaitCursor(!1),showAlertDialog("error",l)}else AssignHTML(i[1],"FillGrid",t),0!=changeFillGridDc&&(CheckShowHideFldsGrid(changeFillGridDc.toString()),changeFillGridDc=0),AxWaitCursor(!1);if("GetTabData"==t&&a!=undefined&&a.length>1&&"false"==a[1]){var s=$j.inArray(CurrTabNo.toString(),DCFrameNo);IsDcGrid(CurrTabNo)&&"False"==DCHasDataRows[s]&&UpdateAxpRowVldInArray(CurrTabNo,"001","1"),EvalDcFldExpressions(CurrTabNo)}}try{AfterParseServiceResult(t)}catch(d){}ShowDimmer(!1),AxWaitCursor(!1)}function EvalDcFldExpressions(e){for(var t=GetGridFields(e),i=0;i<t.length;i++){var a=t[i];a!="axp_recid"+e&&(IsGridField(a)?EvaluateAxFunction(t[i],a,"001F"+e):EvaluateAxFunction(t[i],a,"000F"+e))}}function DoFillControlPrivilege(strSingleLineText){var rno,noofrows=1;if(""!=strSingleLineText)for(var myfdcJSONObject=eval("("+strSingleLineText+")"),i=0;i<myfdcJSONObject.root.length;i++)for(var dcvalues=myfdcJSONObject.root[i].dc,fields=dcvalues.split("###"),gdslno=1,fpar=0;fpar<fields.length;fpar++){var valSplit=fields[fpar].toString();valSplit=valSplit.split("~"),rno=noofrows+"";var rnolength=rno.length;2==rnolength?nrno="0"+rno:1==rnolength?nrno="00"+rno:3==rnolength&&(nrno=rno),nrno=nrno+"F"+fillDcname;var fldVal="";for(m=0;m<valSplit.length;m++){var FldSplit=valSplit[m].split("=");if(-1!=FldSplit[0].toString().indexOf("axpvalid")&&(fldVal=FldSplit[1]),""!=fldVal){var strValue=fldVal.toString().toUpperCase();if("B"==strValue){var delImg=window.opener.document.getElementById("del"+nrno);delImg&&(delImg.removeAttribute("onclick"),delImg.removeAttribute("onmouseover"),delImg.removeAttribute("onmouseout"))}if("C"==strValue){var delImg=window.opener.document.getElementById("del"+nrno);delImg&&(delImg.removeAttribute("onclick"),delImg.removeAttribute("onmouseover"),delImg.removeAttribute("onmouseout"));for(var l=0;l<valSplit.length;l++){var FldSplit=valSplit[l].split("="),FieldId=window.opener.document.getElementById(FldSplit[0]+nrno);if(FieldId){var id=FieldId.id;window.opener.document.getElementById(id).disabled="true"}}break}}}dnrno="'"+nrno+"'",noofrows+=1}}function CheckAll(e,t){"t"==t||"true"==t?$j("input[name=chkItem]:checkbox").each(function(){0==$j(this).prop("disabled")&&"none"!=$j(this).parent().parent().parent().css("display")&&$j(this).prop("checked",e.checked)}):e.checked=!1,$j("#dvFillGrid").height($j("#dvFillGrid").height())}function ChkHdrCheckbox(e,t){"t"==t||"true"==t?$j(".fgChk:visible").length==$j(".fgChk:checked").length?$j(".fgHdrChk").prop("checked",!0):$j(".fgHdrChk").prop("checked",!1):e.checked=!1,$j("#dvFillGrid").height($j("#dvFillGrid").height())}function DeleteAllRows(e,t){var i=parseInt(t,10);i>1&&!axInlineGridEdit&&"form"!=AxpGridForm&&(grdRCOunt=$("#gridHd"+e+" tbody tr").length,grdRCOunt==i&&i++);for(var a=axInlineGridEdit?i:"form"==AxpGridForm?i:i-1;a>=1;a--)DeleteGridRow(e,GetClientRowNo(a,e),"all");if(axInlineGridEdit||"form"!=AxpGridForm){adjustEditLayoutId(e),AxActiveRowNo="1";var r=GetGridFields(e);"undefined"!=typeof wsPerfEnabled&&wsPerfEnabled?CallEvaluateOnAddPerf(e,"001",r):CallEvaluateOnAdd(e,"001",r),IsAddRowCalled?axInlineGridEdit||UpdateDcRowArrays(e,"001","Add"):(IsDcPopGridCleared=!0,DeleteGridRow(e,"001F"+e,undefined))}else $("#divDc"+e+" .grid-icons").append(gridDivHtml[e]),$("#divDc"+e+" .formGridRow").remove(),0==$(".wrapperForGridData"+e+" table tbody tr").length&&adjustEditLayoutId(e),setDesignedLayout("divDc"+e),editTheRow("",e,"",event)}function ChangeDir(e){$j("#form1").attr("dir",e)}function LoadPdfDDL(e){document.getElementById("dvPdfDDl").innerHTML=e}function bindUpdownEvents(e,t){unbindKeyDownEvent(),"single"!=t&&$("#"+e+" input[type='checkbox']").each(function(){$(this).parents("td,th").addClass("text-center")}),jQuery("#"+e+" tr:nth-child(2)").length,jQuery("#"+e).length>0&&(jQuery("#"+e).on("keydown.tstrctSrch","tr:not(:first)",function(i){var a=$(this);if($(a).addClass("activeSearchTr"),9!=i.keyCode||i.shiftKey)if(9==i.keyCode&&i.shiftKey)jQuery("#"+e).find("tr.activeSearchTr").prevAll("tr:visible").length>0&&("multiple"==t&&checkTheHeight(e,a,"top"),$(a).prev().is("tr")&&!$(a).prev().is("#"+e+" tr:first")&&(jQuery("#"+e).find("tr.activeSearchTr").removeClass("activeSearchTr"),$(a).prev().addClass("activeSearchTr"),jQuery(".activeSearchTr").find("input").focus(),i.preventDefault()));else if(38==i.keyCode){i.preventDefault(),0!=jQuery("#"+e).find("tr.activeSearchTr").index()&&jQuery("#"+e).find("tr.activeSearchTr").prevAll("tr:visible").length>0&&("multiple"==t&&checkTheHeight(e,a,"top"),jQuery("#"+e).find("tr.activeSearchTr").removeClass("activeSearchTr").prevAll("tr:visible:first").addClass("activeSearchTr").find("input").focus())}else if(40==i.keyCode){"single"==t&&i.preventDefault(),jQuery("#"+e).find("tr.activeSearchTr").index()<jQuery("#"+e).find("tr").last().index()&&jQuery("#"+e).find("tr.activeSearchTr").nextAll("tr:visible").length>0&&("multiple"==t&&checkTheHeight(e,a,"bottom"),jQuery("#"+e).find("tr.activeSearchTr").removeClass("activeSearchTr").nextAll("tr:visible:first").addClass("activeSearchTr").find("input").focus())}else 32==i.keyCode?"searchInput"!=$(i.target).attr("id")&&"single"==t&&unbindKeyDownEvent():13==i.keyCode&&"searchInput"!=$(i.target).attr("id")&&("multiple"==t?(i.preventDefault(),unbindKeyDownEvent(),$("#dvFillGrid").parents(".modal-body").next().find("#modalCnfirmbtn").click()):(jQuery("#"+e+" tr.activeSearchTr input").click(),"single"==t&&unbindKeyDownEvent()),unbindKeyDownEvent());else jQuery("#"+e).find("tr.activeSearchTr").prevAll("tr:visible").length>0&&("multiple"==t&&checkTheHeight(e,a,"bottom"),$(a).next().is("tr")&&(jQuery("#"+e).find("tr.activeSearchTr").removeClass("activeSearchTr"),$(a).next().addClass("activeSearchTr"),jQuery(".activeSearchTr").find("input").focus(),i.preventDefault()))}),jQuery("#"+e).on("keydown.tstrctSrch","tr:first",function(e){13==e.keyCode&&$("#dvFillGrid").parents(".modal-body").next().find("#modalCnfirmbtn").click()}),jQuery("#"+e+" tr").hover(function(){jQuery("#"+e+" tr.activeSearchTr").removeClass("activeSearchTr")},function(){}),jQuery("#"+e+" tr").click(function(e){"single"==t&&unbindKeyDownEvent(),"checkbox"!=$(e.target).attr("type")&&"radio"!=$(e.target).attr("type")&&0==$(this).parent("thead").length&&("single"==t?jQuery(this).find('input[type="radio"]').click():jQuery(this).find('input[type="checkbox"]').click())}))}function checkTheHeight(e,t,i){var a=parseInt(jQuery("#dvFillGrid").parents(".modal-body-content").css("height").replace("px","")),r=jQuery("#dvFillGrid").parents(".modal-body-content").scrollTop(),o=$(t),n=$(t).next().height(),l=$(t).prev().height(),s=o.position().top;"bottom"==i?s+n+50>a&&jQuery("#dvFillGrid").parents(".modal-body-content").animate({scrollTop:r+n+30},"fast"):"top"==i&&s-l<0&&jQuery("#dvFillGrid").parents(".modal-body-content").animate({scrollTop:r-l-30},"fast")}function unbindKeyDownEvent(){jQuery(document).unbind("keydown.tstrctSrch")}function GetGridDcTable(e,t){var i="gridHd"+t,a=document.getElementById(i),r=e.split("#"),o=a.outerHTML;o=o.replace(i,"mergeHd"+t),$j("#"+i).before(o);for(var n=$j("#mergeHd"+t)[0].childNodes[0].childNodes[0].childNodes,l=0;l<n.length;l++)for(var s=r[0].split(",").toString(),d=s.substr(s.indexOf("~")+1).split(","),c=s.split("~",1).toString(),p=0;p<d.length;p++){var u=n[l];u.innerHTML="",thName="th-"+d[p],u.id==thName&&(SetHeader(d,p,c),r.length>1&&r.splice(0,1),l=l+d.length-1);break}}function SetHeader(e,t,i){for(var a=0;a<e.length;a++){theadName="th-"+e[t+a];var r=document.getElementById(theadName);a-(e.length-1)!=0&&(r.style.borderColor="grey"),0==a?(r.innerHTML='<div id="div-'+e[0]+'"><b style="font-weight:101">'+i+"</b></div>",r.style.borderBottom="solid 1px white",r.style.maxWidth=r.style.width):(r.innerHTML="",r.style.borderBottom="solid 1px white")}SetHeaderWidth(e,e[0],t)}function SetHeaderWidth(e,t,i){for(var a=parseInt(0),r=(parseInt(0),$j("#div-"+t)),o=0;o<e.length;o++)theadName="th-"+e[i+o],a+=parseInt(document.getElementById(theadName).offsetWidth);navigator.userAgent.toLowerCase().indexOf("firefox")>-1?(r=document.getElementById("div-"+t)).childNodes[0].innerHTML.indexOf("_")>-1?(r.style.width=a+"px",r.style.maxWidth=a+"px",r.childNodes[0].innerHTML=r.childNodes[0].innerHTML.replace(/_/g," ")):(r.style.width=a+"px",r.style.maxWidth=a+"px"):(r=$j("#div-"+t))[0].innerText.indexOf("_")>-1?(r.css({width:a,maxWidth:a}),r[0].innerText=r[0].innerText.replace(/_/g," ")):(a=40*a/100,r.css({marginLeft:a}))}$("body").on("click",function(e){$("[data-toggle=popover]").each(function(){$(this).is(e.target)||0!==$(this).has(e.target).length||0!==$(".popover").has(e.target).length||$(this).popover("hide")})}),$j(function(){for(var e=0;e<VisibleDCs.length;e++)if("true"==DCIsGrid[e].toLowerCase()&&$j("#axp_colmerge_"+VisibleDCs[e]+"000F1").length>0){var t=$j("#axp_colmerge_"+VisibleDCs[e]+"000F1");null!=(t=t[0].value)&&""!=t&&t!=undefined&&GetGridDcTable(t,VisibleDCs[e])}});var popUpTitle="";function OpenPopUp(e,t){var i=GetFieldsRowNo(e),a=GetFieldsDcNo(e);AxActivePDc=a,RegisterActivePRow(i,a),AxIsPopActive=!0;var r=t.substring(t.lastIndexOf("F")+1);AxActiveDc=r;var o=$j.inArray(r,PopGridDCs);if(-1!=o){if(""!=PopCondition[o]&&"f"==EvalPrepared("","000",PopCondition[o],"expr").toLowerCase())return void showAlertDialog("error",2006,"client")}var n=IsPopGridFirmBind(r);SetPopDcStyle(r,n);var l=GetPopRows(a,i,r),s=l.split(",");parseInt($j("#hdnRCntDc"+r).val(),10),popUpTitle="<span style='font-size: 20PX;color: white;font-weight: bold;'>"+(popUpTitle=$j("#popDcTitle"+r).val())+"</span>",$j("#gridDc"+r+" tbody tr").each(function(){$j(this);$j(this).hide()});for(var d=0;d<s.length;d++){var c="#sp"+r+"R"+s[d]+"F"+r;$j(c).show()}if($j(".AxAddRows").length>0&&$j(".AxAddRows").val("1"),""==l&&1==IsPopParBound(r,a,i)){if(1==GetDcRowCount(r)&&IsEmptyRow("001",r))0==IsRowInPopRows(a,r,i,"001")&&(1,UpdatePopUpArrays(r,"001",!0,"Add"),UpdatePopParentFlds(r,a,"001",i),SetRowCount(r,"1"),$j("#sp"+r+"R001F"+r).show(),RefreshFillFldsInSubGrid(r,"001"),AxActiveRowNo="1",CallGetSubGridDDL(r,i,a,"001"));else AddSubGridRow(r)}else RefreshFillFldsInSubGrid(r,l),$j("#DivFrame"+r).dialog({title:popUpTitle,height:400,width:550,close:function(){ClosePopUp(r)},position:"top",modal:!0,buttons:{Ok:function(){ClosePopUp(r,$j(this))}}})}function RefreshFillFldsInSubGrid(e,t){for(var i=GetGridFields(e),a=0;a<i.length;a++){var r=GetFieldIndex(i[a]),o=FldParents[r].toString().split(",");if("Fill"==FMoe[r]&&""!=o)for(var n=0;n<o.length;n++){var l=GetDcNo(o[n]);if(!IsDcGrid(l)&&-1!=$j.inArray(o[n],ComboParentField))for(var s=GetFieldValue(o[n]+"000F"+l),d=(o[n],o[n]),c=0;c<ComboParentField.length;c++)if(ComboParentField[c]==d&&ComboParentValue[c]==s){for(var p=t.split(","),u=0;u<p;u++)if(""!=p[u]){var f=p[u]+"F"+e,h=GetDbRowNo(p[u],e),m=ComboDepField[c]+f,v=ComboDepValue[c].toString();$j("#"+m).length>0&&(CallSetFieldValue(m,v),UpdateFieldArray(m,h,v,"parent"))}break}}}}function AddSubGridRow(dcNo,calledFrom){var tableName="gridDc"+dcNo,newRow="",sTRowIndx=-1;newRow=$j("#"+tableName+" tbody>tr:last").clone(!0);var oldRowNo=newRow.attr("id"),hdnRowCount=$j("#hdnRCntDc"+dcNo);if(hdnRowCount.length>0){var dcClientRows=GetDcClientRows(dcNo),lastRow=dcClientRows.getMaxVal(),rowCount=$j("#hdnRCntDc"+dcNo).val(),newCnt=parseInt(lastRow,10)+1,newRowNo=GetRowNoHelper(newCnt);newRow.attr("id","sp"+dcNo+"R"+newRowNo+"F"+dcNo),newRow.find(":input").val(""),newRow.find("select,input,label,img,.Grdlnk").each(function(){ConvertFieldID($j(this),newRowNo)}),RegisterActiveRow(newRowNo,dcNo),AxActiveDc=dcNo;var glType=eval(callParent("gllangType")),dtpkrRTL=!1;dtpkrRTL="ar"==glType;var glCulture=eval(callParent("glCulture")),dtFormat="dd/mm/yy";"en-us"==glCulture&&(dtFormat="mm/dd/yy"),$j(".date").datepicker({isRTL:dtpkrRTL,dateFormat:dtFormat,showOn:"both",buttonImage:"../AxpImages/icons/16x16/calendar.png",buttonImageOnly:!0,buttonText:"Select date",changeMonth:!0,changeYear:!0,yearRange:"-100:+100"}),delImg=newRow.find(".rowdelete"),delImg.attr("id")!=undefined&&delImg.attr("id","del"+newRowNo+"F"+dcNo),newRow.insertAfter("#"+tableName+" tbody>tr:last"),$j("#sp"+dcNo+"R"+newRowNo+"F"+dcNo).show(),calledFrom==undefined?SetRowCount(dcNo,newCnt,"i"+newRowNo):SetRowCount(dcNo,parseInt(rowCount,10)+1),"GetDep"==calledFrom&&UpdateNewPopInfo(dcNo,newRowNo);var rowFrameNo=newRowNo+"F"+dcNo,ind=$j.inArray(rowFrameNo,DeletedDCRows);if(-1!=ind&&DeletedDCRows.splice(ind,1),CheckScroll(dcNo),UpdateDcRowArrays(dcNo,newRowNo,"Add"),calledFrom==undefined&&(UpdateFieldsInNewRow(dcNo,newRowNo),UpdatePopParentFlds(dcNo,AxActivePDc,newRowNo,GetClientRowNo(AxActivePRow,AxActivePDc))),IsFunction="","GetDep"==calledFrom)if(""!=AxParStrFromDep){var parStr=AxParStrFromDep.split("~"),parDc=parStr[0],pRow=GetClientRowNo(parStr[1],parDc);UpdatePopUpArrays(dcNo,newRowNo,!0,"Add",pRow,parDc)}else UpdatePopUpArrays(dcNo,newRowNo,!0,"Add");else UpdatePopUpArrays(dcNo,newRowNo,!0,"Add");calledFrom==undefined&&(RefreshFillFldsInSubGrid(dcNo,newRowNo),""==subGridJson?CallGetSubGridDDL(dcNo,AxActivePRow,AxActivePDc,newRowNo):ApplyPopJson(dcNo)),adjustwin("10",window)}}function CallGetSubGridDDL(e,t,i,a){try{var r=$j("#recordid000F0").val();ASB.WebService.GetSubGridDropdown(ChangedFields,ChangedFieldDbRowNo,ChangedFieldValues,DeletedDCRows,e,tstDataId,r,t,i,a,SuccessSubGridCombos,OnException)}catch(o){AxWaitCursor(!1),showAlertDialog("error",ServerErrMsg)}}var subGridJson="",result;function SuccessSubGridCombos(e,t){if(!CheckSessionTimeout(e)&&(ChangedFields=new Array,ChangedFieldDbRowNo=new Array,ChangedFieldValues=new Array,DeletedDCRows=new Array,""!=e)){subGridJson=e;var i=GetDcClientRows(AxActiveDc);AxPopRowNo=i.getMaxVal(),AssignLoadValues(e,"PopGridCombos");try{AxAfterSubGridAddRow()}catch(a){}$j("#DivFrame"+AxActiveDc).dialog({title:popUpTitle,height:400,width:550,close:function(){ClosePopUp(AxActiveDc)},position:"top",modal:!0,buttons:{Ok:function(){ClosePopUp(AxActiveDc,$j(this))}}})}}function ApplyPopJson(e){var t=GetDcClientRows(e);AxPopRowNo=t.getMaxVal(),AssignLoadValues(subGridJson,"PopGridCombos"),UpdateRowInDataObj();try{AxAfterSubGridAddRow()}catch(i){}}function IsRowInPopRows(e,t,i,a){for(var r=GetPopRows(e,i,t).split(","),o=0;o<r.length;o++)if(r[o]==a)return!0;return!1}function IsPopParBound(e,t,i){for(var a=GetParentFields(e),r=!0,o=0;o<a.length;o++){var n=a[o]+i+"F"+t,l=GetFieldValue(n);try{l=parseFloat(l)}catch(s){}if(""==l.toString()){r=!1;break}}return r}function UpdatePopParentFlds(e,t,i,a){for(var r=GetParentFields(e),o=0;o<r.length;o++){var n=r[o].toString().trim()+a+"F"+t,l=GetSubFieldId("sub"+e+"_"+r[o].toString(),i,e),s=GetFieldValue(n);SetFieldValue(l,s);var d=GetDbRowNo(i,e);UpdateFieldArray(l,d,s,"parent")}}function EvaluateSubGridDep(e){for(var t=GetGridFields(e),i=0;i<t.length;i++){var a,r=GetFieldIndex(t[i]);if(-1!=r&&(depStr=FldDependents[r].toString()),""!=depStr&&(a=depStr.split(","))!=undefined)for(var o=0;o<a.length;o++){var n=a[o].toString(),l=n.substring(0,1),s=n.substring(1);e!=GetDcNo(s)&&"e"==l&&EvaluateAxFunction(s,t[i]+AxActiveRowNo+"F"+e)}}}function ClosePopUp(e,t){var i=GetPopRows(AxActivePDc,GetClientRowNo(AxActivePRow,AxActivePDc),e).split(",");if(1!=i.length)for(var a=i.length-1;a>=0;a--){var r=GetDcRowCount(e);""!=i[a].toString()&&IsEmptyRow(i[a],e)&&1!=r&&DeletePopRow(e,i[a])}$j("#dvPickList").is(":visible")&&$j("#dvPickList").hide(),AxIsPopActive=!1,t!=undefined&&t.dialog("close");var o=$j("#"+AxActiveField);o.length>0&&o.focus(),subGridJson="",EvaluateSubGridDep(e),DisplaySummaryInPopUp(e)}function DeletePopRow(e,t){var i=GetSerialNoCnt(e);i=parseInt(i,10)-1,SetSerialNoCnt(e,i);GetDcRowCount(e);var a=t+"F"+e;UpdateDcRowArrays(e,t,"Delete");for(var r=GetGridFields(e),o=0;o<r.length;o++){var n=r[o]+a;RemoveDeletedFields(n)}$j("#"+("sp"+e+"R"+t+"F"+e)).remove(),UpdatePopUpArrays(e,t,!0,"Delete");var l=GetDcRowCount(e);SetRowCount(e,l-1)}function UpdatePopUpParents(e){for(var t=GetFieldsName(e),i=GetFieldsDcNo(e),a=GetFieldsRowNo(e),r=0;r<PopParentDCs.length;r++)if(PopParentDCs[r]==i){popParentFlds=PopParentFlds[r].toString().split(",");var o;o=GetParentString(i,a,PopGridDCs[r]);for(var n=!1,l=GetParentFields(PopGridDCs[r]),s=0;s<l.length;s++)if(l[s]==t){n=!0;break}if(!n)continue;if(CheckDuplicateParents(i,popParentFlds,o,PopGridDCs[r],a)&&""!=o)return errorFlag=!0,void(errorField=e);SetPopParents(i,PopGridDCs[r],a,o);for(var d=PopGridDCs[r],c=GetPopRows(i,a,d).split(","),p=GetFieldValue(e),u=0;u<c.length;u++)if(""!=c[u].toString()){var f=GetSubFieldId("sub"+d+"_"+t,c[u].toString(),d);f="#"+f;try{var h=f.substring(1);SetFieldValue(h,p);var m=GetDbRowNo(c[u].toString(),d);UpdateFieldArray(h,m,p,"parent")}catch(v){}}}}function CheckDuplicateParents(e,t,i,a,r){var o,n=!1;o=parseInt(GetDcRowCount(e),10);for(var l=1;l<o;l++){GetParentString(e,GetRowNoHelper(l),a)==i&&l!=parseInt(r,10)&&(n=!0)}return n}function SetPopParents(e,t,i,a){for(var r=0;r<ParentDcNo.length;r++)ParentDcNo[r]==e&&PopGridDcNo[r]==t&&ParentClientRow[r]==i&&(PopParentsStr[r]=a)}function DisplaySummaryInPopUp(e){var t=-1,i=0;for(i=0;i<PopGridDCs.length;i++)if(PopGridDCs[i]==e){t=i;break}var a="",r="",o="",n="";-1!=t&&(a=PopSummaryParent[t],r=PopSummaryFld[t],o=""==PopSummDelimiter[t]?",":PopSummDelimiter[t]),-1!=r.indexOf(":")&&(r=r.replace(":",""));for(var l=GetPopRows(AxActivePDc,GetClientRowNo(AxActivePRow,AxActivePDc),e).split(","),s=0;s<l.length;s++){var d=r+l[s]+"F"+e;(d=$j("#"+d)).length>0&&(n+=d.val()+o)}n=n.substring(0,n.length-1),a=a+GetClientRowNo(AxActivePRow,AxActivePDc)+"F"+AxActivePDc,$j("#"+a).length>0&&$j("#"+a).val(n)}function GetPopRows(e,t,i){for(var a="",r=0;r<ParentDcNo.length;r++)if(ParentDcNo[r]==e&&ParentClientRow[r]==GetRowNoHelper(t)&&PopGridDcNo[r]==i){a=PopRows[r];break}return a}function ClearPopRows(e,t,i){for(var a=0;a<ParentDcNo.length;a++)ParentDcNo[a]==e&&ParentClientRow[a]==t&&PopGridDcNo[a]==i&&(PopRows[a]="")}function AddDeletePopRow(e,t,i,a,r){for(var o=!1,n=0;n<ParentDcNo.length;n++)if(ParentDcNo[n]==e&&ParentClientRow[n]==t&&PopGridDcNo[n]==i){o=!0;var l=PopRows[n].toString();if("Add"==r){if(""==l)l=a;else{var s=l.split(",");-1==$j.inArray(a,s)&&(l+=","+a)}PopRows[n]=l}else{for(var d=(l=l.split(",")).length-1;d>=0;d--)if(l[d].toString()==a){l.splice(d,1);break}for(var c="",p=0;p<l.length;p++)c+=""==c?l[p].toString():","+l[p].toString();PopRows[n]=c}break}if("Add"==r){if(!o){ParentDcNo.push(e),ParentClientRow.push(t);var u=GetParentString(e,t,i);PopGridDcNo.push(i),PopParentsStr.push(u),PopRows.push(a)}for(var f=0;f<PopParentDCs.length;f++)if(PopParentDCs[f]==e){parentFlds=PopParentFlds[f].toString().split(",");for(n=0;n<parentFlds.length;n++){var h=parentFlds[n]+t+"F"+e,m=GetSubFieldId("sub"+i+"_"+parentFlds[n],a,i),v=$j("#"+h),g=$j("#"+m);v.length>0&&g.length>0&&g.val(v.val())}}}}function IsEmptyRow(e,t){for(var i,a=!1,r=0;r<FldDcRange.length;r++){var o=FldDcRange[r].split("~");if(o[0]==t){i=o[1].split(",");break}}if(i!=undefined)for(var n=parseInt(i[0].toString(),10),l=parseInt(i[1].toString(),10),s=n;s<=l;s++){var d=FNames[s];if("Accept"==FMoe[s]||"Select"==FMoe[s]){d=d+e+"F"+t;var c=GetFieldValue(d),p=$j("#"+d);if(p.length>0&&"hidden"!=p.attr("type")){if("numeric"==FDataType[s].toLowerCase()&&""!=c&&(c=parseInt(c,10)),""!=c&&"0"!=c){a=!1;break}a=!0}}}return a}function SetPopDcStyle(e,t){var i=document.getElementById("add"+e),a=document.getElementById("btnClear"+e),r=document.getElementById("btnOk"+e);t?(i&&(i.disabled=!0,i.style.cursor="default"),a&&(a.style.visibility="hidden"),r&&(r.value="Close"),ShowingDc(e,"Disable")):(i&&(i.disabled=!1,i.style.cursor="hand"),a&&(a.style.visibility="visible"),r&&(r.value="Ok"))}function RegisterActivePRow(e,t){AxActivePRow=GetDbRowNo(e,t),AxActivePDc=t;for(var i=!1,a=Parameters.length-1;a>=0;a--){if("activeprow"==Parameters[a].split("~")[0]){Parameters[a]="activeprow~"+AxActivePRow,i=!0;break}}i||(Parameters[Parameters.length]="activeprow~"+AxActivePRow)}function IsPopGridFirmBind(e){for(var t=0;t<PopGridDCs.length;t++)if(PopGridDCs[t]==e&&"t"==PopGridDCFirm[t].toString().toLowerCase())return!0;return!1}function GetParentFields(e){for(var t,i=0;i<PopGridDCs.length;i++)if(PopGridDCs[i]==e){t=PopParentFlds[i].toString().split(",");break}return t}function GetParentString(e,t,i){var a="",r=GetParentFields(i);if(r!=undefined)for(var o=0;o<r.length;o++){var n=r[o]+t+"F"+e;""==a?a=GetFieldValue(n):a+="¿"+GetFieldValue(n)}return a}function GetPopGrids(e){for(var t="",i=0;i<PopParentDCs.length;i++)PopParentDCs[i]==e&&(""==t?t=PopGridDCs[i]:t+=","+PopGridDCs[i]);return t}function GetPopGridDcNo(e){for(var t="",i=0;i<PopParentDCs.length;i++)PopParentDCs[i]==e&&(""==t?t="dc"+PopGridDCs[i]:t+=",dc"+PopGridDCs[i]);return t}function AddParentRow(e,t,i,a){for(var r=!1,o=0;o<=e.length;o++)if(ParentDcNo[o]==e&&PopGridDcNo[o]==i&&ParentClientRow[o]==t){PopParentsStr[o]=a,r=!0;break}r||(ParentDcNo.push(e),ParentClientRow.push(t),PopGridDcNo.push(i),PopParentsStr.push(a),PopRows.push(""))}function UpdatePopUpArrays(e,t,i,a,r,o){if(TstructHasPop)if(i){var n=GetClientRowNo(AxActivePRow,AxActivePDc),l=AxActivePDc,s=n;r!=undefined&&o!=undefined&&(l=o,s=r),AddDeletePopRow(l,s,AxActiveDc,t,"Add"==a?"Add":"Delete")}else for(var d=GetPopGrids(e).split(","),c=0;c<d.length;c++)""!=d[c]&&AddParentRow(e,t,d[c],"")}function DeletePopRowsAfterGetDep(){for(var e=AxSubGridRows.split("¿"),t=AxParStrFromDep.split("~"),i=0;i<e.length;i++)if(""!=e[i]){var a=e[i].split("~"),r=a[0];ClearPopRows(t[0],GetClientRowNo(t[1],t[0]),r);for(var o=a[1].split(","),n=o.length-1;n>=0;n--){var l=GetClientRowNo(parseInt(o[n],10),r);if(1==$j("#gridDc"+r)[0].rows.length){var s=$j("#gridDc"+r)[0].rows[0].id;l=s.substring(s.lastIndexOf("R")+1,s.lastIndexOf("F"));ClearDeletedFields(r,l);var d=$j.inArray(r,DCFrameNo);DCHasDataRows[d]="False";var c="sp"+r+"R"+o[n]+"F"+r,p=$j("#"+c);p.attr("id","sp"+r+"R001F"+r),p.find(":input").val(""),p.find("select,a,input,label,img,.Grdlnk").each(function(){ConvertFieldID($j(this),"001")}),SetRowCount(r,"1"),UpdatePopUpArrays(r,l,!0,"Delete"),UpdateDcRowArrays(r,l,"Delete",-1)}else{c="sp"+r+"R"+l+"F"+r;$j("#"+c).remove(),UpdatePopUpArrays(r,l,!0,"Delete"),UpdateDcRowArrays(r,l,"Delete",-1),SetRowCount(r,GetDcRowCount(r)-1)}}}}function AddRowAfterGetDep(e,t,i){if(TstructHasPop)if("1"!=e||"True"==i)AddRow(t,"GetDep"),AxDepRows.push(e+"~"+GetDcRowCount(t));else{if(AxDepRows.push(e+"~1"),$j("#sp"+t+"R001F"+t).show(),UpdateNewPopInfo(t,"001"),""!=AxParStrFromDep){var a=AxParStrFromDep.split("~"),r=a[0];UpdatePopUpArrays(t,"001",!0,"Add",GetClientRowNo(a[1],r),r)}UpdateDcRowArrays(t,"001","Add")}}function GetDbPopRows(e,t){if(""!=e){var i=e.split(",");i.sort();for(var a="",r=0;r<i.length;r++){var o=GetRowNoHelper(GetDbRowNo(i[r],t));""==a?a=o:a+=","+o}return a}return e}function GetSubDsRowNo(e,t){var i=0,a=$j.inArray(e,AxSubWsRows);return-1==a?(AxSubWsRows.push(e),i=GetDcRowCount(t)+1,AxSubDsRows.push(i)):i=AxSubDsRows[a],i}function toggleSwitch(e){var t="";1==$j("#ckbPurposeUser").prop("checked")?($j("#ckbPurposeUser").prop("checked",!1),t="0",$j(".clsPrps").css("display","none")):($j("#ckbPurposeUser").prop("checked",!0),t="1",$j(".clsPrps").css("display","block"));try{result=ASB.WebService.GetChoices("normal",t)}catch(i){result=i.toString()}}function toggleSwitchDesign(e){var t="";1==$("#ckbPurposeDev").prop("checked")?($("#ckbPurposeDev").prop("checked",!1),t="0",$j(".clsPrps").css("display","none")):($("#ckbPurposeDev").prop("checked",!0),t="1",$j(".clsPrps").css("display","block"));try{result=ASB.WebService.GetChoices("design",t)}catch(i){result=i.toString()}}function GetChoiceStatusForDSign(){$.ajax({type:"POST",url:"TstructDesign.aspx/GetPrpLblStatusForDSign",data:"",contentType:"application/json; charset=utf-8",dataType:"json",success:function(e){"true"==e.d?($j(".clsPrps").css("display","block"),$j("#ckbPurposeDev").prop("checked",!0)):($j(".clsPrps").css("display","none"),$j("#ckbPurposeDev").prop("checked",!1))}})}function pageloadlogtime(e){console.log("Page Load: "+e+" milliseconds.")}function disableDC(e){var t=$j("#DivFrame"+e);t.find("input,textarea, img, select, a").not(".subGrid,.chkShwSel,.swtchDummyAnchr,.tgl").attr("disabled",!0),t.find("a img").removeClass("handCur"),t.find("img").attr("onclick","Callnull"),t.find(":button").removeClass("handCur"),t.find(".rowdelete").addClass("disabledelete"),t.find(".rowadd").addClass("disableadd"),t.find(".axpBtn").css({"pointer-events":"none",cursor:"default"}),t.find(".axpBtnCustom").css({"pointer-events":"none",cursor:"default"}),t.find(".upload-icon").attr("disabled",!0).css("cursor","default"),t.find(".fillcls").addClass("disablefill"),$j("#gridAddBtn"+e).prop("disabled",!0),axInlineGridEdit||"form"==AxpGridForm||$j("#wrapperForEditFields"+e).hide(),$j("#gridToggleBtn"+e).addClass("disabled").prop("disabled",!0),$j("[id ^= 'fillgrid']").prop("disabled",!0).addClass("disabled"),$j("#wrapperForEditFields"+e).find(".editLayoutFooter button").addClass("disabled").prop("disabled",!0),$j("#colScroll"+e+" table tbody tr").addClass("disableTheRow"),$j("#colScroll"+e+" table tbody tr").find(".glyphicon.glyphicon-pencil,.glyphicon.glyphicon-remove").addClass("disabled").prop("disabled",!0).parent().addClass("disabled").prop("disabled",!0),$("#gridAddBtn"+e).next().find(":button").attr("disabled",!0).off("click")}function createEditors(){$("textarea").each(function(){var e=$(this),t="";if(0===(t=e.attr("id")!=undefined?e.attr("id"):"").toLowerCase().indexOf("sql_editor")||0===t.toLowerCase().indexOf("exp_editor")||"SQL Editor"==GetDWBFieldType(GetFieldsName(t))||"Expression Editor"==GetDWBFieldType(GetFieldsName(t))||0===t.toLowerCase().indexOf("js_editor")||0===t.toLowerCase().indexOf("html_editor")){if(IsGridField(GetFieldsName(t))&&"form"!=AxpGridForm&&!e.parent("div").hasClass("edit-mode-content")&&!e.parents(".modal").length)return!0;if(e.hasClass("CodeMirrorApplied"))return!0;if(e.addClass("CodeMirrorApplied"),e.data("myeditor")&&e.data("myeditor").toTextArea(),0===t.toLowerCase().indexOf("sql_editor")||"SQL Editor"==GetDWBFieldType(GetFieldsName(t))){createTheEditor({type:"sql",textarea:t,loadSqlHintObj:!1,sqlHintObj:"mainSQLhintObj",customValidationFn:customValidationFn});var i='<div id="dvpop'+t+'" class="tstsqleditorbtn"><a value="SQL Editor" onclick=javascript:createPopup(\'AxDBScript.aspx\',true); tooltip="SQL Editor"><i class="fa fa-external-link"></i></a></div>';$("#"+t).after(i)}else 0===t.toLowerCase().indexOf("exp_editor")||"Expression Editor"==GetDWBFieldType(GetFieldsName(t))?createTheEditor({type:"expression",textarea:t,customValidationFn:customValidationFn}):0===t.toLowerCase().indexOf("html_editor")?createHtmlEditor(t):0===t.toLowerCase().indexOf("js_editor")?createJSEditor(t,"text/javascript"):console.log("Not Applied "+t)}})}function createPopupdesignnew(e){htmlContent='<div id="axpertPopupWrapperDWB" class="remodal" data-pushtxt-id="'+e+'" data-remodal-id="axpertPopupModalDWB"><button data-remodal-action="close" class="remodal-close remodalCloseBtn icon-basic-remove" title="Close"></button><div style="height:100%;" id="iframeMarkUp1"><div id="QryEditor"><div ><button id="exeQuery" title="Execute"><i class="fa fa-bolt"></i></button><textarea id="dwbtxtEditorsql" rows="4" cols="50"></textarea></div><div class="dvOutput"><div class="rsltHeader">Result<span id="spnRowCnt"></span></div><div id="txtOutput"></div><table id="tblOutput" class="table-responsive"></table></div></div></div></div>',$("head").append(htmlContent);var t=$("[data-remodal-id=axpertPopupModalDWB]:not(.remodal-is-initialized):not(.remodal-is-closed):eq(0)").remodal({closeOnOutsideClick:!0,hashTracking:!1,closeOnEscape:!0});t&&"opened"!=t.state&&t.open(),CodeMirror.fromTextArea(document.getElementById("dwbtxtEditorsql"),{mode:"text/x-sql",smartIndent:!0,lineNumbers:!0,matchBrackets:!0,autoCloseBrackets:!0,theme:"default",hintOptions:{tables:callParentNew("mainSqlHintObj")}}).on("keyup",function(e,t){(!t.ctrlKey&&t.keyCode>=65&&t.keyCode<=90||t.keyCode>=97&&t.keyCode<=122||t.keyCode>=46&&t.keyCode<=57)&&CodeMirror.commands.autocomplete(e,null,{completeSingle:!1})});var i="#dv"+$("#axpertPopupWrapperDWB").attr("data-pushtxt-id").split("0")[0];$("#QryEditor .CodeMirror")[0].CodeMirror.setValue($(i+" .CodeMirror")[0].CodeMirror.getDoc().getValue())}function customValidationFn(textarea){var jsonData="",webServiceName="",textSqlandExpression=textarea.value;if(!(textSqlandExpression.length<=0)&&(textarea.id.toLocaleLowerCase().startsWith("sql_editor")||textarea.id.toLocaleLowerCase().startsWith("exp_editor")||"SQL Editor"==GetDWBFieldType(GetFieldsName(textarea.id))||"Expression Editor"==GetDWBFieldType(GetFieldsName(textarea.id)))){var SuccessCallbackAction=function(e,t){ShowDimmer(!1);try{var i=$.parseJSON(e),a=i.result[0].msg,r=i.result[0].status;"undefined"!=typeof i.result[0].metadata?autocompleteMetadataJson(i.result[0].metadata):(sourceAcMetaJsonFlds=new Array,fldSourceAcMetaJson=""),"failed"==r.toLowerCase()&&(a=a.replace("<error>","").replace("</error>",""),showAlertDialog("warning",a))}catch(o){}},_OnException=function(e){ShowDimmer(!1)},sourcefield="",sourcetable="",Axp_Web_SqlExp_Val_Def_RestRad="",calfrom="",fgname="",fieldname="",fldordno="",datatype="",fieldType="",sfrom="",expression="",validateExpression="",transid="",savenorm="",refresh="",autoselect="",combobox="",sql="",iviewparams="",pmetadata="",sourcefieldid="",sourcetableid="",dcNo="";fieldType=GetFieldValue(GetComponentName("type",GetDcNo("type")))||"",fieldname=GetFieldValue(GetComponentName("name",GetDcNo("name")))||"",fldordno=GetFieldValue(GetComponentName("fldordno",GetDcNo("fldordno")))||"",datatype=GetFieldValue(GetComponentName("datatype",GetDcNo("datatype")))||"","field"===fieldType.toLowerCase()?sfrom=GetFieldValue(GetComponentName("modeofentry",GetDcNo("modeofentry")))||"":"Fill Grid"===fieldType.toLowerCase()&&(sfrom="fillgrid"),transid=GetFieldValue(GetComponentName("stransid",GetDcNo("stransid")))||callParentNew("transid"),expression=GetFieldValue(GetComponentName("exp_editor_expression",GetDcNo("exp_editor_expression")))||"",validateExpression=GetFieldValue(GetComponentName("exp_editor_validateexpression",GetDcNo("exp_editor_validateexpression")))||"",sfrom=sfrom.toLowerCase(),"select from sql"===sfrom?(savenorm=GetFieldValue(GetComponentName("savenormalized",GetDcNo("savenormalized")))||"",refresh=GetFieldValue(GetComponentName("refreshonsav",GetDcNo("refreshonsav")))||"",autoselect=GetFieldValue(GetComponentName("autoselect_sql",GetDcNo("autoselect_sql")))||"",combobox=""|GetFieldValue(GetComponentName("combobox_sql",GetDcNo("combobox_sql"))),sql=GetFieldValue(GetComponentName("sql_editor_test",GetDcNo("sql_editor_test")))||"",sourcefield=GetFieldValue(GetComponentName("sourcefield",GetDcNo("sourcefield")))||"",sourcetable=GetFieldValue(GetComponentName("sourcetable",GetDcNo("sourcetable")))||"",pmetadata=GetFieldValue(GetComponentName("pmetadata",GetDcNo("pmetadata")))||"",sourcefieldid="sourcefield",sourcetableid="sourcetable"):"select from form"===sfrom?(savenorm=GetFieldValue(GetComponentName("savenormalized_form",GetDcNo("savenormalized_form")))||"",refresh=GetFieldValue(GetComponentName("refreshonsave_form",GetDcNo("refreshonsave_form")))||"",autoselect=GetFieldValue(GetComponentName("autoselect_form",GetDcNo("autoselect_form")))||"",combobox=GetFieldValue(GetComponentName("combobox_form",GetDcNo("combobox_form")))||"",sql=GetFieldValue(GetComponentName("sql_editor_sqltextform",GetDcNo("sql_editor_sqltextform")))||"",sourcefield=GetFieldValue(GetComponentName("selectfield",GetDcNo("selectfield")))||"",sourcetable=GetFieldValue(GetComponentName("tname",GetDcNo("tname")))||"",pmetadata=GetFieldValue(GetComponentName("pmetadata",GetDcNo("pmetadata")))||""):"accept"===sfrom?sql=GetFieldValue(GetComponentName("sql_editor_detail",GetDcNo("sql_editor_detail")))||"":""==sql&&(sql=textSqlandExpression),Axp_Web_SqlExp_Val_Def_RestRad=GetFieldValue(GetComponentName("Axp_Web_SqlExp_Val_Def_RestRad",GetDcNo("Axp_Web_SqlExp_Val_Def_RestRad")))||"",textarea.id.toLocaleLowerCase().startsWith("sql_editor")?(jsonData={_parameters:[{tstructs:{axpapp:callParentNew("mainProject"),transid:transid,fieldname:fieldname,iviewparams:iviewparams,fldordno:fldordno,datatype:datatype,sfrom:sfrom,expression:expression,validateexpression:validateExpression,savenorm:savenorm,refresh:refresh,autoselect:autoselect,combobox:combobox,sql:sql,sourcefield:sourcefield,sourcetable:sourcetable,Axp_Web_SqlExp_Val_Def_RestRad:Axp_Web_SqlExp_Val_Def_RestRad,metadata:pmetadata,sourcefieldid:sourcefieldid,sourcetableid:sourcetableid}}]},webServiceName="ValidateSQL"):textarea.id.toLocaleLowerCase().startsWith("exp_editor")&&(textAreaID=textarea.id.toLocaleLowerCase(),calfrom=-1!=textAreaID.indexOf("exp_editor_expression")?"field":-1!=textAreaID.indexOf("exp_editor_validateexpression")?"fgval":-1!=textAreaID.indexOf("exp_editor_footerstring")?"fgfootstr":"field",jsonData={_parameters:[{tstructs:{axpapp:eval(callParent("mainProject")),transid:transid,calfrom:calfrom,expression:textSqlandExpression,fgname:fieldname,Axp_Web_SqlExp_Val_Def_RestRad:Axp_Web_SqlExp_Val_Def_RestRad}}]},webServiceName="ValidateExpression"),ShowDimmer(!0);try{ASB.WebService.CallRestWS(JSON.stringify(jsonData),webServiceName,SuccessCallbackAction,_OnException)}catch(exp){}}}function IsTabDc(e){return-1!=$j.inArray(e,TabDCs)}function createJSEditor(e,t){var i={smartIndent:!0,lineNumbers:!0,matchBrackets:!0,autoCloseBrackets:!0,autoRefresh:!0,foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"]};i.mode=t,jsCodeMirror=CodeMirror.fromTextArea(document.getElementById(e),i),jsCodeMirror.on("blur",function(){SetFieldValue(e,jsCodeMirror.getValue()),UpdateFieldArray(e,"000",$("#"+e).val(),"parent")}),jsCodeMirror.on("keyup",function(e,t){(!t.ctrlKey&&t.keyCode>=65&&t.keyCode<=90||t.keyCode>=97&&t.keyCode<=122||t.keyCode>=46&&t.keyCode<=57)&&CodeMirror.commands.autocomplete(e,null,{completeSingle:!1})})}function discardLodaData(){try{var e=$j("#recordid000F0").val();GetLoadData(e,"")}catch(t){}}function hideDiscardButton(){try{var e=$j("#recordid000F0").val();""!=e&&"0"!=e?$("#ftbtn_iDiscard").css({display:"block"}):$("#ftbtn_iDiscard").css({display:"none"})}catch(t){}}function autocompleteMetadataJson(e){if(""!=e)try{sourceAcMetaJsonFlds=new Array,fldSourceAcMetaJson=e,e.forEach(function(e){sourceAcMetaJsonFlds.push(e.name)})}catch(t){}}function tstwfcomments(){if(0==$(".toolbarRightMenu").find(".content").length){var e='<section class="content">';$("#breadcrumb-panel .bcrumb span:not(.ivirCButton):not(.icon-arrows-down).tstivtitle").css("padding","3px 0px 0px 46px"),e+='<button type="button" class="btn btn-default btn-circle waves-effect waves-circle waves-float wftstBackBtn" onclick="wftstBackBtn();" style="float: left;margin-top: -8px;margin-left: -15px;">',e+='<i class="material-icons">arrow_back</i>',e+="</button></section>",$(".toolbarRightMenu .newRequestJson").length>0?$($(".toolbarRightMenu .newRequestJson")[0]).before(e):$(".toolbarRightMenu #iconsNewOption").length>0?$(".toolbarRightMenu #iconsNewOption").before(e):$(".toolbarRightMenu").append(e)}}function wftstBackBtn(){window.parent.globalChange=!1;var e=$("#stransid000F1").val(),t=$("#wfname000F1").val();parent.LoadIframeac("WorkflowNew.aspx?prevTransId="+e+"&prevWfName="+t)}function DoScriptFormControl(e,t){if(SFormControls.length>0)if("On Form Load"==t||"On Data Load"==t){var i=$j("#recordid000F0").val();$.each(SFCApply,function(e,t){if("On Form Load"==t&&"0"==i)EvaluateScriptFormControl(SFormControls[e]);else if("On Data Load"==t&&"0"!=i){EvaluateScriptFormControl(SFormControls[e])}})}else if(""!=e){var a=GetFieldsName(e);$.each(SFCFldNames,function(i,r){("On Click"==SFCApply[i]&&"On Field Enter"==t&&(t="On Click"),r==a&&SFCApply[i]==t)&&EvaluateScriptFormControl(SFormControls[i],e)})}}function EvaluateScriptFormControl(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"";if(""!=e){""!=t&&GetFieldValue(t);var i=""==t?"":t,a=e.split("~"),r=EvalExprSet(a);""!=r&&r.split("~").length>=2?ProcessScriptFormControl(r.split("~")[1],r.split("~")[0],i):""!=r&&r.split("♠").length>0&&ProcessScriptFormControlEvents(r,i)}}function ProcessScriptFormControl(e,t,i){var a="",r=0;e.indexOf("♦")>0&&(r=e.split("♦")[2],a=e.split("♦")[1],e=e.split("♦")[0]),e.split(",").forEach(function(e){var o=GetExactFieldName(e);e=o;var n=GetDcNo(e);if("0"!=n){var l=IsDcGrid(n);if("NONGRID"==(secFldDc=l?"GRID":"NONGRID"))e=e+"000F"+n;else if("GRID"==secFldDc){var s,d=e;if("0"==AxActiveRowNo||""==AxActiveRowNo)e=e+"001"+"F"+n;else e=e+GetClientRowNo(AxActiveRowNo,n)+"F"+n;if(0==(s=$j("#"+e+":not(.tstformbutton,.axpBtnCustom)")).length){var c=$("#gridHd"+n+" tbody tr:first").length>0?$("#gridHd"+n+" tbody tr:first").attr("id"):"";""!=c&&(e=d+(c=c.substring(c.lastIndexOf("F")-3)))}}}if(isFieldBtn=!1,0==(s=$j("#"+e+":not(.tstformbutton,.axpBtnCustom)")).length&&0==(s=$j("#DivFrame"+e.toString().substring(2))).length){var p=e.substr(2);-1!=$j.inArray(p,TabDCs)&&(s=$j("#ank"+p))}var u=GetFieldsRowNo(e),f=GetFieldsDcNo(e),h=(GetDbRowNo(u,f),!1);if(s.length<=0){var m,v=e;-1!=e.toString().indexOf("F")&&(v=e.substring(0,e.lastIndexOf("F")-3)),$j(".axpBtn,.axpBtnCustom").each(function(){if($j(this).attr("id")==v)return s=$j(this),isFieldBtn=!0,!1}),$j(".action img").each(function(){if($j(this).attr("id")==v)return m=$j(this),isFieldBtn=!0,!1});var g=!1;$j(".AxpTstBtn input,img").each(function(){if($j(this).attr("value")==v||$j(this).attr("id")=="AxpTstBtn_"+v)return m=$j(this),isFieldBtn=!0,g=!0,!1}),$j(".tstformbutton").each(function(){if($j(this).attr("id")==v)return m=$j(this),isFieldBtn=!0,g=!0,!1}),"remove"==v.toLowerCase()?v="delete":"list view"==v.toLowerCase()?v="listview":"new"==v.toLowerCase()&&(v="add"),"save"==v.toLowerCase()&&(h=!0);var b=v;"listview"==b.toLowerCase()&&(b="list view"),$j("#icons").find("a").each(function(){return void 0!==$j(this).attr("title")&&$j(this).attr("class")==v.toLowerCase()||"undefined"!=typeof btnName&&$j(this).text()==btnName?(s=$j(this),isFieldBtn=!0,!1):void 0!==$j(this).attr("title")&&$j(this).attr("title").toLowerCase()==b.toLowerCase()||"undefined"!=typeof btnName&&$j(this).text()==btnName?(s=$j(this),isFieldBtn=!0,!1):void 0}),$j(".toolbarRightMenu").find("a").each(function(){if(void 0!==$j(this).attr("title")&&$j(this).attr("title").toLowerCase()==b.toLowerCase()||"undefined"!=typeof btnName&&$j(this).text()==btnName)return s=$j(this),isFieldBtn=!0,!1}),isFieldBtn||$j("#nextprevicons").find("a").each(function(){$j(this).attr("class")==v.toLowerCase()&&(s=$j(this),isFieldBtn=!0)}),m!=undefined&&m.length>0&&(s=m.parent(0)),g&&(s=m)}if(s.length>0)switch(t){case"enable":if(isFieldBtn)h?EnableSaveBtn(!0):EnableDisableBtns(s,!0);else if("dc"==o.substr(0,2)){var w=parseInt(o.substr(2,o.length),10);"undefined"!=typeof isWizardTstruct&&isWizardTstruct?ToggleWizardDc(w,"enable"):ShowingDc(w,"enable")}else{if(1==IsPickListField(s.attr("id")))(C=document.getElementById("img~"+s.attr("id"))).disabled=!1,C.className="input-group-addon handCur pickimg";if(0==s.val()&&"select-one"!=s.prop("type")&&s.val(""),s.attr("title")==dateString&&""==s.val()&&s.val(dateString),"checkbox"==s.attr("type"))EnableDisableCheckbox(s.attr("id"),!1);else(s.attr("id").startsWith("rtf_")||s.attr("id").startsWith("rtfm_")||s.attr("id").startsWith("fr_rtf_")||"Rich Text"==GetDWBFieldType(GetFieldsName(s.attr("id"))))&&($j("#cke_"+s.attr("id")).prop("disabled",!1),s.css("display","none"),$j("#cke_"+s.attr("id")).removeAttr("disabled")),"axpImg"==s.attr("class")&&s.attr("onclick",null),s.prop("disabled",!1),s.prop("readOnly",!1),s.removeAttr("readOnly"),SetAutoCompAccess("enabled",s)}break;case"disable":if(isFieldBtn)h?EnableSaveBtn(!1):EnableDisableBtns(s,!1);else if("dc"==o.substr(0,2)){w=parseInt(o.substr(2,o.length),10);"undefined"!=typeof isWizardTstruct&&isWizardTstruct?ToggleWizardDc(w,"disable"):ShowingDc(w,"disable")}else{var C;if(1==IsPickListField(s.attr("id")))(C=document.getElementById("img~"+s.attr("id"))).disabled=!0,C.className="pickimg input-group-addon handCur";if(s.attr("title")!=dateString||s.val()!=dateString&&"''"!=s.val()||s.val(""),"checkbox"==s.attr("type"))EnableDisableCheckbox(s.attr("id"),!0);else(s.attr("id").startsWith("rtf_")||s.attr("id").startsWith("rtfm_")||s.attr("id").startsWith("fr_rtf_")||"Rich Text"==GetDWBFieldType(GetFieldsName(s.attr("id"))))&&($j("#cke_"+s.attr("id")).attr("disabled","disabled"),s.css("display","none"),$j("#cke_"+s.attr("id")).prop("readonly",!0)),"axpImg"==s.attr("class")&&s.attr("onclick","callnull"),s.prop("disabled",!0),s.attr("readOnly","readOnly"),SetAutoCompAccess("disabled",s)}break;case"hide":if("dc"==o.substr(0,2)){w=parseInt(o.substr(2,o.length),10);"undefined"!=typeof isWizardTstruct&&isWizardTstruct?ToggleWizardDc(w,"hide"):ShowingDc(w,"hide")}else if(isFieldBtn)EnableDisableSFCBtns(s,"hide");else{HideShowField(o,"hide");var D=GetFieldIndex(o),F=GetDWBFieldType("",D);(o.startsWith("axptm_")||o.startsWith("axpdbtm_")||""!=F&&"time"==F.toLowerCase())&&$j("#"+s.attr("id")+" .tstOnlyTime").removeClass("hasDatepicker")}break;case"show":if("dc"==o.substr(0,2)){w=parseInt(o.substr(2,o.length),10);"undefined"!=typeof isWizardTstruct&&isWizardTstruct?ToggleWizardDc(w,"show"):ShowingDc(w,"show")}else if(isFieldBtn)EnableDisableSFCBtns(s,"show");else{HideShowField(o,"show");D=GetFieldIndex(o),F=GetDWBFieldType("",D);(o.startsWith("axptm_")||o.startsWith("axpdbtm_")||""!=F&&"time"==F.toLowerCase())&&$j("#"+s.attr("id")+" .tstOnlyTime").addClass("hasDatepicker")}break;case"setvalue":axpScriptIsAddrow=!1;w=GetDcNo(o);var y="";if(sfrowno=r,IsDcGrid(w)){var x="001",S=r.length;2==S?x="0"+r:1==S?x="00"+r:3==S&&(x=r),y=o+x+"F"+w,sfrowno=x,AxActiveRowNo=GetDbRowNo(x,w)}else sfrowno="000",y=o+"000F"+w;if($j("#"+y).hasClass("multiFldChk")&&""==a.trim())if(IsDcGrid(w))$j("input[id="+y+"]").each(function(){$j(this).removeAttr("checked"),$j(this).prop("checked",!1)});else try{$("#"+y).val(""),$("#"+y).data("valuelist",""),$("#"+y).tokenfield("setTokens",[])}catch(N){}else CallSetFieldValue(y,a);var A=GetFieldsRowNo(y),G=GetDbRowNo(A,w);UpdateFieldArray(y,G,a,"parent",""),$j($j("#"+i)).val("");if("undefined"!=typeof AxpNotFillDepFields&&""!=AxpNotFillDepFields&&""!=i){var P=GetFieldsName(i);if(void 0!==P&&""!=P)AxpNotFillDepFields.split(",").indexOf(P)>-1&&!0}break;case"axaddrow":axpScriptIsAddrow=!0;var k=e.substring(2),j=!1;gridDummyRowVal.length>0&&gridDummyRowVal.map(function(e){e.split("~")[0]==k&&(j=!0)}),AxWaitCursor(!0),ShowDimmer(!0),CallAddRowFromScript(k,i,j);break;default:return}})}function ProcessScriptFormControlEvents(e,t){if(""!=e){var i=e.split("♠");switch(i[0]){case"LoadForm":case"LoadFormAndData":n=i[1];o=(o=i[2]).replace(/♦/g,"&");l=i[3],i[4];if(""==l||"d"==l.toLowerCase()||"default"==l.toLowerCase())callParentNew("LoadIframe(tstruct.aspx?transid="+n+"&"+o+"&act=load)","function");else{tparams=o+"&AxPop=true",tparams+="&axp_refresh=true";s="tstruct.aspx?act=load&transid="+n+"&"+tparams;createPopup(s)}break;case"LoadIView":var a=i[1];o=(o=i[2]).replace(/♦/g,"&");l=i[3],i[4];if(""==l||"d"==l.toLowerCase()||"default"==l.toLowerCase())callParentNew("LoadIframe(ivtoivload.aspx?ivname="+a+"&"+o+"&act=load)","function");else{tparams=o+"&AxIsPop=true";var r="ivtoivload.aspx?ivname="+a+"&"+tparams;createPopup(r)}break;case"LoadPage":case"OpenPage":var o,n=i[1];o=(o=i[2]).replace(/♦/g,"&");var l=i[3];i[4];if(""==l||"d"==l.toLowerCase()||"default"==l.toLowerCase())callParentNew("LoadIframe(tstruct.aspx?transid="+n+"&"+o+"&act=load)","function");else{tparams=o+"&AxPop=true",tparams+="&axp_refresh=true";var s="tstruct.aspx?act=load&transid="+n+"&"+tparams;createPopup(s)}break;default:return}}}function CallAddRowFromScript(addDcNo,sfName,isExitDummy){var dcClientRows=GetDcClientRows(addDcNo),lastRow=dcClientRows.getMaxVal();0==lastRow&&(lastRow=1),isExitDummy&&(lastRow=1);var newCnt=parseInt(lastRow,10),newRowNo=GetRowNoHelper(newCnt),visDcname=GetOpenTabDcs(),dbRowNo=GetDbRowNo(newRowNo,addDcNo),rid=$j("#recordid000F0").val(),filename=traceSplitStr+"AddRowFromScript-"+transid+traceSplitChar,ixml='<sqlresultset axpapp="'+proj+'" transid="'+transid+'" recordid="'+rid+'" dcname="'+addDcNo+'" rowno="'+dbRowNo+'" dcnames="'+visDcname+'" sessionid="'+sid+'" trace="'+filename+'" >';try{ASB.WebService.AddRowPerfWS(ChangedFields,ChangedFieldDbRowNo,ChangedFieldValues,DeletedDCRows,ixml,addDcNo,tstDataId,!0,SuccessCalAddDataForce,ErrorAddRowForceWS)}catch(exp){$j($j("#"+sfName)).val(""),AxWaitCursor(!1),ShowDimmer(!1),showAlertDialog("error",ServerErrMsg)}function SuccessCalAddDataForce(result,eventArgs){var passResult=result;if(""!=result&&(result=result.split("*♠*")[2]),!CheckSessionTimeout(result)){var isValidRow=!0;""!=result&&"Not a valid value!"==result&&(isValidRow=!1,showAlertDialog("warning",eval(callParent("lcm[517]")))),isValidRow&&(axpScriptaddrowres=passResult,isExitDummy&&!isMobile?(isScriptFCAddClick=!0,$("#gridHd"+addDcNo+" tbody tr[id=sp"+addDcNo+"R001F"+addDcNo+"]").find(".glyphicon-pencil").parent().click(),isScriptFCAddClick=!1):axInlineGridEdit?addNewInlineGridRow(addDcNo):AddNewRowInDc(addDcNo),axpScriptaddrowres="",updateInlineGridRowValues()),$j($j("#"+sfName)).val(""),AxWaitCursor(!1),ShowDimmer(!1)}}function ErrorAddRowForceWS(){ArrActionLog="",ChangedFields=new Array,ChangedFieldDbRowNo=new Array,ChangedFieldValues=new Array,DeletedDCRows=new Array,$j($j("#"+sfName)).val(""),AxWaitCursor(!1),ShowDimmer(!1)}}function EnableDisableSFCBtns(e,t){e.length>0&&("hide"==t?$(e).parent("li").length>0?$(e).parent("li").hide():$(e).parent("div").length>0?$(e).parent("div").hide():($(e).parent("td").hide(),$(e).parents("table").find("th#th-"+$(e).attr("id")).hide()):$(e).parent("li").length>0?$(e).parent("li").show():$(e).parent("div").length>0?$(e).parent("div").show():($(e).parent("td").show(),$(e).parents("table").find("th#th-"+$(e).attr("id")).show()))}function AlertNoAction(){var e=$("#smtphost000F1").val(),t=$("#smtpport000F1").val(),i=$("#smtpuser000F1").val(),a=$("#smtppwd000F1").val();try{ASB.WebService.TestMailSettings(e,t,i,a,sucessCallbackMail,OnException)}catch(r){}}function sucessCallbackMail(e,t){var i=e;try{var a=jQuery.parseXML(e);a&&(i=-1!=e.indexOf("result")?a.getElementsByTagName("result")[0].firstChild.nodeValue:a.getElementsByTagName("error")[0].firstChild.nodeValue),-1!=i.indexOf("Test mail has been sent to")?showAlertDialog("success",i):showAlertDialog("warning",i)}catch(r){}}function barCodeScannerInit(){var e=$j(document).find("input[id^=barqr_]").attr("id");if(void 0!==e){try{onScan.detachFrom(document)}catch(t){}loadAndCall({files:{css:[],js:["/ThirdParty/onscan.js-master/onscan.min.js"]},callBack:function(){onScan.attachTo(document,{reactToPaste:!0,ignoreIfFocusOn:"none"==$j("#waitDiv").css("display")!=1,onScan:function(t){"none"==$j("#waitDiv").css("display")==1?($j("#"+e).val(t),isScriptFCAddClick=!0,axpScanBarFldFocus=e,$j($j("#"+e)).blur(),0==axpScriptIsAddrow&&$j($j("#"+e)).val("").focus(),isScriptFCAddClick=!1):showAlertDialog("warning","Please wait till the process complete!")}})}})}}function getHybridWeightScaleInfo(e){try{var t=0,i=setInterval(function(){10==++t&&(clearInterval(i),ShowDimmer(!1));var a=getRedisString("HybridWeightScaleInfo",callParentNew("hybridGUID"));if(""!=a){var r=JSON.parse(a);a=r.data.weight+r.data.unit,SetFieldValue(e,a),UpdateFieldArray(e,GetFieldsRowNo(e),a,"parent",""),MainBlur($j("#"+e)),$("#"+e).blur(),clearInterval(i),ShowDimmer(!1)}},1e3)}catch(a){}}function closeWeightScalePort(){try{ASB.WebService.NotifyCloseWeightScalePort(callParentNew("hybridGUID"),function(e){},function(e){})}catch(e){}}function DropzoneInit(e){(void 0!==e?$(e+" .dropzone"):$("#divDc1 .dropzone")).each(function(){var e="#"+$(this).attr("id"),t=document.querySelector(e),i=t.querySelector(".dropzone-item");i.id="";var a=i.parentNode.innerHTML;i.parentNode.removeChild(i);var r=location.origin+location.pathname.substr(0,location.pathname.indexOf("aspx")),o=$(e).attr("id").substr(9);funame=o.substring(0,o.lastIndexOf("F")-3);var n=callParentNew("axAttachmentSize","axAttachmentSize")==undefined?1:callParentNew("axAttachmentSize","axAttachmentSize"),l="0"!=AxpFileUploadlmt?AxpFileUploadlmt:100,s=new Dropzone(e,{url:r+"TstFileUpload.ashx?thisFld=".concat($(e).attr("id").substr(9),"&filePath=").concat($(".axpFilePath_"+$(e).attr("id").substring("dropzone_axpfile_".length)).val()==undefined?"":$(".axpFilePath_"+$(e).attr("id").substring("dropzone_axpfile_".length)).val(),"&dcNo=").concat(GetFieldsDcNo($(e).attr("id")),"&attFldName=").concat(funame),maxFilesize:n,previewTemplate:a,previewsContainer:e+" .dropzone-items",clickable:e+" .dropzone-select",maxFiles:l}),d=t.querySelectorAll(".dz-default");$(d).addClass("d-none"),s.on("addedfile",function(e){t.querySelectorAll(".dropzone-item").forEach(function(e){e.style.display=""})}),s.on("complete",function(e){t.querySelectorAll(".dz-complete");if("success"==e.status)if("success"==e.xhr.response||e.xhr.response.startsWith("success:")){var i=e.xhr.response;$(e.previewElement).parents(".dropzone").find(".fileuploadmore").removeClass("d-none");var a=$(e.previewElement).parents(".dropzone").attr("id").substr(9),r=$("#"+a).val();r=""==r?e.name:r+","+e.name,$("#"+a).val(r);var o=$j("#hdnScriptsUrlpath").val()+"axpert/"+sid+"/";o+=e.name,$(e.previewElement).find(".dropzone-filename").attr("onclick","ShowAxpFileuploadLink('"+a+"','"+e.name+"','"+o+"')"),UpdateFieldArray(a,"0",r,"parent",""),showAlertDialog("success",i.split(":")[1])}else{var n=e.xhr.response;s.removeFile(e),showAlertDialog("error",n.split(":")[1])}else"error"==e.status&&showAlertDialog("warning",$(e.previewTemplate).find(".dropzone-error").text())}),s.on("error",function(e){s.removeFile(e)}),s.on("removedfile",function(e){var t=$(s.element).attr("id").substr(9),i=$("#"+t).val();i=i.replace(e.name+",","").replace(e.name,""),$("#"+t).val(i),UpdateFieldArray(t,"0",i,"parent","")});var c=$(e).attr("id").substr(9),p=$("#"+c).val();""!=p&&($.each(p.split(","),function(e,t){var i={name:t,size:"0",status:Dropzone.ADDED,accepted:!0};s.emit("addedfile",i),s.emit("complete",i),s.files.push(i);var a=$j("#hdnScriptsUrlpath").val()+"axpert/"+sid+"/";a+=i.name,$(i.previewElement).find(".dropzone-filename").attr("onclick","ShowAxpFileuploadLink('"+$(s.files[0].previewElement).parents(".dropzone").attr("id").substr(9)+"','"+i.name+"','"+a+"')")}),$(e).find(".fileuploadmore").removeClass("d-none"))})}function TstFldImageUpload(e){for(var t=e.files,i=new FormData,a=0;a<t.length;a++)i.append(t[a].name,t[a]);var r=location.origin+location.pathname.substr(0,location.pathname.indexOf("aspx")),o=$("#isAxpImagePathHidden").val();$.ajax({url:r+"TstImageUpload.ashx?fldname=".concat($(e).attr("id"),"&isAxpImagePath=").concat(o),type:"POST",data:i,contentType:!1,processData:!1,success:function(i){if(i.indexOf("success:")>-1){var a=$(e).attr("id");$(e).parents(".image-input").find(".imageFileUpload").addClass("d-none"),$(e).parents(".image-input").find(".profile-pic").removeClass("d-none");var r=$j("#hdnScriptsUrlpath"),o=GetFieldsName(a),n=r.val()+"axpert/"+sid+"/"+o+"/"+t[0].name;$("img#"+a).css({"background-image":"unset"}),$("img#"+a).prop("src",n),$("#"+a).parent().find(".delete-button").removeClass("d-none"),UpdateFieldArray(a,"0",t[0].name,"parent",""),showAlertDialog("success",i.replace("success:",""))}else"error:sessionexpired"==i?CheckSessionTimeout(i):showAlertDialog("error",i.replace("error:",""))},error:function(e){handlerType="upload",showAlertDialog("error",e.statusText)}})}function HeaderAttachFiles(){var e="#attachment-overlay",t=document.querySelector(e),i=t.querySelector(".dropzone-item");i.id="";var a=i.parentNode.innerHTML;i.parentNode.removeChild(i);var r=location.origin+location.pathname.substr(0,location.pathname.indexOf("aspx")),o=callParentNew("axAttachmentSize","axAttachmentSize")==undefined?1:callParentNew("axAttachmentSize","axAttachmentSize"),n=new Dropzone(e,{url:r+"HeaderFileUpload.ashx?act=attach",maxFilesize:o,previewTemplate:a,previewsContainer:e+" .dropzone-items",clickable:e+" .dropzone-select",dictDuplicateFile:"Duplicate Files Cannot Be Uploaded",preventDuplicates:!0}),l=t.querySelectorAll(".dz-default");$(l).addClass("d-none"),n.on("addedfile",function(e){t.querySelectorAll(".dropzone-item").forEach(function(e){e.style.display=""})}),n.on("complete",function(e){t.querySelectorAll(".dz-complete");if("success"==e.status)if("success"==e.xhr.response||e.xhr.response.startsWith("success:")){var i=e.xhr.response;$(e.previewElement).parents(".dropzone").find(".fileuploadmore").removeClass("d-none"),filenamearray.push(e.name);var a=0;$j("#recordid000F0").length>0&&(a=$j("#recordid000F0").val());var r=CheckUrlSpecialChars(e.name);$(e.previewElement).find(".dropzone-filename").attr("onclick","OpenAttachment('"+r+"','"+a+"');"),showAlertDialog("success",i.split(":")[1])}else{var o=e.xhr.response;n.removeFile(e),showAlertDialog("error",o.split(":")[1])}else"error"==e.status&&showAlertDialog("warning",$(e.previewTemplate).find(".dropzone-error").text())}),n.on("error",function(e){n.removeFile(e)}),n.on("removedfile",function(e){RemoveArrVal(e.name,filenamearray)}),fileonloadarray.length>0&&($.each(fileonloadarray,function(e,t){var i={name:t,size:"0",status:Dropzone.ADDED,accepted:!0};n.emit("addedfile",i),n.emit("complete",i),n.files.push(i);var a=0;$j("#recordid000F0").length>0&&(a=$j("#recordid000F0").val());var r=CheckUrlSpecialChars(i.name);$(i.previewElement).find(".dropzone-filename").attr("onclick","OpenAttachment('"+r+"','"+a+"');")}),$(e).find(".fileuploadmore").removeClass("d-none"))}function callAxpertConfigStudio(e,t,i){try{e=e+"~"+t+"~"+i,ASB.WebService.GetAxpertCunfigInfo(e,SuccessAxpertConfigStudio,OnException)}catch(a){}}function SuccessAxpertConfigStudio(e,t){""!=e&&callParentNew("showWorkBench("+e+")","function")}$(document).on("click",".fileuploadmore",function(){if($(this).parents(".dropzone").find(".dropzone-items").hasClass("d-none")){var e=$(this).parents(".dropzone").attr("id"),t=bootstrap.Popover.getInstance(this);t._config.content='<div class="dropzone dropzone-queue mt-n3" id="'+e+'">'+$(this).parents(".dropzone").find(".dropzone-items").html()+"</div>",t.show()}else $(this).parents(".dropzone").find(".dropzone-items").addClass("d-none")}),$j(document).on("click","body",function(e){$(e.target).hasClass("fileuploadmore")||$(e.target).hasClass("popover-body")||$(e.target).hasClass("dropzone-item")||$(e.target).parent().hasClass("dropzone-filename")||$("[data-bs-toggle]").popover("hide")}),$j(document).on("click",".popover-body .dropzoneItemDelete",function(e){var t,i=$(e.target).parents(".dropzone").attr("id"),a=document.querySelector("#"+i),r=Dropzone.forElement(a),o=$(e.target).parents(".dropzone-item").find(".dropzone-filename").text(),n=null===(t=r.files.filter(function(e){return e.name==o}))||void 0===t?void 0:t[0];n&&r.removeFile(n)}),$j(document).on("click",".popover-body .dropzoneItemDeleteHeader",function(e){var t,i=document.querySelector("#attachment-overlay"),a=Dropzone.forElement(i),r=$(e.target).parents(".dropzone-item").find(".dropzone-filename").text(),o=null===(t=a.files.filter(function(e){return e.name==r}))||void 0===t?void 0:t[0];if(o){var n=0;$j("#recordid000F0").length>0&&(n=$j("#recordid000F0").val()),RemoveFile(r,n,o)}});