1import{ax as Nt,d4 as jt,c$ as yt,eg as wt,dr as St,d7 as Tt,r as n,j as e,A as Y,cD as ie,as as f,bi as Ct,bj as Dt,ac as Le,x as It,bk as Ot,bl as de,O as ce,J as q,b9 as $e,aI as w,dG as Be,ao as Pt,b4 as Ft,c as _e,n as Rt,bQ as Et,Y as Je,b as At,eS as Mt,eT as Gt,f0 as Lt,eU as $t,eV as Bt,eW as _t,e$ as Jt,eX as xe,bT as Ke,bv as Kt,bw as Yt,bx as Vt,by as Ut,bB as Ht}from"./index-CpeGhXo5.js";import{F as Wt}from"./FilterBar-B_jdgGzl.js";import{u as zt}from"./filters-DQMtevU2.js";import{a as Qt,b as Xt}from"./currency-CACMzR5Q.js";import{g as qt,c as Zt,m as es}from"./financeMappers-CUv1G2pV.js";import{s as Ye,a as Ve}from"./excelUtils-B6c4w-tr.js";import{S as ts}from"./scale-Bjl0IPKl.js";import"./mock-Ci00pIzy.js";const Ue=[{short:"Apr",full:"April",mIndex:3,yearOffset:0},{short:"May",full:"May",mIndex:4,yearOffset:0},{short:"Jun",full:"June",mIndex:5,yearOffset:0},{short:"Jul",full:"July",mIndex:6,yearOffset:0},{short:"Aug",full:"August",mIndex:7,yearOffset:0},{short:"Sep",full:"September",mIndex:8,yearOffset:0},{short:"Oct",full:"October",mIndex:9,yearOffset:0},{short:"Nov",full:"November",mIndex:10,yearOffset:0},{short:"Dec",full:"December",mIndex:11,yearOffset:0},{short:"Jan",full:"January",mIndex:0,yearOffset:1},{short:"Feb",full:"February",mIndex:1,yearOffset:1},{short:"Mar",full:"March",mIndex:2,yearOffset:1}];function cs(){const V=Nt(),U=jt(),i=zt(),{activeCurrency:G,exchangeRates:He,defaultRate:We}=yt(),T=i.year||2026,{data:ue,isLoading:ze,refetch:Qe}=wt({limit:2e3}),{data:me,isLoading:Xe,refetch:qe}=St({limit:2e3}),{data:pe,isLoading:Ze,refetch:et}=Tt({limit:2e3}),tt=ze||Xe||Ze,he=n.useMemo(()=>(ue?.items??[]).map(qt),[ue]),be=n.useMemo(()=>(me?.items??[]).map(Zt),[me]),fe=n.useMemo(()=>(pe?.items??[]).map(es),[pe]),d=t=>Xt(t,G,T,6,He,We),c=t=>Qt(t,G),P=G==="USD"?"$":G==="EUR"?"â¬":G==="GBP"?"£":"â¹",[E,Z]=n.useState("gst"),[H,st]=n.useState(!1),[at,ge]=n.useState([]),[rt,ee]=n.useState([]),ve=t=>{t&&i.set("months",[t]),V(`${U}/invoices`)},W=t=>{t&&i.set("months",[t]),V(`${U}/revenue`)},R=t=>{t&&i.set("months",[t]),V(`${U}/expenses`)},[L,nt]=n.useState(()=>{try{const t=localStorage.getItem("tws_gst_filing_status");return t?JSON.parse(t):{}}catch{return{}}}),[$,lt]=n.useState(()=>{try{const t=localStorage.getItem("tws_tds_deposit_status");return t?JSON.parse(t):{}}catch{return{}}}),[A,ot]=n.useState(()=>{try{const t=localStorage.getItem("tws_custom_tds_entries");return t?JSON.parse(t):[]}catch{return[]}}),[it,z]=n.useState(!1),[ke,dt]=n.useState("Sec 194J"),[S,Ne]=n.useState(""),[g,je]=n.useState(""),[v,ye]=n.useState(""),[y,B]=n.useState("10"),[k,N]=n.useState({}),[j,F]=n.useState({}),we=t=>{nt(t);try{localStorage.setItem("tws_gst_filing_status",JSON.stringify(t))}catch{}},Se=t=>{lt(t);try{localStorage.setItem("tws_tds_deposit_status",JSON.stringify(t))}catch{}},te=t=>{ot(t);try{localStorage.setItem("tws_custom_tds_entries",JSON.stringify(t))}catch{}},_=t=>{if(!t)return null;const s=new Date(t);return isNaN(s.getTime())?null:s},se=t=>{if(!i.company||i.company==="All Companies"||!t)return!0;const s=t.toLowerCase().trim(),a=i.company.toLowerCase().trim();return s.includes(a)||a.includes(s)},Te=n.useMemo(()=>{const t=[],s=new Set;for(const a of he){if(a.status==="Cancelled"||a.status==="Rejected")continue;const l=_(a.dueDate||a.date||a.entryDate);if(!l||!se(a.client||a.company))continue;const o=(a.invoiceNo||a.id).trim().toLowerCase();if(o&&!s.has(o)){s.add(o);const x=Number(a.amount||0),r=a.taxAmount!=null?Number(a.taxAmount):a.tax!=null?Number(a.tax):0,m=isNaN(r)?0:r,p=Math.max(0,x-m);t.push({id:a.id,type:"invoice",date:l,amount:p>0?p:x,taxAmount:m,company:a.client||"Tekki Web Solutions Pvt. Ltd.",client:a.client||"Client",invoiceNo:a.invoiceNo||"INV"})}}for(const a of be){if(a.status==="Cancelled"||a.status==="Rejected")continue;const l=_(a.date||a.entryDate);if(!l||!se(a.company))continue;const o=(a.invoiceNo||a.id).trim().toLowerCase();if(o&&!s.has(o)){s.add(o);const x=Number(a.net||0),r=Number(a.gross||0),m=a.tax!=null?Number(a.tax):r>x?r-x:0,p=isNaN(m)?0:m;t.push({id:a.id,type:"revenue",date:l,amount:x>0?x:r,taxAmount:p,company:a.company||"Tekki Web Solutions Pvt. Ltd.",client:a.client||"Client",invoiceNo:a.invoiceNo||"REV"})}}return t},[he,be,i.company]),Q=n.useMemo(()=>fe.filter(t=>t.status==="Rejected"||!se(t.company)?!1:!!_(t.date)),[fe,i.company]),ae=n.useMemo(()=>{const t=new Date;return Ue.map((s,a)=>{const l=T+s.yearOffset,o=`gst-${s.short.toLowerCase()}-${l}`,x=`${s.full} ${l}`,r=(s.mIndex+1)%12,m=s.mIndex===11?l+1:l,p=new Date(m,r,11),I=new Date(m,r,20),h=Te.filter(b=>b.date.getFullYear()===l&&b.date.getMonth()===s.mIndex),M=h.filter(b=>b.type==="invoice"),J=h.filter(b=>b.type==="revenue"),ne=Q.filter(b=>{const O=_(b.date);return O&&O.getFullYear()===l&&O.getMonth()===s.mIndex}),le=h.reduce((b,O)=>b+Number(O.amount||0),0),K=h.reduce((b,O)=>b+Number(O.taxAmount||0),0),X=Math.round(K/2),bt=K-X,ft=0,Re=K,Ee=ne.reduce((b,O)=>{const Ge=Number(O.tax||0);return b+(isNaN(Ge)?0:Ge)},0),gt=Math.max(0,Re-Ee),Ae=L[o];let Me="Filed",oe="Filed";t<p&&(Me="Pending"),(t<I||t>I&&t.getMonth()===r&&t.getFullYear()===m)&&(oe="Pending");const vt=Ae?.gstr1||Me,kt=Ae?.gstr3b||oe;return{id:o,monthKey:s.short,month:x,year:l,monthIndex:s.mIndex,fiscalIndex:a,outwardTaxable:le,cgstOutput:X,sgstOutput:bt,igstOutput:ft,totalGstOutput:Re,itcAvailable:Ee,netTaxPayable:gt,gstr1Status:vt,gstr3bStatus:kt,gstr1DueDate:`${l}-${String(s.mIndex+1).padStart(2,"0")}-11`,gstr3bDueDate:`${m}-${String(r+1).padStart(2,"0")}-20`,invoicesCount:M.length,revenueCount:J.length,salesCount:h.length,expensesCount:ne.length}})},[Te,Q,T,L]),u=n.useMemo(()=>!i.months||i.months.length===0?ae:ae.filter(t=>i.months.includes(t.monthKey)),[ae,i.months]),C=n.useMemo(()=>{const t=[];return Q.forEach(s=>{const a=_(s.date);if(!a)return;const l=a.getMonth(),o=a.getFullYear();if((l>=3?o:o-1)!==T)return;if(i.months&&i.months.length>0){const M=Ue.find(J=>J.mIndex===l)?.short;if(M&&!i.months.includes(M))return}const r=`${s.category||""} ${s.description||""} ${s.expenseType||""}`.toLowerCase(),m=Number(s.gross||s.net||0);if(m<=0)return;let p="",I="",h=0;if(r.includes("legal")||r.includes("professional")||r.includes("consultant")||r.includes("audit")||r.includes("advisory")?(p="Sec 194J",I=s.description||"Professional & Legal Fees Retainer",h=10):r.includes("developer")||r.includes("software")||r.includes("tech")||r.includes("it support")?(p="Sec 194J",I=s.description||"Technical & IT Consultancy Fees",h=2):r.includes("contractor")||r.includes("subcontract")||r.includes("maintenance")||r.includes("security")||r.includes("cleaning")?(p="Sec 194C",I=s.description||"Subcontractor & Facility Maintenance",h=2):r.includes("rent")||r.includes("premises")||r.includes("office space")||r.includes("lease")?(p="Sec 194I",I=s.description||"Office Premises Building Rent",h=10):(r.includes("brokerage")||r.includes("commission")||r.includes("sales commission")||r.includes("channel"))&&(p="Sec 194H",I=s.description||"Sales Brokerage & Client Commission",h=5),p&&h>0){const M=Math.round(m*h/100),J=(l+1)%12,le=`${l===11?o+1:o}
1-${String(J+1).padStart(2,"0")}-07`,K=$[s.id],X=s.status==="Paid"||s.status==="Approved";t.push({id:s.id,section:p,natureOfPayment:`${I} (${s.vendor||"Vendor"})`,vendorName:s.vendor||"Vendor",totalTaxablePaid:m,tdsRatePct:h,tdsDeducted:M,status:K||(X?"Deposited":"Pending Deposit"),dueDate:le,date:String(s.date),company:s.company||"Tekki Web Solutions Pvt. Ltd."})}}),A.forEach(s=>{const a=$[s.id];t.push({...s,status:a||s.status})}),t},[Q,T,i.months,$,A]),Ce=n.useMemo(()=>u.reduce((t,s)=>t+s.outwardTaxable,0),[u]),De=n.useMemo(()=>u.reduce((t,s)=>t+s.totalGstOutput,0),[u]),Ie=n.useMemo(()=>u.reduce((t,s)=>t+s.itcAvailable,0),[u]),Oe=n.useMemo(()=>u.reduce((t,s)=>t+s.netTaxPayable,0),[u]),Pe=n.useMemo(()=>C.filter(t=>t.status==="Pending Deposit").reduce((t,s)=>t+s.tdsDeducted,0),[C]),ct=t=>{const s=L[t]||{},a={...L,[t]:{...s,gstr3b:"Filed",gstr1:"Filed"}};we(a),w.success("Marked GSTR-1 & GSTR-3B return as Filed successfully!")},xt=t=>{const s={...$,[t]:"Deposited"};Se(s),w.success("Marked TDS deduction as Deposited to Govt Challan!")},D=(t=S,s=g,a=v,l=y)=>{const o={};t.trim()||(o.nature="Please enter nature of payment / description"),s.trim()||(o.vendor="Please enter beneficiary / vendor name");const x=parseFloat(a);(isNaN(x)||x<=0)&&(o.amount="Please enter a valid taxable amount greater than 0");const r=parseFloat(l);return(isNaN(r)||r<=0||r>100)&&(o.rate="Please enter a valid TDS percentage (1-100%)"),o},ut=()=>{const t=D();if(Object.keys(t).length>0){N(t),F({nature:!0,vendor:!0,amount:!0,rate:!0}),w.error("Please fill in all required fields correctly");return}const s=parseFloat(v),a=parseFloat(y),l=Math.round(s*a/100),x=[{id:`custom-tds-${Date.now()}`,section:ke,natureOfPayment:`${S} ${g?`(${g})`:""}`.trim(),vendorName:g||"Beneficiary",totalTaxablePaid:s,tdsRatePct:a,tdsDeducted:l,status:"Pending Deposit",dueDate:new Date(new Date().getFullYear(),new Date().getMonth()+1,7).toISOString().slice(0,10),date:new Date().toISOString().slice(0,10),company:i.company||"Tekki Web Solutions Pvt. Ltd."},...A];te(x),z(!1),Ne(""),je(""),ye(""),N({}),F({}),w.success("New statutory TDS deduction recorded successfully!")},re=()=>{Qe(),qe(),et(),w.success("Tax ledgers recalculated with active sales and purchase bills")},mt=()=>{if(E==="gst"){const t=u.map(s=>({"Month / Period":s.month,"Outward Sales (â¹)":s.outwardTaxable,"CGST (â¹)":s.cgstOutput,"SGST (â¹)":s.sgstOutput,"Total Output GST (â¹)":s.totalGstOutput,"ITC Credit Available (â¹)":s.itcAvailable,"Net Tax Payable (â¹)":s.netTaxPayable,"GSTR-1 Status":s.gstr1Status,"GSTR-3B Status":s.gstr3bStatus,"GSTR-3B Due Date":s.gstr3bDueDate}));Ye(`GST_Returns_FY${T}`,s=>{Ve(s,"GST Returns",t)}),w.success("Exported GST returns statement to Excel!")}else{const t=C.map(s=>({Section:s.section,"Nature of Payment / Beneficiary":s.natureOfPayment,"Taxable Amount (â¹)":s.totalTaxablePaid,"TDS Rate (%)":`${s.tdsRatePct}%`,"TDS Deducted (â¹)":s.tdsDeducted,"Challan Due Date":s.dueDate,"Deposit Status":s.status,Company:s.company}));Ye(`TDS_Deductions_FY${T}`,s=>{Ve(s,"TDS Deductions",t)}),w.success("Exported TDS deductions statement to Excel!")}},pt=n.useMemo(()=>[{key:"month",label:"MONTH / PERIOD",width:"175px",sortable:!0,sortValue:t=>t.fiscalIndex,defaultSortDir:"asc",render:t=>e.jsxs("div",{children:[e.jsx("span",{className:"font-bold text-slate-900 dark:text-slate-100 text-xs block",children:t.month}),e.jsxs("div",{className:"flex items-center gap-1 text-[10px] text-slate-500 dark:text-slate-400 font-normal mt-0.5 flex-wrap",children:[t.invoicesCount>0&&e.jsxs("button",{type:"button",onClick:s=>{s.stopPropagation(),ve(t.monthKey)},className:"hover:text-indigo-600 dark:hover:text-indigo-400 hover:underline cursor-pointer font-medium inline-flex items-center gap-0.5",title:`Click to view ${t.invoicesCount} client invoice(s) in Invoices for ${t.month}`,children:[t.invoicesCount," inv ",e.jsx(Y,{className:"w-2.5 h-2.5 opacity-70"})]}),t.invoicesCount>0&&t.revenueCount>0&&e.jsx("span",{children:"â¢"}),t.revenueCount>0&&e.jsxs("button",{type:"button",onClick:s=>{s.stopPropagation(),W(t.monthKey)}
1,className:"hover:text-blue-600 dark:hover:text-blue-400 hover:underline cursor-pointer font-medium inline-flex items-center gap-0.5",title:`Click to view ${t.revenueCount} sales record(s) in Revenue for ${t.month}`,children:[t.revenueCount," rev ",e.jsx(Y,{className:"w-2.5 h-2.5 opacity-70"})]}),t.salesCount===0&&e.jsx("span",{className:"text-slate-400",children:"0 sales"}),e.jsx("span",{children:"â¢"}),e.jsxs("button",{type:"button",onClick:s=>{s.stopPropagation(),R(t.monthKey)},className:"hover:text-emerald-600 dark:hover:text-emerald-400 hover:underline cursor-pointer font-medium inline-flex items-center gap-0.5",title:`Click to view ${t.expensesCount} purchase bills in Expenses for ${t.month}`,children:[t.expensesCount," bill",t.expensesCount===1?"":"s"," ",e.jsx(ie,{className:"w-2.5 h-2.5 opacity-70"})]})]})]})},{key:"outwardTaxable",label:"OUTWARD SALES (â¹)",width:"160px",align:"right",sortable:!0,defaultSortDir:"desc",render:t=>e.jsxs("button",{type:"button",onClick:()=>W(t.monthKey),className:f("font-data font-semibold text-right w-full cursor-pointer hover:underline inline-flex items-center justify-end gap-1 group",t.outwardTaxable>0?"text-slate-900 dark:text-slate-100 hover:text-blue-600 dark:hover:text-blue-400":"text-slate-400 dark:text-slate-500"),title:`View outward sales entries in Revenue for ${t.month}`,children:[e.jsx("span",{children:c(d(t.outwardTaxable))}),t.outwardTaxable>0&&e.jsx(Y,{className:"w-3 h-3 opacity-0 group-hover:opacity-100 transition-opacity text-blue-600"})]})},{key:"cgstOutput",label:"CGST (â¹)",width:"120px",align:"right",sortable:!0,defaultSortDir:"desc",render:t=>e.jsx("span",{className:"font-data text-slate-600 dark:text-slate-400",children:c(d(t.cgstOutput))})},{key:"sgstOutput",label:"SGST (â¹)",width:"120px",align:"right",sortable:!0,defaultSortDir:"desc",render:t=>e.jsx("span",{className:"font-data text-slate-600 dark:text-slate-400",children:c(d(t.sgstOutput))})},{key:"totalGstOutput",label:"TOTAL OUTPUT (â¹)",width:"150px",align:"right",sortable:!0,defaultSortDir:"desc",render:t=>
1e.jsx("span",{className:"font-data font-bold text-rose-600 dark:text-rose-400",children:c(d(t.totalGstOutput))})},{key:"itcAvailable",label:"ITC CREDIT (â¹)",width:"140px",align:"right",sortable:!0,defaultSortDir:"desc",render:t=>e.jsxs("button",{type:"button",onClick:()=>R(t.monthKey),className:f("font-data font-bold text-right w-full cursor-pointer hover:underline inline-flex items-center justify-end gap-1 group",t.itcAvailable>0?"text-emerald-600 dark:text-emerald-400 hover:text-emerald-700":"text-slate-400 dark:text-slate-500"),title:`View expense purchase bills in Expenses for ${t.month}`,children:[e.jsx("span",{children:c(d(t.itcAvailable))}),t.itcAvailable>0&&e.jsx(ie,{className:"w-3 h-3 opacity-0 group-hover:opacity-100 transition-opacity text-emerald-600"})]})},{key:"netTaxPayable",label:"NET TAX PAYABLE (â¹)",width:"160px",align:"right",sortable:!0,defaultSortDir:"desc",render:t=>e.jsx("span",{className:"font-data font-black text-blue-600 dark:text-blue-400 text-xs",children:c(d(t.netTaxPayable))})},{key:"gstr1Status",label:"GSTR-1 STATUS",width:"130px",align:"center",sortable:!0,render:t=>e.jsxs("div",{children:[e.jsx("span",{className:f("px-2 py-0.5 rounded text-[10px] font-bold inline-block",t.gstr1Status==="Filed"?"bg-emerald-100 text-emerald-800 dark:bg-emerald-950 dark:text-emerald-300":"bg-amber-100 text-amber-800 dark:bg-amber-950 dark:text-amber-300"),children:t.gstr1Status}),e.jsxs("div",{className:"text-[10px] text-slate-400 font-data mt-0.5",children:["Due: ",t.gstr1DueDate]})]})},{key:"gstr3bStatus",label:"GSTR-3B STATUS",width:"130px",align:"center",sortable:!0,render:t=>e.jsxs("div",{children:[e.jsx("span",{className:f("px-2 py-0.5 rounded text-[10px] font-bold inline-block",t.gstr3bStatus==="Filed"?"bg-emerald-100 text-emerald-800 dark:bg-emerald-950 dark:text-emerald-300":"bg-amber-100 text-amber-800 dark:bg-amber-950 dark:text-amber-300 animate-pulse"),children:t.gstr3bStatus}),e.jsxs("div",{className:"text-[10px] text-slate-400 font-data mt-0.5",children:["Due: ",t.gstr3bDueDate]})]})},{key:"action",label:"ACTION",width:"220px",align:"right",render:t=>e.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[e.jsxs(Ct,{children:[e.jsx(Dt,{asChild:!0,children:e.jsxs("button",{type:"button",className:"h-7 px-2 rounded-md border border-slate-200 dark:border-slate-700 bg-white dark:bg-slate-800 hover:bg-slate-50 dark:hover:bg-slate-700 text-slate-700 dark:text-slate-200 text-xs font-semibold inline-flex items-center gap-1 shadow-2xs cursor-pointer transition-colors",title:"Redirect to source entries for this month",children:[e.jsx(Le,{className:"w-3 h-3 text-blue-600 dark:text-blue-400"}),e.jsx("span",{children:"Source Data"}),e.jsx(It,{className:"w-2.5 h-2.5 opacity-60"})]})}),e.jsxs(Ot,{align:"end",className:"w-60",children:[t.invoicesCount>0&&e.jsxs(de,{onClick:()=>ve(t.monthKey),className:"text-xs cursor-pointer flex items-center justify-between py-1.5",children:[e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(ce,{className:"w-3.5 h-3.5 text-indigo-600"}),"Client Invoices (/invoices)"]}),e.jsx("span",{className:"font-data font-semibold text-[10px] bg-indigo-50 dark:bg-indigo-950 text-indigo-700 dark:text-indigo-300 px-1.5 py-0.5 rounded",children:t.invoicesCount})]}),e.jsxs(de,{onClick:()=>W(t.monthKey),className:"text-xs cursor-pointer flex items-center justify-between py-1.5",children:[e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(Y,{className:"w-3.5 h-3.5 text-blue-600"}),"Revenue Entries (/revenue)"]}),e.jsx("span",{className:"font-data font-semibold text-[10px] bg-blue-50 dark:bg-blue-950 text-blue-700 dark:text-blue-300 px-1.5 py-0.5 rounded",children:t.revenueCount})]}),e.jsxs(de,{onClick:()=>R(t.monthKey),className:"text-xs cursor-pointer flex items-center justify-between py-1.5",children:[e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(ie,{className:"w-3.5 h-3.5 text-emerald-600"}),"Expense Bills (/expenses)"]}),e.jsx("span",{className:"font-data font-semibold text-[10px] bg-emerald-50 dark:bg-emerald-950 text-emerald-700 dark:text-emerald-300 px-1.5 py-0.5 rounded",children:t.expensesCount})]})]})]}),t.gstr3bStatus!=="Filed"?e.jsx("button",{type:"button",onClick:()=>ct(t.id),className:"h-7 px-2.5 rounded-md bg-emerald-600 hover:bg-emerald-700 text-white font-bold text-xs shadow-2xs cursor-pointer whitespace-nowrap",children:"Mark Filed"}):e.jsxs("span",{className:"text-[11px] font-bold text-emerald-600 dark:text-emerald-400 flex items-center gap-1 px-1",children:[e.jsx(q,{className:"w-3.5 h-3.5"})," Filed"]})]})}],[c,d]),ht=n.useMemo(()=>[{key:"section",label:"SECTION",width:"110px",sortable:!0,render:t=>
1e.jsx("span",{className:"font-bold text-blue-600 dark:text-blue-400 text-xs px-2 py-0.5 rounded bg-blue-50 dark:bg-blue-950/50 border border-blue-100 dark:border-blue-900",children:t.section})},{key:"natureOfPayment",label:"NATURE OF PAYMENT / BENEFICIARY",sortable:!0,render:t=>e.jsxs("div",{children:[e.jsx("button",{type:"button",onClick:()=>R(),className:"font-semibold text-slate-800 dark:text-slate-200 text-xs block text-left hover:text-blue-600 hover:underline cursor-pointer",title:"Click to view expense in Expenses page",children:t.natureOfPayment}),e.jsx("span",{className:"text-[10px] text-slate-400 font-normal",children:t.company})]})},{key:"totalTaxablePaid",label:"TAXABLE AMOUNT (â¹)",width:"150px",align:"right",sortable:!0,defaultSortDir:"desc",render:t=>e.jsx("button",{type:"button",onClick:()=>R(),className:"font-data font-semibold hover:text-blue-600 hover:underline cursor-pointer",title:"Click to view expense voucher in Expenses",children:c(d(t.totalTaxablePaid))})},{key:"tdsRatePct",label:"TDS RATE (%)",width:"120px",align:"right",sortable:!0,render:t=>e.jsxs("span",{className:"font-data font-bold text-slate-700 dark:text-slate-300",children:[t.tdsRatePct,"%"]})},{key:"tdsDeducted",label:"TDS DEDUCTED (â¹)",width:"150px",align:"right",sortable:!0,defaultSortDir:"desc",render:t=>
1e.jsx("span",{className:"font-data font-bold text-rose-600 dark:text-rose-400",children:c(d(t.tdsDeducted))})},{key:"dueDate",label:"CHALLAN DUE DATE",width:"140px",align:"center",sortable:!0,sortValue:t=>t.dueDate?new Date(t.dueDate).getTime():0,defaultSortDir:"asc",render:t=>e.jsx("span",{className:"font-data text-slate-600 dark:text-slate-400",children:t.dueDate})},{key:"status",label:"DEPOSIT STATUS",width:"140px",align:"center",sortable:!0,render:t=>e.jsx("span",{className:f("px-2 py-0.5 rounded text-[10px] font-bold",t.status==="Deposited"?"bg-emerald-100 text-emerald-800 dark:bg-emerald-950 dark:text-emerald-300":"bg-amber-100 text-amber-800 dark:bg-amber-950 dark:text-amber-300 animate-pulse"),children:t.status})},{key:"action",label:"ACTION",width:"220px",align:"right",render:t=>e.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[e.jsxs("button",{type:"button",onClick:()=>R(),className:"h-7 px-2 rounded-md border border-slate-200 dark:border-slate-700 bg-white dark:bg-slate-800 hover:bg-slate-50 dark:hover:bg-slate-700 text-slate-700 dark:text-slate-200 text-xs font-semibold inline-flex items-center gap-1 shadow-2xs cursor-pointer transition-colors",title:"Redirect to source expense in Expenses page",children:[e.jsx(Le,{className:"w-3 h-3 text-blue-600"}),e.jsx("span",{children:"Source Bill"})]}),t.status==="Pending Deposit"?e.jsx("button",{type:"button",onClick:()=>xt(t.id),className:"h-7 px-2.5 rounded-md bg-blue-600 hover:bg-blue-700 text-white font-bold text-xs shadow-2xs cursor-pointer whitespace-nowrap",children:"Deposit"}):e.jsxs("span",{className:"text-[11px] font-bold text-emerald-600 flex items-center gap-1 px-1",children:[e.jsx(q,{className:"w-3.5 h-3.5"})," Deposited"]}),t.id.startsWith("custom-tds-")&&e.jsx("button",{type:"button",onClick:()=>{const s=A.filter(a=>a.id!==t.id);te(s),w.success("Custom TDS deduction removed")},className:"h-7 w-7 rounded-md border border-slate-200 dark:border-slate-700 bg-white dark:bg-slate-800 hover:bg-rose-50 hover:border-rose-300 text-slate-400 hover:text-rose-600 inline-flex items-center justify-center shadow-2xs cursor-pointer transition-colors",title:"Delete this custom entry",children:e.jsx($e,{className:"w-3.5 h-3.5"})})]})}],[c,d,A]),Fe=e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-1 bg-slate-100 dark:bg-slate-800/80 p-0.5 rounded-lg border border-slate-200 dark:border-slate-700 shrink-0",children:[e.jsxs("button",{type:"button",onClick:()=>Z("gst"),className:f("px-3 py-1 text-xs font-semibold rounded-md transition-all cursor-pointer flex items-center gap-1.5 whitespace-nowrap",E==="gst"?"bg-white dark:bg-slate-900 text-rose-600 dar
1k:text-rose-400 shadow-2xs":"text-slate-600 dark:text-slate-400 hover:text-slate-900"),children:[e.jsx(Be,{className:"w-3.5 h-3.5"})," Monthly GST Returns"]}),e.jsxs("button",{type:"button",onClick:()=>Z("tds"),className:f("px-3 py-1 text-xs font-semibold rounded-md transition-all cursor-pointer flex items-center gap-1.5 whitespace-nowrap",E==="tds"?"bg-white dark:bg-slate-900 text-blue-600 dark:text-blue-400 shadow-2xs":"text-slate-600 dark:text-slate-400 hover:text-slate-900"),children:[e.jsx(ce,{className:"w-3.5 h-3.5"})," TDS Deductions (Sec 194C / 194J)"]})]}),E==="tds"&&e.jsxs("button",{type:"button",onClick:()=>z(!0),className:"h-7 px-2.5 rounded-md bg-blue-600 hover:bg-blue-700 text-white text-xs font-semibold inline-flex items-center gap-1 shadow-2xs cursor-pointer",children:[e.jsx(Pt,{className:"w-3.5 h-3.5"})," Record TDS Entry"]})]});return e.jsxs("div",{className:"flex flex-col flex-1 h-full min-h-0 overflow-hidden bg-slate-50/50 dark:bg-slate-950/50 text-slate-800 dark:text-slate-100",children:[e.jsx(Ft,{title:"Taxes & Statutory Duties Management",subtitle:"Monthly GST returns (GSTR-1 & 3B), Input Tax Credit (ITC) reconciliation, and TDS deductions",accentVar:"--mod-finance",showMonthYearFilter:!1}),e.jsx("div",{className:"shrink-0 bg-white dark:bg-slate-900 border-b border-slate-200 dark:border-slate-800 px-4 py-2 flex items-center justify-between flex-wrap gap-2 shadow-2xs",children:e.jsx(Wt,{showMonths:!0,actions:e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsxs("button",{type:"button",onClick:()=>st(!H),className:f("h-8 px-2.5 rounded-md border text-xs font-medium inline-flex items-center gap-1.5 transition-colors shadow-2xs cursor-pointer",H?"bg-blue-50 text-blue-700 border-blue-200 dark:bg-blue-950/50 dark:text-blue-300 dark:border-blue-800":"bg-white dark:bg-slate-800 border-slate-200 dark:border-slate-700 text-slate-700 dark:text-slate-200 hover:bg-slate-50 dark:hover:bg-slate-800"),title:"Toggle Monthly Tax Trends Chart",children:[e.jsx(_e,{className:"w-3.5 h-3.5"}),e.jsx("span",{className:"hidden sm:inline",children:H?"Hide Visuals":"Tax Trends"})]}),e.jsx("button",{type:"button",onClick:re,className:"h-8 p-2 rounded-md border border-slate-200 dark:border-slate-700 bg-white dark:bg-slate-800 hover:bg-slate-50 text-slate-600 dark:text-slate-300 transition-colors shadow-2xs cursor-pointer",title:"Recalculate with Live Ledgers",children:e.jsx(Rt,{className:f("w-3.5 h-3.5",tt&&"animate-spin text-blue-600")})}),e.jsxs("button",{type:"button",onClick:mt,className:"h-8 px-2.5 rounded-md border border-slate-200 dark:border-slate-700 bg-white dark:bg-slate-800 hover:bg-slate-50 text-slate-700 dark:text-slate-200 font-semibold text-xs inline-flex items-center gap-1.5 shadow-2xs cursor-pointer",title:"Export to Excel (.xlsx)",children:[e.jsx(Et,{className:"w-3.5 h-3.5 text-emerald-600"}),e.jsx("span",{className:"hidden sm:inline",children:"Export"})]}),e.jsxs("button",{type:"button",onClick:()=>V(`${U}/calendar`),className:"h-8 px-3 rounded-md border border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-900 hover:bg-slate-50 text-slate-700 dark:text-slate-300 font-bold text-xs flex items-center gap-1.5 shadow-2xs cursor-pointer",children:[e.jsx(Je,{className:"w-3.5 h-3.5 text-rose-600"})," View Tax Calendar"]})]})})}),e.jsx("div",{className:"shrink-0 px-3 sm:px-4 pt-3",children:e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-2.5",children:[e.jsxs("div",{onClick:()=>W(),className:"p-2.5 sm:p-3 bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-xl shadow-2xs cursor-pointer hover:border-blue-300 transition-colors group",title:"Click to redirect to Revenue & Sales",children:[e.jsxs("div",{className:"flex items-center justify-between text-xs text-slate-500 dark:text-slate-400 mb-1",children:[e.jsx("span",{className:"font-semibold uppercase tracking-wider text-[10px] group-hover:text-blue-600",children:"Outward Sales"}),e.jsx(Y,{className:"w-3.5 h-3.5 text-blue-600 dark:text-blue-400"})]}),e.jsxs("div",{className:"text-sm sm:text-base font-bold font-data text-slate-900 dark:text-slate-100",children:[P," ",Ce.toLocaleStr
1ing("en-IN",{maximumFractionDigits:0})]}),e.jsxs("div",{className:"text-[10px] text-slate-500 dark:text-slate-400 mt-1 flex items-center justify-between",children:[e.jsx("span",{children:"Active Revenue"}),e.jsx("span",{className:"text-blue-600 text-[9px] font-semibold opacity-0 group-hover:opacity-100 transition-opacity",children:"View â"})]})]}),e.jsxs("div",{className:"p-2.5 sm:p-3 bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-xl shadow-2xs",children:[e.jsxs("div",{className:"flex items-center justify-between text-xs text-slate-500 dark:text-slate-400 mb-1",children:[e.jsx("span",{className:"font-semibold uppercase tracking-wider text-[10px]",children:"Output GST"}),e.jsx(Be,{className:"w-3.5 h-3.5 text-rose-600 dark:text-rose-400"})]}),e.jsxs("div",{className:"text-sm sm:text-base font-bold font-data text-rose-600 dark:text-rose-400",children:[P," ",De.toLocaleString("en-IN",{maximumFractionDigits:0})]}),e.jsx("div",{className:"text-[10px] text-slate-500 dark:text-slate-400 mt-1",children:"CGST + SGST (18% Slab)"})]}),e.jsxs("div",{onClick:()=>R(),className:"p-2.5 sm:p-3 bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-xl shadow-2xs cursor-pointer hover:border-emerald-300 transition-colors group",title:"Click to redirect to Expenses & Purchase Bills",children:[e.jsxs("div",{className:"flex items-center justify-between text-xs text-slate-500 dark:text-slate-400 mb-1",children:[e.jsx("span",{className:"font-semibold uppercase tracking-wider text-[10px] group-hover:text-emerald-600",children:"ITC Claimed"}),e.jsx(At,{className:"w-3.5 h-3.5 text-emerald-600 dark:text-emerald-400"})]}),e.jsxs("div",{className:"text-sm sm:text-base font-bold font-data text-emerald-600 dark:text-emerald-400",children:[P," ",Ie.toLocaleString("en-IN",{maximumFractionDigits:0})]}),e.jsxs("div",{className:"text-[10px] text-emerald-600 dark:text-emerald-400 font-semibold mt-1 flex items-center justify-between",children:[e.jsx("span",{children:"Expense Credits"}),e.jsx("span",{className:"text-[9px] opacity-0 group-hover:opacity-100 transition-opacity",children:"View â"})]})]}),e.jsxs("div",{className:"p-2.5 sm:p-3 bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-xl shadow-2xs",children:[e.jsxs("div",{className:"flex items-center justify-between text-xs text-slate-500 dark:text-slate-400 mb-1",children:[e.jsx("span",{className:"font-semibold uppercase tracking-wider text-[10px]",children:"Net GST Payable"}),e.jsx(ts,{className:"w-3.5 h-3.5 text-purple-600 dark:text-purple-400"})]}),e.jsxs("div",{className:"text-sm sm:text-base font-bold font-data text-purple-600 dark:text-purple-400",children:[P," ",Oe.toLocaleString("en-IN",{maximumFractionDigits:0})]}),e.jsx("div",{className:"text-[10px] text-slate-500 dark:text-slate-400 mt-1",children:"Output GST minus ITC"})]}),e.jsxs("div",{onClick:()=>Z("tds"),className:"p-2.5 sm:p-3 bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-xl shadow-2xs col-span-2 md:col-span-1 cursor-pointer hover:border-amber-300 transition-colors group",title:"Click to view pending TDS entries",children:[e.jsxs("div",{className:"flex items-center justify-between text-xs text-slate-500 dark:text-slate-400 mb-1",children:[e.jsx("span",{className:"font-semibold uppercase tracking-wider text-[10px] group-hover:text-amber-600",children:"Pending TDS"}),e.jsx(Je,{className:"w-3.5 h-3.5 text-amber-600 dark:text-amber-400"})]}),e.jsxs("div",{className:"text-sm sm:text-base font-bold font-data text-amber-600 dark:text-amber-400",children:[P," ",Pe.toLocaleString("en-IN",{maximumFractionDigits:0})]}),e.jsxs("div",{className:"text-[10px] text-slate-500 dark:text-slate-400 mt-1 flex items-center justify-between",children:[e.jsx("span",{children:"Challan Deposit Due"}),e.jsx("span",{className:"text-amber-600 text-[9px] font-semibold opacity-0 group-hover:opacity-100 transition-opacity",children:"Review â"})]})]})]})}),H&&e.jsx("div",{className:"shrink-0 px-3 sm:px-4 pt-3",children:e.jsxs("div",{className:"p-3 bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-xl shadow-2xs animate-in fade-in duration-200",children:[e.jsxs("h4",{className:"text-xs font-bold text-slate-800 dark:text-slate-200 mb-2 flex items-center gap-1.5",children:[e.jsx(_e,{className:"w-3.5 h-3.5 text-blue-600"})," Fiscal Monthly Tax Trends (Output GST vs ITC Credit vs Net Payable)"]}),e.jsx("div",{className:"h-44 w-full",children:e.jsx(Mt,{width:"100%",height:"100%",children:e.jsxs(Gt,{data:u,margin:{top:10,right:20,left
1:10,bottom:5},children:[e.jsx(Lt,{strokeDasharray:"3 3",vertical:!1,opacity:.2}),e.jsx($t,{dataKey:"monthKey",tick:{fontSize:10}}),e.jsx(Bt,{tick:{fontSize:10},tickFormatter:t=>`${P}${(t/1e3).toFixed(0)}k`}),e.jsx(_t,{formatter:t=>[`${P} ${Number(t).toLocaleString("en-IN")}`]}),e.jsx(Jt,{wrapperStyle:{fontSize:11}}),e.jsx(xe,{dataKey:"totalGstOutput",name:"Total Output GST",fill:"#f43f5e",radius:[3,3,0,0]}),e.jsx(xe,{dataKey:"itcAvailable",name:"ITC Credit",fill:"#10b981",radius:[3,3,0,0]}),e.jsx(xe,{dataKey:"netTaxPayable",name:"Net Tax Payable",fill:"#3b82f6",radius:[3,3,0,0]})]})})})]})}),E==="gst"&&e.jsxs("div",{className:"p-3 flex-1 min-h-0 flex flex-col overflow-hidden",children:[e.jsx("div",{className:"flex-1 min-h-0 flex flex-col",children:e.jsx(Ke,{fillHeight:!0,toolbar:Fe,searchKeys:["month","gstr1Status","gstr3bStatus"],searchPlaceholder:"Search GST returns, months, status...",selectable:!0,selectedIds:at,onSelectionChange:ge,initialClientSortKey:"month",initialClientSortDir:"asc",onClearFilters:()=>i.set("months",[]),clearFiltersLabel:"Reset Month Filters",onRefresh:re,bulkActions:[{id:"mark-filed",label:"Mark Selected as Filed",icon:e.jsx(q,{className:"w-3.5 h-3.5 text-emerald-600"}),onAction:t=>{const s={...L};t.forEach(a=>{s[a.id]={gstr1:"Filed",gstr3b:"Filed"}}),we(s),ge([]),w.success(`Marked ${t.length} GST return(s) as Filed`)}}],rows:u,columns:pt,rowKey:t=>t.id,storageKey:"gst-returns-datatable-v3",initialPageSize:25,empty:"No GST returns matching current fiscal filter"})}),e.jsxs("div",{className:"shrink-0 mt-2 px-3 py-2 bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-lg flex items-center justify-between flex-wrap gap-2 text-xs shadow-2xs",children:[e.jsxs("div",{className:"flex items-center gap-3 sm:gap-4 flex-wrap",children:[e.jsxs("span",{className:"font-bold text-slate-800 dark:text-slate-200",children:["FY ",T,"-",String(T+1).slice(-2)," Ledger Totals (",u.length," Months):"]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"text-slate-500 dark:text-slate-400",children:"Sales:"}),e.jsx("span",{className:"font-data font-semibold text-slate-900 dark:text-slate-100",children:c(d(Ce))})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"text-slate-500 dark:text-slate-400",children:"Output GST:"}),e.jsx("span",{className:"font-data font-bold text-rose-600 dar
1k:text-rose-400",children:c(d(De))})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"text-slate-500 dark:text-slate-400",children:"ITC Claimed:"}),e.jsx("span",{className:"font-data font-bold text-emerald-600 dark:text-emerald-400",children:c(d(Ie))})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"text-slate-500 dark:text-slate-400",children:"Net Payable:"}),e.jsx("span",{className:"font-data font-black text-blue-600 dark:text-blue-400",children:c(d(Oe))})]})]}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs("span",{className:"text-[11px] font-semibold text-slate-600 dark:text-slate-400",children:["Filing Status:"," ",e.jsxs("span",{className:"text-emerald-600 dark:text-emerald-400 font-bold",children:[u.filter(t=>t.gstr3bStatus==="Filed").length," / ",u.length," Filed"]})]})})]})]}),E==="tds"&&e.jsxs("div",{className:"p-3 flex-1 min-h-0 flex flex-col overflow-hidden",children:[e.jsx("div",{className:"flex-1 min-h-0 flex flex-col",children:e.jsx(Ke,{fillHeight:!0,toolbar:Fe,searchKeys:["section","natureOfPayment","vendorName","status"],searchPlaceholder:"Search section, beneficiary, vendor, status...",selectable:!0,selectedIds:rt,onSelectionChange:ee,initialClientSortKey:"dueDate",initialClientSortDir:"asc",onClearFilters:()=>i.set("months",[]),clearFiltersLabel:"Reset Filters",onRefresh:re,bulkActions:[{id:"mark-deposited",label:"Mark Selected as Deposited",icon:e.jsx(q,{className:"w-3.5 h-3.5 text-blue-600"}),onAction:t=>{const s={...$};t.forEach(a=>{s[a.id]="Deposited"}),Se(s),ee([]),w.success(`Marked ${t.length} TDS entry/entries as Deposited`)}},{id:"delete-custom",label:"Delete Custom Entries",icon:e.jsx($e,{className:"w-3.5 h-3.5"}),variant:"destructive",onAction:t=>{const s=new Set(t.map(l=>l.id)),a=A.filter(l=>!s.has(l.id));te(a),ee([]),w.success("Removed selected custom entries")}}],rows:C,columns:ht,rowKey:t=>t.id,storageKey:"tds-deductions-datatable-v3",initialPageSize:25,empty:"No statutory TDS deductions matching current criteria"})}),e.jsxs("div",{className:"shrink-0 mt-2 px-3 py-2 bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-lg flex items-center justify-between flex-wrap gap-2 text-xs shadow-2xs",children:[e.jsxs("div",{className:"flex items-center gap-3 sm:gap-4 flex-wrap",children:[e.jsxs("span",{className:"font-bold text-slate-800 dark:text-slate-200",children:["TDS Statutory Liability (",C.length," Entries):"]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"text-slate-500 dark:text-slate-400",children:"Taxable Paid:"}),e.jsx("span",{className:"font-data font-semibold text-slate-900 dark:text-slate-100",children:c(d(C.reduce((t,s)=>t+s.totalTaxablePaid,0)))})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"text-slate-500 dark:text-slate-400",children:"Total Deducted:"}),e.jsx("span",{className:"font-data font-bold text-rose-600 dar
1k:text-rose-400",children:c(d(C.reduce((t,s)=>t+s.tdsDeducted,0)))})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"text-slate-500 dark:text-slate-400",children:"Pending Deposit:"}),e.jsx("span",{className:"font-data font-black text-amber-600 dark:text-amber-400",children:c(d(Pe))})]})]}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs("span",{className:"text-[11px] font-semibold text-slate-600 dark:text-slate-400",children:["Deposit Progress:"," ",e.jsxs("span",{className:"text-blue-600 dark:text-blue-400 font-bold",children:[C.filter(t=>t.status==="Deposited").length," / ",C.length," Deposited"]})]})})]})]}),e.jsx(Kt,{open:it,onOpenChange:t=>{z(t),t||(N({}),F({}))},children:e.jsxs(Yt,{className:"sm:max-w-[440px]",children:[e.jsx(Vt,{children:e.jsxs(Ut,{className:"text-sm font-bold flex items-center gap-2 text-slate-900 dark:text-slate-100",children:[e.jsx(ce,{className:"w-4 h-4 text-blue-600"})," Record Statutory TDS Deduction"]})}),e.jsxs("div",{className:"space-y-3 py-2 text-xs",children:[e.jsxs("div",{children:[e.jsx("label",{className:"font-semibold text-slate-700 dark:text-slate-300 block mb-1",children:"Income Tax Section"}),e.jsxs("select",{value:ke,onChange:t=>{const s=t.target.value;dt(s),s==="Sec 194J"?B("10"):s==="Sec 194C"?B("2"):s==="Sec 194I"?B("10"):s==="Sec 194H"&&B("5")},className:"w-full h-8 px-2 rounded-md border border-slate-200 dark:border-slate-700 bg-white dark:bg-slate-800 text-xs",children:[e.jsx("option",{value:"Sec 194J",children:"Sec 194J - Professional & Technical Fees (10%)"}),e.jsx("option",{value:"Sec 194C",children:"Sec 194C - Contractors & Subcontractors (2%)"}),e.jsx("option",{value:"Sec 194I",children:"Sec 194I - Rent of Premises & Real Estate (10%)"}),e.jsx("option",{value:"Sec 194H",children:"Sec 194H - Brokerage & Commission (5%)"})]})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"font-semibold text-slate-700 dark:text-slate-300 block mb-1",children:["Nature of Payment / Description ",e.jsx("span",{className:"text-rose-500",children:"*"})]}),e.jsx("input",{type:"text",placeholder:"e.g. Legal Retainer or Server Infrastructure",value:S,onChange:t=>{Ne(t.target.value),j.nature&&N(D(t.target.value,g,v,y))},onBlur:()=>{F(t=>({...t,nature:!0})),N(D(S,g,v,y))},className:f("w-full h-8 px-2.5 rounded-md border bg-white dark:bg-slate-800 text-xs transition-colors",j.nature&&k.nature?"border-rose-500 focus:border-rose-500 focus:ring-1 focus:ring-rose-500":"border-slate-200 dark:border-slate-700")}),j.nature&&k.nature&&e.jsx("p",{className:"text-[11px] text-rose-500 font-medium mt-1 animate-in fade-in duration-150",children:k.nature})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"font-semibold text-slate-700 dark:text-slate-300 block mb-1",children:["Beneficiary / Vendor Name ",e.jsx("span",{className:"text-rose-500",children:"*"})]}),e.jsx("input",{type:"text",placeholder:"e.g. Acme Legal LLP",value:g,onChange:t=>{je(t.target.value),j.vendor&&N(D(S,t.target.value,v,y))},onBlur:()=>{F(t=>({...t,vendor:!0})),N(D(S,g,v,y))},className:f("w-full h-8 px-2.5 rounded-md border bg-white dark:bg-slate-800 text-xs transition-colors",j.vendor&&k.vendor?"border-rose-500 focus:border-rose-500 focus:ring-1 focus:ring-rose-500":"border-slate-200 dark:border-slate-700")}),j.vendor&&k.vendor&&e.jsx("p",{className:"text-[11px] text-rose-500 font-medium mt-1 animate-in fade-in duration-150",children:k.vendor})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"font-semibold text-slate-700 dark:text-slate-300 block mb-1",children:["Taxable Amount (â¹) ",e.jsx("span",{className:"text-rose-500",children:"*"})]}),e.jsx("input",{type:"number",placeholder:"e.g. 50000",value:v,onChange:t=>{ye(t.target.value),j.amount&&N(D(S,g,t.target.value,y))},onBlur:()=>{F(t=>({...t,amount:!0})),N(D(S,g,v,y))},className:f("w-full h-8 px-2.5 rounded-md border bg-white dark:bg-slate-800 text-xs font-data transition-colors",j.amount&&k.amount?"border-rose-500 focus:border-rose-500 focus:ring-1 focus:ring-rose-500":"border-slate-200 dark:border-slate-700")}),j.amount&&k.amount&&e.jsx("p",{className:"text-[11px] text-rose-500 font-medium mt
1-1 animate-in fade-in duration-150",children:k.amount})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"font-semibold text-slate-700 dark:text-slate-300 block mb-1",children:["TDS Rate (%) ",e.jsx("span",{className:"text-rose-500",children:"*"})]}),e.jsx("input",{type:"number",value:y,onChange:t=>{B(t.target.value),j.rate&&N(D(S,g,v,t.target.value))},onBlur:()=>{F(t=>({...t,rate:!0})),N(D(S,g,v,y))},className:f("w-full h-8 px-2.5 rounded-md border bg-white dark:bg-slate-800 text-xs font-data transition-colors",j.rate&&k.rate?"border-rose-500 focus:border-rose-500 focus:ring-1 focus:ring-rose-500":"border-slate-200 dark:border-slate-700")}),j.rate&&k.rate&&e.jsx("p",{className:"text-[11px] text-rose-500 font-medium mt-1 animate-in fade-in duration-150",children:k.rate})]})]}),parseFloat(v)>0&&e.jsxs("div",{className:"p-2 rounded bg-blue-50 dark:bg-blue-950/40 text-blue-800 dark:text-blue-300 flex justify-between font-semibold",children:[e.jsx("span",{children:"Calculated TDS:"}),e.jsxs("span",{className:"font-data",children:[P," ",Math.round(parseFloat(v)*parseFloat(y)/100).toLocaleString("en-IN")]})]})]}),e.jsxs(Ht,{className:"gap-2",children:[e.jsx("button",{type:"button",onClick:()=>{z(!1),N({}),F({})},className:"px-3 py-1.5 rounded-md border border-slate-200 dark:border-slate-700 text-xs font-medium hover:bg-slate-50 dark:hover:bg-slate-800 cursor-pointer",children:"Cancel"}),e.jsx("button",{type:"button",onClick:ut,className:"px-3 py-1.5 rounded-md bg-blue-600 hover:bg-blue-700 text-white text-xs font-semibold shadow-2xs cursor-pointer",children:"Save Deduction"})]})]})})]})}export{cs as TaxesPage,cs as default};
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.