"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[78303],{30989:(e,s,t)=>{t.d(s,{l:()=>r});var a=t(95155),l=t(30313);let i={PAID:"text-emerald-700",PARTIAL:"text-amber-700",UNPAID:"text-rose-700"},n={CASH:"Cash",BANK:"Bank transfer",ESEWA:"eSewa",CARD:"Card",OTHER:"Other"};function d(e){return Number(e||0).toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:2})}function r({data:e,studentLabel:s}){let t=s||[e.student.fullName,e.student.studentCode,e.schoolClass.displayName,e.academicYear.name].filter(Boolean).join(" \xb7 ");return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(l.jQ,{items:[{label:"Assigned",value:d(e.totals.totalAssigned)},{label:"Paid",value:d(e.totals.totalPaid)},{label:"Due",value:d(e.totals.totalDue)}]}),(0,a.jsxs)("div",{className:"overflow-hidden rounded-lg border border-slate-100 bg-white shadow-sm",children:[(0,a.jsx)("div",{className:"border-b border-slate-100 bg-slate-50/80 px-4 py-3 text-sm text-slate-600 sm:px-5",children:t}),e.lines.length?(0,a.jsx)("ul",{className:"divide-y divide-slate-100",children:e.lines.map(e=>(0,a.jsxs)("li",{className:"flex flex-wrap items-center justify-between gap-3 px-4 py-3 text-sm sm:px-5",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-slate-900",children:e.feesMaster.feesType?.name||"Fee"}),(0,a.jsxs)("p",{className:"text-xs text-slate-500",children:["Assigned ",d(e.assignedAmount)," \xb7 Paid ",d(e.paidAmount)]})]}),(0,a.jsxs)("div",{className:"text-right",children:[(0,a.jsx)("p",{className:"font-semibold tabular-nums text-slate-900",children:d(e.dueAmount)}),(0,a.jsx)("p",{className:`text-xs font-medium ${i[e.status]||"text-slate-500"}`,children:e.status})]})]},e.feesMaster.id))}):(0,a.jsx)("div",{className:"p-6",children:(0,a.jsx)(l.i0,{title:"No fee lines",description:"Fee types for this class have not been set up yet."})})]}),e.payments?.length?(0,a.jsxs)("section",{className:"overflow-hidden rounded-lg border border-slate-100 bg-white shadow-sm",children:[(0,a.jsxs)("div",{className:"border-b border-slate-100 px-4 py-3 sm:px-5",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-slate-900",children:"Payment history"}),(0,a.jsx)("p",{className:"mt-0.5 text-xs text-slate-500",children:"Receipts recorded by the school office"})]}),(0,a.jsx)("ul",{className:"divide-y divide-slate-100",children:e.payments.map(e=>(0,a.jsxs)("li",{className:"flex flex-wrap items-center justify-between gap-3 px-4 py-3 text-sm sm:px-5",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-slate-900",children:e.receiptNo||"Receipt"}),(0,a.jsxs)("p",{className:"text-xs text-slate-500",children:[e.paymentDate||"—",e.notes?` \xb7 ${e.notes}`:""]})]}),(0,a.jsxs)("div",{className:"text-right",children:[(0,a.jsx)("p",{className:"font-semibold tabular-nums text-slate-900",children:d(e.totalAmount)}),(0,a.jsx)("p",{className:"text-xs text-slate-500",children:n[e.method]||e.method})]})]},e.id))})]}):null]})}},78303:(e,s,t)=>{t.r(s),t.d(s,{default:()=>c});var a=t(95155),l=t(12115),i=t(30571),n=t(30313),d=t(30989),r=t(75560),o=t(2581);function c(){let[e,s]=(0,l.useState)(null),[t,c]=(0,l.useState)(!0);return(0,l.useEffect)(()=>{let e=!1;return(0,r.ZZ)().then(t=>{e||s(t)}).catch(s=>{e||(0,o.Qg)(s instanceof Error?s.message:"Failed to load fees")}).finally(()=>{e||c(!1)}),()=>{e=!0}},[]),(0,a.jsx)(i.o,{title:"Fees",description:"Your assigned fees, payments, and remaining dues.",children:t?(0,a.jsx)("div",{className:"h-40 animate-pulse rounded-lg bg-slate-100"}):e?(0,a.jsx)(d.l,{data:e}):(0,a.jsx)(n.i0,{title:"No fee records",description:"Your school has not assigned fees to your class yet."})})}}}]);