PageSourceSearch

https://ripplemind.com/_next/static/chunks/pages/salary-management…/salary-list-8be0c8195aff9fe1.js

js ripplemind.com collected 2026-10-06 13:17:00 UTC 30,290 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1626],{36316:function(e,a,t){"use strict";t.d(a,{Z:function(){return r}});var l=t(91373);let r=(0,l.Z)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},45503:function(e,a,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/salary-management/company/[companyId]/salary-list",function(){return t(92666)}])},42689:function(e,a,t){"use strict";t.r(a);var l=t(85893),r=t(67294),s=t(41664),n=t.n(s),o=t(11163),i=t(88446),d=t(86501);a.default=e=>{let{children:a}=e,t=(0,o.useRouter)(),{companyId:s}=t.query,[c,u]=(0,r.useState)(null),[y,p]=(0,r.useState)(!0),m=[{name:"Employees",path:"/salary-management/company/".concat(s,"/employees")},{name:"Departments",path:"/salary-management/company/".concat(s,"/department")},{name:"Attendance",path:"/salary-management/company/".concat(s,"/attendance")},{name:"Designations",path:"/salary-management/company/".concat(s,"/designation")},{name:"Salary List",path:"/salary-management/company/".concat(s,"/salary-list")},{name:"Holidays",path:"/salary-management/company/".concat(s,"/holidays")},{name:"Religion",path:"/salary-management/company/".concat(s,"/religion")}].sort((e,a)=>e.name.localeCompare(a.name));return(0,r.useEffect)(()=>{if(!s)return;let e=async()=>{var e,a,t;try{let a=await i.Z.post("/payroll/company/company-by-id",{company_id:s});u(null===(e=a.data)||void 0===e?void 0:e.data)}catch(e){d.ZP.error((null==e?void 0:null===(a=e.response)||void 0===a?void 0:null===(t=a.data)||void 0===t?void 0:t.message)||"Error fetching company"),console.error("❌ Error fetching company:",e)}finally{p(!1)}};e()},[s]),(0,l.jsxs)("div",{className:"flex min-h-screen",children:[(0,l.jsxs)("aside",{className:"w-64 flex-shrink-0 bg-gray-900 text-white p-4",children:[y?(0,l.jsx)("h2",{className:"text-lg font-bold mb-6",children:"Loading..."}):(0,l.jsxs)("div",{className:"flex items-center gap-3 my-3",children:[(null==c?void 0:c.logo_url)&&(0,l.jsx)("img",{src:c.logo_url,alt:c.company_name,className:"w-12 h-12 rounded-full object-cover border border-gray-700"}),(0,l.jsx)("h2",{className:"text-lg font-bold truncate",children:(null==c?void 0:c.company_name)||"Company"})]}),(0,l.jsx)("ul",{className:"space-y-2 mb-6",children:m.map(e=>(0,l.jsx)("li",{children:(0,l.jsx)(n(),{href:e.path,children:(0,l.jsx)("span",{className:"block px-3 py-2 rounded-md cursor-pointer transition-colors ".concat(t.asPath.startsWith(e.path)?"bg-gray-700 font-semibold":"hover:bg-gray-800"),children:e.name})})},e.path))}),(0,l.jsx)(n(),{href:"/salary-management/company",children:(0,l.jsx)("span",{className:"block mt-6 text-sm text-gray-300 hover:text-white",children:"← Back to Companies"})})]}),(0,l.jsx)("main",{className:"flex-1 p-3 bg-gray-100 overflow-x-auto",children:(0,l.jsx)("div",{className:"min-w-[1200px]",children:a})})]})}},92666:function(e,a,t){"use strict";t.r(a),t.d(a,{default:function(){return E}});var l=t(85893),r=t(67294),s=t(88446),n=t(86501),o=t(90044),i=t(87083),d=t(36316),c=t(91373);let u=(0,c.Z)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),y=(0,c.Z)("file-up",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"m15 15-3-3-3 3",key:"15xj92"}]]);var p=t(17866),m=t(44080),h=t(91479),x=t(86010),v=t(58386),g=e=>{let{onClose:a,otpModal:t,handleClick:o}=e,[i,d]=(0,r.useState)(""),[c,u]=(0,r.useState)(!1),[y,p]=(0,r.useState)(""),[x,g]=(0,r.useState)(""),f=async()=>{if(4!==i.length){p("4-digit OTP is required"),g("");return}try{u(!0),p(""),g(""),await s.Z.post("/otp/verify_otp_admin",{otp:parseInt(i)}),g("OTP Verified successfully"),n.ZP.success("OTP Verified successfully"),o&&await o(),a()}catch(s){var e,t,l,r;let a=(null==s?void 0:null===(e=s.response)||void 0===e?void 0:null===(t=e.data)||void 0===t?void 0:t.message)==="otp mismatch"?"OTP Mismatch":(null==s?void 0:null===(l=s.response)||void 0===l?void 0:null===(r=l.data)||void 0===r?void 0:r.message)||"Verification failed";p(a),g(""),n.ZP.error(a)}finally{u(!1)}};return(0,l.jsx)(m.u,{appear:!0,show:null==t?void 0:t.openModal,as:r.Fragment,children:(0,l.jsxs)(h.V,{as:"div",className:"relative z-10",onClose:a,children:[(0,l.jsx)(m.u.Child,{as:r.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,l.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-25"})}),(0,l.jsx)("div",{className:"fixed inset-0 overflow-y-auto flex items-center justify-center p-4",children:(0,l.jsx)("div",{className:"w-full max-w-md",children:(0,l.jsx)(m.u.Child,{as:r.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95",children:(0,l.jsxs)(h.V.Panel,{className:"bg-white rounded-2xl shadow-xl p-6",children:[(0,l.jsx)(h.V.Title,{className:"text-lg font-medium text-gray-900 mb-2",children:"Verify OTP to Proceed"}),(0,l.jsx)("p",{className:"text-sm text-gray-500 mb-4",children:"Please enter the 4-digit OTP sent to your device."}),(0,l.jsxs)("div",{className:"pt-4",children:[(0,l.jsxs)("div",{className:"w-full border-b border-gray-200",children:[(0,l.jsx)("div",{className:"flex justify-center p-3",children:(null==t?void 0:t.openModal)&&(0,l.jsx)(v.Z,{value:i,onChange:d,numInputs:4,inputType:"tel",containerStyle:"flex gap-2",inputStyle:"border border-gray-300 rounded-md text-center w-10 h-10 text-lg focus:outline-none focus:ring-2 focus:ring-blue-400",render
1Separator:(0,l.jsx)("span",{className:"px-1",children:"-"}),renderInput:e=>(0,l.jsx)("input",{...e}),skipDefaultStyles:!0})}),y&&(0,l.jsx)("p",{className:"text-center text-sm text-red-600",children:y}),x&&(0,l.jsx)("p",{className:"text-center text-sm text-green-600",children:x})]}),(0,l.jsxs)("div",{className:"text-center space-x-2 mt-4",children:[(0,l.jsx)("button",{className:"shadow bg-green-500 hover:bg-green-400 focus:shadow-outline focus:outline-none text-white py-2 px-4 rounded disabled:opacity-50",type:"button",onClick:f,disabled:c,children:c?"Verifying...":"Verify OTP"}),(0,l.jsx)("button",{className:"shadow bg-gray-200 hover:bg-gray-300 focus:shadow-outline focus:outline-none text-black py-2 px-4 rounded",type:"button",onClick:a,children:"Close"})]})]})]})})})})]})})};let f=["January","February","March","April","May","June","July","August","September","October","November","December"],b=new Date().getFullYear(),_=Array.from({length:10},(e,a)=>b-a);function j(e){let{companyId:a}=e,[t,o]=(0,r.useState)(!1),[i,d]=(0,r.useState)(""),[c,u]=(0,r.useState)(b.toString()),[y,p]=(0,r.useState)(!1),[v,j]=(0,r.useState)("group"),[w,N]=(0,r.useState)([]),[S,k]=(0,r.useState)(""),[C,D]=(0,r.useState)({openModal:!1,verified:!1,from:"",status:!1}),Z=async()=>{p(!0);try{var e;let t=await s.Z.post("/payroll/employee/list",{page_enabled:"n",page:-1,limit:-1,sortDetails:{sortKey:"employee-id",sortType:-1},searchDetails:[],searchDetailsAnd:[{basicSearchKey:"",basicSearchValue:"",basicSearchType:""}],searchQuery:"",company_id:a}),l=(null===(e=t.data)||void 0===e?void 0:e.data)||[];N(l)}catch(e){console.error("Failed to fetch employee list:",e)}finally{p(!1)}},P=async()=>{if(i&&("individual"!==v||S))try{o(!1);let e=await s.Z.get("/otp/sent_otp_admin");200===e.status&&(n.ZP.success(e.data.message),D({openModal:!0,verified:!1,from:"group"===v?"salary-summary":"individual-salary",status:!1}))}catch(t){var e,a;n.ZP.error((null==t?void 0:null===(e=t.response)||void 0===e?void 0:null===(a=e.data)||void 0===a?void 0:a.message)||"An error occurred")}},T=async()=>{D({...C,openModal:!1}),"group"===v?await F():await E()},F=async()=>{if(!i)return;p(!0);let e=f.indexOf(i)+1;try{var t;let l=await s.Z.post("/payroll/salary/generate-monthly-salary",{month:e,year:parseInt(c,10),company_id:a});n.ZP.success((null===(t=l.data)||void 0===t?void 0:t.message)||"Salary list generated for ".concat(i," ").concat(c)),o(!1)}catch(e){console.error(e),n.ZP.error("Failed to generate salary list")}finally{p(!1)}},E=async()=>{var e,t,l;if(!S||!i)return;p(!0);let r=f.indexOf(i)+1;try{let t=await s.Z.post("/payroll/salary/generate-employee-salary",{employee_id:S,month:r,year:parseInt(c,10),company_id:a});n.ZP.success((null===(e=t.data)||void 0===e?void 0:e.message)||"Individual salary generated"),o(!1)}catch(e){console.error(e),n.ZP.error((null==e?void 0:null===(t=e.response)||void 0===t?void 0:null===(l=t.data)||void 0===l?void 0:l.message)||"Failed to generate individual salary")}finally{p(!1)}};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("button",{onClick:()=>{o(!0),"individual"===v&&Z()},className:"bg-green-600 text-white px-4 py-2 rounded-xl shadow hover:bg-green-700 transition",children:"Generate Salary List"}),(0,l.jsx)(m.u,{appear:!0,show:t,as:r.Fragment,children:(0,l.jsxs)(h.V,{as:"div",className:"relative z-50",onClose:()=>o(!1),children:[(0,l.jsx)(m.u.Child,{as:r.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"ease-in duration-200",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 translate-y-4",children:(0,l.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-30 backdrop-blur-sm"})}),(0,l.jsx)("div",{className:"fixed inset-0 flex items-center justify-center p-4",children:(0,l.jsx)(m.u.Child,{as:r.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95 translate-y-4",enterTo:"opacity-100 scale-100 translate-y-0",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100 translate-y-0",leaveTo:"opacity-0 scale-95 translate-y-4",children:(0,l.jsxs)(h.V.Panel,{className:"bg-white rounded-2xl shadow-xl p-6 w-full max-w-sm space-y-4",children:[(0,l.jsx)(h.V.Title,{className:"text-lg font-semibold text-gray-800",children:"Generate Salary List"}),(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-sm text-gray-600 mb-1",children:"Generation Mode"}),(0,l.jsxs)("div",{className:"flex space-x-2",children:[(0,l.jsx)("button",{onClick:()=>j("group"),className:(0,x.Z)("px-4 py-2 rounded-xl border text-sm","group"===v?"bg-gray-200":"hover:bg-gray-100"),children:"Group"}),(0,l.jsx)("button",{onClick:()=>{j("individual"),Z()},className:(0,x.Z)("px-4 py-2 rounded-xl border text-sm","individual"===v?"bg-gray-200":"hover:bg-gray-100"),children:"Individual"})]})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-sm text-gray-600 mb-1",children:"Select Month"}),(0,l.jsxs)("select",{className:"w-full border rounded-xl px-3 py-2",value:i,onChange:e=>d(e.target.value),children:[(0,l.jsx)("option",{value:"",disabled:!0,children:"Select Month"}),f.map(e=>(0,l.jsx)("option",{value:e,children:e},e))]})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-sm text-gray-600 mb-1",children:"Select Year"}),(0,l.jsx)("select",{className:"w-full border rounded-xl px-3 py-2",value:c,onChange:e=>u(e.target.value),children:_.map(e=>(0,l.jsx)("option",{value:e,children:e},e))})]}),"individual"===v&&(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-sm text-gray-600 mb-1",children:"Select Employee"}),(0,l.jsxs)("select",{className:"w-full border rounded-xl px-3 py-2",value:S,onChange:e=>k(e.target.value),children:[(0,l.jsx)("option",{value:"",children:"Select Employee"}),w.map(e=>(0,l.jsx)("option",{value:e.employee_id,children:e.name},e.employee_id))]})]})]}),(0,l.jsxs)("div",{className:"pt-4 flex justify-end space-x-2",children:[(0,l.jsx)("button",{className:"px-4 py-2 rounded-xl border text-gray-600 hover:bg-gray-100 transition",onClick:()=>o(!1),disabled:y,children:"Cancel"}),(0,l.jsx)("button",{className:"px-4 py-2 rounded-xl bg-gray-600 text-white hover:bg-gray-700 transition flex items-center justify-center min-w-[100px]",onClick:P,disabled:!i||"individual"===v&&!S||y,children:y?(0,l.jsx)("div",{className:"h-4 w-4 border-2 border-white border-t-transparent roun
1ded-full animate-spin"}):"Generate"})]})]})})})]})}),C.openModal&&(0,l.jsx)(g,{onClose:()=>D({openModal:!1,verified:!1,from:"",status:!1}),otpModal:C,handleClick:T})]})}var w=t(26533),N=e=>{let{value:a,onChange:t,disabled:n=!1,className:o="",companyId:i}=e,[d,c]=(0,r.useState)([]),[u,y]=(0,r.useState)(!1),[p,m]=(0,r.useState)(null),h=async()=>{y(!0),m(null);try{var e;let a=await s.Z.post("/payroll/employee/active-list",{page_enabled:"n",page:-1,limit:-1,sortDetails:{sortKey:"name",sortType:1},searchDetails:[],searchDetailsAnd:[{basicSearchKey:"",basicSearchValue:"",basicSearchType:""}],searchQuery:"",company_id:i}),t=(null===(e=a.data)||void 0===e?void 0:e.data)||[];c(t)}catch(e){console.error("Failed to fetch employee list:",e),m("Failed to load employees")}finally{y(!1)}};return(0,r.useEffect)(()=>{h()},[]),(0,l.jsxs)("div",{className:"max-w-sm ".concat(o),children:[(0,l.jsxs)("select",{className:"w-full border rounded-xl px-3 py-2 bg-white",value:a,onChange:e=>t(e.target.value),disabled:n,children:[(0,l.jsx)("option",{value:"",children:u?"Loading employees...":"Select Employee"}),Array.isArray(d)&&d.map(e=>(0,l.jsx)("option",{value:e.employee_id,children:e.name},e.employee_id))]}),p&&(0,l.jsx)("p",{className:"text-xs text-red-500 mt-1",children:p})]})},S=t(6605),k=t(8823);let C={name:"Employee Name",month_year:"Month-Year",total_working_days:"Total Working Days",total_present_days:"Total Present Days",total_paid_days:"Total Paid Days",total_ot_days:"OT Days",ot_amount:"OT Amount",basic_salary:"Basic Salary",gross_salary:"Gross Salary",deductions:"Deductions",net_salary:"Net Salary",department:"Department",operator:"Operator"},D=e=>{let a=e.map(e=>{var a,t,l,r,s,n,o;return{name:(null===(a=e.employeeDetails)||void 0===a?void 0:null===(t=a[0])||void 0===t?void 0:t.name)||"",month_year:e.month_year,total_working_days:e.total_working_days,total_present_days:e.total_present_days,total_paid_days:e.total_paid_days,total_ot_days:e.total_ot_days,ot_amount:e.ot_amount,basic_salary:e.basic_salary,gross_salary:e.gross_salary,deductions:e.deductions,net_salary:e.net_salary,department:(null===(l=e.employeeDetails)||void 0===l?void 0:null===(r=l[0])||void 0===r?void 0:null===(s=r.departmentDetails)||void 0===s?void 0:null===(n=s[0])||void 0===n?void 0:n.name)||"",operator:null===(o=e.operatorDetails[0])||void 0===o?void 0:o.user_name}});return a};var Z=e=>{let{companyId:a}=e,[t,c]=(0,r.useState)(0),[m,h]=(0,r.useState)([]),[x,v]=(0,r.useState)(1),[g,f]=(0,r.useState)(20),[b,_]=(0,r.useState)({sortKey:"employee_id",sortType:-1}),[Z,P]=(0,r.useState)(""),[T,F]=(0,r.useState)(!1),[E,M]=(0,r.useState)(null),[O,A]=(0,r.useState)(null),[V,I]=(0,r.useState)(!1),[R,L]=(0,r.useState)((()=>{let e=new Date;e.setMonth(e.getMonth()-1);let a=e.getFullYear(),t=String(e.getMonth()+1).padStart(2,"0");return"".concat(a,"-").concat(t)})()),[q,K]=R.split("-"),[W,B]=(0,r.useState)({loading:!1,success:"",error:""}),H={display:"flex",justifyContent:"center",width:"100%"},z=e=>{M(e.employee_id),A({id:e.employee_id,employee_id:e.employee_id,month_year:e.month_year,ot_amount:e.ot_amount,basic_salary:e.basic_salary,gross_salary:e.gross_salary,deductions:e.deductions,net_salary:e.net_salary,total_working_days:e.total_working_days,total_present_days:e.total_present_days,total_paid_days:e.total_paid_days,total_ot_days:e.total_ot_days,remarks:e.remarks||""})},G=(e,a)=>{let{name:t,value:l}=e.target;if(E===a&&O){let e=l;(t.includes("salary")||t.includes("amount")||t.includes("deductions")||t.includes("days"))&&(e=Number(l)),"remarks"===t&&(e=l),A({...O,[t]:e})}},Y=async()=>{if(O)try{if(B({...W,loading:!0}),O.basic_salary<=0||O.gross_salary<=0){n.ZP.error("Salary values must be positive numbers");return}let e=await s.Z.post("/payroll/salary/edit-salary",{...O,company_id:a});200===e.status&&(n.ZP.success("Salary updated successfully"),h(e=>e.map(e=>e.employee_id===O.employee_id?{...e,ot_amount:O.ot_amount,basic_salary:O.basic_salary,gross_salary:O.gross_salary,deductions:O.deductions,net_salary:O.net_salary,total_working_days:O.total_working_days,total_present_days:O.total_present_days,total_paid_days:O.total_paid_days,total_ot_days:O.total_ot_days,remarks:O.remarks}:e)),J(),B({loading:!1,error:"",success:"Salary updated successfully"}))}catch(e){console.error("Error updating salary:",e),n.ZP.error("Failed to update salary"),B({loading:!1,error:"Failed to update salary",success:""})}},J=()=>{M(null),A(null)},Q=["ot_amount","basic_salary","gross_salary","deductions","net_salary","remarks"],U=(0,r.useMemo)(()=>[{name:(0,l.jsx)("div",{style:H,children:"Action"}),id:"action",minWidth:"100px",cell:e=>E===e.employee_id?(0,l.jsx)(i.ZP,{content:(0,l.jsx)("span",{children:"Inline Edit"}),placement:"bottom",children:(0,l.jsxs)("span",{className:"flex gap-2 justify-center",children:[(0,l.jsx)("button",{onClick:J,className:"px-2 py-1 bg-gray-500 text-white rounded hover:bg-gray-600",children:"❌"}),(0,l.jsx)("button",{onClick:Y,className:"px-2 py-1 bg-gray-500 text-white rounded hover:bg-gray-600",disabled:W.loading,children:W.loading?(0,l.jsx)(d.Z,{className:"h-5 w-5 animate-spin"}):(0,l.jsx)(u,{className:"h-5 w-5"})})]})}):(0,l.jsx)(i.ZP,{content:(0,l.jsx)("span",{children:"Inline Edit"}),placement:"bottom",children:(0,l.jsx)("button",{onClick:()=>z(e),className:"px-2 py-1 bg-gray-500 text-white rounded hover:bg-gray-600",disabled:null!==E&&E!==e.employee_id,children:(0,l.jsx)("i",{className:"fa-solid fa-pen-to-square"})})}),sortable:!1},{name:(0,l.jsx)("div",{style:H,children:"Employee Name"}),id:"name",minWidth:"150px",cell:e=>{var a;return(0,l.jsx)("div",{style:H,children:(0,p.Z)(null===(a=e.employeeDetails[0])||void 0===a?void 0:a.name)})},sortable:!0},{name:(0,l.jsx)("div",{style:H,children:"Month-Year"}),id:"month_year",minWidth:"130px",cell:e=>(0,l.jsx)("div",{style:H,children:(0,p.Z)(e.month_year)}),sortable:!0},...["total_working_days","total_present_days","total_absent_days","total_paid_days","total_ot_days","total_work_minutes","total_ot_minutes","comp_off_amount","ot_amount","basic_salary","gross_salary","deductions","net_salary","remarks"].map(e=>({name:(0,l.jsx)("div",{style:H,children:(0,p.Z)(e.replace(/_/g," "))}),id:e,minWidth:"120px",cell:a=>{let t=E===a.employee_id,r=Q.includes(e);if(t&&r){var s,n;let t="remarks"===e?"text":"number";return"remarks"===e?(0,l.jsx)("textarea",{name:e,itemType:t,value:null!==(s=null==O?void 0:O[e])&&void 0!==s?s:"",onCh
1ange:e=>G(e,a.employee_id),className:"w-full px-2 py-1 border rounded",rows:1,placeholder:"Enter remarks"},"".concat(a.employee_id,"-").concat(e)):(0,l.jsx)("input",{type:"number",name:e,value:null!==(n=null==O?void 0:O[e])&&void 0!==n?n:a[e],onChange:e=>G(e,a.employee_id),className:"w-full px-2 py-1 border rounded",min:0},"".concat(a.employee_id,"-").concat(e))}return(0,l.jsx)("div",{style:H,children:a[e]})},sortable:!0})),{name:(0,l.jsx)("div",{style:H,children:"Department"}),id:"department",minWidth:"120px",cell:e=>{var a,t;return(0,l.jsx)("div",{style:H,children:null===(a=null===(t=e.employeeDetails[0])||void 0===t?void 0:t.departmentDetails[0])||void 0===a?void 0:a.name})},sortable:!0},{name:(0,l.jsx)("div",{style:H,children:"Operator"}),id:"operator_id",width:"100px",cell:e=>{var a;return(0,l.jsx)("div",{style:H,children:null===(a=e.operatorDetails[0])||void 0===a?void 0:a.user_name})},sortable:!0}],[E,O,W]),X=async()=>{F(!0);try{var e,t;let l=await s.Z.post("/payroll/salary/salaries",{month:Number(K),year:Number(q),employee_id:Z,page_enabled:"y",page:x,limit:g,sortDetails:b,searchDetails:[],searchDetailsAnd:[{basicSearchKey:"",basicSearchValue:"",basicSearchType:""}],company_id:a}),r=(null===(e=l.data)||void 0===e?void 0:e.data)||[];h(r),c((null===(t=l.data)||void 0===t?void 0:t.count)||0)}catch(e){console.error("Failed to fetch salary summary:",e)}finally{F(!1)}},$=async()=>{F(!0);try{var e;let t=await s.Z.post("/payroll/salary/salaries",{month:Number(K),year:Number(q),employee_id:Z,page_enabled:"n",page:x,limit:g,sortDetails:b,searchDetails:[],searchDetailsAnd:[{basicSearchKey:"",basicSearchValue:"",basicSearchType:""}],company_id:a}),l=(null===(e=t.data)||void 0===e?void 0:e.data)||[];return h(l),c(l.length),l}catch(e){return console.error("Failed to fetch salary summary:",e),[]}finally{F(!1)}};return(0,r.useEffect)(()=>{null===E&&X()},[x,g,b,R,Z]),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"px-4 pt-4 space-y-4",children:[(0,l.jsx)("h1",{className:"text-2xl ",children:"Salary Summary (".concat(t,")")}),(0,l.jsxs)("div",{children:[(0,l.jsx)(j,{companyId:a}),(0,l.jsx)("button",{className:"p-2 bg-gray-300 hover:bg-gray-400 py-2 px-3 rounded ml-4",onClick:()=>{I(!0)},children:(0,l.jsx)(y,{className:"w-5 h-5"})})]}),(0,l.jsxs)("div",{className:"flex flex-wrap gap-4",children:[(0,l.jsx)(w.Z,{value:R,onChange:L,className:"rounded",inputClassName:"focus:outline-none focus:ring focus:border-blue-500"}),(0,l.jsx)(N,{value:Z,onChange:P,companyId:a})]}),(0,l.jsx)(S.Z,{onClose:()=>I(!1),isOpen:V,title:"Salary Details Data",fieldToHeaderMap:C,fetchData:$,processData:D})]}),(0,l.jsx)("div",{className:"pt-2 p-4",children:(0,l.jsx)(o.ZP,{columns:U,data:m,progressPending:T,pagination:!0,paginationServer:!0,paginationPerPage:g,paginationRowsPerPageOptions:[5,10,20,30,50,100],paginationTotalRows:t,onChangeRowsPerPage:e=>{v(1),f(e)},onChangePage:e=>{v(e)},sortServer:!0,defaultSortFieldId:"col_".concat(b.sortKey),defaultSortAsc:1===b.sortType,onSort:(e,a)=>{let t={sortKey:"string"==typeof(null==e?void 0:e.id)?e.id.replace("col_",""):"id",sortType:"desc"===a?-1:1};_(t)},fixedHeader:!0,fixedHeaderScrollHeight:"64vh",customStyles:k.Z,highlightOnHover:!0})})]})},P=t(42689),T=t(64270),F=t(11846),E=()=>{let e=(0,T.P)("companyId");return!e||e<1?null:(0,l.jsx)(F.Z,{children:(0,l.jsx)(P.default,{children:(0,l.jsx)(Z,{companyId:e})})})}},28646:function(e,a,t){"use strict";var l=t(85893),r=t(41664),s=t.n(r),n=t(11163);t(67294),a.Z=()=>{let e=(0,n.useRouter)(),a=e.asPath;return(0,l.jsxs)("div",{className:"md:mx-28 text-center text-red-500 p-10 bg-gray-100 text-xl",children:["Your are not Logged in to use this functionality .......! ",(0,l.jsx)("br",{}),(0,l.jsx)(s(),{className:"text-blue-500",href:"/login?re_url=".concat(a),children:"Click here to Login"})]})}},8823:function(e,a){"use strict";a.Z={headCells:{style:{border:"1px solid #f1f1f1",fontSize:"14px",backgroundColor:"#e1e1e1"}},cells:{style:{border:"1px solid #f1f1f1",paddingLeft:"7px",paddingRight:"7px"}}}},26533:function(e,a,t){"use strict";var l=t(85893);t(67294),a.Z=e=>{let{value:a,onChange:t,className:r="",inputClassName:s=""}=e;return(0,l.jsx)("div",{className:r,children:(0,l.jsx)("input",{type:"month",value:a,onChange:e=>t(e.target.value),className:"border px-3 py-2 rounded w-full text-sm ".concat(s)})})}},6605:function(e,a,t){"use strict";t.d(a,{Z:function(){return x}});
1var l=t(85893),r=t(67294),s=t(44080),n=t(91479);let o=e=>Object.values(e),i=(e,a)=>e.map(e=>Object.keys(a).reduce((t,l)=>(t[a[l]]=e[l],t),{}));var d=t(74295),c=t.n(d),u=t(93162);let y=async function(e,a){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"export";try{let l=new(c()).Workbook,r=l.addWorksheet("Exported Data");r.addRow(e),a.forEach(a=>{let t=e.map(e=>a[e]||"");r.addRow(t)});let s=r.getRow(1);s.eachCell(e=>{e.font={bold:!0},e.fill={type:"pattern",pattern:"solid",fgColor:{argb:"FFFFE599"}}}),r.columns.forEach(e=>{if(e&&e.eachCell){let a=10;e.eachCell({includeEmpty:!0},e=>{if(e.value){let t=e.value.toString().length;a=Math.max(a,t)}}),e.width=a+2}else e.width=12});let n=await l.xlsx.writeBuffer(),o=new Blob([n],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});(0,u.saveAs)(o,"".concat(t,".xlsx"))}catch(e){console.error("Error exporting to Excel:",e)}};var p=t(57460),m=t.n(p);let h=function(e,a){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"export",l=a.map(a=>e.reduce((e,t)=>(e[t]=a[t]||"",e),{})),r=m().unparse({fields:e,data:l}),s=new Blob([r],{type:"text/csv;charset=utf-8;"});(0,u.saveAs)(s,"".concat(t||"export",".csv"))};var x=e=>{let{onClose:a,isOpen:t,title:d,fieldToHeaderMap:c,fetchData:u,processData:p}=e,[m,x]=(0,r.useState)("excel"),[v,g]=(0,r.useState)(!1),f=async()=>{g(!0);try{let e=await u(),a=await p(e),t=o(c),l=i(a,c);"excel"===m?y(t,l,d):h(t,l,d)}catch(e){console.error("Error exporting data:",e)}finally{g(!1)}};return(0,l.jsx)(s.u,{appear:!0,show:t,as:r.Fragment,children:(0,l.jsxs)(n.V,{as:"div",className:"relative z-10",onClose:a,children:[(0,l.jsx)(s.u.Child,{as:r.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,l.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-25"})}),(0,l.jsx)("div",{className:"fixed inset-0 overflow-y-auto",children:(0,l.jsx)("div",{className:"flex min-h-full items-center justify-center p-4 text-center",children:(0,l.jsx)(s.u.Child,{as:r.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95",children:(0,l.jsxs)(n.V.Panel,{className:"w-full max-w-md p-6 overflow-hidden text-left align-middle transition-all transform bg-white shadow-xl rounded-2xl",children:[(0,l.jsx)(n.V.Title,{as:"h3",className:"text-lg font-medium leading-6 text-gray-900",children:(0,l.jsxs)("div",{children:[d,(0,l.jsx)("button",{className:"shadow bg-slate-400 hover:bg-slate-500 text-white text-sm py-1 px-2 rounded ml-2",onClick:a,children:"Close"})]})}),(0,l.jsxs)("div",{className:"mt-4",children:[(0,l.jsx)("div",{className:"py-3",children:(0,l.jsxs)("div",{className:"flex flex-row text-center rounded bg-gray-200",children:[(0,l.jsx)("div",{className:"px-2 py-1 flex-grow ".concat("excel"===m?"bg-blue-500 text-white":""),onClick:()=>x("excel"),children:"Excel"}),(0,l.jsx)("div",{className:"px-2 py-1 flex-grow ".concat("csv"===m?"bg-blue-500 text-white":""),onClick:()=>x("csv"),children:"CSV"})]})}),(0,l.jsx)("div",{className:"mt-4",children:(0,l.jsx)("button",{className:"shadow bg-green-500 hover:bg-green-600 text-white text-sm py-2 px-4 rounded",onClick:f,disabled:v,children:v?"Exporting...":"Export ".concat(m.toUpperCase())})})]})]})})})})]})})}},11846:function(e,a,t){"use strict";t.d(a,{Z:function(){return o}});var l=t(85893),r=t(48583),s=t(94543),n=t(28646);function o(e){let{children:a}=e,t=(0,r.Dv)(s.ZP);return t.isLoggedIn?a:(0,l.jsx)(n.Z,{})}},17866:function(e,a){"use strict";a.Z=e=>{try{if("string"==typeof e||"number"==typeof e)return"".concat(e);return"-"}catch(e){return console.error(e),"-----"}}},64270:function(e,a,t){"use strict";t.d(a,{N:function(){return n},P:function(){return s}});var l=t(11163),r=t(67294);function s(e){let a=(0,l.useRouter)(),[t,s]=(0,r.useState)(null);return(0,r.useEffect)(()=>{if(a.isReady){let t=a.query[e];if("string"==typeof t){let e=Number(t);e>=1&&s(e)}}},[a.isReady,a.query,e]),t}function n(e){let a=(0,l.useRouter)(),[t,s]=(0,r.useState)(null);return(0,r.useEffect)(()=>
1{if(a.isReady){let t=a.query[e];"string"==typeof t&&""!==t.trim()&&s(t)}},[a.isReady,a.query,e]),t}},58386:function(e,a,t){"use strict";t.d(a,{Z:function(){return s}});var l=t(67294),r=function(e){return"object"==typeof e&&null!==e},s=function(e){var a=e.value,t=void 0===a?"":a,s=e.numInputs,n=void 0===s?4:s,o=e.onChange,i=e.onPaste,d=e.renderInput,c=e.shouldAutoFocus,u=void 0!==c&&c,y=e.inputType,p=void 0===y?"text":y,m=e.renderSeparator,h=e.placeholder,x=e.containerStyle,v=e.inputStyle,g=e.skipDefaultStyles,f=void 0!==g&&g,b=l.useState(0),_=b[0],j=b[1],w=l.useRef([]),N=function(){return t?t.toString().split(""):[]},S="number"===p||"tel"===p;l.useEffect(function(){w.current=w.current.slice(0,n)},[n]),l.useEffect(function(){var e;u&&(null===(e=w.current[0])||void 0===e||e.focus())},[u]);var k=function(){if("string"==typeof h){if(h.length===n)return h;h.length>0&&console.error("Length of the placeholder should be equal to the number of inputs.")}},C=function(e){return(S?!isNaN(Number(e)):"string"==typeof e)&&1===e.trim().length},D=function(e){var a=e.target.value;C(a)&&(E(a),F(_+1))},Z=function(e){var a=e.nativeEvent,t=e.target.value;C(t)||(t.length!==n||t.split("").some(function(e){return!C(e)})||(M(t.split("")),F(n-1)),null===a.data&&"deleteContentBackward"===a.inputType&&(e.preventDefault(),E(""),F(_-1)),e.target.value="")},P=function(){j(_-1)},T=function(e){var a=N();[e.code,e.key].includes("Backspace")?(e.preventDefault(),E(""),F(_-1)):"Delete"===e.code?(e.preventDefault(),E("")):"ArrowLeft"===e.code?(e.preventDefault(),F(_-1)):"ArrowRight"===e.code?(e.preventDefault(),F(_+1)):e.key===a[_]?(e.preventDefault(),F(_+1)):("Spacebar"===e.code||"Space"===e.code||"ArrowUp"===e.code||"ArrowDown"===e.code)&&e.preventDefault()},F=function(e){var a,t,l=Math.max(Math.min(n-1,e),0);w.current[l]&&(null===(a=w.current[l])||void 0===a||a.focus(),null===(t=w.current[l])||void 0===t||t.select(),j(l))},E=function(e){var a=N();a[_]=e[0],M(a)},M=function(e){o(e.join(""))},O=function(e){e.preventDefault();var a,t=N(),l=_,r=e.clipboardData.getData("text/plain").slice(0,n-_).split("");if(!(S&&r.some(function(e){return isNaN(Number(e))}))){for(var s=0;s<n;++s)s>=_&&r.length>0&&(t[s]=null!==(a=r.shift())&&void 0!==a?a:"",l++);F(l),M(t)}};return l.createElement("div",{style:Object.assign({display:"flex",alignItems:"center"},r(x)&&x),className:"string"==typeof x?x:void 0,onPaste:i},Array.from({length:n},function(e,a){return a}).map(function(e){var a,t,s;return l.createElement(l.Fragment,{key:e},d({value:null!==(a=N()[e])&&void 0!==a?a:"",placeholder:null!==(s=null===(t=k())||void 0===t?void 0:t[e])&&void 0!==s?s:void 0,ref:function(a){return w.current[e]=a},onChange:D,onFocus:function(a){j(e),a.target.select()},onBlur:P,onKeyDown:T,onPaste:O,autoComplete:"off","aria-label":"Please enter OTP character ".concat(e+1),style:Object.assign(f?{}:{width:"1em",textAlign:"center"},r(v)?v:{}),className:"string"==typeof v?v:void 0,type:p,inputMode:S?"numeric":"text",onInput:Z},e),e<n-1&&("function"==typeof m?m(e):m))}))}}},function(e){e.O(0,[8869,1303,44,5655,7419,9774,2888,179],function(){return e(e.s=45503)}),_N_E=e.O()}]);

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.