PageSourceSearch

https://vizops360.ai/assets/finance.bank-accounts-DJ68uNJZ.js

js vizops360.ai collected 2026-10-05 13:52:58 UTC 28,915 bytes, 1 lines download raw bytes

1import{d3 as je,E as ye,j as e,d4 as ve,ax as we,e7 as Ce,r as n,aH as Ae,c_ as Be,en as Se,eo as De,ep as Ie,b4 as Pe,b3 as J,bN as F,bO as E,L as Y,cI as X,bP as R,ao as Te,bT as Le,dG as M,as as j,bf as Ue,b9 as C,bv as Fe,bw as Ee,by as Re,bz as Me,ea as O,ar as c,A as Oe,cD as We,ab as _e,b8 as Ke,ap as Z,n as qe,b5 as $e,eq as ee,er as ae,es as te,et as se,eu as re,ev as ne,ew as le,ex as oe,aI as p}from"./index-CpeGhXo5.js";import{F as Qe}from"./FilterBar-B_jdgGzl.js";import{e as ce,j as Ge}from"./financeMappers-CUv1G2pV.js";import{NewBankAccountPage as Ve}from"./finance.bank-accounts.new-CTcFK2kM.js";import{BankStatementsImportPage as He}from"./finance.bank-statements.import-nF-hmSlV.js";import{u as ze,a as Je}from"./companySettingsMockApi-D8Uh5efq.js";import{u as Ye}from"./filters-DQMtevU2.js";import{Q as ie}from"./qr-code-aLso372O.js";import"./mock-Ci00pIzy.js";import"./Panel-Cf_wAUzv.js";import"./expenseDraft-DqR0Jp71.js";import"./file-check-DgOG7DHv.js";import"./seedData-BKFJmuM9.js";import"./lock-open-Cmtyk41m.js";const Xe=["HDFC Bank","ICICI Bank","State Bank of India (SBI)","Axis Bank","Kotak Mahindra Bank","Bank of Baroda","Punjab National Bank (PNB)","HSBC Bank","Citi Bank","Standard Chartered Bank","Yes Bank","IndusInd Bank"],A=m=>m==null||isNaN(Number(m))?"₹0.00":Number(m).toLocaleString("en-IN",{style:"currency",currency:"INR",minimumFractionDigits:2,maximumFractionDigits:2});function ha(){const m=je();if(m)return m;const{pathname:B}=ye();if(B.includes("/bank-accounts/new"))return e.jsx(Ve,{});if(B.includes("/bank-accounts/import")||B.includes("/bank-statements/import"))return e.jsx(He,{});const y=ve(),W=we(),{data:i,isLoading:de,isFetching:xe,refetch:g}=Ce({limit:500},{refetchOnMountOrArgChange:!0}),[_,S]=n.useState([]),[me,K]=n.useState(!1),u=n.useCallback(async()=>{try{K(!0);const a=localStorage.getItem("tenant_slug")||"tekki-web-solutions",t=await Ae.get(`/finance/bank-accounts?limit=500&tenantSlug=${a}`),r=t.data?.data?.items||t.data?.items||(Array.isArray(t.data?.data)?t.data.data:Array.isArray(t.data)?t.data:[]);Array.isArray(r)&&S(r.map(ce).reverse())}catch(a){console.error("[BankAccounts] Direct fetch error:",a)}finally{K(!1)}},[]);n.useEffect(()=>{g(),u()},[u]);const{data:q=[]}=ze(),{data:$=[]}=Je(),{data:Q=[]}=Be(),[ue]=Se(),[he]=De(),[G]=Ie(),[be,D]=n.useState([]),[pe,V]=n.useState(!1),v=Ye(),ge=n.useMemo(()=>{const a=["Tekki Web Solutions Pvt. Ltd."],t=new Set(["Tekki Web Solutions Pvt. Ltd."]);(q||[]).forEach(r=>{r?.name&&!t.has(r.name.trim())&&(a.push(r.name.trim()),t.add(r.name.trim()))}),($||[]).forEach(r=>{r?.name&&!t.has(r.name.trim())&&(a.push(r.name.trim()),t.add(r.name.trim()))}),(Q||[]).forEach(r=>{r?.name&&!t.has(r.name.trim())&&(a.push(r.name.trim()),t.add(r.name.trim()))});try{["hrms_company_settings_subs","mock_sub_companies_data","hrms_company_entities"].forEach(r=>{const x=localStorage.getItem(r);if(x){const b=JSON.parse(x);Array.isArray(b)&&b.forEach(U=>{const w=U.name||U.companyName;w&&!t.has(w.trim())&&(a.push(w.trim()),t.add(w.trim()))})}})}catch{}return a},[q,$,Q]),I=n.useMemo(()=>{const a=Array.isArray(i)?i:Array.isArray(i?.items)?i.items:Array.isArray(i?.data?.items)?i.data.items:Array.isArray(i?.data)?i.data:[];return i!==void 0?a.map(ce).reverse():_},[i,_]),d=n.useMemo(()=>{if(!v.company||v.company==="All Companies")return I;const a=v.company.toLowerCase().trim();return I.filter(t=>{const r=(t.company||"").toLowerCase().trim();return r?r===a||(a==="tekki web solutions pvt. ltd."||a==="tekki web solutions"||a==="tws")&&(r==="tekki web solutions pvt. ltd."||r==="tekki web solutions"||r==="tws")?!0:r.includes(a)||a.includes(r):!1})},[I,v.company]),[fe,P]=n.useState(!1),[f,Ze]=n.useState(null),[k,T]=n.useState(null),[N,L]=n.useState([]),[H,z]=n.useState(!1),[s,l]=n.useState({company:"Tekki Web Solutions Pvt. Ltd.",account:"",bank:"",accountNo:"",type:"Current",branch:"",bankAddress:"",ifscCode:"",swiftCode:"",upiId:"",qrCodeUrl:"",balance:"",beginningBalance:"",totalDeposits:"",totalWithdrawals:"",lastUpdated:""}),[o,h]=n.useState({});n.useMemo(()=>d.reduce((a,t)=>a+(t.balance||0),0),[d]),n.useMemo(()=>d.reduce((a,t)=>a+(t.beginningBalance||0),0),[d]),n.useMemo(()=>d.reduce((a,t)=>a+(t.totalDeposits||0),0),[d]),n.useMemo(()=>d.reduce((a,t)=>a+(t.totalWithdrawals||0),0),[d]);const ke=()=>{const a={};return s.company.trim()||(a.company="Company name is required"),s.account.trim()||(a.account="Account name is required"),s.bank.trim()||(a.bank="Bank name is required"),s.accountNo.trim()?/^\d+$/.test(s.accountNo.trim())||(a.accountNo="Account number must contain numbers only"):a.accountNo="Account number is required (numbers only)",h(a),Object.keys(a).length===0},Ne=async()=>
1{if(!ke())return;z(!0);const a=parseFloat(s.beginningBalance)||0,t=parseFloat(s.totalDeposits)||0,r=parseFloat(s.totalWithdrawals)||0;let x=parseFloat(s.balance);isNaN(x)&&(x=a+t-r);const b=Ge({company:s.company.trim(),account:s.account.trim(),bank:s.bank.trim(),accountNo:s.accountNo.trim(),type:s.type,branch:s.branch.trim(),bankAddress:s.bankAddress.trim(),ifscCode:s.ifscCode.trim().toUpperCase(),swiftCode:s.swiftCode.trim().toUpperCase(),upiId:s.upiId.trim(),qrCodeUrl:s.qrCodeUrl.trim(),balance:x,beginningBalance:a,totalDeposits:t,totalWithdrawals:r,lastUpdated:s.lastUpdated||new Date().toLocaleString("en-IN",{day:"2-digit",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"})});try{f?.id&&/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(String(f.id))?(await he({id:f.id,body:b}).unwrap(),p.success("Bank account updated successfully")):(await ue(b).unwrap(),p.success("Bank account added successfully")),await Promise.all([g(),u()]),P(!1)}catch{p.error("Failed to save bank account")}finally{z(!1)}};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",children:[e.jsx(Pe,{title:"Bank Accounts",subtitle:"Account-wise transaction ledger and balance reconciliation",accentVar:"--mod-finance",showMonthYearFilter:!1}),e.jsx("div",{className:"shrink-0 bg-surface/50 border-b border-border px-4 py-2 flex items-center justify-between gap-2 overflow-x-auto no-scrollbar",children:e.jsx(Qe,{showMonths:!0,actions:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(J,{delayDuration:150,children:e.jsxs(F,{children:[e.jsx(E,{asChild:!0,children:e.jsx(Y,{to:`${y}/bank-accounts/import`,className:"h-8 w-8 rounded-lg border border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-900 hover:bg-slate-50 dark:hover:bg-slate-800 text-slate-700 dark:text-slate-200 inline-flex items-center justify-center shadow-2xs transition-colors shrink-0 cursor-pointer","aria-label":"Import Statements",children:e.jsx(X,{className:"w-4 h-4 text-blue-600"})})}),e.jsx(R,{side:"bottom",className:"text-xs",children:"Import Statements"})]})}),e.jsxs(Y,{to:`${y}/bank-accounts/new`,className:"h-8 px-3 rounded-lg bg-blue-600 hover:bg-blue-700 text-white font-semibold text-xs inline-flex items-center gap-1.5 shadow-2xs transition-colors shrink-0 cursor-pointer",children:[e.jsx(Te,{className:"w-3.5 h-3.5"})," Add Bank Account"]})]})})}),e.jsx("div",{className:"p-3 pb-3 flex-1 min-h-0 flex flex-col overflow-hidden",children:e.jsx(Le,{selectable:!0,selectedIds:be,onSelectionChange:D,bulkActions:[{id:"delete",label:"Delete Selected",icon:e.jsx(C,{className:"w-3.5 h-3.5 text-rose-600"}),variant:"destructive",onAction:a=>{L(a)}}],rows:d,rowKey:a=>a.id,searchKeys:["account","bank","accountNo","type"],searchPlaceholder:"Search accounts, banks, numbers…",storageKey:"finance-bank-accounts",initialPageSize:50,fetching:xe||de||me||pe,onRefresh:async()=>{V(!0),await Promise.all([g(),u()]),setTimeout(()=>V(!1),500)},onRowClick:a=>W(`${y}/bank-accounts/new?editId=${a.id}`),fillHeight:!0,columns:[{key:"account",label:"ACCOUNT",sortable:!0,sortValue:a=>a.bank+a.account,render:a=>e.jsxs("div",{className:"flex items-center gap-2.5 py-0.5",children:[e.jsx("div",{className:"w-7 h-7 rounded-md bg-blue-50 dark:bg-blue-950/60 border border-blue-200 dark:border-blue-800 text-blue-600 dark:text-blue-400 flex items-center justify-center shrink-0",children:e.jsx(M,{className:"w-3.5 h-3.5"})}),e.jsxs("div",{className:"flex flex-col min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"font-bold text-slate-800 dark:text-slate-200 text-xs truncate",children:a.bank}),e.jsx("span",{className:"px-1.5 py-0.2 text-[9px] font-semibold rounded bg-slate-100 dark:bg-slate-800 text-slate-600 dark:text-slate-400 border border-slate-200 dark:border-slate-700",children:a.type})]}),e.jsxs("span",{className:"text-[11px] text-muted-foreground truncate",children:[a.account," · ",e.jsx("span",{className:"font-data",children:a.accountNo?`•••• ${a.accountNo.slice(-4)}`:"—"})]})]})]})},{key:"balance",label:"CURRENT BALANCE",align:"right",width:"160px",sortable:!0,sortValue:a=>a.balance,render:a=>e.jsx("span",{className:"font-data font-bold text-slate-900 dark:text-slate-100 text-xs",children:A(a.balance)})},{key:"beginningBalance",label:"BEGINNING BALANCE",align:"right",width:"160px",sortable:!0,sortValue:a=>a.beginningBalance,render:a=>e.jsx("span",{className:"font-data text-muted-foreground text-xs",children:A(a.beginningBalance)})},{key:"totalDeposits",label:"TOTAL DEPOSITS",align:"right",width:"160px",sortable:!0,sortValue:a=>a.totalDeposits,render:a=>e.jsx("span",{className:"font-data font-semibold text-emerald-600 dark:text-emerald-400 text-xs",children:A(a.totalDeposits)})},{key:"totalWithdrawals",label:"TOTAL WITHDRAWALS",align:"right",width:"160px",sortable:!0,sortValue:a=>a.totalWithdrawals,render:a=>e.jsx("span",{className:"font-data font-semibold text-rose-600 dar
1k:text-rose-400 text-xs",children:A(a.totalWithdrawals)})},{key:"netChange",label:"TOTAL BALANCE +/-",align:"right",width:"160px",sortable:!0,sortValue:a=>a.balance-a.beginningBalance,render:a=>{let t=a.balance-a.beginningBalance;t===0&&(a.totalDeposits>0||a.totalWithdrawals>0)&&(t=a.totalDeposits-a.totalWithdrawals);const r=Math.abs(t).toLocaleString("en-IN",{style:"currency",currency:"INR",minimumFractionDigits:2});return e.jsx("span",{className:j("inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-bold font-data border shadow-2xs",t>0?"bg-emerald-50 text-emerald-700 border-emerald-200 dark:bg-emerald-950/40 dark:text-emerald-300 dark:border-emerald-800":t<0?"bg-rose-50 text-rose-700 border-rose-200 dark:bg-rose-950/40 dark:text-rose-300 dark:border-rose-800":"bg-slate-100 text-slate-700 border-slate-200 dark:bg-slate-800 dark:text-slate-300 dark:border-slate-700"),children:t>0?`+${r}`:t<0?`-${r}`:r})}},{key:"lastChecked",label:"LAST CHECKED",align:"center",width:"150px",sortable:!0,sortValue:a=>a.lastUpdated,render:a=>e.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:a.lastUpdated||"—"})},{key:"actions",label:"ACTIONS",width:"90px",align:"center",sortable:!1,fixed:"right",render:a=>e.jsx("div",{className:"flex items-center gap-1 opacity-70 group-hover:opacity-100 transition-opacity justify-center",children:e.jsxs(J,{delayDuration:150,children:[e.jsxs(F,{children:[e.jsx(E,{asChild:!0,children:e.jsx("button",{onClick:t=>{t.stopPropagation(),W(`${y}/bank-accounts/new?editId=${a.id}`)},className:"p-1.5 rounded-md hover:bg-primary/10 text-slate-600 hover:text-primary transition-colors cursor-pointer","aria-label":"Edit Bank Account",children:e.jsx(Ue,{className:"w-3.5 h-3.5"})})}),e.jsx(R,{side:"top",className:"text-xs font-medium",children:"Edit Bank Account"})]}),e.jsxs(F,{children:[e.jsx(E,{asChild:!0,children:e.jsx("button",{onClick:t=>{t.stopPropagation(),T(a)},className:"p-1.5 rounded-md hover:bg-rose-50 dark:hover:bg-rose-950/30 text-slate-600 hover:text-rose-600 transition-colors cursor-pointer","aria-label":"Delete Bank Account",children:e.jsx(C,{className:"w-3.5 h-3.5"})})}),e.jsx(R,{side:"top",className:"text-xs font-medium",children:"Delete Bank Account"})]})]})})}]})}),e.jsx(Fe,{open:fe,onOpenChange:P,children:e.jsxs(Ee,{className:"sm:max-w-[580px] p-0 overflow-hidden border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-900 shadow-2xl rounded-2xl",children:[e.jsx("div",{className:"px-6 py-4 border-b border-border bg-slate-50/70 dark:bg-slate-900/70 flex items-center justify-between",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-primary/10 border border-primary/20 text-primary flex items-center justify-center shrink-0 shadow-2xs",children:e.jsx(M,{className:"w-5 h-5"})}),e.jsxs("div",{children:[e.jsx(Re,{className:"text-base font-bold text-slate-900 dark:text-slate-100",children:f?"Edit Bank Account":"Add New Bank Account"}),e.jsx(Me,{className:"text-xs text-muted-foreground mt-0.5",children:"Configure organization bank details, opening balance, and ledger metrics"})]})]})}),e.jsxs("div",{className:"p-6 space-y-4 max-h-[75vh] overflow-y-auto custom-scrollbar",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("div",{className:"h-5 flex items-center",children:e.jsxs("label",{className:"text-xs font-semibold text-slate-700 dark:text-slate-300 flex items-center gap-1",children:["Company Name ",e.jsx("span",{className:"text-rose-500",children:"*"})]})}),e.jsx(O,{value:s.company,onChange:a=>{l({...s,company:a}),o.company&&h(t=>({...t,company:""}))},defaultOptions:ge,storageKey:"finance_company_names",placeholder:"Select company",searchPlaceholder:"Search or add company...",className:j("h-9 bg-white dark:bg-slate-900 border-input rounded-md text-xs shadow-2xs",o.company&&"border-destructive focus-visible:ring-destructive")}
1),o.company&&e.jsx("p",{className:"text-[10px] text-destructive font-medium",children:o.company})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("div",{className:"h-5 flex items-center",children:e.jsxs("label",{className:"text-xs font-semibold text-slate-700 dark:text-slate-300 flex items-center gap-1",children:["Bank Name ",e.jsx("span",{className:"text-rose-500",children:"*"})]})}),e.jsx(O,{value:s.bank,onChange:a=>{l({...s,bank:a}),o.bank&&h(t=>({...t,bank:""}))},defaultOptions:Xe,storageKey:"finance_bank_names",placeholder:"Select bank name",searchPlaceholder:"Search or add bank...",className:j("h-9 bg-white dark:bg-slate-900 border-input rounded-md text-xs shadow-2xs",o.bank&&"border-destructive focus-visible:ring-destructive")}),o.bank&&e.jsx("p",{className:"text-[10px] text-destructive font-medium",children:o.bank})]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("div",{className:"h-5 flex items-center",children:e.jsxs("label",{className:"text-xs font-semibold text-slate-700 dark:text-slate-300 flex items-center gap-1",children:["Account Name ",e.jsx("span",{className:"text-rose-500",children:"*"})]})}),e.jsx(c,{type:"text",placeholder:"e.g. Primary Operations",value:s.account,onChange:a=>{l({...s,account:a.target.value}),o.account&&h(t=>({...t,account:""}))},className:j("h-9 rounded-md shadow-2xs",o.account&&"border-destructive focus-visible:ring-destructive")}
1),o.account&&e.jsx("p",{className:"text-[10px] text-destructive font-medium",children:o.account})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("div",{className:"h-5 flex items-center",children:e.jsxs("label",{className:"text-xs font-semibold text-slate-700 dark:text-slate-300 flex items-center gap-1",children:["Account Number ",e.jsx("span",{className:"text-rose-500",children:"*"})]})}),e.jsx(c,{type:"text",inputMode:"numeric",pattern:"[0-9]*",placeholder:"e.g. 918020048291024",value:s.accountNo,onChange:a=>{const t=a.target.value.replace(/\D/g,"");l(r=>({...r,accountNo:t})),h(t?r=>({...r,accountNo:""}):r=>({...r,accountNo:"Account number is required (numbers only)"}))},className:j("h-9 font-data rounded-md shadow-2xs",o.accountNo&&"border-destructive focus-visible:ring-destructive")}),o.accountNo&&e.jsx("p",{className:"text-[10px] text-destructive font-medium",children:o.accountNo})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("div",{className:"h-5 flex items-center",children:e.jsx("label",{className:"text-xs font-semibold text-slate-700 dark:text-slate-300",children:"Account Type"})}),e.jsx(O,{value:s.type,onChange:a=>l({...s,type:a}),defaultOptions:["Current","Savings","Overdraft","Credit Card","Fixed Deposit"],storageKey:"finance_account_types",placeholder:"Select account type",searchPlaceholder:"Search or add type...",className:"h-9 bg-white dark:bg-slate-900 border-input rounded-md text-xs shadow-2xs"})]}),e.jsxs("div",{className:"border-t border-slate-100 dark:border-slate-800 pt-3 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-[10px] font-bold uppercase tracking-wider text-primary flex items-center gap-1.5",children:[e.jsx(M,{className:"w-3.5 h-3.5"})," Invoicing, Wire Transfer & QR Details"]}),e.jsx("span",{className:"text-[10px] text-muted-foreground",children:"Auto-fetches on client invoices"})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("div",{className:"h-5 flex items-center",children:e.jsx("label",{className:"text-xs font-semibold text-slate-700 dark:text-slate-300",children:"Branch Name"})}),e.jsx(c,{type:"text",placeholder:"e.g. Ludhiana - Sunder Nagar",value:s.branch,onChange:a=>l({...s,branch:a.target.value}),className:"h-9 rounded-md shadow-2xs text-xs"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("div",{className:"h-5 flex items-center",children:e.jsx("label",{className:"text-xs font-semibold text-slate-700 dark:text-slate-300",children:"IFSC Code (Domestic)"})}),e.jsx(c,{type:"text",placeholder:"e.g. KKBK0003916",value:s.ifscCode,onChange:a=>l({...s,ifscCode:a.target.value.toUpperCase()}),className:"h-9 font-mono uppercase tracking-wider rounded-md shadow-2xs text-xs"})]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("div",{className:"h-5 flex items-center",children:e.jsx("label",{className:"text-xs font-semibold text-slate-700 dark:text-slate-300",children:"SWIFT / BIC Code (Foreign Inward)"})}),e.jsx(c,{type:"text",placeholder:"e.g. KKBKINBBCPC",value:s.swiftCode,onChange:a=>l({...s,swiftCode:a.target.value.toUpperCase()}),className:"h-9 font-mono uppercase tracking-wider rounded-md shadow-2xs text-xs"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("div",{className:"h-5 flex items-center",children:e.jsx("label",{className:"text-xs font-semibold text-slate-700 dark:text-slate-300",children:"UPI ID (VPA)"})}),e.jsx(c,{type:"text",placeholder:"e.g. corporate@okaxis",value:s.upiId,onChange:a=>l({...s,upiId:a.target.value}),className:"h-9 rounded-md shadow-2xs text-xs"})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("div",{className:"h-5 flex items-center",children:e.jsx("label",{className:"text-xs font-semibold text-slate-700 dark:text-slate-300",children:"Full Branch Address (Prints on Invoices)"})}),e.jsx(c,{type:"text",placeholder:"e.g. Ground Floor, B-24-2594, Taraf saidan, Sunder Nagar, Ludhiana, Punjab-141007, INDIA.",value:s.bankAddress,onChange:a=>l({...s,bankAddress:a.target.value}),className:"h-9 rounded-md shadow-2xs text-xs"})]}),e.jsxs("div",{className:"space-y-1.5 p-3 rounded-xl border border-slate-200 dark:border-slate-800 bg-slate-50/50 dark:bg-slate-900/50",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("label",{className:"text-xs font-semibold text-slate-700 dark:text-slate-300 flex items-center gap-1.5",children:[e.jsx(ie,{className:"w-4 h-4 text-blue-600"})," UPI QR Code (Scan to Pay for Invoices)"]}),s.qrCodeUrl&&e.jsx("button",{type:"button",onClick:()=>l({...s,qrCodeUrl:""}),className:"text-[10px] text-rose-500 hover:underline cursor-pointer",children:"Remove QR"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[s.qrCodeUrl?e.jsx("div",{className:"w-16 h-16 rounded-lg border border-slate-200 dark:border-slate-700 bg-white p-1 flex items-center justify-center shrink-0 shadow-2xs",children:e.jsx("img",{src:s.qrCodeUrl,alt:"UPI QR",className:"w-full h-full object-contain"})}):e.jsx("div",{className:"w-16 h-16 rounded-lg border-2 border-dashed border-slate-300 dark:border-slate-700 flex flex-col items-center justify-center shrink-0 text-slate-400 bg-white/50 dark:bg-slate-800/50",children:e.jsx(ie,{className:"w-6 h-6 opacity-40"})}),e.jsxs("div",{className:"flex-1 space-y-1.5",children:[e.jsxs("label",{className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium bg-white dark:bg-slate-800 border border-slate-200 dark:border-slate-700 text-slate-700 dark:text-slate-200 hover:bg-slate-50 dark:hover:bg-slate-750 cursor-pointer shadow-2xs transition-all",children:[e.jsx(X,{className:"w-3.5 h-3.5 text-blue-600"})," Upload QR Image",e.jsx("input",{type:"file",accept:"image/*",className:"hidden",onChange:a=>{const t=a.target.files?.[0];if(t){const r=new FileReader;r.onload=()=>
1{l(x=>({...x,qrCodeUrl:r.result}))},r.readAsDataURL(t)}}})]}),e.jsx("p",{className:"text-[10px] text-slate-400",children:"Supports PNG, JPG, WebP. Displayed directly on domestic tax invoices."})]})]})]})]}),e.jsxs("div",{className:"border-t border-slate-100 dark:border-slate-800 pt-2",children:[e.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground block mb-3",children:"Ledger & Balance Metrics (INR)"}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 mb-3",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("div",{className:"h-5 flex items-center",children:e.jsx("label",{className:"text-xs font-semibold text-slate-700 dark:text-slate-300",children:"Beginning Balance (Opening)"})}),e.jsxs("div",{className:"relative",children:[e.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-xs font-bold text-muted-foreground pointer-events-none",children:"₹"}),e.jsx(c,{type:"number",placeholder:"0.00",value:s.beginningBalance,onChange:a=>l({...s,beginningBalance:a.target.value}),className:"h-9 pl-7 font-data rounded-md shadow-2xs"})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"h-5 flex items-center justify-between",children:[e.jsx("label",{className:"text-xs font-semibold text-slate-700 dark:text-slate-300",children:"Current Balance"}),e.jsx("span",{className:"text-[10px] text-muted-foreground font-normal",children:"(Auto-calculated if blank)"})]}),e.jsxs("div",{className:"relative",children:[e.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-xs font-bold text-muted-foreground pointer-events-none",children:"₹"}),e.jsx(c,{type:"number",placeholder:"0.00",value:s.balance,onChange:a=>l({...s,balance:a.target.value}),className:"h-9 pl-7 font-data font-bold rounded-md shadow-2xs"})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("div",{className:"h-5 flex items-center",children:e.jsxs("label",{className:"text-xs font-semibold text-emerald-700 dark:text-emerald-400 flex items-center gap-1",children:[e.jsx(Oe,{className:"w-3.5 h-3.5"})," Total Deposits (Credits)"]})}),e.jsxs("div",{className:"relative",children:[e.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-xs font-bold text-emerald-600 pointer-events-none",children:"₹"}),e.jsx(c,{type:"number",placeholder:"0.00",value:s.totalDeposits,onChange:a=>l({...s,totalDeposits:a.target.value}),className:"h-9 pl-7 font-data border-emerald-200 dark:border-emerald-900/50 bg-emerald-50/20 dark:bg-emerald-950/20 text-emerald-900 dark:text-emerald-200 rounded-md shadow-2xs"})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("div",{className:"h-5 flex items-center",children:e.jsxs("label",{className:"text-xs font-semibold text-rose-700 dark:text-rose-400 flex items-center gap-1",children:[e.jsx(We,{className:"w-3.5 h-3.5"})," Total Withdrawals (Debits)"]})}),e.jsxs("div",{className:"relative",children:[e.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-xs font-bold text-rose-600 pointer-events-none",children:"₹"}),e.jsx(c,{type:"number",placeholder:"0.00",value:s.totalWithdrawals,onChange:a=>l({...s,totalWithdrawals:a.target.value}),className:"h-9 pl-7 font-data border-rose-200 dark:border-rose-900/50 bg-rose-50/20 dark:bg-rose-950/20 text-rose-900 dark:text-rose-200 rounded-md shadow-2xs"})]})]})]})]}),e.jsxs("div",{className:"space-y-1.5 pt-1",children:[e.jsx("div",{className:"h-5 flex items-center",children:e.jsxs("label",{className:"text-xs font-semibold text-slate-700 dark:text-slate-300 flex items-center gap-1",children:[e.jsx(_e,{className:"w-3.5 h-3.5 text-slate-400"})," Last Checked Date & Time"]})}),e.jsx(Ke,{showTime:!0,value:s.lastUpdated,onChange:a=>l({...s,lastUpdated:a}),placeholder:"Select last checked date & time",className:"w-full h-9 bg-white dark:bg-slate-900 border-input rounded-md text-xs shadow-2xs"})]})]}),e.jsxs("div",{className:"px-6 py-3.5 border-t border-border bg-slate-50/70 dark:bg-slate-900/70 flex items-center justify-end gap-2.5",children:[e.jsx(Z,{type:"button",variant:"outline",onClick:()=>P(!1),className:"h-9 px-4 text-xs font-semibold rounded-lg border-border",children:"Cancel"}),e.jsxs(Z,{type:"button",disabled:H,onClick:Ne,className:"h-9 px-5 text-xs font-semibold rounded-lg bg-primary text-primary-foreground hover:bg-primary/90 shadow-sm inline-flex items-center gap-1.5",children:[H?e.jsx(qe,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx($e,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:f?"Update Bank Account":"Save Bank Account"})]})]})]})}),e.jsx(ee,{open:!!k,onOpenChange:a=>!a&&T(null),children:e.jsxs(ae,{className:"sm:max-w-[420px] rounded-2xl border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-900 shadow-2xl p-6",children:[e.jsxs(te,{children:[e.jsxs(se,{className:"text-base font-bold text-slate-900 dark:text-slate-100 flex items-center gap-2.5",children:[e.jsx("div",{className:"w-9 h-9 rounded-full bg-rose-100 dar
1k:bg-rose-950/60 text-rose-600 flex items-center justify-center shrink-0",children:e.jsx(C,{className:"w-4 h-4"})}),e.jsx("span",{children:"Delete Bank Account"})]}),e.jsxs(re,{className:"text-xs text-slate-600 dark:text-slate-400 mt-2 leading-relaxed",children:["Are you sure you want to delete ",e.jsxs("span",{className:"font-semibold text-slate-900 dark:text-slate-100",children:[k?.bank," (",k?.account,")"]}),"? This action will remove the account from your organization's ledger metrics."]})]}),e.jsxs(ne,{className:"mt-5 flex items-center justify-end gap-2",children:[e.jsx(le,{className:"h-9 px-4 text-xs font-semibold rounded-lg border-border",children:"Cancel"}),e.jsx(oe,{onClick:async()=>{if(k){const a=k.id;try{await G(a).unwrap(),S(t=>t.filter(r=>r.id!==a)),D(t=>t.filter(r=>r!==a)),await Promise.all([g(),u()]),p.success("Bank account deleted successfully")}catch(t){p.error(t?.data?.message||t?.message||"Failed to delete bank account")}finally{T(null)}}},className:"h-9 px-4 text-xs font-semibold rounded-lg bg-rose-600 hover:bg-rose-700 text-white shadow-sm",children:"Delete Account"})]})]})}),e.jsx(ee,{open:N.length>0,onOpenChange:a=>!a&&L([]),children:e.jsxs(ae,{className:"sm:max-w-[420px] rounded-2xl border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-900 shadow-2xl p-6",children:[e.jsxs(te,{children:[e.jsxs(se,{className:"text-base font-bold text-slate-900 dark:text-slate-100 flex items-center gap-2.5",children:[e.jsx("div",{className:"w-9 h-9 rounded-full bg-rose-100 dark:bg-rose-950/60 text-rose-600 flex items-center justify-center shrink-0",children:e.jsx(C,{className:"w-4 h-4"})}),e.jsx("span",{children:"Delete Selected Accounts"})]}),e.jsxs(re,{className:"text-xs text-slate-600 dark:text-slate-400 mt-2 leading-relaxed",children:["Are you sure you want to delete ",e.jsxs("span",{className:"font-semibold text-slate-900 dark:text-slate-100",children:[N.length," selected bank account(s)"]}),"? This action cannot be undone."]})]}),e.jsxs(ne,{className:"mt-5 flex items-center justify-end gap-2",children:[e.jsx(le,{className:"h-9 px-4 text-xs font-semibold rounded-lg border-border",children:"Cancel"}),e.jsxs(oe,{onClick:async()=>{const a=new Set(N.map(t=>t.id));for(const t of N)try{await G(t.id).unwrap()}catch{}S(t=>t.filter(r=>!a.has(r.id))),D([]),L([]),await Promise.all([g(),u()]),p.success(`Deleted ${a.size} bank account(s)`)},className:"h-9 px-4 text-xs font-semibold rounded-lg bg-rose-600 hover:bg-rose-700 text-white shadow-sm",children:["Delete Selected (",N.length,")"]})]})]})})]})}export{ha as BankAccountsPage};

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.