1import{d4 as X,ax as ee,i2 as te,dA as se,d5 as Oe,di as Be,r as n,kc as Pe,kd as De,j as e,b4 as ae,L as U,K as be,ao as xe,bT as _,as as g,a0 as oe,b as me,X as z,h as we,b7 as je,Y as Me,aI as k,aJ as Ve,dF as ue,hZ as Q,O as pe,z as Ie,ke as Le,kf as Re,dZ as Ce,J as Ee,al as ye,au as Se,v as ie,kg as de,e as $e,E as Ke,kh as He,A as Ge,c as We,b3 as qe,bN as ze,bO as Ue,bP as Ye,bf as Qe,b9 as ke}from"./index-CpeGhXo5.js";import{v as re,t as le}from"./financeMappers-CUv1G2pV.js";import{u as he}from"./useCurrencyHelpers-D5hUvgaW.js";import{F as Je}from"./FilterBar-B_jdgGzl.js";import{u as Ze}from"./useGlobalFilter-BkOUrZeG.js";import{C as _e}from"./EntityPill-btGCy98_.js";import{P as ve,N as Xe}from"./cash-book.new-Ogz_jc80.js";import{A as et}from"./arrow-down-left-CPlghnlt.js";import"./currency-CACMzR5Q.js";import"./filters-DQMtevU2.js";import"./mock-Ci00pIzy.js";import"./Panel-Cf_wAUzv.js";import"./file-check-DgOG7DHv.js";function tt(){const o=X();ee();const{fmtConv:v}=he(),{data:N,isLoading:u,refetch:f}=te({limit:500,sortBy:"createdAt",sortOrder:"desc"}),{data:m}=se({limit:2e3}),{data:y=[]}=Oe(),{data:i}=Be({limit:500,status:"Active"}),b=n.useMemo(()=>i?.items??[],[i]),[M]=Pe(),[w]=De(),[T,O]=n.useState(!1),[l,j]=n.useState(null),[h,S]=n.useState(""),[I,B]=n.useState("Growth"),[L,R]=n.useState(""),[E,A]=n.useState("40000"),[P,H]=n.useState("Weekly office running & supplies float"),[D,F]=n.useState(!1);n.useEffect(()=>{if(y.length>0&&!h){const s=y.find(d=>d.name.toLowerCase().includes("growth")||d.name.toLowerCase().includes("it"))||y[0];S(s.id),B(s.name)}},[y,h]);const $=n.useMemo(()=>{if(!h)return b;const s=b.filter(d=>d.departments?.some(c=>c.departmentId===h)||d.departmentId===h);return s.length>0?s:b},[b,h]),J=n.useMemo(()=>y.map(s=>({value:s.id,label:`${s.name}${s.code?` (${s.code})`:""}`,sub:s.code?`Dept Code: ${s.code}`:"HRMS Department"})),[y]),q=n.useMemo(()=>$.map(s=>{const d=`${s.firstName||""} ${s.lastName||""}`.trim(),c=s.designation||"Department Custodian",p=s.employeeId||s.empId||"";return{value:`${d} (${c})`,label:`${d} (${c})`,sub:p?`Employee ID: ${p}`:`${I} Team`}}),[$,I]),G=s=>{S(s);const d=y.find(c=>c.id===s);if(d){B(d.name);const c=b.find(p=>p.id===d.headEmployeeId);if(c)R(`${c.firstName} ${c.lastName} (${c.designation||"Head"})`);else{const p=$[0];p&&R(`${p.firstName} ${p.lastName} (${p.designation||"Member"})`)}}};n.useEffect(()=>{const s=d=>{d.key==="Escape"&&(O(!1),j(null))};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[]);const Y=n.useMemo(()=>(N?.items??[]).map(re),[N]),W=n.useMemo(()=>(m?.items??[]).map(le),[m]),C=n.useMemo(()=>{if(Y.length>0)return Y;const s=W.filter(c=>c.payment>0).reduce((c,p)=>c+(p.payment||0),0);return[{id:"seed-001",batchNo:"FLOAT-2026-001",department:"Operations",requestedBy:"Gurcharan Singh (COO)",requestedAmount:4e4,allocatedAmount:4e4,allocatedBy:"Pawandeep Kaur (CFO)",allocatedAt:"2026-08-01",purpose:"Weekly civil work, repairs, canteen & staff expenses",totalSpent:s||38450,remainingCash:Math.max(4e4-s,0)||1550,status:"Active",totalSlipsCount:W.filter(c=>c.payment>0).length||48,verifiedSlipsCount:42,waiverAmount:0}]},[Y,W]);n.useMemo(()=>C.find(s=>s.status==="Active")||C[0],[C]);const t=async()=>{const s=parseFloat(E)||0;if(s<=0){k.error("Please enter a valid float amount");return}F(!0);try{await M({department:I,requestedBy:L.trim(),requestedAmount:s,allocatedAmount:s,allocatedBy:"Pawandeep Kaur (CFO)",purpose:P.trim(),status:"Active"}).unwrap(),k.success(`Allocated â¹${s.toLocaleString("en-IN")} cash float to ${L}`),O(!1),f()}catch(d){k.error(d?.data?.message||"Failed to create float request")}finally{F(!1)}},r=async()=>{if(l){F(!0);try{await w(l.id).unwrap(),k.success(`Batch ${l.batchNo} submitted to CFO Pawandeep Kaur for audit!`),j(null),f()}catch(s){k.error(s?.data?.message||"Failed to submit batch for audit")}finally{F(!1)}}};return e.jsxs("div",{className:"flex flex-col flex-1 h-full min-h-0 overflow-hidden bg-slate-50/50 dark:bg-slate-950/50",children:[e.jsx(ae,{title:"Cash Requests & Custody Allocation",subtitle:"Departmental imprest cash float requests, CFO custody disbursements & audit submissions",accentVar:"--mod-finance",showMonthYearFilter:!1,actions:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(U,{to:`${o}/cash-book`,className:"h-8 px-3 rounded-md border border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-900 hover:bg-slate-50 dark:hover:bg-slate-800 text-xs font-semibold text-slate-700 dark:text-slate-200 inline-flex items-center gap-1.5 transition-colors shadow-2xs cursor-pointer",children:[e.jsx(be,{className:"w-3.5 h-3.5"})," Back to Ledger"]}),e.jsxs("button",{type:"button",onClick:()=>O(!0),className:"h-8 px-3.5 rounded-md bg-blue-600 hover:bg-blue-700 text-white text-xs font-bold shadow-2xs inline-flex items-center gap-1.5 transition-colors cursor-pointer",children:[e.jsx(xe,{className:"w-4 h-4"})," Allocate Cash Float"]})]})}),e.jsx("div",{className:"p-4 flex-1 min-h-0 flex flex-col overflow-hidden",children:e.jsx(_,{rows:C,rowKey:s=>s.id||s.batchNo,searchKeys:["batchNo","department","requestedBy","purpose"],searchPlaceholder:"Search float batchesâ¦",initialSortKey:"allocatedAt",storageKey:"finance-cash-float-batches",initialPageSize:25,fetching:u,fillHeight:!0,columns:[{key:"batchNo",label:"Batch No",sortable:!0,width:"130px",render:s=>e.jsxs("div",{className:"flex items-center gap-1.5 font-data",children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-blue-600 shrink-0"}),e.jsx("span",{className:"font-bold text-slate-900 dark:text-slate-100 text-xs",children:s.batchNo})]})},{key:"department",label:"Department & Custodian",sortable:!0,render:s=>e.jsxs("div",{className:"flex flex-col text-xs",children:[e.jsx("span",{className:"font-semibold text-slate-800 dark:text-slate-200",children:s.requestedBy}),e.jsxs("span",{className:"text-[10px] text-slate-400 font-medium",children:[s.department," ⢠Purpose: ",s.purpose]})]})},{key:"allocatedAmount",label:"Allocated (â¹)",align:"right",width:"130px",sortable:!0,render:s=>e.jsxs("span",{className:"font-data font-bold text-xs text-slate-900 dark:text-slate-100",children:["â¹ ",s.allocatedAmount.toLocaleStr
1ing("en-IN")]})},{key:"totalSpent",label:"Burned (â¹)",align:"right",width:"120px",sortable:!0,render:s=>e.jsxs("span",{className:"font-data font-bold text-xs text-rose-600",children:["â¹ ",s.totalSpent.toLocaleString("en-IN")]})},{key:"remainingCash",label:"In Hand (â¹)",align:"right",width:"120px",sortable:!0,render:s=>e.jsxs("span",{className:"font-data font-bold text-xs text-emerald-600",children:["â¹ ",s.remainingCash.toLocaleString("en-IN")]})},{key:"burnRate",label:"Burn %",width:"100px",align:"center",render:s=>{const d=Math.min(Math.round(s.totalSpent/(s.allocatedAmount||1)*100),100);return e.jsxs("div",{className:"flex items-center gap-1.5 justify-center",children:[e.jsx("div",{className:"w-12 h-2 bg-slate-100 dark:bg-slate-800 rounded-full overflow-hidden",children:e.jsx("div",{className:g("h-full",d>90?"bg-rose-500":d>60?"bg-amber-500":"bg-blue-600"),style:{width:`${d}%`}})}),e.jsxs("span",{className:"text-[10px] font-bold text-slate-600 dark:text-slate-400",children:[d,"%"]})]})}},{key:"status",label:"Status",width:"150px",align:"center",render:s=>e.jsx("span",{className:g("px-2 py-0.5 rounded text-[10px] font-bold border",s.status==="Signed Off & Settled"?"bg-purple-50 text-purple-700 border-purple-200 dark:bg-purple-950/40 dark:text-purple-300":s.status==="Submitted for Audit"?"bg-amber-50 text-amber-700 border-amber-200 dark:bg-amber-950/40 dark:text-amber-300":"bg-emerald-50 text-emerald-700 border-emerald-200 dark:bg-emerald-950/40 dark:text-emerald-300"),children:s.status})},{key:"actions",label:"Actions",width:"180px",align:"center",render:s=>e.jsxs("div",{className:"flex items-center gap-1 justify-center",children:[s.status==="Active"&&e.jsxs("button",{type:"button",onClick:()=>j(s),className:"px-2.5 py-1 rounded bg-amber-50 hover:bg-amber-100 text-amber-800 border border-amber-200 text-[11px] font-bold transition-colors cursor-pointer inline-flex items-center gap-1 shadow-2xs",title:"Submit this cash float batch to CFO for audit",children:[e.jsx(oe,{className:"w-3 h-3 text-amber-600"})," Submit for Audit"]}),s.status==="Submitted for Audit"&&e.jsxs(U,{to:`${o}/cash-book/audit`,className:"px-2.5 py-1 rounded bg-blue-50 hover:bg-blue-100 text-blue-700 border border-blue-200 text-[11px] font-bold transition-colors inline-flex items-center gap-1 shadow-2xs",children:[e.jsx(me,{className:"w-3 h-3 text-blue-600"})," Open CFO Audit â"]}),s.status==="Signed Off & Settled"&&e.jsx("span",{className:"text-[11px] font-semibold text-emerald-700 bg-emerald-50 border border-emerald-200 px-2 py-0.5 rounded",children:"Audited & Settled â"})]})}]})}),l&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4 animate-in fade-in duration-150",children:e.jsxs("div",{className:"w-full max-w-lg bg-white dark:bg-slate-900 rounded-xl border border-slate-200 dark:border-slate-800 p-6 shadow-2xl space-y-4",children:[e.jsxs("div",{className:"flex items-start justify-between border-b border-slate-100 dark:border-slate-800 pb-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-amber-100 dark:bg-amber-950/60 flex items-center justify-center text-amber-700 dark:text-amber-300 shrink-0",children:e.jsx(oe,{className:"w-5 h-5"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-bold text-slate-900 dark:text-slate-100",children:"Submit Float Batch for CFO Audit"}),e.jsxs("p",{className:"text-xs text-slate-500",children:["Batch #",l.batchNo," ⢠",l.department]})]})]}),e.jsx("button",{type:"button",onClick:()=>j(null),className:"text-slate-400 hover:text-slate-600 cursor-pointer p-1",children:e.jsx(z,{className:"w-4 h-4"})})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-2.5 p-3 rounded-lg bg-slate-50 dark:bg-slate-950 border border-slate-200 dark:border-slate-800 text-xs",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-slate-400 uppercase font-bold block",children:"Allocated Float"}),e.jsxs("span",{className:"font-bold text-slate-900 dark:text-slate-100 font-data",children:["â¹",l.allocatedAmount.toLocaleStr
1ing("en-IN")]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-rose-500 uppercase font-bold block",children:"Spent (Burned)"}),e.jsxs("span",{className:"font-bold text-rose-600 font-data",children:["â¹",l.totalSpent.toLocaleString("en-IN")]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-emerald-500 uppercase font-bold block",children:"Cash in Hand"}),e.jsxs("span",{className:"font-bold text-emerald-600 font-data",children:["â¹",l.remainingCash.toLocaleString("en-IN")]})]})]}),e.jsxs("div",{className:"space-y-2 text-xs text-slate-600 dark:text-slate-400 leading-relaxed bg-amber-50/50 dark:bg-amber-950/20 p-3 rounded-lg border border-amber-200/60 dark:border-amber-900/40",children:[e.jsxs("p",{children:[e.jsx("strong",{children:"Department Custodian:"})," ",l.requestedBy]}),e.jsxs("p",{children:["This batch will be queued directly to ",e.jsx("strong",{children:"CFO Pawandeep Kaur"}),"'s 1-by-1 Audit Desk. The CFO will audit all paper slips and vouchers against physical ledger balance before sanctioning the next cash replenishment."]})]}),e.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2 border-t border-slate-100 dark:border-slate-800",children:[e.jsx("button",{type:"button",onClick:()=>j(null),className:"h-8 px-3.5 rounded border border-slate-200 dark:border-slate-800 text-xs font-semibold text-slate-600 hover:bg-slate-50 cursor-pointer",children:"Cancel"}),e.jsxs("button",{type:"button",disabled:D,onClick:r,className:"h-8 px-4 rounded bg-amber-600 hover:bg-amber-700 text-white text-xs font-bold shadow-2xs inline-flex items-center gap-1.5 cursor-pointer transition-colors",children:[e.jsx(oe,{className:"w-3.5 h-3.5"}),D?"Submittingâ¦":"Confirm & Submit for Audit"]})]})]})}),T&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4 animate-in fade-in duration-150 overflow-y-auto",children:e.jsxs("div",{className:"w-full max-w-lg bg-white dark:bg-slate-900 rounded-xl border border-slate-200 dark:border-slate-800 p-6 shadow-2xl space-y-5 my-8",children:[e.jsxs("div",{className:"flex items-start justify-between border-b border-slate-100 dark:border-slate-800 pb-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-blue-100 dark:bg-blue-950/60 flex items-center justify-center text-blue-600 dark:text-blue-400 shrink-0",children:e.jsx(we,{className:"w-5 h-5"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-bold text-slate-900 dark:text-slate-100",children:"Cash Float & Custody Allocation"}),e.jsx("p",{className:"text-xs text-slate-500",children:"Disburse departmental imprest cash with CFO authorization & custody tracking"})]})]}),e.jsx("button",{type:"button",onClick:()=>O(!1),className:"text-slate-400 hover:text-slate-600 cursor-pointer p-1",children:e.jsx(z,{className:"w-4 h-4"})})]}),e.jsxs("div",{className:"p-2.5 rounded-lg bg-blue-50/80 dark:bg-blue-950/40 border border-blue-200 dark:border-blue-900 flex items-center justify-between text-xs",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-blue-600 shrink-0"}),e.jsx("span",{className:"font-bold text-blue-900 dark:text-blue-300",children:"Cash Flow & Custody Allocation"})]}),e.jsx("span",{className:"text-[10px] text-blue-700 dark:text-blue-400 font-medium",children:"CFO Disburser â Department HRMS â Recipient Custodian"})]}),e.jsxs("div",{className:"space-y-4 text-xs",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"font-bold text-slate-700 dark:text-slate-300 block mb-1",children:["Department ",e.jsx("span",{className:"text-slate-400 font-normal",children:"(from HRMS)"})]}),e.jsx(je,{options:J,value:h,onChange:s=>G(String(s)),placeholder:"Search and select department...",searchPlaceholder:"Filter departments...",enableEditDeleteAdd:!1,fullWidth:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"font-bold text-slate-700 dark:text-slate-300 block mb-1",children:"Requested By / Department Custodian"}),e.jsx(je,{options:q,value:L,onChange:s=>R(String(s)),placeholder:"Search custodian or department employee...",searchPlaceholder:"Filter employees by name or designation...",enableEditDeleteAdd:!1,fullWidth:!0})]}),e.jsxs("div",{className:"flex items-center justify-between px-3 py-2 bg-slate-50 dark:bg-slate-900/60 border border-slate-200 dark:border-slate-800 rounded-md text-[11px]",children:[e.jsxs("span",{className:"text-slate-500 font-medium flex items-center gap-1.5",children:[e.jsx(Me,{className:"w-3.5 h-3.5 text-slate-400"}),"Allocation Date & Time:"]}),e.jsxs("span",{className:"font-semibold text-slate-800 dark:text-slate-200 font-data",children:[new Date().toLocaleDateString("en-IN",{day:"2-digit",month:"short",year:"numeric"})," ⢠",new Date().toLocaleTimeString("en-IN",{hour:"2-digit",minute:"2-digit"})," (Auto-recorded)"]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"font-bold text-slate-700 dark:text-slate-300 block mb-1",children:"Disbursed & Sanctioned By"}),e.jsxs("div",{className:"h-9 rounded-md border border-slate-200 dark:border-slate-800 px-3 bg-slate-50 dark:bg-slate-950 flex items-center justify-between text-xs",children:[e.jsx("span",{className:"font-bold text-slate-800 dark:text-slate-200",children:"Pawandeep Kaur (CFO)"}),e.jsx("span",{className:"text-[10px] uppercase font-bold text-blue-600 dar
1k:text-blue-400 bg-blue-50 dark:bg-blue-950/40 px-2 py-0.5 rounded border border-blue-200 dark:border-blue-800",children:"Central Imprest Authority"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"font-bold text-slate-700 dark:text-slate-300 block mb-1",children:"Float Amount (â¹ INR)"}),e.jsxs("div",{className:"relative",children:[e.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-xs font-bold text-slate-400",children:"â¹"}),e.jsx("input",{type:"number",value:E,onChange:s=>A(s.target.value),className:"w-full h-9 pl-7 pr-3 rounded-md border border-slate-200 dark:border-slate-700 bg-white dark:bg-slate-900 font-data font-bold text-sm text-slate-900 dark:text-slate-100 focus:outline-none focus:ring-2 focus:ring-blue-500/20"})]}),e.jsx("div",{className:"flex items-center gap-1.5 pt-1.5 flex-wrap",children:[2e4,3e4,4e4,5e4,1e5].map(s=>e.jsxs("button",{type:"button",onClick:()=>A(String(s)),className:g("px-2.5 py-1 rounded text-xs font-bold border transition-colors cursor-pointer",E===String(s)?"bg-blue-600 text-white border-blue-600 shadow-2xs":"bg-blue-50/70 hover:bg-blue-100 text-blue-700 border-blue-200 dark:bg-blue-950/30 dark:text-blue-300"),children:["â¹",s.toLocaleString("en-IN")]},s))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"font-bold text-slate-700 dark:text-slate-300 block mb-1",children:"Purpose / Imprest Note"}),e.jsx("textarea",{rows:2,value:P,onChange:s=>H(s.target.value),placeholder:"e.g. Weekly civil construction, urgent vendor payments, canteen & office running float",className:"w-full rounded-md border border-slate-200 dark:border-slate-700 p-2.5 bg-white dark:bg-slate-900 text-xs text-slate-900 dark:text-slate-100 resize-none focus:outline-none focus:ring-2 focus:ring-blue-500/20"})]})]}),e.jsxs("div",{className:"flex items-center justify-end gap-2 pt-3 border-t border-slate-100 dark:border-slate-800",children:[e.jsx("button",{type:"button",onClick:()=>O(!1),className:"h-8 px-3.5 rounded border border-slate-200 dark:border-slate-800 text-xs font-semibold text-slate-600 hover:bg-slate-50 cursor-pointer",children:"Cancel"}),e.jsxs("button",{type:"button",disabled:D,onClick:t,className:"h-8 px-4 rounded bg-blue-600 hover:bg-blue-700 text-white text-xs font-bold shadow-2xs inline-flex items-center gap-1.5 cursor-pointer",children:[e.jsx(xe,{className:"w-3.5 h-3.5"}),D?"Allocatingâ¦":"Confirm Float Allocation"]})]})]})})]})}function st(o){if(isNaN(o)||o===0)return"Zero Rupees Only";const v=["","One ","Two ","Three ","Four ","Five ","Six ","Seven ","Eight ","Nine ","Ten ","Eleven ","Twelve ","Thirteen ","Fourteen ","Fifteen ","Sixteen ","Seventeen ","Eighteen ","Nineteen "],N=["","","Twenty","Thirty","Forty","Fifty","Sixty","Seventy","Eighty","Ninety"];function u(i){if(i===0)return"";let b="";return Math.floor(i/1e7)>0&&(b+=u(Math.floor(i/1e7))+"Crore ",i%=1e7),Math.floor(i/1e5)>0&&(b+=u(Math.floor(i/1e5))+"Lakh ",i%=1e5),Math.floor(i/1e3)>0&&(b+=u(Math.floor(i/1e3))+"Thousand ",i%=1e3),Math.floor(i/100)>0&&(b+=u(Math.floor(i/100))+"Hundred ",i%=100),i>0&&(b!==""&&(b+="and "),i<20?b+=v[i]:(b+=N[Math.floor(i/10)]+" ",i%10>0&&(b+=v[i%10]))),b}const f=Math.floor(Math.abs(o)),m=Math.round((Math.abs(o)-f)*100);let y=u(f).trim()+" Rupees";return m>0&&(y+=" and "+u(m).trim()+" Paise"),y+" Only"}const ce=[{id:"sample-civil-01",voucherNo:"VCH-2026-0814",date:"2026-08-04",category:"Construction & Civil Work",subCategory:"Waterproofing & PVC Sheet",description:"Purchased heavy-duty waterproofing PVC tarpaulin rolls and sealing solution for 3rd floor terrace cabin repair",amount:3850,paidTo:"Mohan Lal (Hardware Store)",givenBy:"Gurcharan Singh Kang (COO)",batchNo:"FLOAT-2026-001",status:"Verified",voucherType:"Debit Voucher / Cash Out"},{id:"sample-labour-02",voucherNo:"VCH-2026-0815",date:"2026-08-05",category:"Staff & Daily Wages",subCategory:"Office Cleaning Staff Cash Wages",description:"Monthly cash compensation for weekend office deep-cleaning staff and waste disposal team",amount:6500,paidTo:"Sunita & Raju (Cleaning Crew)",givenBy:"Pawandeep Kaur (CFO)",batchNo:"FLOAT-2026-001",status:"Verified",voucherType:"Debit Voucher / Cash Out"}
1,{id:"sample-canteen-03",voucherNo:"VCH-2026-0816",date:"2026-08-07",category:"Office Running & Admin",subCategory:"Canteen Material & Tea",description:"Weekly pantry purchase: Taj Mahal tea leaf bags, dairy milk cartons, refined sugar, and guest cookies",amount:2150,paidTo:"Verma General Store",givenBy:"Gurcharan Singh Kang (COO)",batchNo:"FLOAT-2026-001",status:"Verified",voucherType:"Debit Voucher / Cash Out"},{id:"sample-fuel-04",voucherNo:"VCH-2026-0817",date:"2026-08-09",category:"Travel & Conveyance",subCategory:"Activa / Two-Wheeler Petrol",description:"Local field conveyance petrol reimbursement for bank document submission and urgent cheque deposit",amount:650,paidTo:"Surinder Pal (Office Boy)",givenBy:"Gurcharan Singh Kang (COO)",batchNo:"FLOAT-2026-001",status:"Verified",voucherType:"Debit Voucher / Cash Out"}];function fe(o){if(!o)return fe(new Date().toISOString().split("T")[0]);try{const v=new Date(o);if(isNaN(v.getTime()))return o;const N=String(v.getDate()).padStart(2,"0"),f=["January","February","March","April","May","June","July","August","September","October","November","December"][v.getMonth()],m=v.getFullYear();return`${N} ${f}, ${m}`}catch{return o}}function at(){const o=X();ee();const[v]=Ve(),N=v.get("id"),{data:u}=se({limit:500}),{data:f}=te({limit:100}),m=n.useMemo(()=>(u?.items??[]).map(le),[u]),y=n.useMemo(()=>
1(f?.items??[]).map(re),[f]),[i,b]=n.useState(N||"sample-civil-01"),[M,w]=n.useState(""),T=n.useMemo(()=>{const l=m.find(h=>h.id===i);if(l){const h=(l.receipt||0)>0||l.type==="receipt"||l.type&&l.type.includes("In");return{id:l.id,voucherNo:l.invoiceNo||`VCH-2026-${l.id.slice(-4).toUpperCase()}`,date:l.date,category:l.category||(h?"Cash Receipt Inflow":"General Office Expense"),subCategory:l.subCategory||(h?"Bank Withdrawal / Cash Deposit":"General Petty Cash"),description:ue(l.description||"Petty cash transaction"),amount:Number(l.receipt||l.payment||0),paidTo:h?l.party||"Central Cash Vault (Inflow)":l.assignTo||l.party||"Authorized Vendor / Recipient",givenBy:h?l.givenBy||"Bank / Depositor":l.givenBy||"Pawandeep Kaur (CFO)",batchNo:l.floatBatchId||(y[0]?.batchNo??"FLOAT-2026-001"),status:l.verificationStatus||"Pending Audit",isReceipt:h,voucherType:h?"Cash Receipt Voucher (Credit Voucher)":"Cash Payment Voucher (Debit Voucher)",receiptUrl:l.receiptUrl}}const j=ce.find(h=>h.id===i);return j||ce[0]},[i,m,y]),O=()=>{window.print()};return e.jsxs("div",{className:"flex flex-col flex-1 h-full min-h-0 bg-slate-50/50 dark:bg-slate-950/50 overflow-y-auto",children:[e.jsx("div",{className:"print:hidden",children:e.jsx(ae,{title:"Cash Vouchers",subtitle:"Official petty cash payment vouchers, debit receipts & audit sign-off sheets",accentVar:"--mod-finance",showMonthYearFilter:!1,actions:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(U,{to:`${o}/cash-book`,className:"h-8 px-3 rounded-md border border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-900 hover:bg-slate-50 dark:hover:bg-slate-800 text-xs font-semibold text-slate-700 dark:text-slate-200 inline-flex items-center gap-1.5 transition-colors shadow-2xs cursor-pointer",children:[e.jsx(be,{className:"w-3.5 h-3.5"})," Back to Ledger"]}),e.jsx("div",{className:"h-4 w-px bg-slate-200 dark:bg-slate-800"}),e.jsxs("div",{className:"h-8 px-2.5 rounded-md bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 flex items-center gap-1.5 shadow-2xs",children:[e.jsxs("span",{className:"text-xs font-bold text-slate-800 dark:text-slate-200",children:["Voucher #",T.voucherNo]}),e.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-bold bg-emerald-100 text-emerald-700 dark:bg-emerald-950/50 dark:text-emerald-400",children:T.status})]}),e.jsxs("button",{type:"button",onClick:O,className:"h-8 px-3.5 rounded-md bg-blue-600 hover:bg-blue-700 text-white text-xs font-bold shadow-2xs inline-flex items-center gap-1.5 cursor-pointer transition-colors",children:[e.jsx(Q,{className:"w-3.5 h-3.5"})," Print Official Voucher"]})]})})}),e.jsxs("div",{className:"flex-1 p-4 md:p-6 grid grid-cols-1 lg:grid-cols-12 gap-6 max-w-7xl mx-auto w-full",children:[e.jsx("div",{className:"print:hidden lg:col-span-4 space-y-4",children:e.jsxs("div",{className:"rounded-xl border border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-900 p-3.5 shadow-sm space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-slate-100 dark:border-slate-800 pb-2",children:[e.jsxs("span",{className:"text-xs font-bold text-slate-900 dark:text-slate-100 flex items-center gap-1.5",children:[e.jsx(pe,{className:"w-4 h-4 text-blue-600"}),"Select Cash Entry / Voucher"]}),e.jsxs("span",{className:"text-[10px] font-bold text-slate-400",children:[m.length," Total"]})]}),e.jsxs("div",{className:"relative",children:[e.jsx(Ie,{className:"w-3.5 h-3.5 absolute left-2.5 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx("input",{type:"text",placeholder:"Search description, payee, amountâ¦",value:M,onChange:l=>w(l.target.value),className:"w-full pl-8 pr-3 py-1.5 text-xs rounded-md border border-slate-200 dark:border-slate-700 bg-slate-50 dark:bg-slate-950 focus:outline-none focus:ring-1 focus:ring-blue-500"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"text-[10px] font-bold uppercase tracking-wider text-slate-400 px-1",children:"Standard Corporate Samples"}),ce.map(l=>e.jsxs("button",{type:"button",onClick:()=>b(l.id),className:g("w-full text-left p-2 rounded-lg border text-xs transition-all cursor-pointer flex flex-col gap-0.5",i===l.id?"bg-blue-50/90 dark:bg-blue-950/40 border-blue-300 dark:border-blue-800 text-blue-900 dark:text-blue-200 shadow-2xs font-semibold":"border-transparent hover:bg-slate-100/70 dark:hover:bg-slate-800/60 text-slate-700 dark:text-slate-300"),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"font-bold truncate",children:l.voucherNo}),e.jsxs("span",{className:"text-emerald-600 font-bold",children:["â¹",l.amount.toLocaleStr
1ing("en-IN")]})]}),e.jsxs("span",{className:"text-[11px] text-slate-500 truncate",children:[l.subCategory," ⢠",l.paidTo]})]},l.id))]}),m.length>0&&e.jsxs("div",{className:"space-y-1 pt-2 border-t border-slate-100 dark:border-slate-800",children:[e.jsxs("div",{className:"text-[10px] font-bold uppercase tracking-wider text-slate-400 px-1",children:["Live Cash Book Records (",m.length,")"]}),e.jsx("div",{className:"max-h-60 overflow-y-auto space-y-1 pr-1",children:m.filter(l=>{if(!M)return!0;const j=M.toLowerCase();return(l.description||"").toLowerCase().includes(j)||(l.assignTo||"").toLowerCase().includes(j)||(l.category||"").toLowerCase().includes(j)||String(l.payment||l.receipt).includes(j)}).slice(0,30).map(l=>e.jsxs("button",{type:"button",onClick:()=>b(l.id),className:g("w-full text-left p-2 rounded-lg border text-xs transition-all cursor-pointer flex flex-col gap-0.5",i===l.id?"bg-blue-50/90 dark:bg-blue-950/40 border-blue-300 dark:border-blue-800 text-blue-900 dark:text-blue-200 shadow-2xs font-semibold":"border-transparent hover:bg-slate-100/70 dark:hover:bg-slate-800/60 text-slate-700 dark:text-slate-300"),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"font-bold truncate",children:l.invoiceNo||`VCH-${l.id.slice(-4)}`}),e.jsxs("span",{className:g("font-bold",l.payment>0?"text-rose-600":"text-emerald-600"),children:["â¹",Number(l.payment||l.receipt||0).toLocaleString("en-IN")]})]}),e.jsxs("span",{className:"text-[11px] text-slate-500 truncate",children:[fe(l.date)," ⢠",l.receipt>0?`Cash Inflow (${l.category||"Receipt"})`:l.assignTo||l.party||l.category]})]},l.id))})]})]})}),e.jsx("div",{className:"lg:col-span-8 flex justify-center",children:e.jsx("div",{className:"w-full max-w-[780px]",children:e.jsx(ge,{voucher:T,onPrint:O})})})]})]})}function ge({voucher:o,onPrint:v,companyName:N="Tekki Web Solutions Pvt. Ltd."}){const u=n.useMemo(()=>st(Number(o.amount||0)),[o.amount]),f=n.useMemo(()=>fe(o.date),[o.date]),m=o.isReceipt||o.voucherType&&o.voucherType.includes("Receipt");return e.jsxs("div",{id:"printable-cash-voucher",className:"bg-white text-slate-900 rounded-xl border-2 border-slate-900 p-6 md:p-8 shadow-xl print:shadow-none print:border-2 print:border-black print:p-6 print:m-0 print:w-full print:max-w-none print:static relative",children:[e.jsx("style",{children:` 2 @media print { 3 @page { 4 size: A4 portrait; 5 margin: 10mm; 6 } 7 body { 8 background: #ffffff !important; 9 color: #000000 !important; 10 } 11 /* Hide everything in body */ 12 body * { 13 visibility: hidden !important; 14 } 15 /* Make only the voucher card and its children visible */ 16 #printable-cash-voucher, 17 #printable-cash-voucher * { 18 visibility: visible !important; 19 } 20 /* Position voucher at top of page, taking full width cleanly */ 21 #printable-cash-voucher { 22 position: absolute !important; 23 left: 0 !important; 24 top: 0 !important; 25 width: 100% !important; 26 max-width: 100% !important; 27 margin: 0 !important; 28 padding: 16px !important; 29 border: 2px solid #000000 !important; 30 box-shadow: none !important; 31 background: #ffffff !important; 32 } 33 /* Ensure modal backdrop and buttons are completely unrendered */ 34 .print\\:hidden, 35 dialog, 36 [role="dialog"], 37 .fixed.inset-0 { 38 background: transparent !important; 39 } 40 } 41 `}),e.jsxs("div",{className:"border-b-2 border-slate-900 pb-4 flex items-start justify-between",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-11 h-11 rounded-lg bg-blue-600 text-white flex items-center justify-center font-black text-lg tracking-tighter shadow-2xs shrink-0 print:border print:border-black print:text-black print:bg-white",children:e.jsx("span",{className:"text-white print:text-black",children:"VO"})}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-base font-black tracking-tight uppercase text-slate-900",children:N}),e.jsx("span",{className:"text-[10px] font-bold px-1.5 py-0.5 rounded bg-blue-50 text-blue-700 border border-blue-200 print:hidden uppercase",children:"VizOps ERP Verified"})]}),e.jsx("p",{className:"text-[11px] text-slate-600 print:text-black font-medium",children:"Corporate Headquarters ⢠Petty Cash Imprest Account ⢠Central Finance Division"})]})]}),e.jsxs("div",{className:"text-right space-y-0.5",children:[e.jsx("span",{className:"inline-block px-2.5 py-0.5 rounded border border-slate-900 bg-slate-900 text-white print:border-black print:bg-black font-extrabold text-[11px] tracking-wider up
41percase",children:m?"CASH RECEIPT VOUCHER":"PETTY CASH PAYMENT VOUCHER"}),e.jsx("p",{className:"text-[11px] font-bold text-slate-700 print:text-black",children:"Official Accounting Audit Document"})]})]}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3 py-3.5 border-b border-slate-300 text-xs",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] uppercase font-bold text-slate-400 print:text-slate-600 block",children:"Voucher No."}),e.jsx("span",{className:"font-extrabold text-slate-900 text-sm font-mono",children:o.voucherNo})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] uppercase font-bold text-slate-400 print:text-slate-600 block",children:"Date"}),e.jsx("span",{className:"font-bold text-slate-800 print:text-black",children:f})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] uppercase font-bold text-slate-400 print:text-slate-600 block",children:"Imprest Float Ref."}),e.jsx("span",{className:"font-bold text-slate-800 print:text-black font-mono",children:o.batchNo||"FLOAT-2026-001"})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] uppercase font-bold text-slate-400 print:text-slate-600 block",children:"Payment Mode"}),e.jsx("span",{className:"font-extrabold text-emerald-700 print:text-black",children:"HARD CASH (PETTY FLOAT)"})]})]}),e.jsx("div",{className:"my-6 border-2 border-slate-900 rounded-lg overflow-hidden",children:e.jsxs("table",{className:"w-full text-xs border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-slate-100 print:bg-slate-100 border-b-2 border-slate-900 font-extrabold text-slate-900",children:[e.jsx("th",{className:"py-3.5 px-5 text-left w-14 border-r-2 border-slate-900 uppercase tracking-wider text-[11px]",children:"S.No."}),e.jsx("th",{className:"py-3.5 px-5 text-left border-r-2 border-slate-900 uppercase tracking-wider text-[11px]",children:"Account Head & Description of Work / Material"}),e.jsx("th",{className:"py-3.5 px-5 text-right w-44 uppercase tracking-wider text-[11px]",children:"Amount (INR)"})]})}),e.jsxs("tbody",{children:[e.jsxs("tr",{className:"border-b-2 border-slate-900 min-h-[140px]",children:[e.jsx("td",{className:"py-6 px-5 align-top font-bold text-center border-r-2 border-slate-900 text-sm",children:"01"}),e.jsxs("td",{className:"py-6 px-5 align-top space-y-3 border-r-2 border-slate-900",children:[e.jsxs("div",{children:[e.jsxs("span",{className:"text-xs uppercase tracking-wider font-black text-blue-900 print:text-black block mb-1",children:[o.category," ⢠",o.subCategory]}),e.jsx("p",{className:"text-sm font-semibold text-slate-900 leading-relaxed",children:ue(o.description)})]}),e.jsx("div",{className:"pt-3.5 flex items-center gap-4 text-xs text-slate-700 print:text-black border-t border-slate-200",children:m?e.jsxs(e.Fragment,{children:[e.jsxs("span",{children:[e.jsx("strong",{children:"Received From (Depositor):"})," ",o.givenBy||"Bank Deposit / Cash Inflow"]}),e.jsx("span",{children:"â¢"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Deposited Into:"})," ",o.paidTo||"Central Cash Vault"]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("span",{children:[e.jsx("strong",{children:"Disbursed By (Given By):"})," ",o.givenBy||"Pawandeep Kaur (CFO)"]}),e.jsx("span",{children:"â¢"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Paid To / Spent By:"})," ",o.paidTo||"Authorized Vendor / Recipient"]})]})})]}),e.jsxs("td",{className:"py-6 px-5 align-top text-right font-black text-base font-mono",children:["â¹",Number(o.amount||0).toLocaleString("en-IN",{minimumFractionDigits:2})]})]}),e.jsxs("tr",{className:"bg-slate-50 print:bg-slate-50 font-bold border-t-2 border-slate-900",children:[e.jsx("td",{colSpan:2,className:"py-4 px-5 text-right font-black uppercase text-slate-900 border-r-2 border-slate-900 text-xs tracking-wider",children:m?"Total Cash Received:":"Total Cash Disbursed:"}),e.jsxs("td",{className:"py-4 px-5 text-right font-black text-lg text-slate-900 font-mono",children:["â¹",Number(o.amount||0).toLocaleString("en-IN",{minimumFractionDigits:2})]})]})]})]})}),e.jsxs("div",{className:"p-3.5 bg-slate-50 border border-slate-300 rounded-lg mb-6 flex flex-col md:flex-row items-start md:items-center justify-between gap-3 text-xs",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] uppercase font-bold text-slate-500 block",children:"Amount in Words:"}),e.jsx("span",{className:"font-extrabold text-slate-900 italic text-sm",children:u})]}),e.jsxs("div",{className:"shrink-0 flex items-center gap-2 border-l border-slate-300 pl-3",children:[e.jsx(me,{className:"w-5 h-5 text-emerald-600 print:text-black"}),e.jsxs("div",{children:[e.jsx("span",{className:"font-bold text-emerald-800 print:text-black block text-[11px]",children:"CFO AUDITED & CERTIFIED"}),e.jsx("span",{className:"text-[10px] text-slate-500",children:"Checked with attached slips & bills"})]})]})]}),e.jsxs("div",{className:"pt-6 border-t-2 border-slate-800",children:[e.jsx("div",{className:"text-[10px] font-bold uppercase tracking-wider text-slate-400 mb-4 text-center",children:"Authorizations & Mandatory Audit Sign-Off"}),e.jsxs("div",{className:"grid grid-cols-3 gap-6 text-center text-xs",children:[e.jsxs("div",{className:"flex flex-col justify-between border-t-2 border-dashed border-slate-400 pt-3 min-h-[110px]",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx("div",{className:"h-9 flex items-center justify-center",children:e.jsx("span",{className:"text-[11px] text-slate-400 italic",children:"Signature on file"})}),e.jsx("span",{className:"font-extrabold text-slate-900 block text-xs",children:m?o.givenBy||"Bank Deposit / Cash Inflow":o.paidTo||"Authorized Vendor / Recipient"}),e.jsx("span",{className:"text-[10px] text-slate-500 font-medium block",children:m?"Cash Depositor / S
41ource":"Cash Recipient / Vendor"})]}),e.jsxs("div",{className:"space-y-0.5 mt-2",children:[e.jsx("span",{className:"text-[10px] text-slate-500 uppercase font-bold block",children:m?"Signature of Depositor":"Signature of Receiver"}),e.jsxs("span",{className:"text-[10px] text-slate-700 print:text-black font-semibold block",children:["Date: ",f]})]})]}),e.jsxs("div",{className:"flex flex-col justify-between border-t-2 border-dashed border-slate-400 pt-3 min-h-[110px]",children:[e.jsxs("div",{className:"space-y-1.5 flex flex-col items-center",children:[e.jsx("div",{className:"h-9 flex items-end justify-center pb-1",children:e.jsx("span",{className:"font-serif italic font-bold text-slate-800 print:text-black text-sm tracking-wider -rotate-2 select-none inline-block",children:o.handledBy||"Vault Custodian"})}),e.jsx("div",{className:"pt-1 border-t border-slate-200 w-full text-center",children:e.jsx("span",{className:"font-extrabold text-slate-900 block text-xs",children:o.handledBy||"Vault Custodian"})})]}),e.jsxs("div",{className:"space-y-0.5 mt-2",children:[e.jsx("span",{className:"text-[10px] text-slate-600 print:text-black uppercase font-bold block",children:"Verified By (Vault Custodian)"}),e.jsxs("span",{className:"text-[10px] text-slate-700 print:text-black font-semibold block",children:["Date: ",f]})]})]}),e.jsxs("div",{className:"flex flex-col justify-between border-t-2 border-dashed border-slate-400 pt-3 min-h-[110px]",children:[e.jsxs("div",{className:"space-y-1.5 flex flex-col items-center",children:[e.jsx("div",{className:"h-9 flex items-end justify-center pb-1",children:e.jsx("span",{className:"font-serif italic font-bold text-blue-900 print:text-black text-xl tracking-wider -rotate-2 select-none inline-block",children:"Pawandeep Kaur"})}),e.jsx("div",{className:"pt-1 border-t border-slate-200 w-full text-center",children:e.jsx("span",{className:"font-extrabold text-slate-900 block text-xs text-blue-900 print:text-black",children:"Pawandeep Kaur (CFO)"})})]}),e.jsxs("div",{className:"space-y-0.5 mt-2",children:[e.jsx("span",{className:"text-[10px] text-blue-800 print:text-black uppercase font-black block",children:"Sanctioned By (CFO / Authorized)"}),e.jsxs("span",{className:"text-[10px] text-slate-700 print:text-black font-semibold block",children:["Date: ",f]})]})]})]})]}),e.jsxs("div",{className:"mt-8 pt-3 border-t border-slate-200 flex items-center justify-between text-[10px] text-slate-400 print:text-slate-600",children:[e.jsxs("span",{children:["Generated via VizOps ERP Financial Ledger System ⢠",N]}),e.jsx("span",{children:"Page 1 of 1 ⢠System Generated Voucher"})]})]})}function rt(){const o=X();ee();const{fmtConv:v}=he(),{data:N,refetch:u}=se({limit:2e3,sortBy:"entryDate",sortOrder:"asc"}),{data:f,refetch:m}=te({limit:500}),[y]=Le(),[i]=Re(),[b,M]=n.useState(""),[w,T]=n.useState(null),[O,l]=n.useState(!1),[j,h]=n.useState("0"),[S,I]=n.useState(""),[B,L]=n.useState("Audited all expense slips against paper diary & invoices. Settled."),[R,E]=n.useState(!1),[A,P]=n.useState("all"),[H,D]=n.useState(null),[F,$]=n.useState([]),[J,q]=n.useState(!1),{data:G}=Ce({limit:10}),Y=n.useMemo(()=>G?.items?.[0]?.name||"Tekki Web Solutions Pvt. Ltd.",[G]);n.useEffect(()=>{const a=x=>{x.key==="Escape"&&(D(null),T(null),l(!1))};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[]);const W=n.useMemo(()=>(f?.items??[]).map(re),[f]),C=n.useMemo(()=>(N?.items??[]).map(le),[N]),t=n.useMemo(()=>{if(W.length>0)return W;const a=C.filter(x=>x.payment>0).reduce((x,K)=>x+(K.payment||0),0);return[{id:"seed-001",batchNo:"FLOAT-2026-001",department:"Growth",requestedBy:"Gurcharan Singh Kang (COO)",requestedAmount:4e4,allocatedAmount:4e4,allocatedBy:"Pawandeep Kaur (CFO)",allocatedAt:"2026-08-01",purpose:"Weekly civil work, repairs, canteen & staff expenses",totalSpent:a||1500,remainingCash:Math.max(4e4-a,0)||38500,status:"Submitted for Audit",totalSlipsCount:C.filter(x=>x.payment>0).length||1,verifiedSlipsCount:1,waiverAmount:0}]},[W,C]);n.useEffect(()=>{if(!b&&t.length>0){const a=t.find(x=>x.status==="Submitted for Audit")||t[0];M(a.id||a.batchNo)}},[t,b]);const r=n.useMemo(()=>t.find(a=>a.id===b||a.batchNo===b)||t[0],[t,b]),s=n.useMemo(()=>
41{if(!r)return[];const a=r.id,x=r.batchNo,K=C.filter(V=>V.payment>0),Ne=K.filter(V=>V.floatBatchId===a||V.floatBatchId===x),Z=Ne.length>0?Ne:K;return A==="pending"?Z.filter(V=>V.verificationStatus==="Pending"||!V.verificationStatus):A==="verified"?Z.filter(V=>V.verificationStatus==="Verified"):A==="flagged"?Z.filter(V=>V.verificationStatus==="Flagged"):Z},[C,r,A]),d=n.useMemo(()=>s.filter(a=>a.verificationStatus==="Verified").length,[s]),c=n.useMemo(()=>!r||r.allocatedAmount<=0?0:Math.min(100,Math.round(r.totalSpent/r.allocatedAmount*100)),[r]),p=async(a,x,K)=>{try{await i({id:a,body:{verificationStatus:x,verificationNote:K}}).unwrap(),k.success(x==="Verified"?"Slip verified â":"Slip flagged â"),u(),m()}catch{k.error("Failed to update status")}},ne=async()=>{if(r){E(!0);try{await y({id:r.id,body:{waiverAmount:parseFloat(j)||0,waiverReason:S.trim()||void 0,auditRemarks:B.trim()||void 0,signedOffBy:"Pawandeep Kaur (CFO)"}}).unwrap(),k.success(`Batch ${r.batchNo} settled & signed off by CFO Pawandeep Kaur!`),l(!1),m()}catch(a){k.error(a?.data?.message||"Failed to sign off batch")}finally{E(!1)}}},Ae=n.useMemo(()=>C.filter(a=>a.payment>0),[C]),Fe=n.useMemo(()=>[{key:"date",label:"DATE & TIME",sortable:!0,width:"140px",render:a=>{if(!a.date)return e.jsx("span",{className:"text-muted-foreground",children:"â"});const x=new Date(a.date),K=isNaN(x.getTime())?a.date:x.toLocaleDateString("en-IN",{day:"2-digit",month:"short",year:"numeric"});return e.jsxs("div",{className:"flex flex-col text-xs font-data",children:[e.jsx("span",{className:"font-semibold text-slate-800 dark:text-slate-200",children:K}),e.jsx("span",{className:"text-[10px] text-slate-400 font-normal",children:a.entryTime||"10:00 AM"})]})}},{key:"description",label:"DETAILS",sortable:!0,render:a=>{const x=!a.billUrl||a.description?.includes("[Rough Slip");return e.jsxs("div",{className:"flex flex-col max-w-[280px]",children:[e.jsx("span",{className:"font-semibold text-slate-800 dark:text-slate-100 text-xs truncate",title:a.description,children:a.description||"â"}),e.jsxs("div",{className:"flex items-center gap-1 text-[10px] text-slate-500 font-medium",children:[e.jsxs("span",{children:[a.givenBy||"Pawandeep Kaur (CFO)"," â"]}),e.jsx("span",{className:"text-slate-700 dark:text-slate-300 font-bold",children:a.assignTo||a.custodianName||"Staff Member"}),a.invoiceNo&&e.jsxs("span",{className:"ml-1 font-mono text-[9px] text-slate-400",children:["#",a.invoiceNo]})]}),x&&e.jsxs("span",{className:"inline-flex items-center gap-1 text-[9px] font-bold text-amber-700 dark:text-amber-300 bg-amber-50 dark:bg-amber-950/60 border border-amber-200 dark:border-amber-900 px-1.5 py-0.2 rounded w-fit mt-0.5",children:[e.jsx(ve,{className:"w-2.5 h-2.5"})," Rough Diary Slip"]})]})}},{key:"category",label:"CATEGORY",sortable:!0,width:"150px",render:a=>e.jsxs("div",{className:"flex flex-col text-xs",children:[e.jsx("span",{className:"font-medium text-slate-800 dark:text-slate-200",children:a.category}),e.jsxs("span",{className:"text-[10px] text-slate-400",children:[a.subCategory?`${a.subCategory} · `:"",a.department||"Growth"]})]})},{key:"status",label:"STATUS",sortable:!0,width:"110px",render:a=>{const x=a.verificationStatus==="Verified",K=a.verificationStatus==="Flagged";return x?e.jsxs("span",{className:"px-2 py-0.5 rounded text-[11px] font-bold bg-emerald-50 text-emerald-700 border border-emerald-200 dark:bg-emerald-950 dark:text-emerald-300 inline-flex items-center gap-1",children:[e.jsx(Ee,{className:"w-3 h-3"})," Verified"]}):K?e.jsxs("span",{className:"px-2 py-0.5 rounded text-[11px] font-bold bg-rose-50 text-rose-700 border border-rose-200 dark:bg-rose-950 dark:text-rose-300 inline-flex items-center gap-1",children:[e.jsx(ye,{className:"w-3 h-3"})," Flagged"]}):e.jsx("span",{className:"px-2 py-0.5 rounded text-[11px] font-bold bg-amber-50 text-amber-700 border border-amber-200 dark:bg-amber-950 dark:text-amber-300",children:"Pending"})}},{key:"slip",label:"SLIP",width:"80px",align:"center",render:a=>e.jsxs("button",{type:"button",onClick:()=>T({url:a.billUrl,description:a.description,amount:a.payment,entryId:a.id,verificationStatus:a.verificationStatus}),className:"p-1 rounded border border-slate-200 hover:border-slate-300 bg-white dark:bg-slate-800 hover:bg-slate-50 text-slate-600 dar
41k:text-slate-300 text-xs inline-flex items-center gap-1 cursor-pointer transition-colors shadow-2xs",title:"View Slip / Note",children:[e.jsx(Se,{className:"w-3.5 h-3.5 text-blue-600"}),e.jsx("span",{className:"text-[10px] font-semibold",children:a.billUrl?"Bill":"Note"})]})},{key:"payment",label:"PAYMENT (CR)",sortable:!0,width:"130px",align:"right",render:a=>e.jsxs("span",{className:"font-data font-bold text-rose-600 dark:text-rose-400 text-xs",children:["â¹",Number(a.payment||0).toLocaleString("en-IN",{minimumFractionDigits:2})]})},{key:"actions",label:"ACTIONS",width:"140px",align:"right",render:a=>{const x=a.verificationStatus==="Verified";return e.jsxs("div",{className:"flex items-center justify-end gap-1",children:[e.jsxs("button",{type:"button",onClick:()=>p(a.id,x?"Pending":"Verified"),className:g("h-7 px-2 text-xs font-bold rounded flex items-center gap-1 transition-colors cursor-pointer",x?"bg-slate-100 dark:bg-slate-800 hover:bg-slate-200 text-slate-600 dark:text-slate-400":"bg-emerald-600 hover:bg-emerald-700 text-white shadow-2xs"),title:x?"Undo Verification":"Approve Slip",children:[e.jsx(ie,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:x?"Undo":"Approve"})]}),e.jsx("button",{type:"button",onClick:()=>p(a.id,"Flagged","Flagged by CFO for clarification"),className:"h-7 px-1.5 text-xs text-slate-400 hover:text-rose-600 hover:bg-rose-50 dark:hover:bg-rose-950/40 rounded transition-colors cursor-pointer",title:"Flag Slip",children:e.jsx(z,{className:"w-3.5 h-3.5"})}),e.jsx("button",{type:"button",onClick:()=>D({id:a.id,voucherNo:a.invoiceNo||`VCH-2026-${a.id.slice(-4).toUpperCase()}`,date:a.date,category:a.category||"Float Expense",subCategory:a.subCategory||"General Slip",description:a.description||"Petty cash voucher item",amount:Number(a.payment||0),paidTo:a.assignTo||a.party||"Site Supervisor / Staff",givenBy:a.givenBy||"Pawandeep Kaur (CFO)",batchNo:r?.batchNo||"FLOAT-2026-001",status:a.verificationStatus||"Pending Audit",voucherType:"Debit Voucher / Cash Out"}),className:"h-7 px-1.5 text-xs text-slate-400 hover:text-blue-600 hover:bg-blue-50 dark:hover:bg-blue-950/40 rounded transition-colors cursor-pointer",title:"Print Voucher",children:e.jsx(Q,{className:"w-3.5 h-3.5"})})]})}}],[r]),Te=e.jsxs("div",{className:"flex items-center justify-between gap-3 w-full flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1 rounded-md bg-emerald-50 dark:bg-emerald-950/40 border border-emerald-200 dark:border-emerald-800 text-xs",children:[e.jsx("span",{className:"text-slate-500 font-medium text-[11px]",children:"Disbursed:"}),e.jsxs("span",{className:"font-bold font-data text-emerald-700 dark:text-emerald-300",children:["â¹",r?.allocatedAmount?.toLocaleString("en-IN")||"0"]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1 rounded-md bg-rose-50 dark:bg-rose-950/40 border border-rose-200 dark:border-rose-800 text-xs",children:[e.jsx("span",{className:"text-slate-500 font-medium text-[11px]",children:"Claimed:"}),e.jsxs("span",{className:"font-bold font-data text-rose-700 dark:text-rose-300",children:["â¹",r?.totalSpent?.toLocaleString("en-IN")||"0"]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1 rounded-md bg-blue-50 text-blue-700 border border-blue-200 dark:bg-blue-950/40 dark:text-blue-300 text-xs font-bold font-data",children:[e.jsx("span",{className:"text-slate-500 font-medium uppercase text-[10px] tracking-tight",children:"In-Hand:"}),e.jsxs("span",{children:["â¹",r?.remainingCash?.toLocaleString("en-IN")||"0"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-1 bg-slate-100 dark:bg-slate-800/80 p-0.5 rounded-lg border border-slate-200 dark:border-slate-700 text-xs",children:[e.jsxs("button",{type:"button",onClick:()=>P("all"),className:g("px-2.5 py-1 rounded-md font-semibold transition-all cursor-pointer",A==="all"?"bg-white dark:bg-slate-900 text-blue-600 shadow-2xs font-bold":"text-slate-600 dar
41k:text-slate-400 hover:text-slate-900"),children:["All (",Ae.length,")"]}),e.jsx("button",{type:"button",onClick:()=>P("pending"),className:g("px-2.5 py-1 rounded-md font-semibold transition-all cursor-pointer",A==="pending"?"bg-white dark:bg-slate-900 text-amber-600 shadow-2xs font-bold":"text-slate-600 dark:text-slate-400 hover:text-slate-900"),children:"Pending Audit"}),e.jsx("button",{type:"button",onClick:()=>P("verified"),className:g("px-2.5 py-1 rounded-md font-semibold transition-all cursor-pointer",A==="verified"?"bg-white dark:bg-slate-900 text-emerald-600 shadow-2xs font-bold":"text-slate-600 dark:text-slate-400 hover:text-slate-900"),children:"Verified â"}),e.jsx("button",{type:"button",onClick:()=>P("flagged"),className:g("px-2.5 py-1 rounded-md font-semibold transition-all cursor-pointer",A==="flagged"?"bg-white dark:bg-slate-900 text-rose-600 shadow-2xs font-bold":"text-slate-600 dark:text-slate-400 hover:text-slate-900"),children:"Flagged â"})]}),e.jsxs("button",{type:"button",onClick:async()=>{for(const a of s)a.verificationStatus!=="Verified"&&await p(a.id,"Verified");k.success("All visible slips marked as Verified â")},className:"px-2.5 py-1 rounded-md bg-blue-50 hover:bg-blue-100 text-blue-700 text-xs font-bold border border-blue-200 cursor-pointer inline-flex items-center gap-1.5 transition-colors shadow-2xs",children:[e.jsx(de,{className:"w-3.5 h-3.5"})," Verify All"]})]})]});return e.jsxs("div",{className:"flex flex-col flex-1 h-full min-h-0 overflow-hidden bg-slate-50/50 dark:bg-slate-950/50",children:[e.jsx(ae,{title:"CFO Audit",subtitle:"Line-by-line petty cash voucher inspection, bill verification & float sign-off",accentVar:"--mod-finance",showMonthYearFilter:!1,actions:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(U,{to:`${o}/cash-book`,className:"h-8 px-3 rounded-md border border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-900 hover:bg-slate-50 text-xs font-semibold text-slate-700 dark:text-slate-200 inline-flex items-center gap-1.5 transition-colors shadow-2xs",children:[e.jsx(be,{className:"w-3.5 h-3.5"})," Back to Cash Book"]}),e.jsxs(U,{to:`${o}/cash-book/requests`,className:"h-8 px-3 rounded-md border border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-900 hover:bg-slate-50 text-xs font-semibold text-slate-700 dark:text-slate-200 inline-flex items-center gap-1.5 transition-colors shadow-2xs",children:[e.jsx($e,{className:"w-3.5 h-3.5"})," Cash Requests"]}),r&&e.jsxs("button",{type:"button",onClick:()=>l(!0),className:"h-8 px-4 rounded-md bg-emerald-600 hover:bg-emerald-700 text-white text-xs font-bold shadow-2xs inline-flex items-center gap-1.5 transition-colors cursor-pointer",children:[e.jsx(de,{className:"w-4 h-4"})," Final CFO Sign-Off & Settle Batch"]})]})}),e.jsxs("div",{className:"shrink-0 px-6 py-4 bg-white dark:bg-slate-900 border-b border-slate-200 dark:border-slate-800 space-y-3.5",children:[e.jsx("div",{className:"flex items-center justify-between flex-wrap gap-3",children:e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("span",{className:"text-xs font-bold text-slate-700 dark:text-slate-300",children:"Auditing Float Batch:"}),e.jsx("select",{value:b,onChange:a=>M(a.target.value),className:"h-8 px-3 rounded-lg border border-slate-200 dark:border-slate-700 bg-slate-50 dark:bg-slate-800 text-xs font-bold text-slate-800 dark:text-slate-200 focus:outline-none focus:ring-2 focus:ring-blue-500/20",children:t.map(a=>e.jsxs("option",{value:a.id||a.batchNo,children:[a.batchNo," â ",a.requestedBy," (",a.department,") [â¹",a.allocatedAmount.toLocaleString("en-IN"),"] ⢠",a.status]},a.id||a.batchNo))})]})}),r&&e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-5 gap-3 text-xs",children:[e.jsxs("div",{className:"p-3 bg-slate-50 dark:bg-slate-950 rounded-xl border border-slate-200 dark:border-slate-800 space-y-1",children:[e.jsx("span",{className:"text-[10px] text-slate-400 font-bold uppercase tracking-wider block",children:"1. Float Disbursed"}),e.jsxs("div",{className:"text-base font-black font-data text-slate-900 dark:text-slate-100",children:["â¹ ",r.allocatedAmount.toLocaleStr
41ing("en-IN")]}),e.jsx("div",{className:"text-[10px] text-slate-400 truncate",children:"By Pawandeep Kaur (CFO)"})]}),e.jsxs("div",{className:"p-3 bg-rose-50/50 dark:bg-rose-950/20 rounded-xl border border-rose-200 dark:border-rose-900/60 space-y-1",children:[e.jsx("span",{className:"text-[10px] text-rose-700 dark:text-rose-400 font-bold uppercase tracking-wider block",children:"2. Slips Claimed / Burned"}),e.jsxs("div",{className:"text-base font-black font-data text-rose-600",children:["â¹ ",r.totalSpent.toLocaleString("en-IN")]}),e.jsxs("div",{className:"text-[10px] text-rose-700/70 font-semibold",children:[c,"% float burned"]})]}),e.jsxs("div",{className:"p-3 bg-emerald-50/50 dark:bg-emerald-950/20 rounded-xl border border-emerald-200 dark:border-emerald-900/60 space-y-1",children:[e.jsx("span",{className:"text-[10px] text-emerald-700 dark:text-emerald-400 font-bold uppercase tracking-wider block",children:"3. In-Hand with Custodian"}),e.jsxs("div",{className:"text-base font-black font-data text-emerald-600",children:["â¹ ",r.remainingCash.toLocaleString("en-IN")]}),e.jsx("div",{className:"text-[10px] text-emerald-700/70 truncate",children:r.requestedBy})]}),e.jsxs("div",{className:"p-3 bg-slate-50 dark:bg-slate-950 rounded-xl border border-slate-200 dark:border-slate-800 space-y-1.5",children:[e.jsxs("div",{className:"flex justify-between items-center text-[10px] text-slate-400 font-bold uppercase",children:[e.jsx("span",{children:"4. Burn Progress"}),e.jsxs("span",{className:"font-mono text-slate-700 dark:text-slate-300",children:[c,"%"]})]}),e.jsx("div",{className:"w-full bg-slate-200 dark:bg-slate-800 h-2 rounded-full overflow-hidden",children:e.jsx("div",{className:g("h-full rounded-full transition-all",c>80?"bg-rose-500":c>50?"bg-amber-500":"bg-blue-500"),style:{width:`${c}%`}})}),e.jsxs("div",{className:"text-[10px] text-slate-400",children:["Department: ",r.department]})]}),e.jsxs("div",{className:"p-3 bg-blue-50/50 dark:bg-blue-950/20 rounded-xl border border-blue-200 dark:border-blue-900/60 space-y-1",children:[e.jsx("span",{className:"text-[10px] text-blue-700 dark:text-blue-300 font-bold uppercase tracking-wider block",children:"5. Audit Progress"}),e.jsxs("div",{className:"text-base font-black text-blue-600",children:[d," / ",s.length," Verified"]}),e.jsx("div",{className:"text-[10px] text-blue-700/70 font-semibold",children:d===s.length&&s.length>0?"Ready for Sign-Off â":"Pending Inspection"})]})]})]}),e.jsx("div",{className:"p-3 pb-3 flex-1 min-h-0 flex flex-col overflow-hidden",children:e.jsx(_,{selectable:!0,selectedIds:F,onSelectionChange:$,bulkActions:[{id:"verify",label:"Verify Selected",icon:e.jsx(ie,{className:"w-3.5 h-3.5"}),onAction:async a=>{try{for(const x of a)await p(x.id,"Verified");k.success(`Verified ${a.length} slip(s)`),$([])}catch{k.error("Failed to verify slips")}}},{id:"flag",label:"Flag Selected",icon:e.jsx(ye,{className:"w-3.5 h-3.5"}),variant:"destructive",onAction:async a=>{try{for(const x of a)await p(x.id,"Flagged","Flagged by CFO via bulk audit");k.success(`Flagged ${a.length} slip(s)`),$([])}catch{k.error("Failed to flag slips")}}}],rows:s,rowKey:a=>a.id,searchKeys:["description","category","subCategory","givenBy","assignTo","invoiceNo"],searchPlaceholder:"Search expense slipsâ¦",initialSortKey:"date",storageKey:"cfo-cash-audit-slips",initialPageSize:25,fetching:J,onRefresh:async()=>{q(!0),await Promise.all([u(),m()]),setTimeout(()=>q(!1),500)},fillHeight:!0,toolbar:Te,columns:Fe})}),w&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4 animate-in fade-in duration-150",children:e.jsxs("div",{className:"w-full max-w-lg bg-white dark:bg-slate-900 rounded-2xl border border-slate-200 dark:border-slate-800 p-5 shadow-2xl space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-slate-100 dark:border-slate-800 pb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(pe,{className:"w-4 h-4 text-blue-600"}),e.jsx("span",{className:"text-xs font-bold text-slate-800 dark:text-slate-200",children:w.url?"Official Tax Receipt / Bill Proof":"Handwritten Notebook Diary Note"})]}),e.jsx("button",{type:"button",onClick:()=>T(null),className:"text-slate-400 hover:text-slate-600 cursor-pointer p-1",children:e.jsx(z,{className:"w-4 h-4"})})]}),e.jsxs("div",{className:"space-y-3 text-xs",children:[w.url?e.jsx("div",{className:"max-h-[350px] overflow-auto rounded-xl border border-slate-200 dark:border-slate-800 bg-slate-50 dark:bg-slate-950 p-2 flex justify-center",children:e.jsx("img",{src:w.url,alt:"Receipt Proof",className:"max-h-[330px] object-contain rounded-lg"})}):e.jsxs("div",{className:"p-4 rounded-xl bg-amber-50/70 dark:bg-amber-950/30 border border-amber-200 dark:border-amber-900/40 space-y-2 text-amber-900 dark:text-amber-200",children:[e.jsxs("div",{className:"font-bold flex items-center gap-1.5",children:[e.jsx(ve,{className:"w-3.5 h-3.5 text-amber-600"})," Physical Diary Note / Voucher Entry:"]}),e.jsx("p",{className:"leading-relaxed bg-white dark:bg-slate-900 p-3 rounded-lg border border-amber-200/60 dark:border-amber-900/60 text-slate-800 dark:text-slate-200",children:w.description})]}),e.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-slate-100 dar
41k:border-slate-800",children:[e.jsxs("span",{className:"font-data font-black text-rose-600 text-sm",children:["Amount: â¹",Number(w.amount||0).toLocaleString("en-IN")]}),w.entryId&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{type:"button",onClick:()=>{p(w.entryId,"Verified"),T(null)},className:"h-8 px-3 rounded bg-emerald-600 hover:bg-emerald-700 text-white text-xs font-bold inline-flex items-center gap-1 cursor-pointer",children:[e.jsx(ie,{className:"w-3.5 h-3.5"})," Approve Slip"]}),e.jsx("button",{type:"button",onClick:()=>{p(w.entryId,"Flagged","Bill discrepancy"),T(null)},className:"h-8 px-3 rounded bg-slate-100 hover:bg-rose-100 text-rose-700 text-xs font-semibold cursor-pointer",children:"Flag Slip"})]})]})]})]})}),O&&r&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4 animate-in fade-in duration-150",children:e.jsxs("div",{className:"w-full max-w-lg bg-white dark:bg-slate-900 rounded-2xl border border-slate-200 dark:border-slate-800 p-6 shadow-2xl space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-slate-100 dark:border-slate-800 pb-3",children:[e.jsxs("h3",{className:"text-sm font-bold text-slate-900 dark:text-slate-100 flex items-center gap-2",children:[e.jsx(me,{className:"w-4 h-4 text-emerald-600"}),"CFO Final Sign-Off & Settle Batch (",r.batchNo,")"]}),e.jsx("button",{type:"button",onClick:()=>l(!1),className:"text-slate-400 hover:text-slate-600 cursor-pointer",children:e.jsx(z,{className:"w-4 h-4"})})]}),e.jsxs("div",{className:"p-3.5 bg-slate-50 dark:bg-slate-950 rounded-xl border border-slate-200 dark:border-slate-800 space-y-2 text-xs",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-500",children:"Total Float Assigned:"}),e.jsxs("span",{className:"font-bold text-slate-800 dark:text-slate-200 font-data",children:["â¹ ",r.allocatedAmount.toLocaleString("en-IN")]})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-500",children:"Total Verified Slips Claimed:"}),e.jsxs("span",{className:"font-bold text-rose-600 font-data",children:["â¹ ",r.totalSpent.toLocaleString("en-IN")]})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsxs("span",{className:"text-slate-500",children:["Remaining In-Hand with Custodian (",r.requestedBy,"):"]}),e.jsxs("span",{className:"font-bold text-emerald-600 font-data",children:["â¹ ",r.remainingCash.toLocaleString("en-IN")]})]})]}),e.jsxs("div",{className:"space-y-3 text-xs",children:[e.jsxs("div",{children:[e.jsx("label",{className:"font-bold text-slate-700 dark:text-slate-300 block mb-1",children:"Waiver / Round-off Adjustment (â¹)"}),e.jsx("input",{type:"number",value:j,onChange:a=>h(a.target.value),className:"w-full h-9 rounded-md border border-slate-200 dark:border-slate-700 px-3 font-data font-bold text-xs",placeholder:"0.00"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"font-bold text-slate-700 dark:text-slate-300 block mb-1",children:"Waiver Reason / Discrepancy Note"}),e.jsx("input",{type:"text",value:S,onChange:a=>I(a.target.value),placeholder:"e.g. Approved minor auto conveyance without receipt",className:"w-full h-9 rounded-md border border-slate-200 dark:border-slate-700 px-3 text-xs"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"font-bold text-slate-700 dark:text-slate-300 block mb-1",children:"CFO Sign-Off Remarks"}),e.jsx("textarea",{rows:2,value:B,onChange:a=>L(a.target.value),className:"w-full rounded-md border border-slate-200 dark:border-slate-700 p-2 text-xs resize-none"})]}),e.jsxs("div",{className:"p-3 bg-blue-50/50 dark:bg-blue-950/20 border border-blue-200 dark:border-blue-900/60 rounded-xl space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between text-[10px] text-blue-700 dark:text-blue-300 font-bold uppercase tracking-wider",children:[e.jsx("span",{children:"Authorized Digital Signature Seal"}),e.jsx("span",{children:"Tekki Web Solutions Pvt. Ltd."})]}),e.jsx("div",{className:"font-serif italic text-2xl text-blue-800 dark:text-blue-300 py-1",children:"Pawandeep Kaur"}),e.jsxs("div",{className:"text-[10px] text-slate-400 font-mono",children:["Chief Financial Officer (CFO) · Sign-off Timestamp: ",new Date().toLocaleDateString("en-IN")]})]})]}),e.jsxs("div",{className:"flex items-center justify-between pt-3 border-t border-slate-100 dar
41k:border-slate-800",children:[e.jsx("button",{type:"button",onClick:()=>l(!1),className:"h-8 px-3 rounded border border-slate-200 text-xs font-semibold text-slate-600 hover:bg-slate-50 cursor-pointer",children:"Cancel"}),e.jsxs("button",{type:"button",disabled:R,onClick:ne,className:"h-8 px-5 rounded bg-emerald-600 hover:bg-emerald-700 text-white text-xs font-bold shadow-2xs inline-flex items-center gap-1.5 cursor-pointer",children:[e.jsx(de,{className:"w-3.5 h-3.5"}),R?"Signing Offâ¦":"Confirm CFO Sign-Off & Settle Batch"]})]})]})}),H&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4 animate-in fade-in duration-150 overflow-y-auto",children:e.jsxs("div",{className:"w-full max-w-3xl bg-white dark:bg-slate-900 rounded-xl border border-slate-200 dark:border-slate-800 p-4 shadow-2xl space-y-4 my-8 max-h-[92vh] overflow-y-auto",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-slate-100 dark:border-slate-800 pb-2.5 print:hidden",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Q,{className:"w-4 h-4 text-blue-600"}),e.jsx("span",{className:"text-xs font-bold text-slate-900 dark:text-slate-100",children:"Official Petty Cash Payment Voucher Slip"}),e.jsxs("span",{className:"text-[10px] text-slate-400 font-mono",children:["#",H.voucherNo]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{type:"button",onClick:()=>window.print(),className:"h-7 px-3 rounded bg-blue-600 hover:bg-blue-700 text-white text-xs font-bold shadow-2xs inline-flex items-center gap-1 cursor-pointer",children:[e.jsx(Q,{className:"w-3 h-3"})," Print Voucher"]}),e.jsx("button",{type:"button",onClick:()=>D(null),className:"text-slate-400 hover:text-slate-600 cursor-pointer p-1",children:e.jsx(z,{className:"w-4 h-4"})})]})]}),e.jsx(ge,{voucher:H,companyName:Y})]})})]})}function Nt(){const{pathname:o}=Ke(),v=X(),N=ee();return o.includes("/cash-book/new")?e.jsx(Xe,{}):o.includes("/cash-book/requests")?e.jsx(tt,{}):o.includes("/cash-book/audit")?e.jsx(rt,{}):o.includes("/cash-book/voucher")?e.jsx(at,{}):e.jsx(lt,{base:v,navigate:N})}function lt({base:o,navigate:v}){const{fmtConvCompact:N,fmtConv:u}=he(),{data:f,isLoading:m,isFetching:y,refetch:i}=se({limit:2e3,sortBy:"entryDate",sortOrder:"asc"}),{data:b}=te({limit:100}),{data:M}=Ce({limit:10}),[w]=He(),T=n.useMemo(()=>M?.items?.[0]?.name||"Tekki Web Solutions Pvt. Ltd.",[M]),[O,l]=n.useState([]),[j,h]=n.useState(!1),[S,I]=n.useState("all"),[B,L]=n.useState(null),[R,E]=n.useState(null);n.useEffect(()=>{const t=r=>{r.key==="Escape"&&(E(null),L(null))};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[]);const A=n.useMemo(()=>(f?.items??[]).map(le),[f]),P=n.useMemo(()=>(b?.items??[]).map(re),[b]),H=n.useMemo(()=>P.find(t=>t.status==="Active")||P[0],[P]),D=n.useMemo(()=>{const t=[...A].sort((s,d)=>new Date(s.date).getTime()-new Date(d.date).getTime());let r=0;return t.map(s=>{const d=Number(s.receipt)||0,c=Number(s.payment)||0;return r+=d-c,{...s,balance:r}})},[A]),F=Ze(D,"date"),$=n.useMemo(()=>F.reduce((t,r)=>t+(Number(r.receipt)||0),0),[F]),J=n.useMemo(()=>F.reduce((t,r)=>t+(Number(r.payment)||0),0),[F]),q=$-J,G=n.useMemo(()=>[...F].sort((t,r)=>new Date(r.date).getTime()-new Date(t.date).getTime()),[F]),Y=n.useMemo(()=>S==="in"?G.filter(t=>t.receipt>0):S==="out"?G.filter(t=>t.payment>0):G,[G,S]),W=n.useMemo(()=>{const t={};return D.forEach(r=>{if(!r.date)return;const s=new Date(r.date);if(isNaN(s.getTime()))return;const d=s.getFullYear(),c=s.getMonth(),p=`${d}-${String(c+1).padStart(2,"0")}`,ne=s.toLocaleString("en-US",{month:"short",year:"numeric"});t[p]||(t[p]={monthKey:p,monthLabel:ne,receipts:0,payments:0,lastBalance:r.balance}),t[p].receipts+=r.receipt||0,t[p].payments+=r.payment||0,t[p].lastBalance=r.balance}),Object.values(t).sort((r,s)=>s.monthKey.localeCompare(r.monthKey))},[D]),C=e.jsxs("div",{className:"flex items-center justify-between gap-3 w-full flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1 rounded-md bg-emerald-50 dark:bg-emerald-950/40 border border-emerald-200 dark:border-emerald-800 text-xs",children:[e.jsx(et,{className:"w-3.5 h-3.5 text-emerald-600 dark:text-emerald-400"}),e.jsx("span",{className:"text-slate-500 font-medium",children:"Cash In:"}),e.jsx("span",{className:"font-bold font-data text-emerald-700 dark:text-emerald-300",children:u($)})]}),e.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1 rounded-md bg-rose-50 dark:bg-rose-950/40 border border-rose-200 dark:border-rose-800 text-xs",children:[e.jsx(Ge,{className:"w-3.5 h-3.5 text-rose-600 dar
41k:text-rose-400"}),e.jsx("span",{className:"text-slate-500 font-medium",children:"Cash Out:"}),e.jsx("span",{className:"font-bold font-data text-rose-700 dark:text-rose-300",children:u(J)})]}),e.jsxs("div",{className:g("flex items-center gap-1.5 px-3 py-1 rounded-md border text-xs font-bold font-data",q===0?"bg-blue-50 text-blue-700 border-blue-200 dark:bg-blue-950/40 dark:text-blue-300":q>0?"bg-emerald-50 text-emerald-700 border-emerald-200":"bg-rose-50 text-rose-700 border-rose-200"),children:[e.jsx("span",{className:"text-slate-500 font-medium uppercase text-[10px] tracking-tight",children:"Net Ledger Balance:"}),e.jsx("span",{children:u(q)})]}),H&&e.jsxs(U,{to:`${o}/cash-book/requests`,className:"hidden xl:flex items-center gap-1.5 px-2.5 py-1 rounded-md bg-amber-50 dark:bg-amber-950/40 border border-amber-200 text-xs text-amber-800 dark:text-amber-300 hover:bg-amber-100 transition-colors",children:[e.jsx(we,{className:"w-3 h-3 text-amber-600"}),e.jsxs("span",{className:"font-semibold",children:["Float #",H.batchNo.slice(-3),":"]}),e.jsxs("span",{children:["â¹",H.remainingCash.toLocaleString("en-IN")," left â"]})]})]}),e.jsxs("div",{className:"flex items-center gap-1 bg-slate-100 dark:bg-slate-800/80 p-0.5 rounded-lg border border-slate-200 dark:border-slate-700 text-xs",children:[e.jsxs("button",{type:"button",onClick:()=>I("all"),className:g("px-2.5 py-1 rounded-md font-semibold transition-all cursor-pointer",S==="all"?"bg-white dark:bg-slate-900 text-blue-600 shadow-2xs font-bold":"text-slate-600 dark:text-slate-400 hover:text-slate-900"),children:["All (",F.length,")"]}),e.jsx("button",{type:"button",onClick:()=>I("in"),className:g("px-2.5 py-1 rounded-md font-semibold transition-all cursor-pointer",S==="in"?"bg-white dark:bg-slate-900 text-emerald-600 shadow-2xs font-bold":"text-slate-600 dark:text-slate-400 hover:text-slate-900"),children:"Cash In"}),e.jsx("button",{type:"button",onClick:()=>I("out"),className:g("px-2.5 py-1 rounded-md font-semibold transition-all cursor-pointer",S==="out"?"bg-white dark:bg-slate-900 text-rose-600 shadow-2xs font-bold":"text-slate-600 dark:text-slate-400 hover:text-slate-900"),children:"Cash Out"}),e.jsxs("button",{type:"button",onClick:()=>I("monthly"),className:g("px-2.5 py-1 rounded-md font-semibold transition-all cursor-pointer flex items-center gap-1",S==="monthly"?"bg-white dark:bg-slate-900 text-blue-600 shadow-2xs font-bold":"text-slate-600 dark:text-slate-400 hover:text-slate-900"),children:[e.jsx(We,{className:"w-3 h-3"})," Monthly"]})]})]});return e.jsxs("div",{className:"flex flex-col flex-1 h-full min-h-0 overflow-hidden bg-slate-50/50 dark:bg-slate-950/50",children:[e.jsx(ae,{title:"Cash Book & Ledger",subtitle:"Daily receipts (Dr), payments (Cr), and monthly ledger balance reconciliation",accentVar:"--mod-finance",showMonthYearFilter:!1}),e.jsx("div",{className:"shrink-0 bg-surface/50 border-b border-border px-4 py-2 flex items-center justify-between flex-wrap gap-2",children:e.jsx(Je,{showMonths:!0,actions:e.jsx(qe,{delayDuration:150,children:e.jsxs(ze,{children:[e.jsx(Ue,{asChild:!0,children:e.jsx(U,{to:`${o}/cash-book/new`,className:"h-8 w-8 p-0 rounded-lg bg-blue-600 hover:bg-blue-700 text-white inline-flex items-center justify-center shadow-2xs transition-colors shrink-0 cursor-pointer","aria-label":"Add Cash Entry",children:e.jsx(xe,{className:"w-4 h-4"})})}),e.jsx(Ye,{side:"bottom",align:"end",className:"text-xs font-medium",children:"Add Cash Entry"})]})})})}),e.jsx("div",{className:"p-3 pb-3 flex-1 min-h-0 flex flex-col overflow-hidden",children:S==="monthly"?e.jsx(_,{rows:W,columns:[{key:"monthLabel",label:"MONTH",sortable:!0,render:t=>e.jsx("span",{className:"font-bold text-slate-900 dark:text-slate-100",children:t.monthLabel})},{key:"receipts",label:"TOTAL RECEIPTS (DR)",align:"right",width:"160px",sortable:!0,render:t=>e.jsx("span",{className:"font-data font-bold text-emerald-600 dark:text-emerald-400",children:t.receipts>0?u(t.receipts):"â"})},{key:"payments",label:"TOTAL PAYMENTS (CR)",align:"right",width:"160px",sortable:!0,render:t=>
41e.jsx("span",{className:"font-data font-bold text-rose-600 dark:text-rose-400",children:t.payments>0?u(t.payments):"â"})},{key:"netFlow",label:"NET CASH FLOW",align:"right",width:"160px",render:t=>{const r=t.receipts-t.payments;return e.jsx("span",{className:g("inline-flex items-center gap-1 px-2.5 py-0.5 rounded-full text-xs font-bold font-data border",r>=0?"bg-emerald-50 text-emerald-700 border-emerald-200":"bg-rose-50 text-rose-700 border-rose-200"),children:r>=0?`+ ${u(r)}`:`- ${u(Math.abs(r))}`})}},{key:"lastBalance",label:"CLOSING LEDGER BALANCE",align:"right",width:"180px",render:t=>e.jsx("span",{className:"font-data font-bold text-slate-900 dark:text-slate-100",children:u(t.lastBalance)})}],rowKey:t=>t.monthKey,searchKeys:["monthLabel"],searchPlaceholder:"Search monthly ledgerâ¦",storageKey:"finance-cash-book-monthly",initialPageSize:25,fetching:y||m||j,onRefresh:async()=>{h(!0),await i(),setTimeout(()=>h(!1),500)},fillHeight:!0,toolbar:C}):e.jsx(_,{selectable:!0,selectedIds:O,onSelectionChange:l,bulkActions:[{id:"delete",label:"Delete",icon:e.jsx(ke,{className:"w-3.5 h-3.5"}),variant:"destructive",onAction:async t=>{if(confirm(`Delete ${t.length} selected cash book entry(ies)?`))try{await Promise.all(t.map(r=>w(r.id).unwrap())),k.success(`Deleted ${t.length} entry(ies)`),l([]),i()}catch{k.error("Failed to delete selected entry(ies)")}}}],rows:Y,rowKey:t=>t.id,searchKeys:["description","category","subCategory","givenBy","assignTo","custodianName"],searchPlaceholder:"Search cash entriesâ¦",initialSortKey:"date",storageKey:"finance-cash-book",initialPageSize:25,fetching:y||m||j,onRefresh:async()=>{h(!0),await i(),setTimeout(()=>h(!1),500)},fillHeight:!0,toolbar:C,columns:[{key:"date",label:"Date & Time",sortable:!0,width:"135px",render:t=>{if(!t.date)return e.jsx("span",{className:"text-muted-foreground",children:"â"});const r=new Date(t.date),s=isNaN(r.getTime())?t.date:r.toLocaleDateString("en-IN",{day:"2-digit",month:"short",year:"numeric"});return e.jsxs("div",{className:"flex flex-col text-xs font-data",children:[e.jsx("span",{className:"font-semibold text-slate-800 dark:text-slate-200",children:s}),e.jsx("span",{className:"text-[10px] text-slate-400 font-normal",children:t.entryTime||"10:00 AM"})]})}},{key:"description",label:"Details",sortable:!0,render:t=>{const r=(t.receipt||0)>0;return e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"font-semibold text-slate-800 dark:text-slate-100 text-xs",children:ue(t.description)||"â"}),e.jsxs("div",{className:"flex items-center gap-1 text-[10px] text-slate-500 font-medium",children:[r?e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"text-emerald-700 dark:text-emerald-400 font-semibold",children:["Float from ",t.givenBy||"Pawandeep Kaur (CFO)"," â"]}),e.jsx("span",{className:"text-slate-700 dark:text-slate-300 font-bold",children:t.assignTo||t.custodianName||"Custodian"})]}):e.jsx(e.Fragment,{children:e.jsxs("span",{className:"text-slate-600 dark:text-slate-400",children:["Custodian: ",e.jsx("strong",{className:"text-slate-800 dark:text-slate-200",children:t.custodianName||t.assignTo||"Gurcharan Singh"})]})}),t.floatBatchId&&e.jsxs("span",{className:"ml-1 px-1.5 py-0.2 rounded text-[9px] font-bold bg-blue-50 text-blue-700 border border-blue-200",children:["#",t.floatBatchId.slice(-3)]})]})]})}},{key:"category",label:"Category",width:"170px",sortable:!0,render:t=>e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx(_e,{name:t.category||"General"}),t.subCategory&&e.jsx("span",{className:"text-[10px] text-slate-400 font-normal truncate max-w-[150px]",children:t.subCategory})]})},{key:"verificationStatus",label:"Status",width:"115px",align:"center",render:t=>{const r=t.verificationStatus||t.auditStatus||"Signed Off",s=r==="Verified"||r==="Signed Off",d=r==="Flagged"||r==="Disputed",c=r==="Submitted for Audit"||r==="Active";return e.jsxs("span",{className:g("inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-bold border whitespace-nowrap shadow-2xs",s?"bg-emerald-50 text-emerald-700 dark:bg-emerald-950/50 dark:text-emerald-300 border-emerald-200 dark:border-emerald-800":d?"bg-rose-50 text-rose-700 dark:bg-rose-950/50 dark:text-rose-300 border-rose-200 dark:border-rose-800":c?"bg-blue-50 text-blue-700 dark:bg-blue-950/50 dark:text-blue-300 border-blue-200 dark:border-blue-800":"bg-amber-50 text-amber-700 dark:bg-amber-950/50 dark:text-amber-300 border-amber-200 dark:border-amber-800"),children:[e.jsx("span",{className:g("w-1.5 h-1.5 rounded-full shrink-0",s?"bg-emerald-500":d?"bg-rose-500":c?"bg-blue-500":"bg-amber-500")}),s?"Verified":d?"Flagged":c?"Active Audit":"Pending"]})}},{key:"billUrl",label:"Slip",width:"70px",align:"center",render:t=>e.jsx("button",{type:"button",onClick:r=>{r.stopPropagation(),L({url:t.billUrl,description:t.description,amount:t.payment||t.receipt})},className:"p-1 rounded-md bg-slate-100 hover:bg-slate-200 text-slate-600 transition-colors cursor-pointer",title:t.billUrl?"View bill":"View note",children:e.jsx(Se,{className:"w-3.5 h-3.5"})})},{key:"receipt",label:"Receipt (Dr)",align:"right",width:"120px",sortable:!0,render:t=>t.receipt>0?e.jsx("span",{className:"font-data font-bold text-xs text-emerald-600 dark:text-emerald-400",children:N(t.receipt)}):e.jsx("span",{className:"text-muted-foreground text-xs",children:"â"})},{key:"payment",label:"Payment (Cr)",align:"right",width:"120px",sortable:!0,render:t=>t.payment>0?e.jsx("span",{className:"font-data font-bold text-xs text-rose-600 dar
41k:text-rose-400",children:N(t.payment)}):e.jsx("span",{className:"text-muted-foreground text-xs",children:"â"})},{key:"balance",label:"Balance",align:"right",width:"120px",sortable:!0,render:t=>e.jsxs("div",{className:"flex flex-col items-end",children:[e.jsx("span",{className:"font-data font-bold text-xs text-slate-800 dark:text-slate-200",children:Number(t.balance||0).toLocaleString("en-IN")}),t.isEdited&&e.jsx("span",{className:"text-[9px] text-slate-400 font-normal italic",children:"(Edited)"})]})},{key:"actions",label:"ACTIONS",width:"80px",align:"center",render:t=>e.jsxs("div",{className:"flex items-center gap-1 justify-center",onClick:r=>r.stopPropagation(),children:[e.jsx("button",{type:"button",onClick:()=>{E({id:t.id,voucherNo:t.invoiceNo||`VCH-2026-${t.id.slice(-4).toUpperCase()}`,date:t.date,category:t.category||"General Cash",subCategory:t.subCategory||"Petty Cash",description:t.description||"Cash payment disbursement",amount:Number(t.payment||t.receipt||0),paidTo:t.assignTo||t.party||"Staff Member",givenBy:t.givenBy||"Pawandeep Kaur (CFO)",batchNo:t.floatBatchId||(P[0]?.batchNo??"FLOAT-2026-001"),status:t.verificationStatus||"Audited",voucherType:t.payment>0?"Debit Voucher / Cash Out":"Credit Voucher / Cash In"})},className:"p-1 rounded hover:bg-blue-50 dark:hover:bg-blue-950/40 text-slate-500 hover:text-blue-600 transition-colors cursor-pointer",title:"Generate & Print Official Cash Voucher",children:e.jsx(Q,{className:"w-3.5 h-3.5"})}),e.jsx(U,{to:`${o}/cash-book/new?id=${t.id}`,className:"p-1 rounded hover:bg-slate-100 dark:hover:bg-slate-800 text-slate-600 dark:text-slate-400 transition-colors cursor-pointer",title:"Edit Cash Entry",children:e.jsx(Qe,{className:"w-3.5 h-3.5"})}),e.jsx("button",{type:"button",onClick:async()=>{if(confirm(`Delete cash entry: "${t.description}"?`))try{await w(t.id).unwrap(),k.success("Cash entry deleted"),i()}catch{k.error("Failed to delete entry")}},className:"p-1 rounded hover:bg-rose-50 text-slate-400 hover:text-rose-600 transition-colors cursor-pointer",title:"Delete",children:e.jsx(ke,{className:"w-3.5 h-3.5"})})]})}]})}),B&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4 animate-in fade-in duration-150",children:e.jsxs("div",{className:"w-full max-w-md bg-white dark:bg-slate-900 rounded-xl border border-slate-200 dark:border-slate-800 p-5 shadow-2xl space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-slate-100 dark:border-slate-800 pb-2.5",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-xs font-bold text-slate-900 dark:text-slate-100",children:"Voucher / Paper Slip Note"}),e.jsxs("p",{className:"text-[11px] text-slate-400",children:[B.description," ⢠â¹",Number(B.amount||0).toLocaleString("en-IN")]})]}),e.jsx("button",{type:"button",onClick:()=>L(null),className:"text-slate-400 hover:text-slate-600 cursor-pointer",children:e.jsx(z,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"p-4 bg-slate-50 dark:bg-slate-950 rounded-lg border border-slate-200 dark:border-slate-800 flex flex-col items-center justify-center min-h-[180px]",children:B.url?e.jsx("img",{src:B.url,alt:"Voucher Bill Attachment",className:"max-h-[300px] object-contain rounded"}):e.jsxs("div",{className:"text-center space-y-2",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-amber-50 text-amber-600 flex items-center justify-center mx-auto",children:e.jsx(pe,{className:"w-5 h-5"})}),e.jsx("span",{className:"font-bold text-slate-700 dark:text-slate-300 block text-xs",children:"Handwritten Diary Note / Slip"}),e.jsxs("p",{className:"text-[11px] text-slate-400 max-w-xs italic",children:['"',B.description,'"']})]})}),e.jsx("div",{className:"flex justify-end",children:e.jsx("button",{type:"button",onClick:()=>L(null),className:"h-8 px-4 rounded bg-slate-900 text-white text-xs font-semibold cursor-pointer",children:"Close"})})]})}),R&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4 animate-in fade-in duration-150 overflow-y-auto",children:e.jsxs("div",{className:"w-full max-w-3xl bg-white dark:bg-slate-900 rounded-xl border border-slate-200 dark:border-slate-800 p-5 shadow-2xl space-y-4 my-8 max-h-[92vh] overflow-y-auto",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-slate-100 dar
41k:border-slate-800 pb-2.5 print:hidden",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Q,{className:"w-4 h-4 text-blue-600"}),e.jsx("span",{className:"text-xs font-bold text-slate-900 dark:text-slate-100",children:"Official Petty Cash Payment Voucher Slip"}),e.jsxs("span",{className:"text-[10px] text-slate-400 font-mono",children:["#",R.voucherNo]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{type:"button",onClick:()=>window.print(),className:"h-7 px-3 rounded bg-blue-600 hover:bg-blue-700 text-white text-xs font-bold shadow-2xs inline-flex items-center gap-1 cursor-pointer",children:[e.jsx(Q,{className:"w-3 h-3"})," Print Voucher"]}),e.jsx("button",{type:"button",onClick:()=>E(null),className:"text-slate-400 hover:text-slate-600 cursor-pointer p-1",children:e.jsx(z,{className:"w-4 h-4"})})]})]}),e.jsx(ge,{voucher:R,companyName:T})]})})]})}export{Nt as CashBookPage};
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.