"use strict";exports.id=63991,exports.ids=[63991],exports.modules={14647:(a,b,c)=>{c.d(b,{B:()=>e,J:()=>f});var d=c(48249);function e({disabled:a}){return(0,d.jsx)("button",{type:"button",disabled:a,onClick:()=>window.print(),className:"inline-flex min-h-[40px] items-center justify-center rounded-md bg-primary-700 px-4 py-2 text-sm font-medium text-white hover:bg-primary-800 disabled:opacity-50 print:hidden",children:"Print / Save PDF"})}function f({letterhead:a,title:b,subtitle:c,meta:f,children:g,actions:h}){return(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center justify-end gap-2 print:hidden",children:[h,(0,d.jsx)(e,{})]}),(0,d.jsxs)("div",{id:"sms-print-report",className:"overflow-hidden rounded-lg border border-slate-200 bg-white shadow-sm print:border-0 print:shadow-none",children:[(0,d.jsxs)("div",{className:"border-b border-slate-200 bg-slate-50 px-5 py-5 text-center sm:px-8",children:[(0,d.jsx)("p",{className:"text-xl font-bold tracking-tight text-slate-900 sm:text-2xl",children:a?.academyName||"School"}),a?.tagline?(0,d.jsx)("p",{className:"mt-1 text-sm text-slate-500",children:a.tagline}):null,(0,d.jsx)("p",{className:"mt-3 text-base font-semibold uppercase tracking-wide text-slate-800",children:b}),c?(0,d.jsx)("p",{className:"mt-1 text-sm text-slate-600",children:c}):null,f?(0,d.jsx)("p",{className:"mt-1 text-xs text-slate-500",children:f}):null]}),(0,d.jsx)("div",{className:"px-4 py-5 sm:px-8 sm:py-6",children:g}),(0,d.jsx)("div",{className:"border-t border-slate-100 px-5 py-4 text-xs text-slate-400 sm:px-8",children:"Generated for school records \xb7 Use Print / Save PDF for a paper copy"})]}),(0,d.jsx)("style",{children:`
        @media print {
          body * { visibility: hidden !important; }
          #sms-print-report, #sms-print-report * { visibility: visible !important; }
          #sms-print-report {
            position: absolute;
            left: 0;
            top: 0;
            width: 100%;
            border: none !important;
            box-shadow: none !important;
          }
        }
      `})]})}},17319:(a,b,c)=>{c.d(b,{R:()=>j});var d=c(48249),e=c(60932),f=c(40433),g=c(14113),h=c(17060);let i=[{href:f.bw.SMS_ADMIN.FEES_GROUPS,label:"Groups",match:a=>a.startsWith(f.bw.SMS_ADMIN.FEES_GROUPS)},{href:f.bw.SMS_ADMIN.FEES_TYPES,label:"Types",match:a=>a.startsWith(f.bw.SMS_ADMIN.FEES_TYPES)},{href:f.bw.SMS_ADMIN.FEES_MASTER,label:"Master",match:a=>a.startsWith(f.bw.SMS_ADMIN.FEES_MASTER)},{href:f.bw.SMS_ADMIN.COLLECT_FEES,label:"Collect",match:a=>a.startsWith(f.bw.SMS_ADMIN.COLLECT_FEES)},{href:f.bw.SMS_ADMIN.FEES_PAYMENTS,label:"Payments",match:a=>a.startsWith(f.bw.SMS_ADMIN.FEES_PAYMENTS)},{href:f.bw.SMS_ADMIN.FEES_STATEMENT,label:"Statement",match:a=>a.startsWith(f.bw.SMS_ADMIN.FEES_STATEMENT)}];function j(){let a=(0,h.sK)()??"";return(0,d.jsx)("nav",{className:"flex gap-1 overflow-x-auto rounded-lg border border-slate-200 bg-slate-50/80 p-1 scrollbar-none","aria-label":"Fees collection sections",children:i.map(b=>{let c=b.match(a);return(0,d.jsx)(e.u,{href:b.href,className:(0,g.xW)("inline-flex shrink-0 items-center gap-1.5 rounded-md px-3 py-2 text-sm font-medium transition-all duration-200 ease-out motion-reduce:transition-none",c?"bg-white text-primary-800 shadow-sm ring-1 ring-slate-200/80":"text-slate-600 hover:bg-white hover:text-slate-900 hover:shadow-sm"),"aria-current":c?"page":void 0,children:b.label},b.href)})})}},63991:(a,b,c)=>{c.r(b),c.d(b,{default:()=>m});var d=c(48249),e=c(67484),f=c(84466),g=c(17319),h=c(14647),i=c(82697),j=c(81152),k=c(91115);let l={CASH:"Cash",BANK:"Bank",ESEWA:"eSewa",CARD:"Card",OTHER:"Other"};function m(){let[a,b]=(0,e.useState)([]),[c,m]=(0,e.useState)(""),[n,o]=(0,e.useState)(""),[p,q]=(0,e.useState)(null),[r,s]=(0,e.useState)(!1),[t,u]=(0,e.useState)(!1);return(0,e.useCallback)(async()=>{if(!n)return void q(null);s(!0);try{q(await (0,j.dN)(n))}catch(a){(0,k.Qg)(a instanceof Error?a.message:"Failed to load statement"),q(null)}finally{s(!1)}},[n]),(0,d.jsxs)("div",{className:"space-y-4 sm:space-y-6",children:[(0,d.jsx)(f.wc,{title:"Fees Statement",description:"Assigned fees, dues, and payment history — printable for parents and office records."}),(0,d.jsx)(g.R,{}),(0,d.jsxs)(i.r7,{children:[(0,d.jsx)(i.yB,{label:"Search students",className:"min-w-0 flex-1 sm:min-w-[14rem]",children:(0,d.jsx)(i.Ew,{value:c,onChange:m,placeholder:"Name, email, or code",ariaLabel:"Search students"})}),(0,d.jsx)(i.yB,{label:"Student",className:"min-w-0 flex-1 sm:min-w-[14rem]",children:(0,d.jsxs)(i.Kd,{value:n,onChange:a=>o(a.target.value),children:[(0,d.jsx)("option",{value:"",children:t?"Searching…":"Select student"}),a.map(a=>(0,d.jsxs)("option",{value:a.userId,children:[a.user?.fullName||a.userId,a.schoolClass?` \xb7 ${a.schoolClass.displayName}`:""]},a.userId))]})})]}),n?r?(0,d.jsx)(i.nI,{rows:4}):p?(0,d.jsxs)(h.J,{title:"Fees statement",subtitle:`${p.student.fullName} \xb7 ${p.schoolClass.displayName}`,meta:`${p.academicYear.name}${p.student.studentCode?` \xb7 ${p.student.studentCode}`:""}${p.student.rollNumber?` \xb7 Roll ${p.student.rollNumber}`:""}`,children:[(0,d.jsxs)("div",{className:"mb-5 grid grid-cols-3 gap-3 text-center text-sm",children:[(0,d.jsxs)("div",{className:"rounded-lg border border-slate-100 bg-slate-50 p-3",children:[(0,d.jsx)("p",{className:"text-xs uppercase text-slate-500",children:"Assigned"}),(0,d.jsx)("p",{className:"text-lg font-semibold tabular-nums",children:p.totals.totalAssigned})]}),(0,d.jsxs)("div",{className:"rounded-lg border border-slate-100 bg-slate-50 p-3",children:[(0,d.jsx)("p",{className:"text-xs uppercase text-slate-500",children:"Paid"}),(0,d.jsx)("p",{className:"text-lg font-semibold tabular-nums",children:p.totals.totalPaid})]}),(0,d.jsxs)("div",{className:"rounded-lg border border-slate-100 bg-slate-50 p-3",children:[(0,d.jsx)("p",{className:"text-xs uppercase text-slate-500",children:"Due"}),(0,d.jsx)("p",{className:"text-lg font-semibold tabular-nums",children:p.totals.totalDue})]})]}),(0,d.jsx)("h2",{className:"mb-2 text-sm font-semibold text-slate-900",children:"Fee lines"}),(0,d.jsx)(i.T7,{className:"hidden lg:block print:block",children:(0,d.jsxs)(i.cR,{minWidth:"36rem",children:[(0,d.jsx)(i.K_,{children:(0,d.jsxs)("tr",{children:[(0,d.jsx)("th",{className:`${i.aB} font-medium`,children:"Fee"}),(0,d.jsx)("th",{className:`${i.aB} font-medium`,children:"Assigned"}),(0,d.jsx)("th",{className:`${i.aB} font-medium`,children:"Paid"}),(0,d.jsx)("th",{className:`${i.aB} font-medium`,children:"Due"}),(0,d.jsx)("th",{className:`${i.aB} font-medium`,children:"Status"})]})}),(0,d.jsx)("tbody",{children:p.lines.length?p.lines.map(a=>(0,d.jsxs)("tr",{className:"border-t border-slate-100",children:[(0,d.jsx)("td",{className:`${i.Cl} font-medium text-slate-900`,children:a.feesMaster.feesType?.name}),(0,d.jsx)("td",{className:`${i.Cl} text-slate-600`,children:a.assignedAmount}),(0,d.jsx)("td",{className:`${i.Cl} text-slate-600`,children:a.paidAmount}),(0,d.jsx)("td",{className:`${i.Cl} text-slate-600`,children:a.dueAmount}),(0,d.jsx)("td",{className:`${i.Cl} text-slate-700`,children:a.status})]},a.feesMaster.id)):(0,d.jsx)("tr",{children:(0,d.jsx)("td",{colSpan:5,className:`${i.Cl} text-center text-slate-500`,children:"No fees assigned to this class."})})})]})}),(0,d.jsx)(i.yg,{className:"rounded-lg border border-slate-100 print:hidden",children:p.lines.length?p.lines.map(a=>(0,d.jsxs)(i.oe,{children:[(0,d.jsx)("p",{className:"font-semibold text-slate-900",children:a.feesMaster.feesType?.name}),(0,d.jsx)(i._w,{label:"Assigned",children:a.assignedAmount}),(0,d.jsx)(i._w,{label:"Paid",children:a.paidAmount}),(0,d.jsx)(i._w,{label:"Due",children:a.dueAmount}),(0,d.jsx)(i._w,{label:"Status",children:a.status})]},a.feesMaster.id)):(0,d.jsx)(i.oe,{children:(0,d.jsx)("p",{className:"text-sm text-slate-500",children:"No fees assigned to this class."})})}),(0,d.jsx)("h2",{className:"mb-2 mt-6 text-sm font-semibold text-slate-900",children:"Payment history"}),(0,d.jsx)(i.T7,{className:"hidden lg:block print:block",children:(0,d.jsxs)(i.cR,{minWidth:"36rem",children:[(0,d.jsx)(i.K_,{children:(0,d.jsxs)("tr",{children:[(0,d.jsx)("th",{className:`${i.aB} font-medium`,children:"Receipt"}),(0,d.jsx)("th",{className:`${i.aB} font-medium`,children:"Date"}),(0,d.jsx)("th",{className:`${i.aB} font-medium`,children:"Amount"}),(0,d.jsx)("th",{className:`${i.aB} font-medium`,children:"Method"})]})}),(0,d.jsx)("tbody",{children:p.payments.length?p.payments.map(a=>(0,d.jsxs)("tr",{className:"border-t border-slate-100",children:[(0,d.jsx)("td",{className:`${i.Cl} font-medium text-slate-900`,children:a.receiptNo||"—"}),(0,d.jsx)("td",{className:`${i.Cl} text-slate-600`,children:a.paymentDate||"—"}),(0,d.jsx)("td",{className:`${i.Cl} text-slate-700`,children:a.totalAmount}),(0,d.jsx)("td",{className:`${i.Cl} text-slate-600`,children:l[a.method]||a.method})]},a.id)):(0,d.jsx)("tr",{children:(0,d.jsx)("td",{colSpan:4,className:`${i.Cl} text-center text-slate-500`,children:"No payments yet."})})})]})}),(0,d.jsx)(i.yg,{className:"rounded-lg border border-slate-100 print:hidden",children:p.payments.length?p.payments.map(a=>(0,d.jsxs)(i.oe,{children:[(0,d.jsx)("p",{className:"font-semibold text-slate-900",children:a.receiptNo||"Receipt"}),(0,d.jsx)(i._w,{label:"Date",children:a.paymentDate||"—"}),(0,d.jsx)(i._w,{label:"Amount",children:a.totalAmount}),(0,d.jsx)(i._w,{label:"Method",children:l[a.method]||a.method})]},a.id)):(0,d.jsx)(i.oe,{children:(0,d.jsx)("p",{className:"text-sm text-slate-500",children:"No payments yet."})})})]}):null:(0,d.jsx)(i.i0,{title:"Select a student",description:"Search and choose a student to view their fees statement."})]})}}};