import{j as e,S as i,M as x}from"./vendor-mui-CBBEb17G.js";import{B as Y}from"./index-DQbmBtLN.js";import{S as M}from"./sidebar-LClLznnd.js";import{e as k,y as h,gM as L,go as p,r as j,aX as v,z as f,aY as w,dY as D}from"./index-DdWwwZXu.js";import{a as s}from"./vendor-react-BBazpZul.js";import"./vendor-utils-BveVE6Uf.js";import{S as C}from"./index-ilZhUWsG.js";import{m as I}from"./monthItems-DfL7pbng.js";import"./vendor-charts-tGnAgELZ.js";const y=s.createContext(void 0),P=({children:t})=>{const{serverDate:a}=k(d=>d.doctorData),{getTaxListAsync:r}=new C,[o,c]=s.useState(!1),[l,m]=s.useState(h(a).format("jYYYY")),[n,b]=s.useState(h(a).format("jM")),[g,T]=s.useState(null),N={states:{loading:o,selectedYear:l,selectedMonth:n,data:g},actions:{setSelectedYear:m,setSelectedMonth:b},handlers:{fetchData:async()=>{try{c(!0);const{data:d}=await r({Year:+l,Month:+n});d&&T(d)}finally{c(!1)}}}};return e.jsx(y.Provider,{value:N,children:t})},S=()=>s.useContext(y),A=()=>{const{states:{loading:t,selectedYear:a,selectedMonth:r},handlers:{fetchData:o},actions:{setSelectedYear:c,setSelectedMonth:l}}=S(),m=L({});return e.jsx(M,{loading:t,onSearch:o,children:e.jsxs(e.Fragment,{children:[e.jsxs(i,{spacing:1,children:[e.jsx(p,{children:"انتخاب سال"}),e.jsx(j,{items:m,value:a,onchange:n=>c(n)})]}),e.jsxs(i,{spacing:1,children:[e.jsx(p,{children:"انتخاب ماه"}),e.jsx(j,{items:I,value:r,onchange:n=>l(n)})]})]})})},B=[{title:"نام و نام خانوادگی",key:"fullName",dataIndex:"fullName",width:150},{title:"نوع قرارداد",key:"employmentType",dataIndex:"employmentType",width:120},{title:"شماره پرسنلی",key:"personnelNumber",dataIndex:"personnelNumber",width:120,render:t=>f(t??"0")},{title:"شماره بیمه",key:"insuranceNumber",dataIndex:"insuranceNumber",width:120,render:t=>f(t??"0")},{title:"مبلغ مالیات",key:"amount",dataIndex:"amount",width:120,render:t=>w(t??0)}],u=({data:t})=>e.jsx(i,{className:"!h-full",children:e.jsx(v,{columns:B,data:t,rowKey:"id"})}),K=()=>{const{states:{data:t}}=S(),[a,r]=s.useState("1"),o=[{key:"1",title:"پزشکان",component:e.jsx(u,{data:(t==null?void 0:t.doctors)??[]})},{key:"2",title:"دستیاران/پرستاران",component:e.jsx(u,{data:(t==null?void 0:t.assistants)??[]})},{key:"3",title:"منشی ها",component:e.jsx(u,{data:(t==null?void 0:t.secretaries)??[]})}];return e.jsx(i,{className:"h-full p-1 ",children:e.jsx(D,{tabValue:a,data:o,handleChange:r})})},R=()=>e.jsxs(x,{container:!0,className:"!h-full",children:[e.jsx(x,{item:!0,xs:.5,md:2.5,className:"!h-full !pb-10",children:e.jsx(A,{})}),e.jsx(x,{item:!0,xs:11.5,md:9.5,paddingX:2,className:"!h-full !pb-10 ",children:e.jsx(K,{})})]}),J=()=>e.jsxs(i,{className:"!px-4 !py-2 !space-y-2 h-full",children:[e.jsx(Y,{prevRoutes:[{path:"/",title:"داشبورد"}],currentRoute:"لیست مالیات"}),e.jsx(P,{children:e.jsx(R,{})})]});export{J as default};
