PageSourceSearch

https://www.hajurbuwa.com/_next/static/chunks/pages/account/finance/[section]-bc1f19d818942763.js

js hajurbuwa.com collected 2026-10-02 01:31:55 UTC 7,246 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6969],{6382:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/account/finance/[section]",function(){return s(4039)}])},4039:function(e,t,s){"use strict";s.r(t);var a=s(5893),n=s(7294),l=s(1664),c=s.n(l),r=s(1163),i=s(3636),o=s(9558),d=s(416),x=s(5773),u=s(4357);let m={invoices:u.sA,payments:u._P,adjustments:u.QJ},p="rounded-xl border border-backgroundColor bg-white p-4";function h(e){let{invoice:t}=e,s=t.balance_due>0,n="overdue"===t.status?"text-errorColor":s?"text-black":"text-success-primary";return(0,a.jsxs)(c(),{href:"/account/finance/invoice/".concat(t.id),className:"".concat(p," block hover:bg-backgroundLightColor"),children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"flex-1 text-sm font-bold text-black",children:t.invoice_number}),(0,a.jsx)("span",{className:"font-bold tabular-nums ".concat(n),children:(0,x.rs)(t.total_amount)})]}),(0,a.jsxs)("div",{className:"mt-1 flex items-center gap-2 text-xs",children:[(0,a.jsxs)("span",{className:"flex-1 text-grey",children:[(0,x.v0)(t.invoice_date)," \xb7 Due ",(0,x.v0)(t.due_date)]}),(0,a.jsx)("span",{className:"tabular-nums ".concat(n),children:s?"Balance due ".concat((0,x.rs)(t.balance_due)):(0,x.Cf)(t.status)})]})]})}function b(e){var t;let{payment:s}=e;return(0,a.jsxs)("div",{className:p,children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"flex-1 text-sm font-bold text-black",children:s.payment_number}),(0,a.jsx)("span",{className:"font-bold tabular-nums text-success-primary",children:(0,x.rs)(s.amount)})]}),(0,a.jsxs)("div",{className:"mt-1 text-xs text-grey",children:[(0,x.v0)(s.payment_date),s.method?" \xb7 ".concat((0,x.Y)(s.method)):"",(null===(t=s.invoices)||void 0===t?void 0:t.length)?" \xb7 ".concat(s.invoices.join(", ")):""]})]})}function f(e){let{adjustment:t}=e,s="debit"===t.direction;return(0,a.jsxs)("div",{className:p,children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"flex-1 text-sm font-bold capitalize text-black",children:(0,x.rl)(t.type)}),(0,a.jsxs)("span",{className:"font-bold tabular-nums ".concat(s?"text-black":"text-success-primary"),children:[s?"+":"−",(0,x.rs)(t.amount)]})]}),(0,a.jsxs)("div",{className:"mt-1 text-xs text-grey",children:[(0,x.v0)(t.effective_date)," \xb7 ",t.adjustment_number,t.reason?" \xb7 ".concat((0,x.rl)(t.reason)):"","reversed"===t.status?" \xb7 Reversed":""]})]})}function v(e){let{data:t,showOpening:s}=e,n=null==t?void 0:t.summary,l=function(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"text-black";return(0,a.jsxs)("div",{className:"flex gap-2 text-xs",children:[(0,a.jsx)("span",{className:"flex-1 text-grey",children:e}),(0,a.jsx)("span",{className:"tabular-nums ".concat(s),children:(0,x.rs)(t)})]})};return(0,a.jsxs)("div",{className:"".concat(p," space-y-1"),children:[s&&l("Opening balance",null==n?void 0:n.opening_balance),l("Total invoiced",null==n?void 0:n.total_invoices),l("Total paid",null==n?void 0:n.total_payments,"text-success-primary"),(null==n?void 0:n.total_adjustments)?l("Adjustments",n.total_adjustments):null,(0,a.jsxs)("div",{className:"flex gap-2 pt-1 text-sm font-bold text-black",children:[(0,a.jsx)("span",{className:"flex-1",children:"Closing balance"}),(0,a.jsx)("span",{className:"tabular-nums",children:(0,x.rs)(null==n?void 0:n.closing_balance)})]})]})}function y(e){var t,s;let{entry:n}=e,l=n.credit>0;return(0,a.jsxs)("div",{className:p,children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"flex-1 truncate text-sm text-black",children:null!==(s=null!==(t=n.reference_number)&&void 0!==t?t:n.description)&&void 0!==s?s:(0,x.rl)(n.entry_type)}),(0,a.jsxs)("span",{className:"text-sm font-semibold tabular-nums ".concat(l?"text-success-primary":"text-black"),children:[l?"−":"+",(0,x.rs)(l?n.credit:n.debit)]})]}),(0,a.jsxs)("div",{className:"mt-1 flex gap-2 text-xs text-grey",children:[(0,a.jsx)("span",{className:"flex-1",children:(0,x.v0)(n.created_at)}),(0,a.jsxs)("span",{className:"tabular-nums",children:["Balance ",(0,x.rs)(n.balance_after)]})]})]})}t.default=(0,o.Z)(function(e){var t,s,l;let o,{access:p,initialiseBase:j}=e,g=(0,r.useRouter)(),N=Array.isArray(g.query.section)?g.query.section[0]:g.query.section,_=(0,x.M7)(N),k=null==_?void 0:_.key,w="ledger"===k||"statements"===k,[C,T]=(0,n.use
1State)(3),[L,S]=(0,n.useState)(null),[E,P]=(0,n.useState)(null),[A,O]=(0,n.useState)(!0),[R,q]=(0,n.useState)(!1),[G,Z]=(0,n.useState)(!1);(0,n.useEffect)(()=>{if(g.isReady){if(j(),!k)return O(!1);O(!0),Z(!1),(w?(0,u.yb)("statements"===k?(0,x.Dn)(C):void 0).then(P):m[k](1).then(e=>S(e))).catch(()=>Z(!0)).finally(()=>O(!1))}},[g.isReady,k,C]);let B=null!==(t=null==_?void 0:_.label)&&void 0!==t?t:"Finance",D=null!==(s=null==L?void 0:L.items)&&void 0!==s?s:[],F=null!==(l=null==E?void 0:E.entries)&&void 0!==l?l:[];return o=_?A?null:G?(0,a.jsx)("p",{className:"py-12 text-center text-grey",children:p.accessGranted?"Could not load this section. Try again later.":"Sign in to see your finance records."}):w?(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)(v,{data:E,showOpening:"statements"===k}),0===F.length?(0,a.jsx)("p",{className:"py-8 text-center text-grey",children:"No entries for this period."}):F.map(e=>(0,a.jsx)(y,{entry:e},e.id))]}):D.length?(0,a.jsxs)("div",{className:"space-y-3",children:[D.map(e=>"invoices"===k?(0,a.jsx)(h,{invoice:e},e.id):"payments"===k?(0,a.jsx)(b,{payment:e},e.id):(0,a.jsx)(f,{adjustment:e},e.id)),L&&L.page<L.lastPage&&(0,a.jsx)("button",{type:"button",onClick:()=>{L&&!w&&k&&(q(!0),m[k](L.page+1).then(e=>S({...e,items:[...L.items,...e.items]})).catch(()=>{}).finally(()=>q(!1)))},disabled:R,className:"mx-auto block rounded-full border border-gray-300 px-5 py-2 text-sm font-semibold hover:text-primary disabled:opacity-50",children:R?"Loading…":"Load more"})]}):(0,a.jsxs)("p",{className:"py-12 text-center text-grey",children:["No ",B.toLowerCase()," yet."]}):(0,a.jsx)("p",{className:"py-12 text-center text-grey",children:"This section does not exist."}),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.Z,{type:"page",name:B,path:"/account/finance/".concat(null!=N?N:""),noindex:!0}),(0,a.jsx)(i.Z,{backTitle:B,wholePageLoader:A,accessGranted:p.accessGranted,children:(0,a.jsxs)("div",{className:"mx-auto w-full max-w-3xl py-4",children:[(0,a.jsx)("div",{className:"mb-4 flex gap-2 overflow-x-auto pb-1",children:x.Tr.map(e=>(0,a.jsx)(c(),{href:"/account/finance/".concat(e.key),className:"shrink-0 rounded-full px-4 py-2 text-sm font-semibold ".concat(e.key===k?"bg-primary text-white":"bg-box text-black hover:bg-backgroundColor"),children:e.label},e.key))}),"statements"===k&&(0,a.jsx)("div",{className:"mb-4 flex gap-2",children:[3,6,12].map(e=>(0,a.jsxs)("button",{type:"button",onClick:()=>T(e),className:"rounded-full px-3 py-1.5 text-xs font-semibold ".concat(e===C?"bg-secondaryColorLight text-secondaryColor":"bg-box text-grey"),children:["Last ",e," months"]},e))}),o]})})]})})}},function(e){e.O(0,[4838,3365,6660,5675,999,8738,3636,2474,2888,9774,179],function(){return e(e.s=6382)}),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.