PageSourceSearch

https://ess.bcpcl.org.bd:8080/chunk-RC6YBWVC.js

js bcpcl.org.bd collected 2026-10-02 20:06:58 UTC 56,775 bytes, 1 lines download raw bytes

1import{a as Oe}from"./chunk-PTWPI6CV.js";import{a as Ee}from"./chunk-DVZRDGAE.js";import{a as Ie}from"./chunk-QJRH2VXX.js";import{a as ke,b as De}from"./chunk-34D656GC.js";import{a as Le}from"./chunk-4FRSWHP5.js";import{a as K}from"./chunk-XMDPOBDC.js";import{mb as Ce,nb as xe,ob as Te,pb as Pe,qb as we,rb as oe}from"./chunk-2ZEZUT32.js";import{a as J,b as j,c as S}from"./chunk-63NDYRXM.js";import{a as H}from"./chunk-WG4MFHKN.js";import{a as ye}from"./chunk-7NIHN5QR.js";import{Bc as ve,hg as _e,i as ae,j as Fe,jg as D}from"./chunk-2FDKHKO5.js";import{c as I,d as _,f as O,g as R,h as M,k as h,m as Se,n as X,q as Y,r as V,w as k,x as N}from"./chunk-VJV6S5HM.js";import{h as fe,i as be,q as ge}from"./chunk-WOIS2MGL.js";import{$b as q,Ac as he,Gb as L,Kb as u,Mb as y,O as me,Pa as d,S as de,Vb as pe,X as C,_b as r,aa as P,ab as E,ac as z,ba as w,bc as ue,d as A,fb as W,ia as B,ob as x,pb as T,ub as f,vb as i,wb as a,xb as g}from"./chunk-ROZS4BMJ.js";import{f as U}from"./chunk-UM6N65NR.js";var re=U(Fe());var F=class m{toastr=C(ye);punchTimeList=new A;punchPrintList=new A;punchExcelList=new A;rComStatus=new A;employmentList=new A;actionStatus=new A;constructor(){this.rComStatus.next(!1)}createPunchTime(t){this.rComStatus.next(!0),D().post(xe,t).then(e=>{this.actionStatus.next(e.data),this.rComStatus.next(!1),this.toastr.success("Successfully Added !")}).catch(e=>{console.log("error ==> ",e),this.rComStatus.next(!1),this.toastr.warning("Something is wrong !")})}getPunchTimeList(){D().get(Ce).then(t=>{this.punchTimeList.next(t.data)}).catch(t=>{console.log("error ==> ",t),this.rComStatus.next(!1),this.toastr.warning("Punch List Loading Failed !")})}punchTimePaginationList(t,e,n,o,l,s,c,p,b){D().get(oe+"?searchText="+t+"&offSet="+e+"&length="+n+"&locationAvailability="+b+"&employeeId="+o+"&designationId="+l+"&departmentId="+s+"&startDate="+c+"&endDate="+p).then(ie=>{this.punchTimeList.next(ie.data)}).catch(ie=>{console.log("error ==> ",ie),this.rComStatus.next(!1),this.toastr.warning("Punch List Loading Failed !")})}punchTimePrintList(t,e,n,o,l,s){D().get(oe+"?searchText=&offSet=&length=-1&employeeId="+t+"&designationId="+e+"&departmentId="+n+"&startDate="+o+"&endDate="+l).then(c=>{s==1?this.punchPrintList.next(c.data):this.punchExcelList.next(c.data)}).catch(c=>{console.log("error ==> ",c),this.rComStatus.next(!1),this.toastr.warning("Punch List Loading Failed !")})}createBulkPunchTime(t){this.rComStatus.next(!0),D().post(Pe,t).then(e=>{this.actionStatus.next(e.data),this.rComStatus.next(!1),this.toastr.success("Successfully Added !")})}deletePunchTime(t){this.rComStatus.next(!0),D().delete(we+"?_id="+t).then(e=>{this.rComStatus.next(!1),this.toastr.error("Deleted Successfully !"),this.actionStatus.next(e.data)}).catch(e=>{console.log("error ==> ",e),this.rComStatus.next(!1),this.toastr.error("Something is wrong !")})}updatePunchTime(t,e){this.rComStatus.next(!0),D().put(Te+"?_id="+e,t).then(n=>{this.rComStatus.next(!1),this.toastr.warning("Updated Successfully !"),this.actionStatus.next(n.data)}).catch(n=>{console.log("error ==> ",n),this.rComStatus.next(!1),this.toastr.error("Something is wrong !")})}static \u0275fac=function(e){return new(e||m)};static \u0275prov=de({token:m,factory:m.\u0275fac,providedIn:"root"})};var v=U(ae());function Ae(m,t){if(m&1&&(i(0,"div")(1,"strong"),r(2,"Location:"),a(),r(3),a()),m&2){let e=y().$implicit;d(3),z(" ",e.location," ")}}function Re(m,t){if(m&1){let e=L();i(0,"div",12)(1,"div",13)(2,"div",14)(3,"h6",15),r(4),a(),i(5,"span",16),r(6),a()(),i(7,"div",17)(8,"div")(9,"strong"),r(10,"Designation:"),a(),r(11),a(),i(12,"div")(13,"strong"),r(14,"Department:"),a(),r(15),a(),i(16,"div")(17,"strong"),r(18,"Date & Time:"),a(),r(19),a(),W(20,Ae,4,1,"div",18),a(),i(21,"div",19)(22,"button",20),u("click",function(){let o=P(e).$implicit,l=y(2);return w(l.onEdit(o))}),g(23,"i",21),r(24," Edit "),a(),i(25,"button",22),u("click",function(){let o=P(e).$implicit,l=y(2);return w(l.onDelete(o))}),g(26,"i",23),r(27," Delete "),a()()()()}if(m&2){let e=t.$implicit;d(4),z(" ",e.employeeName," "),d(2),q(e.punchType),d(5),z(" ",e.de
1signation),d(4),z(" ",e.departmentName),d(4),ue(" ",e.date?e.date.split("T")[0]:""," | ",e.punchTime," "),d(),f("ngIf",e.location)}}function Xe(m,t){if(m&1&&(i(0,"div",10),W(1,Re,28,7,"div",11),a()),m&2){let e=y();d(),f("ngForOf",e.items)}}function Ye(m,t){m&1&&(i(0,"div",24)(1,"p",25),r(2,"No records found."),a()())}function $e(m,t){if(m&1){let e=L();i(0,"div",26)(1,"button",27),u("click",function(){P(e);let o=y();return w(o.goToPage(o.currentPage-1))}),g(2,"i",28),r(3," Prev "),a(),i(4,"span",29),r(5," Page "),i(6,"strong"),r(7),a(),r(8," of "),i(9,"strong"),r(10),a()(),i(11,"button",27),u("click",function(){P(e);let o=y();return w(o.goToPage(o.currentPage+1))}),r(12," Next "),g(13,"i",30),a()()}if(m&2){let e=y();d(),f("disabled",e.currentPage===1),d(6),q(e.currentPage),d(3),q(e.totalPages),d(),f("disabled",e.currentPage>=e.totalPages)}}var Q=class m{items=[];totalRecords=0;pageSize=10;currentPage=1;searchChange=new B;pageChange=new B;edit=new B;delete=new B;searchTerm="";get totalPages(){return Math.ceil(this.totalRecords/this.pageSize)||1}onSearch(t){this.searchTerm=t,this.searchChange.emit(this.searchTerm)}goToPage(t){t>=1&&t<=this.totalPages&&t!==this.currentPage&&this.pageChange.emit(t)}onEdit(t){this.edit.emit(t)}onDelete(t){this.delete.emit(t)}static \u0275fac=function(e){return new(e||m)};static \u0275cmp=E({type:m,selectors:[["app-punch-time-mobile"]],inputs:{items:"items",totalRecords:"totalRecords",pageSize:"pageSize",currentPage:"currentPage"},outputs:{searchChange:"searchChange",pageChange:"pageChange",edit:"edit",delete:"delete"},decls:11,vars:4,consts:[["noData",""],[1,"mobile-container","p-2"],[1,"mb-3"],[1,"input-group","input-group-sm"],[1,"input-group-prepend"],[1,"input-group-text"],[1,"fas","fa-search"],["type","text","placeholder","Search employee, department...",1,"form-control",3,"ngModelChange","ngModel"],["class","card-list",4,"ngIf","ngIfElse"],["class","d-flex justify-content-between align-items-center mt-3 pt-2 border-top",4,"ngIf"],[1,"card-list"],["class","card mb-2 shadow-sm",4,"ngFor","ngForOf"],[1,"card","mb-2","shadow-sm"],[1,"card-body","p-3"],[1,"d-flex","justify-content-between","align-items-center","mb-2"],[1,"card-title","font-weight-bold","mb-0","text-primary"],[1,"badge","badge-info"],[1,"card-text","text-muted","small"],[4,"ngIf"],[1,"d-flex","justify-content-end","mt-2","pt-2","border-top"],[1,"btn","btn-sm","btn-info-soft","mr-2",3,"click"],[1,"fas","fa-edit"],[1,"btn","btn-sm","btn-danger-soft",3,"click"],[1,"fas","fa-trash-alt"],[1,"text-center","py-4","text-muted"],[1,"mb-0"],[1,"d-flex","justify-content-between","align-items-center","mt-3","pt-2","border-top"],[1,"btn","btn-sm","btn-outline-secondary",3,"click","disabled"],[1,"fas","fa-chevron-left"],[1,"small","text-muted"],[1,"fas","fa-chevron-right"]],template:function(e,n){if(e&1&&(i(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"span",5),g(5,"i",6),a()(),i(6,"input",7),u("ngModelChange",function(l){return n.onSearch(l)}),a()()(),W(7,Xe,2,1,"div",8)(8,Ye,3,0,"ng-template",null,0,he)(10,$e,14,4,"div",9),a()),e&2){let o=pe(9);d(6),f("ngModel",n.searchTerm),d(),f("ngIf",n.items&&n.items.length>0)("ngIfElse",o),d(3),f("ngIf",n.totalRecords>0)}},dependencies:[ge,fe,be,k,I,O,Se],styles:[".mobile-container[_ngcontent-%COMP%]{width:100%}.card[_ngcontent-%COMP%]{border-radius:8px;border:1px solid #e0e0e0}.btn-info-soft[_ngcontent-%COMP%]{color:#17a2b8;background-color:#17a2b81a;border:none}.btn-danger-soft[_ngcontent-%COMP%]{color:#dc3545;background-color:#dc35451a;border:none}.btn-info-soft[_ngcontent-%COMP%]:hover{background-color:#17a2b8;color:#fff}.btn-danger-soft[_ngcontent-%COMP%]:hover{background-color:#dc3545;color:#fff}"]})};function Ve(m,t){if(m&1){let e=L();i(0,"input",67),u("click",function(){P(e);let o=y(2);return w(o.createPunch())}),a()}if(m&2){let e=y(2);f("disabled",!e.employeePunchForm.valid)}}function je(m,t){if(m&1){let e=L();i(0,"input",68),u("click",function(){P(e);let o=y(2);return w(o.updatePunch())}),a()}if(m&2){let e=y(2);f("disabled",!e.employeePunchForm.valid)}}function Be(m,t){if(m&1&&(i(0,"div",23),x(1,Ve,1,1,"input",65),x(2,je,1,1,"input",66),a()),m&2){let e=y();d(),T(e.editStatus?-1:1),d(),T(e.editStatus?2:-1)}}function ze(m,t){m&1&&(i(0,"div")(1,"span",69),r(2,"Please Wait...."),a()())}function Ge(m,t){if(m&1){let e=L();i(0,"div",8)(1,"input",70),u("click",function(){P(e);let o=y();return w(o.createBulkPunch())}),a()()}if(m&2){let e=y();d(),f("disabled",!e.bulkPunchForm.valid)}}function Ue(m,t){m&1&&(i(0,"div")(1,"span",71),r(2,"Please Wait...."),a()())}var ee=class m{departmentService=C(Le);designationService=C(Ee);employmentService=C(Oe);
1regionService=C(De);punchTimeService=C(F);officeService=C(ke);sectionService=C(Ie);employeePunchForm;bulkPunchForm;allowanceList;selectedItem;editStatus;rComStatus;departmentSelectList=[];designationSelectList=[];employmentSelectList=[];regionSelectList=[];punchTypeSelectList=[];officeSelectList=[];sectionSelectList=[];selectDepartmentList=[];selectOfficeList=[];selectSectionList=[];filteredOfficeSelectList=[];filteredDepartmentSelectList=[];filteredSectionSelectList=[];punchObList=[];punchTimeList;dataTableParameter;selectedAvailability="0";locationAvailability=[{id:"0",text:"Location Status"},{id:"Available",text:"Location Available"},{id:"Unavailable",text:"Empty Location"}];startDate=(0,v.default)().startOf("month").format("YYYY-MM-D");endDate=(0,v.default)().endOf("month").format("YYYY-MM-D");fDepartment=0;fDesignation=0;fEmployee=0;appName;address;showReportLogo=0;companyLogo="";constructor(){}ngOnInit(){let t=JSON.parse(atob(localStorage.getItem("authUser")+""));this.appName=t.appName,this.address=t.hqAddress,this.showReportLogo=t.appSettings.find(e=>e.skey=="REPORT_LOGO").svalue.toUpperCase()=="TRUE"?1:0,this.companyLogo=_e()+ve+"?fileName="+t.logoPath,this.dateRangeButtonConfig(),this.departmentService.getDepartmentList(),this.designationService.getDesignationList(),this.employmentService.getEmploymentList(),this.regionService.getRegionList(),this.officeService.getOfficeList(),this.sectionService.getSectionList(),this.punchTypeSelectList.push({id:"Manual",text:"Manual",disabled:!1}),this.punchTypeSelectList.push({id:"Excel Import",text:"Excel Import",disabled:!1}),this.punchTypeSelectList.push({id:"App",text:"App",disabled:!1}),this.employeePunchForm=new M({empId:new h(null,[_.required]),punchTime:new h(null,[_.required]),deptId:new h(null,[]),designationId:new h(null,[]),punchType:new h(null,[_.required]),employeeName:new h(null,[]),longitude:new h(null,[]),latitude:new h(null,[]),location:new h(null,[]),date:new h(null,[_.required]),remarks:new h(null,[]),createUser:new h(null,[])}),this.bulkPunchForm=new M({regionId:new h(0,[_.required]),punchType:new h(0,[_.required]),punchTime:new h("",[_.required]),date:new h("",[_.required]),remarks:new h("",[]),createUser:new h(null,[])}),this.generateDataTable(),this.punchTimeService.actionStatus.subscribe(e=>{e>0&&(this.employeePunchForm.reset(),this.bulkPunchForm.reset(),this.employeePunchForm.get("status")?.setValue(!0),this.hideModal(),this.hideDepartmentModal(),this.hideBulkModal(),$("#punchTimeTable").DataTable().ajax.reload())}),this.departmentService.departmentSelectList.subscribe(e=>{this.departmentSelectList=[],this.departmentSelectList.push({id:"0",text:"All Department",disabled:!1}),this.departmentSelectList.push.apply(this.departmentSelectList,e)}),this.designationService.designationSelecttList.subscribe(e=>{this.designationSelectList=[],this.designationSelectList.push({id:"0",text:"All Designation",disabled:!1}),this.designationSelectList.push.apply(this.designationSelectList,e)}),this.employmentService.employmentSelectList.subscribe(e=>{this.employmentSelectList=[],this.employmentSelectList.push({id:"0",text:"All Employee",disabled:!1}),this.employmentSelectList.push.apply(this.employmentSelectList,e)}),this.regionService.regionSelecttList.subscribe(e=>{this.regionSelectList=e}),this.officeService.officeSelecttList.subscribe(e=>{this.officeSelectList=e}),this.sectionService.sectionSelectList.subscribe(e=>{this.sectionSelectList=e}),this.punchTimeService.rComStatus.subscribe(e=>{this.rComStatus=e})}dateRangeButtonConfig(){$("#DateRange-PunchTime").daterangepicker({showDropdowns:!0,linkedCalendars:!1,ranges:{Today:[(0,v.default)(),(0,v.default)()],Yesterday:[(0,v.default)().subtract(1,"days"),(0,v.default)().subtract(1,"days")],"Last 7 Days":[(0,v.default)().subtract(6,"days"),(0,v.default)()],"Last 30 Days":[(0,v.default)().subtract(29,"days"),(0,v.default)()],"This Month":[(0,v.default)().startOf("month"),(0,v.default)().endOf("month")],"Last Month":[(0,v.default)().subtract(1,"month").startOf("month"),(0,v.default)().subtract(1,"month").endOf("month")]},startDate:(0,v.default)().startOf("month"),endDate:(0,v.default)().endOf("month")},(t,e)=>{this.startDate=t.format("YYYY-MM-D"),this.endDate=e.format("YYYY-MM-D"),$("#punchTimeTable").DataTable().ajax.reload(),$("#DateRange-PunchTime").html(t.format("MMMM D, YYYY")+" - "+e.format("MMMM D, YYYY"))}),$("#DateRange-PunchTime").html((0,v.default)().startOf("month").format("MMMM D, YYYY")+" - "+(0,v.default)().endOf("month").format("MMMM D, YYYY"))}createBulkPunch(){let t=this.punchObList;t.length>0&&this.punchTimeService.createBulkPunchTime(t)}createPunch(){this.employeePunchForm.valid&&this.punchTimeService.createPunchTime(this.employeePunchForm.value)}employeeSelected(t){let e=this.employmentSelectList.find(n=>n.id==t);e!=null&&(this.employeePunchForm.controls.deptId.setValue(e.departmentId),this.employeePunchForm.controls.designationId.setValue(e.designationId))}bulkTimeChanged(t){this.timeChanged(t)}timeChanged(t){let e=(0,v.default)("10-10-2022 "+t.target.value);for(let n=0;n<this.punchObList.length;n++){let o=(0,v.default)(e).add(n,"seconds").format("hh:mm:ss");this.punchObList[n].punchTime=o}this.generateEmployeeTable(this.punchObList,"timeChanged")}bulkRemarksChanged(t){this.remarksChanged(t)}remarksChanged(t){for(let e=0;e<this.punchObList.length;e++)this.punchObList[e].remarks=t.target.value;this.generateEmployeeTable(this.punchObList,"remarksChanged")}
1bulkDateChanged(t){this.dateChanged(t)}dateChanged(t){for(let e=0;e<this.punchObList.length;e++)this.punchObList[e].date=t.target.value;this.generateEmployeeTable(this.punchObList,"dateChanged")}bulkRegionChanged(t){this.regionChanged(t)}regionChanged(t){console.log("calledHre --> regionChanged"),t!=null&&(this.punchObList=[],this.filteredOfficeSelectList=this.officeSelectList.filter(e=>e.regionId==t),t!=0&&t!=null&&(this.employmentSelectList.filter(n=>n.regionId==t).forEach(n=>{this.punchObList.push({punchType:this.bulkPunchForm.value.punchType,employeeName:n.text,empId:n.empId!=null?n.empId:"",punchTime:this.bulkPunchForm.value.punchTime!=null?this.bulkPunchForm.value.punchTime:0,date:this.bulkPunchForm.value.date!=null?this.bulkPunchForm.value.date:"",remarks:this.bulkPunchForm.value.remarks!=null?this.bulkPunchForm.value.remarks:"",longitude:0,latitude:0,location:""})}),this.generateEmployeeTable(this.punchObList,"regionChanged"),console.log("allowanceOB ===> ",this.punchObList)))}bulkOfficeChanged(t){this.officeChanged(t)}officeChanged(t){console.log("calledHre --> officeChanged ---> ",t),t!=null&&(this.punchObList=[],this.filteredDepartmentSelectList=this.departmentSelectList.filter(e=>e.officeId==t),t!=0&&t!=null&&(this.employmentSelectList.filter(n=>n.officeId==t).forEach(n=>{this.punchObList.push({punchType:this.bulkPunchForm.value.punchType,employeeName:n.text,empId:n.empId!=null?n.empId:"",punchTime:this.bulkPunchForm.value.punchTime!=null?this.bulkPunchForm.value.punchTime:0,date:this.bulkPunchForm.value.date!=null?this.bulkPunchForm.value.date:"",remarks:this.bulkPunchForm.value.remarks!=null?this.bulkPunchForm.value.remarks:"",longitude:0,latitude:0,location:""})}),this.generateEmployeeTable(this.punchObList,"officeChanged")))}bulkDepartmentChanged(t){this.departmentChanged(t)}departmentChanged(t){console.log("calledHre --> departmentChanged"),t!=null&&(this.punchObList=[],this.filteredSectionSelectList=this.sectionSelectList.filter(e=>e.departmentId==t),t!=0&&t!=null&&(this.employmentSelectList.filter(n=>n.departmentId==t).forEach(n=>{this.punchObList.push({punchType:this.bulkPunchForm.value.punchType,employeeName:n.text,empId:n.empId!=null?n.empId:"",punchTime:this.bulkPunchForm.value.punchTime!=null?this.bulkPunchForm.value.punchTime:0,date:this.bulkPunchForm.value.date!=null?this.bulkPunchForm.value.date:"",remarks:this.bulkPunchForm.value.remarks!=null?this.bulkPunchForm.value.remarks:"",longitude:0,latitude:0,location:""})}),this.generateEmployeeTable(this.punchObList,"departmentChanged")))}bulkSectionChanged(t){console.log("calledHre --> bulkSectionChanged"),this.sectionChanged(t)}sectionChanged(t){console.log("calledHre --> sectionChanged"),t!=null&&(this.punchObList=[],t!=0&&t!=null&&(this.employmentSelectList.filter(n=>n.sectionId==t).forEach(n=>{this.punchObList.push({punchType:this.bulkPunchForm.value.punchType,employeeName:n.text,empId:n.empId!=null?n.empId:"",punchTime:this.bulkPunchForm.value.punchTime!=null?this.bulkPunchForm.value.punchTime:0,date:this.bulkPunchForm.value.date!=null?this.bulkPunchForm.value.date:"",remarks:this.bulkPunchForm.value.remarks!=null?this.bulkPunchForm.value.remarks:"",longitude:0,latitude:0,location:""})}),this.generateEmployeeTable(this.punchObList,"sectionChanged")))}bulkBenefitTypeChanged(t){this.benefitTypeChanged(t)}benefitTypeChanged(t){if(t!=null){let e=this.punchTypeSelectList.find(n=>n.id==t);for(let n=0;n<this.punchObList.length;n++)this.punchObList[n].punchType=e.text;this.generateEmployeeTable(this.punchObList,"benefitTypeChanged")}}filterDepartmentSelected(t){t!=null&&(this.fDepartment=t,$("#punchTimeTable").DataTable().ajax.reload())}filterDesignationSelected(t){t!=null&&(this.fDesignation=t,$("#punchTimeTable").DataTable().ajax.reload())}filterEmployeeSelected(t){t!=null&&(this.fEmployee=t,$("#punchTimeTable").DataTable().ajax.reload())}reloadTable(){$("#punchTimeTable").DataTable().ajax.reload()}generateDataTable(){let t=[{title:"#SL"},{title:"Employee",data:"employeeName"},{title:"Designation",data:"designation"},{title:"Department",data:"departmentName"},{title:"Type",data:"punchType"},{title:"Date",data:"date",render:function(o,l,s,c){return s.date!=null?s.date.split("T")[0]:""}},{title:"Time",data:"punchTime"},{title:"Location",data:"location",render:function(o,l,s,c){return'<div style="width:200
1px !important;">'+s.location+"</div>"}},{title:"Action",data:"_id",render:function(o){return'<div class="text-center"><i class="btn btn-sm btn-info-soft mx-1 rounded mx-1 fas fa-edit allowanceAction" id="edit_'+o+'"></i><i class="btn btn-sm btn-danger-soft mx-1 rounded mx-1 fa fa-trash-alt allowanceAction" id="delete_'+o+'"></i></div>'}}],e=this,n=$("#punchTimeTable").DataTable({destroy:!0,columns:t,dom:'<"float-right">rt<"row"<"col-sm-2 mt-2 pl-7"l><"col-sm-4"i><"col-sm-6"p>>',lengthMenu:[[10,25,50,100,-1],[10,25,50,100,"All"]],pageLength:10,serverSide:!0,ordering:!1,ajax:(o,l)=>{this.punchTimeService.punchTimePaginationList($("#searchPunch").val(),o.start,o.length,this.fEmployee,this.fDesignation,this.fDepartment,this.startDate,this.endDate,this.selectedAvailability),this.punchTimeService.punchTimeList.subscribe(s=>{re.default.close(),this.punchTimeList=s.list,this.dataTableParameter=o,l({recordsTotal:s.recordsTotal,recordsFiltered:s.recordsFiltered,data:s.list})})},columnDefs:[{className:"text-center",render:(o,l,s,c)=>this.dataTableParameter.start+(c.row+1),targets:0}],drawCallback:o=>{$(".allowanceAction").on("click",l=>{let s=l.target.id,c=s.split("_")[0],p=s.split("_")[1];this.actionClick(c,p)})}});n.clear(),n.draw(),$("#searchPunch").keyup(o=>{setTimeout(l=>{$("#punchTimeTable").DataTable().ajax.reload()},500)})}employeeWise(){$(".employee-punch-modal").modal("show")}bulkEntry(){$(".bulk-punch-modal").modal("show")}generateEmployeeTable(t,e){let n=[{title:"#SL",className:"text-center"},{title:"Employee",data:"employeeName"},{title:"Type",data:"punchType"},{title:"Time",data:"punchTime",className:"text-center",render:function(l,s,c,p){return'<div ><input type="time" class="text-right amountAction" step="1" value="'+l+'" id="amount_'+c.empId+'"/></div>'}},{title:"Remarks",data:"remarks",className:"text-center",render:function(l,s,c,p){return'<div ><input type="text" value="'+l+'" class="remarksAction" id="remarks_'+c.empId+'"/></div>'}},{title:"Date",data:"date",className:"text-center",render:function(l,s,c,p){return'<div ><input type="date" value="'+l+'" class="effectiveAction" id="effective_'+c.empId+'"/></div>'}},{title:"Action",data:"empId",className:"text-center",render:function(l){return'<div class="text-center"><i class="btn btn-sm btn-danger-soft mx-1 rounded mx-1 fa fa-trash-alt deleteAction" id="delete_'+l+'"></i></div>'}}],o=$("#bulkPunchTimeTable").DataTable({destroy:!0,autoWidth:!1,columns:n,buttons:[{extend:"excelHtml5",text:'<i class="fa fa-file-excel"></i>',titleAttr:"Excel",className:"bg-lighter-soft"},{extend:"csvHtml5",text:'<i class="fa fa-file-csv"></i>',titleAttr:"CSV",className:"bg-lighter-soft"},{extend:"pdfHtml5",text:'<i class="fa fa-file-pdf"></i>',titleAttr:"PDF",className:"bg-lighter-soft"}
1],columnDefs:[{className:"text-center",render:function(l,s,c,p){return p.row+1},targets:0}],drawCallback:l=>{$(".allowanceAction").on("click",s=>{let c=s.target.id,p=c.split("_")[0],b=c.split("_")[1];this.actionClick(p,b)}),$(".remarksAction").on("keyup",s=>{let c=s.target.id,p=c.split("_")[0],b=c.split("_")[1];this.dataChanged(p,b,s.target.value)}),$(".amountAction").on("keyup",s=>{let c=s.target.id,p=c.split("_")[0],b=c.split("_")[1];this.dataChanged(p,b,s.target.value)}),$(".effectiveAction").on("change",s=>{let c=s.target.id,p=c.split("_")[0],b=c.split("_")[1];this.dataChanged(p,b,s.target.value)}),$(".deleteAction").on("click",s=>{let c=s.target.id,p=c.split("_")[0],b=c.split("_")[1];this.dataChanged(p,b,s.target.value)})}});o.clear(),o.rows.add(t).draw()}dataChanged(t,e,n){if(t=="remarks"){var o=this.punchObList.findIndex(l=>l.empId==e);this.punchObList[o].remarks=n}else if(t=="amount"){var o=this.punchObList.findIndex(s=>s.empId==e);this.punchObList[o].punchTime=n}else if(t=="effective"){var o=this.punchObList.findIndex(s=>s.empId==e);this.punchObList[o].date=n}else if(t=="delete"&&this.punchObList.length>1){var o=this.punchObList.findIndex(s=>s.empId==e);o!==-1&&this.punchObList.splice(o,1),this.generateEmployeeTable(this.punchObList,"dataChanged-delete")}}actionClick(t,e){t=="edit"?(this.editData(e),$(".employee-punch-modal").modal("show")):t=="delete"&&this.deleteData(e)}editData(t){this.editStatus=!0,this.selectedItem=this.punchTimeList.find(e=>e._id+""==t+""),this.employeePunchForm.reset(),this.employeePunchForm=new M({empId:new h(this.selectedItem.empId,[_.required]),punchTime:new h(this.selectedItem.punchTime,[_.required]),deptId:new h(this.selectedItem.deptId),designationId:new h(this.selectedItem.designationId),punchType:new h(this.selectedItem.punchType,[_.required]),employeeName:new h,longitude:new h,latitude:new h,location:new h,date:new h((0,v.default)(this.selectedItem.date).format("YYYY-MM-D"),[_.required]),remarks:new h(this.selectedItem.remarks,[]),createUser:new h})}deleteData(t){re.default.fire({title:"Are you sure?",icon:"warning",showCancelButton:!0,confirmButtonColor:"#3085D6",cancelButtonColor:"#d33",confirmButtonText:"Yes"}).then(e=>{e.isConfirmed&&this.punchTimeService.deletePunchTime(t)})}updatePunch(){this.employeePunchForm.valid&&(this.punchTimeService.updatePunchTime(this.employeePunchForm.value,this.selectedItem._id),this.editStatus=!1)}hideModal(){this.editStatus=!1,this.employeePunchForm.reset(),$(".employee-punch-modal").modal("hide")}hideBulkModal(){this.editStatus=!1,this.bulkPunchForm.reset(),$(".bulk-punch-modal").modal("hide")}hideDepartmentModal(){this.editStatus=!1,this.employeePunchForm.reset(),$(".department-allowance-modal").modal("hide")}downloadExcel(){this.punchTimeService.punchTimePrintList(this.fEmployee,this.fDe
1signation,this.fDepartment,this.startDate,this.endDate,2),this.punchTimeService.punchExcelList.subscribe(t=>{this.generateExcel(t.list)})}generateExcel(t){let e=S.json_to_sheet([]),n=S.book_new();S.book_append_sheet(n,e,this.startDate+"_"+this.endDate);let o=1;S.sheet_add_aoa(e,[["Employee Name","Designation","Department","Type","Date","Time","Location"]],{origin:"A1"}),t.forEach(l=>{o++,S.sheet_add_aoa(e,[[l.employeeName,l.designation,l.departmentName,l.punchType,l.date,l.punchTime,l.location]],{origin:"A"+o})}),j(n,"PunchList_"+this.startDate+"_"+this.endDate+".xlsx")}printData(){this.punchTimeService.punchTimePrintList(this.fEmployee,this.fDesignation,this.fDepartment,this.startDate,this.endDate,1),this.punchTimeService.punchPrintList.subscribe(t=>{let e="";this.showReportLogo==1?(e+='<div style="text-align:center;margin-bottom:3px;">',e+='<img src="'+this.companyLogo+'" style="width: 250px;height: 45px;"/>',e+="</div>",e+='<div style="text-align:center;font-size: 14px; color:grey;margin-bottom:10px;">'+this.address+"</div>"):(e+='<div style="text-align:center;font-size: 20px;">'+this.appName+"</div>",e+='<div style="text-align:center;font-size: 14px; color:grey;">'+this.address+"</div>"),e+='<div style="text-align:center;font-size: 20px;">PUNCH TIME REPORT</div>',e+='<div style="text-align:center;font-size: 20px;">'+this.startDate+" TO "+this.endDate+"</div>",e+='<div style="text-align:center;font-size: 14px;margin-bottom:15px;"></div>',e+="<style>tfoot {background-color:grey;color:white;} table , th, td {border: 1px solid lightgray;border-collapse: collapse;text-align:center; } table{table-layout: auto;width:100%;}</style>",e+='<table style="width:100%;">',e+="<tbody>",e+='<tr style="color:black;background-color:lightgrey;">',e+="<td>#SL</td>",e+='<td style="text-align:left;">Employee Name</td>',e+='<td style="text-align:left;">Designation</td>',e+='<td style="text-align:left;">Department</td>',e+='<td style="text-align:left;">Type</td>',e+='<td style="text-align:left;">Date</td>',e+='<td style="text-align:left;">Time</td>',e+='<td style="text-align:left;width:250px;">Location</td>',e+="</tr>",t.list.forEach((o,l)=>{e+='<tr style="color:black;">',e+="<td>"+(l+1)+"</td>",e+='<td style="text-align:left;">'+o.employeeName+"</td>",e+='<td style="text-align:left;">'+o.designation+"</td>",e+='<td style="text-align:left;">'+o.departmentName+"</td>",e+='<td style="text-align:left;">'+o.punchType+"</td>",e+='<td style="text-align:left;">'+o.date.split("T")[0]+"</td>",e+='<td style="text-align:left;">'+o.punchTime+"</td>",e+='<td style="text-align:left;">'+o.location+"</td>",e+="</tr>"}),e+="</tbody>",e+="</table>";let n=window.open("","PRINT","height=800,width=1000");n.document.write(e),n.document.close(),n.onload=()=>{n.focus(),n.print(),n.close()}})}locationAvailabilityCheck(t){t!=null&&(this.selectedAvailability=t,this.reloadTable())}mobilePage=1;mobilePageSize=10;mobileSearchText="";mobileTotalRecords=0;onMobileSearch(t){this.mobileSearchText=t,this.mobilePage=1,this.loadMobileData()}onMobilePageChange(t){this.mobilePage=t,this.loadMobileData()}loadMobileData(){let t=(this.mobilePage-1)*this.mobilePageSize;this.punchTimeService.punchTimePaginationList(this.mobileSearchText,t,this.mobilePageSize,this.fEmployee,this.fDe
1signation,this.fDepartment,this.startDate,this.endDate,this.selectedAvailability),this.punchTimeService.punchTimeList.subscribe(e=>{this.punchTimeList=e.list,this.mobileTotalRecords=e.recordsFiltered})}static \u0275fac=function(e){return new(e||m)};static \u0275cmp=E({type:m,selectors:[["app-punch-time-process"]],decls:182,vars:23,consts:[[1,"content",2,"margin-top","5px"],[1,"container-fluid"],["data-focus","false","role","dialog","aria-labelledby","myLargeModalLabel","aria-hidden","true",1,"modal","fade","employee-punch-modal"],[1,"modal-dialog","modal-dialog-centered","modal-lg"],[1,"modal-content"],[1,"modal-header","bg-dark-header"],["id","CustomerModalLabel",1,"modal-title",2,"font-size","15px"],["type","button","data-dismiss","modal","aria-label","Close",1,"close","text-light",3,"click"],[1,"col-md-12"],[2,"padding","20px",3,"formGroup"],[1,"row"],[1,"col-md-6","col-sm-12"],[1,"form-group"],[1,"control-label","col-md-12"],[2,"margin-left","5px","color","red"],["placeholder","Select Employee","formControlName","empId","width","100%",1,"form-control","form-control-sm",3,"valueChange","data"],["placeholder","","formControlName","deptId","width","100%","readonly","",1,"form-control","form-control-sm",3,"data"],["placeholder","","formControlName","designationId","width","100%","readonly","",1,"form-control","form-control-sm",3,"data"],["placeholder","Select Punch Type","formControlName","punchType","width","100%",1,"form-control","form-control-sm",3,"data"],["formControlName","date","type","date",1,"form-control","form-control-sm"],["formControlName","punchTime","type","time",1,"form-control","form-control-sm"],["formControlName","remarks","type","text","placeholder","Remarks",1,"form-control","form-control-sm"],[1,"col-md-3","col-sm-6"],[1,"col-md-offset-3","col-md-12",2,"margin-top","25px"],["data-focus","false","role","dialog","aria-labelledby","myLargeModalLabel","aria-hidden","true",1,"modal","fade","bulk-punch-modal"],[1,"modal-dialog","modal
1-dialog-centered","modal-xl"],[1,"modal-body"],[2,"padding","15px",3,"formGroup"],[1,"col-md-2","col-sm-12"],["placeholder","Select Region","width","100%","formControlName","regionId",1,"form-control","form-control-sm",3,"valueChange","data"],["placeholder","Select Office","width","100%",1,"form-control","form-control-sm",3,"valueChange","data"],["placeholder","Select Department","formControlName","deptId","width","100%",1,"form-control","form-control-sm",3,"valueChange","data"],["placeholder","Select Section","width","100%",1,"form-control","form-control-sm",3,"valueChange","data"],["type","date","formControlName","date",1,"form-control","form-control-sm",3,"change"],["placeholder","Select Punch Type","width","100%","formControlName","punchType",1,"form-control","form-control-sm",3,"valueChange","data"],["type","time","step","1","formControlName","punchTime","appOnlynumber","",1,"form-control","form-control-sm","text-right",3,"change"],["type","text","formControlName","remarks","placeholder","Remarks",1,"form-control","form-control-sm",3,"keyup"],[1,"col-12",2,"padding-right","35px","padding-left","35px"],[2,"overflow-x","auto"],["id","bulkPunchTimeTable",1,"table-soft","w3-small","table-striped",2,"width","100%","font-size","11px"],[1,"col-md-2","col-sm-6","float-right",2,"margin-top","25px"],[1,"col-md-12",2,"font-size","15px"],[1,"col-md-9",2,"padding-left","0px !important"],[1,"input-group"],["type","button","id","DateRange-PunchTime",1,"btn","btn-primary-soft"],[1,"far","fa-calendar-alt"],[1,"fas","fa-caret-down"],[1,"col-md-3"],[1,"fa","fa-file-pdf","btn","btn-sm","btn-danger-soft","float-right",2,"margin-left","3px",3,"click"],[1,"fa","fa-file-excel","btn","btn-sm","btn-success-soft","float-right",3,"click"],[1,"row","mt-2"],[1,"col-md-2"],[1,"row",2,"margin-top","1px"],[1,"col-md-6","btn","btn-sm","btn-info-soft",3,"click"],[1,"col-md-5","btn","btn-sm","btn-info-soft","ml-1",3,"click"],["placeholder","-- Location Availability --","width","100%",1,"form-control","form-control-sm","text-center",3,"valueChange","data"],["placeholder","--- Select Employee ---","width","100%",1,"form-control","form-control-sm","text-center",3,"valueChange","data"],["placeholder","--- Select Department ---","width","100%",1,"form-control","form-control-sm","text-center",3,"valueChange","data"],["placeholder","--- Select Designation ---","width","100%",1,"form-control","form-control-sm","text-center",3,"valueChange","data"],["id","searchPunch","type","text","placeholder","Search ..",1,"form-control","form-control-sm","col-md-12"],[1,"d-block","d-md-none"],[3,"searchChange","pageChange","edit","delete","items","totalRecords","pageSize","currentPage"],[1,"row","d-none","d-md-flex"],[1,"col-12",2,"margin-top","10px"],["id","punchTimeTable",1,"table-soft","w3-small","table-striped",2,"width","100%","font-size","11px"],["type","submit","value","Save",1,"form-control","form-control-sm","btn","btn-sm","btn-success",3,"disabled"],["type","submit","value","Update",1,"form-control","form-control-sm","btn","btn-sm","btn-danger",3,"disabled"],["type","submit","value","Save",1,"form-control","form-control-sm","btn","btn-sm","btn-success",3,"click","disabled"],["type","submit","value","Update",1,"form-control","form-control-sm","btn","btn-sm","btn-danger",3,"click","disabled"],[1,"form-control","form-control-sm","btn","btn-sm","btn-primary","float-right",2,"margin-top","25px"],["type","submit","value","PROCESS NOW",1,"form-control","form-control-sm","btn","btn-sm","btn-success",3,"click","disabled"],[1,"form-control","form-control-sm","btn","btn-sm","btn-primary","float-right"]],template:function(e,n){e&1&&(i(0,"section",0)(1,"section",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"div",5)(6,"p",6),r(7," Employee Punch Time Entry "),a(),i(8,"div",7),u("click",function(){return n.hideModal()}),i(9,"span"),r(10,"\xD7"),a()()(),i(11,"div",8)(12,"form",9)(13,"div",10)(14,"div",11)(15,"div",12)(16,"label",13),r(17,"Employee"),i(18,"span",14),r(19,"*"),a()(),i(20,"div",8)(21,"app-select",15),u("valueChange",function(l){return n.employeeSelected(l)}),a()()()(),i(22,"div",11)(23,"div",12)(24,"label",13),r(25,"Department"),i(26,"span",14),r(27,"*"),a()(),i(28,"div",8),g(29,"app-select",16),a()()(),i(30,"div",11)(31,"div",12)(32,"label",13),r(33,"Designation"),i(34,"span",14),r(35,"*"),a()(),i(36,"div",8),g(37,"app-select",17),a()()(),i(38,"div",11)(39,"div",12)(40,"label",13),r(41,"Punch Type"),i(42,"span",14),r(43,"*"),a()(),i(44,"div",8),g(45,"app-select",18),a()()(),i(46,"div",11)(47,"div",12)(48,"label",13),r(49,"Punch Date"),i(50,"span",14),r(51,"*"),a()(),i(52,"div",8),g(53,"input",19),a()()(),i(54,"div",11)(55,"div",12)(56,"label",13),r(57,"Time"),i(58,"span",14),r(59,"*"),a()(),i(60,"div",8),g(61,"input",20),a()()(),i(62,"div",11)(63,"div",12)(64,"label",13),r(65,"Remarks"),i(66,"span",14),r(67,"*"),a()(),i(68,"div",8),g(69,"input",21),a()()(),i(70,"div",22),x(71,Be,3,2,"div",23),x(72,ze,3,0,"div"),a()()()()()()(),i(73,"div",24)(74,"div",25)(75,"div",4)(76,"div",5)(77,"p",6),r(78," Bulk Punch Entry "),a(),i(79,"div",7),u("click",function(){return n.hideBulkModal()}),i(80,"span"),r(81,"\xD7"),a()()(),i(82,"div",26)(83,"form",27)(84,"div",10)(85,"div",28)(86,"div",12)(87,"label",13),r(88,"Region"),i(89,"span",14),r(90,"*"),a()(),i(91,"div",8)(92,"app-select",29),u("valueChange",function(l){return n.bulkRegionChanged(l)}),a()()()(),i(93,"div",28)(94,"div",12)(95,"label",13),r(96,"Office"),a(),i(97,"div",8)(98,"app-select",30),u("valueChange",function(l){return n.bulkOfficeChanged(l)}),a()()()(),i(99,"div",28)(100,"div",12)(101,"label",13),r(102,"Department"),a(),i(103,"div",8)(104,"app-select",31),u("valueChange",function(l){return n.bulkDepartmentChanged(l)}),a()()()(),i(105,"div",28)(106,"div",12)(107,"label",13),r(108,"Section"),a(),i(109,"div",8)(110,"app-select",32),u("valueChange",function(l){return n.bulkSectionChanged(l)}),a()()()(),i(111,"div",28)(112,"div",12)(113,"label",13),r(114,"Punch Date"),i(115,"span",14),r(116,"*"),a()(),i(117,"div",8)(118,"input",33),u("change",function(l){return n.bulkDateChanged(l)}),a()()()(),i(119,"div",28)(120,"div",12)(121,"label",13),r(122,"Punch Type"),i(123,"span",14),r(124,"*"),a()(),i(125,"div",8)(126,"app-select",34),u("valueChange",function(l){return n.bulkBenefitTypeChanged(l)}),a()()()(),i(127,"div",28)(128,"div",12)(129,"label",13),r(130,"Time"),i(131,"span",14),r(132,"*"),a()(),i(133,"div",8)(134,"input",35),u("change",function(l){return n.bulkTimeChanged(l)}),a()()()(),i(135,"div",28)(136,"div",12)(137,"label",13),r(138,"Remarks"),a(),i(139,"div",8)(140,"input",36),u("keyup",function(l){return n.bulkRemarksChanged(l)}),a()()()()()(),i(141,"div",10)(142,"div",37)(143,"div",38),g(144,"table",39),a()()(),i(145,"div",40),x(146,Ge,2,1,"div",8),x(147,Ue,3,0,"div"),a()()()()(),i(148,"div",10)(149,"div",41)(150,"div",10)(151,"div",42)(152,"div",43)(153,"button",44),g(154,"i",45)(155,"i",46),a()()(),i(156,"div",47)(1
157,"i",48),u("click",function(){return n.printData()}),a(),i(158,"i",49),u("click",function(){return n.downloadExcel()}),a()()()()(),i(159,"div",50)(160,"div",51)(161,"div",52)(162,"div",53),u("click",function(){return n.employeeWise()}),r(163," Employee Wise "),a(),i(164,"div",54),u("click",function(){return n.bulkEntry()}),r(165,"Bulk Entry"),a()()(),i(166,"div",51)(167,"app-select",55),u("valueChange",function(l){return n.locationAvailabilityCheck(l)}),a()(),i(168,"div",51)(169,"app-select",56),u("valueChange",function(l){return n.filterEmployeeSelected(l)}),a()(),i(170,"div",51)(171,"app-select",57),u("valueChange",function(l){return n.filterDepartmentSelected(l)}),a()(),i(172,"div",51)(173,"app-select",58),u("valueChange",function(l){return n.filterDesignationSelected(l)}),a()(),i(174,"div",51),g(175,"input",59),a()(),i(176,"div",60)(177,"app-punch-time-mobile",61),u("searchChange",function(l){return n.onMobileSearch(l)})("pageChange",function(l){return n.onMobilePageChange(l)})("edit",function(l){return n.editData(l._id)})("delete",function(l){return n.deleteData(l._id)}),a()(),i(178,"div",62)(179,"div",63)(180,"div",38),g(181,"table",64),a()()()()()),e&2&&(d(12),f("formGroup",n.employeePunchForm),d(9),f("data",n.employmentSelectList),d(8),f("data",n.departmentSelectList),d(8),f("data",n.designationSelectList),d(8),f("data",n.punchTypeSelectList),d(26),T(n.rComStatus?-1:71),d(),T(n.rComStatus?72:-1),d(11),f("formGroup",n.bulkPunchForm),d(9),f("data",n.regionSelectList),d(6),f("data",n.filteredOfficeSelectList),d(6),f("data",n.filteredDepartmentSelectList),d(6),f("data",n.filteredSectionSelectList),d(16),f("data",n.punchTypeSelectList),d(20),T(n.rComStatus?-1:146),d(),T(n.rComStatus?147:-1),d(20),f("data",n.locationAvailability),d(2),f("data",n.employmentSelectList),d(2),f("data",n.departmentSelectList),d(2),f("data",n.designationSelectList),d(4),f("items",n.punchTimeList)("totalRecords",n.mobileTotalRecords)("pageSize",n.mobilePageSize)("currentPage",n.mobilePage))},dependencies:[k,X,I,O,R,H,N,V,Y,Q],styles:["@media(min-width:992px){.modal-xl[_ngcontent-%COMP%]{max-width:80%}}.modal-dialog[_ngcontent-%COMP%]{overflow-y:initial!important}.modal-body[_ngcontent-%COMP%]{height:800px;overflow-y:auto;padding:0}.btn[_ngcontent-%COMP%]{display:inline-block;font-weight:600;font-size:11px;border-radius:.25rem}.small-box[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{font-size:11px}.small-box[_ngcontent-%COMP%]   .icon[_ngcontent-%COMP%] > i.fa[_ngcontent-%COMP%], .small-box[_ngcontent-%COMP%]   .icon[_ngcontent-%COMP%] > i.fab[_ngcontent-%COMP%], .small-box[_ngcontent-%COMP%]   .icon[_ngcontent-%COMP%] > i.far[_ngcontent-%COMP%], .small-box[_ngcontent-%COMP%]   .icon[_ngcontent-%COMP%] > i.fas[_ngcontent-%COMP%], .small-box[_ngcontent-%COMP%]   .icon[_ngcontent-%COMP%] > i.glyphicon[_ngcontent-%COMP%], .small-box[_ngcontent-%COMP%]   .icon[_ngcontent-%COMP%] > i.ion[_ngcontent-%COMP%]{font-size:25px;top:25px}.small-box[_ngcontent-%COMP%]   h3[_ngcontent-%COMP%]{font-family:Roboto,sans-serif!important;font-size:15px;font-weight:550;margin:0 0 10px;padding:0;white-space:nowrap}.dropdown-toggle-custom[_ngcontent-%COMP%]{border-top:.3em solid;border-right:.3em solid transparent;border-bottom:0;border-left:.3em solid transparent}.modal-body[_ngcontent-%COMP%]{position:relative;-ms-flex:1 1 auto;flex:1 1 auto;padding:0rem}.modal-header[_ngcontent-%COMP%]{display:-ms-flexbox;display:flex;-ms-flex-align:start;align-items:flex-start;-ms-flex-pack:justify;justify-content:space-between;padding:10px;border-bottom:1px solid #e9ecef;border-top-left-radius:.3rem;border-top-right-radius:.3rem}.modal-header[_ngcontent-%COMP%]   .close[_ngcontent-%COMP%], .modal
1-header[_ngcontent-%COMP%]   .mailbox-attachment-close[_ngcontent-%COMP%]{padding:10px;margin:-1rem -1rem -1rem auto}"]})};var se=U(ae());function We(m,t){if(m&1){let e=L();i(0,"input",27),u("click",function(){P(e);let o=y(2);return w(o.importBulkDeduction())}),a()}}function qe(m,t){if(m&1&&(i(0,"div",9),x(1,We,1,0,"input",26),a()),m&2){let e=y();d(),T(e.allowanceObList.length>0?1:-1)}}function He(m,t){m&1&&(i(0,"div")(1,"span",28),r(2,"Please Wait...."),a()())}var te=class m{employeeService=C(K);punchTimeService=C(F);deductionTypeSelectList=[];employeeList=[];allowanceObList=[];selectedAllowanceType;selectedEffectiveDate;allowanceType;importAllowanceForm;rComStatus;constructor(){}ngOnInit(){this.employeeService.getEmployeeList(),this.deductionTypeSelectList.push({id:"Excel Import",text:"Excel Import",disabled:!1}),this.employeeService.employeeList.subscribe(t=>{this.employeeList=t}),this.punchTimeService.rComStatus.subscribe(t=>{this.rComStatus=t;try{t||$("#punchImportTable").DataTable().clear().draw()}catch(e){console.warn("error ===> ",e)}}),this.punchTimeService.punchTimeList.subscribe(t=>{this.importAllowanceForm.reset(),this.allowanceObList=[]}),this.importAllowanceForm=new M({date:new h(null,[_.required]),punchType:new h(null,[_.required]),fileUpload:new h})}name="Angular "+me.major;tableData;tableTitle;customPagination=1;recordsPerPage=10;tableRecords=[];pageStartCount=0;pageEndCount=10;totalPageCount=0;currentPage=0;importBulkDeduction(){let t=this.allowanceObList;t.length>0&&this.punchTimeService.createBulkPunchTime(t)}uploadData(t){let e=event.target;if(e.files.length!==1)throw new Error("Cannot use multiple files");let n=new FileReader;n.readAsBinaryString(e.files[0]),n.onload=o=>{let l=o.target.result,s=J(l,{type:"binary",cellDates:!0}),c=s.SheetNames[0],p=s.Sheets[c],b=S.sheet_to_json(p);this.tableData=b,this.generateEmployeeTableList()}}generateEmployeeTableList(){this.tableData.forEach(t=>{let e=this.employeeList.find(n=>n.eid==t.empID);this.allowanceObList.push({punchType:this.allowanceType==null?"":this.allowanceType,employeeName:e!=null?e.fullName+"("+e.eid+")":"",empId:e!=null?e._id+"":"",empCode:e!=null?(e.empID!=null?e.empID:"")+"":"",punchTime:(0,se.default)(t.punchTime).format("h:mm:ss"),date:(0,se.default)(t.date).format("YYYY-MM-D"),remarks:t.remarks})}),this.generateEmployeeTable(this.allowanceObList,"general")}dateChangedList(t){this.selectedEffectiveDate=t.target.value;for(let e=0;e<this.allowanceObList.length;e++)this.allowanceObList[e].date=t.target.value;this.generateEmployeeTable(this.allowanceObList,"dateChanged")}allowanceTypeSelection(t){this.allowanceType=t;for(let e=0;e<this.allowanceObList.length;e++)this.allowanceObList[e].punchType=t;this.generateEmployeeTable(this.allowanceObList,"typeSelection")}generateEmployeeTable(t,e){let n=[{title:"#SL",className:"text-center"},{title:"Employee",data:"employeeName"},{title:"Type",data:"punchType"},{title:"Time",data:"punchTime",className:"text-center",render:function(l,s,c,p){return'<div ><input type="time" step="1" class="text-right amountAction" value="'+l+'" id="amount_'+c.empId+'"/></div>'}},{title:"Remarks",data:"remarks",className:"text-center",render:function(l,s,c,p){return'<div ><input type="text" value="'+l+'" class="remarksAction" id="remarks_'+c.empId+'"/></div>'}},{title:"Date",data:"date",className:"text-center",render:function(l,s,c,p){return'<div ><input type="date" value="'+l+'" class="effectiveAction" id="effective_'+c.empId+'"/></div>'}},{title:"Action",data:"empId",className:"text-center",render:function(l){return'<div class="text-center"><i class="btn btn-sm btn-danger-soft mx-1 rounded mx-1 fa fa-trash-alt deleteAction" id="delete_'+l+'"></i></div>'}}],o=$("#punchImportTable").DataTable({destroy:!0,autoWidth:!1,columns:n,dom:"lfrtip",columnDefs:[{className:"text-center",render:function(l,s,c,p){return p.row+1},targets:0}],drawCallback:l=>{$(".remarksAction").on("keyup",s=>{let c=s.target.id,p=c.split("_")[0],b=c.split("_")[1];this.dataChanged(p,b,s.target.value)}),$(".amountAction").on("keyup",s=>{let c=s.target.id,p=c.split("_")[0],b=c.split("_")[1];this.dataChanged(p,b,s.target.value)}),$(".effectiveAction").on("change",s=>{let c=s.target.id,p=c.split("_")[0],b=c.split("_")[1];this.dataChanged(p,b,s.target.value)}
1),$(".deleteAction").on("click",s=>{let c=s.target.id,p=c.split("_")[0],b=c.split("_")[1];this.dataChanged(p,b,s.target.value)})}});o.clear(),o.rows.add(t).draw()}dataChanged(t,e,n){if(t=="remarks"){var o=this.allowanceObList.findIndex(l=>l.empId==e);this.allowanceObList[o].remarks=n}else if(t=="amount"){var o=this.allowanceObList.findIndex(s=>s.empId==e);this.allowanceObList[o].amount=n}else if(t=="effective"){var o=this.allowanceObList.findIndex(s=>s.empId==e);this.allowanceObList[o].effectiveDate=n}else if(t=="delete"&&this.allowanceObList.length>1){var o=this.allowanceObList.findIndex(s=>s.empId==e);o!==-1&&this.allowanceObList.splice(o,1),this.generateEmployeeTable(this.allowanceObList,"dataChanged-delete")}}dateChanged(t){for(let e=0;e<this.allowanceObList.length;e++)this.allowanceObList[e].effectiveDate=t.target.value;this.generateEmployeeTable(this.allowanceObList,"dateChanged")}onPageChange(){this.pageStartCount=this.currentPage*this.recordsPerPage,this.pageEndCount=this.pageStartCount+this.recordsPerPage,this.tableRecords=this.tableData.slice(this.pageStartCount,this.pageEndCount)}DownloadExcel(){let t=S.json_to_sheet([]),e=S.book_new();S.book_append_sheet(e,t,"Attendance_Excel"),S.sheet_add_aoa(t,[["eid","employeeName","punchType","punchTime","remarks","date"]],{origin:"A1"}),j(e,"Attendance_Excel.xlsx")}static \u0275fac=function(e){return new(e||m)};static \u0275cmp=E({type:m,selectors:[["app-punch-excel-import"]],decls:59,vars:4,consts:[[1,"content"],[1,"container-fluid"],[1,"content",2,"margin-top","8px"],[3,"formGroup"],[1,"row"],[1,"col-md-2","col-sm-12"],[1,"form-group"],[1,"control-label","col-md-12"],[2,"margin-left","5px","color","red"],[1,"col-md-12"],["type","date","formControlName","date",1,"form-control","form-control-sm",3,"change"],["placeholder","Select Punch Type","width","100%","formControlName","punchType",1,"form-control","form-control-sm",3,"valueChange","data"],[1,"uploadDocument"],["id","my-file-selector","type","file","formControlName","fileUpload","name","uploadExcel",3,"change"],[1,"col-md-2","col-sm-12",2,"margin-top","25px"],[1,"btn","btn-sm","btn-primary",3,"click"],[1,"fa","fa-file-excel",2,"margin-right","5px"],[1,"col-md-4"],[1,"text-primary",2,"font-size","15px","font-weight","600"],["width","100%",1,"table-soft","w3-small","table-striped"],[1,"text-left"],[1,"col-12"],[1,"col-12",2,"padding","15px"],[2,"overflow-x","auto"],["id","punchImportTable",1,"table-soft","w3-small","table-striped",2,"width","100%","font-size","11px"],[1,"col-md-2","col-sm-6","float-right",2,"margin-top","15px","margin-bottom","10px"],["type","submit","value","PROCESS NOW",1,"form-control","form-control-sm","btn","btn-sm","btn-success"],["type","submit","value","PROCESS NOW",1,"form-control","form-control-sm","btn","btn-sm","btn-success",3,"click"],[1,"form-control","form-control-sm","btn","btn-sm","btn-primary","float-right"]],template:function(e,n){e&1&&(i(0,"section",0)(1,"div",1)(2,"section",2)(3,"div",1)(4,"form",3)(5,"div",4)(6,"div",5)(7,"div",6)(8,"label",7),r(9,"Punch Date"),i(10,"span",8),r(11,"*"),a()(),i(12,"div",9)(13,"input",10),u("change",function(l){return n.dateChangedList(l)}),a()()()(),i(14,"div",5)(15,"div",6)(16,"label",7),r(17,"Punch Type"),i(18,"span",8),r(19,"*"),a()(),i(20,"div",9)(21,"app-select",11),u("valueChange",function(l){return n.allowanceTypeSelection(l)}),a()()()(),i(22,"div",5)(23,"div",6)(24,"label",7),r(25,"Upload Excel"),i(26,"span",8),r(27,"*"),a()(),i(28,"div",9)(29,"div",12)(30,"input",13),u("change",function(l){return n.uploadData(l)}),a()()()()(),i(31,"div",14)(32,"div",15),u("click",function(){return n.DownloadExcel()}),g(33,"i",16),r(34," Download Format "),a()(),i(35,"div",17)(36,"div",18),r(37,"Excel Header"),a(),i(38,"table",19)(39,"thead")(40,"th",20),r(41,"empID"),a(),i(42,"th"),r(43,"employeeName"),a(),i(44,"th"),r(45,"punchType"),a(),i(46,"th"),r(47,"punchTime"),a(),i(48,"th"),r(49,"remarks"),a(),i(50,"th"),r(51,"date"),a()()()()()(),i(52,"div",21)(53,"div",22)(54,"div",23),g(55,"table",24),a()()(),i(56,"div",25),x(57,qe,2,1,"div",9),x(58,He,3,0,"div"),a()()()()()),e&2&&(d(4),f("formGroup",n.importAllowanceForm),d(17
1),f("data",n.deductionTypeSelectList),d(36),T(n.rComStatus?-1:57),d(),T(n.rComStatus?58:-1))},dependencies:[k,X,I,O,R,H,N,V,Y],encapsulation:2})};var ce=U(ae());function Je(m,t){if(m&1){let e=L();i(0,"input",25),u("click",function(){P(e);let o=y(2);return w(o.importBulkDeduction())}),a()}}function Ke(m,t){if(m&1&&(i(0,"div",9),x(1,Je,1,0,"input",24),a()),m&2){let e=y();d(),T(e.machineDataList.length>0?1:-1)}}function Qe(m,t){m&1&&(i(0,"div")(1,"span",26),r(2,"Please Wait...."),a()())}var ne=class m{employeeService=C(K);punchTimeService=C(F);employeeList=[];machineDataList=[];selectedAllowanceType;selectedEffectiveDate;allowanceType;importAllowanceForm;rComStatus;constructor(){}ngOnInit(){this.employeeService.getEmployeeList(),this.employeeService.employeeList.subscribe(t=>{this.employeeList=t}),this.punchTimeService.rComStatus.subscribe(t=>{this.rComStatus=t;try{t||$("#machinePunchTable").DataTable().clear().draw()}catch(e){console.warn("error ===> ",e)}}),this.punchTimeService.punchTimeList.subscribe(t=>{this.importAllowanceForm.reset(),this.machineDataList=[]}),this.importAllowanceForm=new M({date:new h(null,[_.required]),punchType:new h(null,[_.required]),fileUpload:new h})}tableData;tableTitle;customPagination=1;recordsPerPage=10;tableRecords=[];pageStartCount=0;pageEndCount=10;totalPageCount=0;currentPage=0;importBulkDeduction(){let t=this.machineDataList;t.length>0&&this.punchTimeService.createBulkPunchTime(t)}uploadData(t){let e=event.target;if(e.files.length!==1)throw new Error("Cannot use multiple files");let n=new FileReader;n.readAsBinaryString(e.files[0]),n.onload=o=>{let l=o.target.result,s=J(l,{type:"binary",cellDates:!0}),c=s.SheetNames[0],p=s.Sheets[c],b=S.sheet_to_json(p);this.tableData=b,this.generateEmployeeTableList()}}generateEmployeeTableList(){this.tableData.forEach(t=>{let e=this.employeeList.find(n=>n.bioMatrixId==t.empID);e!=null&&this.machineDataList.push({punchType:"Machine",employeeName:e!=null?e.fullName+"("+e.eid+")":t.employeeName,empId:e!=null?e._id+"":"",empCode:e!=null?(e.empID!=null?e.empID:"")+"":"",punchTime:t.punchTime==null?"":(0,ce.default)(t.punchTime).format("hh:mm:ss"),date:t.punchTime==null?"":(0,ce.default)(t.punchTime).format("YYYY-MM-DD"),remarks:"Machine Data Excel Import"})}),this.generateEmployeeTable(this.machineDataList,"general")}generateEmployeeTable(t,e){let n=[{title:"#SL",className:"text-center"},{title:"Employee",data:"employeeName"},{title:"Type",data:"punchType"},{title:"Time",data:"punchTime",className:"text-center"},{title:"Date",data:"date",className:"text-center"},{title:"Action",data:"empId",className:"text-center",render:function(l){return'<div class="text-center"><i class="btn btn-sm btn-danger-soft mx-1 rounded mx-1 fa fa-trash-alt deleteAction" id="delete_'+l+'"></i></div>'}}],o=$("#machinePunchTable").DataTable({destroy:!0,autoWidth:!1,columns:n,dom:"lfrtip",columnDefs:[{className:"text-center",render:function(l,s,c,p){return p.row+1},targets:0}],drawCallback:l=>{$(".effectiveAction").on("change",s=>{let c=s.target.id,p=c.split("_")[0],b=c.split("_")[1];this.dataChanged(p,b,s.target.value)}),$(".deleteAction").on("click",s=>{let c=s.target.id,p=c.split("_")[0],b=c.split("_")[1];this.dataChanged(p,b,s.target.value)})}});o.clear(),o.rows.add(t).draw()}dataChanged(t,e,n){if(t=="effective"){var o=this.machineDataList.findIndex(l=>l.empId==e);this.machineDataList[o].effectiveDate=n}else if(t=="delete"&&this.machineDataList.length>1){var o=this.machineDataList.findIndex(s=>s.empId==e);o!==-1&&this.machineDataList.splice(o,1),this.generateEmployeeTable(this.machineDataList,"dataChanged-delete")}}onPageChange(){this.pageStartCount=this.currentPage*this.recordsPerPage,this.pageEndCount=this.pageStartCount+this.recordsPerPage,this.tableRecords=this.tableData.slice(this.pageStartCount,this.pageEndCount)}DownloadExcel(){let t=S.json_to_sheet([]),e=S.book_new();S.book_append_sheet(e,t,"Machine_Punch_Excel"),S.sheet_add_aoa(t,[["empID","employeeName","punchTime"]],{origin:"A1"}),j(e,"Machine_Punch_Excel.xlsx")}static \u0275fac=function(e){return new(e||m)};static \u0275cmp=E({type:m,selectors:[["app-machine-data"]],decls:37,vars:3,consts:[[1,"content"],[1,"container-fluid"],[1,"content",2,"margin-top","8px"],[3,"formGroup"],[1,"row"],[1,"col-md-6","col-sm-12"],[1,"form-group"],[1,"control-label","col-md-12"],[2,"margin-left","5px","color","red"],[1,"col-md-12"],[1,"uploadDocument"],["id","my-file-selector","type","file","formControlName","fileUpload","name","uploadExcel",3,"change"],[1,"col-md-2","col-sm-12",2,"margin-top","25px"],[1,"btn","btn-sm","btn-primary",3,"click"],[1,"fa","fa-file-excel",2,"margin-right","5px"],[1,"col-md-4"],[1,"text-primary",2,"font-size","15px","font-weight","600"],["width","100%",1,"table-soft","w3-small","table-striped"],[1,"text-left"],[1,"col-12"],[1,"col-12",2,"padding","15px"],[2,"overflow-x","auto"],["
1id","machinePunchTable",1,"table-soft","w3-small","table-striped",2,"width","100%","font-size","11px"],[1,"col-md-2","col-sm-6","float-right",2,"margin-top","15px","margin-bottom","10px"],["type","submit","value","PROCESS NOW",1,"form-control","form-control-sm","btn","btn-sm","btn-success"],["type","submit","value","PROCESS NOW",1,"form-control","form-control-sm","btn","btn-sm","btn-success",3,"click"],[1,"form-control","form-control-sm","btn","btn-sm","btn-primary","float-right"]],template:function(e,n){e&1&&(i(0,"section",0)(1,"div",1)(2,"section",2)(3,"div",1)(4,"form",3)(5,"div",4)(6,"div",5)(7,"div",6)(8,"label",7),r(9,"Upload Excel"),i(10,"span",8),r(11,"*"),a()(),i(12,"div",9)(13,"div",10)(14,"input",11),u("change",function(l){return n.uploadData(l)}),a()()()()(),i(15,"div",12)(16,"div",13),u("click",function(){return n.DownloadExcel()}),g(17,"i",14),r(18," Download Format "),a()(),i(19,"div",15)(20,"div",16),r(21,"Excel Header"),a(),i(22,"table",17)(23,"thead")(24,"th",18),r(25,"empID"),a(),i(26,"th"),r(27,"employeeName"),a(),i(28,"th"),r(29,"punchTime"),a()()()()()(),i(30,"div",19)(31,"div",20)(32,"div",21),g(33,"table",22),a()()(),i(34,"div",23),x(35,Ke,2,1,"div",9),x(36,Qe,3,0,"div"),a()()()()()),e&2&&(d(4),f("formGroup",n.importAllowanceForm),d(31),T(n.rComStatus?-1:35),d(),T(n.rComStatus?36:-1))},dependencies:[k,X,I,O,R,N,V,Y],encapsulation:2})};var Ne=class m{constructor(){}ngOnInit(){}static \u0275fac=function(e){return new(e||m)};static \u0275cmp=E({type:m,selectors:[["app-punch-time"]],decls:26,vars:0,consts:[[1,"content","w3-animate-right"],[1,"container-fluid"],[1,"content",2,"margin-top","8px"],[1,"row"],[1,"col-md-12"],[1,"card","card-dark","card-tabs"],[1,"card-header","p-0","pt-1"],["id","custom-tabs-one-tab","role","tablist",1,"nav","nav-tabs"],[1,"nav-item"],["id","custom-tabs-tree-tab","data-toggle","pill","href","#custom-tabs-tree","role","tab","aria-controls","custom-tabs-tree","aria-selected","true",1,"nav-link","active"],["id","custom-tabs-one-home-tab","data-toggle","pill","href","#custom-tabs-one-home","role","tab","aria-controls","custom-tabs-one-home","aria-selected","true",1,"nav-link"],["id","custom-tabs-one-machine-tab","data-toggle","pill","href","#custom-tabs-one-machine","role","tab","aria-controls","custom-tabs-one-machine","aria-selected","true",1,"nav-link"],[1,"card-body"],["id","custom-tabs-one-tabContent",1,"tab-content"],["id","custom-tabs-tree","role","tabpane3","aria-labelledby","custom-tabs-tree-tab",1,"tab-pane","fade","show","active"],["id","custom-tabs-one-home","role","tabpanel","aria-labelledby","custom-tabs-one-home-tab",1,"tab-pane","fade"],["id","custom-tabs-one-machine","role","tabpanel","aria-labelledby","custom-tabs-one-machine-tab",1,"tab-pane","fade"]],template:function(e,n){e&1&&(i(0,"section",0)(1,"div",1)(2,"section",2)(3,"div",1)(4,"div",3)(5,"div",4)(6,"div",5)(7,"div",6)(8,"ul",7)(9,"li",8)(10,"a",9),r(11,"Punch History"),a()(),i(12,"li",8)(13,"a",10),r(14,"Excel Import"),a()(),i(15,"li",8)(16,"a",11),r(17,"Machine Data"),a()()()(),i(18,"div",12)(19,"div",13)(20,"div",14),g(21,"app-punch-time-process"),a(),i(22,"div",15),g(23,"app-punch-excel-import"),a(),i(24,"div",16),g(25,"app-machine-data"),a()()()()()()()()()())},dependencies:[k,N,ee,te,ne],encapsulation:2})};export{Ne as PunchTimeComponent};

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.