PageSourceSearch

https://app.getcount.com/static/js/2802.cb24658d.chunk.js

js getcount.com collected 2026-10-05 04:10:32 UTC 40,618 bytes, 5 lines download raw bytes

1"use strict";
2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="ed98c52b-26d3-5a71-a280-1110b68e7225")}catch(e){}}();
3(self.rspackChunkcount_app=self.rspackChunkcount_app||[]).push([[2802],{26684(e,t,l){e.exports=l.p+"static/media/count-logo.9b91e071.png"},67294(e,t,l){l.d(t,{},{d:e=>!!(null==e?void 0:e.defaultAccountingWS)&&!(null==e?void 0:e.userTimerLoading)})},53455(e,t,l){l.d(t,{A:()=>r});var n=l(74848),a=l(96540),s=l(43403);let i=e=>{let{sign:t,value:l,reverse:a=!1}=e,i="%"==t,r="number"==typeof l?l:parseFloat(l),o=Number.isFinite(r)?r:0;return(0,n.jsxs)("p",{children:[!i&&(o>=0?t:"-".concat(t)),i&&(o>=0?"":"-"),i?Math.abs(o).toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:0}):(0,s.hRT)(Math.abs(o)),i&&t]})},r=e=>{let{price:t,label:l,color:s="",sign:r=""}=e,o=(0,a.useRef)(null),[c,d]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{o.current&&d(o.current.scrollWidth>o.current.clientWidth)},[]),(0,n.jsxs)("div",{ref:o,className:"flex flex-col gap-2",children:[(0,n.jsx)("p",{className:"font-medium",children:l}),(0,n.jsx)("p",{className:"font-semibold ".concat(s||"text-[#101828]","   ").concat(c?"text-[1.25rem]":"text-[1.75rem]"),children:(0,n.jsx)(i,{value:t,sign:r||"$"})})]})}},435(e,t,l){l.r(t),l.d(t,{default:()=>eu});var n=l(71893),a=l(55456),s=l(74848),i=l(96540),r=l(37470),o=l(79723),c=l(12664),d=l(47767),u=l(84976),p=l(71468),x=l(19145),h=l(34901),m=l(61936),g=l(59075),v=l(20416),f=l(9486),b=l(45118),j=l(53455),y=l(24431),C=l(11849),N=l(5448),D=l(43403),w=l(66618),k=l(70721),S=l(90053),T=l(75314),L=l(68501),E=l(95653),F=l(44887),A=l(69026),B=l(848),M=l(19157),R=l(27401),I=l(22040),O=l(63631),W=l(95093),V=l.n(W),_=l(32363);let P="generalLedgerReport",U=function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return String(null!=(e=null==t?void 0:t.accountId)?e:"").includes("synthetic")},Y=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,l=Array.from(new Set((e||[]).map(Number).filter(e=>Number.isInteger(e)&&e>0)));return 0===l.length||t>0&&l.length>=t||l.length>500?[]:l},G=(e,t)=>(0,D.oce)(e,!1,t),H=(e,t)=>{let l=Number(e);if(null==e||!Number.isFinite(l))return"\u2014";if(0!==l&&.005>Math.abs(l)){let e=t||"$";return"".concat(l<0?"-":"").concat(e,"0.01 or less")}return(0,D.oce)(e,!1,t)},K=(e,t)=>null==e||0===Number(e)?"\u2014":(0,D.oce)(e,!1,t),z=(e,t)=>e&&V()(e).isValid()?V()(e).format("dd/mm/yyyy"===t?"DD/MM/YYYY":"MM/DD/YYYY"):"\u2014",Z=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=null==e?void 0:e.sourceDocumentUrl;if(!t)return null;try{let e=new URL(t,window.location.origin),l=Number(e.searchParams.get("id"));return Number.isInteger(l)&&l>0?l:null}catch(e){return null}},Q=[{key:"date",label:"Date",align:"text-left"},{key:"description",label:"Description",align:"text-left"},{key:"contra",label:"Contra Account",align:"text-left"},{key:"debit",label:"Debit",align:"text-right"},{key:"credit",label:"Credit",align:"text-right"},{key:"balance",label:"Balance",align:"text-right"}],$=Q.length,q="px-4 py-2 align-top text-right whitespace-nowrap tabular-nums text-slate-700",J="px-4 py-2 text-right whitespace-nowrap tabular-nums",X=(e,t)=>{var l,n;return"".concat(null!=(l=null==e?void 0:e.accountId)?l:"acct",":").concat(null!=(n=null==e?void 0:e.accountCode)?n:"",":").concat(t)},ee=()=>(0,s.jsx)("span",{className:"text-slate-500",children:"\u2014"}),et={transaction:"transaction",invoice:"invoice",bill:"bill",journal:"journal"},el=e=>{let{entry:t,currencySymbol:l}=e,n=null==t?void 0:t.contraAccountDisplay,a=(null==t?void 0:t.contraAccounts)||[];return"-Split-"===n&&a.length>0?(0,s.jsx)("div",{className:"flex flex-col gap-0.5",children:a.map((e,t)=>{var n;return(0,s.jsxs)("div",{className:"flex items-baseline justify-between gap-4",children:[(0,s.jsxs)("span",{children:[(null==e?void 0:e.accountCode)?"".concat(e.accountCode," "):"",null==e?void 0:e.accountName]}),(0,s.jsx)("span",{className:"whitespace-nowrap tabular-nums text-slate-500",children:G(null==e?void 0:e.amount,l)})]},"".concat(null!=(n=null==e?void 0:e.accountId)?n:"leg",":").concat(t))})}):n?(0,s.jsx)("span",{children:n}):(0,s.jsx)(ee,{})},en=e=>{let t,{entry:l,onOpenTransaction:n}=e,a=(null==l?void 0:l.reference)||{},i=(null==l?void 0:l.description)||(null==a?void 0:a.sourceDocumentReference)||((null==(t=(null==l?void 0:l.reference)||{})?void 0:t.sourceDocumentUrl)||(null==t?void 0:t.sourceDocumentType)==="journal"&&(null==l?void 0:l.journalEntryUuid)?"View ".concat(et[null==t?void 0:t.sourceDocumentType]||"document"):"");if(!i)return(0,s.jsx)(ee,{});let r=null==a?void 0:a.sourceDocumentUrl;if(!r)return(null==a?void 0:a.sourceDocumentType)==="journal"&&(null==l?void 0:l.journalEntryUuid)?(0,s.jsx)("button",{type:"button",className:"text-left text-brand-text hover:text-brand-text-hover hover:underline",onClick:e=>{e.stopPropagation(),(e=>{if(!e)return;let t=(0,D.UHV)("/journal-entries?mode=view&journalUuid=".concat(encodeURIComponent(e)));window.open(t,"_blank","noopener,noreferrer")})(l.journalEntryUuid)},children:i}):(0,s.jsx)("span",{children:i});let o=(null==a?void 0:a.sourceDocumentType)==="transaction"?Z(a):null;return(0,s.jsx)("button",{type:"button",className:"text-left text-brand-text hover:text-brand-text-hover hover:underline",onClick:e=>{(e.stopPropagation(),o)?n(o):(0,_.HE)(r)},children:i})};var ea=e=>{let{reportData:t,currencySymbol:l="$",teamDateFormat:r="mm/dd/yyyy",refreshReportInBackgroun
3d:o=null}=e,c=(0,i.useMemo)(()=>(null==t?void 0:t.accounts)||[],[t]),{accessType:d}=(0,p.d4)(e=>e.User),[u,x]=(0,i.useState)({}),h=(0,i.useMemo)(()=>c.map((e,t)=>({account:e,index:t})).filter(e=>{let{account:t}=e;return null==t?void 0:t.hasActivity}).map(e=>{let{account:t,index:l}=e;return X(t,l)}),[c]),m=h.length>0&&h.every(e=>u[e]),[g,v]=(0,i.useState)(!1),[f,b]=(0,i.useState)(null),[j,y]=(0,i.useState)(!1),[C,D]=(0,i.useState)(null),[w,k]=(0,i.useState)("details"),[S,T]=(0,i.useState)(!1),[L,E]=(0,i.useState)(!1);(0,i.useEffect)(()=>(g?B.YH.chat.hide():B.YH.chat.show(),()=>{B.YH.chat.show()}),[g]);let F=e=>{k("details"),b({id:e}),v(!0)},A=async e=>{let t=await (0,N.getSingleTransaction)(null==e?void 0:e.splitParentId);return b(t),t};return(0,s.jsxs)("div",{id:"".concat(P,"-table"),children:[h.length>0?(0,s.jsx)("div",{className:"flex justify-end pb-2",children:(0,s.jsx)("button",{type:"button",onClick:()=>x(m?{}:Object.fromEntries(h.map(e=>[e,!0]))),className:"text-sm font-medium text-brand-text hover:text-brand-text-hover",children:m?"Expand All":"Collapse All"})}):null,(0,s.jsxs)("div",{className:"overflow-x-auto lg:overflow-x-visible",children:[(0,s.jsx)(O.A,{modalOpen:L,setModalOpen:E,transactions:!0,selectedTransaction:f}),(0,s.jsx)(I.A,{isOpen:j,setIsOpen:y,receipt:C}),(null==f?void 0:f.id)?(0,s.jsx)(R.A,{transactionPanelOpen:g,setTransactionPanelOpen:v,transaction:f,setTransaction:b,reloadTransaction:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(null==e?void 0:e.refreshReport)!==!1&&(null==o||o())},accessType:d,setReceiptModalOpen:y,setActiveReceipt:D,currentTab:w,setCurrentTab:k,setFromDropdown:T,fromDropdown:S,findSplitParent:A,loadTransactionFromApi:!0,setTaskModalOpen:E,panelClassName:"report-account-tx-panel !fixed !top-16 !bottom-0 !right-0 !left-auto !z-50"}):null,(0,s.jsxs)("table",{className:"w-full table-auto text-sm",children:[(0,s.jsx)("thead",{children:(0,s.jsx)("tr",{children:Q.map(e=>(0,s.jsx)("th",{className:"sticky top-0 z-10 bg-white px-4 py-2.5 text-[0.6875rem] font-semibold uppercase tracking-wider text-slate-500 shadow-[inset_0_1px_0_theme(colors.slate.200),inset_0_-1px_0_theme(colors.slate.200)] ".concat(e.align),children:e.label},e.key))})}),(0,s.jsx)("tbody",{className:"divide-y divide-slate-100",children:c.map((e,t)=>{var o,c;let d=X(e,t),p=!!(null==e?void 0:e.hasActivity),h=p&&!!u[d],m=(null==e?void 0:e.hasActivity)&&!h&&(null==e?void 0:e.entries)||[],g=null!=(o=null==e||null==(c=e.entries)?void 0:c.length)?o:0,v=(0,s.jsxs)(s.Fragment,{children:[p?(0,s.jsx)(M.D3,{className:"mt-2 shrink-0 text-slate-500 transition-transform ".concat(h?"-rotate-90":"")}):(0,s.jsx)("span",{className:"mt-2 w-2.5 shrink-0","aria-hidden":!0}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-1",children:[(null==e?void 0:e.accountCode)?(0,s.jsx)("span",{className:"text-slate-500 tabular-nums",children:e.accountCode}):null,(0,s.jsx)("span",{className:"font-semibold text-slate-900",children:null==e?void 0:e.accountName}),(null==e?void 0:e.accountStatus)&&"active"!==e.accountStatus&&!U(e)?(0,s.jsx)("span",{className:"rounded-full bg-slate-200/70 px-2 py-0.5 text-[0.6875rem] font-medium capitalize text-slate-600",children:e.accountStatus}):null,h?(0,s.jsxs)("span",{className:"text-xs text-slate-500",children:[g," ",1===g?"entry":"entries"," ","hidden"]}):null]}),(null==e?void 0:e.subTypeName)||(null==e?void 0:e.accountType)?(0,s.jsxs)("p",{className:"mt-0.5 text-xs text-slate-500",children:["Under ",(null==e?void 0:e.subTypeName)||(null==e?void 0:e.accountType)]}):null]})]});return(0,s.jsxs)(i.Fragment,{children:[(0,s.jsx)("tr",{className:"bg-slate-50",children:(0,s.jsx)("td",{className:"border-y border-slate-200 p-0",colSpan:$,children:p?(0,s.jsx)("button",{type:"button",onClick:()=>x(e=>(0,a._)((0,n._)({},e),{[d]:!e[d]})),"aria-expanded":!h,"aria-label":"".concat(h?"Expand":"Collapse"," ").concat((null==e?void 0:e.accountName)||"account"),className:"flex w-full items-start gap-2 px-4 py-3 text-left hover:bg-slate-100",children:v}):(0,s.jsx)("div",{className:"flex items-start gap-2 px-4 py-3",children:v})})}),(0,s.jsxs)("tr",{className:"text-slate-700",children:[(0,s.jsx)("td",{className:"px-4 py-2 font-medium",colSpan:3,children:"Beginning Balance"}),(0,s.jsx)("td",{className:J,children:K(null==e?void 0:e.openingBalanceDebit,l)}),(0,s.jsx)("td",{className:J,children:K(null==e?void 0:e.openingBalanceCredit,l)}),(0,s.jsx)("td",{className:J,children:G(null==e?void 0:e.openingBalance,l)})]}),m.map((n,a)=>(0,s.jsxs)("tr",{className:"hover:bg-[#a0cd85] hover:bg-opacity-5",children:[(0,s.jsx)("td",{className:"px-4 py-2 align-top whitespace-nowrap tabular-nums text-slate-600",children:z(null==n?void 0:n.date,r)}
3),(0,s.jsx)("td",{className:"px-4 py-2 align-top text-left text-slate-700 [overflow-wrap:anywhere]",children:(0,s.jsx)(en,{entry:n,onOpenTransaction:F})}),(0,s.jsx)("td",{className:"px-4 py-2 align-top text-slate-700",children:(0,s.jsx)(el,{entry:n,currencySymbol:l})}),(0,s.jsx)("td",{className:q,children:(null==n?void 0:n.debit)!=null?G(n.debit,l):(0,s.jsx)(ee,{})}),(0,s.jsx)("td",{className:q,children:(null==n?void 0:n.credit)!=null?G(n.credit,l):(0,s.jsx)(ee,{})}),(0,s.jsx)("td",{className:"".concat(q," text-slate-900"),children:G(null==n?void 0:n.runningBalance,l)})]},"".concat(X(e,t),":entry:").concat(a))),(0,s.jsxs)("tr",{className:"border-t border-slate-200 bg-slate-50/60 text-slate-900",children:[(0,s.jsx)("td",{className:"px-4 py-2 font-semibold",colSpan:3,children:"Ending Balance"}),(0,s.jsx)("td",{className:"".concat(J," font-semibold"),children:K(null==e?void 0:e.debitTotal,l)}),(0,s.jsx)("td",{className:"".concat(J," font-semibold"),children:K(null==e?void 0:e.creditTotal,l)}),(0,s.jsx)("td",{className:"".concat(J," font-semibold"),children:G(null==e?void 0:e.closingBalance,l)})]})]},d)})})]})]})]})},es=l(34300);let ei=e=>(null!=e?String(e).trim():"")||"-";function er(e){let{teamName:t="",rangeLabel:l="",currencyLabel:i="",currencySymbol:r="$",dateFormat:o="",reportData:c=null}=e,d=(null==c?void 0:c.accounts)||[],u=(null==c?void 0:c.totals)||{},p={fontSize:(0,C.gK)(6)},x=e=>(0,D.oce)(e||0,!1,r),h=e=>{let t=parseFloat(null!=e?e:0);return Number.isFinite(t)&&0!==t?"".concat(t<0?"-":"").concat(r).concat((0,D.hRT)(Math.abs(t).toFixed(2))):"-"},m=(e,t,l)=>({id:e,header:t,accessor:t=>{var l,n;return null!=(l=null==t||null==(n=t.cells)?void 0:n[e])?l:""},width:l,wrap:!0,textStyle:(0,a._)((0,n._)({},p),{paddingRight:8})}),g=(e,t,l)=>({id:e,header:t,accessor:t=>{var l,n;return null!=(l=null==t||null==(n=t.cells)?void 0:n[e])?l:""},align:"right",width:l,textStyle:p}),v=[m("date","Date","11%"),m("description","Description","30%"),m("contra","Contra Account","24%"),g("debit","Debit","11%"),g("credit","Credit","11%"),g("balance","Balance","13%")],f=v.length,b=[];if(d.forEach((e,t)=>{let l=null==e?void 0:e.accountCode,n=l?"".concat(l," ").concat((null==e?void 0:e.accountName)||""):(null==e?void 0:e.accountName)||"",a=(null==e?void 0:e.subTypeName)||(null==e?void 0:e.accountType)||"";b.push({id:"acct-".concat(t),isGroupHeader:!0,isFirstGroup:0===t,isBold:!0,blankEmptyCells:!0,groupHeaderColSpan:f,groupHeaderWrap:!1,noWrap:!0,cells:{date:a?"".concat(n," \u2014 Under: ").concat(a):n}}),b.push({id:"acct-".concat(t,"-start"),isBold:!0,blankEmptyCells:!0,mergedColSpan:3,noWrap:!0,cells:{date:"Beginning Balance",debit:h(null==e?void 0:e.openingBalanceDebit),credit:h(null==e?void 0:e.openingBalanceCredit),balance:x(null==e?void 0:e.openingBalance)}}),(null==e?void 0:e.hasActivity)&&((null==e?void 0:e.entries)||[]).forEach((e,l)=>{var n;b.push({id:"acct-".concat(t,"-entry-").concat(l),blankEmptyCells:!0,cells:{date:z(null==e?void 0:e.date,o),description:ei((null==e?void 0:e.description)||(null==e||null==(n=e.reference)?void 0:n.sourceDocumentReference)),contra:(e=>{let t=null==e?void 0:e.contraAccountDisplay,l=(null==e?void 0:e.contraAccounts)||[];if("-Split-"!==t)return ei(t);if(0===l.length)return"Split";let n=l.map(e=>"".concat((null==e?void 0:e.accountCode)?"".concat(e.accountCode," "):"").concat((null==e?void 0:e.accountName)||"").trim());return"Split: ".concat(n.join("; "))})(e),debit:(null==e?void 0:e.debit)!=null?x(e.debit):"-",credit:(null==e?void 0:e.credit)!=null?x(e.credit):"-",balance:x(null==e?void 0:e.runningBalance)}})}),b.push({id:"acct-".concat(t,"-end"),isTotal:!0,isBold:!0,blankEmptyCells:!0,mergedColSpan:3,noWrap:!0,cells:{date:"Ending Balance",debit:h(null==e?void 0:e.debitTotal),credit:h(null==e?void 0:e.creditTotal),balance:x(null==e?void 0:e.closingBalance)}})}),d.length>0){var j,y;[["Opening Totals",u.openingDebitTotal,u.openingCreditTotal],["Period Totals",u.periodDebitTotal,u.periodCreditTotal],["Closing Totals",u.closingDebitTotal,u.closingCreditTotal]].forEach(e=>{let[t,l,n]=e;b.push({id:"totals-".concat(t),isTotal:!0,isBold:!0,blankEmptyCells:!0,mergedColSpan:3,noWrap:!0,cells:{date:t,debit:h(l),credit:h(n)}})}),b.push({id:"totals-balance-check",isTotal:!0,isBold:!0,blankEmptyCells:!0,mergedColSpan:f,noWrap:!0,cells:{date:u.isInBalance?"In Balance \xb7 ".concat(null!=(j=u.journalLineCount)?j:0," journal lines \xb7 ").concat(null!=(y=u.accountCount)?y:0," accounts"):"Out of Balance \xb7 Opening net imbalance ".concat(H(u.openingNetTotal,r)," \xb7 Closing net imbalance ").concat(H(u.closingNetTotal,r))}})}let N=(0,T.nj)({name:"General Ledger"}),w=(0,T.Bk)({companyName:t,dateLabel:l,filters:[i]}),k=[];if(b.length<=500)k.push(b);else{let e=[],t=0;b.forEach(l=>{var n;let a,s=(a=(null==(n=l)?void 0:n.cells)||{},(null==n?void 0:n.mergedColSpan)>=3?1:Math.max(1,Math.ceil(String(a.description||"").length/46),Math.ceil(String(a.contra||"").length/38)));e.length>0&&t+s>208&&(k.push(e),e=[],t=0),e.push(l),t+=s}),e.length>0&&k.push(e)}return 0===k.length&&k.push([]),(0,s.jsx)(C.pv,{fontFamily:"Outfit",children:(0,s.jsx)(es.yo,{
3children:k.map((e,t)=>(0,s.jsx)(C.YO,{orientation:"landscape",sectionTitle:0===t?N:"",headerMeta:0===t?w:"",reportTitle:N,footerSectionTitle:N,children:(0,s.jsx)(C.v0,{columns:v,rows:e})},"gl-page-".concat(t)))})})}var eo=l(90930);let ec="inline-flex items-center gap-1.5 rounded-full px-3 py-1 text-sm font-medium",ed=[{label:"Opening",debitKey:"openingDebitTotal",creditKey:"openingCreditTotal"},{label:"Period",debitKey:"periodDebitTotal",creditKey:"periodCreditTotal"},{label:"Closing",debitKey:"closingDebitTotal",creditKey:"closingCreditTotal"}];var eu=function(){var e,t,l,B,M,R,I,O,W;(0,y.Iv)({pageId:P});let V=(0,i.useRef)(),_=(0,i.useRef)(!1),U=(0,i.useRef)(null),K=(0,d.Zp)(),{accessType:Z,permissions:Q}=(0,p.d4)(e=>e.User),{useGetTeam:$}=(0,v.T)(),{data:q}=$(),{currencies:J}=(0,p.d4)(e=>e.Currencies),X=(null==q?void 0:q.currency)||sessionStorage.getItem(D.KBg),ee=(null==q||null==(R=q.defaults)?void 0:R.dateFormat)||sessionStorage.getItem(D.rzo),[et,el]=(0,i.useState)(null),[en,es]=(0,i.useState)(null),[ei,eu]=(0,i.useState)(!1),[ep,ex]=(0,i.useState)(!1),[eh,em]=(0,i.useState)(!1),[eg,ev]=(0,i.useState)(!1),ef=(0,F.A)({subType:"General Ledger",reportName:"General Ledger",saveFn:N.generateGeneralLedgerReport}),[eb,ej]=(0,i.useState)({}),[ey,eC]=(0,i.useState)(!1),[eN,eD]=(0,i.useState)(X),[ew,ek]=(0,i.useState)(!1),[eS,eT]=(0,i.useState)((0,D.QnQ)(X,X)),[eL,eE]=(0,i.useState)(!1),[eF]=(0,u.ok)(),eA=eF.get("startDate"),eB=eF.get("endDate"),eM=eF.get("accounts"),eR=eF.get("includeNilBalanceAccounts"),eI=eF.get("currency"),eO=null!=eI&&""!==String(eI).trim()?String(eI).trim().toUpperCase():null,{t:eW}=(0,S.Bd)(),eV=(0,i.useMemo)(()=>(0,D.RCj)(!1,q,eW),[q,eW]),e_=(0,i.useMemo)(()=>eV.flatMap(e=>e.categories),[eV]),{useAllAccounts:eP}=(0,f.pI)(),{data:eU=[],isLoading:eY}=eP({inactive:!0,showHiddenAccounts:!0}),eG=(0,i.useMemo)(()=>(0,D.TCC)(eU,"allAccounts",void 0,!1,{allowRestrictedAccounts:!0}),[eU]),eH=(null==eU?void 0:eU.length)||0;(0,i.useEffect)(()=>{(null==Q?void 0:Q.length)>0&&!(0,x.Yj)(x.kO.VIEW_REPORTS,Z,Q)&&K("/")},[Z,Q,K]),(0,i.useEffect)(()=>{em(!1)},[]),(0,i.useEffect)(()=>{eY||eO||eD(X)},[eY,eO,X]),(0,i.useEffect)(()=>{var e;if((null==V||null==(e=V.current)?void 0:e.setFieldValue)&&(null==e_?void 0:e_.length)>0&&!eA&&!eB&&!eY){let e=(0,D.L2w)(e_);V.current.setFieldValue("dateRange",null==e?void 0:e.id),V.current.setFieldValue("firstStartDate",null==e?void 0:e.startDate),V.current.setFieldValue("firstEndDate",null==e?void 0:e.endDate)}},[null==V||null==(I=V.current)?void 0:I.setFieldValue,e_,eA,eB,eY]);let eK=(null!=(e=null==et||null==(O=et.accounts)?void 0:O.length)?e:0)>0,ez=async function(){var e,t,l,n,a,s,i,r,o;let c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},u=(null!=(e=null==et||null==(t=et.accounts)?void 0:t.length)?e:0)>0,p=(null==d?void 0:d.showFullLoader)===!0||_.current;u&&!p?ex(!0):(em(!0),eu(!0));try{let e={firstStartDate:c.firstStartDate||eb.firstStartDate,firstEndDate:c.firstEndDate||eb.firstEndDate,accounts:(a=c.accounts,Y(null!=(s=null!=(i=null!=a?a:null==eb?void 0:eb.accounts)?i:null==(o=V.current)||null==(r=o.values)?void 0:r.accounts)?s:[],eH)),includeNilBalanceAccounts:null!=(l=c.includeNilBalanceAccounts)?l:ew,currency:c.currency||eN||X},t={startDate:e.firstStartDate?(0,D.poE)(e.firstStartDate,ee):"",endDate:e.firstEndDate?(0,D.poE)(e.firstEndDate,ee):"",accounts:e.accounts,includeNilBalanceAccounts:e.includeNilBalanceAccounts,currency:(e.currency||"").toString().trim().toUpperCase()},d=await (0,N.generateGeneralLedgerReport)(t);if(!(null==d?void 0:d.data))return;U.current=e,el(d.data),es(d.data.filters||null);let u=(null==(n=d.data.filters)?void 0:n.currency)||X;eT((0,D.QnQ)(u,X)),ef.recordGenerate(t,{startDate:t.startDate,endDate:t.endD
3ate,currency:u,extras:t.includeNilBalanceAccounts?["Including Nil Balances"]:[]})}catch(e){}finally{eu(!1),ex(!1),ev(!1),eC(!1),_.current=!1}},eZ=(0,i.useCallback)(()=>{let e=U.current;(null==e?void 0:e.firstStartDate)&&(null==e?void 0:e.firstEndDate)&&ez((0,a._)((0,n._)({},e),{save:!1}))},[et]);(0,i.useEffect)(()=>{Object.keys(eb).length>0&&ey&&ez({})},[eb,ey]),(0,i.useEffect)(()=>{var e;if((eA||eB)&&!eh&&(null==q?void 0:q.id)&&!eY&&(null==(e=V.current)?void 0:e.setFieldValue)){if(!eA||!eB)return;let e=(0,D.Sf2)(eA,ee),t=(0,D.Sf2)(eB,ee);if(!e||!t)return;let l=eM&&"string"==typeof eM?Array.from(new Set(eM.split(",").map(e=>Number(e.trim())).filter(e=>Number.isInteger(e)&&e>0))):[],n="true"===eR,a=eO||X;V.current.setFieldValue("firstStartDate",e),V.current.setFieldValue("firstEndDate",t),V.current.setFieldValue("dateRange","custom"),V.current.setFieldValue("accounts",l),ek(n),eD(a),ez({firstStartDate:e,firstEndDate:t,accounts:l,includeNilBalanceAccounts:n,currency:a})}},[eA,eB,eM,eR,eO,null==q?void 0:q.id,eY,eh]);let eQ=async e=>{eC(e=>!e),ej(e)},e$=en?(0,eo.fn)(en.startDate,en.endDate,(0,eo.AI)(q)):"",eq=(null==en?void 0:en.currency)||eN||X,eJ=async()=>{var e;if(null==et||null==(e=et.accounts)?void 0:e.length)try{eE(!0),await new Promise(e=>{requestAnimationFrame(()=>setTimeout(e,0))});let e=await (0,C.Nl)((0,s.jsx)(er,{teamName:(null==q?void 0:q.name)||"",rangeLabel:e$,currencyLabel:eq,currencySymbol:eS,dateFormat:ee,reportData:et})),t=(0,T.Qz)({name:"General Ledger",dateLabel:e$,currencyLabel:eq}),l=URL.createObjectURL(e),n=document.createElement("a");n.href=l,n.download=t,document.body.appendChild(n),n.click(),n.remove(),URL.revokeObjectURL(l)}catch(e){r.oR.error("Could not generate the PDF. Please try again.")}finally{eE(!1)}},eX=null==et?void 0:et.totals,e0=(null!=(t=null==en||null==(W=en.accounts)?void 0:W.length)?t:0)>0,e1=!!(null==en?void 0:en.spansFiscalYearBoundary),e6=!!(null==eX?void 0:eX.isInBalance);return(0,s.jsx)("main",{className:"relative grow",children:eY?(0,s.jsxs)("div",{className:"flex flex-col gap-2 items-center pb-2 justify-center mt-8",children:[(0,s.jsxs)("svg",{width:"29",height:"29",viewBox:"0 0 29 29",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"animate-spin w-10 h-10 fill-current shrink-0",children:[(0,s.jsx)("path",{d:"M14.5 2.41699V7.25033",stroke:"#E48642",strokeWidth:"2.55882",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M14.5 21.749V26.5824",stroke:"#E48642",strokeWidth:"2.55882",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M5.95703 5.95703L9.37662 9.37662",stroke:"#E48642",strokeWidth:"1.58955",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M19.623 19.6211L23.0426 23.0407",stroke:"#E48642",strokeWidth:"1.58955",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M2.41699 14.5H7.25033",stroke:"#E48642",strokeWidth:"1.58955",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M21.749 14.5H26.5824",stroke:"#E48642",strokeWidth:"1.58955",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M5.95703 23.0407L9.37662 19.6211",stroke:"#E48642",strokeWidth:"1.58955",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M19.623 9.37662L23.0426 5.95703",stroke:"#E48642",strokeWidth:"1.58955",strokeLinecap:"round",strokeLinejoin:"round"})]}),(0,s.jsx)("p",{className:"text-slate-600 font-medium text-[0.875rem] text-center",children:"Fetching data, please wait..."})]}):(0,s.jsxs)("div",{className:"px-4 sm:px-6 lg:px-8 pt-5 pb-10 w-full max-w-9xl mx-auto flex flex-col gap-5",children:[(0,s.jsxs)("div",{className:"flex gap-5 flex-wrap items-center",children:[(0,s.jsx)("div",{role:"button",tabIndex:0,onClick:()=>K("/reports"),onKeyDown:e=>{"Enter"===e.key&&K("/reports")},className:"cursor-pointer",children:(0,s.jsxs)("svg",{width:"33",height:"32",viewBox:"0 0 33 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("rect",{width:"32",height:"33",transform:"translate(33) rotate(90)",fill:"#FBF3ED"}),(0,s.jsx)("path",{d:"M19 10.5L13 16.5L19 22.5",stroke:"#E48642",strokeWidth:"3.6",strokeLinecap:"round",strokeLinejoin:"round"})]})}),(0,s.jsx)("h1",{className:"text-3xl md:text-4xl text-black opacity-60 font-medium",children:"General Ledger"})]}),(0,s.jsx)("div",{className:"flex py-5 px-7 flex-col gap-1 flex-grow flex-shrink-0 basis-0 rounded-xl border border-[#D0D5DD] bg-white",children:(0,s.jsx)(o.l1,{innerRef:V,initialValues:{firstStartDate:null,firstEndDate:null,accounts:[],dateRange:""},validationSchema:c.Ik({firstStartDate:c.Yj().nullable().required("Please Select Start Date"),firstEndDate:c.Yj().nullable().required("Please Select End Date")}),onSubmit:eg&&eQ,children:e=>(0,s.jsxs)(o.lV,{children:[(0,s.jsx)(h.A,{}),(0,s.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-x-3 gap-y-4 items-start",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsxs)("p",{className:"pb-2",children:["Date Range",(0,s.jsx)("span",{"aria-hidden":"true",className:"text-rose-600 pl-1",children:"*"})]}),(0,s.jsx)("div",{className:"flex flex-wrap gap-3 gap-y-0 w-full",children:(0,s.jsx)("div",{className:"flex flex-wrap gap-y-0 w-full",children:(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)(L.Ay,{required:!0,showNamedPeriods:!0,startDateFilter:e.values.firstStartDate,endD
3ateFilter:e.values.firstEndDate,setStartDateFilter:t=>{e.setFieldValue("firstStartDate",t)},setEndDateFilter:t=>{e.setFieldValue("firstEndDate",t)},onDateChange:()=>{e.setFieldValue("dateRange","custom")},align:"left",report:!0,ids:[P],maxDate:null}),!e.values.firstStartDate&&e.errors.firstStartDate||!e.values.firstEndDate&&e.errors.firstEndDate?(0,s.jsx)("div",{role:"alert",className:"text-xs mt-1 text-rose-600",children:(e.values.firstStartDate?"":e.errors.firstStartDate)||(e.values.firstEndDate?"":e.errors.firstEndDate)}):null]})})})]}),(0,s.jsxs)("div",{className:"contents",children:[(0,s.jsxs)("div",{className:"flex flex-col w-full",children:[(0,s.jsx)("p",{className:"pb-2",children:"Account"}),(0,s.jsx)("div",{children:(0,s.jsx)("div",{className:"flex items-center rounded-[0.313rem] leading-6 h-10 whitespace-nowrap",children:(0,s.jsx)(E.A,{allCategories:eG,selectedCategoryId:e.values.accounts,setSelectedCategoryId:t=>{e.setFieldValue("accounts",t)},getTransactionsApi:()=>{},apiFilter:e.values.accounts,isReset:!0,allAccount:!0,type:"account",report:!0,bottomOfTable:!0,ids:[P]})})})]}),(0,s.jsxs)("div",{className:"col-span-1 flex flex-col",children:[(0,s.jsx)("p",{className:"pb-2",children:"Currency"}),(0,s.jsx)("div",{children:(0,s.jsx)("div",{className:"flex items-center rounded-[0.313rem] leading-6 h-10 whitespace-nowrap w-full",children:(0,s.jsx)(g.A,{selected:eN,setSelected:eD,apiFunc:{},options:Array.isArray(J)?J.map(e=>({label:null==e?void 0:e.name,id:null==e?void 0:e.isoCode,value:null==e?void 0:e.isoCode,symbol:(0,D.QnQ)(null==e?void 0:e.isoCode,X)})):[],name:"label",onClear:()=>{eD(X)},label:"Select Currency",type:"tags",flyout:!0,tags:!0,apiFilter:"",scrollIntoView:!1,currency:!0})})})]}),(0,s.jsxs)("div",{className:"col-span-1 flex flex-col",children:[(0,s.jsx)("p",{className:"pb-2 invisible hidden sm:block lg:hidden","aria-hidden":!0,children:"\xa0"}),(0,s.jsxs)("label",{className:"flex h-10 items-center gap-2 text-sm text-slate-600 cursor-pointer select-none",children:[(0,s.jsx)("input",{type:"checkbox",className:"form-checkbox shrink-0 cursor-pointer",checked:ew,onChange:e=>{ek(e.target.checked)}}),(0,s.jsx)("span",{children:"Include accounts with nil balances"})]})]})]}),(0,x.Yj)(x.kO.VIEW_REPORTS,Z,Q)&&(0,s.jsx)("div",{className:"col-span-full mt-4 flex flex-col sm:flex-row gap-2",children:(0,s.jsx)("button",{type:"submit",disabled:ei||ep,onClick:()=>{_.current=!0,ev(!0)},className:"flex items-center cursor-pointer justify-center px-5 py-5 rounded-[0.313rem] shadow-sm leading-6 text-[0.875rem] h-8 whitespace-nowrap bg-brand-solid text-on-brand disabled:opacity-60",children:"Generate Report"})})]})]})})}),ei||!eK?(0,s.jsxs)("div",{className:"flex py-16 px-7 flex-col gap-1 text-center flex-grow flex-shrink-0 basis-0 rounded-xl border border-[#D0D5DD] bg-white",children:[ei&&(0,s.jsx)("div",{className:"flex items-center pb-2 justify-center mt-8",children:(0,s.jsx)("svg",{className:"animate-spin w-10 h-10 fill-current shrink-0 text-brand-text",viewBox:"0 0 16 16",children:(0,s.jsx)("path",{d:"M8 16a7.928 7.928 0 01-3.428-.77l.857-1.807A6.006 6.006 0 0014 8c0-3.309-2.691-6-6-6a6.006 6.006 0 00-5.422 8.572l-1.806.859A7.929 7.929 0 010 8c0-4.411 3.589-8 8-8s8 3.589 8 8-3.589 8-8 8z"})})}),(0,s.jsx)("div",{className:"flex justify-center",children:(0,s.jsxs)("svg",{width:"177",height:"155",viewBox:"0 0 177 155",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsxs)("g",{clipPath:"url(#clip0_gl_empty)",children:[(0,s.jsx)("path",{d:"M48.9475 87.1651C72.3444 87.1651 91.3114 68.1982 91.3114 44.8013C91.3114 21.4044 72.3444 2.4375 48.9475 2.4375C25.5507 2.4375 6.58374 21.4044 6.58374 44.8013C6.58374 68.1982 25.5507 87.1651 48.9475 87.1651Z",fill:"#F9EAE0"}),(0,s.jsx)("path",{d:"M51.6384 141.316C51.0285 141.316 50.4276 141.169 49.8865 140.887C49.3453 140.606 48.8798 140.199 48.529 139.7L43.6594 132.732L162.034 58.0156L167.658 61.7104C168.187 62.0575 168.62 62.5314 168.918 63.0888C169.216 63.6462 169.37 64.2693 169.365 64.9014C169.361 65.5335 169.198 66.1544 168.892 66.7076C168.586 67.2607 168.147 67.7285 167.614 68.0682L53.6699 140.723C53.0631 141.11 52.3582 141.316 51.6384 141.316Z",fill:"white"}
3),(0,s.jsx)("path",{d:"M162.026 58.5765L167.399 62.1059C167.864 62.4057 168.246 62.8191 168.507 63.3072C168.769 63.7954 168.901 64.3421 168.893 64.8957C168.891 65.4501 168.749 65.9949 168.481 66.4801C168.213 66.9653 167.827 67.3753 167.359 67.6724L53.4176 140.33C52.6961 140.789 51.8253 140.952 50.9864 140.785C50.1476 140.619 49.4054 140.135 48.9144 139.435L44.3243 132.87L162.026 58.5765ZM162.036 57.4606L42.9897 132.599L48.1444 139.971C48.7741 140.87 49.7263 141.491 50.8027 141.705C51.8791 141.919 52.9966 141.71 53.9224 141.12L167.864 68.4647C168.463 68.0829 168.957 67.5572 169.301 66.9355C169.645 66.3138 169.828 65.6159 169.833 64.9055C169.838 64.195 169.665 63.4946 169.33 62.8681C168.995 62.2416 168.509 61.7089 167.915 61.3187L162.037 57.457L162.036 57.4606Z",fill:"#081F2D"}),(0,s.jsx)("path",{d:"M94.4027 10.1219C97.252 8.28492 100.657 7.51002 104.021 7.93316C107.384 8.35631 110.491 9.95048 112.797 12.4359L116.492 16.4188L25.6196 54.4691L94.4027 10.1219Z",fill:"white"}),(0,s.jsx)("path",{d:"M102.215 8.29063C104.137 8.29253 106.037 8.68979 107.799 9.45771C109.561 10.2256 111.145 11.3478 112.455 12.7544L115.692 16.2447L30.3452 51.9825L94.657 10.5179C96.9092 9.06308 99.5337 8.28966 102.215 8.29063ZM102.215 7.3507C99.3537 7.34996 96.5531 8.17552 94.1498 9.72815L20.8943 56.9585L117.296 16.5916L113.143 12.1157C111.749 10.6106 110.058 9.41004 108.178 8.58951C106.297 7.76897 104.267 7.34617 102.215 7.34766V7.3507Z",fill:"#081F2D"}),(0,s.jsx)("path",{d:"M42.9896 132.596L38.29 125.876C37.9543 125.396 37.7213 124.852 37.6055 124.278C37.4897 123.703 37.4937 123.111 37.6171 122.539C37.7406 121.966 37.9809 121.425 38.323 120.95C38.6651 120.474 39.1016 120.075 39.6053 119.776L145.216 57.0983C147.051 56.0093 149.098 55.3271 151.219 55.0979C153.34 54.8687 155.486 55.0978 157.511 55.7698L160.918 56.8999C161.683 57.1537 162.36 57.6194 162.871 58.2429C163.381 58.8663 163.704 59.6219 163.803 60.4218C163.901 61.2217 163.77 62.033 163.425 62.7614C163.08 63.4898 162.536 64.1053 161.855 64.5365L51.6376 134.333C50.2494 135.212 48.576 135.521 46.9654 135.198C45.3548 134.874 43.9308 133.942 42.9896 132.596Z",fill:"#78BD4F"}),(0,s.jsx)("path",{d:"M39.6054 119.778L15.239 77.3915C14.256 75.6816 13.6223 73.7935 13.3747 71.8368C13.1271 69.8801 13.2705 67.8937 13.7966 65.9929C14.3227 64.092 15.2209 62.3145 16.4393 60.7636C17.6577 59.2126 19.172 57.919 20.8942 56.9578L98.8604 13.4404C101.831 11.7821 105.28 11.1905 108.634 11.764C111.988 12.3375 115.045 14.0416 117.296 16.5929C128.319 29.0817 135.999 44.1592 139.62 60.4187L39.6054 119.778Z",fill:"#78BD4F"}),(0,s.jsx)("path",{d:"M130.107 66.0703C124.726 50.5333 116.459 36.1524 105.74 23.6836",stroke:"#081F2D",strokeWidth:"0.939413",strokeMiterlimit:"10"}),(0,s.jsx)("path",{d:"M124.152 69.6016C118.77 54.0647 110.503 39.6839 99.7852 27.2148",stroke:"#081F2D",strokeWidth:"0.939413",strokeMiterlimit:"10"}),(0,s.jsx)("path",{d:"M119.188 72.5469C113.807 57.0101 105.54 42.6293 94.8218 30.1602",stroke:"#081F2D",strokeWidth:"0.939413",strokeMiterlimit:"10"}),(0,s.jsx)("path",{d:"M77.843 97.0865C72.4613 81.5495 64.1942 67.1685 53.4761 54.6992",stroke:"#081F2D",strokeWidth:"0.939413",strokeMiterlimit:"10"}),(0,s.jsx)("path",{d:"M52.7817 117.98L57.4813 124.7",stroke:"#081F2D",strokeWidth:"0.939413",strokeMiterlimit:"10"}),(0,s.jsx)("path",{d:"M135.003 63.1602C138.493 64.4051 141.5 66.7228 143.592 69.7812",stroke:"#081F2D",strokeWidth:"0.939413",strokeMiterlimit:"10"}),(0,s.jsx)("path",{d:"M39.6055 119.779L139.62 60.4219",stroke:"#081F2D",strokeWidth:"0.939413",strokeMiterlimit:"10"})]}),(0,s.jsx)("defs",{children:(0,s.jsx)("clipPath",{id:"clip0_gl_empty",children:(0,s.jsx)("rect",{width:"176.013",height:"154.709",fill:"white",transform:"translate(0.493408)"})})})]})}),(0,s.jsx)("div",{className:"self-stretch flex mt-6 flex-col justify-center gap-2 text-center text-slate-600 text-[1rem] leading-6 font-normal h-16",children:eh?(0,s.jsx)("p",{className:"text-[#101828]",children:"No data found for the selected period"}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("p",{className:"text-[#101828]",children:"Your report will appear here"}),(0,s.jsx)("p",{className:"text-[#667085]",children:"Select a date range and generate the report to view the general ledger."})]})})]}):(0,s.jsxs)("div",{className:"flex pt-7 px-7 pb-10 flex-col gap-4 flex-grow flex-shrink-0 basis-0 rounded-xl border border-[#D0D5DD] bg-white relative ".concat(k.C7),children:[ep?(0,s.jsxs)("div",{className:"absolute top-3 right-3 z-10 flex items-center gap-2 rounded-md border border-[#D0D5DD] bg-white/95 px-3 py-1.5 text-sm text-slate-600 shadow-sm","aria-live":"polite",children:[(0,s.jsx)("svg",{className:"animate-spin h-4 w-4 shrink-0 text-brand-text",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":!0,
3children:(0,s.jsx)("path",{d:"M8 16a7.928 7.928 0 01-3.428-.77l.857-1.807A6.006 6.006 0 0014 8c0-3.309-2.691-6-6-6a6.006 6.006 0 00-5.422 8.572l-1.806.859A7.929 7.929 0 010 8c0-4.411 3.589-8 8-8s8 3.589 8 8-3.589 8-8 8z"})}),"Updating report\u2026"]}):null,(0,s.jsxs)("div",{className:"flex justify-between",children:[(0,s.jsx)("h2",{className:"text-2xl md:text-2xl text-black opacity-60 font-medium",children:"Report"}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,s.jsx)(b.A,{canExport:(0,x.Yj)(x.kO.VIEW_REPORTS,Z,Q),onExportCsv:()=>{var e,t,l;if(!(null==et||null==(l=et.accounts)?void 0:l.length))return;let n=[];n.push(["General Ledger"]),n.push([null==q?void 0:q.name]),n.push([e$]),n.push(["Currency: ".concat(eq)]),n.push([""]);let a=e=>{let t=parseFloat(null!=e?e:0);return Number.isFinite(t)&&0!==t?"".concat(t<0?"-":"").concat(eS).concat((0,D.hRT)(Math.abs(t).toFixed(2))):""},s=e=>{let t=parseFloat(null!=e?e:0),l=Number.isFinite(t)?t:0;return"".concat(l<0?"-":"").concat(eS).concat((0,D.hRT)(Math.abs(l).toFixed(2)))};((null==et?void 0:et.accounts)||[]).forEach(e=>{let t=null==e?void 0:e.accountCode,l=t?"".concat(t," ").concat((null==e?void 0:e.accountName)||""):(null==e?void 0:e.accountName)||"",i=(null==e?void 0:e.subTypeName)||(null==e?void 0:e.accountType)||"";n.push([i?"".concat(l," (").concat(i,")"):l]),n.push(["DATE","DESCRIPTION","CONTRA ACCOUNT","DEBIT","CREDIT","BALANCE"]),n.push(["Beginning Balance","","",a(null==e?void 0:e.openingBalanceDebit),a(null==e?void 0:e.openingBalanceCredit),s(null==e?void 0:e.openingBalance)]),(null==e?void 0:e.hasActivity)&&((null==e?void 0:e.entries)||[]).forEach(e=>{var t;n.push([z(null==e?void 0:e.date,ee),(null==e?void 0:e.description)||(null==e||null==(t=e.reference)?void 0:t.sourceDocumentReference)||"",(e=>{let t=null==e?void 0:e.contraAccountDisplay;if("-Split-"!==t)return t||"";let l=(null==e?void 0:e.contraAccounts)||[];return 0===l.length?"Split":"Split: ".concat(l.map(e=>"".concat((null==e?void 0:e.accountCode)?"".concat(e.accountCode," "):"").concat((null==e?void 0:e.accountName)||"").trim()).join("; "))})(e),(null==e?void 0:e.debit)!=null?s(e.debit):"",(null==e?void 0:e.credit)!=null?s(e.credit):"",s(null==e?void 0:e.runningBalance)])}),n.push(["Ending Balance","","",a(null==e?void 0:e.debitTotal),a(null==e?void 0:e.creditTotal),s(null==e?void 0:e.closingBalance)]),n.push(["","","","","",""])});let i=(null==et?void 0:et.totals)||{};n.push(["Opening Totals","","",a(i.openingDebitTotal),a(i.openingCreditTotal),""]),n.push(["Period Totals","","",a(i.periodDebitTotal),a(i.periodCreditTotal),""]),n.push(["Closing Totals","","",a(i.closingDebitTotal),a(i.closingCreditTotal),""]),n.push(["","","","","",""]),n.push(["In Balance",i.isInBalance?"Yes":"No","","","",""]),i.isInBalance||(n.push(["Opening Net Imbalance",H(i.openingNetTotal,eS),"","","",""]),n.push(["Closing Net Imbalance",H(i.closingNetTotal,eS),"","","",""])),n.push(["Journal Lines",null!=(e=i.journalLineCount)?e:0,"","","",""]),n.push(["Accounts",null!=(t=i.accountCount)?t:0,"","","",""]);let r=n.map(e=>e.map(e=>{let t=null==e?"":String(e);return/[",\r\n]/.test(t)?'"'.concat(t.replace(/"/g,'""'),'"'):t}).join(",")).join("\r\n");(0,w.T)(r,"General Ledger - ".concat(e$," (").concat(eq,").csv"))},onExportPdf:eJ,pdfLoading:eL}),(0,s.jsx)(A.A,(0,n._)({},ef.toolbarProps))]})]}),eX?(0,s.jsxs)("div",{className:"grid grid-cols-5 text-center py-8",children:[(0,s.jsx)(j.A,{price:eX.closingDebitTotal,label:"Closing Debits",sign:eS}),(0,s.jsx)("div",{className:"text-[#101828] self-center",children:(0,s.jsx)("p",{className:"font-semibold",children:" -"})}),(0,s.jsx)(j.A,{price:eX.closingCreditTotal,label:"Closing Credits",sign:eS}),(0,s.jsx)("div",{className:"text-[#101828] self-center",children:(0,s.jsx)("p",{className:"font-semibold",children:"="})}),(0,s.jsx)(j.A,{price:eX.closingNetTotal,label:"Difference",sign:eS,color:e0?"":e6?"text-[#4C7632]":"text-[#C62828]"})]}):null,eX?(0,s.jsx)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:e6?(0,s.jsx)("span",{className:"".concat(ec," bg-[#4CAF501A] text-[#377E39]"),children:"In Balance"}):e0?(0,s.jsx)("span",{className:"".concat(ec," bg-slate-100 text-slate-600"),children:"Partial run \u2014 not reconciled"}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"".concat(ec," bg-[#FF5B5B1A] text-[#CD4949]"),children:"Out of Balance"}),(0,s.jsxs)("span",{className:"text-xs text-slate-600",children:["Opening net imbalance"," ",H(eX.openingNetTotal,eS)," ","\xb7 Closing net imbalance"," ",H(eX.closingNetTotal,eS)]})]})}):null,e1?(0,s.jsx)(m.A,{isInfo:!0,content:"This range crosses a fiscal year boundary (fiscal year starts ".concat((null==en?void 0:en.fiscalYearStart)||"","). Grand totals still balance, but per-account profit-and-loss closing balances won't match the end-date Trial Balance, which rolls the earlier year into Retained Earnings.")}):null,e0?(0,s.jsx)(m.A,{isInfo:!0,content:"This is a filtered run limited to the selected accounts. It omits the synthetic Retained Earnings row and is not expected to reconcile to your Trial Balance. Remove the account filter for a complete, balancing ledger."}):null,(0,s.jsx)(ea,{reportData:et,currencySymbol:eS,teamDateFormat:ee,refreshReportInBackgroun
3d:eZ}),eX?(0,s.jsxs)("div",{className:"mt-2 border-t border-slate-200 pt-4 flex flex-col gap-3",children:[(0,s.jsxs)("table",{className:"w-full max-w-xl text-sm",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"w-1/4"}),ed.map(e=>(0,s.jsx)("th",{className:"px-4 pb-2 text-right text-[0.6875rem] font-semibold uppercase tracking-wider text-slate-500",children:e.label},e.label))]})}),(0,s.jsx)("tbody",{children:[{label:"Debit",key:"debitKey"},{label:"Credit",key:"creditKey"}].map(e=>(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",{className:"py-1 text-slate-500",children:e.label}),ed.map(t=>(0,s.jsx)("td",{className:"px-4 py-1 text-right tabular-nums text-slate-800",children:G(eX[t[e.key]],eS)},t.label))]},e.label))})]}),(0,s.jsxs)("p",{className:"text-xs text-slate-500",children:[null!=(l=eX.journalLineCount)?l:0," journal lines \xb7"," ",null!=(B=eX.accountCount)?B:0," accounts \xb7"," ",null!=(M=eX.postingCount)?M:0," postings"]})]}):null]})]})})}},32363(e,t,l){var n=l(43403);let a={transaction:"transaction",invoice:"invoice",bill:"bill",journal:"journal"};l.d(t,{},{HE:e=>{if(!e)return;let t=e;try{let l=new URL(e,window.location.origin);t=l.pathname+l.search}catch(e){}let l=(0,n.UHV)(t);window.open(l,"_blank","noopener,noreferrer")},R7:e=>a[e]||"document"})},70721(e,t,l){let n="top-[var(--sticky-header-top,0px)]",a="sticky ".concat(n," z-20 bg-white");l.d(t,{},{$d:a,C7:"isolate",RO:n})}}]);
4//# sourceMappingURL=2802.cb24658d.chunk.js.map
5//# debugId=ed98c52b-26d3-5a71-a280-1110b68e7225

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.