PageSourceSearch

https://www.elevolt.co.ke/_next/static/chunks/8359-0fe7cfdb4736699c.js

js elevolt.co.ke collected 2026-10-04 21:46:40 UTC 16,439 bytes, 1 lines download raw bytes

1try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},a=(new e.Error).stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="3be3aad0-e25a-4f39-9ea8-84b89fdbdc44",e._sentryDebugIdIdentifier="sentry-dbid-3be3aad0-e25a-4f39-9ea8-84b89fdbdc44")}()}catch(e){}"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8359],{87421:function(e,a,t){var s=t(52322),l=t(47023),n=t(57713),r=t(1973),i=t(47477),d=t(28983),c=t(97203),o=t(40511),u=t(76467),p=t(64792),m=t(74523),y=t(59417),v=t(99603),x=t(13980),j=t.n(x),b=t(2784);let g=e=>{let{label:a,value:t,className:l=""}=e;return null==t?null:(0,s.jsxs)("div",{className:"flex flex-col sm:flex-row sm:justify-between py-2 border-b border-gray-100 last:border-0 ".concat(l),children:[(0,s.jsx)(u.Z,{className:"text-gray-500",variant:"label",children:a}),(0,s.jsx)(u.Z,{className:"sm:text-right",variant:"labelValue",children:t})]})};g.propTypes={label:j().string.isRequired,value:j().oneOfType([j().string,j().number,j().node]),className:j().string};let h=e=>{let{children:a,variant:t="gray"}=e;return(0,s.jsx)("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium ".concat({green:"bg-green-100 text-green-700",red:"bg-red-100 text-red-700",blue:"bg-blue-100 text-blue-700",yellow:"bg-yellow-100 text-yellow-700",gray:"bg-gray-100 text-gray-600"}[t]),children:a})};h.propTypes={children:j().node.isRequired,variant:j().oneOf(["green","red","blue","yellow","gray"])};let f=e=>{var a,t,x,j,f;let{adjustmentId:N,show:Z,onClose:_,onEdit:w,onSubmit:S,onApprove:k,onReject:q,onDelete:D}=e,{data:K,isLoading:Q,error:R}=(0,d.rb)({adjustmentId:N,enabled:!!N&&Z}),T=(0,b.useMemo)(()=>m.sQ[null==K?void 0:K.type]||{label:null==K?void 0:K.type,description:""},[null==K?void 0:K.type]),A=(0,b.useMemo)(()=>m.eL[null==K?void 0:K.category]||{label:null==K?void 0:K.category,description:""},[null==K?void 0:K.category]),C=(0,b.useMemo)(()=>(0,m.oZ)(null==K?void 0:K.payroll_period),[null==K?void 0:K.payroll_period]),L=(0,b.useMemo)(()=>K?"percentage"===K.calculation_type?"".concat(K.percentage,"% of base"):(0,p.x)(K.amount):null,[K]),P=(null==K?void 0:K.status)==="approved"||(null==K?void 0:K.status)==="applied",E=(null==K?void 0:K.status)==="rejected",I=(null==K?void 0:K.status)==="applied";return Z?(0,s.jsxs)(c.B,{centerY:!0,fullWidth:!0,isLoading:Q,maxWidth:"700px",onClose:_,show:Z,title:(null==K?void 0:K.name)||"Adjustment Details",children:[!!(Q||R)&&(0,s.jsx)(r.Z,{design:"wrapped",isError:!!R,isLoading:Q,message:R?"Failed to load adjustment":"Loading adjustment..."}),!!(!Q&&!R&&K)&&(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{className:"pb-4 border-b border-gray-200",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mb-3",children:[(0,s.jsx)(o.Z,{size:"md",status:K.status,type:"adjustment"}),(0,s.jsx)("span",{className:"inline-flex items-center px-2.5 py-1 rounded text-xs font-medium ".concat("deduction"===K.type?"bg-red-100 text-red-700":"bg-green-100 text-green-700"),children:T.label}),!!K.category&&(0,s.jsx)(h,{variant:"blue",children:A.label}),!0===K.is_taxable&&(0,s.jsx)(h,{variant:"yellow",children:"Taxable"}),!1===K.is_taxable&&(0,s.jsx)(h,{variant:"gray",children:"Non-taxable"})]}),!!K.description&&(0,s.jsx)(u.Z,{className:"text-gray-600",variant:"body",children:K.description})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 p-4 bg-gray-50 rounded-lg",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(u.Z,{className:"block mb-1",variant:"label",children:"Employee"}),(0,s.jsx)(u.Z,{variant:"labelValue",children:(null===(a=K.user)||void 0===a?void 0:a.name)||"Unknown"}),!!(null===(t=K.user)||void 0===t?void 0:t.email)&&(0,s.jsx)(u.Z,{className:"block text-gray-500",variant:"caption",children:K.user.email})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(u.Z,{className:"block mb-1",variant:"label",children:"Payroll Period"}),(0,s.jsx)(u.Z,{variant:"labelValue",children:C||"Not assigned"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(u.Z,{className:"block mb-1",variant:"label",children:"Effective Date"}),(0,s.jsx)(u.Z,{variant:"labelValue",children:(0,i.p6)(K.effective_date)||"Not set"})]}),!!K.applied_date&&(0,s.jsxs)("div",{children:[(0,s.jsx)(u.Z,{className:"block mb-1",variant:"label",children:"Applied Date"}),(0,s.jsx)(u.Z,{variant:"labelValue",children:(0,i.p6)(K.applied_date)})]})]}),(0,s.jsxs)("div",{className:"p-4 border border-gray-200 rounded-lg",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,s.jsx)(v.G,{className:"text-gray-400",icon:y.lTt}),(0,s.jsx)(u.Z,{variant:"sectionHeader",children:"Amount Details"})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(u.Z,{className:"block mb-1",variant:"label",children:"Calculation Type"}),(0,s.jsx)(u.Z,{className:"capitalize",variant:"labelValue",children:K.calculation_type||"Fixed"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(u.Z,{className:"block mb-1",variant:"label",children:"percentage"===K.calculation_type?"Percentage":"Amount"}),(0,s.jsxs)(u.Z,{className:"text-lg font-semibold ".concat("deduction"===K.type?"text-red-600":"text-green-600"),variant:"stat",children:["deduction"===K.type?"-":"+",L]})]})]}),!!K.is_retroactive&&(0,s.jsxs)("div",{className:"mt-4 p-3 bg-yellow-50 border border-yellow-100 rounded",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(v.G,{className:"text-yellow-600",icon:y.Ry6}),(0,s.jsx)(u.Z,{className:"text-yellow-800",variant:"labelValue",children:"Retroactive Adjustment"})]}),!!K.retroactive_periods&&(0,s.jsxs)(u.Z,{className:"mt-1 text-yellow-700",variant:"caption",children:["Applies to ",K.retroactive_periods," previous period(s)"]})]})]}),!!(P&&K.approver)&&(0,s.jsxs)("div",{className:"p-4 bg-green-50 border border-green-100 rounded-lg",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,s.jsx)(v.G,{className:"text-green-600",icon:y.f8k}),(0,s.jsx)(u.Z,{className:"text-green-800",variant:"sectionHeader",children:"Approved"})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(u.Z,{className:"block mb-1 text-green-700",variant:"label",children:"Approved By"}),(0,s.jsx)(u.Z,{className:"text-green-900",variant:"labelValue",children:(null===(x=K.approver)||void 0===x?void 0:x.name)||"System"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(u.Z,{className:"block mb-1 text-green-700",variant:"label",children:"Approved On"}),(0,s.jsx)(u.Z,{className:"text-green-900",variant:"labelValue",children:(0,i.p6)(K.approved_at)})]})]}),!!K.approval_notes&&(0,s.jsxs)("div",{className:"mt-3 pt-3 border-t border-green-200",children:[(0,s.jsx)(u.Z,{className:"block mb-1 text-green-700",variant:"label",children:"Approval Notes"}),(0,s.jsx)(u.Z,{className:"text-green-900",variant:"body",children:K.approval_notes})]})]}),!!E&&(0,s.jsxs)("div",{className:"p-4 bg-red-50 border border-red-100 rounded-lg",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,s.jsx)(v.G,{className:"text-red-600",icon:y.nYk}),(0,s.jsx)(u.Z,{className:"text-red-800",variant:"sectionHeader",children:"Rejected"})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[!!K.rejector&&(0,s.jsxs)("div",{children:[(0,s.jsx)(u.Z,{className:"block mb-1 text-red-700",variant:"label",children:"Rejected By"}),(0,s.jsx)(u.Z,{className:"text-red-900",variant:"labelValue",children:(null===(j=K.rejector)||void 0===j?void 0:j.name)||"System"})]}),!!K.rejected_at&&(0,s.jsxs)("div",{children:[(0,s.jsx)(u.Z,{className:"block mb-1 text-red-700",variant:"label",children:"Rejected On"}),(0,s.jsx)(u.Z,{className:"text-red-900",variant:"labelValue",children:(0,i.p6)(K.rejected_at)})]})]}),!!K.rejection_reason&&(0,s.jsxs)("div",{className:"mt-3 pt-3 border-t border-red-200",children:[(0,s.jsx)(u.Z,{className:"block mb-1 text-red-700",variant:"label",children:"Rejection Reason"}),(0,s.jsx)(u.Z,{className:"text-red-900",variant:"body",children:K.rejection_reason})]})]}),!!I&&(0,s.jsx)(n.Z,{defaultExpanded:!0,title:"Processing Details",children:(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)(g,{label:"Processing Status",value:K.is_processed?"Processed":"Pending"}),!!K.applied_date&&(0,s.jsx)(g,{label:"Applied to Payroll",value:(0,i.p6)(K.applied_date)}
1),!!K.payslip_id&&(0,s.jsx)(g,{label:"Payslip Reference",value:"#".concat(K.payslip_id)}),!!K.processing_details&&(0,s.jsxs)("div",{className:"mt-2 p-3 bg-gray-50 rounded",children:[(0,s.jsx)(u.Z,{className:"block mb-1",variant:"label",children:"Processing Notes"}),(0,s.jsx)(u.Z,{className:"whitespace-pre-wrap",variant:"body",children:K.processing_details})]})]})}),(0,s.jsx)(n.Z,{title:"Audit Trail",children:(0,s.jsxs)("div",{className:"space-y-3",children:[!!K.creator&&(0,s.jsx)(g,{label:"Created By",value:(null===(f=K.creator)||void 0===f?void 0:f.name)||"System"}),!!K.created_at&&(0,s.jsx)(g,{label:"Created On",value:(0,i.p6)(K.created_at)}),!!K.updated_at&&(0,s.jsx)(g,{label:"Last Updated",value:(0,i.p6)(K.updated_at)})]})}),!!("draft"===K.status&&(w||S||D)||"pending_approval"===K.status&&(k||q))&&(0,s.jsxs)("div",{className:"pt-4 border-t border-gray-200 flex flex-wrap gap-2 justify-end",children:[!!("draft"===K.status&&w)&&(0,s.jsxs)(l.Z,{onClick:()=>{w(K),_()},outline:!0,type:"button",children:[(0,s.jsx)(v.G,{className:"mr-2",icon:y.Xcf}),"Edit"]}),!!("draft"===K.status&&D)&&(0,s.jsxs)(l.Z,{onClick:()=>{D(K),_()},outline:!0,type:"button",variant:"danger",children:[(0,s.jsx)(v.G,{className:"mr-2",icon:y.$aW}),"Delete"]}),!!("draft"===K.status&&S)&&(0,s.jsxs)(l.Z,{onClick:()=>{S(K),_()},type:"button",children:[(0,s.jsx)(v.G,{className:"mr-2",icon:y.XCy}),"Submit for Approval"]}),!!("pending_approval"===K.status&&q)&&(0,s.jsxs)(l.Z,{onClick:()=>{q(K),_()},outline:!0,type:"button",variant:"danger",children:[(0,s.jsx)(v.G,{className:"mr-2",icon:y.NBC}),"Reject"]}),!!("pending_approval"===K.status&&k)&&(0,s.jsxs)(l.Z,{onClick:()=>{k(K),_()},type:"button",children:[(0,s.jsx)(v.G,{className:"mr-2",icon:y.LEp}),"Approve"]})]})]})]}):null};f.propTypes={adjustmentId:j().oneOfType([j().string,j().number]),show:j().bool.isRequired,onClose:j().func.isRequired,onEdit:j().func,onSubmit:j().func,onApprove:j().func,onReject:j().func,onDelete:j().func},f.defaultProps={adjustmentId:null,onEdit:void 0,onSubmit:void 0,onApprove:void 0,onReject:void 0,onDelete:void 0},a.Z=f},78690:function(e,a,t){var s=t(2784);a.Z=function(e,a){let[t,l]=(0,s.useState)(e);return(0,s.useEffect)(()=>{let t=setTimeout(()=>{l(e)},a);return()=>{clearTimeout(t)}},[e,a]),t}},28983:function(e,a,t){t.d(a,{Cj:function(){return m},El:function(){return b},On:function(){return N},TW:function(){return j},Ul:function(){return x},cv:function(){return h},iD:function(){return f},pb:function(){return g},rb:function(){return y},xI:function(){return v}});var s=t(59820),l=t(78298),n=t(14010),r=t(87686),i=t(60418),d=t(47477),c=t(82036),o=t(84475),u=t(53651);let p=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return"".concat(c.JW,"tenant/").concat((0,d.d_)(),"/").concat(e)},m=function(){let{page:e=1,limit:a=20,status:t,type:l,userId:n,periodId:r,enabled:c=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,s.a)({queryKey:["payroll-adjustments",{page:e,limit:a,status:t,type:l,userId:n,periodId:r}],placeholderData:(0,u.g)(r,e=>{var a;return null==e?void 0:null===(a=e[1])||void 0===a?void 0:a.periodId}),enabled:c&&(0,d.Xu)(),queryFn:async()=>{let s=new URLSearchParams;return s.append("page",e),s.append("limit",a),t&&s.append("status",t),l&&s.append("type",l),n&&s.append("user_id",n),r&&s.append("payroll_period_id",r),(await i.Z.get(p("payroll/adjustments?".concat(s.toString())),{headers:(0,o.g0)({realm:"hr"})})).data}})},y=e=>
1{let{adjustmentId:a,enabled:t=!0}=e;return(0,s.a)({queryKey:["payroll-adjustment",a],enabled:!!a&&t&&(0,d.Xu)(),queryFn:async()=>(await i.Z.get(p("payroll/adjustments/".concat(a)),{headers:(0,o.g0)({realm:"hr"})})).data})},v=function(){let{fromDate:e,toDate:a,enabled:t=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,s.a)({queryKey:["payroll-adjustment-statistics",{fromDate:e,toDate:a}],placeholderData:l.Wk,enabled:t&&(0,d.Xu)(),queryFn:async()=>{var t;let s=new URLSearchParams;return e&&s.append("from_date",e),a&&s.append("to_date",a),null===(t=(await i.Z.get(p("payroll/adjustments/statistics?".concat(s.toString())),{headers:(0,o.g0)({realm:"hr"})})).data)||void 0===t?void 0:t.data}})},x=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=(0,n.NL)();return(0,r.D)({mutationFn:async e=>(await i.Z.post(p("payroll/adjustments"),e,{headers:(0,o.g0)({realm:"hr"})})).data,onSuccess:(t,s)=>{a.invalidateQueries({queryKey:["payroll-adjustments"]}),a.invalidateQueries({queryKey:["payroll-adjustment-statistics"]}),e.onSuccess&&e.onSuccess(t,s)},...e})}
1,j=function(){let{adjustmentId:e,...a}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,n.NL)();return(0,r.D)({mutationFn:async a=>(await i.Z.put(p("payroll/adjustments/".concat(e)),a,{headers:(0,o.g0)({realm:"hr"})})).data,onSuccess:(s,l)=>{t.setQueryData(["payroll-adjustment",e],s.data),t.invalidateQueries({queryKey:["payroll-adjustments"]}),t.invalidateQueries({queryKey:["payroll-adjustment-statistics"]}),a.onSuccess&&a.onSuccess(s,l)},...a})},b=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=(0,n.NL)();return(0,r.D)({mutationFn:async e=>{let{adjustmentId:a}=e;return(await i.Z.delete(p("payroll/adjustments/".concat(a)),{headers:(0,o.g0)({realm:"hr"})})).data},onSuccess:(t,s)=>{a.removeQueries({queryKey:["payroll-adjustment",s.adjustmentId]}),a.invalidateQueries({queryKey:["payroll-adjustments"]}),a.invalidateQueries({queryKey:["payroll-adjustment-statistics"]}),e.onSuccess&&e.onSuccess(t,s)},...e})},g=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=(0,n.NL)();return(0,r.D)({mutationFn:async e=>{let{adjustmentId:a}=e;return(await i.Z.post(p("payroll/adjustments/".concat(a,"/submit")),{},{headers:(0,o.g0)({realm:"hr"})})).data},onSuccess:(t,s)=>{a.invalidateQueries({queryKey:["payroll-adjustment",s.adjustmentId]}),a.invalidateQueries({queryKey:["payroll-adjustments"]}),e.onSuccess&&e.onSuccess(t,s)},...e})},h=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=(0,n.NL)();return(0,r.D)({mutationFn:async e=>{let{adjustmentId:a}=e;return(await i.Z.post(p("payroll/adjustments/".concat(a,"/approve")),{},{headers:(0,o.g0)({realm:"hr"})})).data},onSuccess:(t,s)=>{a.invalidateQueries({queryKey:["payroll-adjustment",s.adjustmentId]}),a.invalidateQueries({queryKey:["payroll-adjustments"]}),a.invalidateQueries({queryKey:["payroll-adjustment-statistics"]}),e.onSuccess&&e.onSuccess(t,s)},...e})},f=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=(0,n.NL)();
1return(0,r.D)({mutationFn:async function(){let{adjustmentId:e,reason:a}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(await i.Z.post(p("payroll/adjustments/".concat(e,"/reject")),{reason:a},{headers:(0,o.g0)({realm:"hr"})})).data},onSuccess:(t,s)=>{a.invalidateQueries({queryKey:["payroll-adjustment",s.adjustmentId]}),a.invalidateQueries({queryKey:["payroll-adjustments"]}),e.onSuccess&&e.onSuccess(t,s)},...e})},N=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=(0,n.NL)();return(0,r.D)({mutationFn:async e=>{let{adjustmentIds:a,periodId:t}=e;return(await i.Z.post(p("payroll/adjustments/bulk-apply"),{adjustment_ids:a,payroll_period_id:t},{headers:(0,o.g0)({realm:"hr"})})).data},onSuccess:(t,s)=>{a.invalidateQueries({queryKey:["payroll-adjustments"]}),a.invalidateQueries({queryKey:["payslips"]}),a.invalidateQueries({queryKey:["payroll-periods"]}),e.onSuccess&&e.onSuccess(t,s)},...e})}},51634:function(e,a,t){var s=t(52322),l=t(13980),n=t.n(l);let r=(0,t(2784).memo)(function(e){let{children:a,padding:t=0,className:l=""}=e;return(0,s.jsx)("div",{className:"w-full ".concat(t?"p-".concat(t):""," ").concat(l).trim(),children:a})});r.displayName="TabPanel",r.propTypes={children:n().node,padding:n().oneOfType([n().number,n().string]),className:n().string},a.Z=r}}]);

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.