PageSourceSearch

https://portal.commoninterest.com/assets/account-history-DJQdhcYa.js

js commoninterest.com collected 2026-09-24 13:28:01 UTC 8,904 bytes, 1 lines download raw bytes

1import{u as E,s as G,r as u,j as s,k as N,bf as m,q as g,a_ as M,aP as I,aW as R}from"./elements-DVh2jUIM.js";import{j as P,K,q as V}from"./index-DeQvL4I7.js";import{S as Y,a as J}from"./StatementDownloadModal-B-otZLFT.js";import{A as Q}from"./authorization-CE7gncHO.js";import{u as U}from"./useIsMobile-Davbtvz5.js";import{u as X}from"./useRedesign-DVyq07A4.js";import"./grids-DXrfAsUA.js";import"./startOfDay-AazlW55I.js";import"./useAuthorization-D7B2eQha.js";const me={title:"All Account History",showPropertySelector:!1,breadCrumbs:[{display:"Account Overview",path:"/billing/account-overview",id:1}],customContentId:["Billing","Homeowner_v2"],showAi:!0};function be(){const t=X(),{t:e}=E(),{width:l}=G(),n=U(),[r,o]=u.useState(!1),[c,y]=u.useState(k(e)[0]),[a,v]=u.useState(),[b,f]=u.useState(null),h=P(i=>i.accounts),j=u.useRef(null),O=u.useMemo(()=>({data:i})=>{if(!i)return null;const x=i.amount,D=x<0;return s.jsxs("div",{className:"flex flex-col w-full py-3 space-y-2",children:[s.jsxs("div",{className:"flex justify-between items-start",children:[s.jsx("div",{className:"text-sm font-medium",children:N(i.ledgerDate,{format:"numeric",naive:!0})}),s.jsx("div",{className:"text-sm text-right",children:i.accountWithSubCode})]}),s.jsxs("div",{className:"text-sm",children:[s.jsx("p",{className:"break-words leading-4",children:`${i.description} ${i.otherDescription||""}`.trim()}),i.detailedDescription&&s.jsx("p",{className:"text-xs mt-1",children:i.detailedDescription})]}),s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsxs("div",{className:"text-sm",children:[s.jsx("span",{children:e("billing.accountOverview.amountLabel")}),s.jsx("span",{className:g(D?"text-success":""),children:m((x??0)/100)})]}),s.jsxs("div",{className:"text-sm",children:[s.jsx("span",{children:e("billing.accountOverview.balanceLabel")}),s.jsx("span",{className:"font-medium",children:m((i.runningBalance??0)/100)})]})]})]})},[]);u.useEffect(()=>{var i;(i=j.current)==null||i.refresh()},[a,c]);const T=i=>{v(i)},$=u.useCallback(i=>{f(i)},[f]),C=u.useMemo(()=>[{field:"ledgerDate",headerName:e("billing.accountOverview.accountHistory"),resizable:!1,floatingFilter:!1,suppressMenu:!0,flex:1,cellRenderer:({data:i})=>s.jsx(O,{data:i})}],[O]),B=u.useMemo(()=>l>=K?F(e,t):C,[l,e,t,C]);return s.jsx(Q,{controller:"Homeowner_v2",action:"Billing",children:s.jsxs("div",{className:g("h-full w-full pt-4 bg-base-fill rounded-xl px-4 tablet:px-6",(a==null?void 0:a.blockLedger)&&"[&_.ag-overlay-wrapper]:text-error"),children:[s.jsxs("div",{className:"lg:flex justify-between mb-8",children:[s.jsx(ee,{options:[e("billing.accountOverview.allAccounts"),...h],onAccountChange:T,value:(a==null?void 0:a.accountWithSubCode)??e("billing.accountOverview.allAccounts")}),s.jsxs("div",{className:g("flex items-center lg:w-96 w-full md:mt-0 mt-3",a!=null&&a.blockLedger?"flex-row-reverse":"justify-between"),children:[s.jsx(ae,{options:k(e),onChange:y,value:c}),!(a!=null&&a.blockLedger)&&s.jsx(Y,{setIsModalOpen:o,isBlocked:(a==null?void 0:a.blockLedger)||!1})]})]}),s.jsx(M,{"data-qa":"account-history__table",ref:j,columnDefs:B,rowHeight:n?85:60,overlayNoRowsTemplate:a!=null&&a.blockLedger?a==null?void 0:a.blockLedgerMessage:e("billing.accountOverview.noDataToDisplay"),getGridRef:$,serverSideDatasource:{getRows:({success:i,fail:x,request:{startRow:D=0,endRow:W=10,filterModel:d,sortModel:q}})=>{var S,L,z;const{sort:H,colId:_}=q.at(0)??{};let w=null;se({startRow:D,endRow:W,sort:H,colId:_,afterDateFilter:(S=d==null?void 0:d.ledgerDate)==null?void 0:S.dateTo,beforeDateFilter:(L=d==null?void 0:d.ledgerDate)==null?void 0:L.dateFrom,descriptionFilter:(z=d==null?void 0:d.description)==null?void 0:z.filter,selectedDateFilter:c,selectedAccountFilter:a}).then(p=>{w=p,i({rowData:p.member,rowCount:p.totalItems})}).catch(p=>{console.error(p),x()}).finally(()=>{(a!=null&&a.blockLedger||(w==null?void 0:w.totalItems)===0)&&(b==null||b.api.showNoRowsOverlay())})}},isMobile:n}),s.jsx(J,{accounts:h,isModalOpen:r,setIsModalOpen:o,currentAccountFilter:(a==null?void 0:a.accountWithSubCode)??e("billing.accountOverview.allAccounts")})]})})}const k=t=>[{value:"any",display:t("billing.accountOverview.allDates")},{value:"last30days",display:t("billing.accountOverview.last30Days")},{value:"last60days",display:t("billing.accountOverview.last60Days")},{value:"yearToDate",display:t("billing.accountOverview.lastYear")}],Z=t=>[{field:"ledgerDate",headerName:t("billing.accountOverview.date"),valueFormatter:e=>N(e.value,{format:"numeric",naive:!0}),sortable:!0,suppressMenu:!0,resizable:!1},{field:"accountWithSubCode",headerName:t("billing.accountOverview.accountNumber"),sortable:!0,suppressMenu:!0,resizable:!1},{field:"description",headerName:t("billing.accountOverview.description"),sortable:!0,suppressMenu:!0,autoHeight:!0,resizable:!1,valueGetter:e=>{var l,n,r;return{description:((l=e.data)==null?void 0:l.description)||"",otherDescription:(n=e.data)==null?void 0:n.otherDescription,details:(r=e.data)==null?void 0:r.detailedDescription}},cellRenderer:({value:e})=>s.jsxs("div",{className:"py-2 max-w-full text-wrap break-words leading-4",children:[s.jsx("p",{children:`${e.description} ${e.otherDescription}`.trim()})," ",e.details&&s.jsx("p",{className:"text-sm opacity-75",children:e.details})]})},{field:"amount",headerName:t("billing.accountOverview.amount"),cellRenderer:({value:e})=>s.jsx("p",{className:g(e<0?"text-success":""),children:m((e??0)/100)}),sortable:!0,suppressMenu:!0,resizable:!1},{field:"runningBalance",headerName:t("billing.accountOverview.balance"),valueFormatter:e=>m((e.value??0)/100),suppressMenu:!0,resizable:!1}],A=t=>[{colId:"ledgerDate",field:"ledgerDate",headerName:t("billing.accountOverview.date"),valueFormatter:e=>N(e.value,{format:"numeric",naive:!0}),filter:"agDateColumnFilter",filterParams:{filterOptions:["greaterThan","lessThan","inRange"],maxNumConditions:1},sortable:!0,floatingFilter:!0,resizable:!0},{field:"accountWithSubCode",headerName:t("billing.accountOverview.accountNumber"),sortable:!0,resizable:!0},{field:"description",headerName:t("billing.accountOverview.description"),sortable:!0,resizable:!0,filter:"agTextColumnFilter",filterParams:{filterOptions:["contains"],maxNumConditions:1},floatingFilter:!0,autoHeight:!0,valueGetter:e=>{var l,n,r;return{description:((l=e.data)==null?void 0:l.description)||"",otherDescription:(n=e.data)==null?void 0:n.otherDescription,details:(r=e.data)==null?void 0:r.detailedDescription}},cellRenderer:({value:e})=>s.jsxs("div",{className:"py-2 max-w-full text-wrap break-words leading-4",children:[s.jsx("p",{children:`${e.description} ${e.otherDescription}`.trim()})," ",e.details&&s.jsx("p",{className:"text-sm opacity-75",children:e.details})]})},{field:"amount",headerName:t("billing.accountOverview.amount"),cellRenderer:({value:e})=>s.jsx("p",{className:g(e<0?"text-success":""),children:m((e??0)/100)}),sortable:!0,resizable:!0},{field:"runningBalance",headerName:t("billing.accountOverview.balance"),valueFormatter:e=>m((e.value??0)/100),cellStyle:{textAlign:"right"},resizable:!0}],F=(t,e)=>e?Z(t):A(t);function ee({value:t,options:e,onAccountChange:l}){const n=r=>{l(typeof r=="string"?void 0:r)};return s.jsx("div",{children:s.jsx(I,{qaListAttribute:"account-filter",required:!0,options:e,label:"",deriveKey:r=>typeof r=="string"?r:r.accountWithSubCode,displaySelected:r=>{const o=e.find(c=>typeof c!="string"?c.accountWithSubCode===r:r===c)??"All Accounts";
1return typeof o=="string"?o:`${o.accountWithSubCode} - ${R(o.propertyAddress,"half")} | ${o.associationName}`},displayOption:r=>typeof r=="string"?r:`${r.accountWithSubCode} - ${R(r.propertyAddress,"half")} | ${r.associationName}`,value:t,onChange:n,className:"lg:w-[22vw] w-full min-w-[275px]",buttonClassName:"min-h-12"})})}function ae({value:t,options:e,onChange:l}){return s.jsx("div",{children:s.jsx(I,{qaListAttribute:"table-account-filter",required:!0,options:e,label:"",deriveKey:n=>n.value??"",displaySelected:()=>{var n;return((n=e.find(r=>r.value===t.value))==null?void 0:n.display)??""},displayOption:n=>`${n.display}`,onChange:l,value:e.find(n=>n.value===t.value),className:"w-full md:w-[215px]",buttonClassName:"h-12"})})}async function se({startRow:t,endRow:e,sort:l,colId:n,afterDateFilter:r,beforeDateFilter:o,descriptionFilter:c,selectedDateFilter:y,selectedAccountFilter:a}){const v=e-t,b=t/v+1,f=o?new Date(o):void 0,h=r?new Date(r):{any:void 0,last30days:new Date(Date.now()-720*60*60*1e3),last60days:new Date(Date.now()-1440*60*60*1e3),yearToDate:new Date(new Date().getFullYear(),0,1)}[y.value];return await V.getLedgers({pageSize:v,page:b,accountNumber:a==null?void 0:a.accountNumber,ownerId:a==null?void 0:a.ownerId,subLedgerId:a==null?void 0:a.subLedgerId,description:c,"ledgerDate.after":f,"ledgerDate.before":h,"sortBy.field":n,"sortBy.order":l==="asc"?"ascending":"descending"})}export{be as Component,me as handle};

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.