PageSourceSearch

https://tts.tranzaura.com/5692.fbf88a976e3a01a4.js

js tranzaura.com collected 2026-10-04 18:30:56 UTC 500,280 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunktranzaura=self.webpackChunktranzaura||[]).push([[5692],{20714:(lt,P,h)=>{h.d(P,{l:()=>w});var k=h(20951),T=h(54438),H=h(21189);let w=(()=>{class b{constructor(D){this.master=D}agInit(D){this.params=D}refresh(D){return this.params=D,!0}value(){let D;if(this.master.masterData&&this.params?.colDef?.field){switch(this.params.colDef.field){case k.jpN.primaryWorkshopOrgID:case k.q7p.workshopOrgID:D=this.master.workshopOrgLookUp.find(C=>C.id===this.params?.value)?.value;break;case k.jpN.depotOrgID:D=this.master.masterOrgList.find(C=>C.id===this.params?.value)?.[k.x$L.companyName];break;case k.jpN.operatorOrgID:D=this.master.operatorOrgLookUp.find(C=>C.id===this.params?.value)?.value;break;case k.jpN.status:D=this.master.assetStatus.find(C=>C.id===this.params?.value)?.[this.master.displayLang];break;case k.jpN.make:D=this.master.getMake(this.params.data);break;case k.jpN.assetType:D=this.master.assetTypes.find(C=>C.id===this.params?.value)?.[this.master.displayLang];break;case k.q7p.docCreatedDate:D=Date.parse(this.params?.value);break;case k.q7p.docType:D=this.master.documentTypes.find(C=>C.id===this.params?.value)?.[this.master.displayLang];break;case k.jpN.range:D=this.master.getRange(this.params.data);break;case k.q7p.contractdocType:D=this.master.contractdocumentTypes.find(C=>C.id===this.params?.value)?.[this.master.displayLang];break;default:return this.params.value}return D||""}return""}static{this.\u0275fac=function(C){return new(C||b)(T.rXU(H.m))}}static{this.\u0275cmp=T.VBU({type:b,selectors:[["model-cell-renderer"]],decls:1,vars:1,template:function(C,v){1&C&&T.EFF(0),2&C&&T.SpI(" ",v.value()," ")},encapsulation:2})}}return b})()},15692:(lt,P,h)=>{h.r(P),h.d(P,{NewBookingModule:()=>Kr});var k=h(60177),T=h(87787),H=h(86989),w=h(10467),b=h(89417),l=h(15752),D=h(2692),C=h(92933),v=h(66277),Q=h(64521),c=h(20951),I=h(47614),u=h(90532),K=h(39520),y=h(47824),U=h(82427),M=h(21626),Tt=h(20714),St=h(62467),xt=h(80772),yt=h(13173),dt=h(29392),Ft=h(43014),ct=h(92771),Nt=h(21413),Z=h(56977),pt=h(5964),mt=h(27468),ht=h(54843),Jt=h(7673),Bt=h(88141),Mt=h(28793),ut=h(37023),At=h(89762),Et=h(49781),t=h(54438),gt=h(2309),tt=h(45957),Gt=h(16083),Pt=h(18657),Ot=h(75328),_t=h(58997),Lt=h(37641),$t=h(80327),Vt=h(1922),Ht=h(31609),Yt=h(82359),Ut=h(86153),Xt=h(68531),et=h(82072),Wt=h(97658),qt=h(40218),ft=h(47674),bt=h(99213),at=h(85956),N=h(44613),kt=h(224),vt=h(88588),Dt=h(83269),J=h(52920),Ct=h(16038),it=h(54348),ot=h(46879),zt=h(43684),O=h(25084),Qt=h(1840),st=h(15494),Kt=h(35252),jt=h(77496),Zt=h(18017),te=h(12700),ee=h(43174),ae=h(10140),ie=h(38460);const oe=["agGridDefectList"];let se=(()=>{class s{constructor(e,a,i,o,n){this.assetService=e,this.defectService=a,this.idb=i,this.modalService=o,this.gridConfigService=n,this.subs=new K.S,this.mainDefectlist=[],this.columnDefs=[],this.reportFromDate="",this.reportToDate="",this.master=e.master,this.gridOptions=this.gridConfigService.getCommonGridOptions()}ngOnChanges(e){if(e.hasOwnProperty("defectrequest")){const a=e.defectrequest;a.currentValue&&(this.defectrequest=a.currentValue,this.reportFromDate=this.defectrequest.isLastInspection?l.H.moment(new Date(this.defectrequest.requestDate)).utc().format(l.H.ddMMYYYYDateFormate):l.H.moment(Date.now()).utc().add(-l.H.days28,"days").format(l.H.ddMMYYYYDateFormate),this.reportToDate=l.H.moment(new Date).utc().format(l.H.ddMMYYYYDateFormate),this.getDefectList())}}ngOnInit(){this.agGridColumnInit()}getDefectList(){navigator.onLine?this.subs.add=this.defectService.getDefectsListbyDateRange(this.defectrequest).subscribe(e=>{e&&e.length>0&&(this.mainDefectlist=this.mapDefect(e))}):this.idb.getAllByIndex(u.S.defect,u.pM.asset_IDX,this.defectrequest.assetID).then(e=>{this.getMainDefectList(e)})}getMainDefectList(e){if(Array.isArray(e)){const a=l.H.moment(new Date).utc().format(l.H.YYYYMMDDDateFormate),i=l.H.moment(this.reportFromDate,l.H.ddMMYYYYDateFormate).format(l.H.YYYYMMDDDateFormate),o=e.filter(n=>(n.defectStatus===c.ORI.OpenDefect||n.defectStatus===c.ORI.Resolved)&&!n.delete&&new Date(n.createdDate)>=new Date(i)&&new Date(n.createdDate)<=new Date(a));this.mainDefectlist=this.mapDefect(o)}}
1agGridColumnInit(){this.columnDefs=[{field:"registration",headerName:"Registration"},{field:"assetTypeText",headerName:"Vehicle type"},{field:"depot",headerName:"Depot"},{field:"driver",headerName:"Reported by Driver"},{field:"createdDate",headerName:"Reported Date",isDynamicDateTime:!0},{field:"categoryText",headerName:"Category"},{field:"resolved",headerName:"Resolved"},{field:"resolvedBy",headerName:"Resolved By"},{field:"updateDate",headerName:"Resolution Date",isDynamicDateTime:!0},{field:"updateby",headerName:"Updated By"}].map(a=>l.H.createColDefField(a))}mapDefect(e){return e.map(a=>{const i=a.defectStatus===c.ORI.Resolved,o=this.master.alluserList.find(d=>d.id===a.updatedBy)?.name||"",n=a;return n.registration=a.vrm,n.depot=this.master.depoOrgLookUp.find(d=>d.id===a.depotOrgID)?.value,n.driver=this.master.alluserList.find(d=>d.id===a.createdBy)?.name||"",n.assetTypeText=this.master.assetTypes.find(d=>d.id===a.assetType)?.[this.master.displayLang],n.id=a.id,n.resolved=i,n.createdDate=a.createdDate,n.updateDate=i?a.updatedDate:"",n.resolvedBy=i?o:"",n.updateby=o,n.categoryText=this.master.DefectCategory.find(d=>d.id===a.defectsCategory)?.[this.master.displayLang],n})}closeModal(){this.mainDefectlist=[],this.modalService.close("defectListGrid")}downloadToExcel(){this.mainDefectlist&&this.mainDefectlist.length>0&&this.agGridDefectList.api.exportDataAsExcel({fileName:`Defect_List_grid_${this.reportFromDate}`,sheetName:"Defects"})}onPaginationChanged(){const e=JSON.stringify(this.agGridDefectList.api.paginationGetCurrentPage());localStorage.setItem(c.rJi.pageNo,e)}ngOnDestroy(){this.subs.dispose()}static{this.\u0275fac=function(a){return new(a||s)(t.rXU(gt.I),t.rXU(_t.a),t.rXU(u.To),t.rXU(tt.B),t.rXU(et.m))}}static{this.\u0275cmp=t.VBU({type:s,selectors:[["app-defect-list"]],viewQuery:function(a,i){if(1&a&&t.GBs(oe,5),2&a){let o;t.mGM(o=t.lsd())&&(i.agGridDefectList=o.first)}},inputs:{defectrequest:"defectrequest"},features:[t.OA$],decls:57,vars:9,consts:[["closebutton",""],["agGridDefectList",""],[1,"theme-model"],[1,"theme-modeltitle"],[1,"title","mbtm-5"],["type","button","id","btnCloseChild",1,"my-close",3,"click"],[1,"theme-modelbody"],["fxLayout","row"],["fxLayout","column","fxFlex","75%","fxLayoutWrap","","fxLayoutAlign","flex-start flex-start",1,"formgroup-lt","divfont"],["id","lblvrm",1,"label-auto","text-left","header"],["fxLayout","column","fxFlex","25%","fxLayoutWrap","","fxLayoutAlign","flex-start flex-start",1,"formgroup-lt","divfont","align-items-center"],["id","logo","src","assets/logo.png","alt","logo","width","50px","height","50px"],["id","lblvrm",1,"label-auto","text-left"],["fxLayout","column","fxFlex","35%","fxLayoutWrap","","fxLayoutAlign","flex-start flex-start",1,"formgroup-lt"],["fxLayout","column","fxFlex","30%","fxLayoutWrap","","fxLayoutAlign","flex-start flex-start",1,"formgroup-lt"],["type","button","id","btnprint","name","print","mat-raised-button","","color","accent",1,"themebtnbg","print-btn",3,"click"],[1,"col-md-12"],["fxFlex","100%"],["id","agg_defect",1,"ag-theme-alpine","agGridFrame","full-width",3,"paginationChanged","rowData","columnDefs","pagination","paginationPageSize","gridOptions"]],template:function(a,i){if(1&a){const o=t.RV6();t.j41(0,"div",2)(1,"div",3)(2,"div",4),t.EFF(3,"Defect List"),t.j41(4,"button",5,0),t.bIt("click",function(){return t.eBV(o),t.Njj(i.closeModal())}),t.EFF(6,"\xd7 "),t.k0s()()(),t.j41(7,"div",6)(8,"div",7)(9,"div",8)(10,"mat-label",9),t.EFF(11,"Defect Management"),t.k0s()(),t.j41(12,"div",10),t.nrm(13,"img",11),t.j41(14,"mat-label",12),t.EFF(15),t.k0s()()(),t.j41(16,"div",7)(17,"div",13)(18,"div",7)(19,"mat-label",9),t.EFF(20,"Reported Date From: "),t.j41(21,"span"),t.EFF(22),t.k0s()()(),t.j41(23,"div",7)(24,"mat-label",9),t.EFF(25,"Reported Date To: "),t.j41(26,"span"),t.EFF(27),t.k0s()()(),t.j41(28,"div",7)(29,"mat-label",9),t.EFF(30,"Depot: "),t.j41(31,"span"),t.EFF(32,"All Depots"),t.k0s()()()(),t.j41(33,"div",13)(34,"div",7)(35,"mat-label",9),t.EFF(36,"Driver: "),t.j41(37,"span"),t.EFF(38,"All Drivers"),t.k0s()()(),t.j41(39,"div",7)(40,"mat-label",9),t.EFF(41,"Vehicle: "),t.j41(42,"span"),t.EFF(43,"All Vehicle Types"),t.k0s()()(),t.j41(44,"div",7)(45,"mat-label",9),t.EFF(46,"Engineering Category: "),t.j41(47,"span"),t.EFF(48,"All Engineering Category"),t.k0s()()()(),t.j41(49,"div",14)(50,"button",15),t.bIt("click",function(){return t.eBV(o),t.Njj(i.downloadToExcel())}),t.EFF(51),t.k0s()()(),t.j41(52,"div",7)(53,"div",16)(54,"div",17)(55,"ag-grid-angular",18,1),t.bIt("paginationChanged",function(){return t.eBV(o),t.Njj(i.onPaginationChanged())}),t.k0s()()()()()()}
12&a&&(t.R7$(15),t.JRh(i.master.datalist.Tranzaura),t.R7$(7),t.JRh(i.reportFromDate),t.R7$(5),t.JRh(i.reportToDate),t.R7$(24),t.JRh(i.master.datalist.Print),t.R7$(4),t.Y8G("rowData",i.mainDefectlist)("columnDefs",i.columnDefs)("pagination",!0)("paginationPageSize",100)("gridOptions",i.gridOptions))},dependencies:[at.iV,N.aw,J.DJ,J.sA,J.UI,st.xs],styles:["@media screen and (max-width: 1080px){.themeinputgrp[_ngcontent-%COMP%]   mat-label.label-auto[_ngcontent-%COMP%]{width:auto!important}}.theme-model[_ngcontent-%COMP%]{width:900px!important}.maxwithSearch[_ngcontent-%COMP%]{max-width:325px!important}.buttonAlgin[_ngcontent-%COMP%]{padding:3px 5px 4px!important}.agGridFrame[_ngcontent-%COMP%]{width:100%;height:400px}.header[_ngcontent-%COMP%]{margin-left:20px;margin-top:20px}.print-btn[_ngcontent-%COMP%]{width:43%;height:40%;margin-left:50px;margin-top:25px}"]})}}return s})();var ne=h(87048),L=h(20962),re=h(42300),le=h(66737),de=h(71997),ce=h(2920),pe=h(74026),wt=h(5951),me=h(2913),he=h(59735),ue=h(65429),ge=h(74184),_e=h(70020),fe=h(76674),be=h(44089),ke=h(76321),ve=h(21189),De=h(48256);const Ce=["agGridCommsLog"];function je(s,r){if(1&s){const e=t.RV6();t.qex(0),t.j41(1,"button",52),t.bIt("click",function(){t.eBV(e);const i=t.XpG();return t.Njj(i.onClickingFilters())}),t.j41(2,"mat-icon"),t.EFF(3,"filter_list"),t.k0s(),t.EFF(4," Filters "),t.j41(5,"span",53),t.EFF(6),t.k0s()(),t.j41(7,"p",54),t.bIt("click",function(){t.eBV(e);const i=t.XpG(),o=t.sdS(22);return t.Njj(i.master.resetAGGridFilter(o))}),t.EFF(8," Clear all "),t.k0s(),t.bVm()}if(2&s){const e=t.XpG(),a=t.sdS(22);t.R7$(6),t.JRh(e.master.agGridActiveFiltersCount(a))}}function we(s,r){if(1&s&&(t.j41(0,"mat-option",55),t.EFF(1),t.k0s()),2&s){const e=r.$implicit;t.Y8G("value",e.id),t.R7$(),t.JRh(e.value)}}function Ie(s,r){if(1&s&&(t.j41(0,"mat-option",55),t.EFF(1),t.k0s()),2&s){const e=r.$implicit;t.Y8G("value",e.id),t.R7$(),t.JRh(e.value)}}function Re(s,r){if(1&s&&(t.j41(0,"mat-option",55),t.EFF(1),t.k0s()),2&s){const e=r.$implicit;t.Y8G("value",e.id),t.R7$(),t.JRh(e.value)}}function Te(s,r){if(1&s&&(t.j41(0,"mat-option",55),t.EFF(1),t.k0s()),2&s){const e=r.$implicit;t.Y8G("value",e.id),t.R7$(),t.JRh(e.value)}}let Se=(()=>{class s{constructor(e,a,i,o,n){this.master=e,this.jobService=a,this.modalService=i,this.gridConfigService=o,this.toastrService=n,this.jobId="",this.assetId="",this.UILabels=c._6u,this.addCommsModalId="AddCommsLogRecord",this.noteMaxLength=200,this.subs=new K.S,this.rowData=[],this.columnDefs=[],this.quickFilterText="",this.sideBar="filters",this.userOptions=[],this.followUpActionOptions=[{id:c.A8X.ContactCustomer,value:"Contact Customer"},{id:c.A8X.ContactSupplier,value:"Contact Supplier"},{id:c.A8X.ReviewInternally,value:"Review Internally"}],this.communicationTypeOptions=[{id:c.Az0.PhoneCall,value:"Phone Call"},{id:c.Az0.Email,value:"Email"},{id:c.Az0.Meeting,value:"Meeting"}],this.statusOptions=[{id:c.gop.Active,value:"Active"},{id:c.gop.Closed,value:"Closed"},{id:c.gop.Pending,value:"Pending"}],this.commsRecord=this.getDefaultRecord(),this.btnDisable=!1,this.gridOptions=this.gridConfigService.getCommonGridOptions(),this.gridOptions.autoSizeStrategy={type:"fitGridWidth"},this.setAggridSidebar(),this.columnDefs=[{field:"dateText",headerName:"Date",sortable:!0,filter:!0,floatingFilter:!0,resizable:!0,suppressSizeToFit:!1},{field:"userName",headerName:"User",sortable:!0,filter:!0,floatingFilter:!0,resizable:!0,suppressSizeToFit:!1},{field:"note",headerName:"Note",sortable:!0,filter:!0,floatingFilter:!0,resizable:!0,suppressSizeToFit:!1},{field:"followUpAction",headerName:"Follow Up Action",sortable:!0,filter:!0,floatingFilter:!0,resizable:!0,suppressSizeToFit:!1},{field:"communicationType",headerName:"Communication Type",sortable:!0,filter:!0,floatingFilter:!0,resizable:!0,suppressSizeToFit:!1},{field:"status",headerName:"Status",sortable:!0,filter:!0,floatingFilter:!0,resizable:!0,suppressSizeToFit:!1}]}setAggridSidebar(){this.sideBar={toolPanels:[{id:"filters",labelDefault:"Filters",labelKey:"filters",iconKey:"filter",toolPanel:"agFiltersToolPanel"}],position:"right"}}onClickingFilters(){this.agGridCommsLog.api.isToolPanelShowing()?this.agGridCommsLog.api.closeToolPanel():this.agGridCommsLog.api.openToolPanel("filters")}get canSelectUser(){return this.master.isTZadmin||this.master.isSuperAdmin}ngOnChanges(e){e.jobId&&(this.loadUserOptions(),this.loadRecords())}openAddModal(){this.jobId?(this.commsRecord=this.getDefaultRecord(),this.modalService.open(this.addCommsModalId)):this.toastrService.warning("Please save the job first to add communication logs.")}closeModal(){this.btnDisable=!1,this.modalService.close(this.addCommsModalId)}saveRecord(){this.btnDisable=!0;const e=this.validateRecord();if(e)return this.toastrService.warning(e),void(this.btnDisable=!1);const a=this.userOptions.find(o=>o.id===this.commsRecord.userId),i={...this.commsRecord,id:this.master.newGuid(),jobId:this.jobId,type:"JobCommunicationLog",assetID_PK:this.assetId,date:this.commsRecord.date?l.H.moment(this.commsRecord.date).format("YYYY-MM-DD"):"",userName:a?.value||this.master.userInfo?.name||this.master.userInfo?.loginName||"-",createdBy:this.master.userInfo?.id||"",createdDate:l.H.moment(new Date).utc().format()};this.subs.add=this.jobService.saveCommunicationLog(i).subscribe({next:()=>{this.loadRecords(),this.toastrService.success("Communication log saved."),this.closeModal()},error:()=>{this.toastrService.error("Failed to save communication log."),this.btnDisable=!1}})}validateRecord(){return this.commsRecord.date?this.commsRecord.userId?this.commsRecord.note&&this.commsRecord.note.trim()?this.commsRecord.note.trim().length>this.noteMaxLength?`Note cannot exceed ${this.noteMaxLength} characters.`:this.commsRecord.communicationType?this.commsRecord.status?"":"Status is required.":"Communication type is required.":"Note is required.":"User is required.":"Date is required."}getDefaultRecord(){return{id:"",assetID_PK:"",jobId:"",type:"",date:new Date,userId:this.master.userInfo?.id||"",note:"",followUpAction:0,communicationType:0,status:c.gop.Active,isDelete:!1,createdBy:"",createdDate:""}}loadUserOptions(){const e=(this.master.alluserList||[]).filter(a=>1===a.status);this.userOptions=e.map(a=>({id:a.id,value:a.name||a.loginName||a.id})).sort((a,i)=>a.value.localeCompare(i.value)),!this.userOptions.length&&this.master.userInfo?.id&&
1(this.userOptions=[{id:this.master.userInfo.id,value:this.master.userInfo.name||this.master.userInfo.loginName||this.master.userInfo.id}])}loadRecords(){this.jobId&&(this.subs.add=this.jobService.getCommunicationLogByJobId(this.jobId).subscribe({next:e=>{this.rowData=(e||[]).map(a=>({...a,userName:this.userOptions.find(i=>i.id===a.userId)?.value||"-",dateText:a.date?l.H.moment(a.date).format(l.H.ddMMYYYYDateFormate):"-",followUpAction:this.getFollowUpActionLabel(a.followUpAction),communicationType:this.getCommunicationTypeLabel(a.communicationType),status:this.getStatusLabel(a.status)}))},error:()=>{this.toastrService.error("Failed to load communication logs.")}}))}getFollowUpActionLabel(e){return this.followUpActionOptions.find(a=>a.id===e)?.value||"-"}getCommunicationTypeLabel(e){return this.communicationTypeOptions.find(a=>a.id===e)?.value||"-"}getStatusLabel(e){return this.statusOptions.find(a=>a.id===e)?.value||"-"}ngOnDestroy(){this.subs.dispose()}static{this.\u0275fac=function(a){return new(a||s)(t.rXU(ve.m),t.rXU(Q.L),t.rXU(tt.B),t.rXU(et.m),t.rXU(De.tw))}}static{this.\u0275cmp=t.VBU({type:s,selectors:[["app-new-booking-comms-log"]],viewQuery:function(a,i){if(1&a&&t.GBs(Ce,5),2&a){let o;t.mGM(o=t.lsd())&&(i.agGridCommsLog=o.first)}},inputs:{jobId:"jobId",assetId:"assetId"},features:[t.OA$],decls:94,vars:44,consts:[["agGridCommsLog",""],["commsDatePicker",""],["fxLayout","row"],["fxFlex","100%"],[1,"aggridCustomFilter"],[1,"aggridTopRowFilter","rounded-lg","flex","p-2","space-x-4","width100"],[1,"row"],[1,"col-md-2"],["fxLayout","row wrap","fxLayoutAlign","center center",1,"themeinputgrpm"],[1,"md-form","form-group","width100"],["id","agGridCommsLogSearchField","appearance","outline",1,"search-field"],["matPrefix","","id","agGridCommsLogSearchMatIcon"],["matInput","","placeholder","Search any column",3,"ngModelChange","ngModel"],[1,"col-md-2","contentCenter"],[4,"ngIf"],[1,"col-md-8"],[1,"text-right","rightSideBtnGrp","comms-add-btn-wrap"],["id","btnAddCommsLog","mat-raised-button","","color","primary",1,"icon-container",3,"click"],["id","btnAddCommsLogIcon"],["id","agg_newBookingCommsLog",1,"ag-theme-alpine","aggridht-650","pos-relative","newViewAggrid",3,"rowData","columnDefs","pagination","paginationPageSize","rowBuffer","gridOptions","suppressColumnVirtualisation","sideBar","quickFilterText"],[1,"newModel",3,"id"],[1,"theme-model"],[1,"theme-modeltitle"],[1,"title","custom"],["type","button","id","btnCloseComms","mat-raised-button","","color","primary",3,"click"],[1,"design-close-btn"],[1,"form-row","themeinputgrp","contact-form-grid"],[1,"contact-field-row"],["id","lblCommsDate",1,"pt-10"],[1,"required"],[1,"md-form","form-group"],["appearance","outline",1,"example-full-width"],["id","txtCommsDate","matInput","","name","commsDate",1,"themeinput",3,"ngModelChange","matDatepicker","ngModel"],["matSuffix","",3,"for"],["id","lblCommsUser",1,"pt-10"],["id","ddlCommsUser","name","commsUser",1,"themeinput",3,"ngModelChange","ngModel","disabled"],[3,"value",4,"ngFor","ngForOf"],["id","lblFollowUpAction",1,"pt-10"],["id","ddlFollowUpAction","name","followUpAction",1,"themeinput",3,"ngModelChange","ngModel"],["id","lblCommunicationType",1,"pt-10"],["id","ddlCommunicationType","name","communicationType",1,"themeinput",3,"ngModelChange","ngModel"],["id","lblCommsStatus",1,"pt-10"],["id","ddlCommsStatus","name","commsStatus",1,"themeinput",3,"ngModelChange","ngModel"],[1,"contact-field-row","full-span"],["id","lblCommsNote",1,"pt-10"],[1,"md-form","form-group","textareagrp","textareaCommunicationLogComment"],["appearance","outline",1,"example-full-width","maxWidthUnset"],["id","txtCommsNote","matInput","","rows","4","maxlength","200","aria-label","Communication Note","name","commsNote",1,"themeinput","communicationLogComment",3,"ngModelChange","ngModel"],["align","end"],[1,"theme-modelfooter","contact-form-actions"],["id","btnCancelComms","type","button","mat-raised-button","",3,"click"],["id","btnSaveComms","type","button","color","primary","mat-raised-button","",1,"mr-0",3,"click","disabled"],["mat-button","",1,"filter-btn",3,"click"],[1,"badge"],["onKeyDown","master.resetAGGridFilter(agGridCommsLog)",1,"highlightColorText","clearFilter",3,"click"],[3,"value"]],template:function(a,i){if(1&a){const o=t.RV6();t.j41(0,"div",2)(1,"div",3)(2,"div",4)(3,"div",5)(4,"div",6)(5,"div",7)(6,"div",8)(7,"div",9)(8,"mat-form-field",10)(9,"mat-icon",11),t.EFF(10),t.nI1(11,"lowercase"),t.k0s(),t.j41(12,"input",12),t.mxI("ngModelChange",function(d){return t.eBV(o),t.DH7(i.quickFilterText,d)||(i.quickFilterText=d),t.Njj(d)}),t.k0s()()()()(),t.j41(13,"div",13),t.DNE(14,je,9,1,"ng-container",14),t.k0s(),t.j41(15,"div",15)(16,"div",16)(17,"button",17),t.bIt("click",function(){return t.eBV(o),t.Njj(i.openAddModal())}),t.j41(18,"mat-icon",18),t.EFF(19),t.k0s(),t.EFF(20),t.k0s()()()()()(),t.nrm(21,"ag-grid-angular",19,0),t.k0s()(),t.j41(23,"app-model",20)(24,"div",21)(25,"div",22)(26,"div",23),t.EFF(27,"Add Communication "),t.j41(28,"button",24),t.bIt("click",function(){return t.eBV(o),t.Njj(i.closeModal())}),t.j41(29,"mat-icon",25),t.EFF(30),t.k0s(),t.EFF(31," Close "),t.k0s()()(),t.j41(32,"form")(33,"div",26)(34,"div",27)(35,"mat-label",28),t.EFF(36),t.j41(37,"span",29),t.EFF(38,"*"),t.k0s()(),t.j41(39,"div",30)(40,"mat-form-field",31)(41,"input",32),t.mxI("ngModelChange",function(d){return t.eBV(o),t.DH7(i.commsRecord.date,d)||(i.commsRecord.date=d),t.Njj(d)}),t.k0s(),t.nrm(42,"mat-datepicker-toggle",33)(43,"mat-datepicker",null,1),t.k0s()()(),t.j41(45,"div",27)(46,"mat-label",34),t.EFF(47),t.j41(48,"span",29),t.EFF(49,"*"),t.k0s()(),t.j41(50,"div",30)(51,"mat-form-field",31)(52,"mat-select",35),t.mxI("ngModelChange",function(d){return t.eBV(o),t.DH7(i.commsRecord.userId,d)||(i.commsRecord.userId=d),t.Njj(d)}),t.DNE(53,we,2,2,"mat-option",36),t.k0s()()()(),t.j41(54,"div",27)(55,"mat-label",37),t.EFF(56),t.k0s(),t.j41(57,"div",30)(58,"mat-form-field",31)(59,"mat-select",38),t.mxI("ngModelChange",function(d){return t.eBV(o),t.DH7(i.commsRecord.followUpAction,d)||(i.commsRecord.followUpAction=d),t.Njj(d)}),t.DNE(60,Ie,2,2,"mat-option",36),t.k0s()()()(),t.j41(61,"div",27)(62,"mat-label",39),t.EFF(63),t.j41(64,"span",29),t.EFF(65,"*"),t.k0s()(),t.j41(66,"div",30)(67,"mat-form-field",31)(68,"mat-select",40),t.mxI("ngModelChange",function(d){return t.eBV(o),t.DH7(i.commsRecord.communicationType,d)||(i.commsRecord.communicationType=d),t.Njj(d)}),t.DNE(69,Re,2,2,"mat-option",36),t.k0s()()()(),t.j41(70,"div",27)(71,"mat-label",41),t.EFF(72),t.j41(73,"span",29),t.EFF(74,"*"),t.k0s()(),t.j41(75,"div",30)(76,"mat-form-field",31)(77,"mat-select",42),t.mxI("ngModelChange",function(d){return t.eBV(o),t.DH7(i.commsRecord.status,d)||(i.commsRecord.status=d),t.Njj(d)}),t.DNE(78,Te,2,2,"mat-option",36),t.k0s()()()(),t.j41(79,"div",43)(80,"mat-label",44),t.EFF(81),t.j41(82,"span",29),t.EFF(83,"*"),t.k0s()(),t.j41(84,"div",45)(85,"mat-form-field",46)(86,"textarea",47),t.mxI("ngModelChange",function(d){return t.eBV(o),t.DH7(i.commsRecord.note,d)||(i.commsRecord.note=d),t.Njj(d)}),t.k0s(),t.j41(87,"mat-hint",48),t.EFF(88),t.k0s()()()(),t.j41(89,"div",49)(90,"button",50),t.bIt("click",function(){return t.eBV(o),t.Njj(i.closeModal())}),t.EFF(91),t.k0s(),t.j41(92,"button",51),t.bIt("click",function(){return t.eBV(o),t.Njj(i.saveRecord())}),t.EFF(93),t.k0s()()()()()()}if(2&a){const o=t.sdS(22),n=t.sdS(44);t.R7$(10),t.JRh(t.bMT(11,42,i.master.datalist.Search)),t.R7$(2),t.R50("ngModel",i.quickFilterText),t.R7$(2),t.Y8G("ngIf",!i.master.filtersAreActive(o)),t.R7$(5),t.JRh(i.master.datalist.add),t.R7$(),t.SpI(" ",i.UILabels.addCommunication," "),t.R7$(),t.Y8G("rowData",i.rowData)("columnDefs",i.columnDefs)("pagination",!0)("paginationPageSize",100)("rowBuffer",89)("gridOptions",i.gridOptions)("suppressColumnVirtualisation",!0)("sideBar",i.sideBar)("quickFilterText",i.quickFilterText),t.R7$(2),t.xc7("--modalWidth","60%"),t.Y8G("id",i.addCommsModalId),t.R7$(7),t.JRh(i.master.datalist.close),t.R7$(6),t.JRh(i.UILabels.date),t.R7$(5),t.Y8G("matDatepicker",n),t.R50("ngModel",i.commsRecord.date),t.R7$(),t.Y8G("for",n),t.R7$(5),t.JRh(i.UILabels.user),t.R7$(5),t.R50("ngModel",i.commsRecord.userId),t.Y8G("disabled",!i.canSelectUser),t.R7$(),t.Y8G("ngForOf",i.userOptions),t.R7$(3),t.JRh(i.UILabels.followUpAction),t.R7$(3),t.R50("ngModel",i.commsRecord.followUpAction),t.R7$(),t.Y8G("ngForOf",i.followUpActionOptions),t.R7$(3),t.JRh(i.UILabels.commType),t.R7$(5),t.R50("ngModel",i.commsRecord.communicationType),t.R7$(),t.Y8G("ngForOf",i.communicationTypeOptions),t.R7$(3),t.JRh(i.UILabels.status),t.R7$(5),t.R50("ngModel",i.commsRecord.status),t.R7$(),t.Y8G("ngForOf",i.statusOptions),t.R7$(3),t.JRh(i.UILabels.note),t.R7$(5),t.R50("ngModel",i.commsRecord.note),t.R7$(2),t.Lme("",(i.commsRecord.note||"").length," / ",i.noteMaxLength,""),t.R7$(3),t.SpI(" ",i.master.datalist.Cancel," "),t.R7$(),t.Y8G("disabled",i.btnDisable),t.R7$(),t.SpI(" ",i.master.datalist.Save," ")}},dependencies:[k.Sq,k.bT,bt.An,at.iV,N.Ky,N.V3,N.aw,N.av,N.xZ,kt.aL,vt.cu,Dt.d1,J.DJ,J.sA,J.UI,b.qT,b.me,b.BC,b.cb,b.tU,O.Vh,O.bZ,O.bU,st.xs,jt.D,b.vS,b.cV,k.GH],styles:[".aggridCustomFilter[_ngcontent-%COMP%]{position:relative}.aggridTopRowFilter[_ngcontent-%COMP%]{border:1px solid var(--trazauraBrandColor);border-bottom:0;border-radius:6px 6px 0 0}  .search-field{height:40px}.contentCenter[_ngcontent-%COMP%]{display:flex;align-items:center}.filter-btn[_ngcontent-%COMP%]{display:flex;align-items:center;border:1px solid var(--trazauraBrandColor);border-radius:6px;padding:6px 12px;
1height:40px}.badge[_ngcontent-%COMP%]{background-color:#f57c00;color:#fff;border-radius:50%;padding:2px 8px;font-size:12px;margin-left:8px}.clearFilter[_ngcontent-%COMP%]{margin-bottom:0;margin-left:10px;cursor:pointer}  .newViewAggrid .ag-root-wrapper{border:1px solid var(--trazauraBrandColor);border-top-right-radius:0;border-top-left-radius:0}  .newViewAggrid .ag-cell{background-color:#fff;border-bottom:1px solid var(--trazauraBrandColor)}  .newViewAggrid .ag-header{border-bottom:none}  .newViewAggrid .ag-header-row{border-bottom:1px solid var(--trazauraBrandColor)}  .newViewAggrid .ag-row:last-child .ag-cell{border-bottom:1px solid var(--trazauraBrandColor)}  .newViewAggrid .ag-column-drop-horizontal{border-bottom:1px solid var(--trazauraBrandColor)}  .newViewAggrid .ag-side-buttons{border-left:1px solid var(--trazauraBrandColor)}  .newViewAggrid .ag-cell.ag-cell-last-left-pinned:not(.ag-cell-range-right):not(.ag-cell-range-single-cell){border-right:1px solid var(--trazauraBrandColor)}  .newViewAggrid .ag-pinned-left-header{border-right:1px solid var(--trazauraBrandColor)}  .newViewAggrid input.ag-input-field-input{border:1px solid var(--trazauraBrandColor)!important;border-radius:6px}.search-field[_ngcontent-%COMP%]   .mat-form-field-outline[_ngcontent-%COMP%]{color:var(--trazauraBrandColor);border-color:var(--trazauraBrandColor)}  .search-field .mat-form-field-outline-start,   .search-field .mat-form-field-outline-end{border-color:var(--trazauraBrandColor)!important}  .search-field .mat-form-field-wrapper{padding:0!important;margin:0!important;height:40px;display:flex;align-items:center}  .search-field .mat-form-field-flex{height:40px;align-items:center;display:flex}  .search-field .mat-form-field-infix{padding:2px 0 0!important;display:flex;align-items:center;height:40px;border-top:0}  .search-field .mat-input-element{height:40px;line-height:40px;padding:0 8px;margin:0;display:flex;align-items:center;color:var(--trazauraBrandColor)}  .search-field .mat-icon{display:flex;align-items:center;justify-content:center;height:40px;line-height:40px;font-size:20px;color:var(--trazauraBrandColor)}  .search-field .mat-input-element::placeholder{color:var(--trazauraBrandColor);opacity:1}  .search-field.mat-focused .mat-form-field-outline-thick{border-color:var(--trazauraBrandColor)}  .ag-theme-alpine .ag-paging-panel{position:absolute;top:-52px;width:100%;z-index:1;right:156px!important;width:unset;justify-content:flex-start;border:none}  .ag-root-wrapper{position:unset!important}.link-btnwrap[_ngcontent-%COMP%]{display:flex;justify-content:flex-end}.comms-add-btn-wrap[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;align-items:center;gap:6px}.design-close-btn[_ngcontent-%COMP%]{border:none;border-radius:4px;align-items:center;font-weight:500}.contact-form-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(5,minmax(120px,1fr));gap:10px 12px}.contact-field-row[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;gap:6px}.contact-field-row[_ngcontent-%COMP%]   .form-group[_ngcontent-%COMP%], .contact-field-row[_ngcontent-%COMP%]   .example-full-width[_ngcontent-%COMP%]{width:100%}.full-span[_ngcontent-%COMP%]{grid-column:1 / -1}.comms-note-textarea[_ngcontent-%COMP%]{min-height:auto;height:auto}.contact-form-actions[_ngcontent-%COMP%]{grid-column:1 / -1;justify-content:flex-end}  app-model#AddCommsLogRecord .jw-modal{display:flex!important;justify-content:center!important;align-items:center!important;overflow:hidden!important;max-height:100vh!important;width:100%!important;left:50%!important;transform:translate(-50%)!important}  app-model#AddCommsLogRecord .jw-modal-body{margin:0!important}  app-model#AddCommsLogRecord .themeinputgrp.contact-form-grid{max-height:min(60vh,calc(100vh - 260px));overflow-y:auto}@media (max-width: 992px){.contact-form-grid[_ngcontent-%COMP%]{grid-template-columns:repeat(2,minmax(160px,1fr))}.full-span[_ngcontent-%COMP%]{grid-column:1 / -1}}@media (max-width: 640px){.contact-form-grid[_ngcontent-%COMP%]{grid-template-columns:1fr}}.themeinputgrp[_ngcontent-%COMP%]   .textareaCommunicationLogComment[_ngcontent-%COMP%]   .mat-input-element[_ngcontent-%COMP%]{min-height:60px!important}.communicationLogComment[_ngcontent-%COMP%]{height:75px}"]})}}return s})();var xe=h(58966);const ye=["jobTabForm"],Fe=["agGridJobHistory"],Ne=["agGridPart"],Je=["agGridJobCostCharges"],Be=["assetCostGridComp"],Me=["keyDateJobFileUpload"],Ae=["costfileDropReference"],Ee=["agGridJobDocument"],Ge=()=>({margin:"-4px"}),A=s=>[s],Pe=()=>({"margin-top":"10px"}),Oe=()=>({height:"100px","z-index":"10000"}),It=()=>({standalone:!0}),Le=s=>({"emergency-work-title":s}),$e=s=>({color:s}),Ve=()=>({$implicit:"",className:"mr-0"}),nt=()=>({$implicit:"",className:""}),He=s=>({data:s}),Ye=(s,r)=>({taskRow:s,idPrefix:r}),Ue=s=>({taskRow:s}),Xe=s=>({"icon-btn-disable":s}),We=()=>[],Rt=s=>({active:s}),qe=()=>({padding:"10px"});function ze(s,r){if(1&s&&(t.j41(0,"mat-label",238),t.EFF(1),t.k0s()),2&s){const e=t.XpG(4);t.R7$(),t.SpI(" ",e.master.datalist.CreateJob," ")}}function Qe(s,r){if(1&s&&(t.j41(0,"mat-label",239),t.EFF(1),t.k0s()),2&s){const e=t.XpG(4);t.R7$(),t.SpI(" ",e.master.datalist.UpdateJob," ")}}function Ke(s,r){if(1&s&&(t.qex(0),t.DNE(1,ze,2,1,"mat-label",236)(2,Qe,2,1,"mat-label",237),t.bVm()),2&s){const e=t.XpG(3);t.R7$(),t.Y8G("ngIf",!e.isUpdatingJobTask),t.R7$(),t.Y8G("ngIf",e.isUpdatingJobTask)}}function Ze(s,r){if(1&s&&(t.j41(0,"mat-label",240),t.EFF(1),t.k0s()),2&s){const e=t.XpG(3);t.Y8G("ngClass",t.eq3(2,Le,e.isEmergencyRequestMode)),t.R7$(),t.SpI("",e.isEmergencyRequestMode?"Create Emergency Work":"Create Request"," ")}}function ta(s,r){if(1&s&&(t.j41(0,"div",233)(1,"div",234),t.DNE(2,Ke,3,2,"ng-container",205)(3,Ze,2,4,"mat-label",235),t.k0s()()),2&s){const e=t.XpG(2);t.R7$(2),t.Y8G("ngIf",!e.createJobRequest),t.R7$(),t.Y8G("ngIf",e.createJobRequest)}}function ea(s,r){if(1&s){const e=t.RV6();t.j41(0,"button",257),t.bIt("click",function(){t.eBV(e);const i=t.XpG(4);return t.Njj(i.createJob())}),t.EFF(1),t.k0s()}if(2&s){const e=t.XpG(4);t.Y8G("disabled",!1),t.R7$(),t.SpI("",e.master.datalist.Create," ")}}function aa(s,r){if(1&s){const e=t.RV6();t.j41(0,"button",258),t.bIt("click",function(){t.eBV(e);const i=t.XpG(4);return t.Njj(i.insertJobTask())}),t.EFF(1),t.k0s()}if(2&s){const e=t.XpG(4);t.Y8G("disabled",!1),t.R7$(),t.SpI("",e.master.datalist.Save," ")}}function ia(s,r){if(1&s&&(t.j41(0,"div",254),t.DNE(1,ea,2,2,"button",255)(2,aa,2,2,"button",256),t.k0s()),2&s){const e=t.XpG(3);
1t.R7$(),t.Y8G("ngIf",!e.jobId||e.isUpdatingJobTask),t.R7$(),t.Y8G("ngIf",e.jobId&&!e.isUpdatingJobTask)}}function oa(s,r){if(1&s){const e=t.RV6();t.j41(0,"div")(1,"img",259),t.bIt("click",function(){t.eBV(e);const i=t.XpG(4);return t.Njj(i.viewAlert())}),t.k0s()()}}function sa(s,r){if(1&s){const e=t.RV6();t.j41(0,"div")(1,"div",260)(2,"span"),t.EFF(3),t.k0s(),t.j41(4,"mat-slide-toggle",261),t.bIt("change",function(i){t.eBV(e);const o=t.XpG(4);return t.Njj(o.createAlert(i))}),t.mxI("ngModelChange",function(i){t.eBV(e);const o=t.XpG(4);return t.DH7(o.blnToggle,i)||(o.blnToggle=i),t.Njj(i)}),t.k0s()()()}if(2&s){const e=t.XpG(4);t.R7$(3),t.JRh(e.master.datalist.Alert),t.R7$(),t.R50("ngModel",e.blnToggle)}}function na(s,r){if(1&s&&(t.j41(0,"div",208),t.DNE(1,oa,2,0,"div",205)(2,sa,5,2,"div",205),t.k0s()),2&s){const e=t.XpG(3);t.R7$(),t.Y8G("ngIf",e.alertDetails),t.R7$(),t.Y8G("ngIf",!e.alertDetails)}}function ra(s,r){1&s&&t.nrm(0,"img",271)}function la(s,r){if(1&s&&(t.j41(0,"div",249)(1,"div",250)(2,"span"),t.EFF(3),t.k0s(),t.j41(4,"mat-label",268),t.EFF(5),t.DNE(6,ra,1,0,"img",270),t.k0s()()()),2&s){const e=t.XpG(4);t.R7$(3),t.SpI("",e.master.datalist.JobNo,": "),t.R7$(2),t.SpI(" ",e.objJobData.jobNumber," "),t.R7$(),t.Y8G("ngIf",e.objJobData.fleetFactorAuthCode)}}function da(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",249)(1,"div",250)(2,"span"),t.EFF(3),t.k0s(),t.j41(4,"a",272),t.bIt("click",function(){t.eBV(e);const i=t.XpG(4);return t.Njj(i.redirectToJobRequest(i.objJobData.jobRequestId))}),t.EFF(5),t.k0s()()()}if(2&s){const e=t.XpG(4);t.R7$(3),t.SpI("",e.master.datalist.RequestNo,": "),t.R7$(2),t.SpI("",e.objJobData.jobRequestNumber," ")}}function ca(s,r){if(1&s&&(t.j41(0,"div",249)(1,"div",250)(2,"span"),t.EFF(3),t.k0s(),t.j41(4,"mat-label",273),t.EFF(5),t.k0s()()()),2&s){const e=t.XpG(4);t.R7$(3),t.SpI("",e.master.datalist.Operator,": "),t.R7$(2),t.SpI(" ",e.assetOperatorName," ")}}function pa(s,r){if(1&s&&(t.j41(0,"div",249)(1,"div",250)(2,"span"),t.EFF(3),t.k0s(),t.j41(4,"mat-label",274),t.EFF(5),t.k0s()()()),2&s){const e=t.XpG(4);t.R7$(3),t.SpI("",e.master.datalist.Depot,": "),t.R7$(2),t.SpI(" ",e.assetDepotName," ")}}function ma(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",262)(1,"div",249)(2,"div",250)(3,"span"),t.EFF(4),t.k0s(),t.j41(5,"mat-label",263)(6,"a",264),t.bIt("click",function(){t.eBV(e);const i=t.XpG(3);return t.Njj(i.redirectToAsset(i.objAssetData.id))}),t.EFF(7),t.k0s()()()(),t.j41(8,"div",249)(9,"div",250)(10,"span"),t.EFF(11),t.k0s(),t.j41(12,"mat-label",265)(13,"a",266),t.bIt("click",function(){t.eBV(e);const i=t.XpG(3);return t.Njj(i.redirectToAsset(i.objAssetData.id))}),t.EFF(14),t.k0s()()()(),t.j41(15,"div",249)(16,"div",250)(17,"span"),t.EFF(18),t.k0s(),t.j41(19,"mat-label",267),t.EFF(20),t.k0s()()(),t.j41(21,"div",249)(22,"div",250)(23,"span"),t.EFF(24),t.k0s(),t.j41(25,"mat-label",268),t.EFF(26),t.k0s()()(),t.DNE(27,la,7,3,"div",269)(28,da,6,2,"div",269)(29,ca,6,2,"div",269)(30,pa,6,2,"div",269),t.k0s()}if(2&s){const e=t.XpG(3);t.R7$(4),t.SpI("",e.master.datalist.VRM,": "),t.R7$(3),t.SpI(" ",e.objAssetData.vrm,""),t.R7$(4),t.SpI("",e.master.datalist.FleetID,": "),t.R7$(3),t.SpI(" ",e.objAssetData.fleetNumber,""),t.R7$(4),t.SpI("",e.master.datalist.Make,": "),t.R7$(2),t.SpI(" ",e.master.getMake(e.objAssetData)," "),t.R7$(4),t.SpI("",e.master.datalist.Model,": "),t.R7$(2),t.SpI(" ",e.objAssetData.model," "),t.R7$(),t.Y8G("ngIf",e.objJobData.jobNumber),t.R7$(),t.Y8G("ngIf",e.objJobData.jobRequestId&&e.objJobData.jobRequestNumber),t.R7$(),t.Y8G("ngIf",e.assetOperatorName),t.R7$(),t.Y8G("ngIf",e.assetDepotName)}}function ha(s,r){if(1&s){const e=t.RV6();t.j41(0,"button",279),t.bIt("click",function(){t.eBV(e);const i=t.XpG(4);return t.Njj(i.sendPurchaseOrderToWorkshop())}),t.EFF(1),t.k0s()}if(2&s){const e=t.XpG(4);t.Y8G("disabled",e.poSendBusy),t.R7$(),t.SpI(" ",e.poSendBusy?"Sending PO...":"Send PO"," ")}}function ua(s,r){1&s&&(t.j41(0,"button",280),t.EFF(1," Send PO "),t.k0s())}function ga(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",275)(1,"div",250)(2,"button",276),t.bIt("click",function(){t.eBV(e);const i=t.XpG(3);return t.Njj(i.showJobRequestForExistingJob())}),t.EFF(3),t.k0s(),t.DNE(4,ha,2,2,"button",277)(5,ua,2,0,"button",278),t.k0s()()}if(2&s){const e=t.XpG(3);t.R7$(3),t.SpI("",e.master.datalist.SendRequest," "),t.R7$(),t.Y8G("ngIf",e.jobId&&e.poTriggerReached),t.R7$(),t.Y8G("ngIf",e.jobId&&!e.poTriggerReached)}}function _a(s,r){1&s&&t.eu8(0)}function fa(s,r){1&s&&t.eu8(0)}function ba(s,r){1&s&&t.eu8(0)}function ka(s,r){1&s&&t.eu8(0)}function va(s,r){if(1&s&&(t.j41(0,"div",283),t.DNE(1,ka,1,0,"ng-container",284),t.k0s()),2&s){t.XpG(3);const e=t.sdS(196);t.R7$(),t.Y8G("ngTemplateOutlet",e)}}function Da(s,r){1&s&&t.eu8(0)}function Ca(s,r){1&s&&t.eu8(0)}function ja(s,r){if(1&s&&(t.j41(0,"div",281)(1,"div",282)(2,"div",283),t.DNE(3,_a,1,0,"ng-container",284),t.k0s(),t.j41(4,"div",283),t.DNE(5,fa,1,0,"ng-container",284),t.k0s()(),t.j41(6,"div",282)(7,"div",283),t.DNE(8,ba,1,0,"ng-container",284),t.k0s(),t.DNE(9,va,2,1,"div",285),t.k0s(),t.j41(10,"div",282)(11,"div",283),t.DNE(12,Da,1,0,"ng-container",284),t.k0s()(),t.j41(13,"div",282)(14,"div",286),t.DNE(15,Ca,1,0,"ng-container",284),t.k0s()()()),2&s){t.XpG(2);const e=t.sdS(192),a=t.sdS(194),i=t.sdS(198),o=t.sdS(200),n=t.sdS(202),d=t.XpG();t.R7$(3),t.Y8G("ngTemplateOutlet",o),t.R7$(2),t.Y8G("ngTemplateOutlet",n),t.R7$(3),t.Y8G("ngTemplateOutlet",a),t.R7$(),t.Y8G("ngIf",d.isExternal),t.R7$(3),t.Y8G("ngTemplateOutlet",e),t.R7$(3),t.Y8G("ngTemplateOutlet",i)}}function wa(s,r){if(1&s&&(t.j41(0,"mat-label",313),t.EFF(1),t.k0s()),2&s){const e=t.XpG(4);t.Y8G("ngStyle",t.eq3(2,$e,e.jobStatus===e.JobStatus.cancelled?"red":"")),t.R7$(),t.SpI(" ",e.lblJobHeader," ")}}function Ia(s,r){if(1&s&&(t.j41(0,"mat-label"),t.EFF(1),t.k0s()),2&s){const e=t.XpG(4);t.R7$(),t.SpI(" - ",e.totalTimeTaken," ")}}function Ra(s,r){if(1&s&&(t.j41(0,"div",314)(1,"div",315)(2,"div",316)(3,"div",317)(4,"mat-label",318),t.EFF(5),t.k0s()()()()()),2&s){const e=t.XpG(4);t.HbH(e.jobStatus==e.JobStatus.booked||e.jobStatus==e.JobStatus.planned?"width75":e.jobStatus==e.JobStatus.inprogress?"width50":"width25"),t.R7$(5),t.JRh(e.showDate(e.jobStatus))}}function Ta(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",324)(1,"mat-form-field",325)(2,"input",326),t.mxI("ngModelChange",function(i){t.eBV(e);const o=t.XpG(5);return t.DH7(o.arrivedAtVal,i)||(o.arrivedAtVal=i),t.Njj(i)}),t.k0s()()()}if(2&s){const e=t.XpG(5);t.R7$(2),t.R50("ngModel",e.arrivedAtVal)}}function Sa(s,r){if(1&s&&(t.j41(0,"div")(1,"div",315)(2,"div",319)(3,"div",317)(4,"mat-label",320),t.EFF(5),t.k0s()()(),t.j41(6,"div",321),t.DNE(7,Ta,3,1,"div",322),t.k0s(),t.j41(8,"div",323)(9,"div",317)(10,"mat-label",318),t.EFF(11),t.k0s()()()()()),2&s){const e=t.XpG(4);t.R7$(5),t.SpI(" ",e.lblJobHeader," "),t.R7$(2),t.Y8G("ngIf",!e.isExternal),t.R7$(4),t.SpI(" ",e.showDate(e.jobStatus)," ")}}function xa(s,r){1&s&&t.eu8(0)}function ya(s,r){1&s&&t.eu8(0)}function Fa(s,r){if(1&s&&(t.qex(0),t.eu8(1,335),t.bVm()),2&s){t.XpG(4);const e=t.sdS(7);t.R7$(),t.Y8G("ngTemplateOutlet",e)("ngTemplateOutletContext",t.lJ4(2,Ve))}}function Na(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",327)(1,"div",328)(2,"mat-label",329),t.EFF(3),t.k0s(),t.qex(4),t.j41(5,"div",330),t.DNE(6,xa,1,0,"ng-container",284),t.k0s(),t.bVm(),t.j41(7,"div",331)(8,"mat-form-field",184)(9,"input",332),t.mxI("ngModelChange",function(i){t.eBV(e);const o=t.XpG(4);return t.DH7(o.alternateDate,i)||(o.alternateDate=i),t.Njj(i)}),t.bIt("dateChange",function(){t.eBV(e);const i=t.XpG(4);return t.Njj(i.validateAlternateDate("compare"))}),t.k0s(),t.nrm(10,"mat-datepicker-toggle",67)(11,"mat-datepicker",null,24),t.k0s(),t.j41(13,"div",333)(14,"button",334),t.bIt("click",function(){t.eBV(e);const i=t.XpG(4);return t.Njj(i.validateAlternateDate("update"))}),t.EFF(15),t.k0s(),t.DNE(16,ya,1,0,"ng-container",284)(17,Fa,2,3,"ng-container",205),t.k0s()()()()}if(2&s){const e=t.sdS(12);t.XpG(3);const a=t.sdS(11),i=t.sdS(13),o=t.XpG();t.R7$(3),t.SpI(" ",o.master.datalist.AlternateDate,""),t.R7$(3),t.Y8G("ngTemplateOutlet",a),t.R7$(3),t.Y8G("matDatepicker",e),t.R50("ngModel",o.alternateDate),t.Y8G("min",o.master.minDate),t.R7$(),t.Y8G("for",e),t.R7$(5),t.SpI(" ",o.jobStatus===o.JobStatus.planned?o.master.datalist.ChangeDate:o.master.datalist.ProposeAlternate," "),t.R7$(),t.Y8G("ngTemplateOutlet",i),t.R7$(),t.Y8G("ngIf",o.jobStatus===o.JobStatus.planned&&o.isExternal)}}function Ja(s,r){1&s&&(t.j41(0,"span",63),t.EFF(1,"*"),t.k0s())}function Ba(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",315)(1,"div",337)(2,"div",317)(3,"mat-label",338),t.EFF(4),t.DNE(5,Ja,2,0,"span",339),t.k0s()()(),t.j41(6,"div",340)(7,"div",315)(8,"div",341)(9,"mat-form-field",342)(10,"input",343),t.mxI("ngModelChange",function(i){t.eBV(e);const o=t.XpG(5);return t.DH7(o.objJobData.usageRate,i)||(o.objJobData.usageRate=i),t.Njj(i)}),t.bIt("ngModelChange",function(){t.eBV(e);const i=t.XpG(5);return t.Njj(i.onOdometerChanged())})("change",function(i){t.eBV(e);const o=t.XpG(5);return t.Njj(o.setUsage(i))}),t.k0s()()(),t.j41(11,"div",344)(12,"mat-label",345),t.EFF(13),t.k0s()()()()()}if(2&s){const e=t.XpG(5);t.R7$(4),t.SpI(" ",e.master.datalist.Usage,""),t.R7$(),t.Y8G("ngIf",e.isExternal),t.R7$(5),t.R50("ngModel",e.objJobData.usageRate),t.Y8G("min",0)("max",9999999)("decimal",!0),t.R7$(3),t.JRh(e.assetUsageInfo.usageIn||e.master.datalist.KMS)}}function Ma(s,r){1&s&&t.eu8(0)}function Aa(s,r){if(1&s){const e=t.RV6();t.j41(0,"button",351),t.bIt("click",function(){t.eBV(e);const i=t.XpG(6);return i.jobHistoryDesc="Inprogress Job",t.Njj(i.updateJob(i.JobStatus.inprogress))}),t.EFF(1),t.k0s()}if(2&s){const e=t.XpG(6);t.Y8G("disabled",!e.canParentOrgControl),t.R7$(),t.SpI("",e.master.datalist.InProgress," ")}}function Ea(s,r){if(1&s&&(t.j41(0,"div",315),t.nrm(1,"div",346),t.j41(2,"div",340)(3,"div",347)(4,"div",348),t.DNE(5,Ma,1,0,"ng-container",284),t.k0s(),t.j41(6,"div",349),t.DNE(7,Aa,2,2,"button",350),t.k0s()()()()),2&s){t.XpG(4);const e=t.sdS(11),a=t.XpG();t.R7$(3),t.xc7("margin-top","10px"),t.R7$(2),t.Y8G("ngTemplateOutlet",e),t.R7$(2),t.Y8G("ngIf",a.jobStatus===a.JobStatus.onSite&&!a.isExternal||a.jobStatus==a.JobStatus.booked&&a.onsiteRestrictAccess)}}function Ga(s,r){if(1&s&&(t.qex(0),t.DNE(1,Ba,14,7,"div",336)(2,Ea,8,4,"div",336),t.bVm()),2&s){const e=t.XpG(4);t.R7$(),t.Y8G("ngIf",!e.isExternal||e.requiresOdometerForWorkflowStep()),t.R7$(),t.Y8G("ngIf",e.jobStatus==e.JobStatus.onSite||e.jobStatus==e.JobStatus.booked&&e.onsiteRestrictAccess)}}function Pa(s,r){if(1&s){const e=t.RV6();t.j41(0,"button",359),t.bIt("click",function(){t.eBV(e);const i=t.XpG(5);return t.Njj(i.rebuildJobPdf())}),t.EFF(1),t.k0s()}if(2&s){const e=t.XpG(5);t.R7$(),t.SpI(" ",e.master.datalist.Rebuild,"")}}function Oa(s,r){if(1&s){const e=t.RV6();t.j41(0,"button",360),t.bIt("click",function(){t.eBV(e);const i=t.XpG(5);return t.Njj(i.generatePDF())}),t.EFF(1),t.k0s()}if(2&s){const e=t.XpG(5);t.R7$(),t.JRh(e.master.datalist.CreateChargeCard)}}function La(s,r){if(1&s&&(t.j41(0,"div",352)(1,"div",353)(2,"div",354)(3,"mat-label",355),t.EFF(4),t.nI1(5,"number"),t.k0s()()(),t.j41(6,"div",356),t.DNE(7,Pa,2,1,"button",357)(8,Oa,2,1,"button",358),t.k0s()()),2&s){const e=t.XpG(4);t.R7$(2),t.AVh("pt-10",e.jobStatus===e.JobStatus.completed&&!(null!=e.master.jobInvoiced&&e.master.jobInvoiced.invoiced)),t.R7$(2),t.SpI("",t.i5U(5,5,e.InvoiceJob.invoiceAmount,"1.2-2")," "),t.R7$(3),t.Y8G("ngIf",e.master.isSuperAdmin&&e.master.isTZadmin&&(null==e.master.jobInvoiced?null:e.master.jobInvoiced.invoiced)&&e.jobStatus===e.JobStatus.completed),t.R7$(),t.Y8G("ngIf",!(null!=e.master.jobInvoiced&&e.master.jobInvoiced.invoiced))}}function $a(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",361)(1,"div",362)(2,"mat-label",363),t.EFF(3),t.k0s(),t.j41(4,"div",364)(5,"mat-form-field",184)(6,"textarea",365),t.mxI("ngModelChange",function(i){t.eBV(e);const o=t.XpG(4);return t.DH7(o.objJobData.cancellationReason,i)||(o.objJobData.cancellationReason=i),t.Njj(i)}),t.bIt("keypress",function(i){t.eBV(e);const o=t.XpG(4);return t.Njj(o.onReasonChange(i))})("change",function(){t.eBV(e);const i=t.XpG(4);return t.Njj(i.onReasonChange("change"))}),t.EFF(7,"                                        "),t.k0s()()()()()}if(2&s){const e=t.XpG(4);t.R7$(3),t.JRh(e.master.datalist.Reason),t.R7$(3),t.R50("ngModel",e.objJobData.cancellationReason)}}function Va(s,r){if(1&s&&(t.j41(0,"div",376),t.EFF(1),t.k0s()),2&s){const e=t.XpG(6);t.R7$(),t.SpI("",e.master.datalist.All," ")}}function Ha(s,r){if(1&s&&(t.j41(0,"div",376),t.EFF(1),t.k0s()),2&s){const e=t.XpG(6);t.R7$(),t.SpI(" ",e.master.datalist.Inspection,"")}}function Ya(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",372)(1,"button",373),t.bIt("click",function(){t.eBV(e);const i=t.XpG(5);return t.Njj(i.viewJobInspectionPdf())}),t.nrm(2,"img",374),t.k0s(),t.DNE(3,Va,2,1,"div",375)(4,Ha,2,1,"div",375),t.k0s()}if(2&s){const e=t.XpG(5);t.R7$(3),t.Y8G("ngIf",!e.objJobData.maintenanceRepairDocId),t.R7$(),t.Y8G("ngIf",e.objJobData.maintenanceRepairDocId)}}function Ua(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",372)(1,"button",377),t.bIt("click",function(){t.eBV(e);const i=t.XpG(5);return t.Njj(i.viewJobMaintenanceAndDefectRepairTaskPdf())}),t.nrm(2,"img",374),t.k0s(),t.j41(3,"div",376),t.EFF(4),t.k0s()()}if(2&s){const e=t.XpG(5);t.R7$(4),t.JRh(e.master.datalist.Maintenance)}}function Xa(s,r){if(1&s){const e=t.RV6();t.qex(0),t.j41(1,"button",378),t.bIt("click",function(){t.eBV(e);const i=t.XpG(5);return t.Njj(i.viewpdf())}),t.nrm(2,"img",374),t.k0s(),t.j41(3,"div",376),t.EFF(4,"Charge Card"),t.k0s(),t.bVm()}}function Wa(s,r){if(1&s){const e=t.RV6();t.j41(0,"button",379),t.bIt("click",function(){t.eBV(e);const i=t.XpG(5);return t.Njj(i.rebuildJobPdf())}),t.EFF(1),t.k0s()}if(2&s){const e=t.XpG(5);t.R7$(),t.SpI(" ",e.master.datalist.Rebuild,"")}}function qa(s,r){if(1&s&&(t.j41(0,"div",366)(1,"div",367)(2,"div",368),t.DNE(3,Ya,5,2,"div",369)(4,Ua,5,1,"div",369),t.j41(5,"div",370),t.DNE(6,Xa,5,0,"ng-container",205)(7,Wa,2,1,"button",371),t.k0s()()()()),2&s){const e=t.XpG(4);t.R7$(3),t.Y8G("ngIf",e.objJobData.documentId),t.R7$(),t.Y8G("ngIf",e.objJobData.maintenanceRepairDocId),t.R7$(2),t.Y8G("ngIf",null==e.master.jobInvoiced?null:e.master.jobInvoiced.invoiced),t.R7$(),t.Y8G("ngIf",e.master.isSuperAdmin&&e.master.isTZadmin&&!(null!=e.master.jobInvoiced&&e.master.jobInvoiced.invoiced)&&e.jobStatus===e.JobStatus.completed)}}function za(s,r){1&s&&t.eu8(0)}function Qa(s,r){if(1&s&&(t.qex(0),t.DNE(1,za,1,0,"ng-container",284),t.bVm()),2&s){t.XpG(4);const e=t.sdS(11);t.R7$(),t.Y8G("ngTemplateOutlet",e)}}function Ka(s,r){if(1&s){const e=t.RV6();t.j41(0,"button",385),t.bIt("click",function(){t.eBV(e);const i=t.XpG(5);return i.jobHistoryDesc="Vehicle On Site",t.Njj(i.updateJob(i.JobStatus.onSite))}),t.EFF(1),t.k0s()}if(2&s){const e=t.XpG(5);t.Y8G("disabled",!e.canParentOrgControl),t.R7$(),t.SpI(" ",e.master.datalist.OnSite,"")}}function Za(s,r){if(1&s&&(t.qex(0),t.eu8(1,335),t.bVm()),2&s){t.XpG(4);const e=t.sdS(7);t.R7$(),t.Y8G("ngTemplateOutlet",e)("ngTemplateOutletContext",t.lJ4(2,nt))}}function ti(s,r){if(1&s&&(t.qex(0),t.eu8(1,335),t.bVm()),2&s){t.XpG(4);const e=t.sdS(9);t.R7$(),t.Y8G("ngTemplateOutlet",e)("ngTemplateOutletContext",t.lJ4(2,nt))}}function ei(s,r){if(1&s&&(t.qex(0),t.eu8(1,335),t.bVm()),2&s){t.XpG(4);const e=t.sdS(5);t.R7$(),t.Y8G("ngTemplateOutlet",e)("ngTemplateOutletContext",t.lJ4(2,nt))}}function ai(s,r){if(1&s&&(t.j41(0,"div",317)(1,"div",347)(2,"mat-label",320),t.EFF(3),t.k0s()()()),2&s){const e=t.XpG(5);t.xc7("margin-top","10px"),t.R7$(3),t.SpI(" ",e.master.datalist.BackDatedJob," ")}}function ii(s,r){if(1&s){const e=t.RV6();t.j41(0,"button",388),t.bIt("click",function(){t.eBV(e);const i=t.XpG(6);return t.Njj(i.requireSupervisorSignoff())}),t.EFF(1," Close Job"),t.k0s()}}function oi(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",347)(1,"button",386),t.bIt("click",function(){t.eBV(e);const i=t.XpG(5);return t.Njj(i.showModal("showBackDateReason"))}),t.EFF(2," View Details"),t.k0s(),t.DNE(3,ii,2,0,"button",387),t.k0s()}if(2&s){const e=t.XpG(5);t.xc7("margin-top","10px"),t.R7$(3),t.Y8G("ngIf",e.jobStatus!==e.JobStatus.completed)}}function si(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",389)(1,"button",390),t.bIt("click",function(){t.eBV(e);const i=t.XpG(5);return t.Njj(i.addbackdateReason())}),t.EFF(2," Backdate & close"),t.k0s()()}2&s&&t.xc7("margi
1n-top","10px")}function ni(s,r){if(1&s&&(t.j41(0,"div")(1,"span",380)(2,"div",347),t.DNE(3,Qa,2,1,"ng-container",205)(4,Ka,2,2,"button",381)(5,Za,2,3,"ng-container",205)(6,ti,2,3,"ng-container",205)(7,ei,2,3,"ng-container",205),t.k0s(),t.DNE(8,ai,4,3,"div",382)(9,oi,4,3,"div",383)(10,si,3,2,"div",384),t.k0s()()),2&s){const e=t.XpG(4);t.R7$(2),t.xc7("margin-top","10px"),t.R7$(),t.Y8G("ngIf",e.jobStatus!==e.JobStatus.onSite&&e.jobStatus!==e.JobStatus.planned&&e.checkJobStatus&&!e.checkCompanyAndJobStatus),t.R7$(),t.Y8G("ngIf",e.jobStatus===e.JobStatus.booked&&!e.isExternal&&!e.onsiteRestrictAccess),t.R7$(),t.Y8G("ngIf",e.jobStatus===e.JobStatus.awaitingSignoff||e.jobStatus===e.JobStatus.booked&&e.isExternal),t.R7$(),t.Y8G("ngIf",e.jobStatus===e.JobStatus.awaitingSignoff&&!e.isExternal),t.R7$(),t.Y8G("ngIf",e.jobStatus===e.JobStatus.inprogress&&!e.isExternal),t.R7$(),t.Y8G("ngIf",e.checkBackdateRolePermission()&&e.objJobData.backdatedJob&&e.jobStatus!==e.JobStatus.onShow),t.R7$(),t.Y8G("ngIf",e.checkBackdateRolePermission()&&e.objJobData.backdatedJob&&e.jobStatus!==e.JobStatus.onShow),t.R7$(),t.Y8G("ngIf",e.checkBackdateRolePermission()&&!e.objJobData.backdatedJob&&e.jobStatus!==e.JobStatus.completed&&e.jobStatus!==e.JobStatus.onShow)}}function ri(s,r){if(1&s){const e=t.RV6();t.j41(0,"button",394),t.bIt("click",function(){t.eBV(e);const i=t.XpG(5);return t.Njj(i.updateJob(i.JobStatus.cancelled))}),t.EFF(1),t.k0s()}if(2&s){const e=t.XpG(5);t.R7$(),t.SpI(" ",e.master.datalist.Save," ")}}function li(s,r){if(1&s){const e=t.RV6();t.j41(0,"div")(1,"span",391),t.DNE(2,ri,2,1,"button",392),t.j41(3,"button",393),t.bIt("click",function(){t.eBV(e);const i=t.XpG(4);return t.Njj(i.reBookJob())}),t.EFF(4),t.k0s()()()}if(2&s){const e=t.XpG(4);t.R7$(2),t.Y8G("ngIf",e.blnupdateCancelReason),t.R7$(2),t.JRh(e.master.datalist.ReBook)}}function di(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",400),t.nrm(1,"img",401),t.j41(2,"img",402),t.bIt("click",function(){t.eBV(e);const i=t.XpG(5);return t.Njj(i.saveSignToJob())}),t.k0s()()}}function ci(s,r){if(1&s&&(t.j41(0,"div",403),t.nrm(1,"img",404),t.k0s()),2&s){const e=t.XpG(5);t.R7$(),t.Y8G("src",e.supervisorSign,t.B4B)}}function pi(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",400)(1,"div",405)(2,"img",406),t.bIt("click",function(){t.eBV(e);const i=t.XpG(5);return t.Njj(i.showSignPadClick())}),t.k0s()()()}}function mi(s,r){if(1&s&&(t.j41(0,"div",395)(1,"div",208)(2,"mat-label",396),t.EFF(3),t.k0s(),t.j41(4,"div",397),t.DNE(5,di,3,0,"div",398)(6,ci,2,1,"div",399)(7,pi,3,0,"div",398),t.k0s()()()),2&s){const e=t.XpG(4);t.R7$(3),t.SpI("",e.master.datalist.Supervisor," "),t.R7$(2),t.Y8G("ngIf",(null==e.master.userInfo?null:e.master.userInfo.signature)&&!(null!=e.objJobData&&e.objJobData.supervisorSigned)),t.R7$(),t.Y8G("ngIf",null==e.objJobData?null:e.objJobData.supervisorSigned),t.R7$(),t.Y8G("ngIf",!(null!=e.master.userInfo&&e.master.userInfo.signature||null!=e.objJobData&&e.objJobData.supervisorSigned))}}function hi(s,r){if(1&s&&(t.j41(0,"div",287)(1,"div",288)(2,"div")(3,"div",289)(4,"span",290),t.EFF(5,"Price:"),t.k0s(),t.j41(6,"span"),t.EFF(7),t.k0s()(),t.j41(8,"div",289)(9,"span",291),t.EFF(10,"Tax:"),t.k0s(),t.j41(11,"span"),t.EFF(12),t.k0s()(),t.j41(13,"div",292)(14,"span",293),t.EFF(15,"Total Price:"),t.k0s(),t.j41(16,"span"),t.EFF(17),t.k0s()(),t.nrm(18,"hr"),t.j41(19,"div",294)(20,"div",295)(21,"label",296),t.EFF(22,"Approval Group"),t.j41(23,"span",297)(24,"mat-icon",298),t.EFF(25),t.k0s()()()(),t.j41(26,"div",208)(27,"mat-form-field",65),t.nrm(28,"input",299),t.k0s()()()()(),t.j41(29,"div",300)(30,"div",301)(31,"mat-card",302)(32,"mat-card-header",303),t.DNE(33,wa,2,4,"mat-label",304)(34,Ia,2,1,"mat-label",205)(35,Ra,6,3,"div",305)(36,Sa,12,3,"div",205),t.k0s(),t.j41(37,"mat-card-content",306),t.nrm(38,"mat-divider",307),t.DNE(39,Na,18,9,"div",308)(40,Ga,3,2,"ng-container",205)(41,La,9,8,"div",309)(42,$a,8,2,"div",310),t.k0s(),t.j41(43,"mat-card-actions",311),t.DNE(44,qa,8,4,"div",312)(45,ni,11,10,"div",205)(46,li,5,2,"div",205)(47,mi,8,4,"div",72),t.k0s()()()()()),2&s){const e=t.XpG(3);t.R7$(7),t.Lme("",e.matchedRule.currencySymbol,"",e.totlPartsPrice,""),t.R7$(5),t.E5c("",e.matchedRule.currencySymbol,"",e.totlPartsTax," @",e.totlPartsTaxPercent,"%"),t.R7$(5),t.Lme("",e.matchedRule.currencySymbol,"",e.totlPartsPriceWithTax,""),t.R7$(7),t.FS9("matTooltip",e.matchedRule.nameListStr),t.R7$(),t.JRh("info_outline"),t.R7$(3),t.Y8G("ngModel",e.matchedRule.rule),t.R7$(4),t.AVh("onSite",e.jobStatus==e.JobStatus.onSite||e.jobStatus==e.JobStatus.booked&&e.onsiteRestrictAccess),t.R7$(),t.Y8G("ngIf",!(e.jobStatus==e.JobStatus.booked&&e.onsiteRestrictAccess)&&e.jobStatus!==e.JobStatus.onSite),t.R7$(),t.Y8G("ngIf",(e.jobStatus==e.JobStatus.inprogress||e.jobStatus==e.JobStatus.completed||e.jobStatus==e.JobStatus.awaitingSignoff)&&!e.isExternal),t.R7$(),t.Y8G("ngIf",!(e.jobStatus==e.JobStatus.booked&&e.onsiteRestrictAccess)&&e.jobStatus!==e.JobStatus.onSite),t.R7$(),t.Y8G("ngIf",e.jobStatus==e.JobStatus.onSite||e.jobStatus==e.JobStatus.booked&&e.onsiteRestrictAccess),t.R7$(3),t.Y8G("ngIf",e.jobStatus==e.JobStatus.planned),t.R7$(),t.Y8G("ngIf",e.jobStatus==e.JobStatus.onSite||e.jobStatus==e.JobStatus.booked&&e.onsiteRestrictAccess||e.requiresOdometerForWorkflowStep()),t.R7$(),t.Y8G("ngIf",e.jobStatus==e.JobStatus.completed),t.R7$(),t.Y8G("ngIf",e.jobStatus==e.JobStatus.cancelled),t.R7$(2),t.Y8G("ngIf",e.jobStatus>=e.JobStatus.completed),t.R7$(),t.Y8G("ngIf",e.jobStatus!=e.JobStatus.unplanned&&e.jobStatus!=e.JobStatus.cancelled),t.R7$(),t.Y8G("ngIf",e.jobStatus===e.JobStatus.cancelled),t.R7$(),t.Y8G("ngIf",e.showSupervisorSign)}}function ui(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",241),t.DNE(1,ia,3,2,"div",242),t.j41(2,"div",243)(3,"div",244),t.DNE(4,na,3,2,"div",245)(5,ma,31,12,"div",246)(6,ga,6,3,"div",247),t.k0s(),t.j41(7,"div",248)(8,"div",249)(9,"div",250)(10,"mat-icon",251),t.bIt("keypress",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.manualyReloadThePage())})("click",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.manualyReloadThePage())}),t.EFF(11),t.k0s()()()()(),t.j41(12,"div",209),t.DNE(13,ja,16,6,"div",252)(14,hi,48,24,"div",253),t.k0s()()}if(2&s){const e=t.XpG(2);t.R7$(),t.Y8G("ngIf",e.isBookingDataUpdated),t.R7$(3),t.Y8G("ngIf",e.jobId&&!e.isUpdatingJobTask),t.R7$(),t.Y8G("ngIf",e.jobId&&!e.isUpdatingJobTask),t.R7$(),t.Y8G("ngIf",e.jobStatus!==e.JobStatus.completed&&e.isExternal),t.R7$(5),t.JRh(e.matIconNames.refresh),t.R7$(2),t.Y8G("ngIf",e.jobId&&!e.isUpdatingJobTask),t.R7$(),t.Y8G("ngIf",e.jobId&&!e.isUpdatingJobTask)}}function gi(s,r){if(1&s){const e=t.RV6();t.j41(0,"button",407),t.bIt("click",function(){t.eBV(e);const i=t.XpG(2);return i.jobHistoryDesc="Waiting for Sign off Job",t.Njj(i.updateJob(i.JobStatus.awaitingSignoff))}),t.EFF(1),t.k0s()}if(2&s){const e=r.className,a=t.XpG(2);t.HbH(e),t.Y8G("disabled",!a.canParentOrgControl),t.R7$(),t.JRh(a.master.datalist.AwaitingSignOff)}}function _i(s,r){if(1&s){const e=t.RV6();t.j41(0,"button",408),t.bIt("click",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.jobCompletionDatePopup())}),t.EFF(1),t.k0s()}if(2&s){const e=r.className,a=t.XpG(2);t.HbH(e),t.Y8G("disabled",!a.canParentOrgControl),t.R7$(),t.JRh(a.master.datalist.Complete)}}function fi(s,r){if(1&s){const e=t.RV6();t.j41(0,"button",409),t.bIt("click",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.openCompletedTaskSheetsForReview())}),t.EFF(1,"Review"),t.k0s()}if(2&s){const e=r.className,a=t.XpG(2);t.HbH(e),t.Y8G("disabled",!a.canParentOrgControl)}}function bi(s,r){if(1&s){const e=t.RV6();t.j41(0,"button",411),t.bIt("click",function(){t.eBV(e);const i=t.XpG(3);return t.Njj(i.cancelJob("showCancelReason"))}),t.EFF(1),t.k0s()}if(2&s){const e=t.XpG(3);t.R7$(),t.JRh(e.master.datalist.Cancel)}}function ki(s,r){if(1&s&&t.DNE(0,bi,2,1,"button",410),2&s){const e=t.XpG(2);t.Y8G("ngIf",e.checkJobStatus)}}function vi(s,r){if(1&s){const e=t.RV6();t.j41(0,"button",413),t.bIt("click",function(){t.eBV(e);const i=t.XpG(3);return i.jobHistoryDesc="Accepted Booking",t.Njj(i.updateJob(i.JobStatus.booked))}),t.EFF(1),t.k0s()}if(2&s){const e=t.XpG(3);t.Y8G("disabled",!e.canParentOrgControl),t.R7$(),t.SpI("",e.master.datalist.ConfirmBooking," ")}}function Di(s,r){if(1&s&&t.DNE(0,vi,2,2,"button",412),2&s){const e=t.XpG(2);t.Y8G("ngIf",e.jobStatus===e.JobStatus.planned&&!e.isExternal)}}function Ci(s,r){if(1&s&&t.nrm(0,"div",423),2&s){const e=t.XpG().index,a=t.XpG(3);t.Y8G("ngClass",t.eq3(1,A,e<=a.selectedTab-1?"highlightColor":"mainColor"))}}function ji(s,r){if(1&s&&(t.j41(0,"div",417)(1,"div",418)(2,"div",419)(3,"h1",420),t.EFF(4),t.k0s(),t.nrm(5,"h2"),t.j41(6,"h3",421),t.EFF(7),t.k0s()()(),t.DNE(8,Ci,1,3,"div",422),t.k0s()),2&s){const e=r.$implicit,a=r.index,i=t.XpG(3);t.R7$(2),t.Y8G("ngClass",t.eq3(4,A,a<=i.selectedTab?"highlightColor":"mainColor")),t.R7$(2),t.JRh(a+1),t.R7$(3),t.JRh(e.name),t.R7$(),t.Y8G("ngIf",a<i.totalWizard.length-1)}}function wi(s,r){if(1&s&&(t.j41(0,"div",233),t.nrm(1,"div",346),t.j41(2,"div",414)(3,"div",315),t.DNE(4,ji,9,6,"div",415),t.k0s()(),t.nrm(5,"div",416),t.k0s()),2&s){const e=t.XpG(2);t.R7$(4),t.Y8G("ngForOf",e.totalWizard)}}function Ii(s,r){if(1&s&&(t.j41(0,"span",424),t.EFF(1),t.k0s()),2&s){const e=t.XpG(2);t.R7$(),t.JRh(e.partsCount)}}function Ri(s,r){1&s&&t.eu8(0)}function Ti(s,r){if(1&s&&t.DNE(0,Ri,1,0,"ng-container",284),2&s){t.XpG(2);const e=t.sdS(32);t.Y8G("ngTemplateOutlet",e)}}function Si(s,r){1&s&&(t.j41(0,"mat-tab",425),t.DNE(1,Ti,1,1,"ng-template",111),t.k0s())}function xi(s,r){1&s&&t.eu8(0)}function yi(s,r){1&s&&t.eu8(0)}function Fi(s,r){1&s&&t.eu8(0)}function Ni(s,r){if(1&s&&(t.j41(0,"div",427)(1,"div",428),t.DNE(2,xi,1,0,"ng-container",284),t.j41(3,"div",429)(4,"div",430),t.DNE(5,yi,1,0,"ng-container",284),t.k0s(),t.DNE(6,Fi,1,0,"ng-container",284),t.k0s()()()),2&s){t.XpG(2);const e=t.sdS(34),a=t.sdS(206),i=t.sdS(208),o=t.XpG();t.R7$(2),t.Y8G("ngTemplateOutlet",e),t.R7$(),t.Y8G("ngClass",t.eq3(4,A,!o.jobId||o.isUpdatingJobTask?"createjob-custwidth":"")),t.R7$(2),t.Y8G("ngTemplateOutlet",i),t.R7$(),t.Y8G("ngTemplateOutlet",a)}}function Ji(s,r){if(1&s&&(t.j41(0,"mat-tab",426),t.DNE(1,Ni,7,6,"ng-template",111),t.k0s()),2&s){const e=t.XpG(2);t.Y8G("disabled",!e.assetId)}}function Bi(s,r){1&s&&t.eu8(0)}function Mi(s,r){1&s&&(t.j41(0,"mat-icon",454),t.EFF(1," check_circle"),t.k0s())}function Ai(s,r){1&s&&(t.j41(0,"mat-icon",455),t.EFF(1," circle "),t.k0s())}function Ei(s,r){if(1&s&&(t.j41(0,"mat-option",130),t.EFF(1),t.k0s()),2&s){const e=r.$implicit;t.Y8G("value",e.id),t.R7$(),t.SpI(" ",e.value," ")}}function Gi(s,r){if(1&s&&(t.j41(0,"mat-option",130),t.EFF(1),t.k0s()),2&s){const e=r.$implicit;t.Y8G("value",e.id),t.R7$(),t.SpI(" ",e.value," ")}}function Pi(s,r){if(1&s){const e=t.RV6();t.j41(0,"button",456),t.bIt("click",function(){t.eBV(e);const i=t.XpG().$implicit,o=t.XpG(4);return o.addRemoveFromTask(!0,i),t.Njj(o.dataModified())}),t.EFF(1),t.k0s()}if(2&s){const e=t.XpG(5);t.R7$(),t.SpI(" ",e.master.datalist.AddToJob,"")}}function Oi(s,r){if(1&s){const e=t.RV6();t.j41(0,"button",457),t.bIt("click",function(){t.eBV(e);const i=t.XpG().$implicit,o=t.XpG(4);return t.Njj(o.addRemoveFromTask(!1,i))}),t.EFF(1),t.k0s()}if(2&s){const e=t.XpG(5);t.R7$(),t.JRh(e.master.datalist.Remove)}}function Li(s,r){if(1&s){const e=t.RV6();t.j41(0,"div")(1,"mat-card",437)(2,"mat-card-header",438)(3,"div",439)(4,"div",173),t.DNE(5,Mi,2,0,"mat-icon",440)(6,Ai,2,0,"mat-icon",441),t.k0s()(),t.j41(7,"mat-card-subtitle",442),t.EFF(8),t.k0s(),t.j41(9,"mat-card-subtitle",443),t.EFF(10),t.k0s()(),t.j41(11,"mat-card-content",444)(12,"div",433)(13,"div",208)(14,"div",445)(15,"div",173)(16,"mat-form-field",446)(17,"mat-select",447),t.mxI("ngModelChange",function(i){const o=t.eBV(e).$implicit;return t.DH7(o.workstationID,i)||(o.workstationID=i),t.Njj(i)}),t.bIt("selectionChange",function(i){const o=t.eBV(e).$implicit,n=t.XpG(4);return t.Njj(n.onchangeWorkStation(i.value,o))}),t.j41(18,"mat-option",130),t.EFF(19," Select workstation"),t.k0s(),t.DNE(20,Ei,2,2,"mat-option",448),t.k0s()()()(),t.j41(21,"div",433)(22,"div",445)(23,"div",173)(24,"mat-form-field",446)(25,"mat-select",447),t.mxI("ngModelChange",function(i){const o=t.eBV(e).$implicit;return t.DH7(o.foremanID,i)||(o.foremanID=i),t.Njj(i)}),t.bIt("selectionChange",function(i){const o=t.eBV(e).$implicit,n=t.XpG(4);return t.Njj(n.onchangeEngineer(i.value,o))}),t.j41(26,"mat-option",130),t.EFF(27," Select engineer"),t.k0s(),t.DNE(28,Gi,2,2,"mat-option",448),t.k0s()()()()()(),t.j41(29,"div",449)(30,"div",450)(31,"button",451),t.bIt("click",function(){const i=t.eBV(e).$implicit,o=t.XpG(4);
1return t.Njj(o.viewTaskDetails(i))}),t.EFF(32),t.k0s(),t.DNE(33,Pi,2,1,"button",452)(34,Oi,2,1,"button",453),t.k0s()()()()()()}if(2&s){const e=r.$implicit,a=r.index,i=t.XpG(4);t.R7$(5),t.Y8G("ngIf",e.checked),t.R7$(),t.Y8G("ngIf",!e.checked),t.R7$(),t.FS9("matTooltip",e.name),t.R7$(),t.SpI(" ",e.name," "),t.R7$(2),t.SpI("",i.master.datalist.Raisedby,":"),t.R7$(7),t.Mz_("id","selInspecWorkstation",a,""),t.R50("ngModel",e.workstationID),t.R7$(),t.Y8G("value",""),t.R7$(2),t.Y8G("ngForOf",e.workstationList)("ngForTrackBy",i.trackByWorkstation),t.R7$(5),t.Mz_("id","selInspecEngineer",a,""),t.R50("ngModel",e.foremanID),t.R7$(),t.Y8G("value",""),t.R7$(2),t.Y8G("ngForOf",e.userList)("ngForTrackBy",i.trackByUser),t.R7$(4),t.SpI(" ",i.master.datalist.ViewDetails,""),t.R7$(),t.Y8G("ngIf",!e.checked),t.R7$(),t.Y8G("ngIf",e.checked)}}function $i(s,r){1&s&&(t.j41(0,"mat-icon",454),t.EFF(1," check_circle"),t.k0s())}function Vi(s,r){1&s&&(t.j41(0,"mat-icon",455),t.EFF(1," circle "),t.k0s())}function Hi(s,r){if(1&s&&(t.j41(0,"mat-option",130),t.EFF(1),t.k0s()),2&s){const e=r.$implicit;t.Y8G("value",e.id),t.R7$(),t.SpI(" ",e.value," ")}}function Yi(s,r){if(1&s&&(t.j41(0,"mat-option",130),t.EFF(1),t.k0s()),2&s){const e=r.$implicit;t.Y8G("value",e.id),t.R7$(),t.SpI(" ",e.value," ")}}function Ui(s,r){if(1&s){const e=t.RV6();t.j41(0,"button",463),t.bIt("click",function(){t.eBV(e);const i=t.XpG().$implicit,o=t.XpG(4);return t.Njj(o.addParts(i))}),t.EFF(1),t.k0s()}if(2&s){const e=t.XpG(5);t.R7$(),t.SpI(" ",e.master.datalist.JobAddParts,"")}}function Xi(s,r){if(1&s&&(t.j41(0,"button",464),t.EFF(1),t.k0s()),2&s){const e=t.XpG(5);t.R7$(),t.SpI(" ",e.master.datalist.JobAddParts,"")}}function Wi(s,r){if(1&s){const e=t.RV6();t.j41(0,"button",465),t.bIt("click",function(){t.eBV(e);const i=t.XpG().$implicit,o=t.XpG(4);return o.addRemoveFromTask(!0,i),t.Njj(o.dataModified())}),t.EFF(1),t.k0s()}if(2&s){const e=t.XpG(5);t.R7$(),t.SpI(" ",e.master.datalist.AddToJob,"")}}function qi(s,r){if(1&s){const e=t.RV6();t.j41(0,"button",466),t.bIt("click",function(){t.eBV(e);const i=t.XpG().$implicit,o=t.XpG(4);return t.Njj(o.addRemoveFromTask(!1,i))}),t.EFF(1),t.k0s()}if(2&s){const e=t.XpG(5);t.R7$(),t.JRh(e.master.datalist.Remove)}}function zi(s,r){if(1&s){const e=t.RV6();t.j41(0,"div")(1,"mat-card",437)(2,"mat-card-header",438)(3,"div",439)(4,"div",173),t.DNE(5,$i,2,0,"mat-icon",440)(6,Vi,2,0,"mat-icon",441),t.k0s()(),t.j41(7,"mat-card-subtitle",442),t.EFF(8),t.k0s(),t.j41(9,"mat-card-subtitle",443),t.EFF(10),t.k0s()(),t.j41(11,"mat-card-content",444)(12,"div",433)(13,"div",208)(14,"div",445)(15,"div",173)(16,"mat-form-field",446)(17,"mat-select",447),t.mxI("ngModelChange",function(i){const o=t.eBV(e).$implicit;return t.DH7(o.workstationID,i)||(o.workstationID=i),t.Njj(i)}),t.bIt("selectionChange",function(i){const o=t.eBV(e).$implicit,n=t.XpG(4);return t.Njj(n.onchangeWorkStation(i.value,o))}),t.j41(18,"mat-option",130),t.EFF(19," Select workstation"),t.k0s(),t.DNE(20,Hi,2,2,"mat-option",448),t.k0s()()()(),t.j41(21,"div",433)(22,"div",445)(23,"div",173)(24,"mat-form-field",446)(25,"mat-select",447),t.mxI("ngModelChange",function(i){const o=t.eBV(e).$implicit;return t.DH7(o.foremanID,i)||(o.foremanID=i),t.Njj(i)}),t.bIt("selectionChange",function(i){const o=t.eBV(e).$implicit,n=t.XpG(4);return t.Njj(n.onchangeEngineer(i.value,o))}),t.j41(26,"mat-option",130),t.EFF(27," Select engineer"),t.k0s(),t.DNE(28,Yi,2,2,"mat-option",448),t.k0s()()()()()(),t.j41(29,"div",449)(30,"div",450),t.DNE(31,Ui,2,1,"button",458)(32,Xi,2,1,"button",459),t.j41(33,"button",460),t.bIt("click",function(){const i=t.eBV(e).$implicit,o=t.XpG(4);return t.Njj(o.viewTaskDetails(i))}),t.EFF(34),t.k0s(),t.DNE(35,Wi,2,1,"button",461)(36,qi,2,1,"button",462),t.k0s()()()()()()}if(2&s){const e=r.$implicit,a=r.index,i=t.XpG(4);t.R7$(5),t.Y8G("ngIf",e.checked),t.R7$(),t.Y8G("ngIf",!e.checked),t.R7$(),t.FS9("matTooltip",e.name),t.R7$(),t.SpI(" ",e.name," "),t.R7$(2),t.SpI("",i.master.datalist.Raisedby,":"),t.R7$(7),t.Mz_("id","selMaintenanceWorkstation",a,""),t.R50("ngModel",e.workstationID),t.R7$(),t.Y8G("value",""),t.R7$(2),t.Y8G("ngForOf",e.workstationList)("ngForTrackBy",i.trackByWorkstation),t.R7$(5),t.Mz_("id","selMaintenanceEngineer",a,""),t.R50("ngModel",e.foremanID),t.R7$(),t.Y8G("value",""),t.R7$(2),t.Y8G("ngForOf",e.userList)("ngForTrackBy",i.trackByUser),t.R7$(3),t.Y8G("ngIf",e.checked),t.R7$(),t.Y8G("ngIf",!e.checked),t.R7$(2),t.SpI(" ",i.master.datalist.ViewDetails,""),t.R7$(),t.Y8G("ngIf",!e.checked),t.R7$(),t.Y8G("ngIf",e.checked)}}function Qi(s,r){1&s&&(t.j41(0,"mat-icon",454),t.EFF(1," check_circle"),t.k0s())}function Ki(s,r){1&s&&(t.j41(0,"mat-icon",455),t.EFF(1," circle "),t.k0s())}function Zi(s,r){if(1&s&&(t.j41(0,"mat-option",130),t.EFF(1),t.k0s()),2&s){const e=r.$implicit;t.Y8G("value",e.id),t.R7$(),t.SpI(" ",e.value," ")}}function to(s,r){if(1&s&&(t.j41(0,"mat-option",130),t.EFF(1),t.k0s()),2&s){const e=r.$implicit;t.Y8G("value",e.id),t.R7$(),t.SpI(" ",e.value," ")}}function eo(s,r){if(1&s){const e=t.RV6();t.j41(0,"button",474),t.bIt("click",function(){t.eBV(e);const i=t.XpG(2).$implicit,o=t.XpG(4);return t.Njj(o.addParts(i))}),t.EFF(1),t.k0s()}if(2&s){const e=t.XpG(6);t.R7$(),t.SpI(" ",e.master.datalist.JobAddParts,"")}}function ao(s,r){if(1&s&&(t.j41(0,"button",475),t.EFF(1),t.k0s()),2&s){const e=t.XpG(6);t.R7$(),t.SpI(" ",e.master.datalist.JobAddParts,"")}}function io(s,r){if(1&s){const e=t.RV6();t.j41(0,"button",476),t.bIt("click",function(){t.eBV(e);const i=t.XpG(2).$implicit,o=t.XpG(4);return o.addRemoveRepairFromTask(!0,i),t.Njj(o.dataModified())}),t.EFF(1),t.k0s()}if(2&s){const e=t.XpG(6);t.R7$(),t.SpI(" ",e.master.datalist.AddToJob,"")}}function oo(s,r){if(1&s){const e=t.RV6();t.j41(0,"button",477),t.bIt("click",function(){t.eBV(e);const i=t.XpG(2).$implicit,o=t.XpG(4);return t.Njj(o.addRemoveRepairFromTask(!1,i))}),t.EFF(1),t.k0s()}if(2&s){const e=t.XpG(6);t.R7$(),t.JRh(e.master.datalist.Remove)}}function so(s,r){if(1&s){const e=t.RV6();t.j41(0,"mat-card",437)(1,"mat-card-header",438)(2,"div",439)(3,"div",173),t.DNE(4,Qi,2,0,"mat-icon",440)(5,Ki,2,0,"mat-icon",441),t.k0s()(),t.j41(6,"mat-card-subtitle",442),t.EFF(7),t.k0s(),t.j41(8,"mat-card-subtitle"),t.EFF(9),t.k0s()(),t.j41(10,"mat-card-content",444)(11,"div",433)(12,"div",208)(13,"div",445)(14,"div",173)(15,"mat-form-field",446)(16,"mat-select",447),t.mxI("ngModelChange",function(i){t.eBV(e);const o=t.XpG().$implicit;return t.DH7(o.workstationID,i)||(o.workstationID=i),t.Njj(i)}),t.bIt("selectionChange",function(i){t.eBV(e);const o=t.XpG().$implicit,n=t.XpG(4);return t.Njj(n.onchangeWorkStation(i.value,o))}),t.j41(17,"mat-option",130),t.EFF(18," Select workstation"),t.k0s(),t.DNE(19,Zi,2,2,"mat-option",448),t.k0s()()()(),t.j41(20,"div",433)(21,"div",445)(22,"div",173)(23,"mat-form-field",446)(24,"mat-select",447),t.mxI("ngModelChange",function(i){t.eBV(e);const o=t.XpG().$implicit;return t.DH7(o.foremanID,i)||(o.foremanID=i),t.Njj(i)}),t.bIt("selectionChange",function(i){t.eBV(e);const o=t.XpG().$implicit,n=t.XpG(4);return t.Njj(n.onchangeEngineer(i.value,o))}),t.j41(25,"mat-option",130),t.EFF(26," Select engineer"),t.k0s(),t.DNE(27,to,2,2,"mat-option",448),t.k0s()()()()()(),t.j41(28,"div",449)(29,"div",450),t.DNE(30,eo,2,1,"button",469)(31,ao,2,1,"button",470),t.j41(32,"button",471),t.bIt("click",function(){t.eBV(e);const i=t.XpG().$implicit,o=t.XpG(4);
1return t.Njj(o.viewDefectReapirTaskDetails(i))}),t.EFF(33),t.k0s(),t.DNE(34,io,2,1,"button",472)(35,oo,2,1,"button",473),t.k0s()()()()()}if(2&s){const e=t.XpG(),a=e.$implicit,i=e.index,o=t.XpG(4);t.R7$(4),t.Y8G("ngIf",a.checked),t.R7$(),t.Y8G("ngIf",!a.checked),t.R7$(),t.FS9("matTooltip",a.name),t.R7$(),t.SpI(" ",a.name," "),t.R7$(2),t.Lme("",o.master.datalist.Raisedby,": ",a.defectRaisedBy," "),t.R7$(7),t.Mz_("id","selRepairWorkstation",i,""),t.R50("ngModel",a.workstationID),t.R7$(),t.Y8G("value",""),t.R7$(2),t.Y8G("ngForOf",a.workstationList)("ngForTrackBy",o.trackByWorkstation),t.R7$(5),t.Mz_("id","selRepairEngineer",i,""),t.R50("ngModel",a.foremanID),t.R7$(),t.Y8G("value",""),t.R7$(2),t.Y8G("ngForOf",a.userList)("ngForTrackBy",o.trackByUser),t.R7$(3),t.Y8G("ngIf",a.checked),t.R7$(),t.Y8G("ngIf",!a.checked),t.R7$(2),t.SpI(" ",o.master.datalist.ViewDetails,""),t.R7$(),t.Y8G("ngIf",!a.checked),t.R7$(),t.Y8G("ngIf",a.checked)}}function no(s,r){if(1&s&&(t.j41(0,"div",467),t.DNE(1,so,36,23,"mat-card",468),t.k0s()),2&s){const e=r.$implicit,a=t.XpG(4);t.R7$(),t.Y8G("ngIf","Repair"==a.taskTypeVG(t.eq3(1,He,e)))}}function ro(s,r){if(1&s&&(t.j41(0,"div",433)(1,"div",434)(2,"mat-label"),t.EFF(3),t.k0s(),t.DNE(4,Li,35,20,"div",435),t.k0s(),t.j41(5,"div",434)(6,"mat-label"),t.EFF(7),t.k0s(),t.DNE(8,zi,37,22,"div",435),t.k0s(),t.j41(9,"div",434)(10,"mat-label"),t.EFF(11),t.k0s(),t.DNE(12,no,2,3,"div",436),t.k0s()()),2&s){const e=t.XpG(3);t.R7$(3),t.JRh(e.master.datalist.JobInspections),t.R7$(),t.Y8G("ngForOf",e.inspectionRowData)("ngForTrackBy",e.trackByInspectionTask),t.R7$(3),t.JRh(e.master.datalist.JobMaintenance),t.R7$(),t.Y8G("ngForOf",e.maintenanceRowData)("ngForTrackBy",e.trackByMaintenanceTask),t.R7$(3),t.JRh(e.master.datalist.JobDefectRepairs),t.R7$(),t.Y8G("ngForOf",e.repairRowData)("ngForTrackBy",e.trackByRepairTask)}}function lo(s,r){1&s&&(t.j41(0,"div",479),t.nrm(1,"app-loading-spinner",480),t.k0s())}function co(s,r){1&s&&(t.j41(0,"mat-label",230),t.EFF(1,"Task Classification"),t.k0s())}function po(s,r){if(1&s){const e=t.RV6();t.j41(0,"button",500),t.bIt("click",function(){t.eBV(e);const i=t.XpG().taskRow,o=t.XpG(5);return t.Njj(o.openDefectRechargeModal(i))}),t.EFF(1," Recharge "),t.k0s()}if(2&s){const e=t.XpG(6);t.Y8G("disabled",e.jobStatus==e.JobStatus.onShow)}}function mo(s,r){if(1&s&&(t.j41(0,"div",501)(1,"div",502)(2,"div",503)(3,"span",504),t.EFF(4),t.k0s(),t.j41(5,"span",505),t.EFF(6),t.k0s()(),t.j41(7,"div",503)(8,"span",504),t.EFF(9),t.k0s(),t.j41(10,"span",505),t.EFF(11),t.k0s()(),t.j41(12,"div",503)(13,"span",504),t.EFF(14),t.k0s(),t.j41(15,"span",505),t.EFF(16),t.k0s()()(),t.j41(17,"div",502)(18,"div",503)(19,"span",504),t.EFF(20),t.k0s(),t.j41(21,"span",505),t.EFF(22),t.k0s()(),t.j41(23,"div",503)(24,"span",504),t.EFF(25),t.k0s(),t.j41(26,"span",505),t.EFF(27),t.k0s()(),t.j41(28,"div",503)(29,"span",504),t.EFF(30),t.k0s(),t.j41(31,"span",505),t.EFF(32),t.k0s()()()()),2&s){const e=t.XpG().taskRow,a=t.XpG(5);t.R7$(4),t.JRh(a.master.datalist.Category),t.R7$(2),t.JRh(a.getMainAreaDisplayValue(e)||"-"),t.R7$(3),t.JRh(a.master.datalist.SubCategory),t.R7$(2),t.JRh(a.getSubCategoryDisplayValue(e)||"-"),t.R7$(3),t.JRh(a.master.datalist.Component),t.R7$(2),t.JRh(a.getComponentDisplayValue(e)||"-"),t.R7$(4),t.JRh(a.master.datalist.Position),t.R7$(2),t.JRh(a.getPositionDisplayValue(e)||"-"),t.R7$(3),t.JRh(a.master.datalist.Action),t.R7$(2),t.JRh(a.getActionDisplayValue(e)||"-"),t.R7$(3),t.JRh(a.master.datalist.Reason),t.R7$(2),t.JRh(a.getReasonDisplayValue(e)||"-")}}function ho(s,r){if(1&s&&(t.j41(0,"div",506)(1,"span",504),t.EFF(2),t.k0s(),t.j41(3,"span",505),t.EFF(4),t.k0s()()),2&s){const e=t.XpG().taskRow,a=t.XpG(5);t.R7$(2),t.JRh(a.master.datalist.Comment),t.R7$(2),t.JRh(e.taskClassificationComment||"-")}}function uo(s,r){if(1&s&&(t.j41(0,"div",509)(1,"small"),t.EFF(2),t.j41(3,"span",510),t.EFF(4),t.nI1(5,"number"),t.k0s()()()),2&s){const e=t.XpG(2).taskRow,a=t.XpG(5);t.R7$(2),t.SpI("",a.master.datalist.TotalDefectCost,": \xa3"),t.R7$(2),t.JRh(t.i5U(5,2,a.getTotalCost(e),"1.2-2"))}}function go(s,r){if(1&s&&(t.j41(0,"div",509)(1,"small"),t.EFF(2),t.j41(3,"span",510),t.EFF(4),t.nI1(5,"number"),t.k0s()()()),2&s){const e=t.XpG(2).taskRow,a=t.XpG(5);t.R7$(2),t.SpI("",a.master.datalist.AmountRecharged,": \xa3"),t.R7$(2),t.JRh(t.i5U(5,2,a.getTotalRechargeCost(e),"1.2-2"))}}function _o(s,r){if(1&s&&(t.j41(0,"div",507),t.DNE(1,uo,6,5,"div",508)(2,go,6,5,"div",508),t.k0s()),2&s){const e=t.XpG().taskRow,a=t.XpG(5);t.R7$(),t.Y8G("ngIf",a.getTotalCost(e)>0),t.R7$(),t.Y8G("ngIf",a.getTotalRechargeCost(e)>0)}}function fo(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",489)(1,"div",490)(2,"div",491),t.DNE(3,co,2,0,"mat-label",492),t.k0s(),t.j41(4,"div",493)(5,"button",494),t.bIt("click",function(){const i=t.eBV(e).taskRow,o=t.XpG(5);return t.Njj(o.openCostDialog(i))}),t.EFF(6," Add Cost "),t.k0s(),t.DNE(7,po,2,1,"button",495),t.k0s()(),t.j41(8,"div",496),t.DNE(9,mo,33,12,"div",497)(10,ho,5,2,"div",498)(11,_o,3,2,"div",499),t.k0s()()}if(2&s){const e=r.taskRow,a=t.XpG(5);t.R7$(3),t.Y8G("ngIf",a.hasTaskClassificationData(e)),t.R7$(2),t.Y8G("disabled",a.jobStatus==a.JobStatus.onShow),t.R7$(2),t.Y8G("ngIf",a.getPayableRechargeCost(e)>0),t.R7$(2),t.Y8G("ngIf",a.hasTaskClassificationData(e)),t.R7$(),t.Y8G("ngIf",a.hasTaskClassificationData(e)),t.R7$(),t.Y8G("ngIf",a.getTotalCost(e)>0||a.getTotalRechargeCost(e)>0)}}function bo(s,r){if(1&s&&(t.j41(0,"mat-option",130),t.EFF(1),t.k0s()),2&s){const e=r.$implicit;t.Y8G("value",e.id),t.R7$(),t.SpI(" ",e.value," ")}}function ko(s,r){1&s&&(t.j41(0,"span"),t.EFF(1,", "),t.k0s())}function vo(s,r){if(1&s&&(t.j41(0,"span"),t.EFF(1),t.DNE(2,ko,2,0,"span",205),t.k0s()),2&s){const e=r.$implicit,a=r.index,i=t.XpG().$implicit;t.R7$(),t.JRh(e.name),t.R7$(),t.Y8G("ngIf",a!==i.checkSheet.length-1)}}function Do(s,r){if(1&s){const e=t.RV6();t.j41(0,"button",531),t.bIt("click",function(){t.eBV(e);const i=t.XpG().$implicit,o=t.XpG(6);return t.Njj(o.setToInprogress(i))}),t.EFF(1,"Set to In progress"),t.k0s()}}function Co(s,r){if(1&s){const e=t.RV6();t.j41(0,"button",532),t.bIt("click",function(){t.eBV(e);const i=t.XpG().$implicit,o=t.XpG(6);return t.Njj(o.cancelTask(i))}),t.EFF(1),t.k0s()}if(2&s){const e=t.XpG().$implicit,a=t.XpG(6);t.Y8G("disabled",a.jobStatus==a.JobStatus.unplanned||a.jobStatus>a.JobStatus.inprogress),t.R7$(),t.SpI(" ",e.defectID?"Remove from Job":a.master.datalist.Cancel,"")}}function jo(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",514)(1,"div",515)(2,"div",516)(3,"div",491)(4,"mat-label",517
1),t.EFF(5),t.k0s()(),t.j41(6,"div",283)(7,"div",518),t.EFF(8),t.k0s(),t.j41(9,"div",519)(10,"div",173)(11,"mat-form-field",446)(12,"mat-select",520),t.mxI("ngModelChange",function(i){const o=t.eBV(e).$implicit;return t.DH7(o.foremanID,i)||(o.foremanID=i),t.Njj(i)}),t.bIt("selectionChange",function(i){const o=t.eBV(e).$implicit,n=t.XpG(6);return n.onchangeEngineer(i.value,o),t.Njj(n.dataModified())}),t.j41(13,"mat-option",130),t.EFF(14," Select engineer"),t.k0s(),t.DNE(15,bo,2,2,"mat-option",448),t.k0s()()()()(),t.j41(16,"p")(17,"span",521),t.EFF(18),t.k0s(),t.DNE(19,vo,3,2,"span",435),t.k0s(),t.DNE(20,Do,2,0,"button",522),t.j41(21,"div",523)(22,"div",333),t.DNE(23,Co,2,2,"button",524),t.j41(24,"button",525),t.bIt("click",function(){const i=t.eBV(e).$implicit,o=t.XpG(6);return t.Njj(o.viewTaskDetails(i))}),t.EFF(25),t.k0s(),t.j41(26,"button",526),t.bIt("click",function(){const i=t.eBV(e).$implicit,o=t.XpG(6);return t.Njj(o.onRowClick({data:i}))}),t.EFF(27),t.k0s()()()()(),t.j41(28,"div",527)(29,"div",528),t.EFF(30),t.k0s()(),t.j41(31,"div",529)(32,"div",530),t.EFF(33),t.k0s()()()}if(2&s){const e=r.$implicit,a=t.XpG(6);t.R7$(5),t.SpI("",e.name," "),t.R7$(3),t.SpI("",a.master.datalist.Engineer," : "),t.R7$(4),t.R50("ngModel",e.foremanID),t.Y8G("disabled",!e.isSelectEngineer),t.R7$(),t.Y8G("value",""),t.R7$(2),t.Y8G("ngForOf",e.userList)("ngForTrackBy",a.trackByUser),t.R7$(3),t.SpI("",a.master.datalist.Checks," : "),t.R7$(),t.Y8G("ngForOf",e.checkSheet)("ngForTrackBy",a.trackByCheckSheet),t.R7$(),t.Y8G("ngIf",a.jobStatus===a.JobStatus.awaitingSignoff&&e.status===a.TaskStatus.completed),t.R7$(3),t.Y8G("ngIf",e.status===a.TaskStatus.inprogress||e.status===a.TaskStatus.notStarted),t.R7$(2),t.SpI(" ",a.master.datalist.ViewDetails,""),t.R7$(),t.Y8G("disabled",a.jobStatus==a.JobStatus.onShow),t.R7$(),t.JRh(a.master.datalist.ClickMe),t.R7$(3),t.JRh(a.master.datalist.PartsNotRequired),t.R7$(),t.xc7("background",e.taskStatusColor),t.R7$(2),t.JRh(e.taskDuration)}}function wo(s,r){if(1&s&&(t.j41(0,"div",479)(1,"div",491)(2,"mat-icon",511),t.EFF(3,"menu "),t.k0s(),t.j41(4,"p",512),t.EFF(5),t.k0s()(),t.DNE(6,jo,34,19,"div",513),t.k0s()),2&s){const e=t.XpG(5);t.R7$(5),t.JRh(e.master.datalist.Inspections),t.R7$(),t.Y8G("ngForOf",e.inspectionRowData)("ngForTrackBy",e.trackByInspectionTask)}}function Io(s,r){if(1&s&&(t.j41(0,"mat-option",130),t.EFF(1),t.k0s()),2&s){const e=r.$implicit;t.Y8G("value",e.id),t.R7$(),t.SpI(" ",e.value," ")}}function Ro(s,r){1&s&&(t.j41(0,"span"),t.EFF(1,", "),t.k0s())}function To(s,r){if(1&s&&(t.j41(0,"span"),t.EFF(1),t.DNE(2,Ro,2,0,"span",205),t.k0s()),2&s){const e=r.$implicit,a=r.index,i=t.XpG().$implicit;t.R7$(),t.JRh(e.name),t.R7$(),t.Y8G("ngIf",a!==i.checkSheet.length-1)}}function So(s,r){if(1&s){const e=t.RV6();t.j41(0,"button",531),t.bIt("click",function(){t.eBV(e);const i=t.XpG().$implicit,o=t.XpG(6);return t.Njj(o.setToInprogress(i))}),t.EFF(1,"Set to In progress"),t.k0s()}}function xo(s,r){if(1&s){const e=t.RV6();t.j41(0,"button",550),t.bIt("click",function(){t.eBV(e);const i=t.XpG().$implicit,o=t.XpG(6);return t.Njj(o.cancelTask(i))}),t.EFF(1),t.k0s()}if(2&s){const e=t.XpG().$implicit,a=t.XpG(6);t.Y8G("disabled",a.jobStatus==a.JobStatus.unplanned||a.jobStatus>a.JobStatus.inprogress),t.R7$(),t.SpI(" ",e.defectID?"Remove from Job":a.master.datalist.Cancel,"")}}function yo(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",514)(1,"div",535)(2,"div",516)(3,"div",491)(4,"mat-label",536),t.EFF(5),t.k0s()(),t.j41(6,"div",283)(7,"div",518),t.EFF(8),t.k0s(),t.j41(9,"div",519)(10,"div",173)(11,"mat-form-field",446)(12,"mat-select",537),t.mxI("ngModelChange",function(i){const o=t.eBV(e).$implicit;return t.DH7(o.foremanID,i)||(o.foremanID=i),t.Njj(i)}),t.bIt("selectionChange",function(i){const o=t.eBV(e).$implicit,n=t.XpG(6);return n.onchangeEngineer(i.value,o),t.Njj(n.dataModified())}),t.j41(13,"mat-option",130),t.EFF(14," Select engineer"),t.k0s(),t.DNE(15,Io,2,2,"mat-option",448),t.k0s()()()()(),t.j41(16,"p")(17,"span",521),t.EFF(18),t.k0s(),t.DNE(19,To,3,2,"span",435),t.k0s(),t.DNE(20,So,2,0,"button",522),t.j41(21,"div",523)(22,"div",450),t.DNE(23,xo,2,2,"button",538),t.j41(24,"button",539),t.bIt("click",function(){const i=t.eBV(e).$implicit,o=t.XpG(6);
1return t.Njj(o.viewTaskDetails(i))}),t.EFF(25),t.k0s(),t.j41(26,"button",526),t.bIt("click",function(){const i=t.eBV(e).$implicit,o=t.XpG(6);return t.Njj(o.onRowClick({data:i}))}),t.EFF(27),t.k0s()()()()(),t.j41(28,"div",540)(29,"div",315)(30,"div",541)(31,"div",542)(32,"mat-label",543),t.EFF(33),t.k0s(),t.j41(34,"button",544),t.bIt("click",function(){t.eBV(e);const i=t.XpG(6);return t.Njj(i.goToPartTab())}),t.EFF(35),t.k0s()(),t.j41(36,"div",545)(37,"div",546)(38,"span",547),t.EFF(39),t.k0s(),t.j41(40,"span",548),t.EFF(41),t.k0s()(),t.j41(42,"div",546)(43,"span",547),t.EFF(44),t.k0s(),t.j41(45,"span",548),t.EFF(46),t.k0s()(),t.j41(47,"div",546)(48,"span",547),t.EFF(49),t.k0s(),t.j41(50,"span",548),t.EFF(51),t.k0s()(),t.j41(52,"div",546)(53,"span",547),t.EFF(54),t.k0s(),t.j41(55,"span",548),t.EFF(56),t.k0s()()()()()(),t.j41(57,"div",549)(58,"div",530),t.EFF(59),t.k0s()()()}if(2&s){const e=r.$implicit,a=t.XpG(6);t.R7$(5),t.SpI("",e.name," "),t.R7$(3),t.SpI("",a.master.datalist.Engineer," : "),t.R7$(4),t.R50("ngModel",e.foremanID),t.Y8G("disabled",!e.isSelectEngineer),t.R7$(),t.Y8G("value",""),t.R7$(2),t.Y8G("ngForOf",e.userList)("ngForTrackBy",a.trackByUser),t.R7$(3),t.SpI("",a.master.datalist.Checks," : "),t.R7$(),t.Y8G("ngForOf",e.checkSheet)("ngForTrackBy",a.trackByCheckSheet),t.R7$(),t.Y8G("ngIf",a.jobStatus===a.JobStatus.awaitingSignoff&&e.status===a.TaskStatus.completed),t.R7$(3),t.Y8G("ngIf",e.status===a.TaskStatus.inprogress||e.status===a.TaskStatus.notStarted),t.R7$(2),t.SpI(" ",a.master.datalist.ViewDetails,""),t.R7$(),t.Y8G("disabled",a.jobStatus==a.JobStatus.onShow),t.R7$(),t.JRh(a.master.datalist.ClickMe),t.R7$(6),t.SpI("",a.master.datalist.PickList," "),t.R7$(),t.Y8G("disabled",a.jobStatus==a.JobStatus.onShow),t.R7$(),t.JRh(a.master.datalist.OpenList),t.R7$(4),t.SpI("",a.master.datalist.PartsRequired," :"),t.R7$(),t.AVh("non-zero",e.partsRequiredCount>0),t.R7$(),t.JRh(e.partsRequiredCount),t.R7$(3),t.SpI("",a.master.datalist.OnOrder," :"),t.R7$(),t.AVh("non-zero",e.partsOnOrderCount>0),t.R7$(),t.JRh(e.partsOnOrderCount),t.R7$(3),t.SpI("",a.master.datalist.NotPicked," :"),t.R7$(),t.AVh("non-zero",e.partsNotPickedCount>0),t.R7$(),t.JRh(e.partsNotPickedCount),t.R7$(3),t.SpI("",a.master.datalist.ReadyToCollect," :"),t.R7$(),t.AVh("non-zero",e.partsReadyToCollectCount>0),t.R7$(),t.JRh(e.partsReadyToCollectCount),t.R7$(),t.xc7("background",e.taskStatusColor),t.R7$(2),t.JRh(e.taskDuration)}}function Fo(s,r){if(1&s&&(t.j41(0,"div",479)(1,"div",491),t.nrm(2,"img",533),t.j41(3,"mat-label",534),t.EFF(4),t.k0s()(),t.DNE(5,yo,60,37,"div",513),t.k0s()),2&s){const e=t.XpG(5);t.R7$(2),t.xc7("background","#206685"),t.R7$(2),t.SpI("",e.master.datalist.Maintenance," "),t.R7$(),t.Y8G("ngForOf",e.maintenanceRowData)("ngForTrackBy",e.trackByMaintenanceTask)}}function No(s,r){if(1&s&&(t.j41(0,"mat-label",569),t.EFF(1),t.k0s()),2&s){const e=t.XpG().$implicit;t.R7$(),t.SpI("",e.defectQstn," ")}}function Jo(s,r){if(1&s&&(t.j41(0,"mat-option",130),t.EFF(1),t.k0s()),2&s){const e=r.$implicit;t.Y8G("value",e.id),t.R7$(),t.SpI(" ",e.value," ")}}function Bo(s,r){1&s&&(t.j41(0,"span"),t.EFF(1,", "),t.k0s())}function Mo(s,r){if(1&s&&(t.j41(0,"span"),t.EFF(1),t.DNE(2,Bo,2,0,"span",205),t.k0s()),2&s){const e=r.$implicit,a=r.index,i=t.XpG().$implicit;t.R7$(),t.JRh(e.name),t.R7$(),t.Y8G("ngIf",a!==i.checkSheet.length-1)}}function Ao(s,r){if(1&s){const e=t.RV6();t.j41(0,"button",531),t.bIt("click",function(){t.eBV(e);const i=t.XpG().$implicit,o=t.XpG(6);return t.Njj(o.setToInprogress(i))}),t.EFF(1,"Set to In progress"),t.k0s()}}function Eo(s,r){if(1&s){const e=t.RV6();t.j41(0,"mat-icon",570),t.bIt("click",function(){t.eBV(e);const i=t.XpG().$implicit,o=t.XpG(6);return t.Njj(o.startEditDefectComment("defectCommentHistory",i))}),t.EFF(1),t.k0s()}2&s&&(t.R7$(),t.SpI(" ","edit",""))}function Go(s,r){if(1&s){const e=t.RV6();t.j41(0,"button",571),t.bIt("click",function(){t.eBV(e);const i=t.XpG().$implicit,o=t.XpG(6);return t.Njj(o.cancelTask(i))}),t.EFF(1),t.k0s()}if(2&s){const e=t.XpG().$implicit,a=t.XpG(6);t.Y8G("disabled",a.jobStatus==a.JobStatus.unplanned||a.jobStatus>a.JobStatus.inprogress),t.R7$(),t.SpI(" ",e.defectID?"Remove from Job":a.master.datalist.Cancel,"")}}function Po(s,r){1&s&&t.eu8(0)}function Oo(s,r){1&s&&t.eu8(0)}function Lo(s,r){if(1&s&&t.DNE(0,Oo,1,0,"ng-container",568),2&s){const e=t.XpG().$implicit,a=t.XpG(6);t.Y8G("ngTemplateOutlet",a.costRechargeBtn)("ngTemplateOutletContext",t.eq3(2,Ue,e))}}function $o(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",514)(1,"div",553)(2,"div",516)(3,"div",491),t.DNE(4,No,2,1,"mat-label",554),t.k0s(),t.j41(5,"div",491)(6,"mat-label",555),t.EFF(7),t.k0s()(),t.j41(8,"div",491)(9,"mat-label",556),t.EFF(10),t.k0s()(),t.j41(11,"p"),t.EFF(12),t.k0s(),t.j41(13,"div",283)(14,"div",518),t.EFF(15),t.k0s(),t.j41(16,"div",519)(17,"div",173)(18,"mat-form-field",446)(19,"mat-select",557),t.mxI("ngModelChange",function(i){const o=t.eBV(e).$implicit;return t.DH7(o.foremanID,i)||(o.foremanID=i),t.Njj(i)}),t.bIt("selectionChange",function(i){const o=t.eBV(e).$implicit,n=t.XpG(6);return n.onchangeEngineer(i.value,o),t.Njj(n.dataModified())}),t.j41(20,"mat-option",130),t.EFF(21," Select engineer"),t.k0s(),t.DNE(22,Jo,2,2,"mat-option",448),t.k0s()()()()(),t.j41(23,"p")(24,"span",521),t.EFF(25),t.k0s(),t.DNE(26,Mo,3,2,"span",435),t.k0s(),t.DNE(27,Ao,2,0,"button",522),t.j41(28,"div",558)(29,"div",450)(30,"div",559),t.DNE(31,Eo,2,1,"mat-icon",560),t.k0s(),t.DNE(32,Go,2,2,"button",561),t.j41(33,"button",562),t.bIt("click",function(){const i=t.eBV(e).$implicit,o=t.XpG(6);
1return t.Njj(o.viewDefectReapirTaskDetails(i))}),t.EFF(34),t.k0s(),t.j41(35,"button",526),t.bIt("click",function(){const i=t.eBV(e).$implicit,o=t.XpG(6);return t.Njj(o.onRowClick({data:i}))}),t.EFF(36),t.k0s()()()()(),t.j41(37,"div",563)(38,"div",315)(39,"div",564)(40,"div",542)(41,"mat-label",565),t.EFF(42),t.k0s(),t.j41(43,"button",544),t.bIt("click",function(){t.eBV(e);const i=t.XpG(6);return t.Njj(i.goToPartTab())}),t.EFF(44),t.k0s()(),t.j41(45,"div",566)(46,"div",546)(47,"span",547),t.EFF(48),t.k0s(),t.j41(49,"span",548),t.EFF(50),t.k0s()(),t.j41(51,"div",546)(52,"span",547),t.EFF(53),t.k0s(),t.j41(54,"span",548),t.EFF(55),t.k0s()(),t.j41(56,"div",546)(57,"span",547),t.EFF(58),t.k0s(),t.j41(59,"span",548),t.EFF(60),t.k0s()(),t.j41(61,"div",546)(62,"span",547),t.EFF(63),t.k0s(),t.j41(64,"span",548),t.EFF(65),t.k0s()()()()()(),t.j41(66,"div",567),t.DNE(67,Po,1,0,"ng-container",568),t.k0s(),t.DNE(68,Lo,1,4,"ng-template",null,26,t.C5r),t.j41(70,"div",529)(71,"div",530),t.EFF(72),t.k0s()()()}if(2&s){const e=r.$implicit;t.XpG(2);const a=t.sdS(20),i=t.XpG(4);t.R7$(4),t.Y8G("ngIf",e.defectQstn),t.R7$(3),t.SpI("",e.name," "),t.R7$(3),t.SpI("",e.defectFirstComment," "),t.R7$(2),t.Lme("",i.master.datalist.Raisedby," : ",e.defectRaisedBy,""),t.R7$(3),t.SpI("",i.master.datalist.Engineer," : "),t.R7$(4),t.R50("ngModel",e.foremanID),t.Y8G("disabled",!e.isSelectEngineer),t.R7$(),t.Y8G("value",""),t.R7$(2),t.Y8G("ngForOf",e.userList)("ngForTrackBy",i.trackByUser),t.R7$(3),t.SpI("",i.master.datalist.Checks," : "),t.R7$(),t.Y8G("ngForOf",e.checkSheet)("ngForTrackBy",i.trackByCheckSheet),t.R7$(),t.Y8G("ngIf",i.jobStatus===i.JobStatus.awaitingSignoff&&e.status===i.TaskStatus.completed),t.R7$(4),t.Y8G("ngIf",i.jobStatus!=i.JobStatus.completed),t.R7$(),t.Y8G("ngIf",e.status===i.TaskStatus.inprogress||e.status===i.TaskStatus.notStarted),t.R7$(2),t.SpI(" ",i.master.datalist.ViewDetails,""),t.R7$(),t.Y8G("disabled",i.jobStatus==i.JobStatus.onShow),t.R7$(),t.JRh(i.master.datalist.ClickMe),t.R7$(6),t.SpI(" ",i.master.datalist.PickList," "),t.R7$(),t.Y8G("disabled",i.jobStatus==i.JobStatus.onShow),t.R7$(),t.JRh(i.master.datalist.OpenList),t.R7$(4),t.SpI("",i.master.datalist.PartsRequired," :"),t.R7$(),t.AVh("non-zero",e.partsRequiredCount>0),t.R7$(),t.JRh(e.partsRequiredCount),t.R7$(3),t.SpI("",i.master.datalist.OnOrder," :"),t.R7$(),t.AVh("non-zero",e.partsOnOrderCount>0),t.R7$(),t.JRh(e.partsOnOrderCount),t.R7$(3),t.SpI("",i.master.datalist.NotPicked," :"),t.R7$(),t.AVh("non-zero",e.partsNotPickedCount>0),t.R7$(),t.JRh(e.partsNotPickedCount),t.R7$(3),t.SpI("",i.master.datalist.ReadyToCollect," :"),t.R7$(),t.AVh("non-zero",e.partsReadyToCollectCount>0),t.R7$(),t.JRh(e.partsReadyToCollectCount),t.R7$(2),t.Y8G("ngTemplateOutlet",a)("ngTemplateOutletContext",t.l_i(44,Ye,e,"repair_"+e.id)),t.R7$(3),t.xc7("background",e.taskStatusColor),t.R7$(2),t.JRh(e.taskDuration)}}function Vo(s,r){if(1&s&&(t.j41(0,"div",479)(1,"div",491),t.nrm(2,"img",551),t.j41(3,"mat-label",552),t.EFF(4),t.k0s()(),t.DNE(5,$o,73,47,"div",513),t.k0s()),2&s){const e=t.XpG(5);t.R7$(2),t.xc7("background","#910012"),t.R7$(2),t.SpI("",e.master.datalist.DefectRepair," "),t.R7$(),t.Y8G("ngForOf",e.repairRowData)("ngForTrackBy",e.trackByRepairTask)}}function Ho(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",514)(1,"div",573)(2,"div",516)(3,"div",491)(4,"mat-label",556),t.EFF(5),t.k0s()(),t.j41(6,"p"),t.EFF(7),t.k0s(),t.j41(8,"div",523)(9,"div",450)(10,"button",562),t.bIt("click",function(){const i=t.eBV(e).$implicit,o=t.XpG(6);return t.Njj(o.viewDefectReapirTaskDetails(i))}),t.EFF(11),t.k0s()()()()(),t.j41(12,"div",574)(13,"div",528),t.EFF(14),t.k0s()(),t.nrm(15,"div",549),t.k0s()}if(2&s){const e=r.$implicit,a=t.XpG(6);t.R7$(5),t.SpI("",e.defectFirstComment," "),t.R7$(2),t.Lme("",a.master.datalist.Raisedby," : ",e.defectRaisedBy,""),t.R7$(4),t.SpI(" ",a.master.datalist.ViewDetails,""),t.R7$(3),t.JRh(a.master.datalist.PartsNotRequired),t.R7$(),t.xc7("background",e.taskStatusColor)}}function Yo(s,r){if(1&s&&(t.j41(0,"div",479)(1,"div",491)(2,"mat-icon",572),t.EFF(3,"flag_2"),t.k0s(),t.j41(4,"mat-label",552),t.EFF(5),t.k0s()(),t.DNE(6,Ho,16,7,"div",513),t.k0s()),2&s){const e=t.XpG(5);t.R7$(5),t.SpI("","Advisories"," "),t.R7$(),t.Y8G("ngForOf",e.advisoryDefectList)("ngForTrackBy",e.trackByAdvisoryDefect)}}function Uo(s,r){if(1&s&&(t.j41(0,"div",479)(1,"div",481)(2,"div",482)(3,"div",483),t.nrm(4,"span",484),t.j41(5,"div",485),t.EFF(6),t.k0s()(),t.j41(7,"div",483),t.nrm(8,"span",486),t.j41(9,"div",485),t.EFF(10,"In Progress"),t.k0s()(),t.j41(11,"div",483),t.nrm(12,"span",487),t.j41(13,"div",485),t.EFF(14),t.k0s()(),t.j41(15,"div",483),t.nrm(16,"span",488),t.j41(17,"div",485),t.EFF(18),t.k0s()()()(),t.DNE(19,fo,12,6,"ng-template",null,25,t.C5r)(21,wo,7,3,"div",478)(22,Fo,6,5,"div",478)(23,Vo,6,5,"div",478)(24,Yo,7,3,"div",478),t.k0s()),2&s){const e=t.XpG(4);t.R7$(6),t.JRh(e.master.datalist.NotStarted),t.R7$(8),t.JRh(e.master.datalist.Cancelled),t.R7$(4),t.JRh(e.master.datalist.Completed),t.R7$(3),t.Y8G("ngIf",null==e.inspectionRowData?null:e.inspectionRowData.length),t.R7$(),t.Y8G("ngIf",null==e.maintenanceRowData?null:e.maintenanceRowData.length),t.R7$(),t.Y8G("ngIf",null==e.repairRowData?null:e.repairRowData.length),t.R7$(),t.Y8G("ngIf",null==e.advisoryDefectList?null:e.advisoryDefectList.length)}}function Xo(s,r){if(1&s&&(t.j41(0,"div"),t.DNE(1,lo,2,0,"div",478)(2,Uo,25,7,"div",478),t.k0s()),2&s){const e=t.XpG(3);t.R7$(),t.Y8G("ngIf",e.isTaskLoading),t.R7$(),t.Y8G("ngIf",!e.isTaskLoading)}}function Wo(s,r){if(1&s&&(t.j41(0,"div",431)(1,"div",428),t.DNE(2,Bi,1,0,"ng-container",284)(3,ro,13,9,"div",432)(4,Xo,3,2,"div",205),t.k0s()()),2&s){t.XpG();const e=t.sdS(34),a=t.XpG();t.R7$(2),t.Y8G("ngTemplateOutlet",e),t.R7$(),t.Y8G("ngIf",!a.jobId||a.isUpdatingJobTask),t.R7$(),t.Y8G("ngIf",a.jobId&&
1!a.isUpdatingJobTask)}}function qo(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",583)(1,"mat-label",584),t.EFF(2),t.k0s(),t.j41(3,"button",585),t.bIt("click",function(){t.eBV(e),t.XpG();const i=t.sdS(12),o=t.XpG(3);return t.Njj(o.master.resetAGGridFilter(i))}),t.EFF(4),t.k0s()()}if(2&s){const e=t.XpG(4);t.R7$(2),t.JRh(e.master.datalist.filtersAreActive),t.R7$(2),t.JRh(e.master.datalist.Clear)}}function zo(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",427)(1,"div",428)(2,"div",576)(3,"div",577)(4,"mat-label"),t.EFF(5),t.k0s(),t.j41(6,"button",578),t.bIt("click",function(){t.eBV(e);const i=t.XpG(3);return t.Njj(i.addPartToJob())}),t.nrm(7,"img",579),t.k0s()(),t.DNE(8,qo,5,2,"div",580),t.k0s(),t.j41(9,"div",581)(10,"div",74)(11,"ag-grid-angular",582,27),t.bIt("rowClicked",function(i){t.eBV(e);const o=t.XpG(3);return t.Njj(o.onPartRowClick(i))})("firstDataRendered",function(i){t.eBV(e);const o=t.XpG(3);return t.Njj(o.onFirstDataRenderedParentOrg(i))}),t.k0s()()()()()}if(2&s){const e=t.sdS(12),a=t.XpG(3);t.R7$(5),t.JRh(a.master.datalist.JobAddPart),t.R7$(),t.Y8G("ngClass",t.eq3(12,Xe,a.addPartBtnDisable()))("disabled",a.tabAddPartBtnDisable),t.R7$(2),t.Y8G("ngIf",!a.master.filtersAreActive(e)),t.R7$(3),t.Y8G("rowData",a.rowdata)("columnDefs",a.columnDefs)("components",a.frameworkComponentsPartsTab)("pagination",!0)("paginationPageSize",100)("rowGroupPanelShow","always")("rowBuffer",89)("gridOptions",a.gridOptions)}}function Qo(s,r){if(1&s&&(t.j41(0,"mat-tab",575),t.DNE(1,zo,13,14,"ng-template",111),t.k0s()),2&s){const e=t.XpG(2);t.Y8G("disabled",!e.assetId||""==e.jobId)}}function Ko(s,r){1&s&&(t.j41(0,"div",588)(1,"div",589),t.EFF(2,"You have no permission to access. Please Contact Admin"),t.k0s()())}function Zo(s,r){if(1&s){const e=t.RV6();t.qex(0),t.j41(1,"app-asset-cost",590,28),t.bIt("rechargeClick",function(){t.eBV(e);const i=t.XpG(4);return t.Njj(i.openJobLevelRechargeModal())})("costDataChanged",function(){t.eBV(e);const i=t.XpG(4);return t.Njj(i.onAssetCostDataChanged())}),t.k0s(),t.bVm()}if(2&s){const e=t.XpG(4);t.R7$(),t.Y8G("jobId",e.jobId)("AssetId",e.objAssetData.id||e.assetId)("pSupplierId",e.objJobData.workshopID)("pJobTasks",(null==e.objJobData?null:e.objJobData.task)||e.rowDataTask||t.lJ4(9,We))("showRechargeButton",!0)("canShowRechargeButton",e.hasRechargeEligibleTasks())("showUploadButton",!0)("showEstimatedCost",!0)("estimatedCost",e.jobEstimatedCost)}}function ts(s,r){if(1&s&&(t.j41(0,"div",427)(1,"div",428),t.DNE(2,Ko,3,0,"div",587)(3,Zo,3,10,"ng-container",205),t.k0s()()),2&s){const e=t.XpG(3);t.R7$(2),t.Y8G("ngIf",!e.master.isAssetCostsPermission),t.R7$(),t.Y8G("ngIf",e.master.isAssetCostsPermission)}}function es(s,r){1&s&&(t.j41(0,"mat-tab",586),t.DNE(1,ts,4,2,"ng-template",111),t.k0s())}function as(s,r){if(1&s){const e=t.RV6();t.qex(0),t.j41(1,"button",607),t.bIt("click",function(){t.eBV(e);const i=t.XpG(3);return t.Njj(i.onClickingFilters())}),t.j41(2,"mat-icon"),t.EFF(3,"filter_list"),t.k0s(),t.EFF(4," Filters "),t.j41(5,"span",608),t.EFF(6),t.k0s()(),t.j41(7,"p",609),t.bIt("click",function(){t.eBV(e),t.XpG();const i=t.sdS(26),o=t.XpG(2);return t.Njj(o.master.resetAGGridFilter(i))})("keypress",function(){t.eBV(e),t.XpG();const i=t.sdS(26),o=t.XpG(2);return t.Njj(o.master.resetAGGridFilter(i))}),t.EFF(8," Clear all"),t.k0s(),t.bVm()}if(2&s){t.XpG();const e=t.sdS(26),a=t.XpG(2);t.R7$(6),t.JRh(a.master.agGridActiveFiltersCount(e))}}function is(s,r){if(1&s){const e=t.RV6();t.j41(0,"mat-tab",591)(1,"div",581)(2,"div",74)(3,"div",592)(4,"div",593),t.nrm(5,"div",594),t.k0s(),t.j41(6,"div",595)(7,"div",315)(8,"div",596)(9,"div",597)(10,"div",598)(11,"mat-form-field",599)(12,"mat-icon",600),t.EFF(13),t.nI1(14,"lowercase"),t.k0s(),t.j41(15,"input",601),t.mxI("ngModelChange",function(i){t.eBV(e);const o=t.XpG(2);return t.DH7(o.quickFilterText,i)||(o.quickFilterText=i),t.Njj(i)}),t.k0s()()()()(),t.j41(16,"div",602),t.DNE(17,as,9,1,"ng-container",205),t.k0s(),t.nrm(18,"div",596),t.j41(19,"div",541)(20,"div",603)(21,"button",604),t.bIt("click",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.openAddDocumentModel())}),t.j41(22,"mat-icon",605),t.EFF(23),t.k0s(),t.EFF(24,"Add Document"),t.k0s()()()()()(),t.j41(25,"ag-grid-angular",606,29),t.bIt("sortChanged",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.onSaveGridColumnState())})("filterChanged",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.onFilterChanged())})("firstDataRendered",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.onFirstDataRendered())})("columnResized",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.onSaveGridColumnState())})("columnPinned",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.onSaveGridColumnState())})("columnMoved",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.onSaveGridColumnState())})("columnVisible",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.onSaveGridColumnState())})("columnValueChanged",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.onSaveGridColumnState())})("columnRowGroupChanged",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.onSaveGridColumnState())})("onColumnPivotChanged",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.onSaveGridColumnState())})("paginationChanged",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.onPaginationChanged())})("rowSelected",function(i){t.eBV(e);const o=t.XpG(2);return t.Njj(o.onRowSelected(i))}),t.k0s()()()()}if(2&s){const e=t.sdS(26),a=t.XpG(2);t.R7$(13),t.JRh(t.bMT(14,16,a.master.datalist.Search)),t.R7$(2),t.R50("ngModel",a.quickFilterText),t.R7$(2),t.Y8G("ngIf",!a.master.filtersAreActive(e)),t.R7$(6),t.JRh("add"),t.R7$(2),t.Y8G("rowData",a.documentRowData)("columnDefs",a.filteredColumnDefs)("components",a.frameworkComponents)("pagination",!0)("paginationPageSize",100)("rowGroupPanelShow","always")("columnTypes",a.columnTypes)("rowBuffer",89)("gridOptions",a.gridOptions)("quickFilterText",a.quickFilterText)("sideBar",a.sideBar)("suppressRowClickSelection",!0)}}function os(s,r){if(1&s&&(t.j41(0,"div",427)(1,"div",428)(2,"div",576)(3,"div",577)(4,"mat-label"),t.EFF(5,"Available contacts"),t.k0s()()(),t.nrm(6,"app-org-contact-list",611),t.k0s()()),2&s){const e=t.XpG(3);t.R7$(6),t.Y8G("orgIDs",t.eq3(3,A,e.objAssetData.operatorOrgID))("workshopId",e.objJobData.workshopID)("jobId",e.objJobData.id)}}function ss(s,r){1&s&&(t.j41(0,"mat-tab",610),t.DNE(1,os,7,5,"ng-template",111),t.k0s())}function ns(s,r){if(1&s&&(t.j41(0,"div",427)(1,"div",428)(2,"div",576)(3,"div",577)(4,"mat-label"),t.EFF(5,"Asset agreements"),t.k0s()()(),t.nrm(6,"app-asset-agreement",613),t.k0s()()),2&s){const e=t.XpG(3);t.R7$(6),t.Y8G("AssetId",e.objAssetData.id||e.assetId)("readOnly",!0)("assetUsageIn",e.objAssetData.usageIn)("assetOperatorOrgId",e.objAssetData.operatorOrgID)}}function rs(s,r){1&s&&(t.j41(0,"mat-tab",612),t.DNE(1,ns,7,4,"ng-template",111),t.k0s())}function ls(s,r){if(1&s&&(t.j41(0,"div",427)(1,"div",428),t.nrm(2,"app-new-booking-comms-log",615),t.k0s()()),2&s){const e=t.XpG(3);t.R7$(2),t.Y8G("jobId",e.jobId)("assetId",e.assetId)}}function ds(s,r){1&s&&(t.j41(0,"mat-tab",614),t.DNE(1,ls,3,2,"ng-template",111),t.k0s())}function cs(s,r){1&s&&t.eu8(0)}function ps(s,r){if(1&s&&t.DNE(0,cs,1,0,"ng-container",284),2&s){t.XpG(2);const e=t.sdS(32);t.Y8G("ngTemplateOutlet",e)}}function ms(s,r){1&s&&(t.j41(0,"mat-tab",616),t.DNE(1,ps,1,1,"ng-template",111),t.k0s())}function hs(s,r){1&s&&(t.j41(0,"div",479),t.nrm(1,"app-loading-spinner",480),t.k0s())}function us(s,r){if(1&s){const e=t.RV6();t.j41(0,"ag-grid-angular",619,30),t.bIt("firstDataRendered",function(){t.eBV(e);const i=t.XpG(3);return t.Njj(i.onHistoryFirstDataRendered())}),t.k0s()}if(2&s){const e=t.XpG(3);t.Y8G("rowData",e.jobHistoryData)("columnDefs",e.historyColumnDefs)("paginationPageSize",100)("pagination",!0)("rowGroupPanelShow","always")("rowBuffer",89)}}function gs(s,r){if(1&s&&(t.j41(0,"mat-tab",617)(1,"div",581)(2,"div",74),t.DNE(3,hs,2,0,"div",478)(4,us,2,6,"ag-grid-angular",618),t.k0s()()()),2&s){const e=t.XpG(2);t.R7$(3),t.Y8G("ngIf",e.isHistoryTabLoading),t.R7$(),t.Y8G("ngIf",!e.isHistoryTabLoading)}}function _s(s,r){if(1&s){const e=t.RV6();t.j41(0,"button",628),t.bIt("click",function(){t.eBV(e);const i=t.XpG(3);return t.Njj(i.discardJobChange())}),t.EFF(1),t.k0s()}if(2&s){const e=t.XpG(3);t.FS9("id",e.master.datalist.DiscardJob),t.Y8G("disabled",!1),t.R7$(),t.JRh(e.master.datalist.DiscardJob)}}function fs(s,r){if(1&s){const e=t.RV6();t.j41(0,"button",629),t.bIt("click",function(){t.eBV(e);const i=t.XpG(3);return t.Njj(i.discardJobRequest())}),t.EFF(1),t.k0s()}if(2&s){const e=t.XpG(3);t.Y8G("disabled",!1),t.R7$(),t.JRh(e.isEmergencyRequestMode?"Discard Work":"Discard Request")}}function bs(s,r){if(1&s){const e=t.RV6();t.j41(0,"button",632),t.bIt("click",function(){t.eBV(e);const i=t.XpG(4);return t.Njj(i.createJob())}),t.EFF(1),t.k0s()}if(2&s){const e=t.XpG(4);t.Y8G("disabled",2!=e.selectedTab),t.R7$(),t.SpI("",e.master.datalist.CreateJob," ")}}function ks(s,r){if(1&s){const e=t.RV6();t.j41(0,"button",633),t.bIt("click",function(){t.eBV(e);const i=t.XpG(4);return t.Njj(i.saveUpdatedJobTask())}),t.EFF(1),t.k0s()}if(2&s){const e=t.XpG(4);t.Y8G("disabled",2!=e.selectedTab),t.R7$(),t.SpI("",e.master.datalist.Save," ")}}function vs(s,r){if(1&s&&(t.qex(0),t.DNE(1,bs,2,2,"button",630)(2,ks,2,2,"button",631),t.bVm()),2&s){const e=t.XpG(3);t.R7$(),t.Y8G("ngIf",!e.isUpdatingJobTask),t.R7$(),t.Y8G("ngIf",e.isUpdatingJobTask)}}function Ds(s,r){if(1&s){const e=t.RV6();t.j41(0,"button",634),t.bIt("click",function(){t.eBV(e);const i=t.XpG(3);return t.Njj(i.addNewJobRequest())}),t.EFF(1),t.k0s()}if(2&s){const e=t.XpG(3);t.Y8G("disabled",2!=e.selectedTab),t.R7$(),t.JRh(e.isEmergencyRequestMode?"Create Emergency Work":"Create Request")}}function Cs(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",620)(1,"div",621)(2,"div",622)(3,"button",623),t.bIt("click",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.onStepChanged("prev"))}),t.EFF(4),t.k0s()(),t.j41(5,"div",622)(6,"button",623),t.bIt("click",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.onStepChanged("next"))}),t.EFF(7),t.k0s()()(),t.j41(8,"div",624)(9,"div",622),t.DNE(10,_s,2,3,"button",625)(11,fs,2,2,"button",626),t.k0s(),t.j41(12,"div",622),t.DNE(13,vs,3,2,"ng-container",205)(14,Ds,2,2,"button",627),t.k0s()()()}if(2&s){const e=t.XpG(2);t.R7$(3),t.FS9("id",e.master.datalist.Prev),t.Y8G("disabled",0==e.selectedTab||e.isUpdatingJobTask),t.R7$(),t.SpI("",e.master.datalist.Prev," "),t.R7$(2),t.FS9("id",e.master.datalist.Next),t.Y8G("disabled",2==e.selectedTab),t.R7$(),t.SpI("",e.master.datalist.Next," "),t.R7$(3),t.Y8G("ngIf",!e.createJobRequest),t.R7$(),t.Y8G("ngIf",e.createJobRequest),t.R7$(2),t.Y8G("ngIf",!e.createJobRequest),t.R7$(),t.Y8G("ngIf",e.createJobRequest)}}function js(s,r){1&s&&t.eu8(0)}function ws(s,r){1&s&&t.eu8(0)}function Is(s,r){if(1&s&&(t.qex(0),t.DNE(1,ws,1,0,"ng-container",284),t.bVm()),2&s){t.XpG(2);const e=t.sdS(200);t.R7$(),t.Y8G("ngTemplateOutlet",e)}}function Rs(s,r){1&s&&t.eu8(0)}function Ts(s,r){if(1&s&&(t.qex(0),t.DNE(1,Rs,1,0,"ng-container",284),t.bVm()),2&s){t.XpG(2);const e=t.sdS(194);t.R7$(),t.Y8G("ngTemplateOutlet",e)}}function Ss(s,r){1&s&&t.eu8(0)}function xs(s,r){1&s&&t.eu8(0)}function ys(s,r){if(1&s&&(t.qex(0),t.DNE(1,xs,1,0,"ng-container",284),t.bVm()),2&s){t.XpG(4);const e=t.sdS(204);t.R7$(),t.Y8G("ngTemplateOutlet",e)}}function Fs(s,r){if(1&s&&(t.qex(0),t.j41(1,"div",637)(2,"div",638),t.DNE(3,Ss,1,0,"ng-container",284),t.k0s()(),t.j41(4,"div",640)(5,"div",638),t.DNE(6,ys,2,1,"ng-container",205),t.k0s()(),t.bVm()),2&s){t.XpG(3);const e=t.sdS(202),a=t.XpG();t.R7$(3),t.Y8G("ngTemplateOutlet",e),t.R7$(3),t.Y8G("ngIf",!a.isEmergencyRequestMode)}}function Ns(s,r){1&s&&t.eu8(0)}function Js(s,r){if(1&s&&(t.j41(0,"div",637)(1,"div",638),t.DNE(2,Ns,1,0,"ng-container",284),t.k0s()()),2&s){t.XpG(3);const e=t.sdS(188);t.R7$(2),t.Y8G("ngTemplateOutlet",e)}}function Bs(s,r){1&s&&t.eu8(0)}function Ms(s,r){if(1&s&&(t.j41(0,"div",637)(1,"div",638),t.DNE(2,Bs,1,0,"ng-container",284),t.k0s()()),2&s){t.XpG(3);const e=t.sdS(190);t.R7$(2),t.Y8G("ngTemplateOutlet",e)}}function As(s,r){1&s&&t.eu8(0)}function Es(s,r){1&s&&t.eu8(0)}function Gs(s,r){if(1&s&&(t.qex(0),t.DNE(1,Es,1,0,"ng-container",284),t.bVm()),2&s){t.XpG(4);const e=t.sdS(36);t.R7$(),t.Y8G("ngTemplateOutlet",e)}}function Ps(s,r){1&s&&t.eu8(0)}function Os(s,r){if(1&s&&(t.qex(0),t.DNE(1,Ps,1,0,"ng-container",284),t.bVm()),2&s){t.XpG(4);const e=t.sdS(38);t.R7$(),t.Y8G("ngTemplateOutlet",e)}}function Ls(s,r){if(1&s&&(t.j41(0,"div",637)(1,"div",638),t.DNE(2,Gs,2,1,"ng-container",205)(3,Os,2,1,"ng-container",205),t.k0s()()),2&s){const e=t.XpG(4);t.R7$(2),t.Y8G("ngIf",e.objJobData.requestType===e.JobRequestType.SupplierRequest),t.R7$(),t.Y8G("ngIf",e.objJobData.requestType===e.JobRequestType.CustomerRequest)}}function $s(s,r){if(1&s&&(t.qex(0),t.DNE(1,Fs,7,2,"ng-container",205)(2,Js,3,1,"div",639)(3,Ms,3,1,"div",639),t.j41(4,"div",637)(5,"div",638),t.DNE(6,As,1,0,"ng-container",284),t.k0s()(),t.DNE(7,Ls,4,2,"div",639),t.bVm()),2&s){t.XpG(2);const e=t.sdS(192),a=t.XpG();t.R7$(),t.Y8G("ngIf",!a.createJobRequest||a.objJobData.requestType===a.JobRequestType.CustomerRequest||a.isEmergencyRequestMode),t.R7$(),t.Y8G("ngIf",a.createJobRequest),t.R7$(),t.Y8G("ngIf",a.createJobRequest&&a.isEmergencyRequestMode),t.R7$(3),t.Y8G("ngTemplateOutlet",e),t.R7$(),t.Y8G("ngIf",a.createJobRequest&&!a.isEmergencyRequestMode)}}function Vs(s,r){1&s&&t.eu8(0)}function Hs(s,r){if(1&s&&(t.j41(0,"div"),t.DNE(1,Vs,1,0,"ng-container",284),t.k0s()),2&s){t.XpG(2);const e=t.sdS(208);t.R7$(),t.Y8G("ngTemplateOutlet",e)}}function Ys(s,r){1&s&&t.eu8(0)}function Us(s,r){if(1&s&&(t.qex(0),t.DNE(1,Ys,1,0,"ng-container",284),t.bVm()),2&s){t.XpG(2);const e=t.sdS(206);t.R7$(),t.Y8G("ngTemplateOutlet",e)}}function Xs(s,r){if(1&s&&(t.j41(0,"div",427)(1,"div",428),t.DNE(2,js,1,0,"ng-container",284),t.j41(3,"div",429)(4,"div",430)(5,"div",635)(6,"div",636),t.DNE(7,Is,2,1,"ng-container",205),t.k0s()(),t.j41(8,"div",637)(9,"div",638),t.DNE(10,Ts,2,1,"ng-container",205),t.k0s()(),t.DNE(11,$s,8,5,"ng-container",205)(12,Hs,2,1,"div",205),t.k0s(),t.DNE(13,Us,2,1,"ng-container",205),t.k0s()()()),2&s){t.XpG();const e=t.sdS(34),a=t.XpG();t.R7$(2),t.Y8G("ngTemplateOutlet",e),t.R7$(),t.Y8G("ngClass",t.eq3(7,A,!a.jobId||a.isUpdatingJobTask?"createjob-custwidth":"")),t.R7$(4),t.Y8G("ngIf",a.jobReqInfo.isSupplierRequest&&(!a.jobId||a.isUpdatingJobTask)),t.R7$(3),t.Y8G("ngIf",!a.jobId||a.isUpdatingJobTask),t.R7$(),t.Y8G("ngIf",!a.jobId||a.isUpdatingJobTask),t.R7$(),t.Y8G("ngIf",a.jobId&&
1!a.isUpdatingJobTask),t.R7$(),t.Y8G("ngIf",a.jobId&&!a.isUpdatingJobTask&&a.assetId)}}function Ws(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",622)(1,"button",646),t.bIt("click",function(){t.eBV(e);const i=t.XpG(4);return t.Njj(i.showAssetList("showAsset"))}),t.EFF(2),t.k0s()()}if(2&s){const e=t.XpG(4);t.R7$(2),t.JRh(e.master.datalist.SearchAsset)}}function qs(s,r){if(1&s&&(t.j41(0,"div",642),t.DNE(1,Ws,3,1,"div",643),t.j41(2,"div",644),t.EFF(3),t.k0s(),t.j41(4,"div",645),t.EFF(5),t.k0s(),t.j41(6,"div",644),t.EFF(7),t.k0s(),t.j41(8,"div",645),t.EFF(9),t.k0s()()),2&s){const e=t.XpG(3);t.R7$(),t.Y8G("ngIf",0==e.selectedTab&&e.blnShowSearchAsset),t.R7$(2),t.SpI(" ",e.master.datalist.VRM,": "),t.R7$(2),t.SpI(" ",e.objAssetData.vrm," "),t.R7$(2),t.SpI(" ",e.master.datalist.AssetType,": "),t.R7$(2),t.SpI(" ",e.getAssetTypeDesc(e.objAssetData.assetType)," ")}}function zs(s,r){if(1&s&&t.DNE(0,qs,10,5,"div",641),2&s){const e=t.XpG(2);t.Y8G("ngIf",!e.jobId||e.isUpdatingJobTask)}}function Qs(s,r){1&s&&t.nrm(0,"div",656)}function Ks(s,r){if(1&s&&(t.j41(0,"div",651)(1,"div",652)(2,"div",653),t.EFF(3),t.k0s(),t.j41(4,"div",654),t.EFF(5),t.k0s()(),t.DNE(6,Qs,1,0,"div",655),t.k0s()),2&s){const e=r.$implicit,a=r.index,i=t.XpG(3);t.R7$(2),t.Y8G("ngClass",t.eq3(4,Rt,0===a)),t.R7$(),t.JRh(a+1),t.R7$(2),t.JRh(e.name),t.R7$(),t.Y8G("ngIf",a<i.supplierRequestFlow.length-1)}}function Zs(s,r){if(1&s&&(t.j41(0,"div",647)(1,"div",648),t.EFF(2," Supplier Request Flow "),t.k0s(),t.j41(3,"div",649),t.DNE(4,Ks,7,6,"div",650),t.k0s()()),2&s){const e=t.XpG(2);t.R7$(4),t.Y8G("ngForOf",e.supplierRequestFlow)}}function tn(s,r){1&s&&t.nrm(0,"div",656)}function en(s,r){if(1&s&&(t.j41(0,"div",651)(1,"div",652)(2,"div",653),t.EFF(3),t.k0s(),t.j41(4,"div",654),t.EFF(5),t.k0s()(),t.DNE(6,tn,1,0,"div",655),t.k0s()),2&s){const e=r.$implicit,a=r.index,i=t.XpG(3);t.R7$(2),t.Y8G("ngClass",t.eq3(4,Rt,0===a)),t.R7$(),t.JRh(a+1),t.R7$(2),t.JRh(e.name),t.R7$(),t.Y8G("ngIf",a<i.customerRequestFlow.length-1)}}function an(s,r){if(1&s&&(t.j41(0,"div",647)(1,"div",657),t.EFF(2,"Customer Request Flow "),t.k0s(),t.j41(3,"div",649),t.DNE(4,en,7,6,"div",650),t.k0s()()),2&s){const e=t.XpG(2);t.R7$(4),t.Y8G("ngForOf",e.customerRequestFlow)}}function on(s,r){if(1&s&&(t.j41(0,"mat-option",130),t.EFF(1),t.k0s()),2&s){const e=r.$implicit;t.Y8G("value",e.id),t.R7$(),t.SpI(" ",e.value||e.name," ")}}function sn(s,r){if(1&s&&(t.j41(0,"mat-option",130),t.EFF(1),t.k0s()),2&s){const e=r.$implicit,a=t.XpG(2);t.Y8G("value",e.id),t.R7$(),t.SpI(" ",e[a.master.displayLang]||e.value," ")}}function nn(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",658)(1,"mat-checkbox",659),t.mxI("ngModelChange",function(i){t.eBV(e);const o=t.XpG(2);return t.DH7(o.taskCostForm.rechargeToOperator,i)||(o.taskCostForm.rechargeToOperator=i),t.Njj(i)}),t.EFF(2," Flag Cost For Recharge To Operator "),t.k0s()()}if(2&s){const e=t.XpG(2);t.R7$(),t.Y8G("ngModelOptions",t.lJ4(2,It)),t.R50("ngModel",e.taskCostForm.rechargeToOperator)}}function rn(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",661),t.nrm(1,"img",662),t.j41(2,"div",663),t.EFF(3),t.k0s(),t.j41(4,"img",664),t.bIt("click",function(){t.eBV(e);const i=t.XpG().$implicit,o=t.XpG(2);return t.Njj(o.showFile(i.defectdocAT))}),t.k0s(),t.j41(5,"img",665),t.bIt("click",function(){t.eBV(e);const i=t.XpG().index,o=t.XpG(2);return t.Njj(o.confirmModel("confirm",i))}),t.k0s()()}if(2&s){const e=t.XpG().$implicit;t.R7$(3),t.JRh(e.filename)}}function ln(s,r){if(1&s&&(t.j41(0,"div",433),t.DNE(1,rn,6,1,"div",660),t.k0s()),2&s){const e=r.$implicit;t.R7$(),t.Y8G("ngIf",!e.isDelete)}}function dn(s,r){if(1&s){const e=t.RV6();t.j41(0,"input",666,31),t.bIt("change",function(i){t.eBV(e);const o=t.XpG(2);return t.Njj(o.uploadFile(i))}),t.k0s(),t.nrm(2,"img",667),t.j41(3,"div",668),t.EFF(4,"Drag Document Here or "),t.j41(5,"label",669),t.EFF(6,"Select File"),t.k0s()()}2&s&&(t.R7$(2),t.Y8G("ngStyle",t.lJ4(1,qe)))}function cn(s,r){if(1&s&&(t.qex(0),t.EFF(1),t.bVm()),2&s){const e=t.XpG(3);t.R7$(),t.SpI(" \u2022 ",e.parsedInvoice.invoiceNumber,"")}}function pn(s,r){if(1&s&&(t.j41(0,"span",670),t.EFF(1),t.DNE(2,cn,2,1,"ng-container",205),t.k0s()),2&s){const e=t.XpG(2);t.R7$(),t.SpI(" ",e.parsedInvoice.supplierName," "),t.R7$(),t.Y8G("ngIf",null==e.parsedInvoice?null:e.parsedInvoice.invoiceNumber)}}function mn(s,r){if(1&s&&(t.qex(0),t.EFF(1),t.bVm()),2&s){const e=t.XpG(3);t.R7$(),t.JRh(e.parsedInvoice.currency)}}function hn(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",675)(1,"span",676),t.EFF(2),t.k0s(),t.j41(3,"span",677),t.EFF(4),t.k0s(),t.j41(5,"span",678),t.EFF(6),t.nI1(7,"number"),t.k0s(),t.j41(8,"button",679),t.bIt("click",function(){const i=t.eBV(e).$implicit,o=t.XpG(3);return t.Njj(o.applyParsedLineToCost(i))}),t.EFF(9,"Use"),t.k0s()()}if(2&s){const e=r.$implicit,a=r.index;
1t.R7$(),t.Y8G("title",e.description),t.R7$(),t.JRh(e.description||"Line "+(a+1)),t.R7$(2),t.SpI("x",e.quantity||1,""),t.R7$(2),t.JRh(t.i5U(7,6,e.amount,"1.2-2")),t.R7$(2),t.Mz_("id","btnUseParsedLine",a,"")}}function un(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",671)(1,"div",672)(2,"span"),t.EFF(3),t.nI1(4,"number"),t.DNE(5,mn,2,1,"ng-container",205),t.k0s(),t.j41(6,"button",673),t.bIt("click",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.applyParsedTotalToCost())}),t.EFF(7,"Use total"),t.k0s()(),t.DNE(8,hn,10,9,"div",674),t.k0s()}if(2&s){const e=t.XpG(2);t.R7$(3),t.SpI("Invoice total: ",t.i5U(4,3,e.parsedInvoice.invoiceTotal,"1.2-2")," "),t.R7$(2),t.Y8G("ngIf",null==e.parsedInvoice?null:e.parsedInvoice.currency),t.R7$(3),t.Y8G("ngForOf",e.parsedInvoiceLines)}}function gn(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",704)(1,"button",705),t.bIt("click",function(){t.eBV(e);const i=t.XpG(3);return t.Njj(i.goRechargePrev())}),t.EFF(2," Prev "),t.k0s(),t.j41(3,"div",706),t.EFF(4),t.k0s(),t.j41(5,"button",705),t.bIt("click",function(){t.eBV(e);const i=t.XpG(3);return t.Njj(i.goRechargeNext())}),t.EFF(6," Next "),t.k0s()()}if(2&s){const e=t.XpG(3);t.R7$(),t.Y8G("disabled",!e.canGoRechargePrev()),t.R7$(3),t.Lme("Defect ",e.getRechargeTaskDisplayIndex()," of ",e.getRechargeTaskCount(),""),t.R7$(),t.Y8G("disabled",!e.canGoRechargeNext())}}function _n(s,r){if(1&s&&(t.j41(0,"div",61)(1,"mat-label",703),t.EFF(2,"Total Pending Cost (All Defects)"),t.k0s(),t.j41(3,"div",83)(4,"mat-form-field",50),t.nrm(5,"input",684),t.nI1(6,"number"),t.k0s()()()),2&s){const e=t.XpG(3);t.R7$(5),t.Y8G("value",t.i5U(6,1,e.getTotalPendingRechargeCostAmount(),"1.2-2"))}}function fn(s,r){if(1&s&&(t.j41(0,"mat-option",130),t.EFF(1),t.k0s()),2&s){const e=r.$implicit;t.Y8G("value",e.id),t.R7$(),t.SpI(" ",e.value," ")}}function bn(s,r){if(1&s&&(t.j41(0,"mat-option",130),t.EFF(1),t.k0s()),2&s){const e=r.$implicit;t.Y8G("value",e.id),t.R7$(),t.SpI(" ",e.value," ")}}function kn(s,r){if(1&s&&(t.j41(0,"mat-option",130),t.EFF(1),t.k0s()),2&s){const e=r.$implicit;t.Y8G("value",e.id),t.R7$(),t.SpI(" ",e.value," ")}}function vn(s,r){if(1&s&&(t.j41(0,"mat-option",130),t.EFF(1),t.k0s()),2&s){const e=r.$implicit;t.Y8G("value",e.id),t.R7$(),t.SpI(" ",e.value," ")}}function Dn(s,r){if(1&s&&(t.j41(0,"mat-option",130),t.EFF(1),t.k0s()),2&s){const e=r.$implicit;t.Y8G("value",e.id),t.R7$(),t.SpI(" ",e.value," ")}}function Cn(s,r){if(1&s&&(t.j41(0,"mat-option",130),t.EFF(1),t.k0s()),2&s){const e=r.$implicit;t.Y8G("value",e.id),t.R7$(),t.SpI(" ",e.value," ")}}function jn(s,r){if(1&s&&(t.j41(0,"mat-option",130),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&s){const e=r.$implicit;t.Y8G("value",e.id),t.R7$(),t.SpI(" ",t.bMT(2,2,e),"")}}function wn(s,r){if(1&s&&(t.j41(0,"div",61)(1,"mat-label",703),t.EFF(2,"Total Recharge Preview (All Defects)"),t.k0s(),t.j41(3,"div",83)(4,"mat-form-field",50),t.nrm(5,"input",684),t.nI1(6,"number"),t.k0s()()()),2&s){const e=t.XpG(3);t.R7$(5),t.Y8G("value",t.i5U(6,1,e.getTotalRechargeAmountPreview(),"1.2-2"))}}function In(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",680),t.DNE(1,gn,7,4,"div",681),t.j41(2,"div",682),t.EFF(3),t.k0s(),t.j41(4,"div",61)(5,"mat-label",683),t.EFF(6),t.k0s(),t.j41(7,"div",83)(8,"mat-form-field",50),t.nrm(9,"input",684),t.k0s()()(),t.j41(10,"div",61)(11,"mat-label",683),t.EFF(12,"Fleet Number"),t.k0s(),t.j41(13,"div",83)(14,"mat-form-field",50),t.nrm(15,"input",684),t.k0s()()(),t.j41(16,"div",61)(17,"mat-label",683),t.EFF(18),t.k0s(),t.j41(19,"div",83)(20,"mat-form-field",50),t.nrm(21,"input",684),t.k0s()()(),t.j41(22,"div",61)(23,"mat-label",683),t.EFF(24,"Customer (Asset Operator)"),t.k0s(),t.j41(25,"div",83)(26,"mat-form-field",50),t.nrm(27,"input",684),t.k0s()()(),t.j41(28,"div",61)(29,"mat-label",683),t.EFF(30,"Customer details"),t.k0s(),t.j41(31,"div",85)(32,"mat-form-field",50),t.nrm(33,"textarea",685),t.k0s()()(),t.j41(34,"div",61)(35,"mat-label",683),t.EFF(36,"Defect Creation Date (Raised On)"),t.k0s(),t.j41(37,"div",83)(38,"mat-form-field",50),t.nrm(39,"input",684),t.k0s()()(),t.j41(40,"div",61)(41,"mat-label",683),t.EFF(42,"Defect Category"),t.k0s(),t.j41(43,"div",83)(44,"mat-form-field",50),t.nrm(45,"input",684),t.k0s()()(),t.j41(46,"div",61)(47,"mat-label",683),t.EFF(48,"Cost Amou
1nt"),t.k0s(),t.j41(49,"div",83)(50,"mat-form-field",50),t.nrm(51,"input",684),t.nI1(52,"number"),t.k0s()()(),t.DNE(53,_n,7,4,"div",68),t.j41(54,"div",682),t.EFF(55),t.k0s(),t.j41(56,"div",61)(57,"mat-label",683),t.EFF(58),t.k0s(),t.j41(59,"div",83)(60,"mat-form-field",50)(61,"input",686),t.bIt("input",function(i){t.eBV(e);const o=t.XpG(2);return t.Njj(o.enforceMaxLimit(i))})("change",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.onRechargePercentChange())}),t.mxI("ngModelChange",function(i){t.eBV(e);const o=t.XpG(2);return t.DH7(o.rechargeModalData.rechargePercent,i)||(o.rechargeModalData.rechargePercent=i),t.Njj(i)}),t.k0s()()()(),t.j41(62,"div",61)(63,"mat-label",683),t.EFF(64),t.k0s(),t.j41(65,"div",83)(66,"mat-form-field",50),t.nrm(67,"input",684),t.nI1(68,"number"),t.k0s()()(),t.j41(69,"div",682),t.EFF(70),t.k0s(),t.j41(71,"div",687)(72,"div",688)(73,"div",61)(74,"div",689)(75,"mat-label",683),t.EFF(76),t.k0s(),t.j41(77,"div",83)(78,"mat-form-field",690)(79,"mat-select",691),t.mxI("ngModelChange",function(i){t.eBV(e);const o=t.XpG(2);return t.DH7(o.selectedTaskForRecharge.taskClassificationMainArea,i)||(o.selectedTaskForRecharge.taskClassificationMainArea=i),t.Njj(i)}),t.j41(80,"mat-option",130),t.EFF(81),t.k0s(),t.DNE(82,fn,2,2,"mat-option",132),t.k0s()()()(),t.j41(83,"div",689)(84,"mat-label",683),t.EFF(85,"Sub Category"),t.k0s(),t.j41(86,"div",83)(87,"mat-form-field",690)(88,"mat-select",692),t.mxI("ngModelChange",function(i){t.eBV(e);const o=t.XpG(2);return t.DH7(o.selectedTaskForRecharge.taskClassificationSubCategory,i)||(o.selectedTaskForRecharge.taskClassificationSubCategory=i),t.Njj(i)}),t.j41(89,"mat-option",130),t.EFF(90),t.k0s(),t.DNE(91,bn,2,2,"mat-option",132),t.k0s()()()()(),t.j41(92,"div",61)(93,"div",689)(94,"mat-label",683),t.EFF(95),t.k0s(),t.j41(96,"div",83)(97,"mat-form-field",690)(98,"mat-select",693),t.mxI("ngModelChange",function(i){t.eBV(e);const o=t.XpG(2);return t.DH7(o.selectedTaskForRecharge.taskClassificationComponent,i)||(o.selectedTaskForRecharge.taskClassificationComponent=i),t.Njj(i)}),t.j41(99,"mat-option",130),t.EFF(100),t.k0s(),t.DNE(101,kn,2,2,"mat-option",132),t.k0s()()()(),t.j41(102,"div",689)(103,"mat-label",683),t.EFF(104),t.k0s(),t.j41(105,"div",83)(106,"mat-form-field",690)(107,"mat-select",694),t.mxI("ngModelChange",function(i){t.eBV(e);const o=t.XpG(2);return t.DH7(o.selectedTaskForRecharge.taskClassificationAction,i)||(o.selectedTaskForRecharge.taskClassificationAction=i),t.Njj(i)}),t.j41(108,"mat-option",130),t.EFF(109),t.k0s(),t.DNE(110,vn,2,2,"mat-option",132),t.k0s()()()()(),t.j41(111,"div",61)(112,"div",689)(113,"mat-label",683),t.EFF(114),t.k0s(),t.j41(115,"div",83)(116,"mat-form-field",690)(117,"mat-select",695),t.mxI("ngModelChange",function(i){t.eBV(e);const o=t.XpG(2);return t.DH7(o.selectedTaskForRecharge.taskClassificationPosition,i)||(o.selectedTaskForRecharge.taskClassificationPosition=i),t.Njj(i)}),t.j41(118,"mat-option",130),t.EFF(119),t.k0s(),t.DNE(120,Dn,2,2,"mat-option",132),t.k0s()()()(),t.j41(121,"div",689)(122,"mat-label",683),t.EFF(123),t.k0s(),t.j41(124,"div",83)(125,"mat-form-field",690)(126,"mat-select",696),t.mxI("ngModelChange",function(i){t.eBV(e);const o=t.XpG(2);return t.DH7(o.selectedTaskForRecharge.taskClassificationReason,i)||(o.selectedTaskForRecharge.taskClassificationReason=i),t.Njj(i)}),t.j41(127,"mat-option",130),t.EFF(128),t.k0s(),t.DNE(129,Cn,2,2,"mat-option",132),t.k0s()()()()(),t.j41(130,"div",61)(131,"mat-label",683),t.EFF(132),t.k0s(),t.j41(133,"div",85)(134,"mat-form-field",690),t.nrm(135,"textarea",697),t.k0s()()()()(),t.j41(136,"div",698)(137,"mat-checkbox",699),t.mxI("ngModelChange",function(i){t.eBV(e);const o=t.XpG(2);return t.DH7(o.rechargeModalData.applyCustomerMargin,i)||(o.rechargeModalData.applyCustomerMargin=i),t.Njj(i)}),t.bIt("change",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.onApplyCustomerMarginChange())}),t.EFF(138),t.k0s(),t.j41(139,"mat-checkbox",87),t.mxI("ngModelChange",function(i){t.eBV(e);const o=t.XpG(2);return t.DH7(o.rechargeModalData.publishToPortal,i)||(o.rechargeModalData.publishToPortal=i),t.Njj(i)}),t.EFF(140),t.k0s()(),t.j41(141,"div",61)(142,"mat-label",683),t.EFF(143),t.k0s(),t.j41(144,"div",83)(145,"mat-form-field",50)(146,"input",700),t.bIt("change",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.onCustomerMarginPercentChange())}),t.mxI("ngModelChange",function(i){t.eBV(e);const o=t.XpG(2);return t.DH7(o.selectedTaskForRecharge.customerMarginPercentage,i)||(o.selectedTaskForRecharge.customerMarginPercentage=i),t.Njj(i)}),t.k0s()()()(),t.j41(147,"div",61)(148,"mat-label",701),t.EFF(149),t.j41(150,"span",63),t.EFF(151,"*"),t.k0s()(),t.j41(152,"div",83)(153,"mat-form-field",50)(154,"mat-select",702),t.mxI("ngModelChange",function(i){t.eBV(e);const o=t.XpG(2);return t.DH7(o.rechargeModalData.vatType,i)||(o.rechargeModalData.vatType=i),t.Njj(i)}),t.DNE(155,jn,3,4,"mat-option",132),t.k0s()()()(),t.j41(156,"div",61)(157,"mat-label",703),t.EFF(158),t.k0s(),t.j41(159,"div",83)(160,"mat-form-field",50),t.nrm(161,"input",684),t.nI1(162,"number"),t.k0s()()(),t.DNE(163,wn,7,4,"div",68),t.k0s()}if(2&s){const e=t.XpG(2);t.R7$(),t.Y8G("ngIf",e.getRechargeTaskCount()>1),t.R7$(2),t.JRh(e.master.datalist.RechargeCustomerDetails),t.R7$(3),t.JRh(e.master.datalist.VRM),t.R7$(3),t.Y8G("value",(null==e.objAssetData?null:e.objAssetData.vrm)||""),t.R7$(6),t.Y8G("value",(null==e.objAssetData?null:e.objAssetData.fleetNumber)||""),t.R7$(3),t.JRh(e.master.datalist.Supplier),t.R7$(3),t.Y8G("value",e.re
1chargeSupplierName),t.R7$(6),t.Y8G("value",e.getRechargeCustomerName()),t.R7$(6),t.Y8G("value",e.getRechargeCustomerDetails()),t.R7$(6),t.Y8G("value",e.getRechargeDefectRaisedOn()),t.R7$(6),t.Y8G("value",e.getRechargeDefectCategory()),t.R7$(6),t.Y8G("value",t.i5U(52,69,e.getRechargeCostAmount(),"1.2-2")),t.R7$(2),t.Y8G("ngIf",e.getRechargeTaskCount()>1),t.R7$(2),t.JRh(e.master.datalist.RechargeSettings),t.R7$(3),t.JRh(e.master.datalist.RechargePercentage),t.R7$(3),t.R50("ngModel",e.rechargeModalData.rechargePercent),t.R7$(3),t.JRh(e.master.datalist.BasePreviewAmount),t.R7$(3),t.Y8G("value",t.i5U(68,72,e.getRechargePreviewAmount(),"1.2-2")),t.R7$(3),t.JRh(e.master.datalist.DefectClassificationDetails),t.R7$(6),t.JRh(e.master.datalist.Category),t.R7$(3),t.R50("ngModel",e.selectedTaskForRecharge.taskClassificationMainArea),t.Y8G("disabled",!0),t.R7$(),t.Y8G("value",0),t.R7$(),t.JRh(e.master.datalist.Select),t.R7$(),t.Y8G("ngForOf",e.selectedTaskForRecharge.taskClassificationMainAreaOptions),t.R7$(6),t.R50("ngModel",e.selectedTaskForRecharge.taskClassificationSubCategory),t.Y8G("disabled",!0),t.R7$(),t.Y8G("value",0),t.R7$(),t.JRh(e.master.datalist.Select),t.R7$(),t.Y8G("ngForOf",e.selectedTaskForRecharge.taskClassificationSubCategoryOptions),t.R7$(4),t.JRh(e.master.datalist.Component),t.R7$(3),t.R50("ngModel",e.selectedTaskForRecharge.taskClassificationComponent),t.Y8G("disabled",!0),t.R7$(),t.Y8G("value",0),t.R7$(),t.JRh(e.master.datalist.Select),t.R7$(),t.Y8G("ngForOf",e.selectedTaskForRecharge.taskClassificationComponentOptions),t.R7$(3),t.JRh(e.master.datalist.Action),t.R7$(3),t.R50("ngModel",e.selectedTaskForRecharge.taskClassificationAction),t.Y8G("disabled",!0),t.R7$(),t.Y8G("value",0),t.R7$(),t.JRh(e.master.datalist.Select),t.R7$(),t.Y8G("ngForOf",e.selectedTaskForRecharge.taskClassificationActionOptions),t.R7$(4),t.JRh(e.master.datalist.Position),t.R7$(3),t.R50("ngModel",e.selectedTaskForRecharge.taskClassificationPosition),t.Y8G("disabled",!0),t.R7$(),t.Y8G("value",0),t.R7$(),t.JRh(e.master.datalist.Select),t.R7$(),t.Y8G("ngForOf",e.selectedTaskForRecharge.taskClassificationPositionOptions),t.R7$(3),t.JRh(e.master.datalist.Reason),t.R7$(3),t.R50("ngModel",e.selectedTaskForRecharge.taskClassificationReason),t.Y8G("disabled",!0),t.R7$(),t.Y8G("value",""),t.R7$(),t.JRh(e.master.datalist.Select),t.R7$(),t.Y8G("ngForOf",e.selectedTaskForRecharge.taskClassificationReasonOptions),t.R7$(3),t.JRh(e.master.datalist.ClassificationComment),t.R7$(3),t.Y8G("value",e.selectedTaskForRecharge.taskClassificationComment||""),t.R7$(2),t.R50("ngModel",e.rechargeModalData.applyCustomerMargin),t.R7$(),t.JRh(e.master.datalist.ApplyCustomerMargin),t.R7$(),t.R50("ngModel",e.rechargeModalData.publishToPortal),t.R7$(),t.JRh(e.master.datalist.PublishToPortal),t.R7$(3),t.JRh(e.master.datalist.CustomerMarginPercentage),t.R7$(3),t.Y8G("disabled",e.isCustomerMarginApplied()),t.R50("ngModel",e.selectedTaskForRecharge.customerMarginPercentage),t.R7$(3),t.JRh(e.master.datalist.VAT),t.R7$(5),t.R50("ngModel",e.rechargeModalData.vatType),t.R7$(),t.Y8G("ngForOf",e.master.taxRate),t.R7$(3),t.JRh(e.master.datalist.RechargePreviewTotal),t.R7$(3),t.Y8G("value",t.i5U(162,75,e.getRechargeAmountPreview(),"1.2-2")),t.R7$(2),t.Y8G("ngIf",e.getRechargeTaskCount()>1)}}function Rn(s,r){1&s&&(t.qex(0),t.j41(1,"span",710),t.EFF(2,"Supplier Request"),t.k0s(),t.bVm())}function Tn(s,r){if(1&s){const e=t.RV6();t.j41(0,"mat-radio-group",711),t.mxI("ngModelChange",function(i){t.eBV(e);const o=t.XpG(3);return t.DH7(o.objJobData.requestType,i)||(o.objJobData.requestType=i),t.Njj(i)}),t.bIt("change",function(){t.eBV(e);const i=t.XpG(3);return t.Njj(i.requesTypeChanged())}),t.j41(1,"mat-radio-button",130),t.EFF(2," Supplier Request "),t.k0s(),t.nrm(3,"br"),t.j41(4,"mat-radio-button",130),t.EFF(5," Customer Request "),t.k0s()()}if(2&s){const e=t.XpG(3);t.R50("ngModel",e.objJobData.requestType),t.R7$(),t.Y8G("value",e.JobRequestType.SupplierRequest),t.R7$(3),t.Y8G("value",e.JobRequestType.CustomerRequest)}}function Sn(s,r){if(1&s&&(t.j41(0,"mat-label",707),t.EFF(1,"Request Type: "),t.k0s(),t.j41(2,"div",708),t.DNE(3,Rn,3,0,"ng-container",709)(4,Tn,6,3,"ng-template",null,32,t.C5r),t.k0s()),2&s){const e=t.sdS(5),a=t.XpG(2);t.R7$(3),t.Y8G("ngIf",a.isEmergencyRequestMode)("ngIfElse",e)}}function xn(s,r){if(1&s&&(t.j41(0,"mat-label",712),t.EFF(1,"Request Mode: "),t.k0s(),t.j41(2,"div",708)(3,"span",710),t.EFF(4),t.k0s()()),2&s){const e=t.XpG(2);t.R7$(4),t.JRh(e.master.datalist.Emergency)}}function yn(s,r){if(1&s){const e=t.RV6();t.j41(0,"mat-label",713),t.EFF(1,"Allocation Time: "),t.k0s(),t.j41(2,"div",708)(3,"mat-radio-group",711),t.mxI("ngModelChange",function(i){t.eBV(e);const o=t.XpG(2);return t.DH7(o.objJobData.dayFilter,i)||(o.objJobData.dayFilter=i),t.Njj(i)}),t.bIt("change",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.dataModified())}),t.j41(4,"mat-radio-button",130),t.EFF(5," AM "),t.k0s(),t.nrm(6,"br"),t.j41(7,"mat-radio-button",130),t.EFF(8," PM "),t.k0s(),t.nrm(9,"br"),t.j41(10,"mat-radio-button",130),t.EFF(11," All Day "),t.k0s()()()}if(2&s){const e=t.XpG(2);t.R7$(3),t.R50("ngModel",e.objJobData.dayFilter),t.R7$(),t.Y8G("value",e.JobDayFilter.AM),t.R7$(3),t.Y8G("value",e.JobDayFilter.PM),t.R7$(3),t.Y8G("value",e.JobDayFilter.AllDay)}}function Fn(s,r){if(1&s){const e=t.RV6();t.j41(0,"mat-label",714),t.EFF(1),t.k0s(),t.j41(2,"div",715)(3,"mat-form-field",65)(4,"input",716,33),t.mxI("ngModelChange",function(i){t.eBV(e);const o=t.XpG(2);return t.DH7(o.objScheduleData.customerReference,i)||(o.objScheduleData.customerReference=i),t.Njj(i)}),t.bIt("ngModelChange",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.dataModified())}),t.k0s()()()}if(2&s){const e=t.XpG(2);t.R7$(),t.SpI(" ",e.master.datalist.Reference,": "),t.R7$(3),t.R50("ngModel",e.objScheduleData.customerReference)}}function Nn(s,r){if(1&s&&(t.j41(0,"mat-option",130),t.EFF(1),t.k0s()),2&s){const e=r.$implicit;t.Y8G("value",e.id),t.R7$(),t.SpI(" ",e.en," ")}}function Jn(s,r){if(1&s){const e=t.RV6();t.j41(0,"mat-label",717),t.EFF(1," WorkFlow Status:"),t.j41(2,"span",63),t.EFF(3,"*"),t.k0s()(),t.j41(4,"div",708)(5,"mat-form-field",65)(6,"mat-select",718),t.mxI("ngModelChange",function(i){t.eBV(e);const o=t.XpG(2);return t.DH7(o.objJobData.workflowStatusID,i)||(o.objJobData.workflowStatusID=i),t.Njj(i)}),t.bIt("selectionChange",function(i){t.eBV(e);const o=t.XpG(2);return t.Njj(o.onChangeWorkFlowStatus(i.value))}),t.j41(7,"mat-option",719),t.EFF(8,"--- Select WorkFlow Status ---"),t.k0s(),t.DNE(9,Nn,2,2,"mat-option",132),t.k0s()()()}if(2&s){const e=t.XpG(2);t.R7$(6),t.R50("ngModel",e.objJobData.workflowStatusID),t.Y8G("disabled",!e.canEditWorkflowStatus)("compareWith",e.compareWorkflowStatus),t.R7$(),t.Y8G("value",""),t.R7$(2),t.Y8G("ngForOf",e.workFlowStatusList)}}function Bn(s,r){if(1&s){const e=t.RV6();t.j41(0,"mat-label",720),t.EFF(1),t.k0s(),t.j41(2,"div",721)(3,"mat-form-field",50)(4,"textarea",722),t.mxI("ngModelChange",function(i){t.eBV(e);const o=t.XpG(2);
1return t.DH7(o.objJobData.jobComment,i)||(o.objJobData.jobComment=i),t.Njj(i)}),t.bIt("ngModelChange",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.dataModified())}),t.k0s()()()}if(2&s){const e=t.XpG(2);t.R7$(),t.SpI(" ",e.master.datalist.Comment,": "),t.R7$(3),t.R50("ngModel",e.objJobData.jobComment)}}function Mn(s,r){if(1&s&&(t.j41(0,"mat-option",130),t.EFF(1),t.k0s()),2&s){const e=r.$implicit;t.Y8G("value",e.id),t.R7$(),t.SpI(" ",e.value," ")}}function An(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",708)(1,"mat-form-field",65)(2,"mat-select",725),t.mxI("ngModelChange",function(i){t.eBV(e);const o=t.XpG(3);return t.DH7(o.objScheduleData.customerID,i)||(o.objScheduleData.customerID=i),t.Njj(i)}),t.bIt("selectionChange",function(i){t.eBV(e);const o=t.XpG(3);return t.Njj(o.onCustomerChange(i))}),t.DNE(3,Mn,2,2,"mat-option",132),t.k0s()()()}if(2&s){const e=t.XpG(3);t.R7$(2),t.R50("ngModel",e.objScheduleData.customerID),t.Y8G("title",e.master.getCompanyName(e.objScheduleData.customerID)),t.R7$(),t.Y8G("ngForOf",e.CustomerList)}}function En(s,r){if(1&s&&(t.j41(0,"mat-option",130),t.EFF(1),t.k0s()),2&s){const e=r.$implicit;t.Y8G("value",e.id),t.R7$(),t.SpI(" ",e.value," ")}}function Gn(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",708)(1,"mat-form-field",65)(2,"mat-select",726),t.mxI("ngModelChange",function(i){t.eBV(e);const o=t.XpG(3);return t.DH7(o.objJobData.customerID,i)||(o.objJobData.customerID=i),t.Njj(i)}),t.DNE(3,En,2,2,"mat-option",132),t.k0s()()()}if(2&s){const e=t.XpG(3);t.R7$(2),t.R50("ngModel",e.objJobData.customerID),t.Y8G("disabled",!0)("title",e.master.getCompanyName(e.objJobData.customerID)),t.R7$(),t.Y8G("ngForOf",e.CustomerList)}}function Pn(s,r){if(1&s&&(t.j41(0,"mat-label",723),t.EFF(1),t.j41(2,"span",63),t.EFF(3,"*"),t.k0s()(),t.DNE(4,An,4,3,"div",724)(5,Gn,4,4,"div",724)),2&s){const e=t.XpG(2);t.R7$(),t.SpI(" ",e.master.datalist.BookedBy,":"),t.R7$(3),t.Y8G("ngIf",e.jobStatus===e.JobStatus.unplanned),t.R7$(),t.Y8G("ngIf",e.jobStatus!==e.JobStatus.unplanned)}}function On(s,r){if(1&s&&(t.j41(0,"mat-option",130),t.EFF(1),t.k0s()),2&s){const e=r.$implicit;t.Y8G("value",e.id),t.R7$(),t.SpI(" ",e.value," ")}}function Ln(s,r){if(1&s){const e=t.RV6();t.qex(0),t.j41(1,"mat-form-field",65)(2,"mat-select",728),t.mxI("ngModelChange",function(i){t.eBV(e);const o=t.XpG(3);return t.DH7(o.objScheduleData.workshopID,i)||(o.objScheduleData.workshopID=i),t.Njj(i)}),t.bIt("selectionChange",function(i){t.eBV(e);const o=t.XpG(3);return t.Njj(o.onchangeworkshp(i.value))}),t.j41(3,"mat-option"),t.nrm(4,"ngx-mat-select-search",729),t.k0s(),t.j41(5,"mat-option",719),t.EFF(6,"--- Select Workshop --- "),t.k0s(),t.DNE(7,On,2,2,"mat-option",132),t.nI1(8,"async"),t.k0s()(),t.bVm()}if(2&s){const e=t.XpG(3);t.R7$(2),t.R50("ngModel",e.objScheduleData.workshopID),t.Y8G("title",e.master.getCompanyName(e.objScheduleData.workshopID,!0)),t.R7$(2),t.Y8G("formControl",e.workshopFilterCtrl),t.R7$(),t.Y8G("value",""),t.R7$(2),t.Y8G("ngForOf",t.bMT(8,5,e.filteredWorkshops))}}function $n(s,r){if(1&s&&(t.j41(0,"mat-option",130),t.EFF(1),t.k0s()),2&s){const e=r.$implicit;t.Y8G("value",e.id),t.R7$(),t.SpI(" ",e.value," ")}}function Vn(s,r){if(1&s){const e=t.RV6();t.qex(0),t.j41(1,"mat-form-field",65)(2,"mat-select",730),t.mxI("ngModelChange",function(i){t.eBV(e);const o=t.XpG(3);return t.DH7(o.objJobData.workshopID,i)||(o.objJobData.workshopID=i),t.Njj(i)}),t.bIt("selectionChange",function(i){t.eBV(e);const o=t.XpG(3);return t.Njj(o.onchangeworkshp(i.value,!0,!0))}),t.j41(3,"mat-option"),t.nrm(4,"ngx-mat-select-search",729),t.k0s(),t.j41(5,"mat-option",719),t.EFF(6,"--- Select Workshop --- "),t.k0s(),t.DNE(7,$n,2,2,"mat-option",132),t.nI1(8,"async"),t.k0s()(),t.bVm()}if(2&s){const e=t.XpG(3);t.R7$(2),t.R50("ngModel",e.objJobData.workshopID),t.Y8G("disabled",e.jobStatus>e.JobStatus.onSite)("title",e.master.getCompanyName(e.objJobData.workshopID,!0)),t.R7$(2),t.Y8G("formControl",e.workshopFilterCtrl),t.R7$(),t.Y8G("value",""),t.R7$(2),t.Y8G("ngForOf",t.bMT(8,6,e.filteredWorkshops))}}function Hn(s,r){if(1&s&&(t.j41(0,"mat-label",727),t.EFF(1),t.j41(2,"span",63),t.EFF(3,"*"),t.k0s()(),t.j41(4,"div",708),t.DNE(5,Ln,9,7,"ng-container",205)(6,Vn,9,8,"ng-container",205),t.k0s()),2&s){const e=t.XpG(2);t.R7$(),t.SpI(" ",e.master.datalist.Workshop,":"),t.R7$(4),t.Y8G("ngIf",e.jobStatus===e.JobStatus.unplanned),t.R7$(),t.Y8G("ngIf",e.jobStatus!=e.JobStatus.unplanned)}}function Yn(s,r){if(1&s&&(t.j41(0,"mat-option",130),t.EFF(1),t.k0s()),2&s){const e=r.$implicit,a=t.XpG(3);t.Y8G("value",e.id),t.R7$(),t.SpI(" ",e[a.master.displayLang]," ")}}function Un(s,r){if(1&s){const e=t.RV6();t.j41(0,"mat-label",731),t.EFF(1),t.k0s(),t.j41(2,"div",732)(3,"mat-form-field",733)(4,"mat-select",734),t.mxI("ngModelChange",function(i){t.eBV(e);const o=t.XpG(2);return t.DH7(o.objJobData.locationCategoryId,i)||(o.objJobData.locationCategoryId=i),t.Njj(i)}),t.bIt("selectionChange",function(i){t.eBV(e);const o=t.XpG(2);return o.onJobWorkshopLocationChange(i.value),t.Njj(o.dataModified())}),t.j41(5,"mat-option",719),t.EFF(6,"--- Select Location --- "),t.k0s(),t.DNE(7,Yn,2,2,"mat-option",132),t.k0s()(),t.j41(8,"button",735)(9,"mat-icon"),t.nrm(10,"img",736),t.k0s()(),t.j41(11,"mat-menu",null,34)(13,"button",737),t.bIt("click",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.showJobWorkshopLocationLookupModal(i.jobWorkshopLocationLookupName,"AddLocation"))}),t.EFF(14,"Add "),t.k0s(),t.j41(15,"button",737),t.bIt("click",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.showJobWorkshopLocationLookupModal(i.jobWorkshopLocationLookupName,"EditLocation"))}),t.EFF(16,"Edit "),t.k0s(),t.j41(17,"button",738),t.bIt("click",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.deleteLookup(i.Constants.JobWorkshopLocations))}),t.EFF(18,"Delete "),t.k0s()()()}if(2&s){const e=t.sdS(12),a=t.XpG(2);t.R7$(),t.SpI(" ",a.master.datalist.WorkArea,": "),t.R7$(3),t.R50("ngModel",a.objJobData.locationCategoryId),t.R7$(),t.Y8G("value",0),t.R7$(2),t.Y8G("ngForOf",a.master.jobWorkshopLocations),t.R7$(),t.Y8G("matMenuTriggerFor",e),t.R7$(9),t.Y8G("disabled",!a.canDeleteWorkshopLocation())}}function Xn(s,r){if(1&s&&(t.j41(0,"th",747),t.EFF(1),t.k0s()),2&s){const e=r.$implicit;t.Y8G("id","weekNum"+e.weekNumber),t.R7$(),t.SpI(" ",e.weekNumber," ")}}function Wn(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",751),t.bIt("keypress",function(){t.eBV(e);const i=t.XpG().$implicit,o=t.XpG(5);return t.Njj(o.navigateToAsset(i.id))})("click",function(){t.eBV(e);const i=t.XpG().$implicit,o=t.XpG(5);return t.Njj(o.navigateToAsset(i.id))}),t.j41(1,"div",752),t.EFF(2),t.k0s()()}if(2&s){const e=t.XpG().$implicit;t.R7$(2),t.SpI(" ",e.vrm," ")}}function qn(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",758),t.bIt("keypress",function(){t.eBV(e);const i=t.XpG().$implicit,o=t.XpG(7);return t.Njj(o.navigateToTask(i))})("click",function(){t.eBV(e);const i=t.XpG().$implicit,o=t.XpG(7);return t.Njj(o.navigateToTask(i))}),t.j41(1,"div",759),t.EFF(2),t.k0s()()}2&s&&(t.R7$(2),t.SpI("","J"," "))}function zn(s,r){1&s&&t.nrm(0,"div")}function Qn(s,r){if(1&s&&(t.j41(0,"div"),t.DNE(1,qn,3,1,"div",753),t.j41(2,"div",754)(3,"div",755)(4,"div",756),t.EFF(5),t.k0s(),t.j41(6,"label",755),t.EFF(7),t.k0s(),t.j41(8,"label",757),t.EFF(9),t.k0s()(),t.j41(10,"div",755),t.EFF(11),t.k0s(),t.j41(12,"div",755),t.EFF(13),t.k0s()(),t.DNE(14,zn,1,0,"div",205),t.k0s()),2&s){const e=r.$implicit;t.R7$(),t.Y8G("ngIf",null!=e),t.R7$(4),t.SpI(" ","J"," "),t.R7$(2),t.JRh(e.name),t.R7$(2),t.JRh(e.jobStatus),t.R7$(2),t.JRh(e.taskWorkshop),t.R7$(2),t.JRh(e.taskDate),t.R7$(),t.Y8G("ngIf",null==e)}}function Kn(s,r){if(1&s&&(t.j41(0,"div"),t.DNE(1,Qn,15,7,"div",210),t.k0s()),2&s){const e=t.XpG().$implicit;t.R7$(),t.Y8G("ngForOf",e)}}function Zn(s,r){if(1&s&&(t.j41(0,"td",749),t.DNE(1,Wn,3,1,"div",750)(2,Kn,2,1,"div",205),t.k0s()),2&s){const e=r.index;t.R7$(),t.Y8G("ngIf",0==e),t.R7$(),t.Y8G("ngIf",0!=e)}}function tr(s,r){if(1&s&&(t.j41(0,"tr",743),t.DNE(1,Zn,3,2,"td",748),t.k0s()),2&s){const e=r.$implicit;t.R7$(),t.Y8G("ngForOf",e)}}function er(s,r){if(1&s&&(t.j41(0,"div",741)(1,"table",742,35)(3,"thead")(4,"tr",743)(5,"th",744),t.EFF(6," ISO Week "),t.k0s(),t.DNE(7,Xn,2,2,"th",745),t.k0s()(),t.j41(8,"tbody"),t.DNE(9,tr,2,1,"tr",746),t.k0s()()()),2&s){const e=t.XpG(3);t.R7$(7),t.Y8G("ngForOf",e.weekNumber),t.R7$(2),t.Y8G("ngForOf",e.assetJoblists)}}function ar(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",760)(1,"button",761),t.bIt("click",function(){t.eBV(e);const i=t.XpG(3);return t.Njj(i.getDefectList(!1))}),t.EFF(2,"Defects - Last 4 Weeks"),t.k0s(),t.j41(3,"button",762),t.bIt("click",function(){t.eBV(e);const i=t.XpG(3);return t.Njj(i.getDefectList(!0))}),t.EFF(4,"Defects - Since Last Inspection"),t.k0s()()}}function ir(s,r){if(1&s&&t.DNE(0,er,10,2,"div",739)(1,ar,5,0,"div",740),2&s){const e=t.XpG(2);t.Y8G("ngIf",e.assetId),t.R7$(),t.Y8G("ngIf",e.jobStatus!=e.JobStatus.unplanned&&e.jobStatus!=e.JobStatus.cancelled)}}function or(s,r){if(1&s){const e=t.RV6();t.j41(0,"mat-form-field",65)(1,"input",773),t.mxI("ngModelChange",function(i){t.eBV(e);const o=t.XpG(3);return t.DH7(o.objScheduleData.plannedDate,i)||(o.objScheduleData.plannedDate=i),t.Njj(i)}),t.bIt("dateChange",function(){t.eBV(e);const i=t.XpG(3);return i.objScheduleData.recurringEvent&&i.comparisonStartdateValidator(),i.schedulerDateChanged=!0,i.dataModified(),t.Njj(i.backdateAction())}),t.k0s(),t.nrm(2,"mat-datepicker-toggle",67)(3,"mat-datepicker",null,36),t.k0s()}if(2&s){const e=t.sdS(4),a=t.XpG(3);t.R7$(),t.R50("ngModel",a.objScheduleData.plannedDate),t.Y8G("min",a.createJobRequest&&a.master.minDate||a.minMaxDateForDeleteJob.min||(a.checkBackdateRolePermission()?null:a.master.minDate))("matDatepicker",e)("max",a.minMaxDateForDeleteJob.max),t.R7$(),t.Y8G("for",e)}}function sr(s,r){if(1&s){const e=t.RV6();t.j41(0,"mat-form-field",65)(1,"input",774),t.mxI("ngModelChange",function(i){t.eBV(e);const o=t.XpG(3);
1return t.DH7(o.objJobData.dateBooked,i)||(o.objJobData.dateBooked=i),t.Njj(i)}),t.k0s(),t.nrm(2,"mat-datepicker-toggle",775)(3,"mat-datepicker",null,37),t.k0s()}if(2&s){const e=t.sdS(4),a=t.XpG(3);t.R7$(),t.R50("ngModel",a.objJobData.dateBooked),t.Y8G("min",a.master.minDate)("matDatepicker",e),t.R7$(),t.Y8G("for",e)("disabled",!0)}}function nr(s,r){if(1&s&&(t.j41(0,"mat-option",130),t.EFF(1),t.k0s()),2&s){const e=r.$implicit;t.Y8G("value",e.value),t.R7$(),t.SpI(" ",e.name," ")}}function rr(s,r){if(1&s&&(t.j41(0,"mat-option",130),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&s){const e=r.$implicit;t.Y8G("value",e.id),t.R7$(),t.SpI(" ",t.bMT(2,2,e)," ")}}function lr(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",776)(1,"div",767)(2,"mat-label",777),t.EFF(3),t.k0s(),t.j41(4,"div",708)(5,"mat-form-field",778)(6,"input",779),t.mxI("ngModelChange",function(i){t.eBV(e);const o=t.XpG(3);return t.DH7(o.objScheduleData.every,i)||(o.objScheduleData.every=i),t.Njj(i)}),t.bIt("ngModelChange",function(){t.eBV(e);const i=t.XpG(3);return t.Njj(i.dataModified())})("change",function(){t.eBV(e);const i=t.XpG(3);return t.Njj(i.validateEvery())}),t.k0s()(),t.j41(7,"mat-form-field",780)(8,"mat-select",781),t.mxI("ngModelChange",function(i){t.eBV(e);const o=t.XpG(3);return t.DH7(o.objScheduleData.interval,i)||(o.objScheduleData.interval=i),t.Njj(i)}),t.bIt("selectionChange",function(){t.eBV(e);const i=t.XpG(3);return t.Njj(i.dataModified())}),t.DNE(9,rr,3,4,"mat-option",132),t.k0s()()()()()}if(2&s){const e=t.XpG(3);t.R7$(3),t.SpI(" ",e.master.datalist.JobEvery,": "),t.R7$(3),t.R50("ngModel",e.objScheduleData.every),t.Y8G("min",1)("max",999)("decimal",!1),t.R7$(),t.Y8G("ngClass",t.eq3(8,A,!e.jobId||e.isUpdatingJobTask?"every-interval-custwidth":"")),t.R7$(),t.R50("ngModel",e.objScheduleData.interval),t.R7$(),t.Y8G("ngForOf",e.master.jobInterval)}}function dr(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",776)(1,"div",767)(2,"mat-label",782),t.EFF(3," Predictive Scheduling: "),t.k0s(),t.j41(4,"div",708)(5,"mat-checkbox",783),t.mxI("ngModelChange",function(i){t.eBV(e);const o=t.XpG(3);return t.DH7(o.objScheduleData.predictiveScheduling,i)||(o.objScheduleData.predictiveScheduling=i),t.Njj(i)}),t.bIt("ngModelChange",function(){t.eBV(e);const i=t.XpG(3);return t.Njj(i.dataModified())}),t.k0s()()()()}if(2&s){const e=t.XpG(3);t.R7$(5),t.R50("ngModel",e.objScheduleData.predictiveScheduling)}}function cr(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",635)(1,"div",767)(2,"mat-label",777),t.EFF(3),t.k0s(),t.j41(4,"div",708)(5,"mat-form-field",65)(6,"input",784),t.mxI("ngModelChange",function(i){t.eBV(e);const o=t.XpG(3);return t.DH7(o.objScheduleData.endDate,i)||(o.objScheduleData.endDate=i),t.Njj(i)}),t.bIt("dateChange",function(){t.eBV(e);const i=t.XpG(3);return i.objScheduleData.recurringEvent&&i.comparisonEnddateValidator(),t.Njj(i.dataModified())}),t.k0s(),t.nrm(7,"mat-datepicker-toggle",67)(8,"mat-datepicker",null,38),t.k0s()()()()}if(2&s){const e=t.sdS(9),a=t.XpG(3);t.R7$(3),t.SpI(" ",a.master.datalist.JobEndDate,": "),t.R7$(3),t.R50("ngModel",a.objScheduleData.endDate),t.Y8G("matDatepicker",e)("min",a.master.minDate),t.R7$(),t.Y8G("for",e)}}function pr(s,r){1&s&&t.eu8(0)}function mr(s,r){if(1&s&&(t.j41(0,"div",785)(1,"div",786),t.DNE(2,pr,1,0,"ng-container",284),t.k0s()()),2&s){t.XpG(2);const e=t.sdS(204);t.R7$(2),t.Y8G("ngTemplateOutlet",e)}}function hr(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",763)(1,"div",764)(2,"mat-label",765),t.EFF(3),t.k0s(),t.j41(4,"div",708),t.DNE(5,or,5,5,"mat-form-field",766)(6,sr,5,5,"mat-form-field",766),t.k0s()()(),t.j41(7,"div",763)(8,"div",767)(9,"mat-label",768),t.EFF(10),t.k0s(),t.j41(11,"div",708)(12,"mat-form-field",65)(13,"mat-select",769),t.mxI("ngModelChange",function(i){t.eBV(e);const o=t.XpG(2);return t.DH7(o.objScheduleData.recurringEvent,i)||(o.objScheduleData.recurringEvent=i),t.Njj(i)}),t.DNE(14,nr,2,2,"mat-option",132),t.k0s()()()()(),t.DNE(15,lr,10,10,"div",770)(16,dr,6,1,"div",770)(17,cr,10,5,"div",771)(18,mr,3,1,"div",772)}if(2&s){const e=t.XpG(2);t.R7$(3),t.SpI(" ",e.master.datalist.JobStartDate,": "),t.R7$(2),t.Y8G("ngIf",e.jobStatus===e.JobStatus.unplanned),t.R7$(),t.Y8G("ngIf",e.jobStatus!=e.JobStatus.unplanned),t.R7$(4),t.SpI(" ",e.master.datalist.RepeatJob,"
1: "),t.R7$(3),t.R50("ngModel",e.objScheduleData.recurringEvent),t.Y8G("disabled",e.createJobRequest||e.jobStatus!=e.JobStatus.unplanned),t.R7$(),t.Y8G("ngForOf",e.repeatJobOptions),t.R7$(),t.Y8G("ngIf",e.objScheduleData.recurringEvent),t.R7$(),t.Y8G("ngIf",e.objScheduleData.recurringEvent),t.R7$(),t.Y8G("ngIf",e.objScheduleData.recurringEvent),t.R7$(),t.Y8G("ngIf",e.jobId&&!e.isUpdatingJobTask)}}function ur(s,r){if(1&s){const e=t.RV6();t.j41(0,"app-asset-search",787),t.bIt("sendSelectedAsset",function(i){t.eBV(e);const o=t.XpG(2);return t.Njj(o.getSelectedAsset(i))}),t.k0s()}if(2&s){const e=t.XpG(2);t.Y8G("fromWorkShop",e.fromWorkShop)("parentAssetId",e.assetId)("blnAssetWorkShop",!0)}}function gr(s,r){if(1&s&&(t.j41(0,"div"),t.EFF(1),t.k0s()),2&s){const e=t.XpG(2);t.R7$(),t.Lme("\xa0\xa0 Every ",e.selectedTaskSvc.every,"\xa0\xa0",e.selectedTaskSvc.serviceUsageBasedDesc,"")}}function _r(s,r){1&s&&(t.j41(0,"span"),t.EFF(1,"or\xa0"),t.k0s())}function fr(s,r){if(1&s&&(t.j41(0,"div"),t.EFF(1,"\xa0\xa0"),t.DNE(2,_r,2,0,"span",205),t.EFF(3),t.k0s()),2&s){const e=t.XpG(2);t.R7$(2),t.Y8G("ngIf",e.selectedTaskSvc.usageBased),t.R7$(),t.Lme(" Every ",e.selectedTaskSvc.alternateEveryUsage,"\xa0\xa0",e.selectedTaskSvc.serviceAlternateUsageBasedDesc," ")}}function br(s,r){1&s&&(t.j41(0,"span"),t.EFF(1,",\xa0"),t.k0s())}function kr(s,r){if(1&s&&(t.j41(0,"div")(1,"div"),t.EFF(2),t.DNE(3,br,2,0,"span",205),t.k0s()()),2&s){const e=r.$implicit,a=r.index,i=t.XpG(2);t.R7$(2),t.SpI("",e.name," "),t.R7$(),t.Y8G("ngIf",a<i.selectedTaskSvc.checkSheet.length-1)}}function vr(s,r){if(1&s){const e=t.RV6();t.j41(0,"app-add-defects",788),t.bIt("taskClassificationMainAreaChange",function(i){t.eBV(e);const o=t.XpG(2);return t.Njj(o.onTaskClassificationMainAreaChange(i,o.selectedTaskSvc))})("taskClassificationSubCategoryChange",function(i){t.eBV(e);const o=t.XpG(2);return t.Njj(o.onTaskClassificationSubCategoryChange(i,o.selectedTaskSvc))})("taskClassificationComponentChange",function(i){t.eBV(e);const o=t.XpG(2);return t.Njj(o.onTaskClassificationComponentChange(i,o.selectedTaskSvc))})("taskClassificationActionChange",function(i){t.eBV(e);const o=t.XpG(2);return t.Njj(o.onTaskClassificationActionChange(i,o.selectedTaskSvc))})("taskClassificationPositionChange",function(i){t.eBV(e);const o=t.XpG(2);return t.Njj(o.onTaskClassificationPositionChange(i,o.selectedTaskSvc))})("taskClassificationReasonChange",function(i){t.eBV(e);const o=t.XpG(2);return t.Njj(o.onTaskClassificationReasonChange(i,o.selectedTaskSvc))})("taskClassificationCommentBlur",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.onTaskClassificationCommentChange(i.selectedTaskSvc))})("SendCancelCommentHist",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.cancelFromDefectCommentHist())})("reloadData",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.needReloadData())}),t.k0s()}if(2&s){const e=t.XpG(2);t.Y8G("jobIdForSaveDefectComment",e.jobId)("defectRepairId",e.selectedTaskSvc.DefectRepairId)("defectTaskID",e.selectedTaskSvc.id)("taskClassificationData",e.selectedTaskSvc)("taskClassificationActionOptions",e.taskClassificationActionOptions)("taskClassificationReasonOptions",e.taskClassificationReasonOptions)("disableTaskClassificationEdit",e.jobStatus==e.JobStatus.onShow)}}function Dr(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",101),t.DNE(1,ta,4,2,"div",102),t.j41(2,"div",103),t.DNE(3,ui,15,7,"div",104)(4,gi,2,4,"ng-template",null,4,t.C5r)(6,_i,2,4,"ng-template",null,5,t.C5r)(8,fi,2,3,"ng-template",null,6,t.C5r)(10,ki,1,1,"ng-template",null,7,t.C5r)(12,Di,1,1,"ng-template",null,8,t.C5r)(14,wi,6,1,"div",102),t.j41(15,"div",105),t.DNE(16,Ii,2,1,"span",106),t.j41(17,"mat-tab-group",107),t.bIt("selectedTabChange",function(i){t.eBV(e);const o=t.XpG();return t.Njj(o.onTabChanged(i))}),t.DNE(18,Si,2,0,"mat-tab",108)(19,Ji,2,1,"mat-tab",109),t.j41(20,"mat-tab",110),t.DNE(21,Wo,5,3,"ng-template",111),t.k0s(),t.DNE(22,Qo,2,1,"mat-tab",112)(23,es,2,0,"mat-tab",113)(24,is,27,18,"mat-tab",114)(25,ss,2,0,"mat-tab",115)(26,rs,2,0,"mat-tab",116)(27,ds,2,0,"mat-tab",117)(28,ms,2,0,"mat-tab",118)(29,gs,5,2,"mat-tab",119),t.k0s()(),t.DNE(30,Cs,15,10,"div",120),t.k0s(),t.DNE(31,Xs,14,9,"ng-template",null,9,t.C5r)(33,zs,1,1,"ng-template",null,10,t.C5r)(35,Zs,5,1,"ng-template",null,11,t.C5r)(37,an,5,1,"ng-template",null,12,t.C5r),t.j41(39,"app-model",93)(40,"div",43)(41,"div",44)(42,"div",95),t.EFF(43),t.j41(44,"button",121),t.bIt("click",function(){t.eBV(e);const i=t.XpG();return t.Njj(i.closeCreateJobRequestModel())}),t.j41(45,"mat-icon",122),t.EFF(46," close "),t.k0s(),t.EFF(47," Close "),t.k0s()()(),t.j41(48,"div",47)(49,"div",123)(50,"app-view-job-request-details",124),t.bIt("startSaveProcess",function(i){t.eBV(e);const o=t.XpG();return t.Njj(o.startSaveJobRequest(i))})("closeModal",function(){t.eBV(e);const i=t.XpG();return t.Njj(i.closeCreateJobRequestModel())}),t.k0s()()()()(),t.j41(51,"app-model",93)(52,"div",43)(53,"div",44)(54,"div",95),t.EFF(55),t.j41(56,"button",125),t.bIt("click",function(){t.eBV(e);const i=t.XpG();return t.Njj(i.closeTaskCostModal())}),t.j41(57,"mat-icon",126),t.EFF(58," close "),t.k0s(),t.EFF(59," Close "),t.k0s()()(),t.j41(60,"div",47)(61,"div",127)(62,"div",61)(63,"mat-label",128),t.EFF(64),t.j41(65,"span",63),t.EFF(66,"*"),t.k0s()(),t.j41(67,"div",83)(68,"mat-form-field",50)(69,"mat-select",129),t.mxI("ngModelChange",function(i){t.eBV(e);const o=t.XpG();return t.DH7(o.taskCostForm.supplierId,i)||(o.taskCostForm.supplierId=i),t.Njj(i)}),t.j41(70,"mat-option",130),t.EFF(71),t.k0s(),t.j41(72,"mat-option"),t.nrm(73,"ngx-mat-select-search",131),t.k0s(),t.DNE(74,on,2,2,"mat-option",132),t.nI1(75,"async"),t.k0s()()()(),t.j41(76,"div",61)(77,"mat-label",133),t.EFF(78,"Cost Event"),t.j41(79,"span",63),t.EFF(80,"*"),t.k0s()(),t.j41(81,"div",83)(82,"mat-form-field",50)(83,"mat-select",134),t.mxI("ngModelChange",function(i){t.eBV(e);const o=t.XpG();return t.DH7(o.taskCostForm.costEventId,i)||(o.taskCostForm.costEventId=i),t.Njj(i)}),t.j41(84,"mat-option",130),t.EFF(85),t.k0s(),t.DNE(86,sn,2,2,"mat-option",132),t.k0s()()()(),t.j41(87,"div",61)(88,"mat-label",135),t.EFF(89,"Cost Amou
1nt"),t.j41(90,"span",63),t.EFF(91,"*"),t.k0s()(),t.j41(92,"div",83)(93,"mat-form-field",50)(94,"input",136),t.mxI("ngModelChange",function(i){t.eBV(e);const o=t.XpG();return t.DH7(o.taskCostForm.costAmount,i)||(o.taskCostForm.costAmount=i),t.Njj(i)}),t.k0s()()()(),t.j41(95,"div",61)(96,"mat-label",137),t.EFF(97,"Preview Total"),t.k0s(),t.j41(98,"div",83)(99,"mat-form-field",50),t.nrm(100,"input",138),t.nI1(101,"number"),t.k0s()()(),t.j41(102,"div",61)(103,"mat-label",139),t.EFF(104,"Asset Operator"),t.k0s(),t.j41(105,"div",83)(106,"mat-form-field",50)(107,"input",140),t.mxI("ngModelChange",function(i){t.eBV(e);const o=t.XpG();return t.DH7(o.taskCostForm.assetOperatorName,i)||(o.taskCostForm.assetOperatorName=i),t.Njj(i)}),t.k0s()()()(),t.j41(108,"div",61)(109,"mat-label",141),t.EFF(110,"Notes Section"),t.k0s(),t.j41(111,"div",85)(112,"mat-form-field",50)(113,"textarea",142),t.mxI("ngModelChange",function(i){t.eBV(e);const o=t.XpG();return t.DH7(o.taskCostForm.notes,i)||(o.taskCostForm.notes=i),t.Njj(i)}),t.k0s()()()(),t.DNE(114,nn,3,3,"div",143),t.j41(115,"div",61)(116,"mat-label",144),t.EFF(117),t.k0s(),t.j41(118,"span",145),t.DNE(119,ln,2,1,"div",146),t.k0s(),t.nrm(120,"app-progress",147),t.k0s()()(),t.j41(121,"div",148)(122,"div",149)(123,"ngx-file-drop",150),t.bIt("onFileDrop",function(i){t.eBV(e);const o=t.XpG();return t.Njj(o.dropped(i))}),t.DNE(124,dn,7,2,"ng-template",151),t.k0s()(),t.j41(125,"div",152)(126,"button",153),t.bIt("click",function(){t.eBV(e);const i=t.XpG();return t.Njj(i.extractCostsFromDocument())}),t.EFF(127),t.k0s(),t.DNE(128,pn,3,2,"span",154),t.k0s(),t.DNE(129,un,9,6,"div",155),t.k0s(),t.j41(130,"div",52)(131,"button",156),t.bIt("click",function(){t.eBV(e);const i=t.XpG();return t.Njj(i.closeTaskCostModal())}),t.EFF(132),t.k0s(),t.j41(133,"button",157),t.bIt("click",function(){t.eBV(e);const i=t.XpG();return t.Njj(i.saveTaskCostFromModal())}),t.EFF(134),t.k0s()()()(),t.j41(135,"app-model",158)(136,"div",43)(137,"div",44)(138,"div",45),t.EFF(139),t.j41(140,"button",57),t.bIt("click",function(){t.eBV(e);const i=t.XpG();return t.Njj(i.closeModal("confirm"))}),t.EFF(141,"\xd7 "),t.k0s()()(),t.j41(142,"div",47)(143,"div")(144,"form")(145,"div",159),t.EFF(146),t.k0s()()()(),t.j41(147,"div",73)(148,"div",75)(149,"button",160),t.bIt("click",function(){t.eBV(e);const i=t.XpG();return t.Njj(i.closeModal("confirm"))}),t.EFF(150),t.k0s(),t.j41(151,"button",161),t.bIt("click",function(){t.eBV(e);const i=t.XpG();return t.Njj(i.deleteFile("confirm",i.deleteId))}),t.EFF(152),t.k0s()()()()(),t.j41(153,"app-model",162)(154,"div",43)(155,"div",44)(156,"div",45),t.EFF(157),t.j41(158,"button",163),t.bIt("click",function(){t.eBV(e);const i=t.XpG();return t.Njj(i.closeModal(i.confirmJobCostDeleteModalName))}),t.EFF(159,"\xd7 "),t.k0s()()(),t.j41(160,"div",47)(161,"div")(162,"form")(163,"div",159),t.EFF(164),t.k0s()()()(),t.j41(165,"div",73)(166,"div",75)(167,"button",164),t.bIt("click",function(){t.eBV(e);const i=t.XpG();return t.Njj(i.closeModal(i.confirmJobCostDeleteModalName))}),t.EFF(168),t.k0s(),t.j41(169,"button",165),t.bIt("click",function(){t.eBV(e);const i=t.XpG();return t.Njj(i.deleteJobCost())}),t.EFF(170),t.k0s()()()()(),t.j41(171,"app-model",166)(172,"div",43)(173,"div",44)(174,"div",95),t.EFF(175,"Defect Recharge "),t.j41(176,"button",167),t.bIt("click",function(){t.eBV(e);const i=t.XpG();return t.Njj(i.closeDefectRechargeModal())}),t.j41(177,"mat-icon",126),t.EFF(178," close "),t.k0s(),t.EFF(179," Close "),t.k0s()()(),t.j41(180,"div",47),t.DNE(181,In,164,78,"div",168),t.k0s(),t.j41(182,"div",52)(183,"button",169),t.bIt("click",function(){t.eBV(e);const i=t.XpG();return t.Njj(i.closeDefectRechargeModal())}),t.EFF(184),t.k0s(),t.j41(185,"button",170),t.bIt("click",function(){t.eBV(e);const i=t.XpG();return t.Njj(i.saveDefectRechargeDetails())}),t.EFF(186),t.k0s()()()(),t.DNE(187,Sn,6,2,"ng-template",null,13,t.C5r)(189,xn,5,1,"ng-template",null,14,t.C5r)(191,yn,12,4,"ng-template",null,15,t.C5r)(193,Fn,6,2,"ng-template",null,16,t.C5r)(195,Jn,10,5,"ng-template",null,17,t.C5r)(197,Bn,5,2,"ng-template",null,18,t.C5r)(199,Pn,6,3,"ng-template",null,19,t.C5r)(201,Hn,7,3,"ng-template",null,20,t.C5r)(203,Un,19,6,"ng-template",null,21,t.C5r)(205,ir,2,2,"ng-template",null,22,t.C5r)(207,hr,19,11,"ng-template",null,23,t.C5r),t.j41(209,"app-model",171)(210,"div",43)(211,"div",44)(212,"div",95),t.EFF(213),t.j41(214,"button",172),t.bIt("click",function(){t.eBV(e);const i=t.XpG();return t.Njj(i.closeModal(i.jobWorkshopLocationLookupName))}),t.EFF(215,"\xd7 "),t.k0s()()(),t.j41(216,"div",47)(217,"form")(218,"div",48)(219,"div",173)(220,"mat-form-field",65)(221,"input",174),t.mxI("ngModelChange",function(i){t.eBV(e);const o=t.XpG();return t.DH7(o.jobWorkshopLocationLookUpValue,i)||(o.jobWorkshopLocationLookUpValue=i),t.Njj(i)}),t.k0s()()()()()(),t.j41(222,"div",52)(223,"button",175),t.bIt("click",function(){t.eBV(e);const i=t.XpG();return t.Njj(i.closeModal(i.jobWorkshopLocationLookupName))}),t.EFF(224),t.k0s(),t.j41(225,"button",176),t.bIt("click",function(){t.eBV(e);const i=t.XpG();return t.Njj(i.saveJobWorkshopLocationLookup(i.jobWorkshopLocationLookupName))}),t.EFF(226),t.k0s()()()(),t.j41(227,"app-model",177),t.DNE(228,ur,1,3,"app-asset-search",178),t.k0s(),t.j41(229,"app-model",179)(230,"div",43)(231,"div",44)(232,"div",56),t.EFF(233),t.j41(234,"button",57),t.bIt("click",function(){t.eBV(e);const i=t.XpG();return t.Njj(i.clickCancel("showCancelReason"))}),t.EFF(235,"\xd7 "),t.k0s()()(),t.j41(236,"div",47)(237,"div")(238,"form")(239,"div",180)(240,"div",181)(241,"mat-label",182),t.EFF(242),t.j41(243,"span",63),t.EFF(244,"*"),t.k0s()(),t.j41(245,"div",183)(246,"mat-form-field",184)(247,"textarea",185),t.mxI("ngModelChange",function(i){t.eBV(e);const o=t.XpG();
1return t.DH7(o.cancellationReason,i)||(o.cancellationReason=i),t.Njj(i)}),t.k0s()()()()()()()(),t.j41(248,"div",73)(249,"div",75)(250,"button",186),t.bIt("click",function(){t.eBV(e);const i=t.XpG();return t.Njj(i.addCancelReason("showCancelReason"))}),t.EFF(251),t.k0s()()()()(),t.j41(252,"app-model",187)(253,"app-alertpopup",188),t.bIt("updateAlert",function(i){t.eBV(e);const o=t.XpG();return t.Njj(o.alertupdate(i))}),t.k0s()(),t.j41(254,"app-model",189),t.nrm(255,"app-ad-hoc-customer",190),t.k0s(),t.j41(256,"app-model",191),t.nrm(257,"app-defect-list",192),t.k0s(),t.j41(258,"app-model",193)(259,"add-part",194),t.bIt("cancelEvent",function(){t.eBV(e);const i=t.XpG();return t.Njj(i.closeModal("addPartTab"))})("stockInfo",function(i){t.eBV(e);const o=t.XpG();return t.Njj(o.master.getStockInfo(i))})("updatedPart",function(i){t.eBV(e);const o=t.XpG();return t.Njj(o.savePart(i))})("getPartMode",function(i){t.eBV(e);const o=t.XpG();return t.Njj(o.getPartMode(i))})("deletePartNotSaveTask",function(i){t.eBV(e);const o=t.XpG();return t.Njj(o.deletePartNotSaveTask(i))})("commonEmitter",function(i){t.eBV(e);const o=t.XpG();return t.Njj(o.commonEmitterEvent(i))}),t.k0s()(),t.j41(260,"app-model",195)(261,"div",43)(262,"div",44)(263,"div",45),t.EFF(264),t.j41(265,"button",196),t.bIt("click",function(){t.eBV(e);const i=t.XpG();return t.Njj(i.closeModal("confirmTakeOwnership"))}),t.EFF(266,"\xd7 "),t.k0s()()(),t.j41(267,"div",47)(268,"div")(269,"form")(270,"div",180),t.EFF(271),t.k0s()()()(),t.j41(272,"div",73)(273,"div",75)(274,"button",197),t.bIt("click",function(){t.eBV(e);const i=t.XpG();return t.Njj(i.onTakeOwnershipNo())}),t.EFF(275,"No, preview"),t.k0s(),t.j41(276,"button",198),t.bIt("click",function(){t.eBV(e);const i=t.XpG();return t.Njj(i.takeTaskOwnership("confirmTakeOwnership"))}),t.EFF(277),t.k0s()()()()(),t.j41(278,"app-model",199)(279,"div",43)(280,"div",44)(281,"div",200),t.EFF(282,"View Details: REP of Service "),t.k0s()(),t.j41(283,"div",47)(284,"div",201)(285,"div",202)(286,"div",203),t.EFF(287),t.k0s(),t.j41(288,"div"),t.EFF(289),t.k0s()(),t.j41(290,"div",204)(291,"div",203),t.EFF(292),t.k0s(),t.j41(293,"div"),t.EFF(294),t.k0s()(),t.j41(295,"div",204)(296,"div",203),t.EFF(297),t.k0s(),t.j41(298,"div"),t.EFF(299),t.k0s()(),t.j41(300,"div",204)(301,"div",203),t.EFF(302),t.k0s(),t.j41(303,"div"),t.EFF(304),t.k0s()(),t.j41(305,"div",204)(306,"div",203),t.EFF(307),t.k0s(),t.j41(308,"div"),t.EFF(309),t.k0s()(),t.j41(310,"div",204)(311,"div",203),t.EFF(312),t.k0s(),t.DNE(313,gr,2,2,"div",205)(314,fr,4,3,"div",205),t.k0s(),t.j41(315,"div",206)(316,"div",207),t.EFF(317),t.k0s(),t.EFF(318," \xa0\xa0 "),t.j41(319,"div",208)(320,"div",209),t.DNE(321,kr,4,2,"div",210),t.k0s()()(),t.j41(322,"div",73)(323,"div",75)(324,"button",211),t.bIt("click",function(){t.eBV(e);const i=t.XpG();return t.Njj(i.closeModal("plannerViewServiceDetails"))}),t.EFF(325),t.k0s()()()()()()(),t.j41(326,"app-model",212)(327,"div",43)(328,"div",44)(329,"div",213),t.EFF(330,"Defect Details"),t.j41(331,"button",214),t.bIt("click",function(){t.eBV(e);const i=t.XpG();return t.Njj(i.closeDefectDetailsModal())}),t.EFF(332,"\xd7 "),t.k0s()()(),t.j41(333,"div",47)(334,"div",215),t.DNE(335,vr,1,7,"app-add-defects",216),t.k0s()()()(),t.j41(336,"app-model",217)(337,"app-signature-pad",218),t.bIt("cancelled",function(){t.eBV(e);const i=t.XpG();return t.Njj(i.closeModal("jobComplteSignPad"))})("signedImage",function(i){t.eBV(e);const o=t.XpG();return t.Njj(o.saveSign(i))}),t.k0s()(),t.j41(338,"app-model",219)(339,"div",43)(340,"div",44)(341,"div",45),t.EFF(342),t.j41(343,"button",220),t.bIt("click",function(){t.eBV(e);const i=t.XpG();return t.Njj(i.resetJobWorkshop("confirmChangeJobWorkshop"))}),t.EFF(344,"\xd7 "),t.k0s()()(),t.j41(345,"div",47)(346,"div")(347,"form")(348,"div",159)(349,"div",221),t.EFF(350),t.k0s()()()()(),t.j41(351,"div",73)(352,"div",75)(353,"button",222),t.bIt("click",function(){t.eBV(e);const i=t.XpG();return t.Njj(i.resetJobWorkshop("confirmChangeJobWorkshop"))}),t.EFF(354),t.k0s(),t.j41(355,"button",223),t.bIt("click",function(){t.eBV(e);const i=t.XpG();return t.Njj(i.changeJobworksp("confirmChangeJobWorkshop"))}),t.EFF(356),t.k0s()()()()(),t.j41(357,"app-model",93)(358,"app-show-active-warranty-list",224),t.bIt("dataChanged",function(i){t.eBV(e);const o=t.XpG();return t.Njj(o.dataFromWarrantyPopup(i))}),t.k0s()(),t.j41(359,"app-model",162)(360,"app-workload-limit-exceeded",225),t.bIt("confirmed",function(){t.eBV(e);const i=t.XpG();return t.Njj(i.onWorkloadConfirmed())})("cancelled",function(){t.eBV(e);const i=t.XpG();return t.Njj(i.onWorkloadCancelled())}),t.k0s()(),t.j41(361,"app-model",226)(362,"div",43)(363,"div",44)(364,"div",95)(365,"mat-icon",227),t.EFF(366,"warning"),t.k0s(),t.j41(367,"span"),t.EFF(368),t.k0s(),t.j41(369,"button",228),t.bIt("click",function(){t.eBV(e);const i=t.XpG();return t.Njj(i.closeDocRequirementAlert())}),t.j41(370,"mat-icon"),t.EFF(371,"close"),t.k0s()()()(),t.j41(372,"div",47)(373,"div",229)(374,"p",230),t.EFF(375),t.k0s()()(),t.j41(376,"div",231)(377,"button",232),t.bIt("click",function(){t.eBV(e);const i=t.XpG();return t.Njj(i.closeDocRequirementAlert())}),t.EFF(378," OK "),t.k0s()()()()()}if(2&s){const e=t.XpG();
1t.R7$(),t.Y8G("ngIf",!e.jobId||e.isUpdatingJobTask),t.R7$(),t.Y8G("ngClass",t.eq3(158,A,!e.jobId||e.isUpdatingJobTask?"job-create-border mainColorBorder":"")),t.R7$(),t.Y8G("ngIf",e.jobId&&!e.isUpdatingJobTask),t.R7$(11),t.Y8G("ngIf",!e.jobId||e.isUpdatingJobTask),t.R7$(2),t.Y8G("ngIf",e.jobId&&!e.isUpdatingJobTask),t.R7$(),t.Y8G("ngClass",t.eq3(160,A,!e.jobId||e.isUpdatingJobTask?"hide-label addNewJob":""))("selectedIndex",e.selectedTab),t.R7$(),t.Y8G("ngIf",!e.jobId||e.isUpdatingJobTask),t.R7$(),t.Y8G("ngIf",!e.jobId||e.isUpdatingJobTask),t.R7$(),t.Y8G("disabled",!e.assetId),t.R7$(2),t.Y8G("ngIf",e.jobId&&!e.isUpdatingJobTask),t.R7$(),t.Y8G("ngIf",e.jobId&&!e.isUpdatingJobTask),t.R7$(),t.Y8G("ngIf",e.jobId&&!e.isUpdatingJobTask),t.R7$(),t.Y8G("ngIf",e.jobId&&!e.isUpdatingJobTask),t.R7$(),t.Y8G("ngIf",e.jobId&&!e.isUpdatingJobTask),t.R7$(),t.Y8G("ngIf",e.jobId&&!e.isUpdatingJobTask),t.R7$(),t.Y8G("ngIf",e.jobId&&!e.isUpdatingJobTask),t.R7$(),t.Y8G("ngIf",e.jobId&&!e.isUpdatingJobTask),t.R7$(),t.Y8G("ngIf",!e.jobId||e.isUpdatingJobTask),t.R7$(9),t.xc7("--modalWidth","60%"),t.FS9("id",e.createJobReqModelName),t.R7$(4),t.SpI("",e.isEmergencyRequestMode?"Create Emergency Work":"Create "+(e.jobReqInfo.isSupplierRequest?"Request":"Estimate")," "),t.R7$(7),t.Y8G("jobReqInfo",e.jobReqInfo)("objAssetData",e.objAssetData)("partsFromTask",e.rowdata),t.R7$(),t.xc7("--modalWidth","45%"),t.Y8G("id",e.taskCostModalName),t.R7$(4),t.SpI("",e.selectedTaskForCost?"Add Cost":"Add Job Cost"," "),t.R7$(9),t.JRh(e.master.datalist.Supplier),t.R7$(5),t.R50("ngModel",e.taskCostForm.supplierId),t.Y8G("title",e.master.getCompanyName(e.taskCostForm.supplierId,!0)),t.R7$(),t.Y8G("value",""),t.R7$(),t.JRh(e.master.datalist.Select),t.R7$(2),t.Y8G("formControl",e.taskCostSupplierFilterCtrl),t.R7$(),t.Y8G("ngForOf",t.bMT(75,153,e.filteredTaskCostSuppliers)),t.R7$(9),t.R50("ngModel",e.taskCostForm.costEventId),t.R7$(),t.Y8G("value",0),t.R7$(),t.JRh(e.master.datalist.Select),t.R7$(),t.Y8G("ngForOf",e.master.costEvent),t.R7$(8),t.R50("ngModel",e.taskCostForm.costAmount),t.R7$(6),t.Y8G("value",t.i5U(101,155,e.getTaskCostPreviewTotal(),"1.2-2")),t.R7$(7),t.R50("ngModel",e.taskCostForm.assetOperatorName),t.R7$(6),t.R50("ngModel",e.taskCostForm.notes),t.R7$(),t.Y8G("ngIf",e.canShowRechargeToOperatorCheckbox()),t.R7$(3),t.JRh(e.master.datalist.Files),t.R7$(2),t.Y8G("ngForOf",e.uploadedFiles),t.R7$(),t.Y8G("ngStyle",t.lJ4(162,Pe))("progress",e.progress),t.R7$(2),t.Y8G("ngStyle",t.lJ4(163,Oe)),t.R7$(4),t.Y8G("disabled",!e.canExtractCostsFromDocument()),t.R7$(),t.SpI(" ",e.isParsingCostDocument?"Reading document...":"Extract costs from document"," "),t.R7$(),t.Y8G("ngIf",null==e.parsedInvoice?null:e.parsedInvoice.supplierName),t.R7$(),t.Y8G("ngIf",e.parsedInvoice),t.R7$(3),t.SpI(" ",e.master.datalist.Cancel," "),t.R7$(),t.Y8G("disabled",e.btnDisableSave),t.R7$(),t.SpI(" ",e.master.datalist.Save," "),t.R7$(5),t.JRh(e.master.datalist.warning),t.R7$(7),t.SpI(" ",e.warningMsg," "),t.R7$(4),t.JRh(e.master.datalist.No),t.R7$(2),t.JRh(e.master.datalist.Yes),t.R7$(),t.Y8G("id",e.confirmJobCostDeleteModalName),t.R7$(4),t.JRh(e.master.datalist.warning),t.R7$(7),t.SpI(" ",e.warningMsg," "),t.R7$(4),t.JRh(e.master.datalist.No),t.R7$(2),t.JRh(e.master.datalist.Yes),t.R7$(),t.xc7("--modalWidth","55%"),t.Y8G("id",e.defectRechargeModalName),t.R7$(10),t.Y8G("ngIf",e.selectedTaskForRecharge),t.R7$(3),t.SpI(" ",e.master.datalist.Cancel," "),t.R7$(),t.Y8G("disabled",e.rechargeSaveBtn),t.R7$(),t.SpI(" ",e.master.datalist.Save," "),t.R7$(23),t.Y8G("id",e.jobWorkshopLocationLookupName),t.R7$(4),t.SpI(" ",e.jobWorkshopLocationmodelTitle,""),t.R7$(),t.Mz_("id","btnClose",e.jobWorkshopLocationLookupName,""),t.R7$(7),t.Mz_("id","txt",e.jobWorkshopLocationLookupName,"Value"),t.Mz_("name","txt",e.jobWorkshopLocationLookupName,"Value"),t.R50("ngModel",e.jobWorkshopLocationLookUpValue),t.Y8G("ngModelOptions",t.lJ4(164,It)),t.R7$(2),t.Mz_("id","btncancel",e.jobWorkshopLocationLookupName,""),t.R7$(),t.SpI(" ",e.master.datalist.Cancel," "),t.R7$(),t.Mz_("id","btnsave",e.jobWorkshopLocationLookupName,""),t.Y8G("disabled",e.jobWorkshopLocationBtnDisable),t.R7$(),t.SpI(" ",e.master.datalist.Save," "),t.R7$(2),t.Y8G("ngIf",!e.jobId),t.R7$(5),t.SpI("",e.isTaskCancel?e.master.datalist.CancelTask:e.master.datalist.CancelJob," "),t.R7$(9),t.JRh(e.master.datalist.Reason),t.R7$(5),t.R50("ngModel",e.cancellationReason),t.R7$(3),t.Y8G("disabled",!e.cancellationReason),t.R7$(),t.JRh(e.master.datalist.Ok),t.R7$(2),t.Y8G("alertDetails",e.alertDetails)("alertType",e.alertType)("entity",e.objJobData)("assetDetails",e.objAssetData),t.R7$(2),t.Y8G("from","workShop"),t.R7$(2),t.Y8G("defectrequest",e.defectrequest),t.R7$(2),t.Y8G("isNew",e.isNewPart)("fromExternalSource",e.externalSourcePart)("isOldPart",e.isOldPart)("taskRows",e.taskRows)("workshopParts",e.workshopParts)("partDetails",e.addPartDetails)("repaircodes",e.master.repairCodes)("jobId",e.jobId)("isNewPartAdded",e.isNewPartAdded)("operatorOrgID",null==e.objAssetData?null:e.objAssetData.operatorOrgID)("operatorOrgID",null==e.objAssetData?null:e.objAssetData.operatorOrgID),t.R7$(5),t.JRh(e.master.datalist.warning),t.R7$(7),t.SpI(" ",e.warningMsg," "),t.R7$(6),t.JRh(e.master.datalist.Yes),t.R7$(7),t.xc7("min-width","600px"),t.R7$(3),t.SpI(" ",e.master.datalist.ServiceName,": "),t.R7$(2),t.SpI("\xa0\xa0",e.selectedTaskSvc.name,""),t.R7$(3),t.SpI(" ",e.master.datalist.Type,": "),t.R7$(2),t.SpI("\xa0\xa0",e.selectedTaskSvc.serviceTypeDesc,""),t.R7$(3),t.SpI(" ",e.master.datalist.AssetType,": "),t.R7$(2),t.SpI("\xa0\xa0",e.selectedTaskSvc.assetTypeDesc,""),t.R7$(3),t.SpI(" ",e.master.datalist.Make,": "),t.R7$(2),t.SpI("\xa0\xa0",e.selectedTaskSvc.assetMakeDesc,""),t.R7$(3),t.SpI(" ",e.master.datalist.Range,": "),t.R7$(2),t.SpI("\xa0\xa0",e.selectedTaskSvc.assetMakeRangeDesc,""),t.R7$(3),t.SpI(" ",e.master.datalist.UsageBased,": "),t.R7$(),t.Y8G("ngIf",e.selectedTaskSvc.usageBased),t.R7$(),t.Y8G("ngIf",e.selectedTaskSvc.isAlternateUsageBased),t.R7$(3),t.SpI(" ",e.master.datalist.CheckSheetsRequired,": "),t.R7$(4),t.Y8G("ngForOf",e.selectedTaskSvc.checkSheet),t.R7$(4),t.JRh(e.master.datalist.Close),t.R7$(10),t.Y8G("ngIf",e.showDefectRepairDetails),t.R7$(2),t.Y8G("currentSignature",e.currentSignature),t.R7$(5),t.JRh(e.master.datalist.warning),t.R7$(8),t.SpI(" ",e.changeJobworkspwarningMsg," "),t.R7$(4),t.JRh(e.master.datalist.No),t.R7$(2),t.JRh(e.master.datalist.Yes),t.R7$(),t.Y8G("id",e.showActiveWarrantyListModelName),t.R7$(),t.Y8G("warranties",e.warrantyList)("assetUsageInfo",e.assetUsageInfo),t.R7$(),t.Y8G("id",e.workloadExceededModalName),t.R7$(),t.Y8G("resources",e.workloadResources),t.R7$(),t.xc7("--modalWidth","420px")("--modalHeight","auto"),t.Y8G("id",e.docRequirementAlertModalName),t.R7$(7),t.JRh(e.docRequirementAlertTitle),t.R7$(7),t.JRh(e.docRequirementAlertMessage)}}function Cr(s,r){1&s&&t.nrm(0,"app-loading-spinner",789)}function jr(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",61)(1,"mat-label",62),t.EFF(2),t.j41(3,"span",63),t.EFF(4,"*"),t.k0s()(),t.j41(5,"div",64)(6,"mat-form-field",65)(7,"input",790),t.mxI("ngModelChange",function(i){t.eBV(e);const o=t.XpG();
1return t.DH7(o.objJobData.actualDateBooked,i)||(o.objJobData.actualDateBooked=i),t.Njj(i)}),t.k0s(),t.nrm(8,"mat-datepicker-toggle",67)(9,"mat-datepicker",null,39),t.k0s()()()}if(2&s){const e=t.sdS(10),a=t.XpG();t.R7$(2),t.JRh(a.master.datalist.ActualBookedDate),t.R7$(5),t.R50("ngModel",a.objJobData.actualDateBooked),t.Y8G("matDatepicker",e)("disabled",!a.enableBackDatingReasonFieldEdit),t.R7$(),t.Y8G("for",e)}}function wr(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",400),t.nrm(1,"img",401),t.j41(2,"img",792),t.bIt("click",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.saveSignToJob(!0))}),t.k0s()()}}function Ir(s,r){if(1&s&&(t.j41(0,"div",403),t.nrm(1,"img",404),t.k0s()),2&s){const e=t.XpG(2);t.R7$(),t.Y8G("src",e.supervisorSign,t.B4B)}}function Rr(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",400)(1,"div",405)(2,"img",406),t.bIt("click",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.showSignPadClick())}),t.k0s()()()}}function Tr(s,r){if(1&s&&(t.j41(0,"div",395)(1,"div",208)(2,"mat-label",791),t.EFF(3),t.j41(4,"span",63),t.EFF(5,"*"),t.k0s()(),t.j41(6,"div",397),t.DNE(7,wr,3,0,"div",398)(8,Ir,2,1,"div",399)(9,Rr,3,0,"div",398),t.k0s()()()),2&s){const e=t.XpG();t.R7$(3),t.SpI("",e.master.datalist.Supervisor," "),t.R7$(4),t.Y8G("ngIf",(null==e.master.userInfo?null:e.master.userInfo.signature)&&!(null!=e.objJobData&&e.objJobData.supervisorSigned)),t.R7$(),t.Y8G("ngIf",null==e.objJobData?null:e.objJobData.supervisorSigned),t.R7$(),t.Y8G("ngIf",!(null!=e.master.userInfo&&e.master.userInfo.signature||null!=e.objJobData&&e.objJobData.supervisorSigned))}}function Sr(s,r){if(1&s){const e=t.RV6();t.j41(0,"button",80),t.bIt("click",function(){t.eBV(e);const i=t.XpG();return i.objScheduleData.backdatedJob=!0,t.Njj(i.handleCompletionDetails())}),t.EFF(1),t.k0s()}if(2&s){const e=t.XpG();t.Y8G("disabled",!e.enableBackdateAction),t.R7$(),t.JRh(e.isNewWorkshopBooking?e.master.datalist.Save:e.master.datalist.ConfirmAndClose)}}function xr(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",400),t.nrm(1,"img",401),t.j41(2,"img",792),t.bIt("click",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.saveSignToJob(!0))}),t.k0s()()}}function yr(s,r){if(1&s&&(t.j41(0,"div",403),t.nrm(1,"img",404),t.k0s()),2&s){const e=t.XpG(2);t.R7$(),t.Y8G("src",e.supervisorSign,t.B4B)}}function Fr(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",400)(1,"div",405)(2,"img",406),t.bIt("click",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.showSignPadClick())}),t.k0s()()()}}function Nr(s,r){if(1&s&&(t.j41(0,"div",395)(1,"div",208)(2,"mat-label",793),t.EFF(3),t.k0s(),t.j41(4,"div",397),t.DNE(5,xr,3,0,"div",398)(6,yr,2,1,"div",399)(7,Fr,3,0,"div",398),t.k0s()()()),2&s){const e=t.XpG();t.R7$(3),t.SpI("",e.master.datalist.Supervisor," "),t.R7$(2),t.Y8G("ngIf",(null==e.master.userInfo?null:e.master.userInfo.signature)&&!(null!=e.objJobData&&e.objJobData.supervisorSigned)),t.R7$(),t.Y8G("ngIf",null==e.objJobData?null:e.objJobData.supervisorSigned),t.R7$(),t.Y8G("ngIf",!(null!=e.master.userInfo&&e.master.userInfo.signature||null!=e.objJobData&&e.objJobData.supervisorSigned))}}function Jr(s,r){if(1&s){const e=t.RV6();t.j41(0,"app-model",794)(1,"app-upload-asset-document",795),t.bIt("defectDocUpdate",function(i){t.eBV(e);const o=t.XpG();return t.Njj(o.taskDocUpdate(i))}),t.k0s()()}if(2&s){const e=t.XpG();t.R7$(),t.Y8G("sourceType",e.documentSource)("jobId",e.jobId)("caseType","DOCUMENT")("modelName","CustomModelName")}}function Br(s,r){if(1&s&&(t.j41(0,"mat-option",801),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&s){const e=r.$implicit;t.Y8G("value",e.id),t.R7$(),t.SpI(" ",t.bMT(2,2,e)," ")}}function Mr(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",61)(1,"mat-label",796),t.EFF(2,"Document Type"),t.j41(3,"span",63),t.EFF(4,"*"),t.k0s()(),t.j41(5,"div",83)(6,"mat-form-field",65)(7,"mat-select",797),t.mxI("ngModelChange",function(i){t.eBV(e);const o=t.XpG();return t.DH7(o.assetDocType,i)||(o.assetDocType=i),t.Njj(i)}),t.j41(8,"mat-option",798),t.EFF(9,"--- select ---"),t.k0s(),t.DNE(10,Br,3,4,"mat-option",799),t.k0s()(),t.j41(11,"app-dynamic-lookup-type",800),t.bIt("refresh",function(){t.eBV(e);const i=t.XpG();return t.Njj(i.refreshLookup())}),t.k0s()()()}if(2&s){const e=t.XpG();t.R7$(7),t.R50("ngModel",e.assetDocType),t.R7$(),t.Y8G("value",0),t.R7$(2),t.Y8G("ngForOf",e.master.documentTypes),t.R7$(),t.Y8G("classNames","custom")("lookupTypeTitle",e.pLookupTypeTitle)("lookupTypeNameInDB",e.pLookupTypeNameInDB)("masterSvcPropertyName",e.pMasterSvcPropertyName)("selectedLookupId",e.assetDocType)}}function Ar(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",61)(1,"mat-label",69),t.EFF(2,"Do you want to rebook the service ?"),t.j41(3,"span",63),t.EFF(4,"*"),t.k0s()(),t.j41(5,"div",85)(6,"mat-radio-group",87),t.mxI("ngModelChange",function(i){t.eBV(e);const o=t.XpG();
1return t.DH7(o.objCompletionJobData.rebook,i)||(o.objCompletionJobData.rebook=i),t.Njj(i)}),t.j41(7,"mat-radio-button",802),t.EFF(8," Yes"),t.k0s(),t.j41(9,"mat-radio-button",802),t.EFF(10," No "),t.k0s()()()()}if(2&s){const e=t.XpG();t.R7$(6),t.R50("ngModel",e.objCompletionJobData.rebook),t.R7$(),t.Y8G("checked","yes"==e.objCompletionJobData.rebook)("value","yes"),t.R7$(2),t.Y8G("checked","no"==e.objCompletionJobData.rebook)("value","no")}}function Er(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",61)(1,"mat-label",69),t.EFF(2),t.j41(3,"span",63),t.EFF(4,"*"),t.k0s()(),t.j41(5,"div",85)(6,"mat-form-field",50)(7,"textarea",803),t.mxI("ngModelChange",function(i){t.eBV(e);const o=t.XpG();return t.DH7(o.objCompletionJobData.comment,i)||(o.objCompletionJobData.comment=i),t.Njj(i)}),t.bIt("change",function(i){t.eBV(e);const o=t.XpG();return t.Njj(o.updateReason(i))}),t.k0s()()()()}if(2&s){const e=t.XpG();t.R7$(2),t.JRh(e.master.datalist.Comment),t.R7$(5),t.R50("ngModel",e.objCompletionJobData.comment)}}function Gr(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",61)(1,"mat-label",62),t.EFF(2),t.k0s(),t.j41(3,"div",83)(4,"mat-form-field",65)(5,"input",805),t.mxI("ngModelChange",function(i){t.eBV(e);const o=t.XpG().$implicit;return t.DH7(o.value,i)||(o.value=i),t.Njj(i)}),t.k0s(),t.nrm(6,"mat-datepicker-toggle",67)(7,"mat-datepicker",null,36),t.k0s()()()}if(2&s){const e=t.sdS(8),a=t.XpG().$implicit;t.R7$(2),t.SpI("Previous ",a.fieldName," "),t.R7$(3),t.R50("ngModel",a.value),t.Y8G("matDatepicker",e),t.R7$(),t.Y8G("for",e)}}function Pr(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",61)(1,"mat-label",62),t.EFF(2),t.j41(3,"span",63),t.EFF(4,"*"),t.k0s()(),t.j41(5,"div",83)(6,"mat-form-field",65)(7,"input",806),t.mxI("ngModelChange",function(i){t.eBV(e);const o=t.XpG().$implicit;return t.DH7(o.updatedValue,i)||(o.updatedValue=i),t.Njj(i)}),t.k0s(),t.nrm(8,"mat-datepicker-toggle",67)(9,"mat-datepicker",null,36),t.k0s()()()}if(2&s){const e=t.sdS(10),a=t.XpG().$implicit,i=t.XpG();t.R7$(2),t.SpI("Next ",a.fieldName,""),t.R7$(5),t.R50("ngModel",a.updatedValue),t.Y8G("min",i.mappeddateFieldFilter(a))("matDatepicker",e),t.R7$(),t.Y8G("for",e)}}function Or(s,r){if(1&s&&(t.j41(0,"div",804),t.DNE(1,Gr,9,4,"div",68)(2,Pr,11,5,"div",68),t.k0s()),2&s){const e=t.XpG();t.R7$(),t.Y8G("ngIf","pass"==e.objCompletionJobData.passOrFail),t.R7$(),t.Y8G("ngIf","pass"==e.objCompletionJobData.passOrFail)}}function Lr(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",400),t.nrm(1,"img",401),t.j41(2,"img",792),t.bIt("click",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.saveSignToJob(!0))}),t.k0s()()}}function $r(s,r){if(1&s&&(t.j41(0,"div",403),t.nrm(1,"img",404),t.k0s()),2&s){const e=t.XpG(2);t.R7$(),t.Y8G("src",e.supervisorSign,t.B4B)}}function Vr(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",400)(1,"div",405)(2,"img",406),t.bIt("click",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.showSignPadClick())}),t.k0s()()()}}function Hr(s,r){if(1&s&&(t.j41(0,"div",395)(1,"div",208)(2,"mat-label",396),t.EFF(3),t.k0s(),t.j41(4,"div",397),t.DNE(5,Lr,3,0,"div",398)(6,$r,2,1,"div",399)(7,Vr,3,0,"div",398),t.k0s()()()),2&s){const e=t.XpG();t.R7$(3),t.SpI("",e.master.datalist.Supervisor," "),t.R7$(2),t.Y8G("ngIf",(null==e.master.userInfo?null:e.master.userInfo.signature)&&!(null!=e.objJobData&&e.objJobData.supervisorSigned)),t.R7$(),t.Y8G("ngIf",null==e.objJobData?null:e.objJobData.supervisorSigned),t.R7$(),t.Y8G("ngIf",!(null!=e.master.userInfo&&e.master.userInfo.signature||null!=e.objJobData&&e.objJobData.supervisorSigned))}}function Yr(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",61)(1,"mat-label",62),t.EFF(2),t.j41(3,"span",63),t.EFF(4,"*"),t.k0s()(),t.j41(5,"div",64)(6,"mat-form-field",65)(7,"input",807),t.mxI("ngModelChange",function(i){t.eBV(e);const o=t.XpG();return t.DH7(o.objJobData.actualDateBooked,i)||(o.objJobData.actualDateBooked=i),t.Njj(i)}),t.k0s(),t.nrm(8,"mat-datepicker-toggle",67)(9,"mat-datepicker",null,36),t.k0s()()()}if(2&s){const e=t.sdS(10),a=t.XpG();t.R7$(2),t.JRh(a.master.datalist.ActualBookedDate),t.R7$(5),t.R50("ngModel",a.objJobData.actualDateBooked),t.Y8G("matDatepicker",e),t.R7$(),t.Y8G("for",e)}}function Ur(s,r){if(1&s){const e=t.RV6();
1t.j41(0,"button",80),t.bIt("click",function(){t.eBV(e);const i=t.XpG();return i.objScheduleData.backdatedJob=!0,t.Njj(i.handleBackdatedJob())}),t.EFF(1),t.k0s()}if(2&s){const e=t.XpG();t.Y8G("disabled",!e.enableBackdateAction),t.R7$(),t.JRh(e.isNewWorkshopBooking?e.master.datalist.Save:e.master.datalist.ConfirmAndClose)}}function Xr(s,r){if(1&s){const e=t.RV6();t.j41(0,"div",808)(1,"button",809),t.bIt("click",function(){t.eBV(e);const i=t.XpG();return t.Njj(i.openCreatedPODocument())}),t.EFF(2,"Open PO Document"),t.k0s()()}}const Y=l.H.jobEventColors;class X{constructor(){this.completionDate="",this.passOrFail="pass",this.rebook="yes",this.comment="",this.previousDate="",this.nextDate=""}}const qr=[{path:"",canActivate:[H.q],component:(()=>{class s{get jobStartDate(){return this.isNewWorkshopBooking?this.objScheduleData.plannedDate:this.dateBooked}set jobStartDate(e){this.isNewWorkshopBooking?this.objScheduleData.plannedDate=e:this.dateBooked=e}constructor(e,a,i,o,n,d,p,m,g,f,R,B,j,S,_,F,E,W,q,G,rt){this.route=e,this.location=a,this.assetService=i,this.jobService=o,this.modalService=n,this.userService=d,this.alertService=p,this.stockService=m,this.defect=g,this.checksheetService=f,this.importService=R,this.roleService=B,this.emailAttachmentService=j,this.workshopassetServ=S,this.http=_,this.webSocketService=F,this.orgService=E,this.gridConfigService=W,this.cdr=q,this.customerBillingService=G,this.workflowGroupService=rt,this.uiLabels=c._6u,this.matIconNames=c.FdZ,this.signWarningTxt="You did not have permission to sign off.",this.signRequiredTxt="Supervisor sign is required before completing job.",this.offlineDataFail="Storing data offline failed!, refresh the page.",this.signatureFiledStr="signature saving failed",this.partsCount=0,this.partsData=[],this.totalWizard=[],this.masterJobWorkshopLocations="jobWorkshopLocations",this.helper=l.H,this.objOrgData={},this.frameworkComponents={btnCellRenderer:St.f,editCellRender:xt.u,dataCellRender:Tt.l,pdfCellRenderer:At.k,deleteCellRenderer:dt.V,statusBadgeRenderer:Et.o},this.Constants=c.YMJ,this.jobWorkshopLocationLookupName="jobWorkshopLocationLookup",this.jobWorkshopLocationmodelTitle="",this.jobWorkshopLocationLookUpValue="",this.editingJobWorkshopLoc="",this.jobWorkshopLocationLookupType="",this.jobWorkshopLocationBtnDisable=!1,this.jobWorkshopLocationSelLookup="",this.workshopLocEditWaring="Please select value",this.workshopLocExistsWaring="Already lookup value exists!",this.assetJoblists=[],this.weekNumber=[],this.date=new Date((new Date).getFullYear(),0,1),this.lastDate=new Date((new Date).getFullYear(),l.H.id11,l.H.days31),this.lastWeekNumber=1,this.nextYearDate=this.lastDate,this.source="",this.jobHistoryDesc="",this.openDefectList=[],this.advisoryDefectList=[],this.advisoryDefectListResp=[],this.UserEntityFields=c.SsI,this.repeatJobOptions=[],this.isDefectRepairOpen=!1,this.workFlowStatusList=[],this.odometerReadingEdited=!1,this.hasSavedOdometerReading=!1,this.rechargeSaveBtn=!1,this.ddlStockTypeArray=[{id:1,en:"Stock"},{id:2,en:"Impress Stock"}],this.taskRows=[],this.rowdata=[],this.jobHistoryData=[],this.frameworkComponentsPartsTab={deleteCellRenderer:dt.V,scanCellRenderer:Ft.k},this.columnDefs=[],this.jobCostChargesColumnDefs=[],this.jobCostChargesRowData=[],this.jobCostChargesAutoGroupColumnDef={headerName:"Task",minWidth:260},this.historyColumnDefs=[],this.addPartDetails=void 0,this.partResponseMode="",this.supervisorSign="",this.selectedTab=0,this.isNewPart=!0,this.isNewPartAdded=!1,this.isOldPart=!1,this.isUpdatingJobTask=!1,this.taskUpdated=!1,this.tabAddPartBtnDisable=!1,this.objAssetData=new C.sP,this.objJobData=new v.XP,this.objScheduleData=new v.qg,this.usageForecastOccurrences=[],this.objCompletionJobData=new X,this.jobId="",this.newJobID="",this.poTriggerReached=!1,this.poWorkshopEmail="",this.poNumber="",this.poSendBusy=!1,this.warningMsg="Do you want to take ownership for the task",this.changeJobworkspwarningMsg="",this.selChangeJobWorkshop="",this.prevJobWorkshop="",this.currJobWorkshop="",this.scheduleId="",this.classificationMasterDataPromise=null,this.classificationDataCache=null,this.cacheTimestamp=0,this.CACHE_DURATION=l.H.id5*l.H.sec*l.H.onesec,this.isProcessingTaskDetail
1s=!1,this.isJobCostChargesRequestInFlight=!1,this.jobCostChargesRequestKey="",this.dates=[],this.rowDataTask=[],this.deletedRowDataTask=[],this.assetlist=[],this.depotID="999",this.workshopID="999",this.assetlistID=[],this.blnToggle=!1,this.showDefectRepairDetails=!1,this.JobStatus=c.A8Q,this.TaskStatus=c.e1J,this.selectedTaskSvc={},this.isReloadData=!1,this.isResolvingMissingJobPdf=!1,this.lblMake="",this.objJobArray=[],this.blnShowSearchAsset=!1,this.assetId="",this.jobStatus=c.A8Q.unplanned,this.lblJobHeader="",this.isStatusButtonClicked=!1,this.isloading=!1,this.isTaskLoading=!0,this.isHistoryTabLoading=!1,this.isHistoryTabActive=!1,this.iSTaskExists=!0,this.blnAlternate=!1,this.parentOrgIdsList=[],this.canParentOrgControl=!1,this.availableMakes=[],this.ranges=[],this.tblUsage=[],this.btnDisplayUsage=!1,this.totalTimeTaken="00:00",this.blnAssetSelected=!0,this.assetSource="asset",this.blnupdateCancelReason=!1,this.workshopcontractlist=[],this.maintenanceService=[],this.inspectionService=[],this.usage=[],this.isDefectTask=!1,this.taskTabIndex=0,this.defaultTask=[],this.InvoiceJob=new v.xB,this.subs=new K.S,this.objTaskArray=[],this.fromWorkShop=!1,this.CustomerList=[],this.alertType="Job Alert",this.isExternal=!1,this.inspecTask=[],this.toasterText="Please enter valid details.",this.toasterJobtext="Job updated successfully.",this.taskUpdateSuccess="Task update success",this.allJobsByWorkshop=[],this.assetUsage=new C.A_,this.immediateInspecService=[],this.externalJobEmailData=new v.gk,this.contractdata=new U.N,this.serviceselected=[],this.isBookingDataUpdated=!1,this.hasPendingDefectClassificationChanges=!1,this.isUpdatingJobRequest=!1,this.rawJobReqstAPIRes={},this.taskChecksheetIDs=[],this.taskChecksheetList=[],this.taskDurationList=[],this.taskCostModalName="taskCostModal",this.selectedTaskForCost=null,this.selectedTaskForJobCostAction=null,this.externalWorkshopCostOptions=[],this.taskCostSupplierFilterCtrl=new b.hs,this.filteredTaskCostSuppliers=new ct.m(1),this.taskCostForm={supplierId:"",costEventId:0,costAmount:0,assetOperatorOrgID:"",assetOperatorName:"",notes:"",rechargeToOperator:!1},this.lastCostDocumentFile=null,this.isParsingCostDocument=!1,this.parsedInvoice=null,this.defectRechargeModalName="defectRechargeModal",this.selectedTaskForRecharge=null,this.isBulkRechargeMode=!1,this.bulkRechargeTasks=[],this.rechargeModalTasks=[],this.rechargeModalTaskIndex=0,this.rechargeModalData={rechargePercent:100,applyCustomerMargin:!1,publishToPortal:!1,vatType:l.H.id1,costIds:[]},this.rechargeSupplierName="",this.defaultRechargePercent=100,this.maxRechargePercent=100,this.isTaskCancel=!1,this.createJobTaskDoc=!1,this.createJobRequest=!1,this.jobTaskDocAdded=!1,this.progressMsg=l.H.stringEmpty,this.onsiteRestrictAccess=!1,this.defectId="",this.objDefect=new yt.kl,this.jobDefectList=[],this.defectCost=[],this.calendarDayView=[c.y4c.devNolansTransport,c.y4c.uatNolansTransport,c.y4c.liveNolansTransport],this.totlPartsPrice=0,this.totlPartsTax=0,this.totlPartsTaxPercent=0,this.totlPartsPriceWithTax=0,this.authRuleList=[],this.matchedRuleList=[],this.matchedRule=new ut.Wu,this.isPriceChanged=!1,this.oldestDdefectCommentInfo={},this.externalSourcePart=!1,this.schedulerDateChanged=!1,this.dateBooked="",this.bookedDateSelected="",this.taskClassificationActionOptions=[],this.taskClassificationReasonOptions=[],this.progress=0,this.uploadedFiles=[],this.deleteId=0,this.selectedJobCostForDelete=null,this.confirmJobCostDeleteModalName="confirmJobCostDelete",this.btnDisableSave=!1,this.assetUdFieldData=[],this.assetDocuments=[],this.enableJobCompletionAction=!0,this.assetDocumentURL="",this.assetDocType=0,this.assetDocFormat="",this.workshopList=[],this.workshopFilterCtrl=new b.hs,this.filteredWorkshops=new ct.m(1),this._onDestroy=new Nt.B,this.JobDayFilter=c.Qro,this.JobRequestMode=c.S3C,this.JobRequestType=c.fti,this.supplierRequestFlow=[],this.customerRequestFlow=[],this.mappedKeydate=[],this.udFields=[],this.minMaxDateForDeleteJob={min:null,max:null},this.createJobFromScheduleDeleteJob=!1,this.createJobReqModelName="CreateJobReqModel",this.jobReqInfo=new v.ZU,this.isEmergencyRequestMode=!1,this.isJobRequestPreview=!1,this.previewJobReqstData={},this.jobReqPrevInspectionTasks=[],this.jobReqPrevMaintenanceTasks=[],this.jobReqPrevRepairTasks=[],this.serviceId=l.H.stringEmpty,this.quickFilterText="",this.columnState="",this.savedFilterModel="",this.savedSortModel="",this.savedPageModel="",this.filteredColumnDefs=[],this.sideBar="filters",this.columnTypes={dimension:{enableRowGroup:!0}},this.rowsSelected=[],this.documentRowData=[],this.documentSource="TASKDETAIL",this.rescheduleJobsModelName="RescheduleJobsModel",this.enableBackDatingReasonFieldEdit=!0,this.isNewWorkshopBooking=!0,this.isUpdateTask=!1,this.backdatedReason="",this.enableBackdateAction=!0,this.canEditWorkflowStatus=!1,this.uDDates=[],this.standardDates=[],this.futureComplianceJob={},this.noScheduleReason="",this.currentJobCompleteType="",this.showActiveWarrantyListModelName="ShowActiveWarrantyListModel",this.isAnyActiveWarrantyExist=!1,this.isWarrantyJobCreationApproved=!1,this.warrantyList=[],this.assetUsageInfo={currentUsage:0,lastUsageDate:"",usageIn:0},this.pLookupTypeTitle=c._6u.DocumentType,this.pLookupTypeNameInDB=c.YMJ.DocumentTypes,this.pMasterSvcPropertyName="documentTypes",this.assetOperatorName="",this.assetDepotName="",this.workloadExceededModalName="WorkloadLimitExceededModal",this.workloadResources=[],this.workloadProceedCallback=null,this.workloadCancelCallback=null,this.pendingEngineerRevertByTaskId=new Map,this.originalTaskHourByTaskId=new Map,this.docRequirementAlertModalName="DocRequirementAlertModal",this.docRequirementAlertTitle="Action Blocked",this.docRequirementAlertMessage="",this.isCheckingWorkloadCapacity=!1,this.poCreateSuccessModalName="poCreateSuccessModal",this.poSuccessData=null,this.pricingCache=null,this.pricingCacheTime=0,this.PRICING_CACHE_DURATION_MS=100,this.addbackdateReason=()=>{this.checkBackdateRolePermission()&&this.showModal("showBackDateReason")},this.taskDocUploadedDate="",this.showJob=V=>{const x=this.plannerService.calendarJobList?.findIndex(z=>z===this.jobId);switch(V){case"p":-1!==x&&this.plannerService.calendarJobList.length-1>=x-1&&(this.jobId=this.plannerService.calendarJobList[x-1]),this.master.footerBtnDisable1=x-1==0,this.master.footerBtnDisable3=this.plannerService.calendarJobList.length-1==x-1;break;case"n":-1!==x&&this.plannerService.calendarJobList.length-1>=x+1&&(this.jobId=this.plannerService.calendarJobList[x+1]),this.master.footerBtnDisable1=x+1===0,this.master.footerBtnDisable3=this.plannerService.calendarJobList.length-1===x+1}this.insertRouterNavigation(),this.editJobDetails(),this.getAlerts()},this.addTasktoCreatedJob=()=>{this.scrollToTopServiceTasks(),this.master.resetFooterBtn(),this.isUpdatingJobTask=!0,this.setServiceTasks(),this.selectedTab=2,this.objJobData.task&&this.agGridTaskRowRender(this.objJobData.task)},this.master=this.assetService.master,this.taskService=this.jobService.taskService,this.plannerService=this.jobService.plannerService,this.toastrService=this.master.toasterService,this.router=this.master.router,this.idb=this.master.idb,this.prepareWizard(),this.prepareRepeatJobOptions(),this.gridOptions=this.gridConfigService.getCommonGridOptions()}ngOnInit(){this.listenForValChanges(),this.masterDetailsLoaded(),this.startWebSocketSvc(),this.getOrgType(),this.fetchAllRoles(),this.getAuthorizationRules(),this.updateWorkflowStatusPermission(),this.sub=this.route.params.subscribe(a=>{a.jobID?(this.prepareJobHistoryColDef(),this.jobId=a.jobID,this.editJobDetails(),this.getAlerts()):(this.blnShowSearchAsset=!0,this.blnAssetSelected=!1,this.rowDataTask=[],this.jobStatus=c.A8Q.unplanned,this.lblJobHeader=y.DY.CreateJobTasks,this.lblUsageRate="",this.assetDepotName="",this.assetOperatorName=""),this.handleUrlParam(a),a.mode&&"WorkShop"===a.mode.toString()?this.mode="WorkShop":(this.mode="Asset",a.assetID&&(this.blnShowSearchAsset=!1,this.assetId=a.assetID,this.getAllJobsByWorkshop(this.assetId),this.getAssetDetails(),this.getAllDefectList())),this.subs.add=this.master.masterInfoLoadedSubAsObs.subscribe(()=>{(this.master.selectedOrg?.parentOrgID||this.master.selectedOrg?.id)&&this.getUdfFields(),(this.objAssetData?.operatorOrgID||this.objAssetData?.depotOrgID)&&(this.assetOperatorName=this.master.getCompanyName(this.objAssetData?.operatorOrgID),this.assetDepotName=this.master.getCompanyName(this.objAssetData?.depotOrgID))})}),this.jobId||(this.lblJobHeader=y.DY.CreateJobTasks,this.getJobStatus(this.jobStatus)),this.checkAndShowPOCreateSuccessPopup(),this.userService.orgUserList=[],this.getWeekNumbers(),this.listenForTaskCostSupplierFilterChanges(),this.addSelectedNavOrgAsCust();const e=this.master.getParentOrgId(this.master.navSelectedOrgID);this.onsiteRestrictAccess=this.calendarDayView.some(a=>a===e),this.enableBackDatingReasonFieldEdit=!0,this.isNewWorkshopBooking=!0,this.sideBar={toolPanels:[{id:"filters",labelDefault:"Filters",labelKey:"filters",iconKey:"filter",toolPanel:"agFiltersToolPanel"}],position:"right"}}
1checkAndAnalyzeScheduleDeleteJobInfo(){let e=localStorage.getItem(c.lOb.ScheduleMgtCreateJob);if(e){e=JSON.parse(e),this.objScheduleData.plannedDate=e.dateBooked;const a=e.weekNumber,i=l.H.getDateOfISOWeek(new Date(e.dateBooked),a);this.minMaxDateForDeleteJob.min=new Date(i.StartDate),this.minMaxDateForDeleteJob.max=new Date(i.EndDate),this.createJobFromScheduleDeleteJob=!0}}closeCreateJobRequestModel(){this.closeModal(this.createJobReqModelName),this.isJobRequestPreview=!1}backToJobReqstFromPreview(){this.isJobRequestPreview=!1}startSaveJobRequest(e){this.jobReqInfo={...this.jobReqInfo,...e},this.saveJobRequest()}saveJobRequest(){var e=this;return(0,w.A)(function*(){let a;yield e.loadJobRequestForUpdate(),e.isUpdatingJobRequest?(a=e.rawJobReqstAPIRes,a.updatedBy=e.master.userInfo?.id||"",a.updatedDate=l.H.moment(new Date).utc().format()):(a=new v.uF,a.assetID_PK=e.assetId,a.customerReference=e.objScheduleData.customerReference,a.vrm=e.objAssetData.vrm,a.fleetNumber=e.objAssetData.fleetNumber,a.jobComment=e.jobReqInfo.comment,a.jobBookedDate=l.H.getTodayDateWithoutTime(e.jobReqInfo.isExistingJob?e.objJobData.dateBooked:e.objScheduleData.plannedDate),e.objJobData.workshopID&&(a.workshopId=e.objJobData.workshopID),e.objScheduleData.agreement&&(a.agreement=""),a.parentOrgID=e.master.getParentOrgId(e.master.navSelectedOrgID),a.dayFilter=e.objJobData.dayFilter,e.objJobData.requestType===c.fti.SupplierRequest?(a.isSupplierRequest=!0,a.supplierLists=e.jobReqInfo.suppliers,a.status=c.t3n.RequestSent,a.customerId=e.objScheduleData.customerID):(a.customerId=e.jobReqInfo.customerId,a.workshopId=e.objScheduleData.workshopID?e.objScheduleData.workshopID:"",a.isSupplierRequest=!1,a.status=c.t3n.EstimateSent),a.tempjobId=e.newJobID,e.jobReqInfo.isExistingJob&&(a.jobId=e.objJobData.id,a.jobNumber=e.objJobData.jobNumber,a.customerId=e.jobReqInfo.customerId,a.status=c.t3n.JobBooked),a.depotId=e.objAssetData.depotOrgID,a.serviceIds=[...e.inspectionRowData.filter(d=>d.checked).map(d=>d.id),...e.maintenanceRowData.filter(d=>d.checked).map(d=>d.id)],a.defectIds=[...e.repairRowData.filter(d=>d.checked).map(d=>d.defectID)],e.master.userInfo&&(a.createdBy=e.master.userInfo.id),a.id=e.master.newGuid());const i=new v.ox;e.setJobReqstCustomerTask(i),i.jobRequest=a,i.uploadFileModels=e.jobReqInfo.uploadedFiles,i.make=e.master.getMake(e.objAssetData),e.objAssetData.model&&(i.model=e.objAssetData.model),i.disclaimerText=e.jobReqInfo.disclaimer,i.ccMails=e.prepareCCEmails(),i.supplierEmails=e.jobReqInfo.toEmails;const o=e.master.getOrgInfo(e.jobReqInfo.isSupplierRequest?a.customerId:a.workshopId);o&&(i.companyName=o[c.x$L.companyName],i.logo=o.logo,i.address1=o.address1,i.address2=o.address2,i.cityTown=o.cityTown,i.postCode=o.postCode,i.phoneNumber=o.phone,i.email=o.email,i.mainColor=o.mainColour);const n=[...e.inspectionRowData.filter(d=>d.checked).map(d=>({taskName:d.name,taskType:c.wP.InspectionAsText})),...e.maintenanceRowData.filter(d=>d.checked).map(d=>({taskName:d.name,taskType:c.wP.MaintenanceAsText})),...e.repairRowData.filter(d=>d.checked).map(d=>({taskName:d.name,taskType:c.wP.RepairAsText}))];i.externalTasks=n,e.isloading=!0,e.jobService.SaveAndSendJobRequestEmail(i).subscribe({next:d=>{Array.isArray(d)?(l.H.helperLog("Failed to save job request"),e.isloading=!1):(e.updateTaskPartsIfItsChanged(),e.objTaskArray=e.rowDataTask,e.toastrService.success("Job request saved successfully"),e.objJobData.jobRequestId=d.id,e.objJobData.jobRequestNumber=d.jobRequestNumber,e.jobReqInfo.isExistingJob?e.isloading=!1:(e.insertTask(!0),e.saveJobReqstParts()),e.isUpdatingJobRequest&&e.resetUpdateFlag())},error:d=>{l.H.helperLog("Failed to save job request - "),l.H.helperLog(d),e.toastrService.error("Failed to save job request"),e.isloading=!1}})})()}updateTaskPartsIfItsChanged(){this.jobReqInfo.isSupplierRequest||this.jobReqInfo.gridLineItemData.forEach(e=>{e.id&&e.taskPartUpdated&&this.rowDataTask.forEach(a=>{a?.parts?.forEach(i=>{i.partId===e.id&&(i.quantity=Number(e.quantity||l.H.zero),i.unitCost=Number(e.unitPrice||l.H.zero),i.taxRate=e.taxRateUnit)})})})}setJobReqstCustomerTask(e){if(!this.jobReqInfo.isSupplierRequest){const a=[];this.jobReqInfo.gridLineItemData.forEach(o=>{if(o.id){const n={partNo:o.partNumber,description:o.description,quantity:o.quantity,unitCost:o.unitPrice,taxR
1ate:o.taxRate,amount:o.amount};n.unit=this.master.partUnit.find(d=>d.id===(o.unit||c.bac.Each))?.[this.master.displayLang],a.push(n)}});const i=[];this.jobReqInfo.rowDataEstimateLabour.forEach(o=>{this.checkAndUpdateLabourInfoToJobTask(o);const n={taskName:o.taskName,hours:Number(o.hours),hoursRate:Number(o.hourlyRate),vatRate:o.taxRate,cost:o.cost};i.push(n)}),e.customerTask={taskParts:a,taskLabours:i,totalNetAmount:this.jobReqInfo.totalNetAmount,totalVat:this.jobReqInfo.totalVat}}}checkAndUpdateLabourInfoToJobTask(e){e.labourInfoUpdated&&this.rowDataTask.forEach(a=>{a.id===e.taskId&&(a.plannedHours=Number(e.hours),a.labourRate=Number(e.hourlyRate))})}saveJobReqstParts(){if(!this.jobReqInfo.isSupplierRequest){const e=[];this.jobReqInfo.gridLineItemData.forEach(a=>{if(a.id&&!a.isFromTaskPart){const i={type:"Part",jobID_PK:this.newJobID,stockType:a.stockType,stockCategory:a.stockCategory,partId:a.id,partNumber:a.partNumber,partName:a.partName,description:a.description,taxRate:a.taxRateUnit,quantity:a.quantity,unit:a.unit,unitCost:a.unitPrice,system:a.system,assembly:a.assembly,component:a.component,partStatus:l.H.id1,actualQuantity:0,isExternalPart:!0,id:a.id,isDelete:!1,createdBy:this.master.userInfo?.id||"",createdDate:this.getNowUTC(),updatedBy:this.master.userInfo?.id||"",updatedDate:this.getNowUTC()};e.push(i)}}),e?.length&&this.jobService.SaveJobPart(e).subscribe({next:a=>{this.isloading=!1,this.toastrService.success("Job request parts saved.")},error:a=>{l.H.helperLog("Failed to save job request parts - "),l.H.helperLog(a),this.toastrService.error("Failed to save job request parts"),this.isloading=!1}})}}prepareCCEmails(){return this.jobReqInfo.ccEmails?this.jobReqInfo.ccEmails.split(","):[]}loadJobRequestForUpdate(){return new Promise(e=>{this.objJobData.jobRequestId?(this.isUpdatingJobRequest=!0,this.subs.add=this.jobService.GetById(this.objJobData.jobRequestId).subscribe({next:a=>{a&&"object"==typeof a?this.rawJobReqstAPIRes=a:this.isUpdatingJobRequest=!1,e()},error:a=>{this.toastrService.error("Failed to load job request details."),this.isUpdatingJobRequest=!1,e()}})):(this.isUpdatingJobRequest=!1,e())})}resetUpdateFlag(){this.isUpdatingJobRequest=!1,this.rawJobReqstAPIRes={}}setDateFields(e,a,i){this.uDDates=a.filter(o=>{let n;if(this.inspectionRowData&&this.maintenanceRowData&&(n=[...this.inspectionRowData,...this.maintenanceRowData].filter(p=>this.getNotCancelledTaskServiceIDs().includes(p?.id)).find(p=>p?.fieldId===o?.id&&p.status!==c.e1J.cancelled)),n?.fieldId)if(o.updatedValue="",o.alternateId=this.getRootIdFromParentHierarchy(i,o),n?.alternateEveryUsage){const d=this.master.getPeriodFrameFromUsageUnits(n?.alternateUsageIn);o.stepCount=n.alternateEveryUsage,o.timeMode=d}else o.stepCount=0,o.timeMode="";return!!n?.fieldId}),this.standardDates=e.filter(o=>{let n;if(this.inspectionRowData&&this.maintenanceRowData&&(n=[...this.inspectionRowData,...this.maintenanceRowData].filter(p=>this.getNotCancelledTaskServiceIDs().includes(p?.id)).find(p=>p?.fieldId===o?.id)),n?.fieldId){const d=o?.fieldValue;if(o.value=this.objAssetData[d],o.updatedValue="",n?.alternateEveryUsage){const p=this.master.getPeriodFrameFromUsageUnits(n?.alternateUsageIn);o.stepCount=n.alternateEveryUsage,o.timeMode=p}else o.stepCount=0,o.timeMode=""}return!!n?.fieldId}),this.mappedKeydate=this.standardDates.concat(this.uDDates),this.mappedKeydate.length&&this.udFields.length&&this.getMappedDateValues()}getUdfFields(){this.workshopassetServ.standardFields.length?this.setDateFields(this.workshopassetServ.standardFields,this.workshopassetServ.udFields,this.workshopassetServ.allUdDateFields):this.workshopassetServ.getAllFields().subscribe(e=>{const[a=[],i=[]]=e,o=i.filter(d=>
1!d.isDelete&&d.isLatest&&d.fieldType===I.Y.id5),n=i.filter(d=>!d.isDelete&&d.fieldType===I.Y.id5);this.workshopassetServ.setDateFields(a,o,n),this.setDateFields(a,o,n)})}getRootIdFromParentHierarchy(e,a){if(!a.parentID)return a.id;let i="",o=Object.assign(a,{});for(;o.parentID;){const n=e.find(d=>o.parentID===d.id);if(!n?.parentID){i=o.parentID;break}o=Object.assign(n,{})}return i}redirectToAsset(e){this.router.navigate(["assets/asset-list/asset",{id:e}])}redirectToJobRequest(e){this.router.navigate(["assets/job-request-details",{id:e}])}redirectToEmergencyJobRequestPOFlow(e){this.router.navigate(["assets/job-request-details",{id:e,process:c.bwc.createEmergencyJobRequest}])}handleUrlParam(e){e.createJobTaskDoc&&(this.createJobTaskDoc=!0),e.process===c.bwc.createEmergencyJobRequest?(this.createJobRequest=!0,this.isEmergencyRequestMode=!0,this.objJobData.requestType=c.fti.SupplierRequest,this.jobReqInfo.isSupplierRequest=!0,this.jobReqInfo.requestMode=c.S3C.Emergency,this.prepareSupplierReqFlowSteps(),this.getWorkshopList()):e.process===c.bwc.createJobRequest&&(this.createJobRequest=!0,this.isEmergencyRequestMode=!1,this.jobReqInfo.requestMode=c.S3C.Standard,this.prepareSupplierReqFlowSteps(),this.getWorkshopList())}prepareSupplierReqFlowSteps(){this.supplierRequestFlow.length||(this.supplierRequestFlow=this.master.jobRequestStatus.filter(e=>e.id>=c.t3n.RequestSent&&e.id<=c.t3n.JobCompleted).sort((e,a)=>e.order-a.order).map(e=>({id:e.id,order:e.order,name:e[this.master.displayLang]})))}requesTypeChanged(){if(this.isEmergencyRequestMode)return this.objJobData.requestType=c.fti.SupplierRequest,void(this.jobReqInfo.isSupplierRequest=!0);this.objJobData.requestType===c.fti.SupplierRequest?(this.jobReqInfo.isSupplierRequest=!0,this.prepareSupplierReqFlowSteps()):(this.jobReqInfo.customerId="",this.jobReqInfo.isSupplierRequest=!1,this.prepareCustomerReqFlowSteps())}prepareCustomerReqFlowSteps(){this.customerRequestFlow.length||(this.customerRequestFlow=this.master.jobRequestStatus.filter(e=>e.id>=c.t3n.EstimateSent&&e.id<=c.t3n.CustomerChargeCardSent).sort((e,a)=>e.order-a.order).map(e=>({id:e.id,order:e.order,name:e[this.master.displayLang]})))}addNewJobRequest(){if(0!==this.rowDataTask?.length){if(this.isEmergencyRequestMode){const e=this.objScheduleData.workshopID||this.objJobData.workshopID,a=this.master.allworkshoplist.find(i=>i.id===e);return e&&a?a.type===c.YMJ.Workshop?void this.toastrService.warning("Please select an external workshop for emergency request."):(this.jobReqInfo.isExistingJob=!1,this.jobReqInfo.suppliers=[e],this.jobReqInfo.comment=this.objJobData.jobComment||this.jobReqInfo.comment||"",this.generateContentByReqstType(),void this.saveJobRequest()):void this.toastrService.warning("Please select a workshop.")}this.jobReqInfo.isExistingJob=!1,this.generateContentByReqstType(),this.showModal(this.createJobReqModelName)}else this.toastrService.warning(c.YMJ.AddTask)}showJobRequestForExistingJob(){if(this.jobId&&!this.isBookingDataUpdated){if(!this.master.isSuperAdmin&&!this.master.features.includes(c.G7b.wrkshp_planner_sendRequest))return void this.toastrService.error(y.B5.udonthavePerm);this.objJobData.requestType=c.fti.SupplierRequest,this.jobReqInfo.isExistingJob=!0,this.newJobID=this.objJobData.id,this.jobReqInfo.suppliers=[this.objJobData.workshopID],this.jobReqInfo.comment=this.objJobData.jobComment,this.generateContentByReqstType(),this.showModal(this.createJobReqModelName)}}generateContentByReqstType(){let e="";this.jobReqInfo.bookedByOrgId=this.jobReqInfo.isExistingJob?this.objJobData.customerID:this.objScheduleData.customerID,this.jobReqInfo.requestMode=this.isEmergencyRequestMode?c.S3C.Emergency:c.S3C.Standard,this.jobReqInfo.isSupplierRequest?(this.jobReqInfo.customerId=this.jobReqInfo.bookedByOrgId,this.jobReqInfo.jobRequestNumber=this.objJobData.jobRequestNumber,e="Request"):(this.objJobData.task=this.rowDataTask,e="Estimate",this.setParts(!1)),this.jobReqInfo.customerReference=this.objScheduleData.customerReference,this.jobReqInfo.plannedDate=this.objScheduleData.plannedDate||"",this.jobReqInfo.workshopParts=this.workshopParts,this.jobReqInfo.inspectionRowData=this.inspectionRowData.filter(a=>a.checked),this.jobReqInfo.maintenanceRowData=this.maintenanceRowData.filter(a=>a.checked),this.jobReqInfo.repairRowData=this.repairRowData.filter(a=>a.checked),this.jobReqInfo.disclaimer=this.master.disclaimerBodyText,this.jobReqInfo.subject=`${e} - ${this.objAssetData.vrm||this.objAssetData.fleetNumber} - ${this.objJobData.jobRequestNumber||"(Request No.Pending)"}`,this.jobReqInfo={...this.jobReqInfo}}getdisclaimer(){this.master.disclaimerBodyText||(this.subs.add=this.orgService.getDisclaimerByOrgId(this.master.parentOrgId).subscribe({next:e=>{e&&!Array.isArray(e)&&(this.master.disclaimerBodyText=e.disclaimerBody)},error:e=>{l.H.helperLog("Error while getting the disclaimer text")}}))}discardJobRequest(){this.isEmergencyRequestMode?this.navigateToPreviousPage():this.redirectToJobReqListPage()}navigateToPreviousPage(){window.history.length>l.H.id1?this.location.back():this.router.navigate(["/workshop/planner"])}showSignPadClick(){this.checkAuthRuleForSignOffOrCompletingJob()?(this.currentSignature=this.objJobData.supervisorSign||this.master.userInfo?.signature||"",this.showModal("jobComplteSignPad")):this.toastrService.warning(this.signWarningTxt)}checkAuthRuleForSignOffOrCompletingJob(e=!1){let a;return this.master.userInfo?.role===c.foM.superAdmin?a=!0:(a=this.master.features.includes(c.G7b.wrkshp_supvi_sign_off),a||e?this.matchedRule.roleList?.length?this.orgService.getAuthRuleUsersList(this.matchedRule.roleList).includes(this.master.userInfo?.id)||(a=!1,this.showNotAuthroisedWarning()):this.authRuleList?.length&&(a=!1,this.showNotAuthroisedWarning()):this.toastrService.warning(this.signWarningTxt)),a}showNotAuthroisedWarning(){this.toastrService.warning("You are not a Authorised Rule user")}saveSignToJob(e=!1){this.checkAuthRuleForSignOffOrCompletingJob()&&(e||(this.isloading=!0),this.closeModal("jobComplteSignPad"),this.jobId&&this.saveSupervisorSign(e))}saveSign(e){if(this.master.userInfo){this.isloading=!0;const i={fileData:e,status:0,fileName:`${this.master.userInfo.name?this.master.userInfo.name:this.master.userInfo.loginName}_${Date.now()}
1`,fileType:"image/png"};let o="";this.subs.add=this.taskService.uploadSignature(i).subscribe({next:n=>{"OK"===n.statusText&&n.body&&(o=n.body.url)},error:()=>{if(navigator.onLine)this.isloading=!1,this.toastrService.error(this.signatureFiledStr);else{o=e,this.isloading=!1;const n={key:"signature",value:Object.assign({offline:u.vQ.created,isSignatureUpload:!0},i)};this.idb.UpsertData(u.S.fileUpload,n);const d={key:this.master.userInfo?.id||"",value:Object.assign({offline:u.vQ.created,dataURL:e})};this.idb.UpsertData(u.S.images,d),this.closeModal("jobComplteSignPad")}},complete:()=>this.updateUserSign(o)})}}listenForValChanges(){this.workshopFilterCtrl.valueChanges.pipe((0,Z.Q)(this._onDestroy)).subscribe(()=>{this.filterWorkshops()})}masterDetailsLoaded(){var e=this;this.subs.add=this.master.masterInfoLoadedSubAsObs.pipe((0,pt.p)(a=>a)).subscribe((0,w.A)(function*(){e.updateWorkflowStatusPermission(),yield e.loadClassificationMasterData(),e.refreshAllTaskClassifications(),e.loadTaskDetails(),e.getdisclaimer(),e.getWorkshopList(),e.columnDefs=e.getTaskColumnDefs(),e.populateWorkFlowStatus()}))}updateWorkflowStatusPermission(){const e=this.master.isSuperAdmin||this.master.features.includes(c.G7b.wor_extnl_wrkflw_status),a=0===Number(this.objJobData?.workflowStatusID);this.canEditWorkflowStatus=e&&!a}populateWorkFlowStatus(){const e=this.master.masterOrgData?.filter(o=>o.lookupType===c.YMJ.WorkFlowStatus).flatMap(o=>o.details||[]),i=[...e&&e.length>0?e:[]].sort((o,n)=>(o.order??0)-(n.order??0));this.workflowGroupService.GetWorkFlowGroupStatusByRoleId(this.master.userInfo?.role).pipe((0,Z.Q)(this._onDestroy)).subscribe(o=>{let n;n=o&&o.length>0?i.filter(p=>o.includes(p.id)):i,n.some(p=>0===Number(p?.id??p?.statusId??p?.lookupId))||n.unshift({id:0,lookupId:0,statusId:0,statusName:"Cancelled",en:"Cancelled",value:"Cancelled",name:"Cancelled",text:"Cancelled",order:0}),this.workFlowStatusList=n})}getWorkshopList(){if(this.workshopList=this.master.allworkshoplist,this.master.isSuperAdmin)this.workshopList=this.applyEmergencyWorkshopFilter(this.workshopList),this.filteredWorkshops.next(this.workshopList.slice());else{const e=this.master.userInfo?.mappedOrgIDs||[];this.workshopList=this.master.allworkshoplist.filter(a=>e.includes(a.id)),this.workshopList=this.applyEmergencyWorkshopFilter(this.workshopList),this.workshopList.length||this.toastrService.warning(this.isEmergencyRequestMode?"There is no external workshop assigned in user locations":"There is no workshop assigned in user locations"),this.filteredWorkshops.next(this.workshopList.slice())}}applyEmergencyWorkshopFilter(e){return this.isEmergencyRequestMode?e.filter(a=>a.type!==c.YMJ.Workshop):e}getSelectedWorkshopName(e){return this.workshopList?.find(a=>a.id===e)?.value||""}filterWorkshops(){if(!this.workshopList)return;let e=this.workshopFilterCtrl.value;e?(e=e.toLowerCase(),this.filteredWorkshops.next(this.workshopList.filter(a=>a.value.toLowerCase().indexOf(e)>-1))):this.filteredWorkshops.next(this.workshopList.slice())}updateUserSign(e){if(this.master.userInfo){const a=this.master.userInfo;this.master.userInfo.signature=e,this.subs.add=this.userService.updateUser(a).subscribe({next:i=>{this.master.userInfo=i},error:()=>{if(navigator.onLine)this.isloading=!1,this.toastrService.error(this.signatureFiledStr);else{const i={key:this.master.userInfo?.id||"",value:a};i.value.offline=u.vQ.updated,this.idb.UpsertData(u.S.user,i).then(o=>{o&&(this.master.userInfo=i.value)}).catch(o=>{this.toastrService.error(this.offlineDataFail)})}},complete:()=>this.saveSignToJob()})}}setSupervisorSign(e){this.supervisorSign=`${e}?t= ${Date.now()}`}saveSupervisorSign(e){if(this.master.userInfo){if(this.setSupervisorSign(this.master.userInfo.signature),this.objJobData.supervisorSign=this.master.userInfo.signature,this.objJobData.supervisorSigned=!0,this.setSupervisorSign(this.master.userInfo.signature),this.objJobData.updatedDate=l.H.moment(Date.now()).utc().format(),this.jobHistoryDesc=`Signed Job ${this.objJobData.jobNumber}`,e)return;this.storeJob(this.objJobData,!1,a=>{a?(this.toastrService.error("Failed to Update Signature in Job"),this.enableBackdateAction=!0):(this.enableBackdateAction=!0,this.isloading=!1),this.jobHistoryDesc=""})}}fetchAllRoles(){this.subs.add=this.roleService.getRoleList().subscribe()}getAuthorizationRules(){this.subs.add=(0,mt.p)([this.orgService.getAuthorizationRuleByOrgID(this.master.navSelectedOrgID)]).subscribe(e=>{this.authRuleList=e?.length?e[0]:[],(this.rowdata?.length||this.totlPartsPriceWithTax>0)&&this.setAuthRuleByTotalPartsPriceValue()})}addSelectedNavOrgAsCust(){if(this.master.selectedOrg)this.updateCustomerList();else{const e=setInterval(()=>{this.master.selectedOrg&&(clearInterval(e),this.updateCustomerList())},l.H.twoThousand)}}updateCustomerList(){this.CustomerList.push({id:this.master.selectedOrg.id,value:this.master.selectedOrg.companyName}),this.jobId||(this.objScheduleData.customerID=this.master.selectedOrg.id)}prepareWizard(){this.totalWizard=[{name:"Details"},{name:"Schedule"},{name:"Tasks"}]}prepareRepeatJobOptions(){this.repeatJobOptions=[{name:"One Time Job",value:!1},{name:"Repeat Job",value:!0}]}goToCurrentTab(){this.selectedTab=localStorage.getItem("newBookingCurrentTab")||l.H.zero}goToPartTab(){this.selectedTab=1}scrollToCurrentIsoWeek(){this.master.scrollToCurrentIsoWeek("iso-table-1",l.H.twotwenty)}alertupdate(e){e.data?this.getAlerts():this.blnToggle=!1}saveJobWorkshopLocationLookup(e){if(this.jobWorkshopLocationBtnDisable=!0,!this.jobWorkshopLocationLookUpValue)return this.toastrService.warning("Please fill value"),void(this.jobWorkshopLocationBtnDisable=!1);const a={id:1,[this.master.displayLang]:this.jobWorkshopLocationLookUpValue,canDelete:!0};switch(this.jobWorkshopLocationLookupType){case"AddLocation":this.addJobWorkshopLocation(a,this.jobWorkshopLocationmodelTitle,e);break;case"EditLocation":this.switchLookupEditAsset(e)}}showJobWorkshopLocationLookupModal(e,a){var i=this;return(0,w.A)(function*(){switch(i.jobWorkshopLocationLookupType=a,a){case"AddLocation":i.jobWorkshopLocationmodelTitle="Add Workshop location",i.showModal(e);break;case"EditLocation":yield i.importService.getMasterOrgData(),i.jobWorkshopLocationmodelTitle="Edit Workshop location",i.editJobWorkshopLoc(e)}})()}switchLookupEditAsset(e){this.importService.isValidateLookup(this.jobWorkshopLocationLookUpValue,this.masterJobWorkshopLocations)?this.updateAssetType("type",e,"",""):this.jobWorkshopLocationBtnDisable=!1}updateAssetType(e,a,i,o){const n=this.master.masterOrgData.find(d=>d.lookupType===c.YMJ.JobWorkshopLocations);if(n)if(n.updatedBy=this.master.userInfo?.id||"",n.updatedDate=l.H.moment(new Date).utc().format(),"type"===e)n.details.find(d=>d.id===this.jobWorkshopLocationSelLookup.id)[this.master.displayLang]=this.jobWorkshopLocationLookUpValue,this.importService.lookUpToDB(!1,n,this.jobWorkshopLocationmodelTitle,this.masterJobWorkshopLocations,a).then(()=>{this.jobWorkshopLocationLookUpValue=""}).finally(()=>{this.jobWorkshopLocationBtnDisable=!1});else{const d=i||this.editingJobWorkshopLoc.id;n.details.find(p=>p.id===d)&&(n.details.find(p=>p.id===d).canDelete=o,this.importService.lookUpToDB(!1,n,"",this.masterJobWorkshopLocations,a))}}canDeleteWorkshopLocation(){if(this.editingJobWorkshopLoc.id){const e=this.master.jobWorkshopLocations.find(a=>a.id===this.editingJobWorkshopLoc.id);return!!e&&e.canDelete}return!1}editJobWorkshopLoc(e){if(this.editingJobWorkshopLoc.id){const a=this.master.jobWorkshopLocations.find(i=>i.id===this.editingJobWorkshopLoc.id);this.mapLookUpValue(a),this.showModal(e)}else this.toastrService.warning(this.workshopLocEditWaring)}mapLookUpValue(e){e&&(this.jobWorkshopLocationLookUpValue=e[this.master.displayLang],this.jobWorkshopLocationSelLookup=e)}addJobWorkshopLocation(e,a,i){let o=!1;if(this.importService.isValidateLookup(this.jobWorkshopLocationLookUpValue,this.masterJobWorkshopLocations)){let n=this.master.masterOrgData.find(d=>d.lookupType===c.YMJ.JobWorkshopLocations);n?(n.updatedBy=this.master.userInfo?.id||"",n.updatedDate=l.H.moment(new Date).utc().format(),n.details.length>0&&(n.details.sort((d,p)=>p.id-d.id),e.id=Number(n.details[0].id)+1),n.details.push(e),n.details.sort((d,p)=>d.id-p.id)):(n=this.importService.masterLookUpTemplate(c.YMJ.JobWorkshopLocations,this.master.getParentOrgId(this.master.navSelectedOrgID)),n.details.push(e),o=!0),this.importService.lookUpToDB(o,n,a,this.masterJobWorkshopLocations,i).then(()=>this.jobWorkshopLocationLookUpValue="").finally(()=>{this.jobWorkshopLocationBtnDisable=!1})}else this.jobWorkshopLocationBtnDisable=!1}
1deleteLookupValidation(){return!!this.editingJobWorkshopLoc.id||(this.toastrService.warning(this.workshopLocEditWaring),!1)}deleteLookup(e){var a=this;return(0,w.A)(function*(){if(a.deleteLookupValidation()&&e===c.YMJ.JobWorkshopLocations){const i=a.master.masterOrgData.find(o=>o.lookupType===c.YMJ.JobWorkshopLocations);if(i){i.updatedBy=a.master.userInfo?.id||"",i.updatedDate=l.H.moment(new Date).utc().format();const o=i.details.findIndex(n=>n.id===a.editingJobWorkshopLoc.id);-1!==o&&(i.details.splice(o,1),yield a.importService.lookUpToDB(!1,i,"Delete workshop location",a.masterJobWorkshopLocations,e),a.editingJobWorkshopLoc={},a.objJobData.locationCategoryId=0)}}})()}checkAndUpdateTaskDetails(){const e=setInterval(()=>{this.userService.orgUserList?.length&&(clearInterval(e),this.loadTaskDetails())},l.H.onesec*l.H.id2)}prepareExternalWorkshop(){this.isExternalWorkshop(this.jobStatus===c.A8Q.unplanned?this.objScheduleData.workshopID:this.objJobData.workshopID)}getOrgUsers(e){this.userService.orgUserList=[],navigator.onLine?this.subs.add=this.userService.getUserListByMappedOrganization(e).subscribe({next:()=>{this.processOrgUserResp()},error:()=>{this.isloading=!1,this.toastrService.error("Error while getting users for the selected workshop")}}):this.idb.getData(u.S.user,e).then(a=>{this.userService.processUserResp(a),this.processOrgUserResp()})}processOrgUserResp(){this.userService.orgUserList||this.toastrService.warning("There is no users for the selected workshop"),this.loadTaskDetails(),this.jobId&&(this.isloading=!1)}cancelTask(e){this.master.features.includes(c.G7b.wrkshp_cancel_tasks)?(this.isTaskCancel=!0,this.selectedTaskSvc=e,this.getTaskById(),this.modalService.open("showCancelReason"),this.cancellationReason=""):this.toastrService.error("Sorry, you don't have permission to do that")}viewTaskDetails(e){this.selectedTaskSvc=e,this.selectedTaskSvc.assetTypeDesc=this.getAssetTypeDesc(e.assetType),this.selectedTaskSvc.assetMakeDesc=this.getAssetMakDesc(e.make),this.selectedTaskSvc.assetMakeRangeDesc=this.getAssetRange(e.make,e.range),this.selectedTaskSvc.serviceTypeDesc=this.getServiceTypeDesc(e.serviceType),this.selectedTaskSvc.serviceUsageBasedDesc=this.getServiceUsageDesc(e.usageIn),this.selectedTaskSvc.serviceUsageBasedDesc=this.getServiceUsageDesc(e.usageIn),this.selectedTaskSvc.serviceAlternateUsageBasedDesc=this.getServiceUsageDesc(e.alternateEveryUsage),this.getCheckSheetName(this.selectedTaskSvc.checkSheet),this.modalService.open("plannerViewServiceDetails")}viewDefectReapirTaskDetails(e){this.showDefectRepairDetails=!0,this.hasPendingDefectClassificationChanges=!1,this.selectedTaskSvc=e,this.ensureTaskClassificationDefaults(this.selectedTaskSvc),this.refreshClassificationOptionLists(this.selectedTaskSvc),this.selectedTaskSvc.DefectRepairId=e.defectID,this.cdr.detectChanges(),this.isDefectRepairOpen=!0,this.modalService.open("defectRepairDetails")}startEditDefectComment(e,a){if(this.master.userroleselected.featureid?.includes(c.G7b.wor_edtdefectcomments)||this.master.isSuperAdmin){if(this.defectId=a.defectID,this.defectId){const o=this.jobDefectList.find(n=>n.id===this.defectId);if(o){this.objDefect=o;const n=this.defectNotesSortByDate(o.defectNotes);n?.length?(this.oldestDdefectCommentInfo=n[n.length-1],this.modalService.open(e)):(this.oldestDdefectCommentInfo={},this.toastrService.warning("There is no defect comment available"))}else this.toastrService.warning("There is no defect available for the task")}else this.toastrService.warning("There is no defect id for this task");return!0}return this.toastrService.warning("User has no permission to edit the comment"),!1}updateDefectComment(){this.objDefect.defectNotes=this.getUpdatedNotes(this.objDefect.defectNotes),this.objDefect.updatedBy=this.master.userInfo?.id||"",this.objDefect.updatedDate=l.H.moment(new Date).utc().format(),this.isloading=!0,this.closeDefectCommentHistoryModal("defectCommentHistory"),this.subs.add=this.defect.updateDefect(this.objDefect).subscribe({next:()=>{this.updateTaskName(),this.toastrService.success("Defect comment updated")},error:()=>{this.isloading=!1}})}getUpdatedNotes(e){if(e?.length){const a=e.findIndex(i=>i.id===this.oldestDdefectCommentInfo.id);a>-1&&(e[a]=this.oldestDdefectCommentInfo)}return e}updateTaskName(){const e=this.objJobData.task.find(a=>a.defectID===this.objDefect.id);e?this.jobService.taskService.updateJobTaskName(e,this.objDefect).then(()=>{this.isloading=!1,this.editJobDetails()}).catch(()=>{this.isloading=!1}):(this.isloading=!1,this.editJobDetails())}closeDefectCommentHistoryModal(e){this.closeModal(e)}
1closeDefectDetailsModal(){this.persistClassificationFromRow(this.selectedTaskSvc),this.saveDefectClassificationTaskChanges(),this.isDefectRepairOpen=!1,this.closeModal("defectRepairDetails"),this.selectedTaskSvc={},this.showDefectRepairDetails=!1,this.checkAndReloadData()}checkAndReloadData(){this.isReloadData&&(this.isReloadData=!1,this.getAuthorizationRules(),this.editJobDetails())}needReloadData(){this.isReloadData=!0}cancelFromDefectCommentHist(){this.closeDefectDetailsModal()}addParts(e){this.selectedTaskSvc=e,this.showModal("addPartTab"),this.prepareTaskType(e.defectID||e.id)}addPartToJob(){this.workshopassetServ.checkAddPartsToTaskPermission()?(this.addPartDetails=null,this.isNewPart=!0,this.isNewPartAdded=!0,this.showModal("addPartTab")):this.master.toasterService.warning(this.workshopassetServ.errMsgAddPartsToTaks)}prepareTaskType(e){this.taskRows=[],e&&this.rowDataTask.forEach(a=>{a.serviceID!==e&&a.defectID!==e||this.taskRows.push({id:a.id,name:a.name,status:a.status})})}loadTaskService(e){this.maintenanceRowData=e.maintenanceService,this.inspectionRowData=e.inspectionService,this.jobId?this.isloading=!1:(this.progressMsg="Get checksheet details",this.newJobID=this.master.newGuid(),this.getTaskChecksheetIDs([...this.maintenanceRowData,...this.inspectionRowData]),this.getAndLoadWorkshopParts()),this.loadTaskDetails(),this.getUdfFields()}prepareJobHistoryColDef(){this.historyColumnDefs=[{field:"createdDate",headerName:"Date",comparator:l.H.dateComparator,valueGetter:l.H.dateTimeValueGetter,...l.H.agGridBasicCols},{field:"userName",headerName:"User",...l.H.agGridBasicCols,valueGetter:e=>this.master.getUserName(e.data.createdBy)},{field:"description",headerName:"Description",...l.H.agGridBasicCols},{field:"status",headerName:this.isExternalWorkshopJob()?"Job Status":"Status",...l.H.agGridBasicCols,valueGetter:e=>c.Jd3[e.data.jobStatus]},...this.isExternalWorkshopJob()?[{field:"workFlowStatus",headerName:"WorkFlow Status",...l.H.agGridBasicCols,valueGetter:e=>this.getWorkflowStatusName(e.data?.workFlowStatus)}]:[],{field:"comment",headerName:"Comments",...l.H.agGridBasicCols}],this.jobCostChargesColumnDefs=[{field:"taskName",headerName:"Task Name",sortable:!0,filter:!0,floatingFilter:!0,resizable:!0},{field:"eventDate",headerName:"Date",comparator:l.H.dynamicDateComparator,valueGetter:l.H.dateValueGetter,sortable:!0,filter:!0,floatingFilter:!0,resizable:!0},{field:"eventName",headerName:"Event",sortable:!0,filter:!0,floatingFilter:!0,resizable:!0},{field:"supplier",headerName:"Supplier",sortable:!0,filter:!0,floatingFilter:!0,resizable:!0},{field:"customer",headerName:"Customer",sortable:!0,filter:!0,floatingFilter:!0,resizable:!0},{field:"reference",headerName:"Reference",sortable:!0,filter:!0,floatingFilter:!0,resizable:!0},{field:"documentAT",headerName:"Action",cellRenderer:"pdfCellRenderer",cellRendererParams:{onClick:this.onBtnPreviewClick.bind(this),btnName:"Review"},sortable:!1,filter:!1,resizable:!0},{field:"revenue",headerName:"Revenue",sortable:!0,filter:!0,floatingFilter:!0,resizable:!0,valueFormatter:e=>{const a=Number(e?.value||0);return a<=0?"":`${e?.data?.currencySymbol||this.master.defaultCurrencySymbol||""}${a.toFixed(2)}`}},{field:"cost",headerName:"Cost",sortable:!0,filter:!0,floatingFilter:!0,resizable:!0,valueFormatter:e=>{const a=Number(e?.value||0);return a<=0?"":`${e?.data?.currencySymbol||this.master.defaultCurrencySymbol||""}${a.toFixed(2)}`}},{field:this.master.datalist.Delete,headerName:this.master.datalist.Delete,filter:!1,floatingFilter:!1,cellRenderer:"deleteCellRenderer",cellRendererParams:{onClickDelete:this.confirmDeleteJobCostModel.bind(this)},sortable:!1,resizable:!0}]}isExternalWorkshopJob(){return!0===this.objJobData?.isExternalJob||this.isExternal}getWorkflowStatusName(e){if(0===Number(e))return"Cancelled";const a=this.master.masterOrgData?.filter(i=>i.lookupType===c.YMJ.WorkFlowStatus).flatMap(i=>i.details||[]).find(i=>Number(i?.id??i?.statusId??i?.lookupId)===Number(e));return a?.en||a?.value||a?.name||a?.text||""}normalizeCostKey(e){return String(e||"").trim().toLowerCase()}getTaskMatchForCostRow(e,a=""){const i=this.normalizeCostKey(a||e?.taskID||e?.taskId),o=this.normalizeCostKey(e?.defectID||e?.defectId);return this.rowDataTask?.find(n=>
1{const d=this.normalizeCostKey(n.id),p=this.normalizeCostKey(n.defectID);return i&&d===i||o&&p===o})}getSelectedTaskForJobCostAction(){return this.selectedTaskForJobCostAction?this.selectedTaskForJobCostAction:Array.isArray(this.rowDataTask)&&1===this.rowDataTask.length?this.rowDataTask[0]:null}onJobCostChargesRowClicked(e){const a=e?.column?.getColId?.()||e?.colDef?.field||"";if("documentAT"===a||a===this.master.datalist.Delete)return;const i=e?.data;i&&(this.selectedTaskForJobCostAction=this.rowDataTask?.find(o=>o.id===i.taskID||i.defectID&&o.defectID===i.defectID)||null)}openJobLevelCostDialog(e=!1){const a=this.getSelectedTaskForJobCostAction();a?(this.openCostDialog(a),e&&(this.taskCostForm.rechargeToOperator=!0)):this.toastrService.warning("Please select a task row in Cost / Charges grid first")}getJobCostChargesTotalRevenue(){return(this.jobCostChargesRowData||[]).reduce((e,a)=>e+Number(a?.revenue||0),0)}getJobCostChargesTotalCost(){return(this.jobCostChargesRowData||[]).reduce((e,a)=>e+Number(a?.cost||0),0)}getRechargeEligibleTasks(){return Array.isArray(this.rowDataTask)?this.rowDataTask.filter(e=>this.getPayableRechargeCost(e)>0):[]}hasRechargeEligibleTasks(){return this.getRechargeEligibleTasks().length>0}getAllDefectIdsFromTasks(){return Array.isArray(this.rowDataTask)?Array.from(new Set(this.rowDataTask.map(e=>String(e?.defectID||e?.defectId||"").trim()).filter(e=>!!e))):[]}upsertDefectCostResponses(e=[]){e.forEach(a=>{const i=this.defectCost.findIndex(o=>o.defectId===a.defectId);i>-1?this.defectCost[i]=a:this.defectCost.push(a)})}refreshEmbeddedAssetCostGrid(e=!0){this.assetCostGridComp?.getAssetCostList(),e&&setTimeout(()=>{this.assetCostGridComp?.getAssetCostList();try{this.cdr.markForCheck()}catch{}},400)}refreshRechargeAndCostViews(e=!0){this.refreshEmbeddedAssetCostGrid(e);try{this.cdr.detectChanges()}catch{}}refreshDefectCostSummary(e,a=!0){e?.length?(this.subs.add=this.taskService.GetAllDefectCostResponse(e).subscribe({next:i=>{this.upsertDefectCostResponses(i||[]),this.refreshRechargeAndCostViews(a)},error:()=>{this.refreshRechargeAndCostViews(a)}}),a&&setTimeout(()=>{this.refreshDefectCostSummary(e,!1)},400)):this.refreshRechargeAndCostViews(a)}onAssetCostDataChanged(){const e=this.getAllDefectIdsFromTasks();this.refreshDefectCostSummary(e)}openJobLevelRechargeModal(){const e=this.getRechargeEligibleTasks();if(!e.length)return void this.toastrService.warning("No eligible defects found for recharge");const a=this.getSelectedTaskForJobCostAction(),i=a&&e.some(o=>o.id===a.id)?a:e[0];this.isBulkRechargeMode=!0,this.bulkRechargeTasks=e,this.openDefectRechargeModal(i)}getRechargeTaskCount(){return this.rechargeModalTasks?.length||0}getRechargeTaskDisplayIndex(){return this.getRechargeTaskCount()?this.rechargeModalTaskIndex+1:0}canGoRechargePrev(){return this.rechargeModalTaskIndex>0}canGoRechargeNext(){return this.rechargeModalTaskIndex<this.getRechargeTaskCount()-1}goRechargePrev(){this.canGoRechargePrev()&&this.setRechargeModalTaskByIndex(this.rechargeModalTaskIndex-1)}goRechargeNext(){this.canGoRechargeNext()&&this.setRechargeModalTaskByIndex(this.rechargeModalTaskIndex+1)}getTotalPendingRechargeCostAmount(){return(this.rechargeModalTasks?.length?this.rechargeModalTasks:[]).reduce((a,i)=>a+this.getPayableRechargeCost(i),0)}getTotalRechargeAmountPreview(){return(this.rechargeModalTasks?.length?this.rechargeModalTasks:[]).reduce((a,i)=>a+this.calculateRechargeAmountForTask(i),0)}calculateRechargeAmountForTask(e){const o=this.getPayableRechargeCost(e)*this.getEffectiveRechargePercent()/100,n=Number(e?.customerMarginPercentage||l.H.zero),m=o+(this.rechargeModalData.applyCustomerMargin||n>l.H.zero?o*n/100:0);return m+m*this.master.getTaxPercent(this.rechargeModalData?.vatType||l.H.id1)/l.H.id100}getCostEventNameForRow(e){const a=e?.eventId??e?.event;if(Number(a)===l.H.zero&&e?.description)return e.description;const n=(Number(e?.revenue||0)>0&&0===Number(e?.cost||0)?this.master.chargeEvent:this.master.costEvent)?.find(d=>String(d.id)===String(a));return n?.[this.master.displayLang]||n?.value||e?.eventName||e?.costEventName||e?.description||""}getRechargeStatusForCostRow(e,a=null){if(!e)return"";const i=String(e?.defectID||e?.defectId||a?.defectID||"").trim(),o=Number(e?.cost||e?.amount||0),n=Number(e?.revenue||0),d=String(e?.assetMaunalCostId||e?.id||"").trim().toLowerCase();if(!(i&&o>0)||n>0&&o<=0)return"";const m=this.defectCost.find(g=>String(g?.defectId||"").trim()===i);if(m&&d){if((m.costIds||[]).map(f=>String(f||"").trim().toLowerCase()).includes(d))return"Recharge Pending";if(Number(m.totalRechargeCost||0)>0)return"Recharge Done"}return e?.isCostRecharged?"Recharge Done":"Recharge Pending"}renderRechargeStatusBadge(e){return console.log("status +++:",e),e?{statusDisplay:e,className:"Recharge Done"===e?"recharge-status-done":"recharge-status-pending"}:null}mapAssetCostToJobGridRow(e,a=""){const i=this.getTaskMatchForCostRow(e,a);return i?{id:e?.assetMaunalCostId||e?.id||this.master.newGuid(),taskName:i?.name||i?.defectQstn||"",eventDate:new Date(e?.eventDate||e?.createdDate||new Date),eventName:this.getCostEventNameForRow(e),supplier:e?.supplier||e?.supplierName||"",customer:e?.customer||"",reference:e?.reference||"",rechargeStatus:this.getRechargeStatusForCostRow(e,i),documentAT:e?.documentAT||e?.defectdocAT||e?.documents?.find(o=>!o?.isDelete)?.defectdocAT||"",revenue:Number(e?.revenue||0),cost:Number(e?.cost||e?.amount||0),currencySymbol:e?.currencySymbol||this.master.defaultCurrencySymbol,taskID:e?.taskID||e?.taskId||"",defectID:e?.defectID||e?.defectId||"",jobID:e?.jobID||e?.jobId||"",showDelete:!(!e?.assetMaunalCostId&&!e?.id)}:null}mapLocalTaskCostsFallbackToRows(){const e=[];return Array.isArray(this.rowDataTask)&&this.rowDataTask.forEach(a=>{const i=a?.name||a?.defectQstn||"Task";
1(Array.isArray(a?.taskCosts)?a.taskCosts:[]).forEach(n=>{e.push({id:n?.id||this.master.newGuid(),taskName:i,eventDate:new Date(n?.createdDate||n?.eventDate||new Date),eventName:n?.costEventName||n?.description||"",supplier:n?.supplierName||"",customer:"",reference:"",rechargeStatus:this.getRechargeStatusForCostRow({...n,defectID:a?.defectID,cost:Number(n?.amount||0),revenue:n?.rechargeToOperator?Number(n?.amount||0):0}),documentAT:"",revenue:n?.rechargeToOperator?Number(n?.amount||0):0,cost:Number(n?.amount||0),currencySymbol:this.master.defaultCurrencySymbol,taskID:a?.id||"",defectID:a?.defectID||"",jobID:this.jobId,showDelete:!!n?.id})})}),e}confirmDeleteJobCostModel(e){const i=(e?.rowData||e?.data)?.id;i?(this.warningMsg="Are you sure you want to delete this?.",this.subs.add=this.assetService.getAssetManualCostByID(i).subscribe({next:o=>{o&&!Array.isArray(o)?(this.selectedJobCostForDelete=o,this.modalService.open(this.confirmJobCostDeleteModalName)):this.toastrService.warning("Unable to load cost details for delete")},error:()=>this.toastrService.error("Failed to load cost details.")})):this.toastrService.warning("Unable to delete this cost record")}deleteJobCost(){if(!this.selectedJobCostForDelete)return;const e={...this.selectedJobCostForDelete,isDelete:!0,updatedBy:this.master.userInfo?.id||"",updatedDate:l.H.moment(new Date).utc().format()};this.btnDisableSave=!0,this.subs.add=this.assetService.updateAssetManualCost(e).subscribe({next:()=>{const a=e.defectID||"";this.toastrService.success("Cost details deleted"),this.selectedJobCostForDelete=null,this.btnDisableSave=!1,this.closeModal(this.confirmJobCostDeleteModalName),a?this.getDefectCostDetails(a):this.loadJobCostChargesGridData()},error:()=>{this.toastrService.error("Failed to Delete Cost details."),this.btnDisableSave=!1}})}computeJobEstimatedCost(){const e=String(this.objJobData?.workshopID||this.objScheduleData?.workshopID||"").trim(),a=this.objJobData?.task||this.rowDataTask||[];if(!e||!a.length)return void(this.jobEstimatedCost=0);const i=[...this.inspectionService||[],...this.maintenanceService||[],...this.immediateInspecService||[],...this.inspectionRowData||[],...this.maintenanceRowData||[]];this.jobEstimatedCost=a.filter(o=>!o?.isDelete&&o?.status!==c.e1J.cancelled&&o?.serviceID).reduce((o,n)=>{const p=(i.find(m=>String(m?.id)===String(n.serviceID))?.suppliers||[]).find(m=>String(m?.supplierId)===e);return o+Number(p?.cost||0)},0)}loadJobCostChargesGridData(){if(!this.assetId||!this.jobId)return void(this.jobCostChargesRowData=this.mapLocalTaskCostsFallbackToRows());this.computeJobEstimatedCost();const e=(this.objJobData?.task||this.rowDataTask||[]).filter(m=>!m?.isDelete&&!!m?.id),a=new Set,i=new Set,o=new Map;e.forEach(m=>{const g=String(m?.id||"").trim(),f=String(m?.defectID||"").trim();g&&a.add(g),f&&(i.add(f),g&&!o.has(f)&&o.set(f,g))});const n=Array.from(a).sort(),d=Array.from(i).sort(),p=`${this.jobId}|${n.join(",")}|${d.join(",")}`;if(!n.length&&!d.length)return this.jobCostChargesRowData=[],this.isJobCostChargesRequestInFlight=!1,void(this.jobCostChargesRequestKey="");this.isJobCostChargesRequestInFlight&&this.jobCostChargesRequestKey===p||(this.isJobCostChargesRequestInFlight=!0,this.jobCostChargesRequestKey=p,this.subs.add=this.assetService.getAssetManualCosts(this.jobId,n,d).subscribe({next:m=>{const g=Array.isArray(m)?m:Array.isArray(m?.data)?m.data:Array.isArray(m?.items)?m.items:[],f=new Map;(g||[]).forEach(R=>{const B=String(R?.defectID||R?.defectId||"").trim(),j=String(R?.taskID||R?.taskId||o.get(B)||"").trim(),S=this.mapAssetCostToJobGridRow({...R,taskID:j,defectID:B},j);if(!S?.taskName)return;const _=`${S.id}-${S.taskID}-${S.eventName}-${S.cost}-${S.revenue}`;f.has(_)||f.set(_,S)}),this.jobCostChargesRowData=Array.from(f.values()),this.isJobCostChargesRequestInFlight=!1},error:()=>{this.jobCostChargesRowData=[],this.isJobCostChargesRequestInFlight=!1}}))}onHistoryFirstDataRendered(){this.agGridJobHistory?.api?.sizeColumnsToFit()}onJobCostChargesFirstDataRendered(){this.agGridJobCostCharges?.api?.sizeColumnsToFit()}getJobHistoryData(){this.isHistoryTabLoading=!0,navigator.onLine?this.subs.add=this.jobService.getJobHistoryByJobId(this.jobId).subscribe({next:e=>{this.isHistoryTabLoading=!1,e&&e.length?(this.jobHistoryData=e,this.idb.bulkUpsert(u.S.jobHistory,e)):this.onHistoryFirstDataRendered()},error:()=>this.isHistoryTabLoading=!1}):this.idb.getAllByIndex(u.S.jobHistory,u.pM.job_Idx,this.jobId).then(e=>{this.isHistoryTabLoading=!1,e&&e.length&&(this.jobHistoryData=e)}).catch(()=>{this.isHistoryTabLoading=!1})}onTabChanged(e){this.selectedTab=e.index;const a=e.tab?.textLabel;if(this.isHistoryTabActive="History"===a,this.jobId&&localStorage.setItem("newBookingCurrentTab",this.selectedTab),"Schedule"===a)this.getAssetJob();
1else if("Tasks"===a)this.loadTaskDetails();else if("Documents"===a)this.onLoadJobDocuments();else if("Parts"===a.trim())this.getAndLoadWorkshopParts();else if("Cost / Charges"===a)this.loadJobCostChargesGridData();else{if("History"!==a)return;this.getJobHistoryData()}}getAndLoadWorkshopParts(){this.setParts()}getAssetTypeDesc(e){return e===l.H.all?"All":this.master.assetTypes.find(i=>i.id===e)?.[this.master.displayLang]||""}getServiceTypeDesc(e){return e===l.H.all?"All":this.master.serviceTypeLookup.find(i=>i.id===e)?.[this.master.displayLang]||""}getServiceUsageDesc(e){return c.Ux9.usageInArray.find(i=>i.id===e)?.name||""}getAssetMakDesc(e){return e===l.H.all?"All":this.master.makes.find(i=>i.id===e)?.[this.master.displayLang]||""}getAssetRange(e,a){return a===l.H.all?"All":this.master.makes.filter(n=>n.id===e).find(n=>n.id===a)?.[this.master.displayLang]||""}onStepChanged(e){"prev"===e?this.selectedTab=this.selectedTab-1:0!==this.selectedTab||this.blnAssetSelected?(this.selectedTab=this.selectedTab+1,this.checkAndGetPartsInfo()):this.toastrService.warning("Please select Any asset and proceed")}checkAndGetPartsInfo(){this.selectedTab===l.H.id1&&this.getWorkshopParts()}loadTaskDetails(){var e=this;return(0,w.A)(function*(a=!1){if(e.isProcessingTaskDetails)return;const i=e.jobId?e.objJobData.workshopID:e.objScheduleData.workshopID,o=e.master.orgList?.find(n=>n.id===i);e.workStationList=o?o.workShopSettings?.workStation:[],e.prepareExternalWorkshop();try{e.cdr.markForCheck()}catch{}e.isProcessingTaskDetails=!0,setTimeout(()=>
1{e.processTaskDetailsInBackground(a)},0)}).apply(this,arguments)}processTaskDetailsInBackground(e){var a=this;return(0,w.A)(function*(){try{a.userService.orgUserList?.length||a.checkAndUpdateTaskDetails();let i=[];const o=[];a.workStationList&&!a.isExternal&&(a.userService.orgUserList.filter(d=>1===d.status).forEach(d=>{a.master.allRoleList.find(m=>m.id===d.role)?.featureid?.indexOf(c.G7b.wrkshp_asgn_task)>-1&&i.push({id:d.id,value:d.name||d.loginName})}),a.workStationList?.forEach(d=>{o.push({id:d.id,value:d.name})})),i=a.master.sortDetails(i,"value","",!0),a.workStationList?.length&&(a.workStationList=a.master.sortDetails(a.workStationList,"value","",!0)),yield a.loadClassificationMasterDataCached(),a.maintenanceRowData=a.alterArrayData(a.maintenanceRowData,o,i),a.inspectionRowData=a.alterArrayData(a.inspectionRowData,o,i),a.repairRowData=a.alterArrayData(a.bindRepairTask(),o,i),a.bindTaskDetails(e);try{a.cdr.detectChanges()}catch{}}catch(i){l.H.helperLog(`Error processing task details in background: ${i?.message||i}`)}finally{a.isProcessingTaskDetails=!1}})()}loadClassificationMasterDataCached(){var e=this;return(0,w.A)(function*(){const a=Date.now();if(e.classificationDataCache&&a-e.cacheTimestamp<e.CACHE_DURATION)return Promise.resolve();yield e.loadClassificationMasterData(),e.cacheTimestamp=a})()}alterArrayData(e,a,i){return e?.map(o=>{const n=o;return n.foremanID=o.foremanID||"",n.workstationID=o.workstationID||"",n.workstationList=a,n.userList=i,n.checked=!1,this.ensureTaskClassificationDefaults(n),this.refreshClassificationOptionLists(n),n})}ensureTaskClassificationDefaults(e){if(e){if(e.taskClassificationMainArea=Number(e.taskClassificationMainArea||e.categoryTypeId||l.H.zero),e.categoryTypeId=e.taskClassificationMainArea,e.taskClassificationSubCategory=Number(e.taskClassificationSubCategory||e.subCategoryTypeId||l.H.zero),e.subCategoryTypeId=e.taskClassificationSubCategory,e.taskClassificationComponent=Number(e.taskClassificationComponent||e.componentId||l.H.zero),e.componentId=e.taskClassificationComponent,e.taskClassificationPosition=Number(e.taskClassificationPosition||e.positionId||l.H.zero),e.positionId=e.taskClassificationPosition,e.taskClassificationAction=Number(e.taskClassificationAction||e.actionId||l.H.zero),e.actionId=Number(e.actionId||l.H.zero),e.taskClassificationReason=Number(e.taskClassificationReason||e.reasonId||l.H.zero),e.reasonId=Number(e.reasonId||l.H.zero),!e.taskClassificationAction&&e.actionId){const a=this.master.masterOrgData?.find(i=>i.lookupType===c.YMJ.ActionTypes);if(a&&a.details){const i=a.details.find(o=>Number(o.id)===e.actionId);i&&(e.taskClassificationAction=i[this.master.displayLang]||i.en||i.value||"")}}else e.taskClassificationAction=e.taskClassificationAction||"";if(!e.taskClassificationReason&&e.reasonId){const a=this.master.masterOrgData?.find(i=>i.lookupType===c.YMJ.ReasonTypes);if(a&&a.details){const i=a.details.find(o=>Number(o.id)===e.reasonId);i&&(e.taskClassificationReason=i[this.master.displayLang]||i.en||i.value||"")}}else e.taskClassificationReason=e.taskClassificationReason||"";e.taskClassificationComment=e.taskClassificationComment||e.classificationComment||"",e.classificationComment=e.taskClassificationComment}}hasRequiredClassificationLookups(){const e=this.master.masterOrgData;return!!e?.length&&[c.YMJ.CategoryTypes,c.YMJ.SubCategories,c.YMJ.ActionTypes,c.YMJ.ReasonTypes,c.YMJ.PositionTypes].every(i=>e.some(o=>o.lookupType===i))}loadClassificationMasterData(){var e=this;return this.classificationMasterDataPromise||(this.classificationMasterDataPromise=(0,w.A)(function*(){try{e.hasRequiredClassificationLookups()||(yield e.importService.getMasterOrgData()),(!e.master.masterData||0===e.master.masterData.length)&&(yield(0,ht._)(e.master.masterInfoLoadedSubAsObs.pipe((0,pt.p)(o=>!!o))));const a=e.master.masterOrgData?.find(o=>o.lookupType===c.YMJ.ActionTypes);a&&a.details&&(e.taskClassificationActionOptions=a.details.map(o=>({id:o.id,value:o[e.master.displayLang]||o.en||o.value||""})));const i=e.master.masterOrgData?.find(o=>o.lookupType===c.YMJ.ReasonTypes);i&&i.details&&(e.taskClassificationReasonOptions=i.details.map(o=>({id:o.id,value:o[e.master.displayLang]||o.en||o.value||""})))}catch(a){e.toastrService.error("Failed to load Action/Reason Master Data."),l.H.helperLog(`Error loading classification master data: ${a?.message||a}`),e.classificationMasterDataPromise=null}})()),this.classificationMasterDataPromise}refreshAllTaskClassifications(){const e=i=>{i&&(this.ensureTaskClassificationDefaults(i),this.refreshClassificationOptionLists(i))};Array.isArray(this.inspectionRowData)&&this.inspectionRowData.forEach(e),Array.isArray(this.maintenanceRowData)&&this.maintenanceRowData.forEach(e),Array.isArray(this.repairRowData)&&this.repairRowData.forEach(e),Array.isArray(this.rowDataTask)&&this.rowDataTask.forEach(e);try{this.cdr.detectChanges()}catch(i){this.toastrService.warning("detectChanges failed in refreshAllTaskClassifications",i)}const a=i=>{i&&(i.taskClassificationMainArea=Number(i.taskClassificationMainArea||l.H.zero),i.taskClassificationSubCategory=Number(i.taskClassificationSubCategory||l.H.zero),i.taskClassificationComponent=Number(i.taskClassificationComponent||l.H.zero))};Array.isArray(this.inspectionRowData)&&this.inspectionRowData.forEach(a),Array.isArray(this.maintenanceRowData)&&this.maintenanceRowData.forEach(a),Array.isArray(this.repairRowData)&&this.repairRowData.forEach(a),Array.isArray(this.rowDataTask)&&this.rowDataTask.forEach(a);try{this.cdr.detectChanges()}catch{}}
1getMainAreaOptions(){try{const e=this.master.masterOrgData?.find(a=>a.lookupType===c.YMJ.CategoryTypes);if(e&&e.details)return e.details.filter(a=>!0!==a.isActive).map(a=>({id:a.id,value:a[this.master.displayLang]||a.en||""}))}catch(e){l.H.helperLog(`Error fetching Main Area Options: ${e?.message||e}`)}return[]}getSubCategoryOptions(e){if(!e)return[];try{const a=this.master.masterOrgData?.find(i=>"SubCategories"===i.lookupType);if(a&&a.details){const i=a.details.find(o=>Number(o.categoryTypeId)===Number(e));if(i&&i.subCategories)return i.subCategories.filter(o=>!0===o.canDelete||!0!==o.isActive).map(o=>({id:o.id,value:o[this.master.displayLang]||o.en||""}))}}catch(a){l.H.helperLog(`Error fetching Sub Category Options: ${a?.message||a}`)}return[]}getComponentOptions(e,a){if(!e||!a)return[];try{const i=this.master.masterOrgData?.find(o=>"SubCategories"===o.lookupType);if(i&&i.details){const o=i.details.find(n=>Number(n.categoryTypeId)===Number(e));if(o&&o.subCategories){const n=o.subCategories.find(d=>Number(d.id)===Number(a));if(n&&n.components)return n.components.filter(d=>!0!==d.isActive).map(d=>({id:d.id,value:d[this.master.displayLang]||d.en||""}))}}}catch(i){l.H.helperLog(`Error fetching Component Options: ${i?.message||i}`)}return[]}getPositionOptions(e,a,i){try{const o=this.master.masterOrgData?.find(n=>n.lookupType===c.YMJ.PositionTypes);if(o&&o.details)return o.details.map(n=>({id:n.id,value:n[this.master.displayLang]||n.en||""}))}catch(o){this.toastrService.error("Error fetching Position Options:",o)}return[]}refreshClassificationOptionLists(e){e.taskClassificationMainAreaOptions=this.getMainAreaOptions(),e.taskClassificationSubCategoryOptions=this.getSubCategoryOptions(e.taskClassificationMainArea),e.taskClassificationComponentOptions=this.getComponentOptions(e.taskClassificationMainArea,e.taskClassificationSubCategory),e.taskClassificationPositionOptions=this.getPositionOptions(e.taskClassificationMainArea,e.taskClassificationSubCategory,e.taskClassificationComponent)}mapClassificationTaskToRow(e,a){if(e&&a){if(a.defectID){const i=this.jobDefectList?.find(o=>o.id===a.defectID);i&&(a.defectID=a.defectID||i.id,a.actionId=a.actionId||i.actionId,a.reasonId=a.reasonId||i.reasonId,a.categoryTypeId=a.categoryTypeId||i.categoryTypeId,a.subCategoryTypeId=a.subCategoryTypeId||i.subCategoryTypeId,a.componentId=a.componentId||i.componentId,a.positionId=a.positionId||i.positionId,a.classificationComment=a.classificationComment||i.classificationComment)}this.ensureTaskClassificationDefaults(a),e.categoryTypeId=a.categoryTypeId,e.subCategoryTypeId=a.subCategoryTypeId,e.componentId=a.componentId,e.positionId=a.positionId,e.actionId=a.actionId,e.reasonId=a.reasonId,e.classificationComment=a.classificationComment,this.refreshClassificationOptionLists(e),e.taskClassificationMainArea=a.taskClassificationMainArea,e.taskClassificationSubCategory=a.taskClassificationSubCategory,e.taskClassificationComponent=a.taskClassificationComponent,e.taskClassificationPosition=a.taskClassificationPosition,e.taskClassificationAction=a.taskClassificationAction,e.taskClassificationReason=a.taskClassificationReason,e.taskClassificationComment=a.taskClassificationComment}}getTaskRowRef(e){const a=e?.taskID||e?.id;return this.rowDataTask.find(o=>o.id===a)||this.rowDataTask.find(o=>o.serviceID===e?.id||e?.defectID&&o.defectID===e.defectID)}getTotalCost(e){const a=this.defectCost.find(i=>i.defectId===e.defectID);return a&&a.totalCost||0}getTotalRechargeCost(e){const a=this.defectCost.find(i=>i.defectId===e.defectID);return a&&a.totalRechargeCost||0}getPayableRechargeCost(e){const a=this.defectCost?.find(i=>i.defectId===e.defectID);return a&&a.payableRechargeCost||0}persistClassificationFromRow(e){const a=this.getTaskRowRef(e);a&&(this.ensureTaskClassificationDefaults(e),this.copyClassificationToTask(a,e),a.updatedBy=this.master.userInfo?.id||"",a.updatedDate=l.H.moment(new Date).utc().format())}isEditingClassificationInDefectModal(e){return!!(this.showDefectRepairDetails&&this.selectedTaskSvc&&e)&&(e.taskID&&e.taskID===this.selectedTaskSvc.taskID||e.id&&e.id===this.selectedTaskSvc.id||e.defectID&&e.defectID===this.selectedTaskSvc.defectID)}markClassificationUpdated(e){this.showDefectRepairDetails||this.isEditingClassificationInDefectModal(e)?this.hasPendingDefectClassificationChanges=!0:this.dataModified()}copyClassificationToTask(e,a){!e||!a||(e.taskClassificationMainArea=Number(a.taskClassificationMainArea||a.categoryTypeId||l.H.zero),e.categoryTypeId=e.taskClassificationMainArea,e.taskClassificationSubCategory=Number(a.taskClassificationSubCategory||a.subCategoryTypeId||l.H.zero),e.subCategoryTypeId=e.taskClassificationSubCategory,e.taskClassificationComponent=Number(a.taskClassificationComponent||a.componentId||l.H.zero),e.componentId=e.taskClassificationComponent,e.taskClassificationPosition=Number(a.taskClassificationPosition||a.positionId||l.H.zero),e.positionId=e.taskClassificationPosition,e.actionId=Number(a.actionId||l.H.zero),e.reasonId=Number(a.reasonId||l.H.zero),e.taskClassificationAction=Number(a.taskClassificationAction||l.H.zero),e.taskClassificationReason=Number(a.taskClassificationReason||l.H.zero),e.taskClassificationComment=a.taskClassificationComment||a.classificationComment||"",e.classificationComment=e.taskClassificationComment)}saveDefectClassificationTaskChanges(){if(!this.jobId||!this.selectedTaskSvc?.taskID||!this.hasPendingDefectClassificationChanges)return;const e=this.rowDataTask.find(a=>a.id===this.selectedTaskSvc.taskID);e&&(this.copyClassificationToTask(e,this.selectedTaskSvc),e.updatedBy=this.master.userInfo?.id||"",e.updatedDate=l.H.moment(new Date).utc().format(),this.subs.add=this.taskService.updateTask(e).subscribe({next:()=>{this.hasPendingDefectClassificationChanges=!1},error:()=>{this.toastrService.warning("Failed to save defect classification changes")}
1}))}onTaskClassificationMainAreaChange(e,a){if(this.showDefectRepairDetails)return this.persistClassificationFromRow(a),void this.markClassificationUpdated(a);a.taskClassificationMainArea=Number(e||l.H.zero),a.taskClassificationSubCategory=0,a.taskClassificationComponent=0,a.taskClassificationPosition=0,a.taskClassificationAction=0,a.taskClassificationReason=0,a.taskClassificationComment="",this.refreshClassificationOptionLists(a),this.persistClassificationFromRow(a),this.markClassificationUpdated(a)}onTaskClassificationSubCategoryChange(e,a){if(this.showDefectRepairDetails)return this.persistClassificationFromRow(a),void this.markClassificationUpdated(a);a.taskClassificationSubCategory=Number(e||l.H.zero),a.taskClassificationComponent=0,a.taskClassificationPosition=0,a.taskClassificationAction=0,a.taskClassificationReason=0,a.taskClassificationComment="",this.refreshClassificationOptionLists(a),this.persistClassificationFromRow(a),this.markClassificationUpdated(a)}onTaskClassificationComponentChange(e,a){if(this.showDefectRepairDetails)return this.persistClassificationFromRow(a),void this.markClassificationUpdated(a);a.taskClassificationComponent=Number(e||l.H.zero),a.taskClassificationPosition=0,a.taskClassificationAction=0,a.taskClassificationReason=0,a.taskClassificationComment="",this.refreshClassificationOptionLists(a),this.persistClassificationFromRow(a),this.markClassificationUpdated(a)}onTaskClassificationPositionChange(e,a){if(this.showDefectRepairDetails)return this.persistClassificationFromRow(a),void this.markClassificationUpdated(a);a.taskClassificationPosition=Number(e||l.H.zero),a.taskClassificationAction=Number(e||l.H.zero),a.taskClassificationReason=Number(e||l.H.zero),a.taskClassificationComment="",this.persistClassificationFromRow(a),this.markClassificationUpdated(a)}onTaskClassificationActionChange(e,a){if(this.showDefectRepairDetails)return this.persistClassificationFromRow(a),void this.markClassificationUpdated(a);a.actionId=e||l.H.zero,a.taskClassificationAction=0,a.taskClassificationReason=0,a.taskClassificationComment="",this.persistClassificationFromRow(a),this.markClassificationUpdated(a)}onTaskClassificationReasonChange(e,a){if(this.showDefectRepairDetails)return this.persistClassificationFromRow(a),void this.markClassificationUpdated(a);a.reasonId=e||l.H.zero,a.taskClassificationComment="",this.persistClassificationFromRow(a),this.markClassificationUpdated(a)}onTaskClassificationCommentChange(e){this.persistClassificationFromRow(e),this.markClassificationUpdated(e)}openCostDialog(e){e.taskCosts||(e.taskCosts=[]),this.selectedTaskForCost=e,this.defectId=this.getTaskDefectId(e),this.externalWorkshopCostOptions=this.master.costOrgOptions||[],this.taskCostSupplierFilterCtrl.setValue(""),this.filteredTaskCostSuppliers.next(this.externalWorkshopCostOptions.slice());const a=this.externalWorkshopCostOptions.find(i=>i.id===this.objJobData.workshopID)?.id||this.externalWorkshopCostOptions[0]?.id||"";this.taskCostForm={supplierId:a,costEventId:0,costAmount:0,assetOperatorOrgID:this.objAssetData?.operatorOrgID||"",assetOperatorName:this.getAssetOperatorNameForCost(),notes:"",rechargeToOperator:!1},this.resetParsedCostDocument(),this.showModal(this.taskCostModalName)}canShowRechargeToOperatorCheckbox(){return!!this.getTaskDefectId(this.selectedTaskForCost)}getTaskDefectId(e){return e?String(e.defectID||e.defectId||"").trim():""}listenForTaskCostSupplierFilterChanges(){this.taskCostSupplierFilterCtrl.valueChanges.pipe((0,Z.Q)(this._onDestroy)).subscribe(()=>{this.filterTaskCostSuppliers()})}filterTaskCostSuppliers(){if(!this.externalWorkshopCostOptions?.length)return;let e=this.taskCostSupplierFilterCtrl.value;e?(e=e.toLowerCase(),this.filteredTaskCostSuppliers.next(this.externalWorkshopCostOptions.filter(a=>(a.value||a.name||"").toLowerCase().indexOf(e)>-1))):this.filteredTaskCostSuppliers.next(this.externalWorkshopCostOptions.slice())}saveTaskCostFromModal(){if(!this.selectedTaskForCost)return;const e=this.canShowRechargeToOperatorCheckbox();if(e||(this.taskCostForm.rechargeToOperator=!1),!this.taskCostForm.supplierId)return void this.toastrService.warning("Please select Supplier");if(!this.taskCostForm.costEventId)return void this.toastrService.warning("Please select Cost Event");
1if(!this.taskCostForm.costAmount||Number(this.taskCostForm.costAmount)<0)return void this.toastrService.warning("Please enter a valid Cost Amount");const a=Number(this.taskCostForm.costAmount||l.H.zero);if(isNaN(a)||a<0)return void this.toastrService.warning("Please enter a valid Cost Amount");const i=this.externalWorkshopCostOptions.find(p=>p.id===this.taskCostForm.supplierId),o=this.master.costEvent?.find(p=>p.id===this.taskCostForm.costEventId),n=o?.[this.master.displayLang]||o?.value||"",d={id:this.master.newGuid(),taskId:this.selectedTaskForCost?.id||"",jobId:this.objJobData?.id||this.jobId||"",description:n,amount:a,supplierId:this.taskCostForm.supplierId,supplierName:i?.value||i?.name||"",costEventId:this.taskCostForm.costEventId,costEventName:n,assetOperatorOrgID:this.taskCostForm.assetOperatorOrgID,assetOperatorName:this.taskCostForm.assetOperatorName,notes:this.taskCostForm.notes||"",rechargeToOperator:e&&!!this.taskCostForm.rechargeToOperator,createdDate:l.H.moment(new Date).utc().format(),createdBy:this.master.userInfo?.id||"",updatedDate:l.H.moment(new Date).utc().format(),updatedBy:this.master.userInfo?.id||""};this.selectedTaskForCost.taskCosts.push(d),this.saveDefectCost(d,l.H.id1)}mapToAssetManualCost(e,a=l.H.zero){const i=this.externalWorkshopCostOptions.find(f=>f.id===this.taskCostForm.supplierId),o=this.master.costEvent?.find(f=>f.id===this.taskCostForm.costEventId),n=o?.[this.master.displayLang]||o?.value||"",d=`${this.objJobData?.jobNumber||""}-${n}`,p=this.canShowRechargeToOperatorCheckbox(),m=this.getTaskDefectId(this.selectedTaskForCost);return{assetID_PK:this.assetId,defectID:m,id:e.id,taskID:this.selectedTaskForCost?.id||"",jobID:this.objJobData?.id||"",event:this.taskCostForm.costEventId,cost:this.getTaskCostPreviewTotal(),vat:a||l.H.zero,supplier:i?.value||i?.name||"",supplierId:this.taskCostForm.supplierId,reference:d,assetOperator:this.taskCostForm.assetOperatorOrgID,description:this.taskCostForm.notes||"",isCostRecharged:p&&!!this.taskCostForm.rechargeToOperator,createdDate:l.H.moment(new Date).utc().format(),createdBy:this.master.userInfo?.id||"",updatedDate:l.H.moment(new Date).utc().format(),updatedBy:this.master.userInfo?.id||"",currency:this.master.defaultCurrencySymbol,type:"AssetManualCost",eventDate:l.H.moment(new Date).utc().format(),documents:this.uploadedFiles,isDelete:!1,customer:"",revenue:0,nominalCodeId:"",costCentreId:"",departmentId:"",poNumber:"",poDate:"",poLineDescription:""}}saveDefectCost(e,a=l.H.zero){const i=this.getTaskDefectId(this.selectedTaskForCost),o=this.mapToAssetManualCost(e,a);this.sub.add=this.assetService.saveAssetManualCost(o).subscribe({next:n=>{this.uploadedFiles=[],this.isBookingDataUpdated=!1,this.closeTaskCostModal(),this.toastrService.success("Cost added successfully"),n&&i?this.getDefectCostDetails(i):this.loadJobCostChargesGridData()},error:()=>{this.toastrService.error("Failed to save Cost details.")}})}getDefectCostDetails(e){this.refreshDefectCostSummary([e])}closeTaskCostModal(){this.closeModal(this.taskCostModalName),this.selectedTaskForCost=null,this.defectId="",this.uploadedFiles=[],this.resetParsedCostDocument()}uploadFile(e){const{target:a}=e,i=a.files;i&&i[0]&&this.processFile(i[0])}dropped(e){for(const a of e)a.fileEntry.isFile&&a.fileEntry.file(o=>this.processFile(o))}processFile(e){if(!this.master.validateFileFormat(e.name,e.type,this.master.datalist.DOCUMENT))return;this.lastCostDocumentFile=e,this.progress=0;const a=e,i=new FormData;i.append("parentOrgId",this.master.parentOrgId),i.append("containerName","AssetCost"),i.append("file",a,a.name),this.http.post(c.Sgn.UploadAsStream,i,{reportProgress:!0,observe:"events"}).subscribe(o=>{o.type===M.hv.UploadProgress?this.progress=Math.round(l.H.hundred*o.loaded/o.total):o.type===M.hv.Response&&(this.uploadedFiles.push({id:this.master.newGuid(),defectdocAT:o.body.url,format:a.type,filename:a.name,isDelete:!1}),this.progress=0),this.fileDropEl.nativeElement.value=""})}showFile(e){window.open(e)}deleteFile(e,a){this.uploadedFiles[a].isDelete||(this.uploadedFiles[a].isDelete=!0,this.modalService.close(e))}confirmModel(e,a){this.warningMsg="Are you sure",this.deleteId=a,this.modalService.open(e)}getAssetOperatorNameForCost(){const e=this.objAssetData?.operatorOrgID;return e&&this.master.masterOrgList.find(a=>a.id===e)?.companyName||""}getTaskCostPreviewTotal(){const e=Number(this.taskCostForm?.costAmount||l.H.zero);return isNaN(e)?l.H.zero:e}resetParsedCostDocument(){this.lastCostDocumentFile=null,this.parsedInvoice=null,this.isParsingCostDocument=!1}canExtractCostsFromDocument(){return!!this.lastCostDocumentFile&&!this.isParsingCostDocument}get parsedInvoiceLines(){return this.parsedInvoice?.lineItems||[]}extractCostsFromDocument(){this.lastCostDocumentFile?(this.isParsingCostDocument=!0,this.parsedInvoice=null,this.sub.add=this.assetService.parseInvoiceDocument(this.lastCostDocumentFile).subscribe({next:e=>{this.isParsingCostDocument=!1,e?.isSuccess?(this.parsedInvoice=e,this.applyParsedSupplier(e.supplierName),e.lineItems?.length||this.toastrService.info("No line items were found. You can still use the invoice total.")):this.toastrService.warning(e?.errorMessage||"No cost details could be read from this document")},error:()=>{this.isParsingCostDocument=!1,this.toastrService.error("Failed to parse the document")}})):this.toastrService.warning("Please attach a document first")}
1applyParsedSupplier(e){const a=(e||"").trim().toLowerCase();if(!a)return;const i=this.externalWorkshopCostOptions.find(o=>{const n=(o.value||o.name||"").trim().toLowerCase();return!!n&&(n===a||n.includes(a)||a.includes(n))});i&&(this.taskCostForm.supplierId=i.id)}applyParsedLineToCost(e){const a=Number(e?.amount??e?.unitPrice??0);a&&!isNaN(a)?(this.taskCostForm.costAmount=a,this.taskCostForm.notes=this.buildParsedCostNote(e?.description||e?.productCode||"")):this.toastrService.warning("This line has no usable amount")}applyParsedTotalToCost(){const e=Number(this.parsedInvoice?.invoiceTotal??0);e&&!isNaN(e)?(this.taskCostForm.costAmount=e,this.taskCostForm.notes=this.buildParsedCostNote("Invoice total")):this.toastrService.warning("This document has no usable invoice total")}buildParsedCostNote(e){return[e,this.parsedInvoice?.invoiceNumber?`Invoice ${this.parsedInvoice.invoiceNumber}`:""].filter(i=>!!i).join(" - ")}hasRechargeCosts(e){return!!e?.taskCosts?.some(a=>!!a.rechargeToOperator)}getCostEventNames(e,a){return e?.taskCosts&&a?.length?a.map(i=>e.taskCosts.find(o=>o.id===i)?.costEventName||"").filter(i=>""!==i):[]}setRechargeModalTaskByIndex(e){if(!this.rechargeModalTasks?.length)return void(this.selectedTaskForRecharge=null);const a=Math.max(0,Math.min(e,this.rechargeModalTasks.length-1));this.rechargeModalTaskIndex=a,this.selectedTaskForRecharge=this.rechargeModalTasks[a],this.selectedTaskForRecharge.taskClassificationActionOptions=this.taskClassificationActionOptions,this.selectedTaskForRecharge.taskClassificationReasonOptions=this.taskClassificationReasonOptions,this.selectedTaskForRecharge.customerMarginPercentage=Number(this.selectedTaskForRecharge.customerMarginPercentage||l.H.zero);const o=this.defectCost.find(d=>d.defectId===this.selectedTaskForRecharge.defectID)?.costIds||this.selectedTaskForRecharge.costIds||[],n=this.getCostEventNames(this.selectedTaskForRecharge,o);this.rechargeModalData={...this.rechargeModalData,costIds:o,costEventNames:n},this.pricingCache=null}openDefectRechargeModal(e){if(!e)return void this.toastrService.warning("No recharge costs found for this defect");this.rechargeSupplierName=this.master.getCompanyName(this.objJobData.workshopID)||"",this.rechargeModalTasks=this.isBulkRechargeMode&&this.bulkRechargeTasks?.length?this.bulkRechargeTasks:[e];const a=this.rechargeModalTasks.findIndex(d=>d.id===e.id);this.rechargeModalTaskIndex=a>=0?a:0;const o=this.defectCost.find(d=>d.defectId===e.defectID)?.costIds||e.costIds||[],n=this.getCostEventNames(e,o);this.rechargeModalData={rechargePercent:Number(e.rechargePercent??this.defaultRechargePercent),applyCustomerMargin:!!e.applyCustomerMargin,publishToPortal:!!e.publishToPortal,customerMarginPercentage:e.customerMarginPercentage||l.H.zero,vatType:l.H.id1,costIds:o,costEventNames:n},this.setRechargeModalTaskByIndex(this.rechargeModalTaskIndex),this.rechargeModalData.applyCustomerMargin&&this.fetchAndApplyCustomerMargin(),this.showModal(this.defectRechargeModalName)}closeDefectRechargeModal(){this.rechargeModalData.applyCustomerMargin=!1,this.rechargeModalData.publishToPortal=!1,this.isBulkRechargeMode=!1,this.bulkRechargeTasks=[],this.rechargeModalTasks?.length&&this.rechargeModalTasks.forEach(e=>{e.customerMarginPercentage=0}),this.rechargeModalTasks=[],this.rechargeModalTaskIndex=0,this.selectedTaskForRecharge&&(this.selectedTaskForRecharge.customerMarginPercentage=0),this.customerMarginPercentage=0,this.closeModal(this.defectRechargeModalName),this.selectedTaskForRecharge=null}onApplyCustomerMarginChange(){this.pricingCache=null,this.rechargeModalData.applyCustomerMargin?this.fetchAndApplyCustomerMargin():(this.rechargeModalTasks?.length&&this.rechargeModalTasks.forEach(e=>e.customerMarginPercentage=0),this.selectedTaskForRecharge&&(this.selectedTaskForRecharge.customerMarginPercentage=0))}fetchAndApplyCustomerMargin(){const e=this.objAssetData?.operatorOrgID,a=i=>{this.selectedTaskForRecharge&&(this.selectedTaskForRecharge.customerMarginPercentage=i),this.rechargeModalTasks?.length&&this.rechargeModalTasks.forEach(o=>o.customerMarginPercentage=i)};if(!e)return this.toastrService.warning("Organization ID not available"),void a(this.defaultRechargePercent);this.subs.add=this.customerBillingService.getCustomerContract(e).subscribe({next:i=>{if(i&&Array.isArray(i)&&i.length>0){const o=i[0]?.customerMargin;this.isValidCustomerMargin(o)?a(o):a(this.defaultRechargePercent)}else a(this.defaultRechargePercent)},error:()=>{this.toastrService.warning("Failed to load customer contract data"),a(this.defaultRechargePercent)}})}isValidCustomerMargin(e){if(null==e||""===e)return!1;const a=Number(e);return!isNaN(a)&&a!==l.H.zero}
1saveDefectRechargeDetails(){if(!this.selectedTaskForRecharge||!this.validateRechargeDetails())return;const e=this.getEffectiveRechargePercent();if(this.selectedTaskForRecharge.rechargePercent=e,this.selectedTaskForRecharge.applyCustomerMargin=!!this.rechargeModalData.applyCustomerMargin,this.selectedTaskForRecharge.publishToPortal=!!this.rechargeModalData.publishToPortal,this.selectedTaskForRecharge.customerMarginPercentage=this.getCustomerMarginPercentage(),this.selectedTaskForRecharge.costIds=this.rechargeModalData.costIds||[],this.selectedTaskForRecharge.costEventNames=this.rechargeModalData.costEventNames||[],this.isBulkRechargeMode)return this.rechargeSaveBtn=!0,void this.saveBulkRechargeDetails();this.persistRechargeToAssetCostTab()}saveBulkRechargeDetails(){var e=this;return(0,w.A)(function*(){const a=e.bulkRechargeTasks?.length?e.bulkRechargeTasks:e.getRechargeEligibleTasks();if(!a.length)return e.toastrService.warning("No eligible defects found for recharge"),void(e.rechargeSaveBtn=!1);const i=[];for(const o of a){const d=e.defectCost.find(f=>f.defectId===o.defectID)?.costIds||o.costIds||[],p=e.getCostEventNames(o,d),m=Number(o?.customerMarginPercentage||e.getCustomerMarginPercentage()||l.H.zero);o.rechargePercent=e.getEffectiveRechargePercent(),o.applyCustomerMargin=!!e.rechargeModalData.applyCustomerMargin,o.publishToPortal=!!e.rechargeModalData.publishToPortal,o.customerMarginPercentage=m,o.costIds=d,o.costEventNames=p;const g=e.buildRechargeCostRequest(o,d,p);g&&i.push(g)}if(!i.length)return e.toastrService.warning("No valid defect recharge details to save"),void(e.rechargeSaveBtn=!1);try{yield(0,ht._)(e.taskService.saveBulkRechargeCost(i)),i.forEac
1h(o=>{o?.defectId&&e.getDefectCostDetails(o.defectId)}),e.refreshRechargeAndCostViews(),e.isBookingDataUpdated=!1,e.rechargeSaveBtn=!1,e.closeDefectRechargeModal(),e.toastrService.success(`Recharge details saved for ${i.length} defect(s)`)}catch{e.toastrService.error("Failed to save bulk recharge details")}})()}validateRechargeDetails(e=!1){const a=Number(this.rechargeModalData.rechargePercent??0);return isNaN(a)||a<0?(this.toastrService.warning("Please enter a valid % to recharge"),!1):!this.rechargeModalData.applyCustomerMargin&&a>this.maxRechargePercent?(this.toastrService.warning("Recharge % cannot be greater than 100 without customer margin"),!1):!(e&&!this.rechargeModalData.publishToPortal&&(this.toastrService.warning("Select Publish to Portal before generating output"),1))}getEffectiveRechargePercent(){return Number(this.rechargeModalData.rechargePercent||l.H.zero)}getRechargeCostAmount(){const e=this.selectedTaskForRecharge;if(e){const a=this.defectCost.find(i=>i.defectId===e.defectID);return a&&a.payableRechargeCost||0}return 0}getCustomerMarginPercentage(){const e=this.selectedTaskForRecharge;return e?Number(e.customerMarginPercentage||l.H.zero):0}calculatePricing(){const e=Date.now();if(this.pricingCache&&e-this.pricingCacheTime<this.PRICING_CACHE_DURATION_MS)return this.pricingCache;const a=this.getRechargeCostAmount(),i=this.getEffectiveRechargePercent(),o=a*i/100,n=this.calculateCustomerMarginAmount(o),d=o+n,p=this.rechargeModalData?.vatType||l.H.id1,m=this.master.getTaxPercent(p),g=d*m/l.H.id100,f=d+g;return this.pricingCache={costAmount:a,marginPercent:i,previewAmount:o,customerMarginPercent:this.getCustomerMarginPercentage(),customerMarginAmount:n,vatTypeId:p,vatBaseAmount:d,vatPercentage:m,vatAmount:g,finalAmount:f},this.pricingCacheTime=e,this.pricingCache}calculateCustomerMarginAmount(e){return this.hasValidCustomerMargin()?e*this.getCustomerMarginPercentage()/100:0}isCustomerMarginApplied(){return!!this.rechargeModalData.applyCustomerMargin}hasValidCustomerMargin(){return this.isCustomerMarginApplied()||this.getCustomerMarginPercentage()>l.H.zero}getRechargePreviewAmount(){return this.calculatePricing().previewAmount}getCustomerMarginAmount(){return this.calculatePricing().customerMarginAmount}getActionDisplayValue(e){return e?this.getClassificationDisplayValue(this.taskClassificationActionOptions,e.taskClassificationAction):""}getReasonDisplayValue(e){return e?this.getClassificationDisplayValue(this.taskClassificationReasonOptions,e.taskClassificationReason):""}hasTaskClassificationData(e){if(!e)return!1;const a=!!(e.taskClassificationMainArea||e.taskClassificationSubCategory||e.taskClassificationComponent||e.taskClassificationPosition||e.taskClassificationAction||e.taskClassificationReason),i=!(!e.taskClassificationComment||!String(e.taskClassificationComment).trim());return a||i}getRechargeAmountPreview(){return this.selectedTaskForRecharge?this.calculatePricing().finalAmount:0}getSelectedRechargeDefect(){const e=this.selectedTaskForRecharge?.defectID;return e&&this.jobDefectList.find(a=>a.id===e)||null}getRechargeCustomerName(){const e=this.objAssetData?.operatorOrgID;return e&&this.master.masterOrgList.find(a=>a.id===e)?.companyName||""}getRechargeCustomerDetails(){const e=this.objAssetData?.operatorOrgID,a=this.master.masterOrgList.find(o=>o.id===e);return a?[a.address1,a.address2,a.town,a.county,a.postCode,a.phone,a.email].filter(o=>!!o).join(", "):""}getRechargeDefectRaisedOn(){const e=this.getSelectedRechargeDefect(),a=e?.defectFoundDate||e?.createdDate;return a?new Date(a):new Date}getRechargeDefectCategory(){const e=this.getSelectedRechargeDefect();return e?.defectsCategory&&this.master.DefectCategory.find(a=>a.id===e.defectsCategory)?.[this.master.displayLang]||""}getRechargeDefectImage(){const e=this.getSelectedRechargeDefect();return e?.defectDocs?.length&&(e.defectDocs.find(a=>!a.isDelete)?.defectdocAT||e.defectDocs[0]?.defectdocAT)||""}persistRechargeToAssetCostTab(){const e=this.selectedTaskForRecharge;if(!e)return;const a=this.buildRechargeCostRequest(e,this.rechargeModalData.costIds||[],this.rechargeModalData.costEventNames||[]);a&&(this.subs.add=this.taskService.AddRecharegeCost(a).subscribe({next:i=>{this.getDefectCostDetails(a.defectId),this.refreshRechargeAndCostViews(),this.isBookingDataUpdated=!1,this.closeDefectRechargeModal(),this.toastrService.success("Recharge details saved")},error:()=>{this.toastrService.warning("Recharge saved locally, but failed to sync Asset Cost tab")}}))}
1buildRechargeCostRequest(e,a,i){if(!e?.defectID||!this.objAssetData?.assetID_PK)return null;const o=this.jobDefectList.find(j=>j.id===e.defectID)||null,n=new C.UM;n.assetId=this.objAssetData.assetID_PK,n.defectId=e.defectID,n.jobId=this.jobId||"",n.taskId=e.id||"",n.reference=this.objJobData?.jobNumber||this.jobId||"",n.organisationId=this.master.parentOrgId||"",n.supplier=this.rechargeSupplierName,n.supplierId=this.objJobData.workshopID||"",n.customer=this.getRechargeCustomerName(),n.charges=this.getPayableRechargeCost(e),n.rechargePercentage=Number(e.rechargePercent||this.getEffectiveRechargePercent()),n.customerMarginPercentage=Number(e.customerMarginPercentage||l.H.zero),n.userId=this.master.userInfo?.id||"",n.vrm=this.objAssetData?.vrm||"",n.fleetNumber=this.objAssetData?.fleetNumber||"",n.customerDetails=this.getRechargeCustomerDetails(),n.rechargedDate=l.H.moment(new Date).utc().format(),n.defectRaisedDate=o?.defectFoundDate||o?.createdDate||new Date,n.defectCategoryId=o?.defectsCategory||l.H.zero,n.defectCategory=this.master.DefectCategory.find(j=>j.id===o?.defectsCategory)?.[this.master.displayLang]||"",n.categoryType=e.taskClassificationMainArea||l.H.zero,n.subCategoryType=e.taskClassificationSubCategory||l.H.zero,n.component=e.taskClassificationComponent||l.H.zero,n.position=e.taskClassificationPosition||l.H.zero,n.action=e.taskClassificationAction||l.H.zero,n.reason=e.taskClassificationReason||l.H.zero,n.classificationComment=e.taskClassificationComment||"",n.isPublishToPortal=!!e.publishToPortal,n.isCustomerMargin=!!e.applyCustomerMargin||n.customerMarginPercentage>0,n.customerId=this.objAssetData?.operatorOrgID||"",n.categoryTypeName=e.taskClassificationMainAreaOptions?.find(j=>j.id===e.taskClassificationMainArea)?.value||"",n.subCategoryTypeName=e.taskClassificationSubCategoryOptions?.find(j=>j.id===e.taskClassificationSubCategory)?.value||"",n.actionName=e.taskClassificationActionOptions?.find(j=>j.id===e.taskClassificationAction)?.value||"",n.reasonName=e.taskClassificationReasonOptions?.find(j=>j.id===e.taskClassificationReason)?.value||"",n.positionName=e.taskClassificationPositionOptions?.find(j=>j.id===e.taskClassificationPosition)?.value||"",n.componentName=e.taskClassificationComponentOptions?.find(j=>j.id===e.taskClassificationComponent)?.value||"",n.costIds=a||[],n.costEventNames=i||[];const p=Number(n.charges||0)*n.rechargePercentage/100,g=p+(n.isCustomerMargin?p*Number(n.customerMarginPercentage||0)/100:0),f=this.rechargeModalData?.vatType||l.H.id1,R=this.master.getTaxPercent(f),B=g*R/l.H.id100;return n.vatTypeId=f,n.vatBaseAmount=g,n.vatPercentage=R,n.vatAmount=B,n.totalAmount=g+B,n.payableRechargeCost=n.totalAmount,n}getTaskClassificationCategoryName(e){return this.selectedTaskForRecharge.taskClassificationMainAreaOptions.find(a=>a.id===e)?.value||""}getTaskClassificationSubCategoryName(e){return this.selectedTaskForRecharge.taskClassificationSubCategoryOptions.find(a=>a.id===e)?.value||""}getTaskClassificationComponentName(e){return this.selectedTaskForRecharge.taskClassificationComponentOptions.find(a=>a.id===e)?.value||""}getTaskClassificationActionName(e){return this.selectedTaskForRecharge.taskClassificationActionOptions.find(a=>a.id===e)?.value||""}getTaskClassificationPositionName(e){return this.selectedTaskForRecharge.taskClassificationPositionOptions.find(a=>a.id===e)?.value||""}getTaskClassificationReasonName(e){return this.selectedTaskForRecharge.taskClassificationReasonOptions.find(a=>a.id===e)?.value||""}getRechargeAssetCostDocuments(){const e=this.getSelectedRechargeDefect();return e?.defectDocs?.length?e.defectDocs.filter(a=>!a.isDelete&&a.defectdocAT).map(a=>({id:a.id||this.master.newGuid(),defectdocAT:a.defectdocAT,format:a.format||"image/jpeg",filename:a.filename||"defect-recharge-document",isDelete:!1})):[]}persistRechargeDocumentsToAssetHistory(){const e=this.selectedTaskForRecharge,a=this.getSelectedRechargeDefect();if(!e||!a?.defectDocs?.length||!this.objAssetData?.id)return;const i=[...e.rechargeHistoryDocIds||[]],o=d=>d.id||d.filename||d.name||d.defectdocAT;a.defectDocs.filter(d=>{const p=o(d);return!(!d.defectdocAT||d.isDelete||!p||i.includes(p))}
1).forEach(d=>{const p=o(d),m={assetID_PK:this.objAssetData.id,type:"Document",documentAT:d.defectdocAT,ownerOrgID:this.objAssetData?.ownerOrgID,operatorOrgID:this.objAssetData?.operatorOrgID,depotOrgID:this.objAssetData?.depotOrgID,workshopOrgID:this.objAssetData?.primaryWorkshopOrgID,jobID:this.jobId||"",taskID:e.id||"",quoteID:"",taskType:0,tasksubType:0,docType:this.master.documentTypes?.[0]?.id||l.H.zero,description:"Defect recharge document",eventDate:l.H.getTodayDateWithoutTime(),name:d.filename||`DefectRecharge-${e.id||""}`,format:d.format||"image/jpeg",docEmailID:"",isDelete:!1,createdBy:this.master.userInfo?.id||"",createdDate:l.H.moment(Date.now()).utc().format(),updatedDate:l.H.moment(Date.now()).utc().format(),updatedBy:this.master.userInfo?.id||"",id:this.master.newGuid(),defectID:e.defectID||""};this.subs.add=this.assetService.uploadDocumentlist(m).subscribe({next:g=>{g.type===M.hv.Response&&("OK"===g.statusText||"Created"===g.statusText)&&(p&&!i.includes(p)&&i.push(p),e.rechargeHistoryDocIds=i,this.dataModified())},error:()=>{this.toastrService.warning("Failed to sync recharge document to Asset History tab")}})})}getClassificationDisplayValue(e,a){return e?.length&&a&&e.find(i=>i.id===a)?.value||""}getMainAreaDisplayValue(e){return e?this.getClassificationDisplayValue(this.getMainAreaOptions(),e.taskClassificationMainArea):""}getSubCategoryDisplayValue(e){return e?this.getClassificationDisplayValue(this.getSubCategoryOptions(e.taskClassificationMainArea),e.taskClassificationSubCategory):""}getComponentDisplayValue(e){return e?this.getClassificationDisplayValue(this.getComponentOptions(e.taskClassificationMainArea,e.taskClassificationSubCategory),e.taskClassificationComponent):""}getPositionDisplayValue(e){return e?this.getClassificationDisplayValue(this.getPositionOptions(e.taskClassificationMainArea,e.taskClassificationSubCategory,e.taskClassificationComponent),e.taskClassificationPosition):""}removeTaskCost(e,a){e.taskCosts&&e.taskCosts[a]&&(e.taskCosts.splice(a,1),this.dataModified(),this.toastrService.success("Cost removed successfully"))}getTaskTotalCost(e){return e.taskCosts&&0!==e.taskCosts.length?e.taskCosts.reduce((a,i)=>a+(i.totalAmount||l.H.zero),0):0}bindTaskDetails(e=!1){this.rowDataTask?.length&&(this.rowDataTask.forEach(a=>{let i=this.inspectionRowData?.findIndex(o=>o.id===a.serviceID);this.findInspectionData(i,a,e),i=this.maintenanceRowData?.findIndex(o=>o.id===a.serviceID),this.findMaintenanceData(i,a,e),i=this.repairRowData?.findIndex(o=>o.id===a.id),this.findRepairData(i,a,e)}),this.captureOriginalTaskHours()),this.jobId&&!this.isUpdatingJobTask&&(this.inspectionRowData=this.inspectionRowData?.filter(a=>a.checked),this.maintenanceRowData=this.maintenanceRowData?.filter(a=>a.checked),this.repairRowData=this.repairRowData?.filter(a=>a.checked)),this.refreshAllTaskClassifications(),this.cdr.detectChanges()}findInspectionData(e,a,i=!1){e>-1&&(this.isUpdatingJobTask&&!i?this.inspectionRowData.splice(e,1):(this.inspectionRowData[e].status=a.status,this.inspectionRowData[e].checked=!0,this.inspectionRowData[e].btnText=a.status===c.e1J.completed?this.master.datalist.ViewDetails:this.master.datalist.TaskGo,this.inspectionRowData[e].foremanID=a.foremanID||"",this.inspectionRowData[e].taskID=a.id||"",this.inspectionRowData[e].workstationID=a.workstationID||"",this.inspectionRowData[e].taskStatusColor=this.getTaskStatusColor(a.status)||"",this.inspectionRowData[e].isSelectEngineer=a.status<l.H.id3,this.inspectionRowData[e].checkSheet=a.checkSheet,this.getCheckSheetName(this.inspectionRowData[e].checkSheet),this.addTaskDuration(this.inspectionRowData[e],a),this.mapClassificationTaskToRow(this.inspectionRowData[e],a)))}getCheckSheetName(e){e?.forEach(a=>{const i=this.taskChecksheetList.find(o=>a.id===o.id);a.name=i?i.name:""})}preparePartsCount(e,a){let i=0,o=0,n=0;e&&e.length&&e.forEach(d=>{d.partStatus===l.H.id1?i++:d.partStatus===l.H.id2?o++:d.partStatus===l.H.id3&&n++}),a.partsRequiredCount=e.length||l.H.zero,a.partsNotPickedCount=i,a.partsOnOrderCount=o,a.partsReadyToCollectCount=n}addTaskDuration(e,a){a&&(e.taskDuration=l.H.convertSecToHrsMins(a.actualHours))}findMaintenanceData(e,a,i=!1){e>-1&&(this.isUpdatingJobTask&&!i?this.maintenanceRowData.splice(e,1):(this.maintenanceRowData[e].status=a.status,this.maintenanceRowData[e].checked=!0,this.maintenanceRowData[e].btnText=a.status===c.e1J.completed?this.master.datalist.ViewDetails:this.master.datalist.TaskGo,this.maintenanceRowData[e].foremanID=a.foremanID||"",this.maintenanceRowData[e].taskID=a.id||"",this.maintenanceRowData[e].workstationID=a.workstationID||"",this.maintenanceRowData[e].checkSheet=a.checkSheet,this.preparePartsCount(a.parts,this.maintenanceRowData[e]),this.getCheckSheetName(this.maintenanceRowData[e].checkSheet),this.addTaskDuration(this.maintenanceRowData[e],a),this.maintenanceRowData[e].taskStatusColor=this.getTaskStatusColor(a.status)||"",this.maintenanceRowData[e].isSelectEngineer=a.status<l.H.id3,this.mapClassificationTaskToRow(this.maintenanceRowData[e],a)))}findRepairData(e,a,i=!1){e>-1&&(this.isUpdatingJobTask&&!i?this.repairRowData.splice(e,1):(this.repairRowData[e].status=a.status,this.repairRowData[e].checked=!0,this.repairRowData[e].btnText=a.status===c.e1J.completed?this.master.datalist.ViewDetails:this.master.datalist.TaskGo,this.repairRowData[e].foremanID=a.foremanID||"",this.repairRowData[e].taskID=a.id||"",this.repairRowData[e].workstationID=a.workstationID||"",this.repairRowData[e].checkSheet=a.checkSheet,this.repairRowData[e].defectQstn=this.getDefectQstn(this.repairRowData[e]),this.preparePartsCount(a.parts,this.repairRowData[e]),this.getCheckSheetName(this.repairRowData[e].checkSheet),this.addTaskDuration(this.repairRowData[e],a),this.repairRowData[e].taskStatusColor=this.getTaskStatusColor(a.status)||"",this.repairRowData[e].isSelectEngineer=a.status<l.H.id3,this.mapClassificationTaskToRow(this.repairRowData[e],a)))}bindRepairTask(){const e=[],a=this.rowDataTask.filter(i=>"repairs"===i.serviceID);return a&&a.length>0?(this.openDefectList.forEach(i=>
1{const o=a.find(n=>n.defectID===i.id);if(o)this.isUpdatingJobTask?this.isUpdatingJobTask&&e.push(o):(o.defectRaisedBy=o.defectRaisedBy?o.defectRaisedBy:this.getDefectRaisedBy(i.createdBy),e.push(o));else{const n=this.getRepairTask(i);e.push(n)}}),a.forEach(i=>{!e.find(n=>n.id===i.id)&&!this.isUpdatingJobTask&&e.push(i)})):this.openDefectList.forEach(i=>{const o=this.getRepairTask(i);e.push(o)}),e}getDefectQstn(e){let a=l.H.stringEmpty;if(e.defectID){const i=this.jobDefectList.find(o=>o.id===e.defectID);if(i)switch(i.defectSource){case c.Z4y.Telematics:i.telematicsDetails&&(a=i.telematicsDetails.description);break;case c.Z4y.WalkAround:a=i.legacy_CHECKDESCRIPTION;break;default:a=i.legacy_CheckTitle}}return a}getDefectRaisedBy(e){const a=this.master.alluserList.find(i=>i.id===e);return a?.name||a?.loginName||""}getRepairTask(e){const a=new v.YZ;e.defectNotes.length&&e.defectNotes.sort((m,g)=>Date.parse(m.createdDate)-Date.parse(g.createdDate));const n=e.defectNotes[0]?.comment,p=this.master.getOrgInfo(this.objAssetData?.operatorOrgID||"");return a.id=this.master.newGuid(),a.name=n,a.defectRaisedBy=this.getDefectRaisedBy(e.createdBy),a.plannedHours=0,a.actualHours=0,a.labourRate=l.H.getEffectiveLabourRate(p?.labourRate,0),a.isMandatory=!1,a.defectID=e.id,a.parts=[],a.checkSheet=[],a.updatedDate=this.getNowUTC(),a.updatedBy=this.master.userInfo?.id||"",a.createdDate=this.getNowUTC(),a.createdBy=this.master.userInfo?.id||"",a.isNew=!0,a.assetID=this.assetId,a.usageBased=!1,a.jobID_PK=this.jobId,a.technicianSigned=!0,a.technicianSign="",a.taxRate=20,a.foremanID="",a.foremanSigned=!1,a.foremanSign="",a.serviceID="repairs",a.taskCompletedDate="",a.taskStartDate="",a.serviceType=l.H.id2,a.subType=1,a.type="Task",a.status=this.isExternal?l.H.id2:1,a.workstationID="",a.isComplianceTask=!1,a.taskClassificationMainArea=0,a.taskClassificationSubCategory=0,a.taskClassificationComponent=0,a.taskClassificationPosition=0,a.taskClassificationAction="",a.taskClassificationReason="",a.taskClassificationComment="",a}setUserList(e,a){const i=this.workStationList.find(o=>o.id===e);this.userService.orgUserList.forEach(o=>{i.skills.map(n=>{o.skills&&o.skills.includes(n)&&!a.userList.find(d=>d.id===o.id)&&a.userList.push({id:o.id,value:o.name})})})}onchangeWorkStation(e,a){if(e){a.workstationID=e;const i=this.rowDataTask.findIndex(o=>o.serviceID===a.id||o.defectID&&o.defectID===a.defectID);-1!==i&&(this.rowDataTask[i].workstationID=e)}else{a.workstationList=[],this.workStationList?.forEach(o=>{a.workstationList.push({id:o.id,value:o.name})}),a.workstationID="";const i=this.rowDataTask.findIndex(o=>o.serviceID===a.id||o.defectID&&o.defectID===a.defectID);-1!==i&&(this.rowDataTask[i].workstationID=e)}}onchangeEngineer(e,a){if(e){this.jobId&&(this.taskUpdated=!0),a.foremanID=e;const i=this.getTaskIndexForEngineerChange(a);if(-1!==i){const o=this.rowDataTask[i]?.id;o&&!this.pendingEngineerRevertByTaskId.has(o)&&this.pendingEngineerRevertByTaskId.set(o,this.rowDataTask[i].foremanID||""),this.rowDataTask[i].foremanID=e,this.rowDataTask[i].formanUpdated=!0}}else{this.jobId&&(this.taskUpdated=!0),a.userList=[],this.userService.orgUserList.filter(n=>1===n.status).forEach(n=>{this.master.allRoleList.find(p=>p.id===n.role)?.featureid?.indexOf(c.G7b.wrkshp_asgn_task)>-1&&a.userList.push({id:n.id,value:n.name||n.loginName})}),a.foremanID="";const o=this.getTaskIndexForEngineerChange(a);if(-1!==o){const n=this.rowDataTask[o]?.id;n&&!this.pendingEngineerRevertByTaskId.has(n)&&this.pendingEngineerRevertByTaskId.set(n,this.rowDataTask[o].foremanID||""),this.rowDataTask[o].foremanID=e,this.rowDataTask[o].formanUpdated=!0}}}cancelAllTheTask(){this.jobStatus===c.A8Q.cancelled&&(this.rowDataTask.forEach(e=>{e.id&&(e.status=c.e1J.cancelled,e.updatedDate=l.H.moment(new Date).utc().format(),e.updatedBy=this.master.userInfo?.id||"")}),this.objTaskArray=this.rowDataTask,this.isloading=!0,this.insertTask(!0))}insertTaskAlone(e){var a=this;return(0,w.A)(function*(){return new Promise((i,o)=>{a.subs.add=a.taskService.bulkInsertTask(e).subscribe({next:()=>{a.master.toasterService.success("Successfully updated task"),i()},error:n=>{a.master.toasterService.error("Add task failed"),a.master._helper.helperLog(`errmsg ${n}`),o()}})})})()}saveUpdatedJobTask(){this.checkActiveWarranties().then(()=>
1{if(this.isAnyActiveWarrantyExist&&!this.isWarrantyJobCreationApproved)return void this.modalService.open(this.showActiveWarrantyListModelName);const e=this.getUpdatedEngineerAssignments();this.checkWorkloadBeforeAssign(e,()=>{this.captureCurrentTaskHoursAsBaseline(),this.pendingEngineerRevertByTaskId.clear(),this.addTaskEnginnerIdsToJob(this.rowDataTask),this.objTaskArray=this.rowDataTask,this.isloading=!0,this.objJobData.isAgreementJob=this.isWarrantyJobCreationApproved,this.insertTask(!0),this.objJobData.isUpdateFromWeb=!0,this.objJobData.updatedDate=this.getNowUTC(),this.objJobData.updatedBy=this.master.userInfo?.id||"",this.setJobUpdatedTime(!0,this.objJobData)},()=>this.revertPendingEngineerAssignments())})}insertJobTask(){let e=this.getMappedJobStatusId(this.objJobData.workflowStatusID);if(this.isExternal&&e===c.A8Q.completed)this.jobCompletionDatePopup();else{const a=this.getUpdatedEngineerAssignments();this.checkWorkloadBeforeAssign(a,()=>{this.captureCurrentTaskHoursAsBaseline(),this.pendingEngineerRevertByTaskId.clear(),this.isloading=!0,this.objScheduleData.createdBy=this.objJobData.createdBy,this.objScheduleData.createdDate=this.objJobData.createdDate,this.objScheduleData.updatedBy=this.master.userInfo?.id||"",this.objScheduleData.updatedDate=this.getNowUTC(),this.objScheduleData.id=this.scheduleId,this.subs.add=this.jobService.scheduleService.updateSchedule(this.objScheduleData).subscribe({next:()=>{this.isBookingDataUpdated=!1,this.objJobData.updatedBy=this.master.userInfo?.id||"",this.objJobData.updatedDate=this.getNowUTC(),this.objJobData.isUpdateFromWeb=!0,this.objJobData.customerReference=this.objScheduleData.customerReference,this.storeJob(this.objJobData,!0,i=>{if(i)this.toastrService.error("Failed to Update Job");else if(this.rowDataTask.length){const o=[...this.rowDataTask,...this.deletedRowDataTask];navigator.onLine?this.subs.add=this.taskService.bulkInsertTask(o).subscribe({error:n=>{this.master.toasterService.error("Add task failed, please retry or please contact admin if error exists"),this.master._helper.helperLog(`bulk insert Task failed ${n}`)},complete:()=>{this.updateTaskGrid(this.rowDataTask)}}):this.idb.bulkUpsert(u.S.jobTasks,o).then().finally(()=>this.updateTaskGrid(this.rowDataTask))}else this.toastrService.warning(c.YMJ.AddTask)})},error:()=>{this.isBookingDataUpdated=!1,this.isloading=!1,navigator.onLine||this.idb.UpsertData(u.S.schedule,{key:this.objScheduleData.id,value:this.objScheduleData}),this.toastrService.error("schedule updated failed")}})},()=>this.revertPendingEngineerAssignments())}}checkForAnyMaintenanceOrDefectRepairTaskSelected(){return 0!==(this.maintenanceRowData.filter(e=>e.checked)?.length||this.repairRowData.filter(e=>e.checked)?.length)}addRemoveFromTask(e,a){const i=this.rowDataTask.findIndex(o=>o.serviceID===a.id);if(e&&-1===i){const o=this.deletedRowDataTask.findIndex(n=>n.serviceID===a.id);if(o>-1){const n=this.deletedRowDataTask.splice(o,1)[0];n.isNew=!0,n.isDelete=!1,this.rowDataTask.push(n)}else{const n={...a};this.updatePartStatus(n.parts);const d=this.objAssetData?.operatorOrgID||"";n.serviceID=a.id,n.id=this.master.newGuid(),n.type="Task",n.plannedHours=a.hours||l.H.zero;const p=this.master.getOrgInfo(d);if(n.labourRate=l.H.getEffectiveLabourRate(p?.labourRate,a.hourlyRate),Array.isArray(n.parts)){const m=p?.partsRatePercentage,g=!p?.parentOrgID;n.parts=n.parts.map(f=>({...f,unitCost:l.H.calculatePartSellingPrice(f.salesPrice,f.unitCost,m,f.partMarkupPercentage,g)}))}n.jobID_PK=this.isUpdatingJobTask?this.jobId:this.newJobID,n.isNew=!0,n.createdDate=l.H.moment(new Date).utc().format(),n.updatedDate=l.H.moment(new Date).utc().format(),n.createdBy=this.master.userInfo?.id||"",n.updatedBy=this.master.userInfo?.id||"",n.assetID=this.assetId,n.status=n.status?n.status:1,n.offline=u.vQ.created,n.isComplianceTask=a.isCompliance,this.ensureTaskClassificationDefaults(n),n.taskCost=this.calculateTaskLabourCost(n),n.status=1===n.status&&this.isExternal&&this.objJobData.status===c.A8Q.booked?l.H.id2:l.H.id1,this.rowDataTask.push(n)}}else if(i>-1){const o=this.rowDataTask.splice(i,1)[0];-1===this.deletedRowDataTask.findIndex(d=>d.serviceID===o.id)&&(o.isNew=!1,o.isDelete=!0,this.deletedRowDataTask.push(o))}this.isAnyActiveWarrantyExist=!1,this.isWarrantyJobCreationApproved=!1,this.loadTaskDetail
1s(!0)}updatePartStatus(e){e?.forEach(a=>{a.partStatus||(a.partStatus=1)})}addRemoveRepairFromTask(e,a){const i=this.rowDataTask.findIndex(o=>o.defectID===a.defectID);if(e&&-1===i){const o=this.deletedRowDataTask.findIndex(n=>n.defectID===a.defectID);if(o>-1)this.rowDataTask.push(this.deletedRowDataTask.splice(o,1)[0]);else{const n={...a};n.jobID_PK=this.isUpdatingJobTask?this.jobId:this.newJobID,n.isNew=!0,n.assetID=this.assetId,n.status=n.status?n.status:1,n.offline=u.vQ.created,this.ensureTaskClassificationDefaults(n),n.taskCost=this.calculateTaskLabourCost(n),n.status=1===n.status&&this.isExternal&&this.objJobData.status===c.A8Q.booked?l.H.id2:l.H.id1,this.rowDataTask.push(n)}}else if(i>-1){const o=this.rowDataTask.splice(i,1)[0];-1===this.deletedRowDataTask.findIndex(d=>d.defectID===a.defectID)&&(o.isNew=!1,o.isDelete=!0,o.offline=u.vQ.updated,this.deletedRowDataTask.push(o))}this.isAnyActiveWarrantyExist=!1,this.isWarrantyJobCreationApproved=!1,this.loadTaskDetails(!0)}closeModal(e){this.modalService.close(e),this.addPartDetails=null,"addPartTab"===e&&(this.isNewPartAdded=!1)}getPartMode(e){this.partResponseMode=e}addPartBtnDisable(){return this.tabAddPartBtnDisable=this.objJobData.status===c.A8Q.completed||this.objJobData.status===c.A8Q.cancelled||this.objJobData.status===c.A8Q.onShow||!this.maintenanceRowData?.length&&!this.repairRowData?.length,this.tabAddPartBtnDisable}savePart(e){let a=0,i=-1,o=[];o=this.jobId?this.objJobData.task:this.rowDataTask,o.forEach((n,d)=>{n.id===e.data.taskType&&(a=d),n.parts.forEach((p,m)=>{p.id===e.data.id&&("add"===this.partResponseMode&&(this.partResponseMode="update"),i=m)})}),this.closeModal("addPartTab"),this.savePartDetails(e.data,a,i,e.data.id)}inValidUser(){return!this.checkUserHasLocation()||!this.isExternal&&this.objJobData.status!==c.A8Q.inprogress&&(this.toastrService.warning("Job needs to be in-progress status to start the task."),!0)}commonEmitterEvent(e){e.isPriceChanged&&(this.isPriceChanged=!0)}deletePartNotSaveTask(e){e&&this.deleteJobPart(e,!0)}savePartDetails(e,a,i,o){let n={};n=this.jobId?this.objJobData.task[a]:this.rowDataTask[a],this.updatePartStatus([e]),-1!==i?"update"===this.partResponseMode?n.parts[i]=e:"delete"===this.partResponseMode?n.parts.splice(i,1):(n.parts.push(e),this.jobHistoryDesc=`Part ${e.partName} Added in Task ${n.name}`):(this.jobHistoryDesc=`Part ${e.partName} Added in Task ${n.name}`,n.parts.push(e)),n.updatedDate=l.H.moment(new Date).utc().format(),n.updatedBy=this.master.userInfo?.id||"",this.objJobData.status>c.A8Q.planned&&this.addJobHistory(!1),this.subs.add=this.taskService.updateTask(n).subscribe({next:()=>{this.isPriceChanged&&(this.jobService.sendPartAuthorizationMail(this.jobId).subscribe(),this.isPriceChanged=!1),this.deleteJobPart(o),this.objJobData.updatedDate=n.updatedDate,this.objJobData.isUpdateFromWeb=!0,this.objJobData.updatedBy=n.updatedBy,this.setJobUpdatedTime(!0,this.objJobData),localStorage.setItem("TaskLastSynced",l.H.moment(new Date).format()),this.toastrService.success(`Part details ${this.partResponseMode}`),this.editJobDetails(),this.createWorkshopInvntryStock(),this.jobId&&this.goToCurrentTab()},error:()=>{if(navigator.onLine)this.toastrService.error("Failed to update task.");else{const d={key:n.id,value:n};d.value.offline=u.vQ.updated,this.idb.UpsertData(u.S.jobTasks,d),this.setJobUpdatedTime(!1,this.objJobData)}}})}deleteJobPart(e,a=!1){l.H.isEroyOrganization(this.master)||(this.subs.add=this.jobService.deleteJobPart(e).subscribe({next:i=>{i&&a&&(this.toastrService.success("Part details are Deleted"),this.editJobDetails(),this.createWorkshopInvntryStock(),this.setParts(),this.jobId&&this.goToCurrentTab())}}))}getAllDefectList(){navigator.onLine?this.subs.add=this.defect.getOpenDefectList(this.assetId).subscribe({next:e=>this._GetDefectList(e),error:e=>this.master._helper.helperLog(`get defect ${e}`)}):this.idb.getAllByIndex(u.S.defect,u.pM.asset_IDX,this.assetId).then(e=>{const a=e.filter(i=>i.defectStatus===c.ORI.OpenDefect);this._GetDefectList(a)})}_GetDefectList(e){Array.isArray(e)&&(this.openDefectList=e.filter(a=>!a.isAdvisory))}getAdvisoryDefects(e){if(this.advisoryDefectListResp=e,this.advisoryDefectList=[],e?.length){const a=e.filter(n=>n.isAdvisory),i=this.objJobData.task||[],o=[];a.forEach(n=>{const d=i.find(p=>p.serviceID===n.serviceId);if(d&&Object.keys(d).length){const p={};p.id=d.id,p.defectID=n.id,p.defectRaisedBy=this.getDefectRaisedBy(n.createdBy);const m=this.defectNotesSortByDate(n.defectNotes),g=this.getMatchedJobComment(m);p.defectFirstComment=g,p.taskStatusColor=this.getTaskStatusColor(n.defectStatus===c.ORI.Resolved?c.ORI.Resolved:c.e1J.inprogress),(g||!g&&n.defectStatus!==c.ORI.Resolved)&&o.push(p)}}),this.advisoryDefectList=o}}getMatchedJobComment(e){let a="";if(e.length){const i=e.find(o=>o.jobId===this.jobId);a=i?.comment?i.comment:""}return a}defectNotesSortByDate(e){return e.length?(e.sort((a,i)=>
1Date.parse(i.createdDate)-Date.parse(a.createdDate)),e):[]}getJobDefects(e){this.jobDefectList=Array.isArray(e)?e:[]}getDefectCost(e){this.defectCost=Array.isArray(e)?e:[]}onFirstDataRenderedParentOrg(e){this.agGridPart.api.autoSizeAllColumns()}navigateToTask(e){this.router.navigate(["/assets/asset-scheduler",{assetId:e.assetID}])}navigateToAsset(e){return e}getWeekNumbers(){this.lastWeekNumber=1===l.H.getCurrentWeekNumber(this.lastDate)?Number(l.H.ISOweek52):Number(l.H.ISOweek);for(let e=1;e<=this.lastWeekNumber;e++){const a=l.H.getDateOfISOWeek(this.date,e);1===e&&(this.date=a.StartDate),e===this.lastWeekNumber&&(this.nextYearDate=a.EndDate),this.weekNumber.push({weekNumber:e,startDate:a.StartDate,endDate:a.EndDate})}}getAllAssetList(){this.jobId?this.assetlist=[this.objAssetData]:this.subs.add=this.assetService.getAssetsList().subscribe({next:e=>{e&&e.length>0&&(this.assetlist=e,this.assetJoblists=[])},complete:()=>{this.getAssetJob()}})}getAssetJob(){this.assetlistID=[this.assetId],this.getJobPlannerDetails(this.assetlistID)}getJobPlannerDetails(e){let a=[];e&&0===e.length||(this.subs.add=this.plannerService._getPlannerDetails(e,this.date,this.nextYearDate).subscribe({next:i=>{i&&!Array.isArray(i)&&i?.jobTasks.length>0&&(a=i.jobTasks)},complete:()=>{let i=[];a&&(i=this.getTaskDetails(a)),this.mapAssetToJobs(i)}}))}getFinalAssetList(){return"999"!==this.assetId&&"999"!==this.depotID?this.assetlist.filter(e=>e.assetID_PK===this.assetId&&e.depotOrgID===this.depotID):"999"!==this.depotID?this.assetlist.filter(e=>e.depotOrgID===this.depotID):"999"!==this.assetId?this.assetlist.filter(e=>e.assetID_PK===this.assetId):this.assetlist}mapAssetToJobs(e){this.assetJoblists=[];let a=[];const i=this.getFinalAssetList();if(i&&i.length>0&&"999"!==this.workshopID){const o=i.map(n=>n.id);e=e.filter(n=>{n.weekJob.filter(d=>{const m=e?.findIndex(g=>g.assetID===d.assetID);o.includes(d.assetID)&&d.workshopID===this.workshopID&&(a=this.getFinalTaskDetailList(a,[],d,m,e))})})}else a=e;for(const o of i){const n=a.findIndex(d=>d.assetID===o.assetID_PK);if(-1!==n)a[n].weekJob[0]=o,this.assetJoblists.push(a[n].weekJob);else{const d=[];d.length=1===this.lastWeekNumber?l.H.ISOweek:l.H.ISOweek54,d[0]=o,this.assetJoblists.push(d)}}this.scrollToCurrentIsoWeek()}getFinalTaskDetailList(e,a,i,o,n){return 0===e.length?(a[i.weekNumber]=[i],e=[{assetID:i.assetID,weekJob:a}]):-1===o?(a[i.weekNumber]=[i],e.push({assetID:i.assetID,weekJob:a})):n[o].weekJob[i.weekNumber]?e[o].weekJob[i.weekNumber].push(i):e[o].weekJob[i.weekNumber]=[i],e}getTaskDetails(e){let a=[];for(const i of this.weekNumber)e=e.filter(o=>{const d=new Date(o.job.dateBooked);return!(d.getTime()>=i.startDate.getTime()&&d.getTime()<i.endDate.getTime()&&(o.tasks.length>0&&o.job.status<c.A8Q.completed&&o.job.status!==c.A8Q.cancelled&&(a=this.getMapping(a,o,i)),1))});return a}getMapping(e,a,i){const o=this.master.masterAllOrgList.find(m=>m.id===a.job.workshopID)?.companyName,n=a.job,d=[];d.length=1===this.lastWeekNumber?l.H.ISOweek:l.H.ISOweek54;const p={type:n.type,assetID:n.assetID_PK,taskDate:l.H.moment(new Date(a.job.dateBooked)).format(l.H.ddMMYYYYDateFormate),taskWorkshop:o,weekStartDate:i.startDate,weekEndDate:i.endDate,weekNumber:i.weekNumber,workshopID:a.job.workshopID,jobStatus:this.jobStatus,jobID:a.job.id};if(0===e.length)d[i.weekNumber]=[p],e=[{assetID:p.assetID,weekJob:d}];else{const m=e.findIndex(g=>g.assetID===p.assetID);-1===m?(d[i.weekNumber]=[p],e.push({assetID:p.assetID,weekJob:d})):e[m].weekJob[i.weekNumber]?e[m].weekJob[i.weekNumber].push(p):e[m].weekJob[i.weekNumber]=[p]}return e}getAlerts(){navigator.onLine?this.subs.add=this.alertService.getByAlertType({type:this.alertType,key:"jobID",value:this.jobId}).subscribe(a=>{Object.keys(a).length>0?this.mapAlertDetails(a):this.mapAlertDetails(void 0)}):this.idb.getAllByIndex(u.S.alerts,u.pM.alertType,this.alertType).then(a=>{a.length>0&&this.mapAlertDetails(a.find(i=>i.jobID===this.jobId))})}mapAlertDetails(e){this.alertDetails=e}getOrgType(){-1!==this.master.masterOrgList.filter(i=>i.id===this.master.navSelectedOrgID)[0]?.orgType.findIndex(i=>i===l.H.id4||i===l.H.id7)&&(this.fromWorkShop=!0)}generatePDF(){if(!navigator.onLine)return void this.toastrService.warning("You can create Charge-card at offline!");this.isloading=!0,this.jobHistoryDesc="Created PDF",this.addJobHistory(!1);const e=this.objJobData.invoiceID;e||(this.objJobData.invoiceID=this.master.newGuid()),this.prepareDataAndcreateInvoice(!1,e).then(a=>{if(a.success){this.checkAndUpdateInvoiceIdToJob(a);const o={invoiceId:this.objJobData.invoiceID||"",jobRequestId:this.objJobData.jobRequestId||"",make:this.master.getMake(this.objAssetData),model:this.objAssetData.model,processedBy:this.master.userInfo?.id||"",processedByName:this.master.userInfo?.name||this.master.userInfo?.loginName||"",processedDate:l.H.moment(new Date).utc().format()};this.subs.add=this.jobService.createChargeCard(o).subscribe({next:n=>{n?(this.InvoiceJob=n,this.InvoiceJob.offline=u.vQ.new,this.storeInvoiceoffline(),this.isloading=!1):(this.toastrService.warning("Not able to create charge card"),this.isloading=!1)},error:()=>{this.isloading=!1,navigator.onLine||(this.InvoiceJob.offline=this.InvoiceJob.offline===u.vQ.created?u.vQ.created:u.vQ.updated,this.storeInvoiceoffline())}})}else this.isloading=!1})}
1checkAndUpdateInvoiceIdToJob(e){e.updateInvoiceIdToJob&&(this.subs.add=this.jobService.updateJob(this.objJobData).subscribe())}storeInvoiceoffline(){this.idb.UpsertData(u.S.invoice,{key:this.InvoiceJob.id,value:this.InvoiceJob}).then(()=>this.toastrService.success("Charge Card Updated")).finally(()=>this.master.jobInvoiced=this.InvoiceJob)}convertLblUsageRateToInt(e){return e?Math.ceil(e):""}bindDropdown(e,a,i){-1===e.findIndex(o=>o.id===a)&&e.push({id:a,value:i})}agGridTaskRowRender(e){(e=e.filter(a=>(a.taskCost=this.calculateTaskLabourCost(a),1===a.status&&this.isExternal&&this.objJobData.status===c.A8Q.booked&&(a.status=2),!1===a.isDelete))).length&&e.forEach(a=>{const i=this.rowDataTask.findIndex(o=>o.id===a.id||"repairs"===o.serviceID&&o.id===a.id);this.ensureTaskClassificationDefaults(a),this.refreshClassificationOptionLists(a),-1===i?this.rowDataTask.push(a):this.rowDataTask[i]=a})}getArrivedAtVal(e){let a=new Date;return e&&(a=new Date(e)),`${a.getHours()}: ${a.getMinutes()}`}docClick(e){void 0!==this.jobId?this.isExternal&&this.jobStatus===c.A8Q.planned||!this.isExternal&&this.jobStatus<c.A8Q.onSite?this.toastrService.warning("Job needs to be started first."):e.rData&&(this.router.url.includes("assets")?this.router.navigate(["/assets/asset-list/tasks",{jobID:this.jobId,id:e.rData.id,tabID:"documentTab"}]):this.router.navigate(["/workshop/planner/tasks",{jobID:this.jobId,id:e.rData.id,tabID:"documentTab"}])):this.toastrService.warning("Job needs to be created first.")}setJobUpdatedTime(e,a){l.H.helperLog(a.updatedDate),e?this.subs.add=this.jobService.updateJob(a).subscribe({next:()=>{l.H.helperLog("Job updated time updated")},error:i=>{l.H.helperLog("Job updated time update failed! : "+i.message)}}):(a.offline=u.vQ.updated,this.idb.UpsertData(u.S.job,{key:a.id,value:a}).catch(()=>{l.H.helperLog("Job update failed")}))}takeTaskOwnership(e){this.closeModal(e);const a={taskId:this.selRowData.taskID,userId:this.master.userInfo?.id};if(this.isloading=!0,this.objJobData.updatedDate=l.H.moment(new Date).utc().format(),this.objJobData.isUpdateFromWeb=!0,this.objJobData.updatedBy=this.master.userInfo?.id||"",navigator.onLine)this.subs.add=this.taskService.updateTaskOwnership(a).subscribe(i=>{this.setJobUpdatedTime(!0,this.objJobData),this.isloading=!1,this.taskOwnershipUpdatedSuccess(i)});else{const i=this.objJobData.task.find(n=>n.id===this.selRowData.taskID),o={key:i.id,value:i};o.value.offline=u.vQ.updated,this.idb.UpsertData(u.S.jobTasks,o).then(n=>{this.setJobUpdatedTime(!1,this.objJobData),this.taskOwnershipUpdatedSuccess(n)})}}taskOwnershipUpdatedSuccess(e){e?(this.toastrService.success("Successfully changed the Task Ownership"),this.prepareForNavToTask(this.selRowData)):this.toastrService.error("Failed to change the Task Ownership")}createWarrantyJobHistory(e,a){if(this.isWarrantyJobCreationApproved){const i=new v.oP;i.jobID_PK=e.id,i.description=c.bo5.createNewAssetAgreJobMsg,i.jobStatus=e.status===c.A8Q.booked?c.A8Q.planned:e.status,i.workFlowStatus=Number(e.workflowStatusID||0),i.id=this.master.newGuid(),i.isDelete=!1,i.createdBy=this.master.userInfo?.id||"",i.offline=u.vQ.created,i.createdDate=l.H.moment(new Date).utc().format(),a.push(i)}}addJobHistory(e,a="",i=[]){const o=[];if(e)i.forEach(d=>{this.createWarrantyJobHistory(d,o);const p=new v.oP;p.jobID_PK=d.id,p.description=a,p.jobStatus=d.status,p.workFlowStatus=Number(d.workflowStatusID||0),p.id=this.master.newGuid(),p.isDelete=!1,p.createdBy=this.master.userInfo?.id||"",p.offline=u.vQ.created,p.createdDate=l.H.moment(new Date).utc().format();const m=Object.assign({},p);m.jobStatus===c.A8Q.booked?(m.id=this.master.newGuid(),m.jobStatus=c.A8Q.planned,m.description="Created Job",o.push(m)):p.description="Created Job",o.push(p)});else if(this.jobHistoryDesc){const d=new v.oP;d.jobID_PK=this.objJobData.id,d.description=this.jobHistoryDesc,d.jobStatus=this.objJobData.status,d.workFlowStatus=Number(this.objJobData.workflowStatusID||0),d.id=this.master.newGuid(),d.isDelete=!1,d.offline=u.vQ.created,d.createdBy=this.master.userInfo?.id||"",d.createdDate=l.H.moment(new Date).utc().format(),this.objCompletionJobData?.comment?d.comment=this.objCompletionJobData.comment:this.noScheduleReason&&(d.comment=this.noScheduleReason),o.push(d)}const n=this.prepareJobWorkshopChangeAudit();n&&o.push(n),o.length&&(navigator.onLine?this.subs.add=this.jobService.createMultipleJobHistory(o).subscribe({next:d=>{this.isWarrantyJobCreationApproved=!1,this.jobHistoryDesc="",l.H.helperLog(d),"fail"===this.objCompletionJobData.passOrFail&&"yes"===this.objCompletionJobData.rebook&&(this.objJobData.jobComment=this.objCompletionJobData.comment,this.objCompletionJobData=new X,this.reBookJob())},error:d=>{this.master._helper.helperLog(`Failed to create job history: ${d.message}`),this.toastrService.error("Job created, but Job History could not be created.")}}):(this.idb.bulkUpsert(u.S.jobHistory,o),"fail"===this.objCompletionJobData.passOrFail&&"yes"===this.objCompletionJobData.rebook&&(this.objJobData.jobComment=this.objCompletionJobData.comment,this.objCompletionJobData=new X,this.reBookJob())))}onRowClick(e){if(void 0===this.jobId)this.toastrService.warning("Job needs to be created first.");else if(!this.isExternal&&this.jobStatus<c.A8Q.inprogress)this.toastrService.warning("Job needs to be started first.");else if(e.data){const a=e.data.foremanID;if(this.master.userInfo?.role===c.foM.superAdmin)this.prepareForNavToTask(e.data);else if(a&&a===this.master.userInfo?.id)this.prepareForNavToTask(e.data);else{this.selRowData=e.data;const o=this.rowDataTask.find(d=>d.id===e.data.taskID)?.plannedHours||l.H.zero,n=this.master.userInfo?.id||"";n&&o>0?this.checkWorkloadBeforeAssign([{userId:n,additionalHours:o}],()=>this.modalService.open("confirmTakeOwnership")):this.modalService.open("confirmTakeOwnership")}}}onTakeOwnershipNo(){this.closeModal("confirmTakeOwnership"),this.selRowData&&this.prepareForNavToTask(this.selRowData,"readonly")}prepareForNavToTask(e,a,i=!1){const o=this.rowDataTask.find(n=>n.serviceID===e.id||"repairs"===n.serviceID&&n.id===e.id)?.id||e?.taskID||e?.id;o&&(this.navigateTotask(o,a,i),this.selRowData=null)}navigateTotask(e,a,i=!1,o={}){localStorage.setItem(c.YMJ.CurrentJobStatus,this.objJobData.status.toString());const n=this.router.url.includes("assets")?"/assets/asset-list/tasks":"/workshop/planner/tasks",d={jobID:this.jobId,id:e,...o};if(a&&(d.previewMode=a),i){const p=this.router.createUrlTree([n,d]),m=this.router.serializeUrl(p);window.open(m,"_blank")}else this.router.url.includes("assets")?this.router.navigate(["/assets/asset-list/tasks",d]):this.router.navigate(["/workshop/planner/tasks",d])}getMappedJobStatusId(e){if(this.isExternal&&this.workFlowStatusList?.length)return this.workFlowStatusList.find(a=>Number(a?.id)===Number(e))?.jobStatusMapId}getNextWorkflowStep(e){const a=(this.master.masterOrgData||[]).filter(o=>o.lookupType===c.YMJ.WorkFlowStatus).flatMap(o=>o.details||[]).sort((o,n)=>Number(o.order)-Number(n.order)),i=a.findIndex(o=>Number(o.id)===Number(e));return i>=0?a[i+1]:null}requiresOdometerForWorkflowStep(e=this.objJobData?.workflowStatusID){return this.isExternal&&!!this.getNextWorkflowStep(e)?.requireOdo}onOdometerChanged(){this.requiresOdometerForWorkflowStep()&&(this.odometerReadingEdited=!0)}saveRequiredOdometer(e){const a=Number(this.objJobData.usageRate);if(!this.odometerReadingEdited||null==this.objJobData.usageRate||""===String(this.objJobData.usageRate).trim()||!Number.isFinite(a)||a<0||a>l.H.maxNumber||null!=this.objAssetData?.usageRate&&a<Number(this.objAssetData.usageRate))return void this.toastrService.warning("ODO is required");if(!navigator.onLine)return void this.toastrService.warning("An internet connection is required to save the ODO reading.");const i=this.getNowUTC();this.subs.add=this.plannerService.SaveOdometerForWorkflowStep({jobId:this.objJobData.id,odometerValue:a,userId:this.master.userInfo?.id||"",requestedDate:i}).subscribe({next:o=>{o?(this.hasSavedOdometerReading=!0,Object.assign(this.objJobData,{isOdometerReadingTaken:!0,odometerReading:a,odometerReadingDate:i}),this.odometerReadingEdited=!1,e()):this.toastrService.error("Failed to save ODO reading.")},error:()=>this.toastrService.error("Failed to save ODO reading.")})}getWorkflowMappedJobStatusLabel(){const e=this.getMappedJobStatusId(this.objJobData?.workflowStatusID);if(!e||this.objJobData.status===c.A8Q.completed)return"";const a=this.master.jobStatus.find(i=>i.id===e);return this.objJobData.status=a?.id||this.objJobData.status,a?.[this.master.displayLang]||a?.en||""}validateJobCompletionStatus(e){if(e!==c.A8Q.completed&&e!==c.A8Q.awaitingSignoff)return!0;
1if((this.objJobData.task||[]).filter(o=>o.status!==l.H.id3&&o.status!==l.H.id4).length>0)return this.jobHistoryDesc="",this.toastrService.warning("Please complete or cancel active tasks"),!1;if(this.isExternal){const o=this.getMandatoryDocsShortfall();if(o)return this.jobHistoryDesc="",this.showDocRequirementAlert(`Cannot ${e===c.A8Q.completed?"complete this job":"move this job to awaiting sign off"}. '${o.stepName}' requires at least ${o.mandatory} mandatory document(s), but only ${o.actual} attached.`),!1}return!(!this.objJobData.supervisorSigned&&e===c.A8Q.completed&&(this.toastrService.warning(this.signRequiredTxt),1))}getMandatoryDocsShortfall(e){const a=e??this.objJobData.workflowStatusID,i=this.workFlowStatusList.find(p=>Number(p.id)===Number(a)),o=Number(i?.mandatoryDocs||i?.mandatoryDocuments||0);if(o<=0)return null;const d=(Array.isArray(this.documentRowData)?this.documentRowData.length:0)||Number(this.objJobData?.documentCount||0);return d>=o?null:{stepName:i?.en||i?.name||"Current step",mandatory:o,actual:d}}showDocRequirementAlert(e,a="Action Blocked"){this.docRequirementAlertTitle=a,this.docRequirementAlertMessage=e,this.modalService.open(this.docRequirementAlertModalName)}closeDocRequirementAlert(){this.modalService.close(this.docRequirementAlertModalName)}openCompletedTaskSheetsForReview(){if(!(this.objJobData?.task||[]).filter(o=>!!o?.id).filter(o=>o?.status===c.e1J.completed).length)return void this.toastrService.warning("No completed tasks available for review.");const i=this.router.url.includes("/assets/")?"/assets/asset-list/job-review":"/workshop/planner/job-review";this.router.navigate([i,{jobID:this.jobId}])}getJobStatus(e){const a=this.master.jobStatus.find(i=>i.id===e);a&&(this.jobStatus=a.id,this.lblJobHeader=this.getWorkflowMappedJobStatusLabel()||a[this.master.displayLang],l.H.helperLog(`Job Status - ${this.jobStatus}`),l.H.helperLog(`Job Status text - ${this.lblJobHeader}`)),this.jobStatus===c.A8Q.onSite&&(this.arrivedAtVal=this.getArrivedAtVal()),this.jobStatus>c.A8Q.onSite&&(this.lblUsageRate=this.objJobData?.usageRate),this.jobStatus===c.A8Q.cancelled&&(this.oldCancellationReason=this.objJobData.cancellationReason,this.blnupdateCancelReason=!1)}get checkJobStatus(){return this.jobStatus>0&&this.jobStatus<=l.H.id4}get checkCompanyAndJobStatus(){return!(!this.onsiteRestrictAccess||this.jobStatus!==c.A8Q.booked)}get showSupervisorSign(){return this.jobStatus>0&&this.jobStatus>=c.A8Q.completed}showSupervisorSignForBackDate(e){let a=this.jobStatus===c.A8Q.booked||this.jobStatus===c.A8Q.planned||this.jobStatus===c.A8Q.inprogress||this.jobStatus===c.A8Q.onSite||this.jobStatus===c.A8Q.onhold;return e||(a=a&&this.isExternal&&(this.objJobData.backdatedJob&&this.jobStatus!==c.A8Q.completed||!this.objJobData.backdatedJob)),!!a}assignDefaultValues(e){this.objScheduleData.interval=this.objScheduleData.interval&&0!=this.objScheduleData.interval?this.objScheduleData.interval:1,this.objScheduleData.every=this.objScheduleData.every??1,this.jobStatus!==c.A8Q.unplanned&&(this.objScheduleData.agreement=this.objJobData.agreement)}isExternalWorkshop(e=""){const a=this.master.allworkshoplist.find(i=>i.id===e)?.type;this.isExternal=a!==c.YMJ.Workshop}trackByInspectionTask(e,a){return a?.id||e}trackByTaskId(e,a){return a?.id||e}trackByMaintenanceTask(e,a){return a?.id||e}trackByRepairTask(e,a){return a?.id||e}trackByAdvisoryDefect(e,a){return a?.id||e}trackByWorkstation(e,a){return a?.id||e}trackByUser(e,a){return a?.id||e}trackByCheckSheet(e,a){return a?.id||e}trackByWizard(e,a){return a?.id||e}assignJobValuesFromAsset(){this.jobId?this.getWorkshopParts():this.CustomerList=[this.CustomerList[0]],this.objScheduleData.workshopID=this.objAssetData.primaryWorkshopOrgID,this.jobStatus===c.A8Q.unplanned?(this.getOrgUsers(this.objScheduleData.workshopID),this.objScheduleData.customerID=this.objAssetData.ownerOrgID,this.objScheduleData.notes="",this.isExternalWorkshop(this.objScheduleData.workshopID),this.getContract(this.objAssetData.ownerOrgID)):(this.isExternalWorkshop(this.objJobData.workshopID),this.getOrgUsers(this.objJobData.workshopID||"")),this.objScheduleData.operatorID=this.objAssetData.operatorOrgID,this.objScheduleData.ownerID=this.objAssetData.ownerOrgID,this.objScheduleData.depotID=this.objAssetData.depotOrgID,this.objScheduleData.assetID_PK=this.objAssetData.id,this.objScheduleData.type="Schedule",this.objScheduleData.status=1,"Workshop"===this.mode?(this.objScheduleData.jobReportedBy="Workshop",this.objJobData.jobReportedBy="Workshop"):(this.objScheduleData.jobReportedBy="Asset",this.objJobData.jobReportedBy="Asset"),this.objJobData.task&&this.agGridTaskRowRender(this.objJobData.task);const e=[this.objAssetData.ownerOrgID,this.objAssetData.operatorOrgID],a=e.filter((i,o)=>e.indexOf(i)===o);for(const i of a){const o=this.master.masterOrgList.filter(n=>i===n.id&&(this.isExternal||n.orgType.find(d=>d<l.H.id3)));o&&o.length>0&&this.bindDropdown(this.CustomerList,o[0].id,o[0].companyName)}}updateJobWorkshopLocationLookupCandelete(){this.master.jobWorkshopLocations.find(a=>a.id===this.editingJobWorkshopLoc.id)?.canDelete&&this.updateAssetType("update","","",!1)}getNowUTC(){return l.H.moment(Date.now()).utc().format()}calculateTaskLabourCost(e){const i=this.master.getOrgInfo(this.objAssetData?.operatorOrgID||""),o=null!=e.hourlyRate?e.hourlyRate:e.labourRate,n=l.H.getEffectiveLabourRate(i?.labourRate,o);return e.labourRate=n,this.getEffectiveLabourHours(e)*n}getEffectiveLabourHours(e){const a=Number(e?.plannedHours||l.H.zero),i=Number(e?.engineerActualHours||l.H.zero);return this.shouldUseEngineerActualHoursFromParentOrg()&&i>l.H.zero?i:a}shouldUseEngineerActualHoursFromParentOrg(){const a=this.master.getParentOrgId(this.master.navSelectedOrgID||"");return!!this.master.masterOrgList?.find(o=>o.id===a)?.isActualHourForCalculation}getJobDateFormatted(){const e=this.jobId&&(this.objJobData.dateBooked||this.objJobData.datePlanned)||this.objScheduleData.plannedDate;if(!e)return"";const a=l.H.getTodayDateWithoutTime(e);
1if(a)return a;const i=l.H.moment(e);return i.isValid()?i.format("YYYY-MM-DD"):""}getJobWorkshopId(){return(this.jobId?this.objJobData?.workshopID||this.objScheduleData?.workshopID:this.objScheduleData?.workshopID||this.objJobData?.workshopID||this.objAssetData?.primaryWorkshopOrgID)||""}get contactsCustomerOrgID(){const e=[this.objJobData?.customerID,this.objScheduleData?.customerID,this.objAssetData?.operatorOrgID,this.objAssetData?.ownerOrgID];for(const a of e){const i=(a||"").toString().trim();if(i&&"999"!==i)return i}return""}buildInitials(e){return e.trim().split(/\s+/).map(a=>a[0]||"").join("").toUpperCase().slice(0,2)}getTaskHours(e){const a=[e?.plannedHours,e?.hours,e?.estimatedHours,e?.durationHours,e?.labourHours];for(const o of a){const n=Number(o);if(!isNaN(n)&&n>0)return n}const i=this.parseDurationToHours(e?.taskDuration);return i>0?i:0}parseDurationToHours(e){if(!e||"string"!=typeof e)return 0;const a=e.trim().toLowerCase();if(!a)return 0;const i=Number(a);if(!isNaN(i)&&i>0)return i;let o=0;const n=a.match(/(\d+(?:\.\d+)?)\s*h/),d=a.match(/(\d+(?:\.\d+)?)\s*m/);return n&&(o+=Number(n[1])),d&&(o+=Number(d[1])/60),o>0?Math.round(o*l.H.hundred)/l.H.hundred:0}getAssignmentHours(e,a){const i=this.getTaskHours(e),o=this.getTaskHours(a);if(i>0||o>0)return Math.max(i,o);const n=e?.serviceID||a?.id||a?.serviceID;if(n){const p=this.inspectionRowData?.find(g=>g.id===n)||this.maintenanceRowData?.find(g=>g.id===n),m=this.getTaskHours(p);if(m>0)return m}const d=e?.defectID||a?.defectID;if(d){const p=this.repairRowData.find(g=>g.defectID===d),m=this.getTaskHours(p);if(m>0)return m}return 0}normalizeId(e){return(e||"").toString().trim().toLowerCase()}getTaskIndexForEngineerChange(e){return this.rowDataTask.findIndex(a=>a.serviceID===e.id||a.id===e.taskID||a.id===e.id||a.defectID&&a.defectID===e.defectID)}checkWorkloadBeforeAssign(e,a,i){if(this.isCheckingWorkloadCapacity)return;if(this.isExternal)return void a();const o=this.getJobDateFormatted(),n=new Map;e.forEach(p=>{const m=this.normalizeId(p.userId),g=Number(p.additionalHours||l.H.zero);!m||g<=0||isNaN(g)||n.set(m,(n.get(m)||l.H.zero)+g)});const d=Array.from(n.entries()).map(([p,m])=>({userId:p,additionalHours:m}));o&&d.length?(this.isCheckingWorkloadCapacity=!0,this.subs.add=this.workshopassetServ.checkUserCapacity(o,d).subscribe({next:p=>{this.isCheckingWorkloadCapacity=!1;const m=[],g=new Set,f=_=>{const F=Number(_);return isNaN(F)?0:F},R=f(p?.engineersAffected??p?.data?.engineersAffected??p?.result?.engineersAffected),B=_=>{const F=_?.userId||_?.id||"",E=this.normalizeId(F);if(!E||g.has(E))return;const W=this.master.getUserName(F)||_?.userName||"",q=f(_?.beforeAllocated??_?.before?.allocated??_?.booked??_?.bookedHours??_?.totalBookedHours),G=f(_?.dayCapacity??_?.before?.dayCapacity??_?.after?.dayCapacity??_?.capacity??_?.totalCapacityHours),rt=f(_?.beforeLoading??_?.before?.loading??_?.loading??_?.loadingPercent??_?.loadingPercentage),V=f(_?.afterAllocated??_?.after?.allocated??_?.projectedBooked??_?.projectedAllocated??q),x=f(_?.afterLoading??_?.after?.loading??_?.projectedLoading??_?.projectedLoadingPercentage),z=x>0?x:G>0?Math.round(V/G*l.H.hundred):0;!(_?.isOverCapacity||z>l.H.hundred||G>0&&V>G)&&R<=0||(g.add(E),m.push({userId:F,name:W,initials:this.buildInitials(W),shiftName:_?.shiftName||"",shiftStatus:_?.shiftName&&""!==_.shiftName.trim()?void 0:"Rest Day / Leave",date:l.H.moment(o).format(l.H.DD_MMM_YYYY_Formate),beforeAllocated:q,dayCapacity:G,beforeLoading:rt,afterAllocated:V,afterLoading:z,overByHrs:f(_?.hoursOver)||Math.round((V-G)*l.H.id10)/l.H.id10}))},j=p?.users||p?.data?.users||p?.result?.users||p?.overCapacityUsers||p?.data?.overCapacityUsers||p?.result?.overCapacityUsers||p?.data||p?.result||p,S=p?.overCapacityUsers||p?.data?.overCapacityUsers||p?.result?.overCapacityUsers;
1Array.isArray(S)&&S.length&&S.forEach(_=>B(_)),Array.isArray(j)&&j.forEach(_=>B(_)),!m.length&&R>0&&d.length&&d.forEach(_=>{const F=this.normalizeId(_.userId);if(!F||g.has(F))return;g.add(F);const E=this.master.getUserName(_.userId)||"";m.push({userId:_.userId,name:E,initials:this.buildInitials(E),shiftName:"",shiftStatus:"Rest Day / Leave",date:l.H.moment(o).format(l.H.DD_MMM_YYYY_Formate),beforeAllocated:0,dayCapacity:0,beforeLoading:0,afterAllocated:_.additionalHours,afterLoading:0,overByHrs:0})}),m.length?(this.workloadResources=m,this.workloadProceedCallback=a,this.workloadCancelCallback=i||null,this.modalService.open(this.workloadExceededModalName)):a()},error:()=>{this.isCheckingWorkloadCapacity=!1,this.master._helper.helperLog("CheckUserCapacity API failed while assigning engineers in new booking."),this.toastrService.warning("Unable to verify workload capacity. Proceeding with assignment."),a()}})):a()}onWorkloadConfirmed(){this.closeModal(this.workloadExceededModalName);const e=this.workloadProceedCallback;this.workloadProceedCallback=null,this.workloadCancelCallback=null,e?.()}onWorkloadCancelled(){this.closeModal(this.workloadExceededModalName);const e=this.workloadCancelCallback;this.workloadProceedCallback=null,this.workloadCancelCallback=null,e?.()}revertPendingEngineerAssignments(){this.pendingEngineerRevertByTaskId.size&&(this.rowDataTask.forEach(e=>{const a=e?.id;!a||!this.pendingEngineerRevertByTaskId.has(a)||(e.foremanID=this.pendingEngineerRevertByTaskId.get(a)||"",e.formanUpdated=!1)}),[this.inspectionRowData,this.maintenanceRowData,this.repairRowData].forEach(e=>{e.forEach(a=>{const i=a?.taskID;!i||!this.pendingEngineerRevertByTaskId.has(i)||(a.foremanID=this.pendingEngineerRevertByTaskId.get(i)||"")})}),this.pendingEngineerRevertByTaskId.clear(),this.taskUpdated=this.rowDataTask.some(e=>e.formanUpdated))}captureCurrentTaskHoursAsBaseline(){this.rowDataTask.forEach(e=>{const a=e?.id;a&&this.originalTaskHourByTaskId.set(a,this.getAssignmentHours(e,e))})}captureOriginalTaskHours(){this.rowDataTask.forEach(e=>{const a=e?.id;!a||this.originalTaskHourByTaskId.has(a)||this.originalTaskHourByTaskId.set(a,this.getAssignmentHours(e,e))})}getHourIncreaseAssignments(){const e=new Map;return this.rowDataTask.forEach(a=>{if(!a?.id||!a?.foremanID||a.formanUpdated)return;const i=Number(this.getAssignmentHours(a,a)||l.H.zero),o=Number(this.originalTaskHourByTaskId.get(a.id)||l.H.zero),n=Math.round((i-o)*l.H.id10)/l.H.id10;n<=0||e.set(a.foremanID,(e.get(a.foremanID)||l.H.zero)+n)}),Array.from(e.entries()).map(([a,i])=>({userId:a,additionalHours:i}))}getUpdatedEngineerAssignments(){const e=new Map;return this.rowDataTask.forEach(a=>{a.formanUpdated&&a.foremanID&&e.set(a.foremanID,(e.get(a.foremanID)||l.H.zero)+this.getAssignmentHours(a,a))}),this.getHourIncreaseAssignments().forEach(a=>{e.set(a.userId,(e.get(a.userId)||l.H.zero)+a.additionalHours)}),Array.from(e.entries()).map(([a,i])=>({userId:a,additionalHours:i}))}comparisonEnddateValidator(){this.objScheduleData.plannedDate=l.H.getTodayDateWithoutTime(this.objScheduleData.plannedDate),this.objScheduleData.endDate=l.H.getTodayDateWithoutTime(this.objScheduleData.endDate);const e=this.objScheduleData.plannedDate,a=this.objScheduleData.endDate;let i="",o="";e&&(i=new Date(e)),a&&(o=new Date(a)),i>o&&this.objScheduleData.recurringEvent&&this.toastrService.warning("End Date cannot be earlier than Booking Date")}comparisonStartdateValidator(){this.objScheduleData.plannedDate=l.H.getTodayDateWithoutTime(this.objScheduleData.plannedDate),this.objScheduleData.endDate=l.H.getTodayDateWithoutTime(this.objScheduleData.endDate);const e=this.objScheduleData.plannedDate,a=this.objScheduleData.endDate;let i="",o="";e&&(i=new Date(e)),a&&(o=new Date(a)),i>o&&this.objScheduleData.recurringEvent&&this.toastrService.warning("Booking Date cannot be greater than End Date")}showOptions(){this.objScheduleData.recurringEvent&&(this.removeDefectRepairsFromTask(),this.comparisonStartdateValidator())}removeDefectRepairsFromTask(){this.rowDataTask=this.rowDataTask.filter(e=>"Repair"!==this.taskTypeVG({data:e}))}inValidateJob(){if(!this.objAssetData.id)return this.toastrService.warning("Please select an asset."),!0;if(0===this.rowDataTask?.length)return this.toastrService.warning(c.YMJ.AddTask),!0;if(!this.objScheduleData.workshopID||!this.objScheduleData.plannedDate)return this.toastrService.warning(this.toasterText),!0;if(!this.objScheduleData.customerID)return this.toastrService.warning("Please enter valid customer details"),!0;if(this.objScheduleData.recurringEvent){const e=this.objScheduleData.plannedDate||null,a=this.objScheduleData.endDate||null;if(!e||!a)return this.toastrService.warning(this.toasterText),!0;if([Date.parse(e)>Date.parse(a),"UsageBased"===this.objScheduleData.scheduleMode?!this.objScheduleData.mileageInterval:!this.objScheduleData.every,"UsageBased"!==this.objScheduleData.scheduleMode&&!this.objScheduleData.interval,"UsageBased"===this.objScheduleData.scheduleMode?0===this.objScheduleData.mileageInterval:0===this.objScheduleData?.every].some(o=>o))return this.toastrService.warning(this.toasterText),!0}return!1}checkActiveWarranties(){return new Promise(e=>{this.checkForAnyMaintenanceOrDefectRepairTaskSelected()&&!this.isWarrantyJobCreationApproved?this.assetService.checkActiveWarranties(this.assetId,this.assetUsageInfo).then(a=>{this.assetService.updateUsageInDesc(this.objAssetData,this.assetUsageInfo),a&&a.assetAgreements?.length?(this.isAnyActiveWarrantyExist=!0,this.warrantyList=a.assetAgreements):(this.isAnyActiveWarrantyExist=!1,this.warrantyList=[]),e()}):e()})}createJob(){this.inValidateJob()||this.checkActiveWarranties().then(()=>
1{if(this.isAnyActiveWarrantyExist&&!this.isWarrantyJobCreationApproved)return void this.modalService.open(this.showActiveWarrantyListModelName);const e=this.rowDataTask.filter(a=>a.foremanID).map(a=>({userId:a.foremanID,additionalHours:this.getAssignmentHours(a,a)}));this.checkWorkloadBeforeAssign(e,()=>{this.pendingEngineerRevertByTaskId.clear(),this.removeTabIndexFromStorage(),this.isloading=!0,this.objJobData.assetID_PK=l.H.getString(this.objAssetData.id),this.objJobData.datePlanned=this.getNowUTC(),this.objJobData.workshopID=this.objScheduleData.workshopID,this.objJobData.agreement=this.objScheduleData.agreement,this.objJobData.customerID=l.H.getString(this.objScheduleData.customerID),this.objJobData.customerReference=this.objScheduleData.customerReference,this.objJobData.type="Job",this.objJobData.status=c.A8Q.planned,this.objJobData.createdBy=this.master.userInfo?.id||"",this.objJobData.createdDate=this.getNowUTC(),this.objJobData.updatedBy=this.master.userInfo?.id||"",this.objJobData.updatedDate=this.getNowUTC(),this.objJobData.isUpdateFromWeb=!0,this.objJobData.parentOrgID=this.master.getParentOrgId(this.master.navSelectedOrgID),this.objScheduleData.createdBy=this.master.userInfo?.id||"",this.objScheduleData.createdDate=this.getNowUTC(),this.objJobData.vrm=this.objAssetData.vrm,this.objJobData.fleetNumber=this.objAssetData.fleetNumber,this.objScheduleData.vrm=this.objAssetData.vrm,this.objScheduleData.notes=this.objJobData.jobComment,this.objScheduleData.updatedBy=this.master.userInfo?.id||"",this.objScheduleData.updatedDate=this.getNowUTC(),this.objScheduleData.parentOrgID=this.objJobData.parentOrgID,this.objScheduleData.plannedDate=l.H.getTodayDateWithoutTime(this.objScheduleData.plannedDate),this.objScheduleData.backdatedReason=this.backdatedReason,this.objScheduleData.recurringEvent?this.objScheduleData.endDate&&(this.objScheduleData.endDate=l.H.getTodayDateWithoutTime(this.objScheduleData.endDate)):this.objScheduleData.endDate=this.objScheduleData.plannedDate,this.isExternal&&(this.objJobData.usageRate=this.objAssetData.usageRate&&this.objAssetData.usageRate>0?this.objAssetData.usageRate:0),this.objJobData.task=this.rowDataTask,this.objJobData.mappedOrgIDs=[this.objAssetData.ownerOrgID,l.H.getString(this.objJobData.workshopID)],this.objAssetData.ownerOrgID!==this.objJobData.customerID&&this.objJobData.mappedOrgIDs.push(this.objAssetData.operatorOrgID),this.objJobData.isAgreementJob=this.isWarrantyJobCreationApproved,this.isBookingDataUpdated=!1,this.saveSchedule(this.objScheduleData)},()=>this.revertPendingEngineerAssignments())})}checkBackdateRolePermission(){return this.master.features.includes(c.G7b.back_date_jobs)||this.master.isSuperAdmin}dataModified(){!this.isBookingDataUpdated&&!this.isUpdatingJobTask&&(this.isBookingDataUpdated=!0)}onChangeWorkFlowStatus(e){const a=this.workFlowStatusList.map(p=>Number(p?.id??p?.statusId??p?.lookupId)),i=a.indexOf(Number(this.lastValidWorkflowStatusID)),o=a.indexOf(Number(e));if(this.lastValidWorkflowStatusID&&i>=0&&o>=0&&o<i)return this.toastrService.warning(y.dq.CannotMoveBack),void setTimeout(()=>{this.objJobData.workflowStatusID=this.lastValidWorkflowStatusID;try{this.cdr.detectChanges()}catch{}});const n=this.lastValidWorkflowStatusID||this.objJobData.workflowStatusID,d=this.getMandatoryDocsShortfall(n);return d&&Number(e)!==Number(n)?(this.showDocRequirementAlert(`Cannot move to next workflow step. '${d.stepName}' requires at least ${d.mandatory} mandatory document(s), but only ${d.actual} attached.`),void setTimeout(()=>{this.objJobData.workflowStatusID=this.lastValidWorkflowStatusID;try{this.cdr.detectChanges()}catch{}})):this.validateJobCompletionStatus(this.getMappedJobStatusId(e))?!this.requiresOdometerForWorkflowStep(n)||Number(this.getNextWorkflowStep(n)?.id)!==Number(e)||this.hasSavedOdometerReading&&!this.odometerReadingEdited?void this.applyWorkflowStatus(e):(this.objJobData.workflowStatusID=n,void this.saveRequiredOdometer(()=>this.applyWorkflowStatus(e))):void setTimeout(()=>{this.objJobData.workflowStatusID=this.lastValidWorkflowStatusID;try{this.cdr.detectChanges()}catch{}})}applyWorkflowStatus(e){this.objJobData.workflowStatusID=e,this.lblJobHeader=this.getWorkflowMappedJobStatusLabel()||this.lblJobHeader,this.dataModified(),this.updateWorkflowStatusPermission()}addWorkflowStatusHistory(e){if(e.status===c.A8Q.completed||e.status===c.A8Q.awaitingSignoff||Number(this.savedWorkflowStatusID)===Number(e.workflowStatusID))return;const a=new v.oP;if(a.jobID_PK=e.id,a.jobStatus=e.status,a.workFlowStatus=Number(e.workflowStatusID),a.description=`Workflow status changed to ${this.getWorkflowStatusName(e.workflowStatusID)}`,a.id=this.master.newGuid(),a.isDelete=!1,a.offline=u.vQ.created,a.createdBy=this.master.userInfo?.id||"",a.createdDate=l.H.moment(new Date).utc().format(),this.savedWorkflowStatusID=e.workflowStatusID,!navigator.onLine)return this.idb.bulkUpsert(u.S.jobHistory,[a]),void(this.isHistoryTabActive&&this.addWorkflowStatusHistoryToGri
1d(a));this.subs.add=this.jobService.createMultipleJobHistory([a]).subscribe({next:()=>{this.isHistoryTabActive&&this.getJobHistoryData()},error:i=>this.master._helper.helperLog(`Failed to create workflow status history: ${i}`)})}addWorkflowStatusHistoryToGrid(e){this.jobHistoryData=[e,...this.jobHistoryData||[]]}compareWorkflowStatus(e,a){return e&&a?e.toString()===a.toString():e===a}updateReason(e){this.isNewWorkshopBooking?this.backdatedReason=e.target.value:this.objJobData.backdatedReason=e.target.value}backdateAction(){const e=l.H.getTodayDateWithoutTime(this.objScheduleData.plannedDate);this.schedulerDateChanged&&l.H.compareDates(e,this.objScheduleData.endDate)&&(this.addbackdateReason(),this.schedulerDateChanged=!1)}get backdatedDateModel(){let e=new Date;e.setDate(e.getDate()-1);const a=l.H.getTodayDateWithoutTime(e);return this.bookedDateSelected=a,this.isNewWorkshopBooking?this.objScheduleData.plannedDate:a}set backdatedDateModel(e){this.isNewWorkshopBooking?this.objScheduleData.plannedDate=e:(this.dateBooked=e,this.bookedDateSelected=e)}showRescheduleJobsModel(){this.rescheduleModal?.reset(),this.showModal(this.rescheduleJobsModelName)}onRescheduleDecided(e){this.noScheduleReason=e.noScheduleReason,this.completeJobProcess()}isComplianceJob(){return this.objJobData.isComplianceJob||!1}jobCompletionDatePopup(){if(this.validateJobCompletionStatus(c.A8Q.completed)){if(!this.objJobData?.supervisorSigned)return void this.toastrService.error(this.signRequiredTxt);if(this.checkAuthRuleForSignOffOrCompletingJob(!0)){if(this.mappedKeydate.length<1)return void this.checkCompilanceJobForNormalJobProcess();this.objCompletionJobData.completionDate=l.H.getTodayDateWithoutTime();for(let e=0;e<this.mappedKeydate.length;e++){const a=this.mappedKeydate[e];if(a?.value){let i=new Date(a.value);a.timeMode&&("MONTH"===a.timeMode?i.setMonth(i.getMonth()+a.stepCount):"WEEK"===a.timeMode?i.setDate(i.getDate()+a.stepCount*I.Y.id7):"DAY"===a.timeMode&&i.setDate(i.getDate()+a.stepCount)),a.timeMode&&(this.mappedKeydate[e].updatedValue=l.H.getTodayDateWithoutTime(i))}}this.showModal("jobCompletionFeedback")}}}checkCompilanceJobForNormalJobProcess(){this.subs.add=this.getFutureComplianceJobs().subscribe(()=>{Object.keys(this.futureComplianceJob).length?(this.currentJobCompleteType=c.K2f.NormalJob,this.showRescheduleJobsModel()):this.startNormalJobUpdateProcess()})}checkAndAddNoRescheduleReason(){this.noScheduleReason&&(this.jobHistoryDesc="Completed outside schedule",this.addJobHistory(!1))}startNormalJobUpdateProcess(){this.jobHistoryDesc="Completed Job",this.updateJob(c.A8Q.completed)}handleCompletionDetails(){const e=new Date(this.dateBooked),a=new Date,i=e.getFullYear()===a.getFullYear()&&e.getMonth()===a.getMonth()&&e.getDate()===a.getDate(),o=l.H.getTodayDateWithoutTime(i?this.bookedDateSelected:this.dateBooked);if(this.isNewWorkshopBooking&&""===this.backdatedReason&&this.objScheduleData.backdatedJob&&this.enableBackDatingReasonFieldEdit)this.toastrService.error("Enter a valid back date reason");else{if(!this.isNewWorkshopBooking&&this.objScheduleData.backdatedJob){let n=new Date;if(n.setDate(n.getDate()-1),""===this.backdatedReason)return void this.toastrService.error("Enter a valid back date reason");if(!l.H.compareDates(o,n))return void this.toastrService.error("Select the past date from booked date");if(!this.objJobData?.supervisorSigned)return void this.toastrService.error(this.signRequiredTxt);if(!this.checkAuthRuleForSignOffOrCompletingJob(!0))return}if(this.enableBackDatingReasonFieldEdit&&!this.objScheduleData.backdatedJob&&(this.isNewWorkshopBooking||(this.dateBooked=this.objJobData.dateBooked),this.backdatedReason="",this.objJobData.supervisorSigned=!1,this.objJobData.supervisorSign=""),this.objScheduleData&&!this.objScheduleData.backdatedJob)return this.enableBackDatingReasonFieldEdit&&(this.objScheduleData.plannedDate=l.H.getTodayDateWithoutTime()),void this.modalService.close("showBackDateReason");if(this.mappedKeydate.length&&!this.isNewWorkshopBooking){this.objCompletionJobData.completionDate=l.H.getTodayDateWithoutTime(this.dateBooked);for(let n=0;n<this.mappedKeydate.length;n++){const d=this.mappedKeydate[n];if(d?.value){let p=new Date(d.value);d.timeMode&&("MONTH"===d.timeMode?p.setMonth(p.getMonth()+d.stepCount):"WEEK"===d.timeMode?p.setDate(p.getDate()+d.stepCount*I.Y.id7):"DAY"===d.timeMode&&p.setDate(p.getDate()+d.stepCount)),d.timeMode&&(this.mappedKeydate[n].updatedValue=l.H.getTodayDateWithoutTime(p))}}
1this.modalService.open("jobCompletionFeedback")}else this.handleBackdatedJob()}}handleBackdatedJobToClose(){if(this.objJobData?.supervisorSigned){if(this.checkAuthRuleForSignOffOrCompletingJob(!0))if(this.modalService.close("showSupervisorSignPopup"),this.mappedKeydate.length){this.objCompletionJobData.completionDate=l.H.getTodayDateWithoutTime(this.dateBooked);for(let e=0;e<this.mappedKeydate.length;e++){const a=this.mappedKeydate[e];if(a?.value){let i=new Date(a.value);a.timeMode&&("MONTH"===a.timeMode?i.setMonth(i.getMonth()+a.stepCount):"WEEK"===a.timeMode?i.setDate(i.getDate()+a.stepCount*I.Y.id7):"DAY"===a.timeMode&&i.setDate(i.getDate()+a.stepCount)),a.timeMode&&(this.mappedKeydate[e].updatedValue=l.H.getTodayDateWithoutTime(i))}}this.modalService.open("jobCompletionFeedback")}else this.closeJob()}else this.toastrService.error(this.signRequiredTxt)}refreshLookup(){}resetFileInput(){this.keyDateJobFileUpload?.nativeElement&&(this.keyDateJobFileUpload.nativeElement.value="")}validateAssetDocument(){return this.assetDocFormat&&!this.assetDocType?(this.toastrService.warning("Please select document type"),!1):!(this.assetDocType&&!this.assetDocFormat&&(this.toastrService.warning("Please upload document"),1))}handleCompletionKeydates(e){if(!e){this.modalService.close("jobCompletionFeedback"),this.assetDocType=0,this.assetDocFormat="",this.resetFileInput(),this.objScheduleData?.backdatedJob&&(this.objScheduleData.backdatedJob=!1,this.handleCompletionDetails());for(let n=0;n<this.mappedKeydate.length;n++)this.mappedKeydate[n].updatedValue="";return void(this.objCompletionJobData=new X)}if(!this.validateAssetDocument())return;let a=!1,i="",o="";if("pass"===this.objCompletionJobData.passOrFail)for(let n=0;n<this.mappedKeydate.length;n++){const d=this.mappedKeydate[n];if(!d.updatedValue){a=!0,i=d.fieldName;break}if(d?.value){if(l.H.compareDates(d.value,d.updatedValue,!0))continue;i=d.fieldName,a=!0,o=`Please Enter equal to or after the previous ${i} date`;break}if(this.objAssetData.inServiceDate){if(l.H.compareDates(this.objAssetData.inServiceDate,d.updatedValue,!0))continue;i=d.fieldName,a=!0,o=`Please Enter equal to or after the previous ${i} date`;break}}a?this.toastrService.error(o||`Select a valid next ${i} date.`):"fail"!==this.objCompletionJobData.passOrFail||""!==this.objCompletionJobData.comment?!this.assetDocFormat||this.assetDocumentURL?this.checkCompilanceJobForKeyDateJobProcess():this.toastrService.warning("Please wait while the file is uploading."):this.toastrService.error("Enter a comment.")}checkCompilanceJobForKeyDateJobProcess(){this.subs.add=this.getFutureComplianceJobs().subscribe(()=>{Object.keys(this.futureComplianceJob).length?(this.currentJobCompleteType=c.K2f.KeyDateJob,this.modalService.close("jobCompletionFeedback"),this.assetDocType=0,this.resetFileInput(),this.showRescheduleJobsModel()):this.jobCompleteWithKeyDates()})}jobCompleteWithKeyDates(){if(this.procressDoc(),"pass"===this.objCompletionJobData.passOrFail){let e=[];const a=[];if(this.mappedKeydate.forEach(i=>{i.updatedValue&&("UserDefinedFields"===i.type?e.push({id:i.id,type:"",response:i.updatedValue,alternateId:i?.alternateId,added:!1}):"SystemDefinedFields"===i.type&&a.push(i))}),e.length&&this.objAssetData?.userDefined.length>0){const i=this.objAssetData.userDefined.findIndex(o=>o.orgId===this.master.parentOrgId);-1!==i?(this.objAssetData.userDefined[i].responseList=this.objAssetData.userDefined[i].responseList.map(n=>{const d=e.findIndex(p=>p.id===n.id||p.alternateId===n.id);return-1!==d?(e[d].added=!0,e[d]):n}),e=e.filter(n=>!n.added),this.objAssetData.userDefined[i].responseList=this.objAssetData.userDefined[i].responseList.concat(e)):this.objAssetData.userDefined.push({orgId:this.master.parentOrgId,responseList:e})}a.length&&a.forEach(i=>{this.objAssetData={...this.objAssetData,[i.fieldValue]:l.H.getTodayDateWithoutTime(i.updatedValue)}}),this.subs.add=this.assetService.updateAsset(this.objAssetData).subscribe({next:i=>{this.toastrService.success(`${i.vrm} updated successfully.`)},error:i=>{this.toastrService.error(i.error.msg+"Update asset failed")},complete:()=>{}})}this.objScheduleData?.backdatedJob?this.handleBackdatedJob():(this.enableBackDatingReasonFieldEdit=!1,this.closeJob()),this.modalService.close("jobCompletionFeedback"),this.assetDocType=0,this.resetFileInput()}getFutureComplianceJobs(){const e=[...this.rowDataTask.filter(i=>i.serviceID&&"repairs"!==i.serviceID).map(i=>i.serviceID)];return this.objJobData.isComplianceJob||e.length?this.taskService.checkAndGetJobChangeList({jobId:this.jobId,serviceIdList:e,assetId:this.objAssetData.id}).pipe((0,Bt.M)({next:i=>{this.futureComplianceJob=Array.isArray(i)?{}:i},error:()=>{this.futureComplianceJob={},this.toastrService.error("Failed to fetch future compliance jobs")}})):(this.futureComplianceJob={},(0,Jt.of)(null))}fileBrowseHandler(e){const{target:a}=e;this.prepareFilesList(a.files)}prepareFilesList(e){this.assetDocumentURL="",this.assetDocFormat="",this.assetDocuments=[];const a=e[0];
1if(!this.master.validateFileFormat(a.name,a.type,"DOCUMENT"))return;a.progress=0,this.assetDocFormat=a.type,this.assetDocuments.push(a);const i=a,o=new FormData;o.append("containerName","documents"),o.append("parentOrgId",this.master.parentOrgId),o.append("file",i,i.name),this.workshopassetServ.uploadAssetDocument(o).subscribe(n=>{n.type===M.hv.UploadProgress?this.assetDocuments[0].progress=Math.round(l.H.hundred*n.loaded/n.total):n.type===M.hv.Response&&(this.assetDocumentURL=n.body.url,this.enableJobCompletionAction&&(this.enableJobCompletionAction=!1))})}procressDoc(){if(this.assetDocumentURL){const e={assetID_PK:this.objAssetData?.id,type:"Document",documentAT:this.assetDocumentURL,ownerOrgID:this.objAssetData?.ownerOrgID,operatorOrgID:this.objAssetData?.operatorOrgID,depotOrgID:this.objAssetData?.depotOrgID,workshopOrgID:this.objAssetData?.primaryWorkshopOrgID,jobID:this.jobId,taskID:"",quoteID:"",taskType:0,tasksubType:0,docType:this.assetDocType,description:"Updated date field value",eventDate:l.H.getTodayDateWithoutTime(),name:this.mappedKeydate[0].fieldName,format:this.assetDocFormat,docEmailID:"",isDelete:!1,createdBy:this.master.userInfo?.id,createdDate:l.H.moment(Date.now()).utc().format(),updatedDate:l.H.moment(Date.now()).utc().format(),updatedBy:this.master.userInfo?.id,id:this.master.newGuid(),defectID:""};this.taskDocUploadedDate=e.updatedDate,this.subs.add=this.assetService.uploadDocumentlist(e).subscribe({next:a=>{a.type===M.hv.Response&&("OK"===a.statusText||"Created"===a.statusText)&&(this.assetDocType=0,this.assetDocumentURL="",this.assetDocFormat="",this.toastrService.success("Document Added"))},error:()=>{this.toastrService.error("Failed To Add Document")}})}}handleBackdatedJob(){const e=l.H.getTodayDateWithoutTime(this.dateBooked);this.enableBackDatingReasonFieldEdit&&!this.isNewWorkshopBooking&&(this.objJobData.actualDateBooked=l.H.getTodayDateWithoutTime(this.objJobData.dateBooked),this.objJobData.dateBooked=e,this.objJobData.backdatedJob=!0,this.objJobData.backdatedReason=this.backdatedReason,this.closeJob()),this.modalService.close("showBackDateReason")}closeSupervisorPopup(){this.modalService.close("showSupervisorSignPopup")}dateFilter(){let e=new Date;return e.setDate(e.getDate()-1),l.H.getTodayDateWithoutTime(e)}mappeddateFieldFilter(e){if(e?.value){let a=new Date(e.value);return l.H.getTodayDateWithoutTime(a)}if(this.objAssetData.inServiceDate){let a=new Date(this.objAssetData.inServiceDate);return l.H.getTodayDateWithoutTime(a)}return null}requireSupervisorSignoff(){this.showModal("showSupervisorSignPopup")}resetScheduleModelValues(){this.currentJobCompleteType="",this.noScheduleReason=""}closeJob(){if(!this.objJobData?.supervisorSigned)return void this.toastrService.error(this.signRequiredTxt);if(!this.checkAuthRuleForSignOffOrCompletingJob(!0)||this.validateAdvisoryDefectCommentsForCloseJob())return;this.isloading=!0,this.isBookingDataUpdated=!1;const e=l.H.getTodayDateWithoutTime(new Date),a=this.master.userInfo?.id||"";this.objTaskArray=this.objJobData.task,this.objTaskArray=this.objTaskArray.map(i=>(i.updatedBy=a,i.taskCompletedBy=a,i.updatedDate=e,i.taskCompletedDate=this.getNowUTC(),i.status=c.e1J.completed,i.backdatedJob=!0,i)),this.objJobData.task=this.objTaskArray,this.objJobData.updatedBy=a,this.objJobData.updatedDate=this.getNowUTC(),this.objJobData.dateCompleted=this.getNowUTC(),this.objJobData.isUpdateFromWeb=!0,this.objJobData.status=c.A8Q.
1completed,this.assignCompletedWorkflowStatus(this.objJobData),this.objJobData.invoiceID=this.master.newGuid(),this.subs.add=(0,Mt.x)(this.taskService.bulkInsertTask(this.objTaskArray),this.jobService.updateJob(this.objJobData)).subscribe({next:()=>{},complete:()=>{if(this.checkAndChangeJobReqstStatus(),this.enableBackDatingReasonFieldEdit){const o=l.H.moment(this.objJobData.actualDateBooked).format("DD-MM-YYYY"),n=l.H.moment(this.objJobData.dateBooked).format("DD-MM-YYYY");this.jobHistoryDesc=`Job backdated from ${o} to ${n} - ${this.objJobData.backdatedReason}`}else this.jobHistoryDesc="Completed Job";const i="fail"===this.objCompletionJobData.passOrFail&&"yes"===this.objCompletionJobData.rebook;this.prepareDataAndcreateInvoice(!0,!1),this.checkAndGenerateInspPdf(this.objJobData,!1,i).then(()=>{this.rowDataTask=[],this.bindTasks(this.objTaskArray),this.bindTaskDetails()}),this.addJobHistory(!1),this.checkAndAddNoRescheduleReason(),this.toastrService.success("Job and Tasks are Completed"),this.assetDocType=0,this.resetFileInput(),this.closeSupervisorPopup()},error:()=>{this.closeSupervisorPopup()}})}validateAdvisoryDefectCommentsForCloseJob(){return!(!this.advisoryDefectList?.length||this.jobService.validateAdvisoryDefectComments(this.jobId,this.advisoryDefectListResp,this.objJobData.task||[])||(this.toastrService.warning(Q.L.ADVISORY_DEFECT_VALIDATION_MSG),0))}prepareDataAndcreateInvoice(e=!1,a){return new Promise((i,o)=>{const n={success:!0,updateInvoiceIdToJob:!1};e||!a?(this.InvoiceJob.id=this.objJobData.invoiceID||"",this.updateInvoiceDetails(),this.InvoiceJob.offline=u.vQ.new,this.subs.add=this.jobService.invoiceservice.createInvoice(this.InvoiceJob).subscribe({next:()=>{n.success=!0,n.updateInvoiceIdToJob=!0,i(n)},error:d=>{const p="Error while creating invoice";this.toastrService.error(p),l.H.helperLog(p),l.H.helperLog(d),n.success=!1,i(n)}})):(n.success=!0,i(n))})}showDate(e){let a;switch(e){case 1:a=this.objJobData.datePlanned;break;case 2:a=this.objJobData.dateBooked;break;case I.Y.id3:a=this.objJobData.dateOnSite;break;case 4:a=this.objJobData.dateInProgress;break;case I.Y.id6:a=this.objJobData.dateCancelled;break;case 8:a=this.objJobData.backdatedJob?this.objJobData.dateBooked:this.objJobData.dateCompleted;break;default:a=this.objJobData.updatedDate}return a&&(a=l.H.moment(a).format("DD-MM-YY")),a}saveSchedule(e){if(this.scheduleId)e.id=this.scheduleId,this.subs.add=this.jobService.scheduleService.updateSchedule(e).subscribe({error:()=>{navigator.onLine||this.idb.UpsertData(u.S.schedule,{key:e.id,value:e}),this.toastrService.error("schedule updated failed")},complete:()=>{this.maintenanceService=[],this.inspectionService=[],this.immediateInspecService=[],this.initAssetTaskAPI()}});else{if(e.id=this.master.newGuid(),"UsageBased"===e.scheduleMode)return void(this.subs.add=this.jobService.scheduleService.previewUsageSchedule(e).subscribe({next:a=>{if(this.usageForecastOccurrences=a.occurrences||[],0===this.usageForecastOccurrences.length)return this.isloading=!1,void this.toastrService.warning("No predicted jobs fall between the selected start and end dates.");e.baselineMileage=a.baselineMileage,e.baselineDate=a.baselineDate,e.forecastRatePerDay=a.ratePerDay,this.createNewSchedule(e)},error:()=>{this.isloading=!1,this.toastrService.warning("No usable odometer history was found. The asset needs two increasing readings on different dates.")}}));this.createNewSchedule(e)}}createNewSchedule(e){this.subs.add=this.jobService.scheduleService.createSchedule(e).subscribe({next:()=>{this.scheduleId=e.id,this.objJobData.scheduleID=e.id,this.objJobData.actualDateBooked=e.actualDateBooked,this.objJobData.backdatedReason=e.backdatedReason,this.objJobData.backdatedJob=e.backdatedJob,this.updateJobWorkshopLocationLookupCandelete(),this.createJobs(this.objJobData)},error:()=>{navigator.onLine?this.toastrService.error("schedule created failed"):this.idb.UpsertData(u.S.schedule,{key:e.id,value:e}).then(i=>{this.scheduleResponse(i,e)}).catch(i=>this.master._helper.helperLog(`idb - schedule - store ${i} ${e.id}`))}})}scheduleResponse(e,a){e&&(this.scheduleId=a.id,this.objJobData.scheduleID=a.id,this.createJobs(this.objJobData))}addTaskEnginnerIdsToJob(e){this.objJobData.engineerIds||(this.objJobData.engineerIds=[]);const a=e&&e.length?e.filter(i=>i.foremanID).map(i=>i.foremanID):[];this.objJobData.engineerIds=a&&a.length>0?this.objJobData.engineerIds.concat(a):this.objJobData.engineerIds,this.objJobData.engineerIds=[...new Set(this.objJobData.engineerIds)]}createJobs(e){this.addTaskEnginnerIdsToJob(e.task),this.objJobArray=[],this.objTaskArray=[];const a="UsageBased"===this.objScheduleData.scheduleMode,i=a?this.usageForecastOccurrences[0]?.predictedDate:this.objScheduleData.plannedDate,o=this.objScheduleData.endDate,n=this.objScheduleData.every?Number(this.objScheduleData.every):1;if(i){let d=Date.parse(i);if(e.id=this.newJobID,e.dateBooked=this.objScheduleData.plannedDate,e.isExternalJob=this.isExternal,this.isExternal||(e.status=this.objScheduleData.recurringEvent?c.A8Q.planned:c.A8Q.booked),e.datePlanned=e.dateBooked,e.recurringSchedule=this.objScheduleData.recurringEvent,e.forecastOccurrence=a?this.usageForecastOccurrences[0]?.occurrence:void 0,e.forecastTargetMileage=a?this.usageForecastOccurrences[0]?.targetMileage:void 0,e.isoWeek=l.H.moment(new Date(d)).isoWeek(),e.updatedDate=l.H.moment(new Date).utc().format(),e.isUpdateFromWeb=!0,e.isCompl
1ianceJob=e.task.some(p=>p.isComplianceTask),e.task=e.task.filter(p=>(p.jobID_PK=this.newJobID,p.status=1,!0)),this.objJobArray.push(e),this.objTaskArray=this.objTaskArray.concat(e.task),this.jobId=e.id,a)this.usageForecastOccurrences.slice(1).forEach(p=>{let m=new v.XP;m=Object.assign(m,e),m.id=this.master.newGuid(),m.dateBooked=l.H.getTodayDateWithoutTime(p.predictedDate),m.datePlanned=m.dateBooked,m.forecastOccurrence=p.occurrence,m.forecastTargetMileage=p.targetMileage,m.isoWeek=l.H.moment(new Date(m.dateBooked)).isoWeek(),m.task=m.task.map(g=>{const f=Object.assign({},g);return f.jobID_PK=m.id||"",f.id=this.master.newGuid(),f}),this.objJobArray.push(m),this.objTaskArray=this.objTaskArray.concat(m.task),e=m});else if(this.objScheduleData.recurringEvent&&o&&!isNaN(n))for(;d<Date.parse(o);){let p=new v.XP;p=Object.assign(p,e),d=this.getBookDateInterval(d,n),d<Date.parse(o)&&(p.id=this.master.newGuid(),p.dateBooked=l.H.getTodayDateWithoutTime(d),p.datePlanned=p.dateBooked,p.isoWeek=l.H.moment(new Date(d)).isoWeek(),p.task=p.task.map(m=>{const g=Object.assign({},m);return g.jobID_PK=p.id||"",g.id=this.master.newGuid(),g}),this.objJobArray.push(p),this.objTaskArray=this.objTaskArray.concat(p.task),e=p)}this.insertJob(this.objJobArray)}}getBookDateInterval(e,a){switch(this.objScheduleData.interval){case 1:e=a>0?e+l.H.onehour*l.H.oneday*a:e;break;case l.H.id2:e=a>0?e+l.H.onehour*l.H.oneday*a*l.H.oneweek:e;break;case l.H.id3:e=a>0?e+l.H.onehour*l.H.oneday*a*l.H.days30:e}return e}addDocToJobTask(){if(this.createJobTaskDoc){const e=localStorage.getItem("createJobTaskDoc"),a=e?JSON.parse(e):null;if(a){const i=this.objTaskArray[0];Array.isArray(a)?(a.forEach(o=>{o.jobID=i.jobID_PK,o.taskID=i.id,o.createdDate=l.H.moment(Date.now()).utc().format()}),this.subs.add=this.assetService.bulkUploadDocumentlist(a).subscribe({next:o=>{o.type===M.hv.Response&&("OK"===o.statusText||"Created"===o.statusText)&&(this.approveEmailAttachment(i.jobID_PK),this.toastrService.success("Document added to task "))},error:()=>{this.isloading=!1,this.toastrService.error("Failed to link document.")}})):(a.jobID=i.jobID_PK,a.taskID=i.id,a.createdDate=l.H.moment(Date.now()).utc().format(),this.subs.add=this.assetService.uploadDocumentlist(a).subscribe({next:o=>{o.type===M.hv.Response&&("OK"===o.statusText||"Created"===o.statusText)&&(this.approveEmailAttachment(i.jobID_PK),this.toastrService.success("Document added to task "))},error:()=>{this.isloading=!1,this.toastrService.error("Failed to link document.")}}))}}}approveEmailAttachment(e){const a=localStorage.getItem("jobTaskEmailAttachment"),i=a?JSON.parse(a):null;i&&(Array.isArray(i)?(i.forEach(o=>{o.updatedDate=l.H.moment(Date.now()).utc().format(),o.jobId=e,o.assetId=this.assetId,o.vrm=this.objAssetData.vrm,o.fleetNumber=this.objAssetData.fleetNumber,o.reject=!1,o.approve=!0,o.isReviewed=!0,o.acceptedBy=this.master.userInfo?.id||"",o.acceptedDate=l.H.moment(Date.now()).utc().format(),o.updatedBy=this.master.userInfo?.id||""}),this.subs.add=this.emailAttachmentService.putBulkEmailAttachment(i).subscribe({next:()=>{this.jobTaskDocAdded=!0,localStorage.removeItem("createJobTaskDoc"),localStorage.removeItem("jobTaskEmailAttachment"),this.toastrService.success("Successfully linked documents.")},error:()=>{this.isloading=!1,this.toastrService.error("Failed to link documents.")}})):(i.updatedDate=l.H.moment(Date.now()).utc().format(),i.jobId=e,i.assetId=this.assetId,i.vrm=this.objAssetData.vrm,i.fleetNumber=this.objAssetData.fleetNumber,i.reject=!1,i.approve=!0,i.isReviewed=!0,i.acceptedBy=this.master.userInfo?.id||"",i.acceptedDate=l.H.moment(Date.now()).utc().format(),i.updatedBy=this.master.userInfo?.id||"",this.subs.add=this.emailAttachmentService.putEmailAttachment(i).subscribe({next:()=>{this.jobTaskDocAdded=!0,localStorage.removeItem("createJobTaskDoc"),localStorage.removeItem("jobTaskEmailAttachment"),this.toastrService.success("Successfully linked document.")},error:()=>{this.isloading=!1,this.toastrService.error("Failed to link document.")}})))}insertJob(e){this.subs.add=this.jobService.createMultipleJobs(e).subscribe({next:()=>{if(this.addDocToJobTask(),this._createMultipleJobs(e),this.jobHistoryDesc="Accepted Booking",this.addJobHistory(!0,"Accepted Booking",e),this.objJobData.backdatedJob){const a=l.H.moment(this.objJobData.actualDateBooked).format("DD-MM-YYYY"),i=l.H.moment(this.objJobData.dateBooked).format("DD-MM-YYYY");this.jobHistoryDesc=`Job backdated from ${a} to ${i} - ${this.objJobData.backdatedReason}`,this.addJobHistory(!1)}},error:()=>{navigator.onLine?this.toastrService.error("Job created failed"):this._createMultipleJobs(e)}})}externalJobsendEmail(){this.subs.add=this.jobService.sendExternaljobEmail(this.objJobData).subscribe({error:e=>this.master._helper.helperLog(`eeee : ${e.message}`)})}_createMultipleJobs(e){this.toastrService.success("Job created successfully"),this.insertTask(!1,!0),this.jobId=e[0].id,this.assetId=e[0].assetID_PK,this.blnShowSearchAsset=!1,this.closeWarrantyListModel()}addWarrantyJobUpdateHistory(){this.isWarrantyJobCreationApproved&&this.isUpdatingJobTask&&(this.jobHistoryDesc=c.bo5.updateAssetAgreJobMsg,this.addJobHistory(!1))}insertTask(e=!1,a=!1){0!==this.objTaskArray.length?this.subs.add=this.jobService.taskService.bulkInsertTask(this.objTaskArray).subscribe({next:()=>{this.addWarrantyJobUpdateHistory()},error:()=>{navigator.onLine?(this.resetUpdatingJobTask(e),this.isloading=!1,this.toastrService.error("Adding task to Jobs failed")):(this.objTaskArray.forEach(i=>
1{this.idb.UpsertData(u.S.jobTasks,{key:i.id,value:i}).catch(n=>this.master._helper.helperLog(`idb - error  ${n}`))}),this.resetUpdatingJobTask(e),this.editJobDetails())},complete:()=>{this.PrepareForExternalWorkshopJobEmail(a),this.isUpdatingJobTask?(this.resetUpdatingJobTask(e),this.toastrService.success("Job task updated successfully")):this.insertRouterNavigation()}}):this.isloading=!1}PrepareForExternalWorkshopJobEmail(e=!1){e&&this.objJobData.status===c.A8Q.planned&&this.isExternal&&this.externalJobsendEmail()}checkAndCallNolansAPI(e=!1){if(e){const a=this.objJobArray.map(i=>i.id);a.length&&(this.subs.add=this.jobService.sendJobToNolansAPI(a).subscribe())}}resetUpdatingJobTask(e=!1){this.isUpdatingJobTask=!1,this.selectedTab=0,this.createAddToJobBtn(),this.isloading=!1,e&&this.editJobDetails()}updateAssetInspecDetails(){this.jobStatus===c.A8Q.cancelled?this.subs.add=this.jobService.taskService.updateInspectionTask(this.objJobData).subscribe({next:()=>this.showToaster(),error:()=>this.showToaster()}):this.showToaster()}showToaster(){this.isloading=!1,this.toastrService.success(this.toasterJobtext)}removeNewlyAddedTask(){const e=[];this.rowDataTask.forEach(a=>{a.isNew||e.push(a)}),this.rowDataTask=e}discardJobChange(){this.isUpdatingJobTask?(this.removeNewlyAddedTask(),this.resetUpdatingJobTask(),this.setServiceTasks()):(this.isloading=!1,this.blnAssetSelected=!1,this.rowDataTask=[],this.jobStatus=c.A8Q.unplanned,this.lblJobHeader=y.DY.CreateJobTasks,this.lblUsageRate="",this.assetDepotName="",this.assetOperatorName="",this.objJobData=new v.XP,this.objScheduleData=new v.qg,this.mode===this.master.datalist.Asset?this.blnShowSearchAsset=!1:(this.blnShowSearchAsset=!0,this.assetId="",this.objAssetData=new C.sP),this.selectedTab=0)}createAddToJobBtn(){this.objJobData.status===c.A8Q.planned||this.objJobData.status===c.A8Q.booked||this.objJobData.status===c.A8Q.onSite||this.objJobData.status===c.A8Q.inprogress?this.master.setFooterBtnInfo("AddToJob",this.addTasktoCreatedJob):this.master.resetFooterBtn(),this.setPrevNxtBtns()}setPrevNxtBtns(){const a=localStorage.getItem(c.iFQ.selectedjobList)?.split(",")??[];this.plannerService.calendarJobList=a;const i=this.plannerService.calendarJobList.length,o=this.plannerService.calendarJobList?.findIndex(n=>n===this.jobId);this.master.footerBtnDisable1=0===o||0===i,this.master.setFooterBtnInfo1("prevJob",this.showJob,"p"),this.master.footerBtnDisable3=this.plannerService.calendarJobList.length-1===o||0===i,this.master.setFooterBtnInfo2("BacktoPlanner",this.routback),this.master.setFooterBtnInfo3("NextJob",this.showJob,"n")}routback(){this.router.navigate(["/workshop/planner"])}insertRouterNavigation(){if(this.isTaskLoading=!0,this.createJobRequest)this.isEmergencyRequestMode&&this.objJobData.jobRequestId?this.redirectToEmergencyJobRequestPOFlow(this.objJobData.jobRequestId):this.redirectToJobReqListPage();else if(this.createJobFromScheduleDeleteJob)this.router.navigate(["/assets/asset-list/asset",{id:this.assetId,process:c.YMJ.CreatedGapFillingJob}]);else if(this.createJobTaskDoc){const e=setInterval(()=>{this.jobTaskDocAdded&&(clearInterval(e),this.router.navigate(["/documents/new"]))},l.H.onesec)}else"Asset"===this.mode?this.router.navigate(["/assets/asset-list/newbooking",{mode:this.mode,jobID:this.jobId}]):(this.isloading=!1,this.isTaskLoading=!1,this.inspecTask=this.rowDataTask?.filter(e=>1===e.serviceType&&1===e.subType),0===this.inspecTask.length&&this.editJobDetails(),this.router.navigate(["/workshop/planner/newbooking",{mode:this.mode,jobID:this.jobId}]))}redirectToJobReqListPage(){this.router.navigate(["/assets/job-request-list"])}updateJob(e){if(!this.requiresOdometerForWorkflowStep()||this.hasSavedOdometerReading&&!this.odometerReadingEdited){switch(e){case c.A8Q.inprogress:if(!this.master.features.includes(c.G7b.wrkshp_mark_in_progrs))return this.toastrService.error(y.B5.sorryudonthavePerm),void(this.jobHistoryDesc="");break;case c.A8Q.booked:if(!this.master.features.includes(c.G7b.wrkshp_confm_booking))return this.toastrService.error(y.B5.sorryudonthavePerm),void(this.jobHistoryDesc="");break;case c.A8Q.onSite:if(!this.master.features.includes(c.G7b.wrkshp_mark_on_site))return this.toastrService.error(y.B5.sorryudonthavePerm),void(this.jobHistoryDesc="");break;case c.A8Q.completed:if(!this.checkUserHasLocation())return}if(!this.isStatusButtonClicked){if(0===this.rowDataTask.length&&e!==c.A8Q.cancelled)return this.toastrService.warning("Please add task to update status"),void(this.jobHistoryDesc="");if(e===c.A8Q.inprogress&&void 0!==this.objJobData.usageRate){if(this.objJobData.usageRate<0||!this.arrivedAtVal||"00:00"===this.arrivedAtVal)return void this.toastrService.warning(this.toasterText);if(this.objJobData.usageRate&&(Number(this.objJobData.usageRate)>l.H.maxNumber||Number(this.objJobData.usageRate)<0))return this.toastrService.warning("Please enter usage rate greater than or equal to min (0) & less than or equal to max (9999999)"),void(this.jobHistoryDesc="");if(this.objJobData.usageRate&&this.objAssetData.usageRate&&Number(this.objAssetData.usageRate)>Number(this.objJobData.usageRate))return this.toastrService.warning("Please enter usage rate greater than or equal to asset usage rate"),void(this.jobHistoryDesc="");const a=this.master.allworkshoplist.find(o=>o.id===this.objJobData.workshopID)?.value||"";this.assetUsage.odometerEnd=this.objJobData.usageRate,this.assetUsage.source=`${a}`,this.assetUsage.id=this.master.newGuid(),this.assetUsage.createdBy=this.master.userInfo?.id||"",this.assetUsage.updatedBy=this.master.userInfo?.id||"",this.assetUsage.assetID_PK=this.objJobData?.assetID_PK?this.objJobData.assetID_PK:"",this.assetUsage.usageRecordDate=l.H.moment(new Date).utc().format()}if(e===c.A8Q.completed||e===c.A8Q.awaitingSignoff){if(!this.validateJobCompletionStatus(e))return;this.updateInvoiceDetails()}this.isStatusButtonClicked=!0,this.isBookingDataUpdated=!1,this.isloading=!0,this.objJobData.customerReference=this.objScheduleData.customerReference,this.objJobData.agreement=this.objScheduleData.agreement,this.updateJobStatus(e),this.createAddToJobBtn(),this.InvoiceJob.id=this.objJobData.invoiceID||"",this.objJobData.updatedBy=this.master.userInfo?.id||"",this.objJobData.updatedDate=this.getNowUTC(),this.objJobData.isUpdateFromWeb=!0,this.storeJob(this.objJobData,!0,()=>{if(this.taskUpdated){const a=this.rowDataTask.filter(i=>i.formanUpdated);this.insertTaskAlone([...a]).then(()=>
1this.resetFormanUpdatedModel()).catch(()=>this.resetFormanUpdatedModel())}})}}else this.saveRequiredOdometer(()=>this.updateJob(e))}resetFormanUpdatedModel(){this.isBookingDataUpdated=!1,this.taskUpdated=!1,this.rowDataTask.forEach(e=>{e.formanUpdated&&(e.formanUpdated=!1)})}updateInvoiceDetails(){const e=this.objJobData.task;if(e&&e.length>0&&e.find(a=>a.status!==l.H.id3&&a.status!==l.H.id4))return this.jobHistoryDesc="",this.toastrService.warning("Please complete or cancel active tasks"),!0;if(this.InvoiceJob.jobID=this.objJobData.id,this.InvoiceJob.jobNumber=this.objJobData.jobNumber,this.InvoiceJob.jobRef=this.objJobData.customerReference,this.InvoiceJob.invoiced=!1,this.InvoiceJob.documentID="",this.InvoiceJob.invoiceDueDDate=l.H.moment(Date.now()).utc().add(l.H.days30,"days").format(),this.InvoiceJob.InvoiceDate=l.H.moment(Date.now()).utc().format(),this.InvoiceJob.totalTasksCost=0,this.InvoiceJob.invoiceAmount=0,this.InvoiceJob.totalVAT=0,this.InvoiceJob.assetID_PK=this.objJobData.assetID_PK,this.InvoiceJob.assetType=this.objAssetData.assetType||l.H.zero,this.InvoiceJob.invoiceFrom=this.objJobData.workshopID,this.InvoiceJob.invoiceTo=this.objJobData.customerID,this.InvoiceJob.vrm=this.objAssetData.vrm,this.InvoiceJob.make=this.objAssetData.make,this.InvoiceJob.range=this.objAssetData.range,this.InvoiceJob.yourRef=this.master.userInfo?.id||"",this.InvoiceJob.task=[],this.InvoiceJob.createdBy=this.master.userInfo?.id||"",this.InvoiceJob.createdDate=l.H.moment(Date.now()).utc().format(),this.InvoiceJob.updatedBy=this.master.userInfo?.id||"",this.InvoiceJob.updatedDate=l.H.moment(Date.now()).utc().format(),this.InvoiceJob.notes=this.objJobData.jobComment??this.objJobData.notes,e&&e.length>0){const a=e.filter(i=>i.status===l.H.id3);a&&a.length>0&&(this.InvoiceJob.task=a.map(i=>{const o=new v.t6;o.id=i.id,o.name=i.name,o.eventName=l.H.getTaskType(i.serviceType,i.subType),o.parts=[],o.type=i.type,o.serviceType=i.serviceType,o.serviceID=i.serviceID,o.foremanSign=i.foremanSign,o.foremanSigned=i.foremanSigned,o.foremanID=i.foremanID,o.technicianSigned=!0,null==i.labourRate&&(i.labourRate=0),null==i.plannedHours&&(i.plannedHours=0),o.plannedHours=this.getEffectiveLabourHours(i);const n=this.objJobData.jobRequestNumber&&c.THj.Zero||c.THj.Standard;o.labourRate=l.H.convertToMoney(i.labourRate),o.netLabourCost=l.H.convertToMoney(i.labourRate*o.plannedHours),o.taxRate=this.master.getTaxPercent(n);let d=l.H.convertToMoney(o.netLabourCost*(o.taxRate/l.H.hundred));return o.total=l.H.convertToMoney(o.netLabourCost+d),i.parts&&i.parts.length>0&&(o.parts=i.parts.filter(p=>!1===p.isDelete).map(p=>{const m=new v.HL;return m.id=p.id,m.partType=p.partType,m.partNumber=p.partNumber,m.partName=p.partName,m.qunatity=p.quantity?p.quantity:1,m.unit=this.master.partUnit.find(g=>g.id===(p.unit||1))?.[this.master.displayLang],m.unitCost=p.unitCost?p.unitCost:1,m.Tax=l.H.convertToMoney(this.master.getTaxPercent(p.taxRate)/l.H.hundred),m.netPartCost=l.H.convertToMoney(p.quantity*p.unitCost),m.taxRate=this.master.getTaxPercent(p.taxRate),this.InvoiceJob.totalVAT=l.H.convertToMoney(this.InvoiceJob.totalVAT+m.Tax*m.netPartCost),this.InvoiceJob.invoiceAmount=l.H.convertToMoney(this.InvoiceJob.invoiceAmount+m.netPartCost),m.total=l.H.convertToMoney(m.netPartCost+m.Tax*m.netPartCost),this.InvoiceJob.totalTasksCost=l.H.convertToMoney(this.InvoiceJob.totalTasksCost+m.total),m})),null==o.labourRate&&(o.labourRate=0),this.InvoiceJob.invoiceAmount=l.H.convertToMoney(this.InvoiceJob.invoiceAmount+o.netLabourCost),this.InvoiceJob.totalVAT=l.H.convertToMoney(this.InvoiceJob.totalVAT+d),this.InvoiceJob.totalTasksCost=l.H.convertToMoney(this.InvoiceJob.invoiceAmount+this.InvoiceJob.totalVAT),this.totalCost=this.InvoiceJob.invoiceAmount,o}))}return!1}assignCompletedWorkflowStatus(e){if(e.status!==c.A8Q.completed)return;const a=this.workFlowStatusList.find(i=>Number(i?.jobStatusMapId)===c.A8Q.completed);a?.id&&(e.workflowStatusID=a.id)}storeJob(e,a=!1,i){this.assignCompletedWorkflowStatus(e),this.addTaskEnginnerIdsToJob(e.task);const o=()=>{this.isStatusButtonClicked=!1,a&&this._updateJobStatus(e.status),i&&i()};if(this.addJobHistory(!1),this.checkAndAddNoRescheduleReason(),navigator.onLine)this.subs.add=this.jobService.updateJob(e).subscribe({next:()=>{this.jobStatus=e.status,this.checkAndChangeJobReqstStatus(),this.objJobData=e,this.lastValidWorkflowStatusID=e.workflowStatusID,this.addWorkflowStatusHistory(e),this.cancelAllTheTask(),o(),this.checkAndGenerateInspPdf(e)},error:n=>{this.isloading=!1,this.isStatusButtonClicked=!1,this.toastrService.error("Job update failed!"),i&&i(n)}});else{const n={key:e.id,value:e};n.value.offline="updated",this.idb.UpsertData(u.S.job,n).then(()=>{this.jobStatus=e.status,this.objJobData=e,this.lastValidWorkflowStatusID=e.workflowStatusID,this.addWorkflowStatusHistory(e),this.cancelAllTheTask(),o()}).catch(d=>{this.isloading=!1,this.isStatusButtonClicked=!1,this.master._helper.helperLog(`idb - error ${d}`),i&&i(d)})}}
1checkAndChangeJobReqstStatus(){if(this.objJobData.jobRequestId&&this.objJobData.status===c.A8Q.completed){const e={jobRequetId:this.objJobData.jobRequestId,completedTime:l.H.moment(new Date).utc().format()};this.jobService.UpdateJobRequestAfterJobComplete(e).subscribe({next:()=>{l.H.helperLog("Successfully changed the job request status")},error:()=>{l.H.helperLog("Failed to change the job request status")}})}}rebuildJobPdf(){this.isloading=!0,this.checkAndGenerateInspPdf(this.objJobData,!0).then(e=>{this.objJobData.documentId=e.documentId,this.objJobData.maintenanceRepairDocId=e.maintenanceRepairDocId,this.toastrService.success("Rebuild pdf completed")}).catch(e=>{this.helper.helperLog("Error while rebuilding job pdf"),this.helper.helperLog(e.message)}).finally(()=>{this.isloading=!1})}sendRechargePdfEmail(){this.jobService.sendRechargePdfEmail({jobRequetId:this.jobId,vrm:this.objJobData.vrm,jobNumber:this.objJobData.jobNumber,organisationId:this.objJobData.parentOrgID,customerId:this.objAssetData.operatorOrgID}).subscribe({next:()=>{l.H.helperLog("Successfully triggered the emai")},error:()=>{l.H.helperLog("Failed to trigger email")}})}checkAndGenerateInspPdf(e,a=!1,i=!1){return new Promise((o,n)=>{e.status!==c.A8Q.completed||e.documentId&&!a?(this.helper.helperLog("Rebuilding pdf is not triggered"),this.helper.helperLog(`Job Status - ${e.status===c.A8Q.completed}, documentId - ${e.documentId},rebuildPdf Flag - ${a}`),o(new v.XP)):this.subs.add=this.jobService.createInspectionTaskPdf(e,a).subscribe({next:d=>{i||this.bindJobInfoAlone(d),a||(this.isloading=!1,this.enableBackdateAction=!0),this.sendRechargePdfEmail(),o(d)},error:d=>{n(d)}})})}_updateJobStatus(e){if(e!==c.A8Q.completed)if(this.objJobData.status===c.A8Q.inprogress&&Number(this.objAssetData.usageRate)<Number(this.objJobData.usageRate))if(navigator.onLine)this.createAssetUsage(e);else{const a={key:this.assetUsage.id,value:this.assetUsage};a.value.offline="new",this.idb.UpsertData(u.S.wsAssetUsage,a).then(()=>{this.updateAssetData(e)}).catch(i=>this.master._helper.helperLog(`idb - error ${i}`))}else this.isloading=!1;else this.isloading=!0,this.InvoiceJob.offline=u.vQ.new,this.subs.add=this.jobService.invoiceservice.createInvoice(this.InvoiceJob).subscribe({next:()=>{this.getLatestAssetFromDB().then(a=>{a&&(this.objAssetData=a,this.storeAssetToLocalDB(u.vQ.new),this.getLatestUsageAsset(e))}).catch()},error:()=>{navigator.onLine?(this.isloading=!1,this.toastrService.success(this.toasterJobtext),this.toastrService.warning("Failed to create Charge Card")):(this.InvoiceJob.offline=u.vQ.created,this.idb.UpsertData(u.S.invoice,{key:this.InvoiceJob.id,value:this.InvoiceJob}).then(()=>{this.isloading=!1}).catch(i=>this.master._helper.helperLog(`${i} idb - insert - invoice - failed ${this.InvoiceJob.id}`)).finally(()=>this.editJobDetails()),this.isloading=!1)},complete:()=>{this.objJobData.documentId&&this.editJobDetails()}});this.getJobStatus(this.objJobData.status)}createAssetUsage(e){this.subs.add=this.assetService.createAssetUsage(this.assetUsage).subscribe({next:a=>{a&&!Array.isArray(a)&&(this.isloading=!1)},error:()=>{this.toastrService.error(y.B5.AddUsageFailed),this.isloading=!1}})}cancelJob(e){this.checkUserHasLocation()&&(this.master.isSuperAdmin||!this.master.isSuperAdmin&&this.master.features.includes(c.G7b.wrkshp_cancel_job)?(this.isTaskCancel=!1,this.showModal(e),this.cancellationReason=""):this.toastrService.error(y.B5.sorryudonthavePerm))}checkUserHasLocation(){const e=this.master.userInfo?.mappedOrgIDs;return!!(this.master.isSuperAdmin||e?.includes(this.master.navSelectedOrgID)||this.master.checkTopMostParentLevelAccess())||(this.toastrService.warning("The selected organisation is not assigned to user location. Please add it"),!1)}addCancelReason(e){this.isTaskCancel?(this.task.cancellationReason=this.cancellationReason,this.task.taskCancelledDate=l.H.moment(Date.now()).utc().format(),this.modalService.close(e),this.updateTask(c.e1J.cancelled),this.cancellationReason=""):(this.objJobData.cancellationReason=this.cancellationReason,this.modalService.close(e),this.updateJob(c.A8Q.cancelled),this.cancellationReason="")}getTaskById(){this.task=this.rowDataTask.find(e=>e.id===this.selectedTaskSvc.taskID),this.copyClassificationToTask(this.task,this.selectedTaskSvc)}updateTask(e){if(this.objJobData.status===c.A8Q.completed||this.objJobData.status===c.A8Q.cancelled)return void this.toastrService.warning("Job is already completed.");
1if(this.inValidUser())return;this.isloading=!0;const a=this.task.status;this.task.status=e,a===c.e1J.notStarted&&(this.task.taskStartDate=l.H.moment(new Date).utc().format(),this.task.taskStartedBy=this.master.userInfo?.id||""),this.task.updatedDate=l.H.moment(new Date).utc().format(),this.task.updatedBy=this.master.userInfo?.id||"",e===c.e1J.cancelled&&this.updateTaskStatus(e)}updateTaskStatus(e){const a={key:this.task.id,value:this.task};a.value.offline=u.vQ.updated,this.subs.add=this.taskService.updateTask(this.task).subscribe({next:()=>{this.objJobData.updatedDate=this.task.updatedDate,this.objJobData.isUpdateFromWeb=!0,this.objJobData.updatedBy=this.task.updatedBy,this.setJobUpdatedTime(!0,this.objJobData),this.task=a.value,this.isloading=!1,this.toastrService.success(this.taskUpdateSuccess)},error:()=>{this.isloading=!1,this.toastrService.error(this.offlineDataFail)},complete:()=>{e===c.e1J.cancelled&&(this.editJobDetails(),this.isloading=!1)}})}clickCancel(e){this.modalService.close(e)}onReasonChange(e){this.blnupdateCancelReason="change"===e&&this.oldCancellationReason!==this.objJobData.cancellationReason,"change"!==e&&(this.blnupdateCancelReason=!0)}setServiceTasks(){this.loadTaskService({maintenanceService:this.maintenanceService,inspectionService:this.inspectionService,immediateInspecService:this.immediateInspecService,usage:this.usage})}scrollToTopServiceTasks(){$(".mat-tab-body-content").scrollTop(0)}assignNewTaskId(){this.rowDataTask.forEach(e=>{e.id&&(e.isNew=!0,e.id=this.master.newGuid(),e.status=c.e1J.notStarted,e.createdDate=l.H.moment(new Date).utc().format(),e.updatedDate=l.H.moment(new Date).utc().format(),e.createdBy=this.master.userInfo?.id||"",e.updatedBy=this.master.userInfo?.id||"",e.offline=u.vQ.created)})}reBookJob(){this.assignNewTaskId(),this.jobId="",this.setServiceTasks(),this.lblJobHeader=y.DY.CreateJobTasks,this.jobStatus=c.A8Q.unplanned,this.selectedTab=0,this.objJobData.id="",this.objJobData.cancellationReason="",this.objJobData.dateCancelled="",this.objJobData.dateBooked="",this.objJobData.datePlanned="",this.objJobData.dateInProgress="",this.objJobData.dateOnSite="",this.objJobData.dateCompleted="",this.objJobData.snapToExistingJobs=!1,this.objJobData.fixToISOWeek=!1,this.objScheduleData.recurringEvent=!1,this.objScheduleData.every=1,this.objScheduleData.interval=1,this.scheduleId="",this.backdatedReason="",this.objJobData.supervisorSigned=!1,this.objJobData.supervisorSign="",this.objScheduleData.backdatedReason="",this.objScheduleData.backdatedJob=!1,this.getJobStatus(this.jobStatus),this.assignJobValuesFromAsset()}updateJobStatus(e){switch(e){case c.A8Q.planned:this.objJobData.status=c.A8Q.planned;break;case c.A8Q.booked:this.objJobData.status=c.A8Q.booked;break;case c.A8Q.awaitingSignoff:this.objJobData.status=c.A8Q.awaitingSignoff;break;case c.A8Q.onSite:this.objJobData.status=c.A8Q.onSite,this.objJobData.dateOnSite=this.getNowUTC(),this.objAssetData.status=l.H.id2;break;case c.A8Q.inprogress:this.objJobData.status=c.A8Q.inprogress,this.objJobData.dateInProgress=this.getNowUTC();const a=this.arrivedAtVal?.split(":"),i=Number(a[0]),o=Number(a[1]),n=new Date;n.setHours(i),n.setMinutes(o),n.setSeconds(0),n.setMilliseconds(0),this.objJobData.arrivedAt=l.H.moment(n).utc().format(),this.objAssetData.status=l.H.id2;break;
1case c.A8Q.cancelled:this.objJobData.status=c.A8Q.cancelled,this.objJobData.workflowStatusID=l.H.zero,this.objJobData.dateCancelled=this.getNowUTC(),this.checkAssetWorkShopJobs(1);break;case c.A8Q.completed:this.objJobData.status=c.A8Q.completed,this.objJobData.invoiceID=this.master.newGuid(),this.objJobData.dateCompleted=this.getNowUTC(),this.checkAssetWorkShopJobs(1)}}getLatestUsageAsset(e){e===c.A8Q.completed&&this.objJobData.assetID_PK?this.subs.add=this.assetService.getLatestUsagebyAssetID(this.objJobData.assetID_PK).subscribe(a=>{if(a){const i=a.odometerEnd,o=this.objJobData.task?.filter(n=>!1===n.isDelete);this.updateServiceUsage(i,e,o)}else this.isloading=!1}):this.isloading=!1}updateServiceUsage(e,a,i){if(this.objAssetData?.serviceUsages&&this.objAssetData?.serviceUsages?.length>0)for(const o of this.tblUsage){const n=this.objAssetData.serviceUsages?.findIndex(d=>d.serviceID===o.id);-1!==n?(this.objAssetData.serviceUsages[n].usage=e,this.objAssetData.serviceUsages[n].lastServiceUsageDate=this.getNowUTC()):this.objAssetData.serviceUsages.push({serviceID:o.id,usage:e,alertTriggeredDate:"",lastServiceUsageDate:this.getNowUTC()})}else if(this.tblUsage.length>0){this.objAssetData.serviceUsages=[];for(const o of i)this.pushServiceUsage(e,o)}this.updateAssetData(a)}pushServiceUsage(e,a){const i=this.tblUsage.find(o=>o.id===a.serviceID);i&&this.objAssetData.serviceUsages.push({serviceID:i.id,usage:e,alertTriggeredDate:"",lastServiceUsageDate:this.getNowUTC()})}afterAssetUpdated(e){e===c.A8Q.completed?(this.toastrService.success(this.toasterJobtext),this.toastrService.success("Charge Card created successfully")):this.toastrService.success(this.toasterJobtext)}updateAssetData(e){this.subs.add=this.assetService.updateAsset(this.objAssetData).subscribe({next:()=>{this.afterAssetUpdated(e),this.storeAssetToLocalDB(u.vQ.new)},error:()=>{navigator.onLine||(this.storeAssetToLocalDB(u.vQ.updated),this.afterAssetUpdated(e))}})}getChecksheetDetail(){var e=this;return(0,w.A)(function*(){if(e.taskChecksheetIDs?.length)if(e.isloading=!0,navigator.onLine)e.subs.add=e.checksheetService.getByCheckSheetIDList(e.taskChecksheetIDs).subscribe({next:a=>{a?.length&&(e.taskChecksheetList=a),e.isloading=!1},error:()=>{e.isloading=!1,l.H.helperLog("Error while getting check sheet list")}});else{e.isloading=!1;const a=yield e.idb.getAll(u.S.serviceChecksheet);e.filterAndAddSvcChecksheet(a)}else e.isloading=!1})()}filterAndAddSvcChecksheet(e){e.forEach(a=>{a?.length&&a.forEach(i=>{this.taskChecksheetIDs.indexOf(i.id)>-1&&this.taskChecksheetList.push(i)})})}getPartsCount(e){this.partsData=e||[],this.setParts()}setJobCompletingSession(){this.objJobData.dayFilter||(this.objJobData.dayFilter=c.Qro.AllDay)}bindJobInfoAlone(e){this.objJobData=e,this.hasSavedOdometerReading=!!e.isOdometerReadingTaken,this.odometerReadingEdited=!1,this.populateWorkFlowStatus(),this.updateWorkflowStatusPermission();const a=this.master.allworkshoplist.find(i=>i.id===this.objJobData.workshopID)?.type;this.isExternal=a!==c.YMJ.Workshop,this.jobStatus=this.objJobData.status,this.getJobStatus(this.jobStatus),this.currJobWorkshop=this.objJobData.workshopID,this.prevJobWorkshop=this.objJobData.workshopID,this.setSupervisorSign(this.objJobData.supervisorSign),this.createAddToJobBtn(),this.onJobWorkshopLocationChange(this.objJobData.locationCategoryId),this.scheduleId=this.objJobData.scheduleID,this.arrivedAtVal=this.getArrivedAtVal(this.objJobData.arrivedAt),this.assetId=this.objJobData.assetID_PK,this.objScheduleData.customerReference=this.objJobData.customerReference,this.objScheduleData.agreement=this.objJobData.agreement,this.objScheduleData.backdatedJob=!1,this.objJobData.workflowStatusID=this.objJobData.workflowStatusID,this.dateBooked||(this.dateBooked=this.objJobData.dateBooked),this.savedWorkflowStatusID=this.objJobData.workflowStatusID,this.lastValidWorkflowStatusID=this.objJobData.workflowStatusID,this.prepareJobHistoryColDef(),this.getParentOrgIdsList(),this.setParentOrgControlStatus(),this.enableBackDatingReasonFieldEdit=!this.objJobData.backdatedJob,this.enableBackDatingReasonFieldEdit&&(this.isNewWorkshopBooking=!1),this.backdatedReason=this.objJobData.backdatedReason}setJobAwaitingSignOff(){this.objJobData.status===c.A8Q.awaitingSignoff&&this.objJobData.supervisorSign&&this.objJobData.dateCompleted?this.isAllTasksCompleted()&&(l.H.helperLog(`Job Status Changed to completed from ${this.objJobData.status}
1`),this.objJobData.status=c.A8Q.completed,this.bindJobInfoAlone(this.objJobData)):(this.objJobData.status===c.A8Q.planned||this.objJobData.status===c.A8Q.booked||this.objJobData.status===c.A8Q.onSite||this.objJobData.status===c.A8Q.inprogress)&&this.isAllTasksCompleted()&&(l.H.helperLog(`Job Status Changed to awaitingSignoff from ${this.objJobData.status}`),this.objJobData.status=c.A8Q.awaitingSignoff,this.bindJobInfoAlone(this.objJobData))}getNotCancelledTaskServiceIDs(){const e=[];return this.objJobData.task?.length&&e.push(...this.objJobData.task.filter(a=>a.status!==c.e1J.cancelled).map(a=>a.serviceID)),e}isAllTasksCompleted(){let e=!1;return this.objJobData.task?.length&&(e=this.objJobData.task?.every(a=>a.status===c.e1J.completed)),e}bindJobDetails(e){e?.jobTask?.job&&(this.bindJobInfoAlone(e.jobTask.job),this.setJobCompletingSession(),this.taskDurationList=e.taskDurations,this.bindTasks(e.jobTask.tasks),this.setParts(),this.setJobAwaitingSignOff(),this.getScheduleData(e.schedule),this.getPartsCount(e.parts),this.getAssetDetails(e.asset),this._GetDefectList(e.defects),this.getAdvisoryDefects(e.jobAdvisory),this.getJobDefects(e.jobDefects),this.getContract(this.objJobData.customerID),this.getDefectCost(e.defectCostResponses))}getParentOrgIdsList(){this.parentOrgIdsList=[];let e=this.objJobData.workshopID;for(this.parentOrgIdsList.push(e);e;)e=this.master.masterOrgList.find(a=>a.id===e)?.parentOrgID,e&&this.parentOrgIdsList.push(e);this.jobId&&(this.setCusotmrOrgName(),this.addJobReqstCustomer())}addJobReqstCustomer(){this.jobId&&this.objJobData.jobRequestNumber&&-1===this.CustomerList.findIndex(a=>a.id===this.objJobData.customerID)&&this.CustomerList.push({id:this.objJobData.customerID,value:this.master.getCompanyName(this.objJobData.customerID)})}setCusotmrOrgName(){this.parentOrgIdsList.forEach(e=>{-1===this.CustomerList.findIndex(i=>i.id===e)&&this.CustomerList.push({id:e,value:this.master.getCompanyName(e)})})}setParentOrgControlStatus(){this.canParentOrgControl=!!this.parentOrgIdsList.includes(this.master.navSelectedOrgID)}getTaskDuration(e){if(e?.length){const a=e[0];-1===this.taskDurationList.indexOf(o=>o.id===a.id)&&this.taskDurationList.push(a)}}getTasktime(){let e=0;this.totalTimeTaken=l.H.convertMinsToHrsMins(e),this.taskDurationList?.length?(this.taskDurationList.forEach(a=>{e=[a].reduce((o,n)=>o+n.taskDuration,e)}),this.totalTimeTaken=l.H.convertMinsToHrsMins(e/l.H.sec),this.isTaskLoading=!1):this.isTaskLoading=!1}getTaskChecksheetIDs(e){this.taskChecksheetIDs=[],e?(e.forEach(a=>{a?.checkSheet?.forEach(i=>{i.id&&-1===this.taskChecksheetIDs.indexOf(i.id)&&this.taskChecksheetIDs.push(i.id)})}),this.getChecksheetDetail()):this.isloading=!1}
1editJobDetails(e=!1,a=!0){this.isloading=a;const i=e?1e3:0;i&&l.H.helperLog(`Delay - ${i}`),setTimeout(()=>{this.subs.add=this.taskService.getJobDetails(this.jobId).subscribe({next:o=>{this.enableBackdateAction=!0,o&&!Array.isArray(o)&&(this.rowDataTask=[],this.bindJobDetails(o))},error:()=>{this.isloading=!1,this.enableBackdateAction=!0},complete:()=>this._editJobDetailsComplete()})},i)}_editJobDetailsComplete(){this.loadPurchaseOrderTriggerState(),this.resolveMissingJobPdf();const e=this.objJobData.invoiceID||"";this.objJobData.status===c.A8Q.completed&&e?navigator.onLine?this.subs.add=this.jobService.invoiceservice.getInvoicebyID(e).subscribe(a=>{Array.isArray(a)||(this.master.jobInvoiced=a,this.InvoiceJob.invoiceAmount=a.invoiceAmount)}):this.idb.getData(u.S.invoice,e).then(a=>{a&&(this.master.jobInvoiced=a)}).catch(a=>this.master._helper.helperLog(`idb - invoice - fetch - error  ${e} ${a}`)):this.master.jobInvoiced={}}loadPurchaseOrderTriggerState(){this.objJobData?.id?this.subs.add=this.jobService.GetPurchaseOrderIssuedState(this.objJobData.id).subscribe({next:e=>{this.poTriggerReached=!!e?.reached,this.poWorkshopEmail=e?.email||"",this.poNumber=e?.poNumber||""},error:()=>{this.poTriggerReached=!1}}):this.poTriggerReached=!1}sendPurchaseOrderToWorkshop(){!this.objJobData?.id||!this.poTriggerReached||this.poSendBusy||(this.poSendBusy=!0,this.subs.add=this.jobService.TriggerPurchaseOrderIssuedEmail(this.objJobData.id).subscribe({next:e=>{this.poSendBusy=!1,e?.sent?(this.poNumber=e.poNumber||this.poNumber,this.poWorkshopEmail=e.email||this.poWorkshopEmail,this.toastrService.success(`PO ${this.poNumber} sent to ${this.poWorkshopEmail}`)):this.toastrService.error(e?.message||"The PO email could not be sent.")},error:()=>{this.poSendBusy=!1,this.toastrService.error("The PO email could not be sent.")}}))}resolveMissingJobPdf(){this.isResolvingMissingJobPdf||!this.objJobData?.id||this.objJobData.status!==c.A8Q.completed||this.objJobData.documentId||(this.isResolvingMissingJobPdf=!0,this.checkAndGenerateInspPdf(this.objJobData,!1,!0).then(e=>{e?.documentId&&(this.objJobData.documentId=e.documentId,this.objJobData.maintenanceRepairDocId=e.maintenanceRepairDocId)}).catch(e=>this.helper.helperLog(`Failed to resolve the missing job PDF - ${e}`)).finally(()=>{this.isResolvingMissingJobPdf=!1,this.cdr.detectChanges()}))}bindTasks(e){this.objJobData.task=e,this.getTaskChecksheetIDs(e),this.getTasktime(),this.agGridTaskRowRender(this.objJobData.task),this.jobId&&this.loadJobCostChargesGridData()}getAssetDetails(e={}){e&&Object.keys(e).length?this._getAssetDetails(e):(this.isloading=!0,navigator.onLine||"Asset"===this.mode?this.getLatestAssetFromDB().then(a=>{a&&(this._getAssetDetails(a),this.storeAssetToLocalDB(u.vQ.new))}).catch(()=>this.isloading=!1):this.idb.getData(u.S.asset,this.assetId).then(a=>{this._getAssetDetails(a)}))}getLatestAssetFromDB(){return new Promise((e,a)=>{this.subs.add=this.assetService.getAssetById(this.assetId).subscribe({next:i=>{i&&e(i)},error:a})})}storeAssetToLocalDB(e){const a={key:this.objAssetData.id,value:this.objAssetData};a.value.offline=e,this.idb.UpsertData(u.S.asset,a)}getMappedDateValues(){this.udFields.forEach(e=>{const a=this.mappedKeydate.find(i=>i.id===e.id);a&&(a.value=e.response)})}_getAssetDetails(e){if(this.objAssetData=e,this.assetService.updateUsageInDesc(this.objAssetData,this.assetUsageInfo),this.objJobData.usageRate=this.jobId&&null!=this.objAssetData?.usageRate?Math.ceil(this.objAssetData.usageRate):this.objJobData?.usageRate?Math.ceil(this.objJobData?.usageRate):this.objAssetData?.usageRate?Math.ceil(this.objAssetData?.usageRate):0,this.lblUsageRate=this.objJobData.usageRate,this.objAssetData?.userDefined.length>0){const i=this.objAssetData.userDefined.findIndex(o=>o.orgId===this.master.parentOrgId);-1!==i&&(this.udFields=this.objAssetData.userDefined[i].responseList,this.mappedKeydate.length&&this.getMappedDateValues())}this.initAssetTaskAPI();const a=this.objAssetData?.model;this.lblMake=`${this.master.getMake(this.objAssetData)} ${this.master.getRange(this.objAssetData)} ${a}`,this.isloading=!1,this.blnAssetSelected=!0,this.assignJobValuesFromAsset(),this.assetOperatorName=this.master.getCompanyName(this.objAssetData?.operatorOrgID),this.assetDepotName=this.master.getCompanyName(this.objAssetData?.depotOrgID)}validateAlternateDate(e){let o,a=new Date,i=new Date;if(a=new Date(a.getFullYear(),a.getMonth(),a.getDate(),0,0,0,0),o=new Date(this.alternateDate),o=isNaN(o)?null:o,o&&(i=new Date(o.getFullYear(),o.getMonth(),o.getDate(),0,0,0,0)),"compare"===e){if(o&&a>i)return void this.toastrService.warning("Alternate Date cannot be earlier than today");this.blnAlternate=!!o}else{if(!this.jobService.checkJobReschedulePermission())return void this.toastrService.warning(this.master.datalist.NoRescheduleJobPermission);if(!o||a>i)return void this.toastrService.warning(this.toasterText);this.objJobData.actualDateBooked=l.H.getTodayDateWithoutTime(this.objJobData.dateBooked),this.objJobData.dateBooked=l.H.getTodayDateWithoutTime(i),this.objJobData.datePlanned=l.H.getTodayDateWithoutTime(i),this.objJobData.isoWeek=l.H.moment(new Date(i)).isoWeek(),this.objJobData.isMoveFromNoShow=!0,this.blnAlternate=!1,this.alternateDate="",this.jobHistoryDesc="Updated Job Alternate Date",this.updateJob(c.A8Q.planned)}}showModal(e){this.modalService.open(e)}
1checkAndShowPOCreateSuccessPopup(){try{const e=localStorage.getItem(c.lOb.poCreateSuccessData);e&&(this.poSuccessData=JSON.parse(e),localStorage.removeItem(c.lOb.poCreateSuccessData),this.poSuccessData&&this.modalService.open(this.poCreateSuccessModalName))}catch{localStorage.removeItem(c.lOb.poCreateSuccessData)}}closePOCreateSuccessModal(){this.modalService.close(this.poCreateSuccessModalName),this.poSuccessData=null}openCreatedPODocument(){this.poSuccessData?.poDocUrl&&this.master.getBolb(this.poSuccessData.poDocUrl)}showAssetList(e){"showAsset"===e&&this.assetService.getAssetRowData(!0),this.showModal(e)}getSelectedAsset(e){e&&(this.objAssetData=e,this.assetId=this.objAssetData.id||"",this.initAssetTaskAPI(),this.lblMake=`${this.master.getMake(this.objAssetData)} ${this.master.getRange(this.objAssetData)} ${this.objAssetData.model}`,this.lblUsageRate=this.objJobData?.usageRate?this.objJobData?.usageRate:this.objAssetData?.usageRate,this.blnAssetSelected=!0,this.assignJobValuesFromAsset(),this.getAllJobsByWorkshop(this.assetId),this.getAllDefectList())}displayAddTask(e){this.jobStatus>=c.A8Q.completed?this.toastrService.warning("Job is already completed status"):this.jobStatus===c.A8Q.cancelled?this.toastrService.warning("Job is already cancelled status"):this.rowDataTask?.length>0&&this.rowDataTask[0].subType===l.H.id5?this.toastrService.warning("As immedidate inspection more than one task can't be added"):this.assetInfo?(this.taskTabIndex=this.isDefectTask?l.H.id2:0,this.showModal(e)):this.toastrService.warning("Please select asset & try again")}updateTaskGrid(e){this.isDefectTask=!1,this.taskTabIndex=1,e.length>0&&this.jobId?this.editJobDetails(!1,!1):this.agGridTaskRowRender(e)}updateDefectTask(e){this.isDefectTask=e,this.taskTabIndex=1}isEroyOrganization(){const e=[c.XMG.devEroy,c.XMG.uatEroy,c.XMG.liveEroy],a=this.master.selectedOrg?.id,i=this.master.selectedOrg?.parentOrgID;return e.includes(a)||e.includes(i)}getTaskColumnDefs(){const e=[{field:"taskName",headerName:"Task Name",...l.H.agGridBasicCols},...this.getCommonColumns()];return this.isEroyOrganization()?(e.splice(1,0,{field:"adviceNumber",headerName:"Advice No",...l.H.agGridBasicCols}),e.push({field:"scan",headerName:"Scan",suppressSizeToFit:!1,sortable:!1,filter:!1,resizable:!0,floatingFilter:!1,cellRenderer:"scanCellRenderer"})):e.splice(1,0,{field:"scan",headerName:"Scan",suppressSizeToFit:!1,sortable:!1,filter:!1,resizable:!0,floatingFilter:!1,cellRenderer:"scanCellRenderer"}),e}getCommonColumns(){return[{field:"partType",headerName:"Part Type",...l.H.agGridBasicCols},{field:"partNumber",headerName:"Part Number",...l.H.agGridBasicCols},{field:"description",headerName:"Description",...l.H.agGridBasicCols},{field:"quantity",headerName:"Qty",...l.H.agGridBasicCols},{field:"unitText",headerName:"Unit",...l.H.agGridBasicCols},{field:"partName",headerName:"Part Name",...l.H.agGridBasicCols},{field:"taxRateText",headerName:"Vat Rate",...l.H.agGridBasicCols},{field:"unitCost",headerName:"Cost",...l.H.agGridBasicCols}]}ngOnDestroy(){this.blnShowSearchAsset=!1,this.jobId="",this.assetId="",this.removeTabIndexFromStorage(),this.master.resetFooterBtn(),this.subs.dispose()}removeTabIndexFromStorage(){this.selectedTab=0,localStorage.removeItem("newBookingCurrentTab")}afterGetContract(e){e&&(this.contractdata=e,this.loadContractserviceList())}mapservice(e){const a=(e=e.filter(p=>p?.isActive)).filter(p=>p.subType===l.H.id2),i=e.filter(p=>1===p.subType),o=e.filter(p=>p.subType===l.H.id5),d=e.filter(p=>!0===p.usageBased).filter(p=>(p.usageInText=this.master.getUsageType(p.usageIn),p));this.tblUsage=d,this.mergeUniqueById(this.immediateInspecService,o),this.mergeUniqueById(this.maintenanceService,a),this.mergeUniqueById(this.inspectionService,i),this.usage.push(...d),this.tblUsage=this.usage,this.setServiceTasks()}mergeUniqueById(e,a){const i=new Set(e.map(o=>o.id));a.forEach(o=>{i.has(o.id)||(e.push(o),i.add(o.id))})}setToInprogress(e){if(this.selectedTaskSvc=e,this.getTaskById(),this.task){const a=this.master.userInfo?.id||"",i=l.H.moment(new Date).utc().format();this.task.updatedBy=a,this.task.updatedDate=i,this.task.status=c.e1J.inprogress,this.task.isReopenTask=!0,this.objJobData.updatedBy=a,this.objJobData.updatedDate=i,this.objJobData.status=c.A8Q.inprogress,this.objJobData.isReopenJob=!0,this.isloading=!0,this.subs.add=(0,mt.p)([this.jobService.updateJob(this.objJobData),this.taskService.updateTask(this.task)]).subscribe(()=>{this.toastrService.success("Job and Task status changed to in progress"),this.isloading=!1,this.selectedTaskSvc={},this.task={},this.editJobDetails()})}}initAssetTaskAPI(){this.servicetasklist=[];const e=this.master.getParentOrgId(this.master.navSelectedOrgID);this.assetInfo={assetType:this.objAssetData.assetType,assetMake:this.objAssetData.make,assetRange:this.objAssetData.range};const a={orgainsationId:e,...this.assetInfo};this.isloading=!0,this.progressMsg="Getting Services",this.subs.add=this.jobService.taskService.getTaskService(a).subscribe({next:i=>{this.maintenanceService=[],this.inspectionService=[],this.immediateInspecService=[],this.usage=[];const o=this.objScheduleData.agreement?this.objScheduleData.agreement:this.objJobData.agreement||"";this.objScheduleData.agreement||this.objJobData.agreement?(i.forEach(n=>{this.servicetasklist.push(n)}),this.subs.add=this.jobService.contractservice.getContractById(o).subscribe(n=>this.afterGetContract(n))):this.mapservice(i)},error:()=>{if(!navigator.onLine&&this.assetInfo){const i=Object.values(this.assetInfo).join("");this.idb.getData(u.S.assetServices,i).then(o=>{this.maintenanceService=[],this.inspectionService=[],this.immediateInspecService=[],this.usage=[],o&&this.mapservice(o)}).catch(o=>this.master._helper.helperLog(o))}},complete:()=>{this.getAllAssetList()}})}getScheduleData(e){e&&Object.keys(e).length&&(this.objScheduleData.fixToISOWeek=e.fixToISOWeek,this.objScheduleData.snapToExistingJobs=e.snapToExistingJobs,this.objScheduleData.recurringEvent=e.recurringEvent,this.objScheduleData.every=e.every,this.objScheduleData.interval=e.interval,this.objScheduleData.predictiveScheduling=e.predictiveScheduling||!1,this.objScheduleData.scheduleMode=e.scheduleMode||"Interval",this.objScheduleData.mileageInterval=e.mileageInterval||0,this.objScheduleData.baselineMileage=e.baselineMileage||0,this.objScheduleData.baselineDate=e.baselineDate,this.objScheduleData.forecastRatePerDay=e.forecastRatePerDay,this.objScheduleData.plannedDate=e.plannedDate,this.objScheduleData.endDate=e.endDate)}displayAssetUsage(){this.jobStatus>
1=c.A8Q.completed||this.jobStatus===c.A8Q.cancelled||(this.tblUsage.length>0?this.btnDisplayUsage=!this.btnDisplayUsage:this.toastrService.warning("Usage based task not found"))}addUsageTasktoJob(e){if(this.rowDataTask?.length>0&&this.rowDataTask[0].subType===l.H.id5)return void this.toastrService.warning("As immedidate inspection more than one task can't be added");const a=Object.assign({},e);if(this.rowDataTask.find(o=>o.serviceID===a.id))this.toastrService.warning(`Task ${a.name} already added`);else{a.isNew=!0,a.jobID_PK=this.jobId,a.type="Task",a.serviceID=a.id,a.id=this.master.newGuid(),a.createdBy=this.master.userInfo?.id||"",a.updatedBy=this.master.userInfo?.id||"",a.createdDate=l.H.moment(new Date).utc().format(),a.updatedDate=l.H.moment(new Date).utc().format(),a.assetID=this.assetId,a.usageBased=!0,a.labourRate=a.hourlyRate,a.plannedHours=e.hours,a.status=1;const o=[];if(o.push(a),this.jobId)a.isNew=!0,a.jobID_PK=this.jobId,this.subs.add=this.jobService.taskService.bulkInsertTask(o).subscribe({next:()=>this.toastrService.success(`Task ${a.name} added`),error:()=>{if(!navigator.onLine){const n={key:a.id,value:a};n.value.offline=u.vQ.created,this.idb.UpsertData(u.S.jobTasks,n).then(()=>{const d=[...this.rowDataTask,a];this.agGridTaskRowRender(d),this.toastrService.success(`Task ${a.name} added`)}).catch(d=>this.master._helper.helperLog(d))}},complete:()=>this.editJobDetails()});else{const n=[...this.rowDataTask,a];this.agGridTaskRowRender(n),this.toastrService.success(`Task ${a.name} added`)}}}taskEmitLoad(e){this.objScheduleData.recurringEvent?this.toastrService.warning("Unable to add Defect Repairs if create schedule is clicked"):this.rowDataTask.find(a=>a.defectID===e)?this.toastrService.warning("Already task added"):(this.jobService.taskService.SelectedDefectID.next(e),this.isDefectTask=!0,this.taskTabIndex=l.H.id2,this.displayAddTask("displayAddTask"))}addCustomer(e){this.modalService.open(e)}createAlert(e){this.blnToggle=!!e.checked,this.jobStatus!==c.A8Q.completed?(this.alertDetails="",this.showModal("jobAlertDesc")):this.toastrService.warning("Alert can not be created as Job is completed!")}viewAlert(){this.showModal("jobAlertDesc")}setUsage(e){return Number(e.target.value)>l.H.maxNumber?(this.toastrService.warning("Usage Rate cannot be greater than 9999999"),!1):!(Number(e.target.value)<0&&(this.toastrService.warning("Usage Rate cannot be lesser than 0"),1))}checkNumber(e){return l.H.checkisMoney(e)}onCustomerChange(e){e.value&&(this.objScheduleData.customerID=e.value,this.getContract(e.value))}getContract(e){this.workshopcontractlist=[],this.subs.add=this.jobService.contractservice.getContractByorgId(e).subscribe({next:a=>{this.workshopcontractlist=a.filter(i=>i.agreementWithID===(this.jobStatus===c.A8Q.unplanned?this.objScheduleData.workshopID:this.objJobData.workshopID)&&1===i.status&&i.endDate>this.master.minDate&&i.invitationStatus===U.s.AcceptInvitation&&i.orgID_PK===this.master.navSelectedOrgID),this.assignDefaultValues(this.workshopcontractlist)},error:()=>{this.objAssetData.id&&this.getContractsOfflineData(this.objAssetData.id)}})}getContractsOfflineData(e){navigator.onLine||this.idb.getData(u.S.contracts,e).then(a=>{a&&(this.workshopcontractlist=a.filter(i=>[1===i.status,i.agreementWithID===(this.jobStatus===c.A8Q.unplanned)?this.objScheduleData.workshopID:this.objJobData.workshopID,i.endDate>this.master.minDate,i.invitationStatus===U.s.AcceptInvitation,i.orgID_PK===this.master.navSelectedOrgID].every(n=>n))),this.assignDefaultValues(a)})}viewJobInspectionPdf(){this.isloading=!0,this.jobService.getJobInspecDocument(this.jobId,this.objJobData.documentId).subscribe({next:e=>{this.isloading=!1,e?.documentAT&&this.master.getBolb(e.documentAT)},error:e=>{this.isloading=!1,e&&this.toastrService.error("Error while getting job inspection pdf")}})}viewJobMaintenanceAndDefectRepairTaskPdf(){this.isloading=!0,this.jobService.getJobInspecDocument(this.jobId,this.objJobData.maintenanceRepairDocId).subscribe({next:e=>{this.isloading=!1,e?.documentAT&&this.master.getBolb(e.documentAT)},error:e=>{this.isloading=!1,e&&this.toastrService.error("Error while getting job MainTenance and Defect Repair pdf")}})}viewpdf(){this.master.jobInvoiced&&(this.subs.add=this.jobService.invoiceservice.getDocbyID(this.master.jobInvoiced.documentID).subscribe(a=>{a&&a.documentAT.includes("storageaccount")?window.open(a.documentAT):alert("Pdf Not Found")}))}getAllJobsByWorkshop(e){}
1checkAssetWorkShopJobs(e){if(this.allJobsByWorkshop.length>0){const a=this.allJobsByWorkshop.filter(i=>i.id!==this.jobId);a.length>0?0===a.filter(o=>o.status===c.A8Q.onSite||o.status===c.A8Q.inprogress).length&&(this.objAssetData.status=e):this.objAssetData.status=e}else this.objAssetData.status=e}validateEvery(){let e;const a="UsageBased"===this.objScheduleData.scheduleMode,i=a?999999:l.H.maxDurationNumber;e=a?this.objScheduleData.mileageInterval:this.objScheduleData.every,e=l.H.ToNumber(e),l.H.isNumber(e)?a?this.objScheduleData.mileageInterval=Math.round(e):this.objScheduleData.every=Math.round(e):a?this.objScheduleData.mileageInterval=e:this.objScheduleData.every=e;const o=a?this.objScheduleData.mileageInterval:this.objScheduleData.every;return!(Number(o)<l.H.minNumber||Number(o)>i)||(a?this.objScheduleData.mileageInterval=1:this.objScheduleData.every=1,this.toastrService.warning(`Please enter Every value greater than or equal to min (1) & less than or equal to max (${i})`),!1)}onchangeworkshp(e,a=!1,i=!1){const o=this.master.allworkshoplist.find(n=>n.id===e);if(i)o?.value?(this.changeJobworkspwarningMsg=y.B5.ChangeJobWorkshop.replace("{workshopID}",o.value),this.selChangeJobWorkshop=e,this.openWorkshopAlert()):this.toastrService.warning("There is no workshop value for this.");else{this.workshopParts=null,this.getParentOrgIdsList(),this.setParentOrgControlStatus();const n=o?.type;this.isExternal=n!==c.YMJ.Workshop,this.objJobData.workflowStatusID=this.objJobData.workflowStatusID?this.objJobData.workflowStatusID:1,this.objScheduleData.workshopID=e,this.objJobData.workshopID=e,this.addToMappedOrgIdList(),this.objJobData.isExternalJob=this.isExternal,a&&(this.isloading=!0,this.getOrgUsers(this.objScheduleData.workshopID),this.objScheduleData.customerID&&this.getContract(this.objScheduleData.customerID))}}addToMappedOrgIdList(){if(this.jobId){const e=this.objJobData.mappedOrgIDs;if(e?.length){const a=e.filter(o=>o!==this.prevJobWorkshop&&o!==this.objJobData.workshopID);a.push(l.H.getString(this.objJobData.workshopID)),-1===a.indexOf(this.objJobData.customerID)&&a.push(l.H.getString(this.objJobData.customerID)),this.objJobData.mappedOrgIDs=a}else this.objJobData.mappedOrgIDs=[l.H.getString(this.objJobData.workshopID),this.objJobData.customerID]}}openWorkshopAlert(){this.showModal("confirmChangeJobWorkshop")}resetTaskAssignedEngineers(){this.rowDataTask.forEach(e=>{e.foremanID&&(e.foremanID="")}),this.bindTaskDetails()}changeJobworksp(e){this.onchangeworkshp(this.selChangeJobWorkshop,!0),this.currJobWorkshop=this.selChangeJobWorkshop,this.objJobData.workflowStatusID=this.objJobData.workflowStatusID?this.objJobData.workflowStatusID:1,this.resetTaskAssignedEngineers(),this.closeModal(e),this.dataModified(),this.objJobData.status=c.A8Q.planned,this.objJobData.oldWorkshopIDs||(this.objJobData.oldWorkshopIDs=[]),-1===this.objJobData.oldWorkshopIDs.indexOf(this.prevJobWorkshop)&&this.objJobData.oldWorkshopIDs.push(this.prevJobWorkshop)}resetJobWorkshop(e){this.selChangeJobWorkshop!==this.currJobWorkshop&&this.onchangeworkshp(this.currJobWorkshop),this.closeModal(e)}prepareJobWorkshopChangeAudit(){if(this.prevJobWorkshop!==this.currJobWorkshop){const e=this.master.allworkshoplist.find(o=>o.id===this.prevJobWorkshop),a=this.master.allworkshoplist.find(o=>o.id===this.currJobWorkshop),i=new v.oP;return i.jobID_PK=this.objJobData.id,i.description=`${e?.value} workshop changed to ${a?.value}`,i.jobStatus=this.objJobData.status,i.id=this.master.newGuid(),i.isDelete=!1,i.offline=u.vQ.created,i.createdBy=this.master.userInfo?.id||"",i.createdDate=l.H.moment(new Date).utc().format(),i}return""}onJobWorkshopLocationChange(e){if(e){const a=this.master.jobWorkshopLocations.filter(i=>i.id===e);a?.length&&(this.editingJobWorkshopLoc=a[0])}}getTaskStatusColor(e){switch(e){case c.e1J.notStarted:return Y.cancelled.primary;case c.e1J.inprogress:return Y.inProgress.primary;case c.e1J.completed:return Y.completed.primary;case c.e1J.cancelled:return Y.onHold.primary;default:return Y.default.primary}}loadContractserviceList(){if(this.contractdata&&this.contractdata.invitationStatus===U.s.AcceptInvitation){const e=[];
1this.parentorgservicelist=[],this.contractdata.services.forEach(a=>{e.push(a.id)}),this.subs.add=this.jobService.contractservice.getservicebyIDs(e).subscribe(a=>{let i=[];a.forEach(o=>{i=a.filter(n=>n.id===o.id),i=i.map(n=>{n.hourlyRate=this.contractdata.services.find(d=>d.id===n.id).hourlyRate||n.hourlyRate,n.hours=this.contractdata.services.find(d=>d.id===n.id).hours||n.hours}),this.parentorgservicelist.push(i[0])});for(let o=0;o<this.parentorgservicelist.length;o++)void 0===this.parentorgservicelist[o]&&this.parentorgservicelist.splice(o,1);for(const o of this.servicetasklist)this.parentorgservicelist.find(n=>n?.id===o.id)||this.parentorgservicelist.push(o);this.parentorgservicelist.length>0&&this.mapservice(this.parentorgservicelist)})}else this.mapservice(this.servicetasklist)}taskTypeVG(e){return l.H.getTaskType(e.data?.serviceType,e.data?.subType)}getDefectList(e){e&&!this.objAssetData.lastInspectionDate?this.toastrService.warning("No defect data found"):(this.modalService.open("defectListGrid"),this.defectrequest={assetID:this.objAssetData.id,requestDate:e?this.objAssetData.lastInspectionDate:this.getNowUTC(),isLastInspection:e})}onPartRowClick(e){if(this.isExternal)this.toastrService.warning("External Workshop has no permission to modify Parts");else{if(this.addPartDetails=e.data,this.isNewPartAdded=!1,this.addPartDetails.taskName){if(this.isNewPart=!1,this.addPartDetails.isExternalPart)return void this.toastrService.warning("It has no permission to modify the fleet factor part")}else this.isNewPart=!0,this.isOldPart=!0;this.externalSourcePart=this.addPartDetails.isExternalPart,this.showModal("addPartTab")}}startWebSocketSvc(){this.subs.add=this.webSocketService.messages.subscribe(e=>{l.H.helperLog("Received message from WebSocket:"+e),e===c.vlY.JobPartAdded&&this.editJobDetails()})}manualyReloadThePage(){this.needReloadData(),this.checkAndReloadData()}setParts(e=!0){this.taskRows=[];let a=[];this.objJobData.task?.forEach(i=>{if("Inspection"!==this.taskTypeVG({data:i})){this.taskRows.push({id:i.id,name:i.name,status:i.status});let n=i.parts.filter(d=>!1===d.isDelete);n=n.map(d=>(d.taskType=i.id,d.taskName=i.name,d.taskStatus=i.status,d)),a.push(...n)}}),a=this.addFleetFactorParts(a),this.rowdata=[],a&&a.length>0&&(a=a.map(i=>{const o=i;return o.unitText=this.master.partUnit.find(n=>n.id===i.unit)?.[this.master.displayLang],o.taxRateText=this.master.taxRate.find(n=>n.id===i.taxRate)?.en,o.mode="",o.partType=this.ddlStockTypeArray.find(n=>n.id===i.stockType)?.en,o}),this.rowdata=a),this.partsCount=this.rowdata?.length||l.H.zero,e&&this.calculateTotalPartsPrice()}calculateTotalPartsPrice(){let e=0,a=0,i=0;this.rowdata.forEach(o=>{if(o.unitCost&&o.quantity&&o.taxRate){const n=o.quantity*o.unitCost;e+=n;const d=this.master.getTaxPercent(o.taxRate),p=l.H.convertToMoney(d/l.H.hundred);a+=n*p,i+=p}}),this.totlPartsPrice=l.H.convertToMoney(e),this.totlPartsTax=l.H.convertToMoney(a),this.totlPartsTaxPercent=l.H.convertToMoney(i),this.totlPartsPriceWithTax=l.H.convertToMoney(e+a),this.setAuthRuleByTotalPartsPriceValue()}setAuthRuleByTotalPartsPriceValue(){if(this.matchedRuleList=[],this.matchedRule=new ut.Wu,this.authRuleList?.length){const e=Number(this.totlPartsPriceWithTax),a=this.authRuleList.filter(i=>{const o=Number(i.minimumApprovalAmmout),n=Number(i.maximumnApprovalAmount);return e>=o&&e<=n}).sort((i,o)=>Number(i.maximumnApprovalAmount)-Number(o.maximumnApprovalAmount));this.matchedRuleList=a,this.prepareCommonMatchedRule()}}prepareCommonMatchedRule(){let e={},a=l.H.stringEmpty,i=[];if(this.matchedRuleList.length){this.matchedRuleList.forEach((n,d)=>{e=n,d>0&&(a+=", "),a+=n.rule,n.roleList.length&&(i=i.concat(n.roleList))}),this.matchedRule.rule=a;const o=this.master.currencyList.find(n=>n.id===e.currencnyId)||{icon:l.H.stringEmpty};this.matchedRule.currencySymbol=o.icon,this.matchedRule.roleList=i,this.matchedRule.nameListStr=this.orgService.getAuthRuleUsersList(this.matchedRule.roleList,!0)}}addFleetFactorParts(e){return this.partsData.forEach(a=>{-1===e.findIndex(o=>o.id===a.id)&&e.push(a)}),e}getWorkshopParts(){this.workshopParts||(this.subs.add=this.stockService.getStockByWorkshopId(this.jobId&&this.objJobData.workshopID||this.objScheduleData.workshopID).subscribe({next:a=>{this.workshopParts=a,this.isloading=!1},error:()=>this.isloading=!1}))}createWorkshopInvntryStock(){this.master.stockInfo&&Object.keys(this.master.stockInfo).length&&(this.subs.add=this.stockService.createStock(this.master.stockInfo).subscribe({next:e=>{e.msg?this.toastrService.warning(e.msg):this.toastrService.success("Stock Added successfully."),this.master.stockInfo={}},error:e=>{this.master._helper.helperLog(e.message),this.toastrService.error("Stock Add failed."),this.master.stockInfo={}}}))}openAddDocumentModel(){this.modalService.open("CustomModelName"),this.assetService.DocAssetData.next(this.objAssetData)}taskDocUpdate(e){e?.documentName&&(this.toastrService.success("Upload Document Successfully"),this.getDocumentList())}onSaveGridColumnState(){this.agGridJobDocument.api&&(this.columnState=JSON.stringify(this.agGridJobDocument.api?.getColumnState()),localStorage.setItem(c.$PV.columnState,this.columnState))}
1onSaveGridColumnStateJobCostCharges(){this.agGridJobCostCharges.api&&(this.columnState=JSON.stringify(this.agGridJobCostCharges.api?.getColumnState()),localStorage.setItem(c.$PV.columnState,this.columnState))}onFirstDataRendered(){const e=localStorage.getItem(c.$PV.filter),a=localStorage.getItem(c.$PV.pageNo),i=localStorage.getItem(c.$PV.columnState);this.master.setAGGridsate(this.agGridJobDocument,a,e,i),setTimeout(()=>{this.agGridJobDocument?.api.sizeColumnsToFit()},0)}onFilterChanged(){this.savedFilterModel=JSON.stringify(this.agGridJobDocument.api.getFilterModel()),localStorage.setItem(c.$PV.filter,this.savedFilterModel)}onPaginationChanged(){this.savedPageModel=JSON.stringify(this.agGridJobDocument.api.paginationGetCurrentPage()),localStorage.setItem(c.$PV.pageNo,this.savedPageModel)}onFilterChangedJobCostCharges(){this.savedFilterModel=JSON.stringify(this.agGridJobDocument.api.getFilterModel()),localStorage.setItem(c.$PV.filter,this.savedFilterModel)}onPaginationChangedJobCostCharges(){this.savedPageModel=JSON.stringify(this.agGridJobDocument.api.paginationGetCurrentPage()),localStorage.setItem(c.$PV.pageNo,this.savedPageModel)}onRowSelected(e){this.rowsSelected=this.agGridJobDocument.api.getSelectedRows()}onClickingFilters(){this.agGridJobDocument.api.isToolPanelShowing()?this.agGridJobDocument.api.closeToolPanel():this.agGridJobDocument.api.openToolPanel("filters")}onClickingFiltersJobCostCharges(){this.aggridJobCostCharges.api.isToolPanelShowing()?this.aggridJobCostCharges.api.closeToolPanel():this.aggridJobCostCharges.api.openToolPanel("filters")}onLoadJobDocuments(){this.filteredColumnDefs=[{field:c.q7p.docCreatedDate,headerName:"Processed Date",sortable:!0,filter:"agDateColumnFilter",resizable:!0,floatingFilter:!0,suppressSizeToFit:!1,type:"dimension",filterParams:this.gridConfigService.getDateFilterParams(),valueGetter:l.H.dateValueGetter},{field:c.q7p.docType,headerName:"Document Type",sortable:!0,filter:"agMultiColumnFilter",filterParams:{filters:[{filter:"agTextColumnFilter",display:"subMenu"},{filter:"agSetColumnFilter"}]},floatingFilter:!0,resizable:!0,suppressSizeToFit:!1,type:"dimension"},{field:c.q7p.documentName,headerName:"Document Name",sortable:!0,filter:"agMultiColumnFilter",filterParams:{filters:[{filter:"agTextColumnFilter",display:"subMenu"},{filter:"agSetColumnFilter"}]},floatingFilter:!0,resizable:!0,suppressSizeToFit:!1,type:"dimension"},{field:c.q7p.description,headerName:"Description",sortable:!0,filter:"agMultiColumnFilter",filterParams:{filters:[{filter:"agTextColumnFilter",display:"subMenu"},{filter:"agSetColumnFilter"}]},floatingFilter:!0,resizable:!0,suppressSizeToFit:!1,type:"dimension"},{field:"taskName",headerName:"Task",sortable:!0,filter:"agMultiColumnFilter",filterParams:{filters:[{filter:"agTextColumnFilter",display:"subMenu"},{filter:"agSetColumnFilter"}]},floatingFilter:!0,resizable:!0,suppressSizeToFit:!1,type:"dimension"},{field:c.q7p.docCreatedBy,headerName:"Processed By",sortable:!0,filter:"agMultiColumnFilter",filterParams:{filters:[{filter:"agTextColumnFilter",display:"subMenu"},{filter:"agSetColumnFilter"}]},floatingFilter:!0,resizable:!0,suppressSizeToFit:!1,type:"dimension"},{field:"",headerName:"Preview",sortable:!0,filter:!0,floatingFilter:!0,resizable:!0,suppressSizeToFit:!1,type:"dimension",cellRenderer:"pdfCellRenderer",cellRendererParams:{onClick:this.onBtnPreviewClick.bind(this),btnName:"Review"}}],this.getDocumentList()}getDocumentList(){this.subs.add=this.assetService.getJobDocumentList(this.jobId).subscribe({next:e=>this.getJobDocuments(e),error:()=>{}})}onBtnPreviewClick(e){this.master.getBolb(e.rowData.documentAT)}getJobDocuments(e){this.documentRowData=[],e&&e.length>0?(this.documentRowData=e.map(a=>({...a,[c.q7p.orgCreatedDate]:a[c.q7p.docCreatedDate],[c.q7p.orgDepotOrgID]:a[c.q7p.depotOrgID],[c.q7p.orgOperatorOrgID]:a[c.q7p.operatorOrgID],[c.q7p.orgCreatedBy]:a[c.q7p.docCreatedBy],[c.q7p.orgWorkshopOrgID]:a[c.q7p.workshopOrgID],[c.q7p.docTypeId]:a[c.q7p.docType],[c.q7p.docCreatedDate]:a.eventDate&&"0001-01-01T00:00:00"!==a.eventDate?a.eventDate:a[c.q7p.docCreatedDate],[c.q7p.depotOrgID]:this.master.masterOrgList.find(i=>i.id===a.depotOrgID)?.[c.x$L.companyName],[c.q7p.operatorOrgID]:this.master.masterOrgList.find(i=>i.id===a.operatorOrgID)?.[c.x$L.companyName],[c.q7p.docCreatedBy]:this.master.alluserList.find(i=>i.id===a[c.q7p.docCreatedBy])?.name||"",[c.q7p.workshopOrgID]:this.master.workshopOrgLookUp.find(i=>i.id===a[c.q7p.workshopOrgID])?.value,[c.q7p.docType]:this.master.documentTypes.find(i=>i.id===a[c.q7p.docType])?.[this.master.displayLang],mode:"assetDocument",showDelete:this.canShowDeleteIcon(a)})),this.agGridJobDocument.api?.sizeColumnsToFit()):this.documentRowData=[]}canShowDeleteIcon(e){let a=!1;return(!e.defectID&&!e.jobID&&!e.mobileInspectionID&&!e.quoteID&&!e.taskID&&!e.userID||e.jobID&&e.taskID&&!e.tasksubType)&&(a=!0),a}completeJobProcess(){switch(this.currentJobCompleteType){case c.K2f.KeyDateJob:this.jobCompleteWithKeyDates();break;case c.K2f.NormalJob:this.startNormalJobUpdateProcess()}}closeRescheduleJobsModel(){this.modalService.close(this.rescheduleJobsModelName),this.resetScheduleModelValues()}closeWarrantyListModel(){this.modalService.close(this.showActiveWarrantyListModelName)}dataFromWarrantyPopup(e){e.createJob?(this.isWarrantyJobCreationApproved=!0,this.isUpdatingJobTask?this.saveUpdatedJobTask():this.createJob()):this.closeWarrantyListModel()}enforceMaxLimit(e){this.pricingCache=null,parseFloat(e.target.value)>100&&(this.rechargeModalData.rechargePercent=100,e.target.value=100,this.toastrService.warning("Recharge % cannot be greater than 100"))}onRechargePercentChange(){this.pricingCache=null}onCustomerMarginPercentChange(){this.pricingCache=null;const e=Number(this.selectedTaskForRecharge?.customerMarginPercentage||0);this.rechargeModalTasks?.length&&this.rechargeModalTasks.forEach(a=>{a.customerMarginPercentage=e})}static{this.\u0275fac=function(a){return new(a||s)(t.rXU(T.nX),t.rXU(k.aZ),t.rXU(gt.I),t.rXU(Q.L),t.rXU(tt.B),t.rXU(Gt.D),t.rXU(Pt.n),t.rXU(Ot.V),t.rXU(_t.a),t.rXU(Lt.f),t.rXU($t.X),t.rXU(Vt.W),t.rXU(Ht.T),t.rXU(Yt.JZ),t.rXU(M.Qq),t.rXU(Ut.V),t.rXU(Xt.P),t.rXU(et.m),t.rXU(t.gRc),t.rXU(Wt.N),t.rXU(qt.P))}}static{this.\u0275cmp=t.VBU({type:s,selectors:[["app-new-booking"]],viewQuery:function(a,i){if(1&a&&(t.GBs(ye,5),t.GBs(Fe,5),t.GBs(Ne,5),t.GBs(Je,5),t.GBs(Be,5),t.GBs(D.h,5),t.GBs(Me,5),t.GBs(Ae,5),t.GBs(Ee,5)),2&a){let o;t.mGM(o=t.lsd())&&(i.jobTabForm=o.first),t.mGM(o=t.lsd())&&(i.agGridJobHistory=o.first),t.mGM(o=t.lsd())&&(i.agGridPart=o.first),t.mGM(o=t.lsd())&&(i.agGridJobCostCharges=o.first),t.mGM(o=t.lsd())&&(i.assetCostGridComp=o.first),t.mGM(o=t.lsd())&&(i.rescheduleModal=o.first),t.mGM(o=t.lsd())&&(i.keyDateJobFileUpload=o.first),t.mGM(o=t.lsd())&&(i.fileDropEl=o.first),t.mGM(o=t.lsd())&&(i.agGridJobDocument=o.first)}},decls:180,vars:66,consts:[["closebutton",""],["SelectedBookedDatePicker",""],["CompletionDatePicker",""],["keyDateJobFileUpload",""],["awaitingSignoffBtnTemp",""],["completeBtnTemp",""],["reviewBtnTemp",""],["cancelBtnTemp",""],["confirmBookingBtnTemp",""],["ScheduleTemp",""],["VrmInfoTemp",""],["SupplierReqFlow",""],["CustomerReqFlow",""],["RequestType",""],["RequestMode",""],["AllocationTime",""],["referenceTemp",""],["workFlowStatusTemp",""],["jobCommentTemp",""],["bookedByTemp",""],["workshopTemp",""],["jobWorkshopLocationTemp",""],["isoWeekTable",""],["tempJobSchedule",""],["picker2",""],["taskClassificationTemplate",""],["fallbackCostBtn",""],["agGridPart",""],["assetCostGridComp",""],["agGridJobDocument",""],["agGridJobHistory",""],["costfileDropReference",""],["requestTypeRadioGroup",""],["focus",""],["jobWorkshopLocationMenuActions","matMenu"],["tab",""],["picker",""],["picker3",""],["picker1",""],["ActualBookedDatePicker",""],["class","container mainContainer",4,"ngIf"],["class","loaderGif",4,"ngIf"],["id","defectCommentHistory"],[1,"theme-model"],[1,"theme-modeltitle"],[1,"title"],["type","button","id","btnCloseEditsaveDefectComment",1,"my-close",3,"click"],[1,"theme-modelbody"],[1,"formfields","themeinputgrp"],[1,"md-form","form-group","textareagrp","notesinput"],["appearance","outline",1,"width100"],["id","txtOldDefectdescription","maxlength","1000","type","text","required","","name","Description","matInput","","aria-label","lbl_Description",1,"themeinput","descstyle","noAutoHeight",3,"ngModelChange","ngStyle","ngModel"],[1,"theme-modelfooter","mg8"],["id","btncancelsaveDefectComment","name","cancel","mat-raised-button","",1,"defaultbtn","camicon",3,"click"],["id","btnsaveDefectComment","name","saveDefectComment","mat-raised-button","",1,"themebtn","camicon",3,"click"],["id","showBackDateReason",1,"theme-model-lg"],[1,"title","mbtm-5"],["type","button","id","btnClosePart",1,"my-close",3,"click"],[1,"theme-modelbody","xs-addpart"],["fxFlex","90%"],["fxLayout","row wrap","fxLayoutGap","5%","fxLayoutAlign","left space-between",1,"form-row","themeinputgrp"],["fxLayout","row wrap","fxLayoutAlign","space-between center",1,"columnflx-xs","width100"],["id","lblPartName",1,"label-auto"],[1,"required"],[1,"md-form","form-group","width80"],["appearance","outline",1,"example-full-width"],["id","txtJobStartDate","matInput","",1,"themeinput",3,"ngModelChange","dateChange","ngModel","max","matDatepicker","disabled"],["matSuffix","",3,"for"],["fxLayout","row wrap","fxLayoutAlign","space-between center","class","columnflx-xs width100",4,"ngIf"],["id","lblDescription",1,"label-auto"],[1,"md-form","form-group","width80","textareagrp"],["id","backdatedReason","matInput","","maxlength","1000","aria-label","backdatedReason",1,"themeinput","descstyle",3,"ngModelChange","change","ngModel","disabled"],["fxLayout","row","fxLayoutAlign","center center","class","supervisorSignRow",4,"ngIf"],[1,"link-btnwrap"],["fxFlex","100%"],[1,"link-btn","pull-right"],["id","btnClosePart","mat-raised-button","","color","orange",1,"defaultbtn","camicon",3,"click"],["id","btnSavePart","mat-raised-button","","color","primary","class","themebtn camicon",3,"disabled","click",4,"ngIf"],["id","showSupervisorSignPopup",1,"theme-model-lg"],[1,"theme-model","supervisor-sign-popup"],["id","btnSavePart","mat-raised-button","","color","primary",1,"themebtn","camicon",3,"click","disabled"],["id","CustomModelName","class","theme-model-lg",4,"ngIf"],["id","jobCompletionFeedback",1,"theme-model-lg","jobCompletionFbackTmp"],[1,"md-form","form-group","width60"],["id","completionDate","matInput","",1,"themeinput",3,"ngModelChange","dateChange","ngModel","max","matDatepicker","disabled"],[1,"md-form","form-group","width60","textareagrp"],["id","uploadFile","type","file","aria-label","lblDescription","accept","image/*,.pdf,.xls,.xlsx,.apk,.ipa,.csv",3,"ngModelChange","change","ngModel"],[3,"ngModelChange","ngModel"],["value","pass",3,"checked"],["value","fail",3,"checked"],["class","columnflx-xs width100",4,"ngFor","ngForOf"],["id","btnSaveKeyDateInfo","mat-raised-button","","color","primary",1,"themebtn","camicon",3,"click"],["id","jobCompletionFeedback",1,"theme-model-lg"],[1,"newModel",3,"id"],[3,"rescheduleDecided","closeModal","futureComplianceJob","assetId","previousJobBookedDate"],[1,"title","custom"],["id","btnClosePOCreateSuccessModal","mat-raised-button","","color","primary",1,"my-close","closeIconBtn","themebtn",3,"click"],["id","poCreateSuccessCloseBtn",1,"accent","material-icons","md-48"],["fxLayout","column",1,"raisePOPreviewContainer","themeinputgrp","field-border-4px"],[1,"form-row"],["class","form-row mt-10 mbtm-10",4,"ngIf"],[1,"container","mainContainer"],["class","row mbtm-10",4,"ngIf"],[1,"mb-45",3,"ngClass"],["class","alert-asset-header",4,"ngIf"],[1,"pos-relative"],["class","partsBubbleCount",4,"ngIf"],[1,"job-details","sectabs",3,"selectedTabChange","ngClass","selectedIndex"],["
1id","tabScheduleAddJob","label","Schedule",4,"ngIf"],["id","tabSchedule","label","Schedule",3,"disabled",4,"ngIf"],["id","tabTasks","label","Tasks",3,"disabled"],["matTabContent",""],["id","tabParts","label","Parts\xa0\xa0\xa0\xa0",3,"disabled",4,"ngIf"],["id","tabCostCharges","label","Cost / Charges",4,"ngIf"],["id","tabJobDocuments","label","Documents",4,"ngIf"],["id","tabContacts","label","Contacts",4,"ngIf"],["id","tabAssetAgreements","label","Asset Agreements",4,"ngIf"],["id","tabCommsLog","label","Comms Log",4,"ngIf"],["id","tabScheduleUpdateJob","label","Schedule",4,"ngIf"],["id","tabJobHistory","label","History",4,"ngIf"],["fxLayout","row","fxLayoutGap","25px","class","job-create-bntgrp pos-relative",4,"ngIf"],["id","btnCloseCreateJobRequestModel","mat-raised-button","","color","primary",1,"my-close","closeIconBtn","themebtn",3,"click"],["id","createRequestCloseBtn",1,"accent","material-icons","md-48"],["fxLayout","column",1,"createJobReqContainer","form-row","themeinputgrp","field-border-4px"],["fxLayout","column","fxFlex","100%",3,"startSaveProcess","closeModal","jobReqInfo","objAssetData","partsFromTask"],["id","btnCloseTaskCostModal","mat-raised-button","","color","primary",1,"my-close","closeIconBtn","themebtn",3,"click"],[1,"accent","material-icons","md-48"],[1,"form-row","themeinputgrp","task-cost-form"],["id","lblTaskCostSupplier",1,"label-auto"],["id","ddlTaskCostSupplier","panelClass","wideSelectPanelForOptions",3,"ngModelChange","ngModel","title"],[3,"value"],["placeholderL
1abel","Find Supplier",3,"formControl"],[3,"value",4,"ngFor","ngForOf"],["id","lblTaskCostEvent",1,"label-auto"],["id","ddlTaskCostEvent",3,"ngModelChange","ngModel"],["id","lblTaskCostAmount",1,"label-auto"],["id","txtTaskCostAmount","aria-label","Cost Amount","matInput","","type","number","min","0","step","0.01",3,"ngModelChange","ngModel"],["id","lblTaskCostPreviewTotal",1,"label-auto"],["id","txtTaskCostPreviewTotal","matInput","","disabled","",3,"value"],["id","lblTaskCostAssetOperator",1,"label-auto"],["id","txtTaskCostAssetOperator","matInput","","disabled","",3,"ngModelChange","ngModel"],["id","lblTaskCostNotes",1,"label-auto"],["id","txtTaskCostNotes","aria-label","Cost Notes","matInput","","maxlength","1000","rows","3",3,"ngModelChange","ngModel"],["fxLayout","row","fxLayoutAlign","end center","class","width100 task-cost-recharge-row",4,"ngIf"],["id","lblFiles",1,"label-auto"],[1,"files-list"],["fxLayout","row",4,"ngFor","ngForOf"],[3,"ngStyle","progress"],["fxLayout","column","fxFlex","100%",1,"width100","ml40"],["id","assetCostDoc","appFileDragAndDrop","",1,"themeuploader",3,"ngStyle"],["dropZoneLabel","Drop files here",3,"onFileDrop"],["ngx-file-drop-content-tmp",""],["fxLayout","row","fxLayoutAlign","start center","fxLayoutGap","10px",1,"width100","parsed-cost-actions"],["id","btnExtractCostsFromDoc","mat-raised-button","",1,"themebtn","camicon",3,"click","disabled"],["class","parsed-cost-supplier",4,"ngIf"],["class","width100 parsed-cost-results",4,"ngIf"],["id","btnTaskCostCancel","mat-raised-button","",1,"defaultbtn","camicon",3,"click"],["id","btnTaskCostSave","mat-raised-button","",1,"themebtn","camicon",3,"click","disabled"],["id","confirm",1,"theme-model-lg"],["fxLayout","row wrap","fxLayoutGap","5%","fxLayoutAlign","left left",1,"form-row","themeinputgrp","filterrow"],["id","btnClose","mat-raised-button","","color","orange",1,"defaultbtn","camicon",3,"click"],["id","btnSave","mat-raised-button","","color","primary",1,"themebtn","camicon",3,"click"],[1,"theme-model-lg",3,"id"],["type","button","id","btnCloseJobCostDelete",1,"my-close",3,"click"],["id","btnCancelJobCostDelete","mat-raised-button","","color","orange",1,"defaultbtn","camicon",3,"click"],["id","btnSaveJobCostDelete","mat-raised-button","","color","primary",1,"themebtn","camicon",3,"click"],[1,"newModel","defect-recharge-modal",3,"id"],["id","btnCloseDefectRechargeModal","mat-raised-button","","color","primary",1,"my-close","closeIconBtn","themebtn",3,"click"],["class","form-row themeinputgrp task-cost-form defect-recharge-form",4,"ngIf"],["mat-raised-button","",1,"defaultbtn","camicon","defect-recharge-footer-btn",3,"click"],["mat-raised-button","",1,"themebtn","camicon","defect-recharge-footer-btn",3,"click","disabled"],[3,"id"],["type","button",1,"my-close",3,"click","id"],[1,"md-form","form-group"],["matInput","","maxlength","100",1,"themeinput","visibleField",3,"ngModelChange","id","name","ngModel","ngModelOptions"],["name","cancel","mat-raised-button","",1,"defaultbtn","camicon",3,"click","id"],["name","save","mat-raised-button","",1,"themebtn","camicon",3,"click","id","disabled"],["id","showAsset",1,"theme-model-lg"],[3,"fromWorkShop","parentAssetId","blnAssetWorkShop","sendSelectedAsset",4,"ngIf"],["id","showCancelReason",1,"theme-model-lg"],["fxLayout","row wrap","fxLayoutGap","5%","fxLayoutAlign","left left",1,"form-row","themeinputgrp","field-border-4px","filterrow"],["fxLayout","column wrap","fxLayoutAlign","center flex-start",1,"formgroup-lt","width100","pad-lt1"],["id","lblreason",1,"label-auto"],[1,"md-form","form-group","width100","textareagrp"],["appearance","outline",1,"example-full-width","width100"],["aria-label","Reason","id","txtCancelReason","matInput","","name","cancelReason","maxlength","1000",1,"themeinput","descstyle",3,"ngModelChange","ngModel"],["id","btnCancelJob","mat-raised-button","","color","primary",1,"themebtn",3,"click","disabled"],["id","jobAlertDesc",1,"theme-model-lg"],[3,"updateAlert","alertDetails","alertType","entity","assetDetails"],["id","adhocCustomer",1,"theme-model-lg"],[3,"from"],["id","defectListGrid",1,"theme-model-lg"],[3,"defectrequest"],["id","addPartTab",1,"theme-model-lg"],[3,"cancelEvent","stockInfo","updatedPart","getPartMode","deletePartNotSaveTask","commonEmitter","isNew","fromExternalSource","isOldPart","taskRows","workshopParts","partDetails","repaircodes","jobId","isNewPartAdded","operatorOrgID"],["id","confirmTakeOwnership",1,"theme-model-lg"],["type","button","id","btnCloseconfirmTakeOwnership",1,"my-close",3,"click"],["id","btnCancelconfirmTakeOwnership","mat-raised-button","","color","orange",1,"defaultbtn","camicon",3,"click"],["id","btnSaveconfirmTakeOwnership","mat-raised-button","","color","primary",1,"themebtn","camicon",3,"click"],["id","plannerViewServiceDetails",1,"theme-model-lg","modalBgColor"],[1,"title","viewServiceDetailsPupup","buttonColour"],["fxLayout","column","fxLayoutGap","20px",1,"pad-lt20"],["fxLayout","row wrap","fxLayoutAlign","left left",1,"mt-15"],[1,"flexinlinestyle"],["fxLayout","row wrap","fxLayoutAlign","left left"],[4,"ngIf"],["fxLayout","row "],["fxLayout","column",1,"flexinlinestyle"],["fxLayout","column"],["fxLayout","row wrap"],[4,"ngFor","ngForOf"],["id","btnCloseVie
1wServiceDetails","mat-raised-button","","color","primary",1,"defaultbtn","camicon",3,"click"],["id","defectRepairDetails",1,"theme-model-lg"],[1,"title","viewServiceDetailsPupup"],["type","button","id","btnClosedefectRepairDetails",1,"my-close",3,"click"],[1,"padtop-20","padbottom-20"],[3,"jobIdForSaveDefectComment","defectRepairId","defectTaskID","taskClassificationData","taskClassificationActionOptions","taskClassificationReasonOptions","disableTaskClassificationEdit","taskClassificationMainAreaChange","taskClassificationSubCategoryChange","taskClassificationComponentChange","taskClassificationActionChange","taskClassificationPositionChange","taskClassificationReasonChange","taskClassificationCommentBlur","SendCancelCommentHist","reloadData",4,"ngIf"],["id","jobComplteSignPad",1,"theme-model-lg"],[3,"cancelled","signedImage","currentSignature"],["id","confirmChangeJobWorkshop",1,"theme-model-lg"],["type","button","id","btnCloseConfirmChangeJobWorkshop",1,"my-close",3,"click"],[1,"white-space-pre-line"],["id","btnCancelconfirmChangeJobWorkshop","mat-raised-button","","color","orange",1,"defaultbtn","camicon",3,"click"],["id","btnSaveconfirmChangeJobWorkshop","mat-raised-button","","color","primary",1,"themebtn","camicon",3,"click"],[3,"dataChanged","warranties","assetUsageInfo"],[3,"confirmed","cancelled","resources"],[1,"confirmModelHeader",3,"id"],[1,"accent"],["type","button","mat-raised-button","","color","primary",1,"my-close","closeIconBtn","themebtn",3,"click"],[1,"padlr15",2,"padding-top","15px","padding-bottom","15px"],[1,"txt-header"],[1,"theme-modelfooter"],["type","button","mat-flat-button","","color","primary",3,"click"],[1,"row","mbtm-10"],[1,"col-md-2","text-left"],["id","lbl_CreateJobRequest","class","label-auto createJob",3,"ngClass",4,"ngIf"],["id","lbl_CreateJob","class","label-auto createJob",4,"ngIf"],["id","lbl_UpdateJob","class","label-auto createJob",4,"ngIf"],["id","lbl_CreateJob",1,"label-auto","createJob"],["id","lbl_UpdateJob",1,"label-auto","createJob"],["id","lbl_CreateJobRequest",1,"label-auto","createJob",3,"ngClass"],[1,"alert-asset-header"],["class","createUpdateJob animatedSlideDownBtn",4,"ngIf"],["fxLayout","row","fxLayout.sm","column","fxLayout.xs","column","fxLayoutGap","0","fxLayoutGap.sm","2%"],["fxLayout","row","fxFlex","95%"],["fxLayout","column",4,"ngIf"],["fxLayout","row","fxLayoutWrap","","fxLayoutGap","20px","class","assetHeader",4,"ngIf"],["fxLayout","row","fxLayoutAlign","left","class","mr-t-b sendReqstContainer",4,"ngIf"],["fxLayout","row","fxFlex","5%",1,"refrshIconContainer"],["fxLayout","column","fxLayoutAlign","left",1,"mr-t-b"],[1,"divfont"],["id","JobrefreshIcon",1,"iconColor",3,"keypress","click"],["fxFlex","45%",4,"ngIf"],["fxFlex","55%",4,"ngIf"],[1,"createUpdateJob","animatedSlideDownBtn"],["class","maxwt-100","mat-raised-button","","color","primary","id","createJob",3,"disabled","click",4,"ngIf"],["class","maxwt-100","mat-raised-button","","color","primary","id","SaveJobTask",3,"disabled","click",4,"ngIf"],["mat-raised-button","","color","primary","id","createJob",1,"maxwt-100",3,"click","disabled"],["mat-raised-button","","color","primary","id","SaveJobTask",1,"maxwt-100",3,"click","disabled"],["id","alertsIcon","onKeyDown","viewAlert()","alt","View Alert","src","assets/buttonIcons/alertIcon.png","width","100%","height","100%",3,"click"],["id","btnAlertView"],["alt","Create Alert",3,"change","ngModelChange","ngModel"],["fxLayout","row","fxLayoutWrap","","fxLayoutGap","20px",1,"assetHeader"],["id","lbljob_Cus_Ref_Vrm",1,"txt-norm"],["id","redirectToAssetFromVrm",1,"link","font-weight-600","cursor-pointer",3,"click"],["id","lblJobFleetID",1,"txt-norm"],["id","redirectToAssetFromFleetID",1,"link","font-weight-600","cursor-pointer",3,"click"],["id","lblJobMake",1,"txt-norm"],["id","lblJobModel",1,"txt-norm"],["fxLayout","column","fxLayoutAlign","left","class","mr-t-b",4,"ngIf"],["id","fleetFactorAuthCodeIcon","src","assets/fleet-logo-light.svg","width","100px","height","25px","alt","addicon","class","iconColor",4,"ngIf"],["id","fleetFactorAuthCodeIcon","src","assets/fleet-logo-light.svg","width","100px","height","25px","alt","addicon",1,"iconColor"],["id","redirectToJobRequestFromNumber",1,"link","font-weight-600","cursor-pointer",3,"click"],["id","lblJobOperator",1,"txt-norm"],["id","lblJobDepot",1,"txt-norm"],["fxLayout","row","fxLayoutAlign","left",1,"mr-t-b","sendReqstContainer"],["id","btnSendRequest","name","sendRequest","mat-raised-button","","color","primary",1,"themebtnbg",3,"click"],["id","btnSendPurchaseOrder","name","sendPurchaseOrder","class","themebtnbg","mat-raised-button","","color","primary","matTooltip","Send the Purchase Order to the workshop",3,"disabled","click",4,"ngIf"],["id","btnSendPurchaseOrderDisabled","name","sendPurchaseOrderDisabled","class","themebtnbg","mat-raised-button","","color","primary","disabled","","matTooltip","Available when the job reaches the configured Issue PO to Supplier step",4,"ngIf"],["id","btnSendPurchaseOrder","name","sendPurchaseOrder","mat-raised-button","","color","primary","matTooltip","Send the Purchase Order to the workshop",1,"themebtnbg",3,"click","disabled"],["id","btnSendPurchaseOrderDisabled","name","sendPurchaseOrderDisabled","mat-raised-button","","color","primary","disabled","","matTooltip","Available when the job reaches the configured Issue PO to Supplier step",1,"themebtnbg"],["fxFlex","45%"],["fxLayout","row","fxLayoutGap","0px","fxLayoutAlign","center center",1,"form-row","themeinputgrp","field-border-4px","themeinputgrpb","justifyContentUnset","tnygrp","pad-top0","pad-btm10"],["fxLayout","row","fxLayoutAlign","center center"],[4,"ngTemplateOutlet"],["fxLayout","row","fxLayoutAlign","center center",4,"ngIf"],["fxLayout","row","fxLayoutAlign","center center",1,"width100"],["fxFlex","55%"],["fxLayout","column","fxFlex","40%",1,"partsTotalCost"],[1,"partsTotalCostRow"],["id","price"],["id","tax"],[1,"partsTotalCostRow","total"],["id","totalPrice"],["fxLayout","row",1,"approval-group","themeinputgrp"],["fxLayout","column",1,"justifyContentcenter"],["for","approval-group"],[1,"info-icon","verticalAlignMiddle"],["id","matchedRule.nameListStr","name","matchedRule.nameListStr","matTooltipClass","custom-tooltip",1,"hoverIcon",3,"matTooltip"],["id","txtAuthRole","required","","matInput","","maxlength","25","name","AuthRole","readonly","","aria-readonly","true",1,"themeinput",3,"ngModel"],["fxLayout","column","fxFlex","50%"],["fxLayout","row wrap","fxLayoutGap","5%","fxLayoutAlign","left space-between",1,"form-row","themeinputgrp","field-border-4px","themeinputgrpb","rtxpanel"],[1,"maxwidth270","width100"],[1,"form-row","statusftstyle"],["id","lbl_jobheader",3,"ngStyle",4,"ngIf"],["id","lbl_jobdate_wrap",3,"class",4,"ngIf"],[1,"mb-0","pos-relative"],[1,"bgBlack"],["class","form-row","fxLayout","row wrap","fxLayoutAlign","left space-between",4,"ngIf"],["class","form-row ovrflow-bw","fxLayout","row wrap","fxLayoutAlign","left space-between",4,"ngIf"],["class","form-row themeinputgrp field-border-4px width100","fxLayout","row wrap","fxLayoutAlign","left space-between",4,"ngIf"],["fxLayout","row-reverse wrap",1,"pull-right","no-padding","width100"],["class","width100","id","JobInspecPdf",4,"ngIf"],["id","lbl_jobheader",3,"ngStyle"],["id","lbl_jobdate_wrap"],[1,"row"],[1,"pr0","align-self-center","text-right"],[1,"md-form","form-group","occurencetime","width100","inputgroupc"],["id","lbl_jobdate",1,"text-right"],[1,"col-md-3","pr0","align-self-center","text-right"],["id","lblusage",1,"text-right"],[1,"col-md-5"],["class","md-form form-group ht-40",4,"ngIf"],[1,"col-md-4","pr0","align-self-center","text-right"],[1,"md-form","form-group","ht-40"],["appearance","outline",1,"onSiteStatus","example-full-width","full-width","occurencetime","max-width-unset"],["aria-label","arrivedat","id","txtArrivedAt","matInput","","type","time","step","60",1,"themeinput",3,"ngModelChange","ngModel"],["fxLayout","row wrap","fxLayoutAlign","left space-between",1,"form-row"],["fxLayout","row wrap","fxLayoutAlign","flex-end",1,"formgroup-lt","width100","themedatefx1"],["id","lbl_alternatedate",1,"padt-5"],[1,"alternateCancelBtn"],[1,"md-form","form-group","width60Percent"],["id","txtALternateDate","matInput","",1,"themeinput",3,"ngModelChange","dateChange","matDatepicker","ngModel","min"],["fxLayout","column","fxLayoutGap","10px"],["id","btnalternate","name","alternate","mat-raised-button","","color","accent",1,"themebtnbg","width100",3,"click"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],["class","row",4,"ngIf"],[1,"col-md-3","align-self-center","pr0","text-right"],["id","lblusage",1,"w40-lg"],["class","required",4,"ngIf"],[1,"col-md-9"],[1,"md-form","form-group","thirdbox"],["appearance","outline",1,"example-full-width","full-width","occurencetime","max-width-unset"],["aria-label","Usage","id","txtKMS","matInput","","type","text","inputmode","numeric","digitOnly","",1,"themeinput",3,"ngModelChange","change","ngModel","min","max","decimal"],[1,"md-form","form-group","totalcout","align-self-center","pr0","pl0"],["id","lbl_kms"],[1,"col-md-3"],["fxLayout","row-reverse"],[1,"col-md-4","col-sm-12","col-xs-12"],[1,"col-md-8","col-sm-12","col-xs-12","text-right"],["id","btninprogress","name","inprogress","class","themebtnbg","mat-raised-button","","color","accent",3,"disabled","click",4,"ngIf"],["id","btninprogress","name","inprogress","mat-raised-button","","color","accent",1,"themebtnbg",3,"click","disabled"],["fxLayout","row wrap","fxLayoutAlign","left space-between",1,"form-row","ovrflow-bw"],["fxFlex","50%","fxLayoutAlign","start"],["id","div_totalcost"],["id","lbl_totalcost"],["fxFlex","50%","fxLayoutAlign","end",1,"pt-10"],["id","btnRebuild","name","Rebuild","class","themebtnbg rebuildBtnPadding","mat-raised-button","","color","accent",3,"click",4,"ngIf"],["id","btninvoice","name","invoice","class","themebtnbg mr-10 rebuildBtnPadding","mat-raised-button","","color","accent",3,"click",4,"ngIf"],["id","btnRebuild","name","Rebuild","mat-raised-button","","color","accent",1,"themebtnbg","rebuildBtnPadding",3,"click"],["id","btninvoice","name","invoice","mat-raised-button","","color","accent",1,"themebtnbg","mr-10","rebuildBtnPadding",3,"click"],["fxLayout","row wrap","fxLayoutAlign","left space-between",1,"form-row","themeinputgrp","field-border-4px","width100"],["fxLayout","column wrap","fxLayoutAlign","center flex-start",1,"formgroup-lt","width100","reasoninput","height50"],["id","lbl_reason",1,"width30"],[1,"md-form","form-group","width100","textareagrp","flexstyle-100"],["aria-label","Reason","id","txtReason","matInput","","maxlength","1000",1,"themeinput",3,"ngModelChange","keypress","change","ngModel"],["id","JobInspecPdf",1,"width100"],[1,"j
1obInspectionPdf","width100"],[1,"row","width100","text-center"],["class","col-md-4",4,"ngIf"],[1,"col-md-4","placeContentcenter"],["id","btnRebuildJobCard","name","btnRebuildJobCard","class","themebtnbg rebuildBtnPadding","mat-raised-button","","color","accent",3,"click",4,"ngIf"],[1,"col-md-4"],["id","btnJobInspecPdf","mat-icon-button","","name","JobInspecPdf",3,"click"],["id","pdf","src","assets/pdf.svg","width","33px","height","33px","alt","pdf",1,"iconColor"],["class","font-size-12px",4,"ngIf"],[1,"font-size-12px"],["mat-icon-button","","id","btnJobmaintenanceRepairPdf","name","JobmaintenanceRepairPdf",3,"click"],["id","btninvoiced","name","btninvoiced","mat-icon-button","",3,"click"],["id","btnRebuildJobCard","name","btnRebuildJobCard","mat-raised-button","","color","accent",1,"themebtnbg","rebuildBtnPadding",3,"click"],[1,"mobcolumn","fl-r","pr10"],["id","btnonsite","name","onsite","class","themebtnbg","mat-raised-button","","color","accent",3,"disabled","click",4,"ngIf"],["class","md-form form-group occurencetime width100 inputgroupc",3,"marginTop",4,"ngIf"],["fxLayout","row-reverse",3,"marginTop",4,"ngIf"],["fxLayout","row-reverse","class","backdate-button",3,"marginTop",4,"ngIf"],["id","btnonsite","name","onsite","mat-raised-button","","color","accent",1,"themebtnbg",3,"click","disabled"],["id","btnviewdetails","name","viewdetails","mat-raised-button","","color","accent",1,"themebtnbg",3,"click"],["id","btnclosejob","name","closejob","class","themebtnbg","mat-raised-button","","color","accent",3,"click",4,"ngIf"],["id","btnclosejob","name","closejob","mat-raised-button","","color","accent",1,"themebtnbg",3,"click"],["fxLayout","row-reverse",1,"backdate-button"],["
1id","btnbackdate","name","backdate","mat-raised-button","","color","accent",1,"themebtnbg",3,"click"],[1,"fl-r","mrgr-18"],["id","btnsave","name","save","class","themebtnbg","mat-raised-button","","color","accent",3,"click",4,"ngIf"],["id","rebook","name","rebook","mat-raised-button","","color","accent",1,"themebtnbg",3,"click"],["id","btnsave","name","save","mat-raised-button","","color","accent",1,"themebtnbg",3,"click"],["fxLayout","row","fxLayoutAlign","center center",1,"supervisorSignRow"],["id","lblForemanSign","name","lblForemanSign",1,"wt-auto","text-left","ftwt-bold"],[1,"signBox"],["fxFlex","100%","class","text-left pos-relative",4,"ngIf"],["class","text-left",4,"ngIf"],["fxFlex","100%",1,"text-left","pos-relative"],["id","imgForemanSign","width","181px","height","46px","src","assets/plain-white-background.jpg","alt","Foreman Sign",1,"img-bdr-w181-h46"],["id","signPad","src","assets/buttonIcons/signPad.svg","alt","sign","onKeyDown","saveSignToJob()","height","32px","width","36px",1,"iconColor","p-x0-y2","imgh32w36","imgh32w36-pos",3,"click"],[1,"text-left"],["id","imgShowForemanSign","alt","Foreman Sign","width","181px","height","46px",1,"img-bdr-w181-h46",3,"src"],[1,"img-bdr-w181-h46"],["id","signPad","onKeyDown","showSignPadClick()","src","assets/buttonIcons/signPad.svg","alt","sign","height","32px","width","36px",1,"iconColor","p-x0-y2","imgh32w36","imgh32w36-pos",3,"click"],["id","btnawaitingsignoff","name","awaitingSignoff","mat-raised-button","","color","accent",1,"themebtnbg",3,"click","disabled"],["id","btncomplete","name","complete","mat-raised-button","","color","accent",1,"themebtnbg",3,"click","disabled"],["id","btnreview","name","review","mat-raised-button","","color","accent",1,"themebtnbg",3,"click","disabled"],["id","btncancel","name","cancel","class","themebtncancelbg","mat-raised-button","","color","accent",3,"click",4,"ngIf"],["id","btncancel","name","cancel","mat-raised-button","","color","accent",1,"themebtncancelbg",3,"click"],["id","btnbook","name","book","class","themebtnbg width100","mat-raised-button","","color","accent",3,"disabled","click",4,"ngIf"],["id","btnbook","name","book","mat-raised-button","","color","accent",1,"themebtnbg","width100",3,"click","disabled"],[1,"col-md-8"],["class","col-md-4 pos-relative pad-0 text-center white",4,"ngFor","ngForOf"],[1,"col-md-1"],[1,"col-md-4","pos-relative","pad-0","text-center","white"],[1,"mb-30","mt-10"],[1,"wizardCircle","pos-relative",3,"ngClass"],[1,"mb-0","padtop-20","txt-header"],[1,"createJobstepperTitle"],["class","wizard-divider",3,"ngClass",4,"ngIf"],[1,"wizard-divider",3,"ngClass"],[1,"partsBubbleCount"],["id","tabScheduleAddJob","label","Schedule"],["id","tabSchedule","label","Schedule",3,"disabled"],[1,"smpad-0"],[1,"full-width","mb-45","orgchartform"],["fxLayout","row wrap","fxLayoutAlign","left space-between",1,"form-row","themeinputgrp","field-border-4px","themeinputgrpb",3,"ngClass"],["fxFlex","70%","fxFlex.sm","100%","fxFlex.xs","100%"],[1,"smpad-0","mlt-20","mr-20"],["fxLayout","row",4,"ngIf"],["fxLayout","row"],["fxFlex","33.3%","fxLayout","column",1,"flexinlinestyle"],[4,"ngFor","ngForOf","ngForTrackBy"],["class","m-b-30",4,"ngFor","ngForOf","ngForTrackBy"],[1,"example-card","mat-card-tasks"],["fxLayout","row","fxLayoutAlign","start start"],["mat-card-avatar","",1,"example-header-image"],["class","green-color-circle","aria-hidden","true",4,"ngIf"],["class","gray-color-circle","aria-hidden","true",4,"ngIf"],["matTooltipClass","mat-tooltip-below-spacer",1,"taskSubTitle","texOverflowEllipsis","mbtm-10",3,"matTooltip"],[1,"colortransparent"],["fxLayout","column","fxLayoutAlign","start start"],["fxFlex","100%","fxLayout","row formgroup-lt wrap",1,"form-row","themeinputgrp","pl0","pbt-0","field-border-4px"],["appearance","outline",1,"mat-gb-color","example-full-width"],["required","","name","Platform",1,"themeinput",3,"ngModelChange","selectionChange","id","ngModel"],[3,"value",4,"ngFor","ngForOf","ngForTrackBy"],[1,"job-task-btns"],["fxLayout","column","fxLayoutGap","15px"],["mat-raised-button","","color","primary","id","inspecViewTaskDetail
1s",1,"themebtnbg","full-width",3,"click"],["id","insAddToJob","class","themebtnbg full-width","mat-raised-button","","color","primary",3,"click",4,"ngIf"],["id","inspRemoveJob","class","themebtnbg full-width","mat-raised-button","","color","failure",3,"click",4,"ngIf"],["aria-hidden","true",1,"green-color-circle"],["aria-hidden","true",1,"gray-color-circle"],["id","insAddToJob","mat-raised-button","","color","primary",1,"themebtnbg","full-width",3,"click"],["id","inspRemoveJob","mat-raised-button","","color","failure",1,"themebtnbg","full-width",3,"click"],["class","themebtnbg full-width","mat-raised-button","","color","primary","id","mainAddParts",3,"click",4,"ngIf"],["class","themebtnbg full-width","mat-raised-button","","color","primary","id","mainAddParts","disabled","",4,"ngIf"],["mat-raised-button","","color","primary","id","mainViewTaskDetails",1,"themebtnbg","full-width",3,"click"],["id","mainAddToJob","class","themebtnbg full-width","mat-raised-button","","color","primary",3,"click",4,"ngIf"],["id","mainRemoveJob","class","themebtnbg full-width","mat-raised-button","","color","failure",3,"click",4,"ngIf"],["mat-raised-button","","color","primary","id","mainAddParts",1,"themebtnbg","full-width",3,"click"],["mat-raised-button","","color","primary","id","mainAddParts","disabled","",1,"themebtnbg","full-width"],["id","mainAddToJob","mat-raised-button","","color","primary",1,"themebtnbg","full-width",3,"click"],["id","mainRemoveJob","mat-raised-button","","color","failure",1,"themebtnbg","full-width",3,"click"],[1,"m-b-30"],["class","example-card mat-card-tasks",4,"ngIf"],["class","themebtnbg full-width","mat-raised-button","","color","primary","id","repairAddParts",3,"click",4,"ngIf"],["class","themebtnbg full-width","mat-raised-button","","color","primary","id","repairAddParts","disabled","",4,"ngIf"],["mat-raised-button","","color","primary","id","repairViewTaskDetails",1,"themebtnbg","full-width",3,"click"],["id","repairAddToJob","class","themebtnbg full-width","mat-raised-button","","color","primary",3,"click",4,"ngIf"],["id","repairRemoveJob","class","themebtnbg full-width","mat-raised-button","","color","failure",3,"click",4,"ngIf"],["mat-raised-button","","color","primary","id","repairAddParts",1,"themebtnbg","full-width",3,"click"],["mat-raised-button","","color","primary","id","repairAddParts","disabled","",1,"themebtnbg","full-width"],["id","repairAddToJob","mat-raised-button","","color","primary",1,"themebtnbg","full-width",3,"click"],["id","repairRemoveJob","mat-raised-button","","color","failure",1,"themebtnbg","full-width",3,"click"],["class","col-md-12",4,"ngIf"],[1,"col-md-12"],[1,"loaderGif","taskLoader"],[1,"badgefilter"],[1,"rowflx"],[1,"filterlab"],[1,"hgtxt","plannerbadgCancelled","badght"],[1,"expandhgtxt"],[1,"hgtxt","plannerbadgInprogress","badght"],[1,"hgtxt","plannerbadgOnHold","badght"],[1,"hgtxt","plannerbadgCompleted","badght"],[1,"task-classification-wrapper","pad-10"],[1,"task-classification-header"],[1,"link-btn","mbtm-10","pad-0","cursor-auto"],["class","txt-header",4,"ngIf"],["fxLayout","row","fxLayoutGap","8px"],["mat-raised-button","","color","primary","title","Add Cost",1,"task-cost-add-btn",3,"click","disabled"],["class","task-cost-add-btn","mat-raised-button","","color","primary","title","Recharge",3,"disabled","click",4,"ngIf"],[1,"width100","task-classification-summary"],["fxLayout","row","fxLayoutGap","20px",4,"ngIf"],["class","task-classification-summary-row comment-row",4,"ngIf"],["fxFlex","100%","class","task-cost-section",4,"ngIf"],["mat-raised-button","","color","primary","title","Recharge",1,"task-cost-add-btn",3,"click","disabled"],["fxLayout","row","fxLayoutGap","20px"],["fxFlex","50%"],[1,"task-classification-summary-row"],[1,"task-classification-summary-label"],[1,"task-classification-summary-value"],[1,"task-classification-summary-row","comment-row"],["fxFlex","100%",1,"task-cost-section"],["class","task-cost-item",4,"ngIf"],[1,"task-cost-item"],[1,"task-cost-value"],["aria-hidden","false","aria-label","Inspection Menu","id","InspectionMenu","name","InspectionMenu",1,"workshop-task-icons","workshop-inspec-task-icon","iconColrToGreen"],["id","lblInspection",1,"txt-header","padl-5","mb-0"],["class","mbtm-10 row",4,"ngFor","ngForOf","ngForTrackBy"],[1,"mbtm-10","row"],[1,"col-md-4","inspecTaskBgColor","taskFirstCol","pos-relative"],[1,"col-md-12","pad-10","taskFirstColWidth"],["id","lblInspectionTaskName",1,"txt-header"],["fxFlex","30%",1,"white"],["fxFlex","70%","fxLayout","row formgroup-lt wrap",1,"form-row","themeinputgrp","pl0","pbt-0","field-border-4px"],["id","selInspecEngineerJob","required","","name","Platform",1,"themeinput",3,"ngModelChange","selectionChange","ngModel","disabled"],[1,"white"],["class","themebtnbg","mat-raised-button","","color","primary","id","btnsetToInprogress",3,"click",4,"ngIf"],[1,"text-right","clickMeBtn"],["class","themebtnbg mat-failure","mat-raised-button","","color","primary","id","inspecCancelTask",3,"disabled","click",4,"ngIf"],["mat-raised-button","","color","primary","id","inspecViewTaskDetail
1s",1,"themebtnbg",3,"click"],["mat-raised-button","","color","primary",1,"themebtnbg",3,"click","disabled"],[1,"col-md-6","taskSecondCol","inspecTaskBorderColor","pos-relative"],[1,"xyaxis-center"],[1,"col-md-2","task-col","task-status-col"],[1,"xyaxis-center","white"],["mat-raised-button","","color","primary","id","btnsetToInprogress",1,"themebtnbg",3,"click"],["mat-raised-button","","color","primary","id","inspecCancelTask",1,"themebtnbg","mat-failure",3,"click","disabled"],["src","/assets/tachographIcon_white.svg","alt","","width","40px","height","40px",1,"workshop-task-icons","workshop-maintenance-task-icon"],["id","lblMaintenance",1,"txt-header","padl-5"],[1,"col-md-4","maintenanceTaskBgColor","taskFirstCol","pos-relative"],["id","lblMaintenanceTaskTit",1,"txt-header"],["id","selMainEngineerJob","required","","name","Platform",1,"themeinput",3,"ngModelChange","selectionChange","ngModel","disabled"],["class","themebtnbg mat-failure","mat-raised-button","","color","primary","id","mainViewCancelTask",3,"disabled","click",4,"ngIf"],["mat-raised-button","","color","primary","id","mainViewTaskDetails",1,"themebtnbg",3,"click"],[1,"col-md-6","taskSecondCol","maintenanceTaskBorderColor","pos-relative"],[1,"col-md-6"],["fxLayout","row","fxLayoutAlign","start center",1,"link-btn","mr-t-b","pad-0","cursor-auto","picklist-title-row"],["id","lblMaintenanceTaskPickList",1,"txt-header"],["mat-raised-button","","color","primary",1,"themebtnbg","open-list-inline-btn",3,"click","disabled"],[1,"picklist-metrics-grid"],[1,"picklist-metric-cell"],[1,"picklist-metric-label"],[1,"picklist-metric-value"],[1,"col-md-2","task-col"],["mat-raised-button","","color","primary","id","mainViewCancelTask",1,"themebtnbg","mat-failure",3,"click","disabled"],["src","/assets/workshopIcon_white.svg","alt","","width","40px","height","40px",1,"workshop-task-icons","workshop-defect-task-icon"],["id","lblDefectRepair",1,"txt-header","padl-5"],[1,"col-md-4","repairTaskBgColor","taskFirstCol","pos-relative"],["id","lblDefectQstn","class","txt-header",4,"ngIf"],["id","lblDefectRepairTaskTit",1,"txt-header"],["id","lblDefectRepairTaskFirstComment",1,"txt-header"],["id","selDefectEngineerJob","required","","name","Platform",1,"themeinput",3,"ngModelChange","selectionChange","ngModel","disabled"],[1,"text-right","clickMeBtnDefect"],[1,"width100","text-center"],["id","editDefectCommentIcon","class","iconColor cursor-pointer","aria-hidden","true","onKeyDown","startEditDefectComment('defectCommentHistory',repairObj)",3,"click",4,"ngIf"],["class","themebtnbg mat-failure","mat-raised-button","","color","primary","id","repairViewCancelTask",3,"disabled","click",4,"ngIf"],["mat-raised-button","","color","primary","id","repairViewTaskDetails",1,"themebtnbg",3,"click"],[1,"taskSecondCol","repairTaskBorderColor","col-md-2","repair-picklist-with-classification","pos-relative"],[1,"defect-picklist-content","col-md-12"],["id","lblDefectRepairTaskPickList",1,"txt-header"],[1,"picklist-metrics-grid-single-col"],[1,"col-md-4","taskSecondCol","repairTaskBorderColor","taskClassificationCol","pos-relative"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["id","lblDefectQstn",1,"txt-header"],["id","editDefectCommentIcon","aria-hidden","true","onKeyDown","startEditDefectComment('defectCommentHistory',repairObj)",1,"iconColor","cursor-pointer",3,"click"],["mat-raised-button","","color","primary","id","repairViewCancelTask",1,"themebtnbg","mat-failure",3,"click","disabled"],["aria-hidden","false","aria-label","advisorydefectIcon","id","advisorydefectIcon","name","advisorydefectIcon",1,"workshop-task-icons","workshop-advisory-task-icon","advisoryDefecticonColr"],[1,"col-md-5","advisoryTaskBgColor","taskFirstCol","pos-relative"],[1,"col-md-5","taskSecondCol","advisoryTaskBorderColor","pos-relative"],["id","tabParts","label","Parts\xa0\xa0\xa0\xa0",3,"disabled"],[1,"divmargin"],["fxFlex","50%","fxLayout","row",1,"flexinlinestyle"],["mat-icon-button","","id","btnTabAddPart",3,"click","ngClass","disabled"],["src","assets/addIcon.svg","width","33px","height","33px","alt","addicon",1,"iconColor"],["class","padlr15 width50 text-right clearFilterDiv",4,"ngIf"],["fxLayout","row",1,"fieldsgrp"],["id","agg_partList","rowSelection","multiple",1,"ag-theme-alpine","aggridht-450",3,"rowClicked","firstDataRendered","rowData","columnDefs","components","pagination","paginationPageSize","rowGroupPanelShow","rowBuffer","gridOptions"],[1,"padlr15","width50","text-right","clearFilterDiv"],["id","lbl_jobPartFilterTxt",1,"mrg-rt"],["id","lbl_jobPartFilterBtn","mat-raised-button","","color","primary",1,"clearFilterBtn",3,"click"],["id","tabCostCharges","label","Cost / Charges"],["class","mt-ht",4,"ngIf"],[1,"mt-ht"],[1,"text-center","f20"],[3,"re
1chargeClick","costDataChanged","jobId","AssetId","pSupplierId","pJobTasks","showRechargeButton","canShowRechargeButton","showUploadButton","showEstimatedCost","estimatedCost"],["id","tabJobDocuments","label","Documents"],[1,"aggridCustomFilter"],[1,"tab-container","rounded-lg","flex","p-2","space-x-4"],[1,"text-right","marign-right-15"],[1,"aggridTopRowFilter","rounded-lg","flex","p-2","space-x-4","width100"],[1,"col-md-2"],["fxLayout","row wrap","fxLayoutAlign","center center",1,"themeinputgrpm"],[1,"md-form","form-group","width100"],["id","agGridSearchField","appearance","outline",1,"search-field"],["matPrefix","","id","agGridSearchMatIcon"],["matInput","","placeholder","Search any column",3,"ngModelChange","ngModel"],[1,"col-md-2","contentCenter"],[1,"text-right","rightSideBtnGrp"],["mat-raised-button","","color","primary",3,"click"],["id","addDocBtnIcon",1,"addDocBtnIcon"],["id","agg_jobDocument",1,"ag-theme-alpine","aggridht-650","pos-relative","newViewAggrid",3,"sortChanged","filterChanged","firstDataRendered","columnResized","columnPinned","columnMoved","columnVisible","columnValueChanged","columnRowGroupChanged","onColumnPivotChanged","paginationChanged","rowSelected","rowData","columnDefs","components","pagination","paginationPageSize","rowGroupPanelShow","columnTypes","rowBuffer","gridOptions","quickFilterText","sideBar","suppressRowClickSelection"],["mat-button","",1,"filter-btn",3,"click"],[1,"badge"],[1,"highlightColorText","clearFilter",3,"click","keypress"],["id","tabContacts","label","Contacts"],[3,"orgIDs","workshopId","jobId"],["id","tabAssetAgreements","label","Asset Agreements"],[3,"AssetId","readOnly","assetUsageIn","assetOperatorOrgId"],["id","tabCommsLog","label","Comms Log"],[3,"jobId","assetId"],["id","tabScheduleUpdateJob","label","Schedule"],["id","tabJobHistory","label","History"],["id","agg_partList","class","ag-theme-alpine aggridht-450",3,"rowData","columnDefs","paginationPageSize","pagination","rowGroupPanelShow","rowBuffer","firstDataRendered",4,"ngIf"],["id","agg_partList",1,"ag-theme-alpine","aggridht-450",3,"firstDataRendered","rowData","columnDefs","paginationPageSize","pagination","rowGroupPanelShow","rowBuffer"],["fxLayout","row","fxLayoutGap","25px",1,"job-create-bntgrp","pos-relative"],["fxLayout","row","fxLayoutGap","25px",1,"jobcreate-prenextbtn"],["fxLayout","column","fxLayoutAlign","center",1,"mr-t-b"],["mat-raised-button","","color","primary",1,"maxwt-100",3,"click","id","disabled"],["fxLayout","row","fxLayoutGap","25px",1,"jobcreate-discardcreatebtn"],["name","cancel","class","maxwt-100 mat-failure","mat-raised-button","","color","primary",3,"id","disabled","click",4,"ngIf"],["id","discardJobRequestBtn","name","cancel","class","maxwt-100 mat-failure","mat-raised-button","","color","primary",3,"disabled","click",4,"ngIf"],["id","createJobRequestBtn","class","maxwt-100","mat-raised-button","","color","primary",3,"disabled","click",4,"ngIf"],["name","cancel","mat-raised-button","","color","primary",1,"maxwt-100","mat-failure",3,"click","id","disabled"],["id","discardJobRequestBtn","name","cancel","mat-raised-button","","color","primary",1,"maxwt-100","mat-failure",3,"click","disabled"],["id","Create Job","class","maxwt-100","mat-raised-button","","color","primary",3,"disabled","click",4,"ngIf"],["id","saveUpdatedJobTask","class","maxwt-100","mat-raised-button","","color","primary",3,"disabled","click",4,"ngIf"],["id","Create Job","mat-raised-button","","color","primary",1,"maxwt-100",3,"click","disabled"],["id","saveUpdatedJobTask","mat-raised-button","","color","primary",1,"maxwt-100",3,"click","disabled"],["id","createJobRequestBtn","mat-raised-button","","color","primary",1,"maxwt-100",3,"click","disabled"],["fxLayout","row warp","fxLayout.sm","column warp","fxLayoutAlign","left space-between","fxLayoutGap","5%","fxLayoutGap.sm","0%",1,"form-row","themeinputgrp","field-border-4px","tnygrp"],["fxLayout","row","fxFlex","50%","fxFlex.sm","100%","fxLayoutAlign","center center",1,"formgroup-lt"],["fxLayout.sm","column","fxLayout","row wrap","fxLayoutAlign","left space-between",1,"form-row","themeinputgrp","field-border-4px","themeinputgrpb","tnygrp"],["fxLayout","row","fxFlex","50%","fxFlex.sm","100%","fxLayout","warp","fxLayoutAlign","center center",1,"formgroup-lt"],["class","form-row themeinputgrp field-border-4px themeinputgrpb tnygrp","fxLayout.sm","column","fxLayout","row wrap","fxLayoutAlign","left space-between",4,"ngIf"],["fxLayout.sm","column","fxLayout","row wrap",1,"form-row","themeinputgrp","field-border-4px","themeinputgrpb","tnygrp"],["fxLayout","row","fxLayoutGap","10px","class","job-create-bntgrp justifyContentcenter",4,"ngIf"],["fxLayout","row","fxLayoutGap","10px",1,"job-create-bntgrp","justifyContentcenter"],["fxLayout","column","fxLayoutAlign","center","class","mr-t-b",4,"ngIf"],["fxLayout","column","fxLayoutAlign","center",1,"mr-t-b","assetinfo-vrm-label"],["fxLayout","column","fxLayoutAlign","center",1,"mr-t-b","assetinfo-vrm-value"],["id","SearchJobAsset","name","search","mat-raised-button","","color","primary",1,"searchAssetBtn",3,"click"],[1,"supplierReqFlowContainer"],["id","supplierRowText",1,"supplierRowText"],[1,"supplierReqFlowStatus"],["class","supplierReqFlowWrapper",4,"ngFor","ngForOf"],[1,"supplierReqFlowWrapper"],[1,"supplierInfo"],[1,"supplierFlowCount",3,"ngClass"],["
1id","supStepName",1,"supStepName"],["class","supplierFlowGap",4,"ngIf"],[1,"supplierFlowGap"],["id","customerRowText",1,"supplierRowText"],["fxLayout","row","fxLayoutAlign","end center",1,"width100","task-cost-recharge-row"],["id","chkRechargeToOperator","name","chkRechargeToOperator",3,"ngModelChange","ngModelOptions","ngModel"],["fxLayout","row","fxLayoutGap","5px","fxLayoutAlign","space-between center","class","single-file",4,"ngIf"],["fxLayout","row","fxLayoutGap","5px","fxLayoutAlign","space-between center",1,"single-file"],["id","drag_and_drop","src","../../../assets/drag_and_drop/ic-file.svg","width","25px","height","25px","alt","file"],[1,"info"],["id","download","src","../../../assets/icons8-eye-24.png","width","20px","height","26px","alt","file","onKeyDown","showFile(file.defectdocAT)",1,"iconColor",3,"click"],["id","deleteFile","src","../../../assets/drag_and_drop/ic-delete-file.svg","width","20px","height","26px","alt","file","onKeyDown","confirmModel('confirm',i)",1,"iconColor",3,"click"],["type","file","id","costfileDropReference",1,"fileDrophide",3,"change"],["id","uploadIcon","src","../../../assets/uploadIcon.svg","width","90px","height","74px","alt","",1,"uploadicon",3,"ngStyle"],[1,"uploadercontent"],["id","lbl_select-file","for","costfileDropReference"],[1,"parsed-cost-supplier"],[1,"width100","parsed-cost-results"],["fxLayout","row","fxLayoutAlign","space-between center",1,"parsed-cost-total"],["id","btnUseParsedTotal","mat-raised-button","",1,"defaultbtn","camicon",3,"click"],["fxLayout","row","fxLayoutAlign","space-between center","class","parsed-cost-line",4,"ngFor","ngForOf"],["fxLayout","row","fxLayoutAlign","space-between center",1,"parsed-cost-line"],[1,"parsed-cost-line-desc",3,"title"],[1,"parsed-cost-line-qty"],[1,"parsed-cost-line-amount"],["mat-raised-button","",1,"defaultbtn","camicon",3,"click","id"],[1,"form-row","themeinputgrp","task-cost-form","defect-recharge-form"],["fxLayout","row","fxLayoutAlign","space-between center","class","width100 task-cost-recharge-row",4,"ngIf"],[1,"defect-recharge-section-title"],[1,"label-auto"],["matInput","","disabled","",3,"value"],["id","txtCustomerDetails","aria-label","Customer Details","matInput","","rows","2","disabled","",3,"value"],["id","txtRechargePercent","aria-label","Margin Percentage","matInput","","type","number","min","0","max","100","step","0.01",1,"themeinput",3,"input","change","ngModelChange","ngModel"],[1,"defect-classification-wrapper","width100"],["fxLayout","column",1,"width100"],["fxLayout","row wrap","fxLayoutAlign","space-between center","fxFlex","48",1,"columnflx-xs"],["appearance","outline",1,"width100","mat-gb-color","task-classification-dropdown"],["id","defect_category",3,"ngModelChange","ngModel","disabled"],["id","defect_subCategory",3,"ngModelChange","ngModel","disabled"],["id","defect_component",3,"ngModelChange","ngModel","disabled"],["id","defect_action",3,"ngModelChange","ngModel","disabled"],["id","defect_position",3,"ngModelChange","ngModel","disabled"],["id","defect_reason",3,"ngModelChange","ngModel","disabled"],["matInput","","rows","2","aria-label","Classification Comment","disabled","",3,"value"],["fxLayout","row","fxLayoutAlign","end center","fxLayoutGap","16px",1,"width100","task-cost-recharge-row"],[3,"ngModelChange","change","ngModel"],["id","txtCustomerMarginPercent","aria-label","Customer Margin %","matInput","","type","number","min","0","max","100","step","0.01",1,"themeinput",3,"change","ngModelChange","disabled","ngModel"],["id","lblRechargeVat",1,"label-auto"],["id","ddlRechargeVatType","aria-label","Select VAT type","name","ddlRechargeVatType",3,"ngModelChange","ngModel"],[1,"label-auto","font-weight-600"],["fxLayout","row","fxLayoutAlign","space-between center",1,"width100","task-cost-recharge-row"],["mat-raised-button","","color","accent",3,"click","disabled"],[1,"font-weight-600"],["id","lbl_RequestType","fxFlex","25%"],["fxFlex","75%",1,"md-form","form-group","grp2"],[4,"ngIf","ngIfElse"],[1,"request-mode-value"],[1,"jobDoingSessionOptions",3,"ngModelChange","change","ngModel"],["id","lbl_RequestMode","fxFlex","25%"],["id","lbl_AllocationTime","fxFlex","25%"],["id","lblCus_Ref","fxFlex","25%","name","lblCus_Ref"],["fxFlex","75%","fxLayout","warp",1,"md-form","form-group","grp2"],["aria-label","lblWorkName","id","txtworkname","required","","matInput","","maxlength","50",1,"themeinput",3,"ngModelChange","ngModel"],["id","lblworkFlowStatus","fxFlex","25%","name","lblWorkFlowStatus"],["id","ddlWorkFlowStatus",1,"themeinput",3,"ngModelChange","selectionChange","ngModel","disabled","compareWith"],["selected","","disabled","","hidden","",3,"value"],["id","lbl_jobCommentLabel","name","jobCommentLabel",1,"jobCommentLabel"],["fxFlex","535px","fxLayout","warp",1,"md-form","form-group","width100","textareagrp","textareaJobComment"],["id","jobCommentLabelTextarea","name","jobCommentLabelTextarea","aria-label","textareaal","type","text","placeholder","Enter Comment Here","maxlength","1000","matInput","",1,"themeinput-lg","mt-0","field-border-4px","jobCommentNewBook",3,"ngModelChange","ngModel"],["id","lblcustomer","fxFlex","25%","name","lbl
1customer"],["class","md-form form-group grp2","fxFlex","75%",4,"ngIf"],["id","ddlCustomer","panelClass","wideSelectPanelForOptions",1,"themeinput",3,"ngModelChange","selectionChange","ngModel","title"],["id","ddlCustomer","panelClass","wideSelectPanelForOptions",1,"themeinput",3,"ngModelChange","ngModel","disabled","title"],["id","lbl_workshop","fxFlex","25%"],["id","ddlWorkshop","panelClass","wideSelectPanelForOptions",1,"themeinput",3,"ngModelChange","selectionChange","ngModel","title"],["placeholderLabel","Find Workshop",3,"formControl"],["id","ddlWorkshopJob","panelClass","wideSelectPanelForOptions",1,"themeinput",3,"ngModelChange","selectionChange","ngModel","disabled","title"],["id","lbl_jobWorkshopLocation","fxFlex","25%"],["fxFlex","75%",1,"md-form","form-group"],["appearance","outline",1,"example-full-width","workshopLocationSize"],["id","ddlJobWorkshopLocation",1,"themeinput",3,"ngModelChange","selectionChange","ngModel"],["mat-icon-button","","aria-label","options",1,"jobWorkshopLocationMenuActionsIcon","height30",3,"matMenuTriggerFor"],["id","optionIcon","src","assets/optionIcon.svg","width","8px","height","15px","alt","optionicon",1,"iconColor","imgMenuIcon"],["mat-menu-item","",3,"click"],["mat-menu-item","",3,"click","disabled"],["id","iso-table-1","class","iso-table-1 mb-20",4,"ngIf"],["fxLayout","row","fxLayoutAlign","left space-between","class","left-align",4,"ngIf"],["id","iso-table-1",1,"iso-table-1","mb-20"],["aria-hidden","true",1,"w-100p","br-color","mb-20"],[1,"br-color"],["id","jobTabISOWeekTitle",1,"w-200"],["class","w-100",3,"id",4,"ngFor","ngForOf"],["class","br-color",4,"ngFor","ngForOf"],[1,"w-100",3,"id"],["class","quotelistwrap w-100",4,"ngFor","ngForOf"],[1,"quotelistwrap","w-100"],["class","w-200",3,"keypress","click",4,"ngIf"],[1,"w-200",3,"keypress","click"],[1,"assetlist"],["class","divhover",3,"keypress","click",4,"ngIf"],[1,"divtooltip"],[1,"pd-left"],[1,"taskTypeName","badgclr3","pl2","taskType","ft-left"],[1,"ft-ryt"],[1,"divhover",3,"keypress","click"],[1,"taskTypeName","badgclr3","pl2","taskType"],["fxLayout","row","fxLayoutAlign","left space-between",1,"left-align"],["id","btndefect","name","defect","mat-raised-button","","color","accent",1,"themebtnbg",3,"click"],["id","btndefectinsp","name","defectInspection","mat-raised-button","","color","accent",1,"themebtnbg",3,"click"],["fxLayout","row wrap","fxLayout.sm","column wrap","fxLayoutAlign","left space-between","fxLayoutGap","5%","fxLayoutGap.sm","0%",1,"form-row","themeinputgrp","field-border-4px","tnygrp"],["fxLayout","row wrap","fxFlex","50%","fxFlex.sm","100%","fxLayoutAlign","center center",1,"formgroup-lt"],["id","lblJobStartDate","fxFlex","25%","name","lblJobStartDate"],["class","example-full-width","appearance","outline",4,"ngIf"],["fxLayout","row warp","fxFlex","50%","fxFlex.sm","100%","fxLayoutAlign","center center",1,"formgroup-lt"],["id","lblRepeatJob","fxFlex","25%","name","lblRepeatJob"],["id","ddlRepeatJob",1,"themeinput",3,"ngModelChange","ngModel","disabled"],["class","form-row themeinputgrp field-border-4px tnygrp","fxLayout","row wrap","fxLayout.sm","column warp","fxLayoutAlign","left space-between","fxLayoutGap","5%","fxLayoutGap.sm","0%",4,"ngIf"],["class"," form-row themeinputgrp field-border-4px tnygrp","fxLayout","row warp","fxLayout.sm","column warp","fxLayoutAlign","left space-between","fxLayoutGap","5%","fxLayoutGap.sm","0%",4,"ngIf"],["class","form-row themeinputgrp field-border-4px themeinputgrpb tnygrp","fxLayout.sm","column","fxLayout","row wrap","fxLayoutAlign","center center",4,"ngIf"],["id","txtJobStartDate","matInput","",1,"themeinput",3,"ngModelChange","dateChange","ngModel","min","matDatepicker","max"],["id","txtJobStartDate","matInput","","readonly","true",1,"themeinput",3,"ngModelChange","ngModel","min","matDatepicker"],["matSuffix","",3,"for","disabled"],["fxLayout","row wrap","fxLayout.sm","column warp","fxLayoutAlign","left space-between","fxLayoutGap","5%","fxLayoutGap.sm","0%",1,"form-row","themeinputgrp","field-border-4px","tnygrp"],["id","lblJobEndDate","fxFlex","25%","name","lblJobEndDate"],["appearance","outline",1,"example-full-width","wd-50p"],["id","jobEvery","aria-label","Every","type","text","matInput","","inputmode","numeric","digitOnly","",1,"themeinput",3,"ngModelChange","change","ngModel","min","max","decimal"],["appearance","outline",1,"example-full-width","every-interval",3,"ngClass"],["
1id","selJobInterval",1,"themeinput",3,"ngModelChange","selectionChange","ngModel"],["id","lblPredictiveScheduling","fxFlex","25%","name","lblPredictiveScheduling"],["id","chkPredictiveScheduling",3,"ngModelChange","ngModel"],["id","selJobEndDate","matInput","",1,"themeinput",3,"ngModelChange","dateChange","ngModel","matDatepicker","min"],["fxLayout.sm","column","fxLayout","row wrap","fxLayoutAlign","center center",1,"form-row","themeinputgrp","field-border-4px","themeinputgrpb","tnygrp"],["fxLayout","row","fxFlex","50%","fxFlex.sm","100%","fxLayout","wrap","fxLayoutAlign","center center",1,"formgroup-lt"],[3,"sendSelectedAsset","fromWorkShop","parentAssetId","blnAssetWorkShop"],[3,"taskClassificationMainAreaChange","taskClassificationSubCategoryChange","taskClassificationComponentChange","taskClassificationActionChange","taskClassificationPositionChange","taskClassificationReasonChange","taskClassificationCommentBlur","SendCancelCommentHist","reloadData","jobIdForSaveDefectComment","defectRepairId","defectTaskID","taskClassificationData","taskClassificationActionOptions","taskClassificationReasonOptions","disableTaskClassificationEdit"],[1,"loaderGif"],["id","txtJobStartDate","matInput","",1,"themeinput",3,"ngModelChange","ngModel","matDatepicker","disabled"],["id","lblBackDateReasonForemanSign","name","backDateReasonForemanSign",1,"wt-auto","text-left","ftwt-bold"],["id","signPad","src","assets/buttonIcons/signPad.svg","alt","sign","onKeyDown","saveSignToJob(true)","height","32px","width","36px",1,"iconColor","p-x0-y2","imgh32w36","imgh32w36-pos",3,"click"],["id","lblSupervisorPopupForemanSign","name","lblSupervisorPopupForemanSign",1,"wt-auto","text-left","ftwt-bold"],["id","CustomModelName",1,"theme-model-lg"],[3,"defectDocUpdate","sourceType","jobId","caseType","modelName"],["id","lblKeyDateDocType",1,"label-auto"],["id","ddlKeyDateDocumentType","name","ddlKeyDateDocumentType",1,"themeinput",3,"ngModelChange","ngModel"],["id","selectDocOptin",3,"value"],["id","select",3,"value",4,"ngFor","ngForOf"],[3,"refresh","classNames","lookupTypeTitle","lookupTypeNameInDB","masterSvcPropertyName","selectedLookupId"],["id","select",3,"value"],[3,"checked","value"],["id","backdatedReason","matInput","","maxlength","1000","aria-label","backdatedReason",1,"themeinput","descstyle",3,"ngModelChange","change","ngModel"],[1,"columnflx-xs","width100"],["id","completionDate","matInput","","disabled","",1,"themeinput",3,"ngModelChange","ngModel","matDatepicker"],["id","txtJobStartDate","matInput","",1,"themeinput",3,"ngModelChange","ngModel","min","matDatepicker"],["id","txtJobStartDate","matInput","",1,"themeinput",3,"ngModelChange","ngModel","matDatepicker"],[1,"form-row","mt-10","mbtm-10"],["id","btnOpenCreatedPODocument","color","primary","mat-raised-button","",3,"click"]],template:function(a,i){if(1&a){const o=t.RV6();t.DNE(0,Dr,379,165,"div",40)(1,Cr,1,0,"app-loading-spinner",41),t.j41(2,"app-model",42)(3,"div",43)(4,"div",44)(5,"div",45),t.EFF(6),t.j41(7,"button",46),t.bIt("click",function(){return t.eBV(o),t.Njj(i.closeDefectCommentHistoryModal("defectCommentHistory"))}),t.EFF(8,"\xd7 "),t.k0s()()(),t.j41(9,"div",47)(10,"form")(11,"div",48)(12,"div",49)(13,"mat-form-field",50)(14,"textarea",51),t.mxI("ngModelChange",function(d){return t.eBV(o),t.DH7(i.oldestDdefectCommentInfo.comment,d)||(i.oldestDdefectCommentInfo.comment=d),t.Njj(d)}),t.EFF(15,"              "),t.k0s()()()()()(),t.j41(16,"div",52)(17,"button",53),t.bIt("click",function(){return t.eBV(o),t.Njj(i.closeDefectCommentHistoryModal("defectCommentHistory"))}),t.EFF(18),t.k0s(),t.j41(19,"button",54),t.bIt("click",function(){return t.eBV(o),t.Njj(i.updateDefectComment())}),t.EFF(20),t.k0s()()()(),t.j41(21,"app-model",55)(22,"div",43)(23,"div",44)(24,"div",56),t.EFF(25),t.j41(26,"button",57,0),t.bIt("click",function(){return t.eBV(o),i.objScheduleData.backdatedJob=!1,t.Njj(i.handleCompletionDetails())}),t.EFF(28,"\xd7 "),t.k0s()()(),t.j41(29,"div",58)(30,"div",59)(31,"div",60)(32,"div",61)(33,"mat-label",62),t.EFF(34),t.j41(35,"span",63),t.EFF(36,"*"),t.k0s()(),t.j41(37,"div",64)(38,"mat-form-field",65)(39,"input",66),t.mxI("ngModelChange",function(d){return t.eBV(o),t.DH7(i.backdatedDateModel,d)||(i.backdatedDateModel=d),t.Njj(d)}),t.bIt("dateChange",function(){return t.eBV(o),t.Njj(i.backdateAction())}),t.k0s(),t.nrm(40,"mat-datepicker-toggle",67)(41,"mat-datepicker",null,1),t.k0s()()(),t.DNE(43,jr,11,5,"div",68),t.j41(44,"div",61)(45,"mat-label",69),t.EFF(46),t.j41(47,"span",63),t.EFF(48,"*"),t.k0s()(),t.j41(49,"div",70)(50,"mat-form-field",50)(51,"textarea",71),t.mxI("ngModelChange",function(d){return t.eBV(o),t.DH7(i.backdatedReason,d)||(i.backdatedReason=d),t.Njj(d)}),t.bIt("change",function(d){return t.eBV(o),t.Njj(i.updateReason(d))}),t.k0s()()()(),t.DNE(52,Tr,10,4,"div",72),t.nrm(53,"div",61),t.k0s()()(),t.j41(54,"div",73)(55,"div",74)(56,"div",75)(57,"button",76),t.bIt("click",function(){return t.eBV(o),i.objScheduleData.backdatedJob=!1,t.Njj(i.handleCompletionDetail
1s())}),t.EFF(58),t.k0s(),t.DNE(59,Sr,2,2,"button",77),t.k0s()()()()(),t.j41(60,"app-model",78)(61,"div",79)(62,"div",44)(63,"div",56),t.EFF(64),t.j41(65,"button",57,0),t.bIt("click",function(){return t.eBV(o),i.objScheduleData.backdatedJob=!1,t.Njj(i.handleCompletionDetails())}),t.EFF(67,"\xd7 "),t.k0s()()(),t.j41(68,"div",58)(69,"div",59)(70,"div",60),t.DNE(71,Nr,8,4,"div",72),t.nrm(72,"div",61),t.k0s()()(),t.j41(73,"div",73)(74,"div",74)(75,"div",75)(76,"button",76),t.bIt("click",function(){return t.eBV(o),t.Njj(i.closeSupervisorPopup())}),t.EFF(77),t.k0s(),t.j41(78,"button",80),t.bIt("click",function(){return t.eBV(o),t.Njj(i.handleBackdatedJobToClose())}),t.EFF(79,"Close Job"),t.k0s()()()()()(),t.DNE(80,Jr,2,4,"app-model",81),t.j41(81,"app-model",82)(82,"div",43)(83,"div",44)(84,"div",56),t.EFF(85),t.j41(86,"button",57,0),t.bIt("click",function(){return t.eBV(o),t.Njj(i.handleCompletionKeydates(!1))}),t.EFF(88,"\xd7 "),t.k0s()()(),t.j41(89,"div",58)(90,"div",59)(91,"div",60)(92,"div",61)(93,"mat-label",62),t.EFF(94,"Job Completion Date"),t.j41(95,"span",63),t.EFF(96,"*"),t.k0s()(),t.j41(97,"div",83)(98,"mat-form-field",65)(99,"input",84),t.mxI("ngModelChange",function(d){return t.eBV(o),t.DH7(i.objCompletionJobData.completionDate,d)||(i.objCompletionJobData.completionDate=d),t.Njj(d)}),t.bIt("dateChange",function(){return t.eBV(o),t.Njj(i.backdateAction())}),t.k0s(),t.nrm(100,"mat-datepicker-toggle",67)(101,"mat-datepicker",null,2),t.k0s()()(),t.j41(103,"div",61)(104,"mat-label",69),t.EFF(105,"Upload Document"),t.k0s(),t.j41(106,"div",85)(107,"input",86,3),t.mxI("ngModelChange",function(d){return t.eBV(o),t.DH7(i.completionFile,d)||(i.completionFile=d),t.Njj(d)}),t.bIt("change",function(d){return t.eBV(o),t.Njj(i.fileBrowseHandler(d))}),t.k0s()()(),t.DNE(109,Mr,12,8,"div",68),t.j41(110,"div",61)(111,"mat-label",69),t.EFF(112,"Did the Service pass or fail ?"),t.j41(113,"span",63),t.EFF(114,"*"),t.k0s()(),t.j41(115,"div",85)(116,"mat-radio-group",87),t.mxI("ngModelChange",function(d){return t.eBV(o),t.DH7(i.objCompletionJobData.passOrFail,d)||(i.objCompletionJobData.passOrFail=d),t.Njj(d)}),t.j41(117,"mat-radio-button",88),t.EFF(118," Pass"),t.k0s(),t.j41(119,"mat-radio-button",89),t.EFF(120," Fail "),t.k0s()()()(),t.DNE(121,Ar,11,5,"div",68)(122,Er,8,2,"div",68)(123,Or,3,2,"div",90),t.nrm(124,"div",61),t.k0s()()(),t.j41(125,"div",73)(126,"div",74)(127,"div",75)(128,"button",76),t.bIt("click",function(){return t.eBV(o),t.Njj(i.handleCompletionKeydates(!1))}),t.EFF(129),t.k0s(),t.j41(130,"button",91),t.bIt("click",function(){return t.eBV(o),t.Njj(i.handleCompletionKeydates(!0))}),t.EFF(131),t.k0s()()()()()(),t.j41(132,"app-model",92)(133,"div",43)(134,"div",44)(135,"div",56),t.EFF(136),t.j41(137,"button",57,0),t.bIt("click",function(){return t.eBV(o),i.objScheduleData.backdatedJob=!1,t.Njj(i.handleBackdatedJob())}),t.EFF(139,"\xd7 "),t.k0s()()(),t.j41(140,"div",58)(141,"div",59)(142,"div",60)(143,"div",61)(144,"mat-label",69),t.EFF(145),t.j41(146,"span",63),t.EFF(147,"*"),t.k0s()(),t.j41(148,"div",70)(149,"mat-form-field",50)(150,"textarea",71),t.mxI("ngModelChange",function(d){return t.eBV(o),t.DH7(i.backdatedReason,d)||(i.backdatedReason=d),t.Njj(d)}),t.bIt("change",function(d){return t.eBV(o),t.Njj(i.updateReason(d))}),t.k0s()()()(),t.DNE(151,Hr,8,4,"div",72)(152,Yr,11,4,"div",68),t.nrm(153,"div",61),t.k0s()()(),t.j41(154,"div",73)(155,"div",74)(156,"div",75)(157,"button",76),t.bIt("click",function(){return t.eBV(o),i.objScheduleData.backdatedJob=!1,t.Njj(i.handleBackdatedJob())}),t.EFF(158),t.k0s(),t.DNE(159,Ur,2,2,"button",77),t.k0s()()()()(),t.j41(160,"app-model",93)(161,"app-reschedule-jobs-modal",94),t.bIt("rescheduleDecided",function(d){return t.eBV(o),t.Njj(i.onRescheduleDecided(d))})("closeModal",function(){return t.eBV(o),t.Njj(i.closeRescheduleJobsModel())}),t.k0s()(),t.j41(162,"app-model",93)(163,"div",43)(164,"div",44)(165,"div",95),t.EFF(166,"PO Created"),t.j41(167,"button",96),t.bIt("click",function(){return t.eBV(o),t.Njj(i.closePOCreateSuccessModal())}),t.j41(168,"mat-icon",97),t.EFF(169),t.k0s(),t.EFF(170," Close "),t.k0s()()(),t.j41(171,"div",47)(172,"div",98)(173,"div",99),t.EFF(174),t.k0s(),t.j41(175,"div",99),t.EFF(176," This is the PO Number: "),t.j41(177,"b"),t.EFF(178),t.k0s()(),t.DNE(179,Xr,3,0,"div",100),t.k0s()()()()}if(2&a){const o=t.sdS(42),n=t.sdS(102);t.Y8G("ngIf",!i.isloading),t.R7$(),t.Y8G("ngIf",i.isloading),t.R7$(),t.xc7("--modalWidth","40%"),t.R7$(4),t.SpI(" ",i.master.datalist.EditComment,""),t.R7$(8),t.Y8G("ngStyle",t.lJ4(65,Ge)),t.R50("ngModel",i.oldestDdefectCommentInfo.comment),t.R7$(4),t.SpI(" ",i.master.datalist.Cancel," "),t.R7$(2),t.SpI(" ",i.master.datalist.Save," "),t.R7$(5),t.JRh(i.master.datalist.EditDate),t.R7$(9),t.JRh(i.enableBackDatingReasonFieldEdit?i.master.datalist.SelectBookDate:i.master.datalist.SelectedBookDate),t.R7$(5),t.R50("ngModel",i.backdatedDateModel),t.Y8G("max",i.dateFilter())("matDatepicker",o)("disabled",!i.enableBackDatingReasonFieldEdit||i.isNewWorkshopBooking),t.R7$(),t.Y8G("for",o),t.R7$(3),t.Y8G("ngIf",!i.enableBackDatingReasonFieldEdit),t.R7$(3),t.JRh(i.master.datalist.BackdateReason),t.R7$(5),t.R50("ngModel",i.backdatedReason),t.Y8G("disabled",!i.enableBackDatingReasonFieldEdit),t.R7$(),t.Y8G("ngIf",i.enableBackDatingReasonFieldEdit&&(i.showSupervisorSign||i.showSupervisorSignForBackDate(!0))),t.R7$(6),t.JRh(i.enableBackDatingReasonFieldEdit?i.master.datalist.Cancel:i.master.datalist.Close),t.R7$(),t.Y8G("ngIf",i.enableBackDatingReasonFieldEdit),t.R7$(5),t.JRh(i.master.datalist.EditDate),t.R7$(7),t.Y8G("ngIf",i.showSupervisorSign||i.showSupervisorSignForBackDate(!0)),t.R7$(6),t.JRh(i.master.datalist.Cancel),t.R7$(),t.Y8G("disabled",!i.enableBackdateAction),t.R7$(2),t.Y8G("ngIf",!i.isDefectRepairOpen),t.R7$(5),t.JRh(i.master.datalist.JobCompletion),t.R7$(14),t.R50("ngModel",i.objCompletionJobData.completionDate),t.Y8G("max",i.dateFilter())("matDatepicker",n)("disabled",!!i.objScheduleData.backdatedJob),t.R7$(),t.Y8G("for",n),t.R7$(7),t.R50("ngModel",i.completionFile),t.R7$(2),t.Y8G("ngIf",i.assetDocFormat),t.R7$(7),t.R50("ngModel",i.objCompletionJobData.passOrFail),t.R7$(),t.Y8G("checked","pass"==i.objCompletionJobData.passOrFail),t.R7$(2),t.Y8G("checked","fail"==i.objCompletionJobData.passOrFail),t.R7$(2),t.Y8G("ngIf","fail"
1==i.objCompletionJobData.passOrFail),t.R7$(),t.Y8G("ngIf","fail"==i.objCompletionJobData.passOrFail),t.R7$(),t.Y8G("ngForOf",i.mappedKeydate),t.R7$(6),t.JRh(i.master.datalist.Cancel),t.R7$(2),t.JRh(i.master.datalist.ConfirmText),t.R7$(5),t.JRh(i.master.datalist.EditDate),t.R7$(9),t.JRh(i.master.datalist.BackdateReason),t.R7$(5),t.R50("ngModel",i.backdatedReason),t.Y8G("disabled",!i.enableBackDatingReasonFieldEdit),t.R7$(),t.Y8G("ngIf",i.enableBackDatingReasonFieldEdit&&(i.showSupervisorSign||i.showSupervisorSignForBackDate(!0))),t.R7$(),t.Y8G("ngIf",!i.enableBackDatingReasonFieldEdit),t.R7$(6),t.JRh(i.enableBackDatingReasonFieldEdit?i.master.datalist.Cancel:i.master.datalist.Close),t.R7$(),t.Y8G("ngIf",i.enableBackDatingReasonFieldEdit),t.R7$(),t.xc7("--modalWidth","40%"),t.Y8G("id",i.rescheduleJobsModelName),t.R7$(),t.Y8G("futureComplianceJob",i.futureComplianceJob)("assetId",i.assetId)("previousJobBookedDate",i.objJobData.dateBooked),t.R7$(),t.xc7("--modalWidth","50%"),t.Y8G("id",i.poCreateSuccessModalName),t.R7$(7),t.SpI(" ",i.matIconNames.close," "),t.R7$(5),t.SpI(" PO Created & Sent to ",(null==i.poSuccessData?null:i.poSuccessData.supplierEmail)||"-"," "),t.R7$(4),t.JRh((null==i.poSuccessData?null:i.poSuccessData.poNumber)||"-"),t.R7$(),t.Y8G("ngIf",null==i.poSuccessData?null:i.poSuccessData.poDocUrl)}},dependencies:[k.YU,k.Sq,k.bT,k.T3,k.B3,ft.M$,ft.vL,bt.An,at.iV,N.Ky,N.aw,N.av,N.xZ,kt.aL,vt.cu,Dt.d1,J.DJ,J.BO,J.sA,J.UI,Ct.PW,Ct.eI,it.cR,it.pW,it.c_,ot.pI,ot.gy,ot.fS,zt.NZ,b.qT,b.me,b.Q0,b.BC,b.cb,b.YS,b.tU,b.VZ,b.zX,b.l_,O.Vh,O.bZ,O.bU,Qt.X,st.xs,Kt.N,jt.D,b.vS,b.cV,Zt.P2,te.q,ee.K,ae.G,ie.D,se,ne.L,L._m,L.XB,L.Rm,L._I,L.DO,L.RA,re.Pv,le.PD,de.q,ce.T,pe.U9,wt.VT,wt._g,me.b,he.m,ue.$,ge.J,_e.z,fe.A,be.g,ke.P,D.h,Se,k.Jj,k.GH,k.QX,xe.D],styles:[".aggridCustomFilter[_ngcontent-%COMP%]{position:relative}.aggridTopRowFilter[_ngcontent-%COMP%]{border:1px solid var(--trazauraBrandColor);border-bottom:0;border-radius:6px 6px 0 0}  .search-field{height:40px}.contentCenter[_ngcontent-%COMP%]{display:flex;align-items:center}.filter-btn[_ngcontent-%COMP%]{display:flex;align-items:center;border:1px solid var(--trazauraBrandColor);border-radius:6px;padding:6px 12px;height:40px}.badge[_ngcontent-%COMP%]{background-color:#f57c00;color:#fff;border-radius:50%;padding:2px 8px;font-size:12px;margin-left:8px}.clearFilter[_ngcontent-%COMP%]{margin-bottom:0;margin-left:10px;cursor:pointer}  .newViewAggrid .ag-root-wrapper{border:1px solid var(--trazauraBrandColor);border-top-right-radius:0;border-top-left-radius:0}  .newViewAggrid .ag-cell{background-color:#fff;border-bottom:1px solid var(--trazauraBrandColor)}  .newViewAggrid .ag-header{border-bottom:none}  .newViewAggrid .ag-header-row{border-bottom:1px solid var(--trazauraBrandColor)}  .newViewAggrid .ag-row:last-child .ag-cell{border-bottom:1px solid var(--trazauraBrandColor)}  .newViewAggrid .ag-column-drop-horizontal{border-bottom:1px solid var(--trazauraBrandColor)}  .newViewAggrid .ag-side-buttons{border-left:1px solid var(--trazauraBrandColor)}  .newViewAggrid .ag-cell.ag-cell-last-left-pinned:not(.ag-cell-range-right):not(.ag-cell-range-single-cell){border-right:1px solid var(--trazauraBrandColor)}  .newViewAggrid .ag-pinned-left-header{border-right:1px solid var(--trazauraBrandColor)}  .newViewAggrid input.ag-input-field-input{border:1px solid var(--trazauraBrandColor)!important;border-radius:6px}.search-field[_ngcontent-%COMP%]   .mat-form-field-outline[_ngcontent-%COMP%]{color:var(--trazauraBrandColor);border-color:var(--trazauraBrandColor)}  .search-field .mat-form-field-outline-start,   .search-field .mat-form-field-outline-end{border-color:var(--trazauraBrandColor)!important}  .search-field .mat-form-field-wrapper{padding:0!important;margin:0!important;height:40px;display:flex;align-items:center}  .search-field .mat-form-field-flex{height:40px;align-items:center;display:flex}  .search-field .mat-form-field-infix{padding:2px 0 0!important;display:flex;align-items:center;height:40px;border-top:0}  .search-field .mat-input-element{height:40px;line-height:40px;padding:0 8px;margin:0;display:flex;align-items:center;color:var(--trazauraBrandColor)}  .search-field .mat-icon{display:flex;align-items:center;justify-content:center;height:40px;line-height:40px;font-size:20px;color:var(--trazauraBrandColor)}  .search-field .mat-input-element::placeholder{color:var(--trazauraBrandColor);opacity:1}  .search-field.mat-focused .mat-form-field-outline-thick{border-color:var(--trazauraBrandColor)}  .ag-theme-alpine .ag-paging-panel{position:absolute;top:-52px;width:100%;z-index:1;right:156px!important;width:unset;justify-content:flex-start;border:none}  .ag-root-wrapper{position:unset!important}.clickMeBtn1[_ngcontent-%COMP%]{position:absolute;right:10px;top:10px}.jobInspectionPdf[_ngcontent-%COMP%]{left:15px;width:100%}.imgh32w36[_ngcontent-%COMP%]{height:32px;width:36px}.imgh32w36-pos[_ngcontent-%COMP%]{position:absolute;right:0;top:7px}.img-bdr-w181-h46[_ngcontent-%COMP%]{border:black solid 1px;width:145px;height:46px}.task-col[_ngcontent-%COMP%]{border-radius:0 14px 14px 0/0px 14px 14px 0px;position:relative;font-weight:700}.task-row-compact[_ngcontent-%COMP%]{min-height:auto!important}.task-classification-wrapper[_ngcontent-%COMP%]{padding:4px 6px!important;margin-bottom:0!important}.task-classification-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}.task-classification-wrapper[_ngcontent-%COMP%]   .link-btn[_ngcontent-%COMP%]{margin-bottom:5px!important;padding:0!important}.task-classification-wrapper[_ngcontent-%COMP%]   mat-form-field[_ngcontent-%COMP%]{margin-bottom:0!important}.task-classification-wrapper[_ngcontent-%COMP%]   .task-classification-dropdown[_ngcontent-%COMP%]{width:50%!important}.task-classification-grid[_ngcontent-%COMP%]{column-gap:12px;row-gap:2px}.task-classification-wrapper[_ngcontent-%COMP%]   mat-label[_ngcontent-%COMP%]{font-size:15px;font-weight:700}  .task-classification-wrapper .mat-form-field-label{font-size:15px!important;font-weight:700!important}  .task-classification-wrapper .mat-form-field-wrapper{margin:0!important;padding-bottom:0!important}  .task-classification-wrapper .mat-form-field-appearance-outline .mat-form-field-infix{padding:.55em 0!important}  .task-classification-wrapper .mat-form-field-subscript-wrapper{display:none}  .task-classification-wrapper .mat-select-disabled .mat-select-value,   .task-classification-wrapper .mat-select-disabled .mat-select-arrow,   .task-classification-wrapper .mat-input-element:disabled,   .task-classification-wrapper textarea.mat-input-element:disabled{color:#000000de!important;-webkit-text-fill-color:rgba(0,0,0,.87)!important;opacity:1!important}  .task-classification-wrapper .mat-form-field-disabled .mat-form-field-label{color:#0009!important}@media (max-width: 767px){.task-classification-wrapper[_ngcontent-%COMP%]   .task-classification-dropdown[_ngcontent-%COMP%]{width:100%!important}.task-classification-grid[_ngcontent-%COMP%]{column-gap:0;row-gap:6px}}.task-cost-section[_ngcontent-%COMP%]{margin-top:4px;padding:5px;background-color:#f5f5f5;border-radius:4px;max-height:60px;overflow-y:auto;font-size:12px;display:flex;justify-content:space-between}.task-cost-item[_ngcontent-%COMP%]{margin:3px 0;padding:2px}.task-cost-value[_ngcontent-%COMP%]{font-weight:700}.task-cost-add-btn[_ngcontent-%COMP%]{min-width:100px;height:32px;border-radius:4px;line-height:32px;padding:0 12px;font-size:12px;font-weight:600}.task-cost-form[_ngcontent-%COMP%]   .md-form.form-group[_ngcontent-%COMP%]{margin-bottom:4px}.task-cost-recharge-row[_ngcontent-%COMP%]{padding-right:5px;position:relative;z-index:10002}.parsed-cost-actions[_ngcontent-%COMP%]{margin-top:10px;position:relative;z-index:10002}.parsed-cost-supplier[_ngcontent-%COMP%]{font-size:12px;opacity:.8}.parsed-cost-results[_ngcontent-%COMP%]{margin-top:8px;max-height:190px;overflow-y:auto;border:1px solid #e0e0e0;border-radius:4px;position:relative;z-index:10002}.parsed-cost-total[_ngcontent-%COMP%]{padding:6px 8px;font-weight:600;border-bottom:1px solid #e0e0e0}.parsed-cost-line[_ngcontent-%COMP%]{padding:5px 8px;gap:8px;border-bottom:1px solid #f2f2f2}.parsed-cost-line-desc[_ngcontent-%COMP%]{flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
1.parsed-cost-line-qty[_ngcontent-%COMP%], .parsed-cost-line-amount[_ngcontent-%COMP%]{flex:0 0 auto;font-variant-numeric:tabular-nums}.task-classification-summary[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:4px;margin-top:2px}.task-classification-summary-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:150px 1fr;column-gap:10px;align-items:start;padding:4px 6px;border:1px solid #e3e7ec;border-radius:4px;background-color:#fafbfd}.task-classification-summary-label[_ngcontent-%COMP%]{font-weight:700;font-size:12px;color:#22384d}.task-classification-summary-value[_ngcontent-%COMP%]{font-size:12px;color:#000000de;word-break:break-word}.task-classification-summary-row.comment-row[_ngcontent-%COMP%]   .task-classification-summary-value[_ngcontent-%COMP%]{white-space:pre-wrap}.defect-recharge-modal[_ngcontent-%COMP%]   .theme-modeltitle[_ngcontent-%COMP%]   .title.custom[_ngcontent-%COMP%]{font-size:20px;font-weight:700;letter-spacing:.2px}.defect-recharge-form[_ngcontent-%COMP%]{background:linear-gradient(180deg,#f8fbff,#fff 38%);border:1px solid #dde7f2;border-radius:10px;padding:12px 14px!important;max-height:68vh;overflow-y:auto}.defect-recharge-form[_ngcontent-%COMP%]   .label-auto[_ngcontent-%COMP%]{font-size:14px;font-weight:700;color:#21384d}.defect-recharge-section-title[_ngcontent-%COMP%]{width:100%;margin:10px 0 8px;padding-bottom:5px;border-bottom:1px solid #d4e3f0;color:#1c3f5f;font-size:13px;font-weight:700;text-transform:uppercase;letter-spacing:.4px}  .recharge-status-badge{display:inline-flex;align-items:center;justify-content:center;min-width:132px;padding:5px 12px;border-radius:999px;font-size:12px;font-weight:700;letter-spacing:.2px;border:1px solid transparent;box-shadow:inset 0 1px #ffffff73}  .recharge-status-done{color:#0d5f3b;background:linear-gradient(180deg,#eefbf3,#d7f4e2);border-color:#9fddbc}  .recharge-status-pending{color:#8a4b00;background:linear-gradient(180deg,#fff8e8,#ffe8bf);border-color:#f0c97d}.defect-recharge-form[_ngcontent-%COMP%]   .task-classification-wrapper[_ngcontent-%COMP%]{background:#f4f8fc;border:1px solid #dbe7f3;border-radius:8px;padding:8px 10px!important}.defect-recharge-modal[_ngcontent-%COMP%]   .theme-modelfooter[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:10px;padding-top:10px}.defect-recharge-footer-btn[_ngcontent-%COMP%]{min-width:130px}@media (max-width: 767px){.defect-recharge-form[_ngcontent-%COMP%]{padding:10px!important;max-height:64vh}.defect-recharge-modal[_ngcontent-%COMP%]   .theme-modelfooter[_ngcontent-%COMP%]{justify-content:stretch}.defect-recharge-footer-btn[_ngcontent-%COMP%]{width:100%;min-width:100%}}.defect-create-classification[_ngcontent-%COMP%]{margin-top:8px;border-top:1px solid #dde7f2;padding-top:10px!important}.defect-create-classification[_ngcontent-%COMP%]   .task-classification-dropdown[_ngcontent-%COMP%]{width:100%!important}.defect-details-classification[_ngcontent-%COMP%]{margin-bottom:10px}.task-status-col[_ngcontent-%COMP%]{min-width:90px}@media (min-width: 768px){.task-status-col[_ngcontent-%COMP%]{min-width:110px}}.assetHeader[_ngcontent-%COMP%]{display:flex!important;flex:1 1 0;flex-wrap:wrap!important;max-width:100%;min-width:0}.assetHeader[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{flex:0 0 auto;white-space:nowrap}.task-classification-summary-row[_ngcontent-%COMP%]{grid-template-columns:120px 1fr}.iconColrToGreen[_ngcontent-%COMP%]{background-color:#65b201}.clickMeBtn[_ngcontent-%COMP%]{position:absolute;right:10px;bottom:10px}.clickMeBtnDefect[_ngcontent-%COMP%]{position:absolute;right:10px;top:50%;transform:translateY(-50%)}.rtxpanel[_ngcontent-%COMP%]   .md-form.form-group[_ngcontent-%COMP%]{margin-top:0;margin-bottom:0}.workshopLocationSize[_ngcontent-%COMP%]{width:calc(100% - 41px)!important}.taskFirstColWidth[_ngcontent-%COMP%]{width:calc(100% - 140px)}.loaderGif.taskLoader[_ngcontent-%COMP%]{top:50%;left:50%;transform:translate(-50%,-50%);position:absolute}.divfont[_ngcontent-%COMP%]{font-size:20px!important}.job-task-btns[_ngcontent-%COMP%]{position:absolute;right:18px;bottom:16px;width:35%}.viewServiceDetailsPupup[_ngcontent-%COMP%]{padding:11px 21px!important;font-size:18px!important;font-weight:700}.taskFirstCol[_ngcontent-%COMP%]{border-top-left-radius:14px;border-bottom-left-radius:14px}.taskSecondCol[_ngcontent-%COMP%]{border:2px solid;border-left:0;border-right:0}.every-interval[_ngcontent-%COMP%]{width:150px!important;padding-left:30px}.every-interval-custwidth[_ngcontent-%COMP%]{width:225px!important}.assetinfo-vrm-value[_ngcontent-%COMP%]{font-size:18px;background-color:#e0e0e0c9;min-width:158px;height:40px;text-align:center;padding:0 10px;border-radius:4px}.searchAssetBtn[_ngcontent-%COMP%]{position:absolute;
1left:10px}.assetinfo-vrm-label[_ngcontent-%COMP%]{font-size:18px}.createJob[_ngcontent-%COMP%]{font-size:25px;font-weight:700}.emergency-work-title[_ngcontent-%COMP%]{white-space:nowrap;font-size:22px}.createJobstepperTitle[_ngcontent-%COMP%]{font-size:20px;font-weight:700;margin:0;position:absolute;color:#000;left:50%;transform:translate(-50%);bottom:-35px}.job-create-border[_ngcontent-%COMP%]{border:2px solid;border-radius:10px}.jobcreate-discardcreatebtn[_ngcontent-%COMP%]{position:absolute;right:25px}.jobcreate-prenextbtn[_ngcontent-%COMP%]{position:absolute;left:50%;transform:translate(-50%)}.job-create-bntgrp[_ngcontent-%COMP%]{min-height:46px}.wizardCircle[_ngcontent-%COMP%]{height:70px;width:70px;border-radius:50%}.wizard-divider[_ngcontent-%COMP%]{height:7px;width:calc(100% - 70px);position:absolute;top:43%;right:0;transform:translateY(-50%)}.inspecTaskBgColor[_ngcontent-%COMP%]{background-color:#63a10344}.inspecTaskBorderColor[_ngcontent-%COMP%]{border-color:#63a10344}.maintenanceTaskBgColor[_ngcontent-%COMP%]{background-color:#016fa056}.maintenanceTaskBorderColor[_ngcontent-%COMP%]{border-color:#016fa056}.repairTaskBgColor[_ngcontent-%COMP%]{background-color:#ddafb1}.repairTaskBorderColor[_ngcontent-%COMP%]{border-color:#ddafb1}.advisoryTaskBgColor[_ngcontent-%COMP%], .advisoryDefecticonColr[_ngcontent-%COMP%]{background-color:#ffc404}.advisoryTaskBorderColor[_ngcontent-%COMP%]{border-color:#ffc404}.workshop-advisory-task-icon[_ngcontent-%COMP%]{width:35px;height:auto}.expandhgtxt[_ngcontent-%COMP%]{font-size:unset}.workshop-task-icons[_ngcontent-%COMP%]{border-radius:20px;color:#fff;font-size:35px}.workshop-inspec-task-icon[_ngcontent-%COMP%]{width:auto;height:auto}.workshop-maintenance-task-icon[_ngcontent-%COMP%]{padding-bottom:5px}.workshop-defect-task-icon[_ngcontent-%COMP%]{padding:5px}.pick-list[_ngcontent-%COMP%]{border-radius:10px;padding-left:10px}.pick-list-create-order[_ngcontent-%COMP%]{background-color:#b27901}.pick-list-ready-tocollect[_ngcontent-%COMP%]{background-color:#0179b2;display:table;margin-left:auto;margin-right:0}.pick-list-create-order[_ngcontent-%COMP%], .pick-list-ready-tocollect[_ngcontent-%COMP%]{display:inline-block;clear:both;margin-bottom:8px;padding:4px 12px;width:-moz-fit-content;width:fit-content}.picklist-metrics-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;column-gap:24px;row-gap:8px;margin-top:15px}.picklist-metrics-grid.picklist-metrics-grid-single-col[_ngcontent-%COMP%]{grid-template-columns:1fr;grid-template-rows:repeat(4,auto)}.picklist-metric-cell[_ngcontent-%COMP%]{display:grid;grid-template-columns:max-content max-content;column-gap:8px;align-items:center}.picklist-metric-label[_ngcontent-%COMP%]{text-align:right;white-space:nowrap;min-width:120px}.picklist-metric-value[_ngcontent-%COMP%]{font-weight:500}.picklist-metric-value.non-zero[_ngcontent-%COMP%]{font-weight:700}.open-list-inline-btn[_ngcontent-%COMP%]{min-width:100px;height:32px;border-radius:4px;line-height:32px;padding:0 12px;font-size:12px;font-weight:600;margin-left:10px}.picklist-title-row[_ngcontent-%COMP%]{width:100%;margin-bottom:8px!important}.defect-picklist-content[_ngcontent-%COMP%]{padding-top:0}.repair-picklist-with-classification[_ngcontent-%COMP%]{border-right:2px solid #ddafb1}.themeinputgrp[_ngcontent-%COMP%]   .label-lg[_ngcontent-%COMP%]{text-align:left!important;font-size:18px;font-weight:700}.themedatefx1[_ngcontent-%COMP%]   .mat-form-field-outline[_ngcontent-%COMP%]{background-color:#fff}.themeinputgrp[_ngcontent-%COMP%]   .textareagrp[_ngcontent-%COMP%]   .mat-input-element[_ngcontent-%COMP%]:not(.noAutoHeight){min-height:auto!important}.themeinputgrp[_ngcontent-%COMP%]   .textareaJobReqstDisclaimer[_ngcontent-%COMP%]   .mat-input-element[_ngcontent-%COMP%]{min-height:120px!important}.themeinputgrp[_ngcontent-%COMP%]   .textareaJobComment[_ngcontent-%COMP%]   .mat-input-element[_ngcontent-%COMP%]{min-height:60px!important}.mat-card-header.onSite[_ngcontent-%COMP%]{display:unset!important}.rtxpanel[_ngcontent-%COMP%]   .mat-card-header[_ngcontent-%COMP%]   mat-label[_ngcontent-%COMP%]{width:auto!important}.rtxpanel[_ngcontent-%COMP%]   .mat-card-header[_ngcontent-%COMP%]   mat-label.width26[_ngcontent-%COMP%]{width:26%!important}.w60-lg[_ngcontent-%COMP%]   .md-form.form-group.thirdbox[_ngcontent-%COMP%]{width:unset!important}.rtxpanel[_ngcontent-%COMP%]   .mat-card[_ngcontent-%COMP%]{padding:12px;min-height:210px;max-height:135px}.alternateCancelBtn[_ngcontent-%COMP%]{position:absolute;
1left:20px;bottom:0}.mat-card[_ngcontent-%COMP%]   .mat-divider-horizontal[_ngcontent-%COMP%]{position:absolute;left:10px!important;width:calc(100% - 20px)!important}td[_ngcontent-%COMP%]{text-align:center}table[_ngcontent-%COMP%]{width:100%}.img25[_ngcontent-%COMP%]{width:25px}.tbl-align-left[_ngcontent-%COMP%]{text-align:left!important;text-indent:10%}#btnAlertView[_ngcontent-%COMP%]{padding-right:15px;display:flex;flex-direction:column;align-items:center}img#alertsIcon[_ngcontent-%COMP%]{padding-left:10px}.superlabel[_ngcontent-%COMP%]{font-size:18px;margin-top:6px}.form-row.themeinputgrp[_ngcontent-%COMP%]   .mat-form-field[_ngcontent-%COMP%]:not(.maxWidthUnset){display:inline-block;position:relative;text-align:left;max-width:201px;width:100%}@media screen and (max-width: 1550px){.form-row.themeinputgrp[_ngcontent-%COMP%]   .mat-form-field[_ngcontent-%COMP%]:not(.maxWidthUnset){max-width:60%}.form-row.themeinputgrp[_ngcontent-%COMP%]   .textareagrp[_ngcontent-%COMP%]   .mat-form-field[_ngcontent-%COMP%]:not(.maxWidthUnset){max-width:80%!important}}.mat-raised-button.mat-button-disabled[_ngcontent-%COMP%]{background-color:#0000001f!important}.createjob-custwidth.form-row.themeinputgrp[_ngcontent-%COMP%]   .mat-form-field[_ngcontent-%COMP%]{max-width:275px}.createjob-custwidth[_ngcontent-%COMP%], .createjob-custwidth[_ngcontent-%COMP%]   .themeinputgrp[_ngcontent-%COMP%]{justify-content:center!important}.left-align[_ngcontent-%COMP%]{margin-left:auto;margin-right:0}@keyframes _ngcontent-%COMP%_pulse{0%{box-shadow:0 0 #cc2c2c66}70%{box-shadow:0 0 0 10px #f10c0c23}to{box-shadow:0 0 #d4232300}}@media screen and (max-width: 1080px){.notesinput[_ngcontent-%COMP%]   mat-label[_ngcontent-%COMP%], .min-wt80[_ngcontent-%COMP%]{min-width:80px;max-width:70px!important}.tnygrp[_ngcontent-%COMP%]   .formgroup-lt[_ngcontent-%COMP%]   mat-label[_ngcontent-%COMP%]{min-width:80px!important}.md-form.form-group.width100.textareagrp[_ngcontent-%COMP%]{max-width:calc(100% - 70px)!important}}.tnygrp[_ngcontent-%COMP%]   .formgroup-lt[_ngcontent-%COMP%]   mat-label[_ngcontent-%COMP%]{min-width:62px}.tnygrp[_ngcontent-%COMP%]   .formgroup-lt[_ngcontent-%COMP%]   .grp2[_ngcontent-%COMP%]{width:calc(100% - 100px)}.newbookingform[_ngcontent-%COMP%]{margin-left:5px;margin-top:5px}@media screen and (max-width:624px){form.newbookingform.ng-untouched.ng-pristine.ng-invalid[_ngcontent-%COMP%]{margin-left:83px}}@media screen and (max-width: 991px){#btnAlertView[_ngcontent-%COMP%]{padding-left:10px}}@media screen and (max-width: 736px){.newbookingform[_ngcontent-%COMP%]   .formgroup-lt[_ngcontent-%COMP%]{flex-direction:column!important;justify-content:flex-start!important;margin-bottom:10px;max-width:100%!important}.newbookingform[_ngcontent-%COMP%]   .themeinputgrp[_ngcontent-%COMP%]{justify-content:flex-start!important;flex-direction:column!important;padding-left:0}.newbookingform[_ngcontent-%COMP%]   mat-label[_ngcontent-%COMP%]{width:auto!important;max-width:100%!important;text-align:left}.newbookingform[_ngcontent-%COMP%]   .notesinput[_ngcontent-%COMP%]   .width100[_ngcontent-%COMP%]{flex-direction:column!important;justify-content:flex-start!important;align-items:flex-start!important}.themeinputgrp.themeinputgrpb[_ngcontent-%COMP%]   .formgroup-lt.columnflx-xs[_ngcontent-%COMP%]{flex-direction:row!important;align-items:center!important}.nopad-mb[_ngcontent-%COMP%]{padding-left:0}.notesinput[_ngcontent-%COMP%]   mat-label[_ngcontent-%COMP%]{min-width:auto}}@media screen and (max-width: 640px){img#alertsIcon[_ngcontent-%COMP%]{padding-left:0;max-width:70px;margin-bottom:15px}}@media screen and (max-width: 360px){.mobcolumn[_ngcontent-%COMP%]{flex-direction:column;justify-content:flex-end;align-items:flex-end}.mobcolumn[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]{margin-top:5px!important;margin-right:10px}}#div_totalcost[_ngcontent-%COMP%]{font-size:27px;font-weight:700;align-self:center;overflow-wrap:break-word}#div_ttt[_ngcontent-%COMP%]{font-size:40px;font-weight:700;align-self:center;margin-top:8px}#lbl_totalcost[_ngcontent-%COMP%]{overflow-wrap:break-word}.roundButton[_ngcontent-%COMP%]{border-radius:50%;border:solid 2px #b5b5b5;color:#fff}.countExist[_ngcontent-%COMP%]{background-color:red;animation:_ngcontent-%COMP%_pulse 1s infinite}.countNotExist[_ngcontent-%COMP%]{background-color:green}
1.ml24-w200[_ngcontent-%COMP%]{margin-left:20px;width:200px!important}.mt6[_ngcontent-%COMP%]{margin-top:6px}.flexstyle-100[_ngcontent-%COMP%]{width:calc(100% - (30% - 5px))!important}.w85px[_ngcontent-%COMP%]{width:85px}.ml50w103[_ngcontent-%COMP%]{margin-left:50px;width:103px}.fl-r[_ngcontent-%COMP%]{float:right}.example-card[_ngcontent-%COMP%]{background-color:#fff;margin:20px 0}.margin[_ngcontent-%COMP%]{margin-top:35px}.quotelistwrap[_ngcontent-%COMP%]{padding:5px 15px 5px 4px;word-break:break-all;border:1px solid #5048484f}.assetlist[_ngcontent-%COMP%]{overflow:hidden;text-overflow:unset;white-space:nowrap}.cday[_ngcontent-%COMP%]   h3[_ngcontent-%COMP%]{margin-bottom:30px;margin-top:2px;font-weight:700;line-height:20px}.taskType[_ngcontent-%COMP%]{width:12px}.divtooltip[_ngcontent-%COMP%]{display:none}.divhover[_ngcontent-%COMP%]:hover + .divtooltip[_ngcontent-%COMP%]{background-color:#dac6c6;color:#000;width:200px;position:absolute;z-index:1071;display:block;font-style:normal;font-weight:400;letter-spacing:normal;line-break:auto;line-height:2;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;font-size:12px;word-wrap:break-word;opacity:.9;pointer-events:none}.w-200[_ngcontent-%COMP%]{width:200px}.w-100p[_ngcontent-%COMP%]{width:100%;border:1px solid #5048484f}.br-color[_ngcontent-%COMP%]{border:1px solid #5048484f}.ft-left[_ngcontent-%COMP%]{float:left}.ft-ryt[_ngcontent-%COMP%]{float:right;font-weight:bolder;padding-right:5px}.pd-left[_ngcontent-%COMP%]{padding-left:5px}.mat-card-tasks[_ngcontent-%COMP%]{width:350px;min-height:165px;height:auto;overflow:visible;background-color:#fff}.mainContainer[_ngcontent-%COMP%]{background-color:#fff}.createUpdateJob[_ngcontent-%COMP%]{border:solid 1px #dbd8d8;border-radius:10px;background-color:#f2f2f2;padding:10px;height:105px;width:210px;z-index:9;position:absolute;top:0;right:0}.iso-table-1[_ngcontent-%COMP%]{overflow-x:auto;margin-top:20px}.texOverflowEllipsis[_ngcontent-%COMP%]{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.taskSubTitle[_ngcontent-%COMP%]{width:150px}.w-100[_ngcontent-%COMP%]{min-width:100px}.mat-card-avatar[_ngcontent-%COMP%]{width:auto!important}.alert-asset-header[_ngcontent-%COMP%]{background-color:#fff;position:sticky;top:0;z-index:11}.green-color-circle[_ngcontent-%COMP%]{color:green;transform:scale(1.2)}.gray-color-circle[_ngcontent-%COMP%]{color:#a9a9a9;transform:scale(1.2)}.mat-success[_ngcontent-%COMP%]{background-color:green!important;color:#fff}.mat-failure[_ngcontent-%COMP%]{background-color:red!important;color:#fff}.rebuildJobPdf[_ngcontent-%COMP%]{position:absolute;left:70px;bottom:12px}.font-size-12px[_ngcontent-%COMP%]{font-size:12px}@media (max-width: 1900px){.rebuildBtnPadding[_ngcontent-%COMP%]{padding-left:10px!important;padding-right:10px!important;font-size:12px}}.placeContentcenter[_ngcontent-%COMP%]{place-content:center}.jobCommentNewBook[_ngcontent-%COMP%]{height:75px}.jobCommentLabel[_ngcontent-%COMP%]{width:82px!important}.taskTypeName[_ngcontent-%COMP%]{border-radius:2px;display:inline;float:right;margin-top:3px;height:21px;width:10px;margin-right:3px;color:#fff}.partsBubbleCount[_ngcontent-%COMP%]{border:1px solid white;text-align:center;z-index:11;color:#fff;place-content:center;position:absolute;top:-9px;left:235px;background-color:#dc143c;height:35px;width:35px;border-radius:100%}.partsTotalCost[_ngcontent-%COMP%]{border-radius:6px;padding:10px;width:100%;box-shadow:3px 5px 5px #bebbbb59,inset 2px 1px 2px #bebbbb59;border:0;background-color:#fff}.partsTotalCostRow[_ngcontent-%COMP%]{display:flex;justify-content:space-between;margin-bottom:8px}.total[_ngcontent-%COMP%]{font-weight:700;font-size:1.2em;margin-top:10px}.approval-group[_ngcontent-%COMP%]{margin-top:16px}.verticalAlignMiddle[_ngcontent-%COMP%]{vertical-align:middle}.rtxpanel[_ngcontent-%COMP%]   .mat-card[_ngcontent-%COMP%]{max-height:max-content!important}.supervisorSignRow[_ngcontent-%COMP%]{margin-right:10px}.jobDoingSession[_ngcontent-%COMP%]{border-radius:6px;padding:0!important;width:100%;box-shadow:3px 5px 5px #bebbbb59,inset 2px 1px 2px #bebbbb59;border:0;background-color:#fff;margin-right:15px}.jobDoingSessionOptions[_ngcontent-%COMP%]{height:100%;display:flex;flex-direction:row;max-width:201px;white-space:nowrap}.jobDoingSessionOptions[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]:not(:last-child){margin-right:5%}.request-mode-value[_ngcontent-%COMP%]{display:inline-flex;align-items:center;min-height:36px;font-weight:600}.statusftstyle[_ngcontent-%COMP%]{font-size:15px;font-weight:700}.themeinputgrp[_ngcontent-%COMP%]   mat-label[_ngcontent-%COMP%]{padding-right:5px}.width75[_ngcontent-%COMP%]{width:75%}.width50[_ngcontent-%COMP%]{width:43px}.width120[_ngcontent-%COMP%]{width:120px}.width60[_ngcontent-%COMP%]{width:60%}.backdate-button[_ngcontent-%COMP%]{position:absolute;bottom:5px;right:10px}.supplierReqFlowContainer[_ngcontent-%COMP%]{border:2px solid var(--highlightColor);border-radius:6px;padding:10px}.supplierReqFlowStatus[_ngcontent-%COMP%]{display:flex}.supplierReqFlowWrapper[_ngcontent-%COMP%]{display:flex;align-items:center}.supplierInfo[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center}.supplierFlowCount[_ngcontent-%COMP%]{width:25px;height:25px;color:#fff;background-color:#a2a2a2;border-radius:100%;justify-content:center;display:flex;align-items:center}.supplierFlowGap[_ngcontent-%COMP%]{width:35px;height:5px;background-color:#a2a2a2;margin:0 10px}.supplierFlowCount.completed[_ngcontent-%COMP%]{background-color:green}.supplierFlowCount.active[_ngcontent-%COMP%]{background-color:var(--highlightColor)}.supplierRowText[_ngcontent-%COMP%]{font-weight:700;margin-bottom:30px}
1.supStepName[_ngcontent-%COMP%]{font-size:12px}.createJobReqContainer[_ngcontent-%COMP%]{padding:20px 40px}.ml-200[_ngcontent-%COMP%]{margin-left:200px}.refrshIconContainer[_ngcontent-%COMP%]{justify-content:center}.sendReqstContainer[_ngcontent-%COMP%]{display:flex;margin-left:auto;padding-right:15px}.form-field-wrapper[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%;min-width:0}.form-field-wrapper[_ngcontent-%COMP%]   .matLabelWidth[_ngcontent-%COMP%]{margin-bottom:8px}.defect-classification-wrapper[_ngcontent-%COMP%]   .form-field-wrapper[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center;width:100%;margin-bottom:12px}.defect-classification-wrapper[_ngcontent-%COMP%]   .form-field-wrapper[_ngcontent-%COMP%]   .matLabelWidth[_ngcontent-%COMP%]{margin-bottom:0!important;min-width:150px;flex-shrink:0}.defect-classification-wrapper[_ngcontent-%COMP%]   .form-field-wrapper[_ngcontent-%COMP%]   .dropdown-wrapper[_ngcontent-%COMP%]{flex-grow:1;width:100%}  .defect-classification-wrapper .mat-mdc-form-field-subscript-wrapper,   .defect-classification-wrapper .mat-form-field-subscript-wrapper{display:none!important}.defect-classification-wrapper[_ngcontent-%COMP%]   .mat-form-field[_ngcontent-%COMP%]{margin-bottom:0!important;padding-bottom:0!important}[_nghost-%COMP%]     .ag-theme-alpine .ag-paging-panel{position:absolute;top:-52px;z-index:1;width:unset;
1right:415px!important;justify-content:flex-start;border:none}.mrgnRight[_ngcontent-%COMP%]{margin-right:20px}.alnright[_ngcontent-%COMP%]{justify-content:flex-end}.cost-summary-wrap[_ngcontent-%COMP%]{width:100%;overflow-x:auto}.cost-summary-values[_ngcontent-%COMP%]{display:flex;align-items:center;flex-wrap:nowrap;justify-content:flex-end;white-space:nowrap;max-width:100%}[_nghost-%COMP%]     .mat-select-panel ngx-mat-select-search{display:block!important;padding:10px 16px;border-bottom:1px solid #e0e0e0}[_nghost-%COMP%]     .mat-select-panel ngx-mat-select-search .mat-form-field{width:100%}[_nghost-%COMP%]     .mat-select-panel ngx-mat-select-search .mat-form-field-wrapper{padding:0!important}.themedatefx1.externalJob[_ngcontent-%COMP%]{padding-top:10px}"]})}}return s})()}];let zr=(()=>{class s{static{this.\u0275fac=function(a){return new(a||s)}}static{this.\u0275mod=t.$C({type:s})}static{this.\u0275inj=t.G2t({imports:[T.iI.forChild(qr),T.iI]})}}return s})();var Qr=h(76965);let Kr=(()=>{class s{static{this.\u0275fac=function(a){return new(a||s)}}static{this.\u0275mod=t.$C({type:s})}static{this.\u0275inj=t.G2t({imports:[k.MD,zr,Qr.g]})}}return s})()},31609:(lt,P,h)=>{h.d(P,{T:()=>C});var k=h(21626),T=h(54438),H=h(18810),w=h(21413),b=h(99437),l=h(20951),D=h(21189);let C=(()=>{class v{handleError(c){return(0,H.$)(c.error||"Server error")}constructor(c){this.master=c,this.shareAgridInstance=new T.bkB,this.gridClearCommonFilter=new T.bkB,this.selectedApproverData=new w.B,this.approversList=[],this.headers={headers:new k.Lr({"Content-Type":"application/json"})},this.http=c.http}getEmailAttachmentList(){const c=this.master.getParentOrgId(this.master.navSelectedOrgID);return this.http.get(l.Sgn.getEmailAttachmentByOrgId,{header:this.headers,params:{OrganizationID:c}}).pipe((0,b.W)(this.master.handleError))}getEmailAttachmentListFilteredDates(c){const I=this.master.getParentOrgId(this.master.navSelectedOrgID),u={header:this.headers,params:{OrganizationID:I,...c}};return this.http.get(l.Sgn.getEmailAttachmentByOrgId,u).pipe((0,b.W)(this.master.handleError))}putEmailAttachment(c){return this.http.put(l.Sgn.upateEmailAttachment,c,this.headers)}putBulkEmailAttachment(c){return this.http.post(l.Sgn.bulkUpateEmailAttachment,c,this.headers)}getEmailDocumentList(c){const I=this.master.getParentOrgId(this.master.navSelectedOrgID),u={header:this.headers,params:{OrganizationID:I,...c}};return this.http.get(l.Sgn.getEmailDocListByOrgId,u).pipe((0,b.W)(this.master.handleError))}static{this.\u0275fac=function(I){return new(I||v)(T.KVO(D.m))}}static{this.\u0275prov=T.jDH({token:v,factory:v.\u0275fac,providedIn:"root"})}}return v})()}}]);

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.