PageSourceSearch

https://mytracksoftware.com/chunk-WSTAMBEE.js

js mytracksoftware.com collected 2026-10-08 17:08:13 UTC 26,262 bytes, 1 lines download raw bytes

1import{b as X}from"./chunk-264B6DF3.js";import{a as K}from"./chunk-SC7OIAJ7.js";import"./chunk-OT7D67RG.js";import{a as L}from"./chunk-FTHQQTSG.js";import"./chunk-L22N5WJT.js";import{c as $}from"./chunk-VGGK7HQB.js";import"./chunk-J6WHBBPP.js";import"./chunk-MKF6QG6V.js";import"./chunk-HOI7JMLX.js";import"./chunk-B3XBM5MD.js";import"./chunk-XGLRQSSV.js";import"./chunk-DAOPRFTB.js";import"./chunk-MVFZ4W5S.js";import"./chunk-QPO6AB24.js";import"./chunk-T2LKHT2R.js";import{a as q}from"./chunk-AV7BHVMF.js";import"./chunk-ECX4OUPM.js";import"./chunk-D5ZZMR3T.js";import"./chunk-LB7GZ4RS.js";import{k as G,l as U,m as H}from"./chunk-XJIYDCB7.js";import"./chunk-OOAKO2NW.js";import"./chunk-CW3A6GGH.js";import"./chunk-LLNDO5TI.js";import"./chunk-LK2H5GWW.js";import{a as z}from"./chunk-LLNUHMNV.js";import"./chunk-QUSGVUOF.js";import"./chunk-CJPLD6EO.js";import"./chunk-PDZ2GFID.js";import"./chunk-O7GVHEWQ.js";import"./chunk-4W4OTVCU.js";import"./chunk-UBZHVILN.js";import"./chunk-WECRXZVT.js";import"./chunk-SXSN5XUL.js";import"./chunk-XGQFJQG5.js";import"./chunk-7MFB5OWF.js";import"./chunk-TH4X4PKG.js";import"./chunk-C6BZFLMK.js";import"./chunk-IDHC3I6D.js";import"./chunk-TVZI3GRT.js";import"./chunk-EMD5D3CD.js";import"./chunk-P7NG7HPQ.js";import"./chunk-CZPI7VJ5.js";import{j as Y}from"./chunk-4VN4MCU7.js";import"./chunk-7GVDXUAU.js";import"./chunk-4J4X5EMA.js";import"./chunk-ECECGNR4.js";import"./chunk-2IWGUN3K.js";import"./chunk-NCZHNS3C.js";import"./chunk-GO7UHMBF.js";import"./chunk-5DDWRNUO.js";import{v as k}from"./chunk-6ZVTRFTL.js";import"./chunk-P76QNSQL.js";import{A as R,d as y,h as A,n as F,s as I}from"./chunk-Z34FZIQM.js";import"./chunk-SM5FSVVY.js";import"./chunk-TDDXVLK3.js";import{Ba as a,Ca as V,Qa as T,Ya as M,pc as D,ya as B}from"./chunk-XVA3MWZK.js";import"./chunk-IJOWPJZI.js";import{e as P}from"./chunk-U32DLQYF.js";import{Bc as p,Ga as E,Mc as s,Nc as o,Qb as l,Rb as c,Sb as m,Tb as f,bb as d,cc as v,ha as g,ic as w,jc as N,kc as O,rb as C,wb as S}from"./chunk-FCFRADKE.js";import{a as b,b as _}from"./chunk-XHGXIXF6.js";var W=(()=>{class h extends q{constructor(){super(...arguments),this.definitionService=g(L),this.currencyList=[],this.cultureList=[],this.currencyDropDownInlineLoading=!1,this.isCurrencyNameExists=!1,this.currencyStatus=!0}ngOnInit(){this.getTranslations(),this.drawerService.formConfig$.pipe(this.takeUntilDestroyed(this.destroyRef)).subscribe(e=>{if(e!=null){let{rowData:i,actionType:t,permissions:r,extraData:n}=e;this.rowData=i,this.actionType=t,this.permissions=r,this.currencyData=n,this.recordName=this.rowData?.name??"",this.updateFooterButton(),this.initializeForm(),this.getCurrencyCultureDropDown(this.currencyData)}}),this.drawerService.drawerFooterAction$.pipe(this.takeUntilDestroyed(this.destroyRef)).subscribe(e=>{if(e!=null)switch(e){case this.ACTIONS.CLOSE:case this.ACTIONS.CANCEL:this.onFormClose(!1,!1,!1,D.ASYNC_CONFIRM);break;case this.ACTIONS.EDIT:this.onDrawerEdit(),this.form.get("isenterprise").enable();break;case this.ACTIONS.SAVE:this.onSave();break}})}getTranslations(){this.entity=this.mciTranslateService.getTranslation("L.Currency"),this.entityPlural=this.mciTranslateService.getTranslation("L.Currencies"),this.editDrawerSubtitle=this.mciTranslateService.getTranslation("L.Edit_Currency_Subtitle")}initializeForm(){this.currencyStatus=this.rowData?.isactive,this.selectedRowId=this.rowData?.id,this.currencyName=this.rowData?.name,this.form=this.formBuilder.group({name:[this.rowData?.name??"",y.required],abbreviation:[this.rowData?.abbreviation??"",y.required],currency:[this.rowData?.currency??"",y.required],culture:[this.rowData?.culture??"",y.required],erpid:[this.rowData?.erpid??"",y.required],isenterprise:[{value:this.rowData?.isenterprise??!1,disabled:this.actionType===a.VIEW},y.required],islocation:[{value:this.rowData?.islocation??!1,disabled:!0},y.required],isactive:[{value:this.rowData?.isactive??!0,disabled:this.mciFormService.getStatusDisabled(this.actionType,this.rowData?.isactive,this.permissions?.canActivate,this.permissions?.canDeactivate)}]})}onSave(){this.mciFormService.validateAllFormFields(this.form),!(this.form.invali
1d||this.form.pristine)&&(this.actionType===a.EDIT?this.create_editCurrency():this.validateCurrencyName())}getCurrencyCultureDropDown(e){this.enterpriseCurrency=e?.filter(i=>i.isenterprise===!0)[0],this.currencyDropDownInlineLoading=!0,this.commonService.getGlobalLookups("currency").subscribe({next:i=>{let t=i[0]?.data;this.currencyList=t?.filter(r=>!e?.find(n=>n.currency.id===r.id&&n.id!==this.selectedRowId)&&r.type==="currency"),this.cultureList=t?.filter(r=>r.type==="currency|culture"),this.currencyDropDownInlineLoading=!1},error:()=>{this.currencyDropDownInlineLoading=!1}})}validateCurrencyName(){let e=this.form.controls?.name.value;if(this.actionType===a.EDIT&&this.currencyName===e){this.form.controls.name.setErrors(null),!this.isCurrencyNameExists&&this.form.valid&&this.create_editCurrency();return}this.currencyData?.filter(t=>t.name===e)?.length>0?(this.isCurrencyNameExists=!0,this.onFormHasErrors(),this.form.controls.name.setErrors({incorrect:!0})):(this.isCurrencyNameExists=!1,this.form.controls.name.setErrors(null),!this.isCurrencyNameExists&&this.form.valid&&this.create_editCurrency())}create_editCurrency(){let e=this.createRequestPaylod(this.form.value);this.definitionService.create_editCurrency(e).subscribe(i=>{this.closeDiscardDialog(),i[0]?.success&&i[0]?.data?i[0]?.data?.isExist===!0&&i[0]?.data?.isSuccess===!1?(this.form.controls.abbreviation.setErrors({exists:!0}),this.onFormHasErrors()):(this.notificationBarService.showUpsertNotificationMessage(this.entity,this.actionType),this.uiUtilitiesService.closeDrawer(),this.drawerService.requestToReloadTableAfterDrawerAction(!0)):i[0]?.success||(this.onFormHasErrors(),this.notificationBarService.showSaveErrorMessage(this.actionType,this.entity))})}createRequestPaylod(e){let i=e,t=new X;return t.id=this.actionType===a.EDIT?this.selectedRowId:"",t.name=i.name,t.abbreviation=i.abbreviation,t.culture={id:i.culture.id},t.erpid=i.erpid,t.currency={id:i.currency.id},t.isenterprise=i.isenterprise?i.isenterprise:!1,t.islocation=i.islocation?i.islocation:!1,t.isactive=i.isactive?i.isactive:!1,t}getAbbreviation(e){let i=e.name;return i.lastIndexOf("(")!==-1||i.lastIndexOf(")")!==-1?i.substring(i.lastIndexOf("(")+1,i.lastIndexOf(")")):i}getCurrencyName(e){let i=e.name;return i.lastIndexOf("(")!==-1?i.substring(0,i.lastIndexOf("(")).trim():i}onCurrencyChanged(e){let i=this.currencyList?.filter(n=>n.id===e?.id)[0],t=this.getCurrencyName(i),r=this.getAbbreviation(i);this.form.patchValue({name:t,abbreviation:r,erpid:r})}confirmOverrideIfYes(){if(this.form?.controls.isenterprise.value===!1||!this.enterpriseCurrency)return;this.modalService.openConfirmationModal(this.mciTranslateService.getTranslation("M.Override_Enterprise_Currency_Confirmation",{currency:this.enterpriseCurrency.currency.name}),this.mciTranslateService.getTranslation("L.Confirm_Override"),this.mciTranslateService.getTranslation("L.Override").toLocaleUpperCase(),this.mciTranslateService.getTranslation("L.Cancel").toLocaleUpperCase()).afterClosed().subscribe(i=>{if(i!==this.ACTIONS.CONFIRM){this.form?.controls.isenterprise.setValue(!1);return}this.form?.controls.isenterprise.setValue(!0)})}static{this.\u0275fac=(()=>{let e;return function(t){return(e||(e=E(h)))(t||h)}})()}static{this.\u0275cmp=C({type:h,selectors:[["app-currency-listing-form"]],features:[S],decls:37,vars:92,consts:[["autocomplete","off","id","currency-Form",3,"formGroup"],[1,"row"],[1,"col"],["fieldFormControlName","currency","inputValueLabel","name",3,"selectChange","actionType","displayViewField","enableDataLoadingOnScrollOrSearch","inlineLoading","inputValues","required","selectDropdownForm","viewFieldValue","labelName","placeholder"],["fieldFormControlName","name",3,"actionType","form","maxlength","required","typeOfControl","labelName"],["fieldFormControlName","abbreviation",3,"actionType","form","maxlength","required","typeOfControl","labelName"],["fieldFormControlName","erpid",3,"actionType","form","maxlength","placeholder","required","typeOfControl","labelName"],["fieldFormControlName","culture","inputValueLabel","name",3,"actionType","displayViewField","enableDataLoadingOnScrollOrSearch","inlineLoading","inputValues","required","selectDropdownForm","viewFieldValue","labelName","placeholder"],["fieldFormControlName","isactive",3,"actionType","displayViewField","form","typeOfControl","labelName"],[1,"row","mci-ui-drawer-vertical-top-margin"],["fieldFormControlName","isenterprise",3,"checkboxChange","actionType","displayLabelName","displayViewField","form","typeOfControl","checkBoxName"],["fieldFormControlName","islocation",3,"actionType","displayLabelName","displayViewField","form","matTooltip","typeOfControl","checkBoxName"]],template:function(i,t){i&1&&(c(0,"form",0)(1,"div",1)(2,"div",2)(3,"mci-picker",3),s(4,"mciTranslate"),s(5,"mciTranslate"),v("selectChange",function(n){return t.onCurrencyChanged(n)}),m()()(),c(6,"div",1)(7,"div",2),f(8,"mci-form-control",4),s(9,"mciTranslate"),m()(),c(10,"div",1)(11,"div",2),f(12,"mci-form-control",5),s(13,"mciTranslate"),m()(),c(14,"div",1)(15,"div",2),f(16,"mci-form-control",6),s(17,"mciTranslate"),s(18,"mciTranslate"),m()(),c(19,"div",1)(20,"div",2),f(21,"mci-picker",7),s(22,"mciTranslate"),s(23,"mciTranslate"),m()(),c(24,"div",1)(25,"div",2),f(26,"mci-form-control",8),s(27,"mciTranslate"),m()(),c(28,"div",9)(29,"div",2)(30,"mci-form-control",10),s(31,"mciTranslate"),v("checkboxChange",function(){return t.confirmOverrideIfYes()}),m()()(),c(32,"div",9)(33,"div",2),f(34,"mci-form-control",11),s(35,"mciTranslate"),s(36,"mciTranslate"),m()()()),i&2&&(l("formGroup",t.form),d(3),l("labelName",p(o(4,68,"L.Currency")))("placeholder",p(o(5,70,"L.Select_Currency")))("actionType",t.actionType)("displayViewField",!0)("enableDataLoadingOnScrollOrSearch",!1)("inlineLoading",t.currencyDropDownInlineLoading)("inputValues",t.currencyList)("required",!0)("selectDropdownForm",t.form)("viewFieldValue",t.rowData==null||t.rowData.currency==null?null:t.rowData.currency.name),d(5),l("labelName",p(o(9,72,"L.Currency_Name")))("actionType",t.actionType)("form",t.form)("maxlength",25)("required",!0)("typeOfControl",t.CONTROL_TYPE.TEXT_INPUT),d(4),l("labelName",p(o(13,74,"L.Abbreviation")))("actionType",t.actionType)("form",t.form)("maxlength",3)("required",!0)("typeOfControl",t.CONTROL_TYPE.TEXT_INPUT),d(4),l("labelName",p(o(17,76,"L.ERP_Id")))("actionType",t.actionType)("form",t.form)("maxlength",25)("placeholder",o(18,78,"L.ERP_ID_Placeholder"))("required",!0)("typeOfControl",t.CONTROL_TYPE.TEXT_INPUT),d(5),l("labelName",p(o(22,80,"L.Currency_Culture")))("placeholder",p(o(23,82,"L.Select_Currency_Culture")))("actionType",t.actionType)("displayViewField",!0)("enableDataLoadingOnScrollOrSearch",!1)("inlineLoading",t.currencyDropDownInlineLoading)("inputValues",t.cultureList)("required",!0)("selectDropdownForm",t.form)("viewFieldValue",t.rowData==null||t.rowData.culture==null?null:t.rowData.culture.name),d(5),l("labelName",p(o(27,84,"L.Status")))("actionType",t.actionType)("displayViewField",!1)("form",t.form)("typeOfControl",t.CONTROL_TYPE.SLIDE_TOGGLE),d(4),l("checkBoxName",p(o(31,86,"L.Enterprise_Level_Currency")))("actionType",t.actionType)("displayLabelName",!1)("displayViewField",!1)("form",t.form)("typeOfControl",t.CONTROL_TYPE.CHECKBOX),d(4),l("checkBoxName",p(o(35,88,"L.Location_Level_Currency")))("actionType",t.actionType)("displayLabelName",!1)("displayViewField",!1)("form",t.form)("matTooltip",o(36,90,"M.Location_Level_Currency_Tooltip"))("typeOfControl",t.CONTROL_TYPE.CHECKBOX))},dependencies:[R,F,A,I,z,Y,B,P],encapsulation:2})}}return h})();var Z=["assignModal"],be=(()=>{class h extends ${constructor(){super(),this.definitionService=g(L),this.gridHeight=k,this.isLoadingStatusButton=!1,this.levels=[{id:0,name:"All",displayName:this.mciTranslateService.getTranslation("L.All")},{id:1,name:"Enterprise",displayName:this.mciTranslateService.getTranslation("L.Enterprise")},{id:2,name:"Location",displayName:this.mciTranslateService.getTranslation("L.Location")},{id:3,name:"No Affiliation",displayName:this.mciTranslateService.getTranslation("L.No_Affiliation")}],this.menuEventCallBack=e=>{switch(e.headerName){case T.CONTEXTMENU:e.actionType!==a.DELETE?this.getById(e):this.contentMenuClick(e.actionType,e.rowData);break;case this.mciTranslateService.getTranslation(T.STATUS):this.openActivateDialog(!e.rowData.isactive,[e.rowData]);break;default:break}},this.setupFilterAfterInitObservable(this.onFiltersInitialized.bind(this))}ngOnInit(){this.uiUtilitiesService.disabledGlobalLocation(!0),this.listingPageGridKey="currencyListing",this.mciTranslateService.onLangChange.pipe(this.takeUntilDestroyed(this.destroyRef)).subscribe(()=>{this.getTranslations(),this.setColumnDefs(),this.gridApi?.refreshHeader()}),this.getTranslations(),this.initializeGrid(M.CURRENCY),this.initializeFilterSection(),this.reloadGridData(),this.getCurrencyCultureDropDown(),this.drawerService.reloadTableAfterDrawerAction$.pipe(this.takeUntilDestroyed(this.destroyRef)).subscribe(e=>{e!=null&&e===!0&&this.reloadGridData()}),this.drawerService.drawerFooterAction$.pipe(this.takeUntilDestroyed(this.destroyRef)).subscribe(e=>{e===a.DELETE&&this.openDeleteDialog([this.selectedRowData])}),this.filterSectionService.applyFilters$.pipe(this.takeUntilDestroyed(this.destroyRef)).subscribe(e=>this.onApplyFilters(e)),this.filterSectionService.resetFilters$.pipe(this.takeUntilDestroyed(this.destroyRef)).subscribe(e=>this.onResetFilters(e))}getTranslations(){this.entity=this.mciTranslateService.getTranslation("L.Currency"),this.entityPlural=this.mciTranslateService.getTranslation("L.Currencies"),this.addDrawerTitle=this.mciTranslateService.getTranslation("L.Add_Currency_Title"),this.addDrawerSubtitle=this.mciTranslateService.getTranslation("L.Add_Currency_Subtitle"),this.editDrawerSubtitle=this.mciTranslateService.getTranslation("L.Edit_Currency_Subtitle"),this.viewDrawerSubtitle=this.mciTranslateService.getTranslation("L.View_Currency_Subtitle")}reloadGridData(){this.selectedIds=[];let e=this.filtersForm?.controls?.status?.value?.map(n=>n.value),i=e?.length===1?Number(e[0]):null,t=this.filtersForm?.controls?.level?.value?.name?this.filtersForm?.controls?.level?.value?.name:null,r={cultureids:this.filtersForm?.controls?.culture?.value?.map(n=>n.id),level:t,status:i};this.definitionService.getAllCurrenciesByFilter(r).subscribe({next:n=>{this.uiUtilitiesService.handleResponse(n)?this.gridData=n[0]?.data:this.onAPIError()},error:()=>{this.onAPIError()}})}setColumnDefs(){this.columnDefs=[{headerName:T.CONTEXTMENU,cellRendererParams:{buttons:this.popupOptions,filterButtons:this.filterContextMenuButtonsCB},context:{isMenuEvent:!0}},{field:"name",headerName:this.mciTranslateService.getTranslation("L.Currency_Name"),flex:1,minWidth:this.mciGridService.getColumnMinWidthByHeader(this.mciTranslateService.getTranslation("L.Currency_Name"))},{field:"abbreviation",headerName:this.mciTranslateService.getTranslation("L.Abbreviation")},{field:"currency",headerName:this.mciTranslateService.getTranslation("L.Currency"),filterValueGetter:e=>e.data?.currency?.name,valueGetter:e=>e.data?.currency?.name,editable:this.permissions?.canEdit,cellEditor:"materialSelectEditor",cellEditorParams:{options:()=>this.currencyLookup.filter(e=>!this.gridData?.find(i=>i.currency.id===e.id)&&e.type==="currency"),multiple:!1,displayField:"name",compareValues:(e,i)=>e&&i?e.id===i.id:e===i,validation:e=>e.length!==0}},{field:"culture",headerName:this.mciTranslateService.getTranslation("L.Currency_Culture"),filterValueGetter:e=>e.data?.culture?.name,valueGetter:e=>e.data?.culture?.name,editable:this.permissions?.canEdit,cellEditor:"materialSelectEditor",cellEditorParams:{options:()=>this.cultureList,multiple:!1,displayField:"name",compareValues:(e,i)=>e&&i?e.id===i.id:e===i,validation:e=>e.length!==0}},{field:"erpid",headerName:this.mciTranslateService.getTranslation("L.ERP_Id"),editable:this.permissions?.canEdit},{field:"isenterprise",headerName:this.mciTranslateService.getTranslation("L.Enterprise_Level"),editable:this.permissions?.canEdit,valueGetter:e=>e.data.isenterprise?this.mciTranslateService.getTranslation("L.Yes"):this.mciTranslateService.getTranslation("L.No"),filter:!0,filterParams:{newRowsAction:"keep",suppressAndOrCondition:!0,buttons:["apply","reset"],closeOnApply:!0,values:[this.mciTranslateService.getTranslation("L.Yes"),this.mciTranslateService.getTranslation("L.No")]},cellEditor:"materialSelectEditor",cellEditorParams:{options:()=>[this.mciTranslateService.getTranslation("L.Yes"),this.mciTranslateService.getTranslation("L.No")],compareValues:(e,i)=>e===(i==="Y"?this.mciTranslateService.getTranslation("L.Yes"):this.mciTranslateService.getTranslation("L.No"))}},{field:"islocation",headerName:this.mciTranslateService.getTranslation("L.Location_Level"),valueGetter:e=>e.data.islocation?this.mciTranslateService.getTranslation("L.Yes"):this.mciTranslateService.getTranslation("L.No"),filter:!0,filterParams:{newRowsAction:"keep",suppressAndOrCondition:!0,buttons:["apply","reset"],closeOnApply:!0,values:[this.mciTranslateService.getTranslation("L.Yes"),this.mciTranslateService.getTranslation("L.No")]}},{field:"lastediteddate",headerName:this.mciTranslateService.getTranslation("L.Last_Edited"),filter:"agDateColumnFilter",type:"rightAligned",valueGetter:e=>this.dateTimeService.toLocalizedDateHourMinFormat(e.data.lastediteddate),filterParams:{comparator:this.dateTimeService.localizedDateHourMinFilterComparator},comparator:this.dateTimeService.localizedDateHourMinComparator,context:{isAutoSize:!0}},{field:"lasteditedby",headerName:this.mciTranslateService.getTranslation("L.Edited_By")},{field:"isactive",headerName:this.mciTranslateService.getTranslation(T.STATUS),headerClass:"ag-center-aligned-header",cellClass:"ag-center-aligned-cell",cellRenderer:"gridSwitch",cellRendererParams:{canActivate:this.permissions?.canActivate,canDeactivate:this.permissions?.canDeactivate},context:{isMenuEvent:!0,isAutoSize:!0},resizable:!1}]}configurePopupOptions(){let e=[{action:a.VIEW,canAct:this.permissions?.canView},{action:a.EDIT,canAct:this.permissions?.canEdit},{action:a.DELETE,canAct:this.permissions?.canDelete}];this.popupOptions=e.filter(i=>i.canAct).map(i=>i.action)}initializeFilterSection(){this.filterDefinitions=[{labelName:this.mciTranslateService.getTranslation("L.Currency_Culture"),placeholder:this.mciTranslateService.getTranslation("L.Select_Currency_Cultures"),isMultiSelect:!0,inputValueLabel:"name",controlType:this.CONTROL_TYPE.PICKER,formControlName:"culture",enableDataLoadingOnScrollOrSearch:!1},{labelName:this.mciTranslateService.getTranslation("L.Level"),placeholder:this.mciTranslateService.getTranslation("L.Select_Level"),isMultiSelect:!1,inputValueLabel:"displayName",inputValues:this.levels,controlType:this.CONTROL_TYPE.SELECT,formControlName:"level",disableAlphabeticalSorting:!0},{labelName:this.mciTranslateService.getTranslation("L.Status"),placeholder:this.mciTranslateService.getTranslation("L.Select_Statuses"),inputValueLabel:"name",inputValues:this.statusList,controlType:this.CONTROL_TYPE.PICKER,formControlName:"status",isMultiSelect:!0,disableAlphabeticalSorting:!0,enableDataLoadingOnScrollOrSearch:!1}];let e={filterDefinitions:this.filterDefinitions,showAdvancedFilterButton:!0,associatedGridId:this.listingPageGridKey};this.filterSectionService.initialize(e)}onFiltersInitialized(e){this.filtersForm=e,this.filterDefinitions[2].inputValues=this.statusList,this.filterDefinitions[1].inputValues=this.levels}onResetFilters(e){this.filtersForm.reset({filterSort:this.defaultFilterSort,culture:[],level:null,status:null}),this.filterSectionService.afterReset$.next(null),e&&this.reloadGridData()}getCurrencyCultureDropDown(){this.filterDefinitions[0].inlineLoading=!0,this.commonService.getGlobalLookups("currency").subscribe({next:e=>{e[0]?.success&&e[0].data&&(this.currencyLookup=e[0]?.data,this.cultureList=this.currencyLookup.filter(i=>i.type==="currency|culture"),this.filterDefinitions[0].inputValues=this.cultureList??[],this.filterDefinitions[0].totalRecords=this.cultureList.length,this.filterDefinitions[0].inputValues?.sort(this.compareService.compareNames)),this.filterDefinitions[0].inlineLoading=!1},error:()=>{this.filterDefinitions[0].inlineLoading=!1}})}onCellValueChanged(e){if(e.newValue!==e.oldValue){let i=this.gridData?.find(t=>t.isenterprise===!0);e.c
1olDef.field==="isenterprise"&&e.newValue==="Yes"&&i?this.checkEnterpeiseCurrency(e,i.name):this.updateCellValue(e,!1)}}updateCellValue(e,i){let t=!1,r=null;e.colDef.field==="currency"&&(t=!0,r=this.currencyLookup.filter(u=>u.id===e.data.currency?.id)[0]);let n={id:e.data.id,name:t?this.getCurrencyName(r):e.data.name,isactive:e.data.isactive,islocation:typeof e.data.islocation=="string"?e.data.islocation==="Yes":e.data.islocation,isenterprise:typeof e.data.isenterprise=="string"?e.data.isenterprise==="Yes":e.data.isenterprise,abbreviation:t?this.getAbbreviation(r):e.data.abbreviation,currency:{id:e.data.currency?.id,name:e.data.currency?.name},culture:{id:e.data?.culture?.id,name:e.data.culture?.name},erpid:t?this.getAbbreviation(r):e.data.erpid};this.definitionService.create_editCurrency(n).subscribe(u=>{if(u[0].success){let j=this.gridData?.findIndex(Q=>Q.id===n.id);this.gridData[j]=n,(i||t)&&this.reloadGridData(),e.api.refreshCells()}else this.reloadGridData(),this.notificationBarService.showSaveErrorMessage(a.EDIT,this.entity)})}checkEnterpeiseCurrency(e,i){this.modalService.openConfirmationModal(this.mciTranslateService.getTranslation("M.Override_Enterprise_Currency_Confirmation",{currency:i}),this.mciTranslateService.getTranslation("L.Confirm_Override"),this.mciTranslateService.getTranslation("L.Override").toLocaleUpperCase(),this.mciTranslateService.getTranslation("L.Cancel").toLocaleUpperCase()).afterClosed().subscribe(r=>{if(r)this.updateCellValue(e,!0);else{let n=e.node,u=e.colDef.field;n.data.isenterprise=e.oldValue,e.api.refreshCells({force:!0,columns:[u],rowNodes:[n]})}})}getAbbreviation(e){let i=e.name;return i.indexOf("(")!==-1||i.lastIndexOf(")")!==-1?i.substring(i.indexOf("(")+1,i.lastIndexOf(")")):i}getCurrencyName(e){let i=e.name;return i.indexOf("(")!==-1?i.substring(0,i.indexOf("(")):i}contentMenuClick(e,i){switch(this.actionType=e,e){case a.ADD:this.selectedRowData=null,this.openDrawerAndSetForm(e);break;case a.EDIT:case a.VIEW:this.selectedRowData=i,this.openDrawerAndSetForm(e);break;case a.DELETE:this.onMassDelete([i]);break;default:break}}openDrawerAndSetForm(e){let i=this.getDrawerHeaderLabels(this.actionType,this.selectedRowData?.name),t=new U(e,this.selectedRowData,this.permissions,this.gridData),r=new G(W,i.title,i.subtitle,null,this.drawerSizesEnum.SMALL,null,t);this.drawerService.updateDrawerContent(r),this.drawerService.openDrawer()}getById(e){this.definitionService.getCurrencyDetails(e?.rowData?.id).subscribe(i=>{i[0]?.success&&i[0].data&&(this.selectedRowData=i[0].data,this.contentMenuClick(e.actionType,this.selectedRowData))})}onMassUpdateStatus(e){this.openActivateDialog(e,this.gridApi?.getSelectedRows())}openActivateDialog(e,i){let t=i.map(r=>r.id);this.isLoadingStatusButton=!0,this.definitionService.activateCurrencies(t,e).subscribe({next:r=>{this.isLoadingStatusButton=!1,r[0].success&&this.gridTransaction(r[0].data,i,!1,n=>{n.isactive=e}),this.uiUtilitiesService.handleStatusChangeResponseMessage(r[0],e,this.entity,this.entityPlural)},error:()=>{this.isLoadingStatusButton=!1}})}onMassDelete(e){this.openDeleteDialog(e)}openDeleteDialog(e){let i=(e??[]).map(r=>_(b({},r),{name:r?.name??""})),t=this.modalService.openConfirmActionModal(e,this.entity,this.entityPlural,a.DELETE,D.ASYNC_CONFIRM);t.componentInstance.confirmAction$.pipe(this.takeUntilDestroyed(this.destroyRef)).subscribe(r=>{if(r===a.DELETE){let n=e.map(u=>u.id);this.definitionService.deleteCurrencies(n).subscribe(u=>{t.close(),u[0].success&&(this.gridTransaction(u[0].data,e),this.uiUtilitiesService.closeDrawer()),this.uiUtilitiesService.handleMassActionResponseMessage(u[0],V.DELETE,this.entity,this.entityPlural,"",i)})}})}ngOnDestroy(){super.ngOnDestroy(),this.uiUtilitiesService.disabledGlobalLocation(!1)}static{this.\u0275fac=function(i){return new(i||h)}}static{this.\u0275cmp=C({type:h,selectors:[["app-currency-listing"]],viewQuery:function(i,t){if(i&1&&w(Z,5),i&2){let r;N(r=O())&&(t.ref=r.first)}},features:[S],decls:5,vars:13,consts:[[1,"mci-ui-card-flat"],["associatedGridId","currencyListing"],[1,"mci-ui-card-flat-border"],[1,"mci-ui-table"],[3,"addClick","cellEdit","gridReady","massActivateDeactivate","massDelete","onRowSelect","columnDefinition","fileName","getRowIdCB","gridData","gridHeight","isLoadingStatusButton","key","menuEventCB","showActivateBtn","showAddButton","showDeActivateBtn","showGridDeleteButton","showGridStatusButton"]],template:function(i,t){i&1&&(c(0,"div",0),f(1,"app-filter-section",1),c(2,"div",2)(3,"div",3)(4,"app-common-data-grid",4),v("addClick",function(){return t.contentMenuClick(t.actionList.ADD,null)})("cellEdit",function(n){return t.onCellValueChanged(n)})("gridReady",function(n){return t.onGridReady(n)})("massActivateDeactivate",function(n){return t.onMassUpdateStatus(n)})("massDelete",function(){return t.onMassDelete(t.gridApi==null?null:t.gridApi.getSelectedRows())})("onRowSelect",function(n){return t.onSelectionChanged(n)}),m()()()()),i&2&&(d(4),l("columnDefinition",t.columnDefs)("fileName",t.entityPlural)("getRowIdCB",t.getRowIdCallBack)("gridData",t.gridData)("gridHeight",t.gridHeight)("isLoadingStatusButton",t.isLoadingStatusButton)("key",t.listingPageGridKey)("menuEventCB",t.menuEventCallBack)("showActivateBtn",t.permissions==null?null:t.permissions.canActivate)("showAddButton",t.permissions==null?null:t.permissions.canAdd)("showDeActivateBtn",t.permissions==null?null:t.permissions.canDeactivate)("showGridDeleteButton",t.permissions==null?null:t.permissions.canDelete)("showGridStatusButton",(t.permissions==null?null:t.permissions.canActivate)||(t.permissions==null?null:t.permissions.canDeactivate)))},dependencies:[K,H],encapsulation:2})}}return h})();export{be as CurrencyListingComponent};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.