import{j as e,a6 as Oe,a9 as Ee,S as K,p as ee,aD as oe,M as J,U as k,V as d,Z as re,$ as ce,a0 as ie,aF as Ve}from"./vendor-mui-CBBEb17G.js";import{B as Me}from"./index-BkhbTDKf.js";import{e as ye,gk as F,y as X,b2 as De,bs as We,aA as z,a$ as de,gG as Ue,al as we,ex as Ke,c$ as qe,be as Se,bf as Ae,aP as ue,C as me,w as ve,ao as be,aT as He,bn as Qe,I as Be,c5 as Xe,aY as i,cL as Ye,a_ as Y,z as xe,c as ge,aU as Je,aV as Le,aW as Ze,aX as Ie,d0 as et,a1 as Ce}from"./index-IP_FWtso.js";import{a as c}from"./vendor-react-BBazpZul.js";import"./vendor-utils-BveVE6Uf.js";import{A as tt,s as at}from"./safeRender-BnrdhTmT.js";import{S as lt}from"./index-D7-0uPSw.js";import"./vendor-charts-tGnAgELZ.js";var h=(t=>(t[t.Group=1]="Group",t[t.Genreal_Account=2]="Genreal_Account",t[t.Subsidiary_Account=3]="Subsidiary_Account",t[t.Detailed_Account=4]="Detailed_Account",t[t.Transaction_Report=5]="Transaction_Report",t))(h||{});const Re=c.createContext(void 0),nt=({children:t})=>{const{activeYear:n}=ye(r=>r.accounting),{clinicId:o,officeId:A}=ye(r=>r.doctorData),{getBrowsAccountAsync:l}=tt(),{GetCenterTransactionsAsync:y,GetCenterTransactionsExportToExcel:j}=Ue(),[N,x]=c.useState(!1),[V,M]=c.useState(!1),[$,E]=c.useState(F.betweenDate),[v,u]=c.useState(n?new Date(n==null?void 0:n.startDate):X().startOf("jYear").toDate()),[G,D]=c.useState(n?new Date(n==null?void 0:n.endDate):X().endOf("jYear").toDate()),[S,pe]=c.useState(De().hour(0).minute(0).second(0)),[P,L]=c.useState(De().hour(23).minute(59).second(0)),[I,q]=c.useState(null),[Z,he]=c.useState(null),[H,ae]=c.useState(null),[C,le]=c.useState(null),[T,ne]=c.useState(null),[W,se]=c.useState(null),[a,m]=c.useState(null),[f,w]=c.useState(null),[s,B]=c.useState(1),[U,p]=c.useState({page:1,size:25}),[Q,R]=c.useState(null),[_,ke]=c.useState(""),fe=(r,b)=>{s===5?Pe(r,b):Fe(r,b)},Fe=async(r,b)=>{const O={From:r?z(r,S):z(v,S),UpTo:b?z(b,P):z(G,P),Type:+s,GeneralAccountGroupId:W?+W.value:void 0,GeneralAccountId:T?+T.value:void 0,SubsidiaryAccountId:I?+I.value:void 0,AccountingObjectId:C?+C.value:void 0};try{x(!0);const{data:g}=await l(O);m(g),w(g)}finally{x(!1)}},Pe=async(r,b)=>{try{x(!0);const O={From:r?z(r,S):z(v,S),UpTo:b?z(b,P):z(G,P),GeneralAccountId:T?+T.value:void 0,SubsidiaryAccountId:I?+I.value:void 0,AccountingObjectId:C?+C.value:void 0,orderBy:Z?+Z.value:void 0,orderType:H?+H.value:void 0,PageSize:U.size,PageNumber:U.page},{data:g}=await y(O);R(g)}finally{x(!1)}},ze=async()=>{try{x(!0);const r={From:z(v,S),UpTo:z(G,P),GeneralAccountId:T?+T.value:void 0,SubsidiaryAccountId:I?+I.value:void 0,AccountingObjectId:C?+C.value:void 0,ClinicId:o??void 0,OfficeId:A??void 0};await j(r)}finally{x(!1)}},$e=()=>{var r,b;if((r=a==null?void 0:a.list)!=null&&r.length&&s!==5){const O=((b=a==null?void 0:a.list)==null?void 0:b.filter(g=>g.accountName.includes(_)||g.accountNumber.toString().includes(_)))||[];w({list:O,totalCreditorAmount:de(O).sumBy(g=>g.creditorAmount),totalDebtorAmount:de(O).sumBy(g=>g.debtorAmount),totalCreditorBalance:de(O).sumBy(g=>g.creditorBalance),totalDebtorBalance:de(O).sumBy(g=>g.debtorBalance)})}},Ge=async()=>{const r=await We(),b=new Date(r);switch($){case F.Today:u(r),D(b);break;case F.LastDay:u(new Date(r.setDate(r.getDate()-1))),D(b);break;case F.lastWeek:u(new Date(r.setDate(r.getDate()-7))),D(b);break;case F.lastMonth:u(new Date(r.setMonth(r.getMonth()-1))),D(b);break;case F.lastYear:u(new Date(r.setFullYear(r.getFullYear()-1))),D(b);break;case F.betweenDate:u(n?new Date(n==null?void 0:n.startDate):X().startOf("jYear").toDate()),D(n?new Date(n==null?void 0:n.endDate):X().endOf("jYear").toDate());break}};c.useEffect(()=>{s&&fe()},[s,C,T,W,I,U]),c.useEffect(()=>{Ge()},[$]),c.useEffect(()=>{if(!n)return;const r=n?new Date(n==null?void 0:n.startDate):X().startOf("jYear").toDate(),b=n?new Date(n==null?void 0:n.endDate):X().endOf("jYear").toDate();u(r),D(b),fe(r,b)},[n]);const _e={loading:N,dateRadioValue:$,fromDateValue:v,toDateValue:G,setDateRadioValue:E,setFromDateValue:u,setToDateValue:D,generalAccount:T,setGeneralAccount:ne,accountingObject:C,setAccountingObject:le,setSubsidiaryAccount:q,subsidiaryAccount:I,dataList:f,generalAccountGroup:W,setGeneralAccountGroup:se,transactionsData:Q,orderBy:Z,setOrderBy:he,orderType:H,setOrderType:ae,handlers:{fetchData:fe,handleSearch:$e,handleExportToExcelTransactions:ze},endTime:P,setEndTime:L,setStartTime:pe,startTime:S,printRequest:V,setPrintRequest:M,setTabValue:B,tabValue:s,setPageInfo:p,searchValue:_,setSearchValue:ke};return e.jsx(Re.Provider,{value:_e,children:t})},te=()=>c.useContext(Re);Ke(t=>({reportSection:{width:"100%",height:"100%"},sidebar:{borderLeft:"1px solid #ccc",padding:"25px 10px",flexDirection:"column",gap:"8px",height:"100%",overflowY:"auto"}}));const st=we("div")`
  background: #6dc9ff;
  color: #fff;
  padding: 5px 0px;
  text-align: center;
  border-radius: 20px;
  font-size: 1rem;
`;we(Oe)`
  .MuiTypography-root {
    font-size: 0.8rem;
  }
  &.MuiFormControlLabel-root {
    min-width: 110px;
    color: rgba(0, 0, 0, 0.5);
    margin: 1px;
  }
`;we(Ee)`
  &.MuiRadio-root {
    padding: 2px 5px;
    color: rgba(0, 0, 0, 0.5);
  }
`;const ot=()=>{const[{userType:t},{activeYear:n}]=ye(u=>[u.user,u.accounting]),{dateRadioValue:o,setDateRadioValue:A,fromDateValue:l,setFromDateValue:y,setToDateValue:j,toDateValue:N,startTime:x,setStartTime:V,endTime:M,setEndTime:$}=te(),E=c.useMemo(()=>n?new Date(n.startDate).toISOString():new Date().toISOString(),[n]),v=c.useMemo(()=>n?new Date(n.endDate).toISOString():new Date().toISOString(),[n]);return e.jsxs(K,{gap:1,children:[e.jsx(st,{className:+t===qe.accountant?"!bg-[#b0d8e7]":"",children:"انتخاب تاریخ"}),e.jsxs(K,{spacing:1.5,className:"!space-y-4 !mt-2",children:[e.jsx(ee,{className:"!w-full",children:e.jsx(Se,{disablePast:!1,disabled:o!==F.betweenDate,value:l,onChange:u=>y(u),label:"از تاریخ",className:"",minDate:E,maxDate:v})}),e.jsx(ee,{className:"!w-full",children:e.jsx(Ae,{value:x,onChange:u=>V(u),disabled:o!==F.betweenDate})}),e.jsx(ee,{className:"!w-full ",children:e.jsx(Se,{disablePast:!1,disabled:o!==F.betweenDate,value:N,onChange:u=>j(u),label:"تا تاریخ",minDate:E,maxDate:v})}),e.jsx(ee,{className:"!w-full",children:e.jsx(Ae,{value:M,onChange:u=>$(u),disabled:o!==F.betweenDate})})]})]})};var je=(t=>(t[t.AccountDocumentCustomId=1]="AccountDocumentCustomId",t[t.AccountDocumentDate=2]="AccountDocumentDate",t))(je||{}),Ne=(t=>(t[t.Ascending=1]="Ascending",t[t.Descending=2]="Descending",t))(Ne||{});const rt=[{label:"شماره سند",value:je.AccountDocumentCustomId.toString()},{label:"تاریخ سند",value:je.AccountDocumentDate.toString()}],ct=[{label:"صعودی",value:Ne.Ascending.toString()},{label:"نزولی",value:Ne.Descending.toString()}],it=()=>{const{handlers:{fetchData:t,handleExportToExcelTransactions:n},setPrintRequest:o,loading:A,generalAccount:l,generalAccountGroup:y,subsidiaryAccount:j,accountingObject:N,tabValue:x,orderBy:V,orderType:M,setOrderBy:$,setGeneralAccountGroup:E,setGeneralAccount:v,setSubsidiaryAccount:u,setAccountingObject:G,setOrderType:D}=te();return e.jsxs(K,{className:"h-full overflow-y-auto p-2 pl-5 pb-10 border-l space-y-3",spacing:1,children:[e.jsx(ot,{}),e.jsx(ue,{disabled:!0,label:"گروه",value:(y==null?void 0:y.label)??"",fullWidth:!0,InputProps:{endAdornment:!!y&&e.jsx(oe,{position:"end",onClick:()=>E(null),className:"cursor-pointer",children:e.jsx(me,{})})}}),e.jsx(ue,{disabled:!0,label:"کل",value:(l==null?void 0:l.label)??"",fullWidth:!0,InputProps:{endAdornment:!!l&&e.jsx(oe,{position:"end",onClick:()=>v(null),className:"cursor-pointer",children:e.jsx(me,{})})}}),e.jsx(ue,{disabled:!0,label:"معین",value:(j==null?void 0:j.label)??"",fullWidth:!0,InputProps:{endAdornment:!!j&&e.jsx(oe,{position:"end",onClick:()=>u(null),className:"cursor-pointer",children:e.jsx(me,{})})}}),e.jsx(ue,{disabled:!0,label:"تفصیلی",value:(N==null?void 0:N.label)??"",fullWidth:!0,InputProps:{endAdornment:!!N&&e.jsx(oe,{position:"end",onClick:()=>G(null),className:"cursor-pointer",children:e.jsx(me,{})})}}),x===h.Transaction_Report&&e.jsxs(e.Fragment,{children:[e.jsx(ve,{label:"مرتب سازی براساس",selectOption:rt,value:V,onChange:S=>$(S)}),e.jsx(ve,{label:"نوع مرتب سازی",selectOption:ct,value:M,onChange:S=>D(S)})]}),e.jsx(be,{fullWidth:!0,color:"success",onClick:()=>t(),loading:A,startIcon:e.jsx(He,{}),children:"جستجو"}),e.jsx(be,{fullWidth:!0,color:"info",onClick:()=>o(!0),loading:A,startIcon:e.jsx(Qe,{}),children:"چاپ"}),x===h.Transaction_Report&&e.jsx(be,{fullWidth:!0,color:"warning",onClick:()=>n(),loading:A,startIcon:e.jsx(Be.ExportExcel,{}),children:"خروجی اکسل"})]})},dt=()=>e.jsx(it,{}),ut=()=>{const{setSearchValue:t,handlers:{handleSearch:n}}=te();return e.jsxs(J,{container:!0,spacing:1,children:[e.jsx(J,{item:!0,xs:12,sm:6,md:4,children:e.jsx(Xe,{delay:0,onChange:o=>t(o),fullWidth:!0})}),e.jsx(J,{item:!0,xs:2,children:e.jsx(be,{onClick:n,children:e.jsx(Be.SearchIcon,{})})})]})},Te=()=>{var A,l,y,j,N,x;const{dataList:t,tabValue:n,transactionsData:o}=te();return n===h.Transaction_Report?e.jsxs(e.Fragment,{children:[e.jsxs(k,{className:"",children:[e.jsx(d,{className:"!py-1  bg-slate-100 !font-bold border-x border-t !border-slate-500",align:"center",colSpan:4,children:"جمع صفحه"}),e.jsx(d,{className:"!py-1  bg-slate-100 !font-bold border-l border-t !border-slate-500",align:"center",width:100,children:i(((A=o==null?void 0:o.extraData)==null?void 0:A.pageTotal.totalDebtorAmount)??0)}),e.jsx(d,{className:"!py-1  bg-slate-100 !font-bold border-l border-t !border-slate-500",align:"center",width:100,children:i(((l=o==null?void 0:o.extraData)==null?void 0:l.pageTotal.totalCreditorAmount)??0)}),e.jsx(d,{className:"!py-1  bg-slate-100 !font-bold border-l border-t !border-slate-500",align:"center",width:120,children:i(((y=o==null?void 0:o.extraData)==null?void 0:y.pageTotal.debtorBalance)??0)})]}),e.jsxs(k,{className:"",children:[e.jsx(d,{className:"!py-1  bg-slate-100 !font-bold  border-x !border-slate-500",align:"center",colSpan:4,children:"جمع کل"}),e.jsx(d,{className:"!py-1  bg-slate-100 !font-bold border-l !border-slate-500",align:"center",width:100,children:i(((j=o==null?void 0:o.extraData)==null?void 0:j.total.totalDebtorAmount)??0)}),e.jsx(d,{className:"!py-1  bg-slate-100 !font-bold border-l !border-slate-500",align:"center",width:100,children:i(((N=o==null?void 0:o.extraData)==null?void 0:N.total.totalCreditorAmount)??0)}),e.jsx(d,{className:"!py-1  bg-slate-100 !font-bold border-l !border-slate-500",align:"center",width:120,children:i(((x=o==null?void 0:o.extraData)==null?void 0:x.total.debtorBalance)??0)})]})]}):e.jsxs(k,{className:"",children:[e.jsx(d,{className:"!py-1  bg-slate-100 !font-bold border-x border-t !border-slate-500",align:"center",colSpan:2,width:250,children:"جمع کل"}),e.jsx(d,{className:"!py-1 bg-slate-100 !font-bold border-l border-t !border-slate-500",align:"center",width:120,children:i((t==null?void 0:t.totalDebtorAmount)??0)}),e.jsx(d,{className:"!py-1 bg-slate-100 !font-bold border-l border-t !border-slate-500",align:"center",width:120,children:i((t==null?void 0:t.totalCreditorAmount)??0)}),e.jsx(d,{className:"!py-1 bg-slate-100 !font-bold border-l border-t !border-slate-500",align:"center",width:120,children:i((t==null?void 0:t.totalDebtorBalance)??0)}),e.jsx(d,{className:"!py-1 bg-slate-100 !font-bold border-l border-t !border-slate-500",align:"center",width:120,children:i((t==null?void 0:t.totalCreditorBalance)??0)})]})},mt=()=>{var H,ae,C,le,T,ne,W,se;const{dataList:t,loading:n,printRequest:o,setPrintRequest:A,transactionsData:l,setPageInfo:y,fromDateValue:j,toDateValue:N,tabValue:x,setTabValue:V,setGeneralAccountGroup:M,setGeneralAccount:$,setSubsidiaryAccount:E,setAccountingObject:v}=te(),{data:u}=Ye(),G=()=>{switch(x){case h.Group:return"گروه";case h.Genreal_Account:return"کل";case h.Subsidiary_Account:return"معین";case h.Detailed_Account:return"تفصیلی"}},D=a=>{switch(x){case h.Group:M({label:`${a.accountNumber}-${a.accountName}`,value:a.accountId.toString()});break;case h.Genreal_Account:$({label:`${a.accountNumber}-${a.accountName}`,value:a.accountId.toString()});break;case h.Subsidiary_Account:E({label:`${a.accountNumber}-${a.accountName}`,value:a.accountId.toString()});break;case h.Detailed_Account:v({label:`${a.accountNumber}-${a.accountName}`,value:a.accountId.toString()});break}},S="مرور حساب‌ها",pe=`از تاریخ (${Y(j)}) تا (${Y(N)})`,P=[{title:`کد  ${G()}`,key:"accountNumber",dataIndex:"accountNumber",width:80,render:a=>xe(a)},{title:`عنوان  ${G()}`,key:"accountName",dataIndex:"accountName",width:150},{title:"گردش بدهکار",key:"debtorAmount",dataIndex:"debtorAmount",width:120,render:a=>i(a||0)},{title:"گردش بستانکار",key:"creditorAmount",dataIndex:"creditorAmount",width:120,render:a=>i(a||0)},{title:"مانده بدهکار",key:"debtorBalance",dataIndex:"debtorBalance",width:120,render:a=>i(a||0)},{title:"مانده بستانکار",key:"creditorBalance",dataIndex:"creditorBalance",width:120,render:a=>i(a||0)}],L=[{title:"تاریخ ثبت",key:"createDate",dataIndex:"createDate",width:100,render:a=>Y(a,"date-time")},{title:"تاریخ سند",key:"accountDocumentRegisterDate",dataIndex:"accountDocumentRegisterDate",width:100,render:a=>Y(a,"date-time")},{title:"شماره سند",key:"accountDocumentCustomId",dataIndex:"accountDocumentCustomId",width:70,render:a=>xe(a)},{title:"شرح سند",key:"description",dataIndex:"description",width:300,render:(a,m)=>`(${m.subsidiaryAccountName})-(${m.accountingObjectName})-(${a})`},{title:"بدهکار",key:"debtAmuont",dataIndex:"amount",width:100,render:(a,m)=>i(m.transactionType===Ce.Debtor?a??0:0)},{title:"بستانکار",key:"credAmuont",dataIndex:"amount",width:100,render:(a,m)=>i(m.transactionType===Ce.Creditor?a??0:0)},{title:"مانده",key:"balance",dataIndex:"balance",width:120}],I=[{id:h.Group,title:"گروه"},{id:h.Genreal_Account,title:"حساب کل"},{id:h.Subsidiary_Account,title:"حساب معین"},{id:h.Detailed_Account,title:"حساب تفصیلی"},{id:h.Transaction_Report,title:"گزارش"}],q=+x==5?[{label:"گردش صفحه بدهکار",value:i(((H=l==null?void 0:l.extraData)==null?void 0:H.pageTotal.totalDebtorAmount)||0)},{label:"گردش صفحه بستانکار",value:i(((ae=l==null?void 0:l.extraData)==null?void 0:ae.pageTotal.totalCreditorAmount)||0)},{label:"مانده صفحه بدهکار",value:i(((C=l==null?void 0:l.extraData)==null?void 0:C.pageTotal.debtorBalance)||0)},{label:"مانده صفحه بستانکار",value:i(((le=l==null?void 0:l.extraData)==null?void 0:le.pageTotal.creditorBalance)||0)},{label:"گردش کل بدهکار",value:i(((T=l==null?void 0:l.extraData)==null?void 0:T.total.totalDebtorAmount)||0)},{label:"گردش کل بستانکار",value:i(((ne=l==null?void 0:l.extraData)==null?void 0:ne.total.totalCreditorAmount)||0)},{label:"مانده کل بدهکار",value:i(((W=l==null?void 0:l.extraData)==null?void 0:W.total.debtorBalance)||0)},{label:"مانده کل بستانکار",value:i(((se=l==null?void 0:l.extraData)==null?void 0:se.total.creditorBalance)||0)}]:[{label:"گردش بدهکار",value:i((t==null?void 0:t.totalDebtorAmount)||0)},{label:"گردش بستانکار",value:i((t==null?void 0:t.totalCreditorAmount)||0)},{label:"مانده بدهکار",value:i((t==null?void 0:t.totalDebtorBalance)||0)},{label:"مانده بستانکار",value:i((t==null?void 0:t.totalCreditorBalance)||0)}],Z=c.useCallback(a=>{if(!t)return;const m=31,f=Math.ceil(t.list.length/m),w=[];for(let s=0;s<f;s++){const B=t.list.slice(m*s,m*(s+1)),U=e.jsxs("div",{children:[e.jsx(a,{}),e.jsxs(re,{size:"small",className:"!shadow-none !border-0",children:[e.jsx(ce,{children:e.jsxs(k,{className:"!bg-blue-100",children:[e.jsx(d,{style:{fontFamily:"B Nazanin"},className:"!border-l !border-l-gray-300 !w-[50px] !text-xs !text-center !font-semibold",children:"ردیف"}),P.map(p=>e.jsx(d,{className:"!border-l !border-l-gray-300 !py-0.5 !w-fit !text-center !font-semibold",style:{fontFamily:"B Nazanin"},children:p.title}))]})}),e.jsx(ie,{children:B.map((p,Q)=>e.jsxs(k,{className:"!border",children:[e.jsx(d,{style:{fontFamily:"B Nazanin"},className:"!border-l !p-0 !py-0.5 !text-xs !text-center !font-semibold",children:xe(m*s+Q+1)}),P.map(R=>{var _;return e.jsx(d,{style:{fontFamily:"B Nazanin"},className:"!border-l !p-0 !py-0.5 !text-xs !text-center !font-semibold",children:R.render?R.render(p[R.dataIndex],p,((_=t==null?void 0:t.list)==null?void 0:_.indexOf(p))??0):p[R.dataIndex]})})]},`${Q}-${p.accountId}`))})]}),s!==f-1&&e.jsx("p",{style:{fontFamily:"B Nazanin"},className:"text-left text-xs font-medium pr-2 my-5",children:`${(s+1).toLocaleString("fa-IR")}/${f.toLocaleString("fa-IR")}`})]});w.push(U)}return w.push(e.jsxs("div",{className:"flex flex-row",children:[e.jsx(K,{style:{fontFamily:"B Nazanin"},className:"!font-semibold !bg-blue-100 !border-l !border-l-gray-300 !text-xs !text-center !w-[70px] !flex !items-center !justify-center",children:"جمع کل"}),e.jsxs(re,{size:"small",className:"!shadow-none !border-0",children:[e.jsx(ce,{children:e.jsx(k,{className:"!bg-blue-100",children:q.map((s,B)=>e.jsx(d,{className:ge("!font-semibold !border-l !border-l-gray-300 !py-0 !w-fit !text-center",B===0&&"border-x"),style:{fontFamily:"B Nazanin"},children:s.label}))})}),e.jsx(ie,{children:e.jsx(k,{className:"!border",children:q.map(s=>e.jsx(d,{style:{fontFamily:"B Nazanin"},className:"!font-semibold !border-l !p-0 !py-0.5 !text-xs !text-center",children:s.value}))})})]})]}),e.jsxs("div",{className:"flex flex-1 justify-between px-2 my-5",children:[e.jsx("p",{style:{fontFamily:"B Nazanin"},className:"text-xs",children:`تاریخ گزارش گیری: (${Y(u,"date-time")})`}),e.jsx("p",{style:{fontFamily:"B Nazanin"},className:"text-left text-xs font-medium ",children:`${f.toLocaleString("fa-IR")}/${f.toLocaleString("fa-IR")}`})]})),c.createElement("div",{className:"space-y-4"},...w)},[t]),he=c.useCallback(a=>{if(!l)return;const m=30,f=Math.ceil(l.list.length/m),w=[];for(let s=0;s<f;s++){const B=l.list.slice(m*s,m*(s+1)),U=e.jsxs("div",{children:[e.jsx(a,{}),e.jsxs(re,{size:"small",className:"!shadow-none !border-0",children:[e.jsx(ce,{children:e.jsxs(k,{className:"!bg-blue-100",children:[e.jsx(d,{style:{fontFamily:"B Nazanin"},className:"!border-l !border-l-gray-300 !w-[50px] !text-xs !text-center !font-semibold",children:"ردیف"}),L.map(p=>e.jsx(d,{className:ge("!border-l !border-l-gray-300 !py-0.5 !w-fit !text-center !font-semibold",p.key==="createDate"&&"!w-[120px]"),style:{fontFamily:"B Nazanin"},children:p.title}))]})}),e.jsx(ie,{children:B.map((p,Q)=>e.jsxs(k,{className:"!border",children:[e.jsx(d,{style:{fontFamily:"B Nazanin"},className:"!border-l !p-0 !py-0.5 !text-xs !text-center !font-semibold",children:xe(m*s+Q+1)}),L.map(R=>{var _;return e.jsx(d,{style:{fontFamily:"B Nazanin"},className:"!border-l !p-0 !py-0.5 !text-xs !text-center !font-semibold",children:R.render?R.render(p[R.dataIndex],p,((_=l==null?void 0:l.list)==null?void 0:_.indexOf(p))??0):at(p[R.dataIndex])})})]},`${p.id}`))})]}),s!==f-1&&e.jsx("p",{style:{fontFamily:"B Nazanin"},className:"text-left text-xs font-medium pr-2 my-5",children:`${(s+1).toLocaleString("fa-IR")}/${f.toLocaleString("fa-IR")}`})]});w.push(U)}return w.push(e.jsxs("div",{className:"flex flex-row",children:[e.jsx(K,{style:{fontFamily:"B Nazanin"},className:"!font-semibold !bg-blue-100 !border-l !border-l-gray-300 !text-xs !text-center !w-[70px] !flex !items-center !justify-center",children:"جمع کل"}),e.jsxs(re,{size:"small",className:"!shadow-none !border-0",children:[e.jsx(ce,{children:e.jsx(k,{className:"!bg-blue-100",children:q.map((s,B)=>e.jsx(d,{className:ge("!font-semibold !border-l !border-l-gray-300 !py-0 !w-fit !text-center",B===0&&"border-x"),style:{fontFamily:"B Nazanin"},children:s.label}))})}),e.jsx(ie,{children:e.jsx(k,{className:"!border",children:q.map(s=>e.jsx(d,{style:{fontFamily:"B Nazanin"},className:"!font-semibold !border-l !p-0 !py-0.5 !text-xs !text-center",children:s.value}))})})]})]}),e.jsxs("div",{className:"flex flex-1 justify-between px-2 my-5",children:[e.jsx("p",{style:{fontFamily:"B Nazanin"},className:"text-xs",children:`تاریخ گزارش گیری: (${Y(u,"date-time")})`}),e.jsx("p",{style:{fontFamily:"B Nazanin"},className:"text-left text-xs font-medium ",children:`${f.toLocaleString("fa-IR")}/${f.toLocaleString("fa-IR")}`})]})),c.createElement("div",{className:"space-y-4"},...w)},[l]);return e.jsxs(K,{className:"overflow-auto space-y-3",children:[e.jsx(ut,{}),e.jsx(K,{width:"100%",maxWidth:"100%",children:e.jsxs(Je,{value:x.toString(),children:[e.jsx(ee,{sx:{borderBottom:1,borderColor:"divider"},children:e.jsx(Le,{variant:"scrollable",scrollButtons:"auto",onChange:(a,m)=>V(+m),className:"!min-h-[30px] !py-0 mt-1 !mr-2 !justify-center",children:I.map(a=>e.jsx(Ve,{label:a.title,value:a.id.toString(),className:"!mx-1 !py-0 !min-h-[30px] !bg-slate-300 !text-slate-500 !text-[0.9rem] !rounded-t-xl !rounded-b-none aria-selected:!bg-[#40849d] aria-selected:!text-white"},a.id))})}),I.map(a=>{var m,f,w;return e.jsx(Ze,{value:a.id.toString(),className:"!p-0",children:+a.id===h.Transaction_Report?e.jsx(Ie,{columns:L,data:(l==null?void 0:l.list)||[],rowKey:"id",boxProps:{height:"70vh"},totalCount:(m=l==null?void 0:l.pagination)==null?void 0:m.totalCount,pageNumber:(((f=l==null?void 0:l.pagination)==null?void 0:f.pageNumber)??1)-1,pageSize:((w=l==null?void 0:l.pagination)==null?void 0:w.pageSize)??25,onPaginationLoad:(s,B)=>y({page:s+1,size:B}),tableFooter:e.jsx(Te,{})}):e.jsx(Ie,{loading:n,rowKey:"accountId",columns:P||[],data:(t==null?void 0:t.list)||[],onClick:s=>D(s),boxProps:{height:"70vh"},tableFooter:e.jsx(Te,{})})},a.id)})]})}),o&&e.jsx(et,{title:S,subTitle:pe,extraInfo:"مبالغ به ريال می‌باشد",mode:"landscape",onCompleted:()=>A(!1),RepetitiveHeaderBodyContent:({PrintHeader:a})=>e.jsx(e.Fragment,{children:+x==5?he(a):Z(a)})})]})},xt=()=>e.jsxs(J,{container:!0,component:"section",className:"w-full",children:[e.jsx(J,{item:!0,xs:12,md:2,className:"!h-fit",children:e.jsx(dt,{})}),e.jsx(J,{item:!0,xs:12,md:10,className:"!h-fit px-2",children:e.jsx(mt,{})})]}),wt=()=>e.jsxs(lt,{className:"!px-4 !py-2 !space-y-2",children:[e.jsx(Me,{prevRoutes:[{path:"/",title:"داشبورد"}],currentRoute:"مرور حساب ها"}),e.jsx(nt,{children:e.jsx(xt,{})})]});export{wt as default};
