1import{j as e,b as Te,hZ as me,bv as _e,bw as qe,O as Ge,by as Ve,d4 as ze,ax as Qe,aJ as Je,r as u,eg as He,dY as Ze,dZ as Ke,e0 as Ye,ey as Xe,k9 as et,ka as tt,kb as st,e2 as at,d_ as rt,L as Oe,K as ge,dl as Ue,cS as lt,cT as nt,cU as Ne,cV as ve,S as it,e3 as Le,b7 as xe,aK as ot,N as Ee,as as B,au as ct,cf as ye,cg as we,ch as ke,ci as Ce,cj as Se,bH as dt,ao as xt,b9 as mt,dG as bt,k as pt,cI as ht,n as Me,b5 as ut,J as ft,aI as I}from"./index-CpeGhXo5.js";import{g as jt,e as gt,x as Nt}from"./financeMappers-CUv1G2pV.js";import{u as vt}from"./useCurrencyHelpers-D5hUvgaW.js";import{u as yt}from"./companySettingsMockApi-D8Uh5efq.js";import{a as wt}from"./seedData-BKFJmuM9.js";const Ie=["","One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten","Eleven","Twelve","Thirteen","Fourteen","Fifteen","Sixteen","Seventeen","Eighteen","Nineteen"],kt=["","","Twenty","Thirty","Forty","Fifty","Sixty","Seventy","Eighty","Ninety"];function E(n){let x="";if(n>=100&&(x+=Ie[Math.floor(n/100)]+" Hundred ",n%=100),n>0)if(n<20)x+=Ie[n]+" ";else{const p=Math.floor(n/10),i=n%10;x+=kt[p]+(i>0?"-"+Ie[i]:"")+" "}return x.trim()}function Fe(n){if(n===0)return"Zero";let x=Math.floor(n/1e7);n%=1e7;let p=Math.floor(n/1e5);n%=1e5;let i=Math.floor(n/1e3);n%=1e3;let f=n,h="";return x>0&&(h+=Fe(x)+" Crore "),p>0&&(h+=E(p)+" Lakh "),i>0&&(h+=E(i)+" Thousand "),f>0&&(h+=E(f)+" "),h.trim()}function Ct(n){if(n===0)return"Zero";const x=Math.floor(n/1e9);n%=1e9;const p=Math.floor(n/1e6);n%=1e6;const i=Math.floor(n/1e3);n%=1e3;const f=n;let h="";return x>0&&(h+=E(x)+" Billion "),p>0&&(h+=E(p)+" Million "),i>0&&(h+=E(i)+" Thousand "),f>0&&(h+=E(f)+" "),h.trim()}function $e(n,x="INR"){const p=Math.max(0,Number(n)||0);if(p===0)return`${x.toUpperCase()} Zero Only.`;const i=Math.floor(p),f=Math.round((p-i)*100),h=x.trim().toUpperCase(),G=h==="INR"||h==="â¹",C=G?Fe(i):Ct(i);let D=`${h} ${C}`;if(f>0){const T=G?"Paise":"Cents",q=E(f);D+=` and ${q} ${T}`}return D+=" Only.",D}function We({invoiceNo:n="TWS-26-01",issueDate:x="01-Sep-2026",dueDate:p="06-Sep-2026",placeOfSupply:i="Punjab",projectName:f="TicketWiz",paymentTerms:h="5 Days",currency:G="INR",clientName:C="Client Name",clientAddress:D="",clientEmail:T="",clientPhone:q="",clientGstin:V="",clientCountry:re="India",lineItems:o=[],subTotal:le=0,discount:Ae=0,taxableAmount:Pe=0,isExport:be,lutNumber:ne="AD030326001365N",gstType:ie,cgstRate:pe=9,cgstAmount:he=0,sgstRate:z=9,sgstAmount:Q=0,igstRate:F=18,igstAmount:ue=0,totalGst:De=0,totalAmount:a=0,bankName:c="",branch:J="",bankAddress:H="",accountNo:$="",ifscCode:fe="",swiftCode:Z="",upiId:K="",qrCodeUrl:je="",authorizedSignatory:j="Authorized Signatory",showPrintButton:k=!1,onPrint:W}){const b=(G||"INR").toUpperCase(),O=b==="USD"||b==="AUD"||b==="EUR"||b==="GBP"||b==="CAD",U=(i||"").toLowerCase().includes("outside"),g=be!==void 0?be:O||U,y=b==="INR"||b==="â¹"?"â¹":b==="USD"||b==="$"?"$":b==="AUD"?"AUD":b==="EUR"?"â¬":b==="GBP"?"£":b,N=s=>{const l=(Number(s)||0).toLocaleString(b==="INR"?"en-IN":"en-US",{minimumFractionDigits:2,maximumFractionDigits:2});return y==="â¹"?`â¹${l}`:y==="$"?`$${l}`:y==="AUD"?`AUD${l}`:y==="â¬"?`â¬${l}`:y==="£"?`£${l}`:`${y} ${l}`},Y=!g&&(i.toLowerCase().includes("punjab")||i===""),S=g?"export":ie||(Y?"intra":"inter"),X=le||o.reduce((s,r)=>s+(Number(r.amount)||0),0),ee=Ae||0,L=Pe||Math.max(0,X-ee);let te=0,se=0,A=0,_=0;g||(S==="intra"?(te=he||L*pe/100,se=Q||L*z/100,_=te+se):(A=ue||L*F/100,_=A));const M=a||(g?L:L+_),oe=$e(M,b),ce=K?`https://api.qrserver.com/v1/create-qr-code/?size=250x250&data=upi://pay?pa=${encodeURIComponent(K)}&pn=Tekki%20Web%20Solutions%20Pvt%20Ltd&cu=INR`:"",ae=je||ce,t=()=>{W?W():window.print()};return e.jsxs("div",{className:"w-full flex flex-col items-center",children:[k&&e.jsxs("div",{className:"w-full max-w-[850px] mb-4 flex items-center justify-between no-print px-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-semibold bg-blue-50 text-blue-700 dark:bg-blue-950/50 dark:text-blue-300 border border-blue-200 dark:border-blue-800",children:[e.jsx(Te,{className:"w-3.5 h-3.5"})," Official Company Format"]}),g&&e.jsx("span",{className:"inline-flex items-center gap-1 px-2.5 py-1 rounded-full text-xs font-semibold bg-emerald-50 text-emerald-700 dark:bg-emerald-950/50 dark:text-emerald-300 border border-emerald-200 dark:border-emerald-800",children:"Zero-Rated Export under LUT"})]}),e.jsxs("button",{type:"button",onClick:t,className:"inline-flex items-center gap-2 px-4 py-2 rounded-lg bg-blue-600 hover:bg-blue-700 text-white font-medium text-xs shadow-md transition-all cursor-pointer",children:[e.jsx(me,{className:"w-4 h-4"})," Print / Save as PDF"]})]}),e.jsxs("div",{id:"tws-tax-invoice-sheet",className:"w-full max-w-[850px] bg-white text-slate-900 border border-slate-300 shadow-xl p-8 sm:p-10 font-sans text-[11px] leading-relaxed relative print:m-0 print:p-6 print:border-none print:shadow-none print:w-full print:max-w-none",style:{minHeight:"1100px",color:"#1e293b",backgroundColor:"#ffffff"},children:[e.jsxs("div",{className:"flex items-start justify-between border-b-2 border-slate-800 pb-4 mb-4",children:[e.jsxs("div",{className:"flex items-start gap-4 max-w-[65%]",children:[e.jsx("div",{className:"shrink-0 flex items-center justify-center pt-1",children:e.jsxs("div",{className:"relative flex items-center",children:[e.jsx("span",{className:"w-3.5 h-3.5 rounded-full bg-rose-600 inline-block mr-1 -mt-3 shadow-xs"}),e.jsxs("span",{className:"text-3xl font-black tracking-tighter text-[#0c2b5e] font-sans",children:["t",e.jsx("span",{className:"text-rose-600",children:"w"}),"s"]})]})}),e.jsxs("div",{className:"space-y-0.5 text-[10px] text-slate-700",children:[e.jsx("h1",{className:"text-base font-extrabold text-[#0c2b5e] tracking-tight leading-tight uppercase font-sans",children:"Tekki Web Solutions Private Limited"}),e.jsx("p",{className:"text-slate-600 font-medium leading-tight",children:"45-46, 1st Floor, Star Enclave, Near Green City, Dugri-Dhandra Road,"}),e.jsx("p",{className:"text-slate-600 font-medium leading-tight",children:"Ludhiana, Punjab-141001, India"}),e.jsxs("div",{className:"flex items-center gap-2 pt-0.5 font-semibold text-slate-800",children:[e.jsx("span",{children:"GSTIN: 03AAECT1189J1ZA"}),e.jsx("span",{children:"|"}),e.jsx("span",{children:"PAN: AAECT1189J"})]}),g&&e.jsxs("div",{className:"font-bold text-blue-900 tracking-wide",children:["LUT: ",ne]}),e.jsxs("div",{className:"flex items-center gap-1.5 pt-0.5 text-slate-600",children:[e.jsx("span",{children:"E-mail: cfo@tekkiwebsolutions.
1com"}),e.jsx("span",{children:"|"}),e.jsx("span",{children:"Phone No. +91-97796 87609"})]}),e.jsx("p",{className:"text-slate-600 font-medium",children:"Website: www.tekkiwebsolutions.com"})]})]}),e.jsxs("div",{className:"w-[240px] border border-[#0c2b5e] overflow-hidden text-center shrink-0",children:[e.jsx("div",{className:"bg-[#0c2b5e] text-white py-1 px-2 font-bold text-[10px] tracking-wider uppercase",children:"OUR VISION"}),e.jsx("div",{className:"p-2 text-[9.5px] leading-snug font-medium text-slate-800 bg-slate-50/50",children:"We strive to provide quick solutions and Professional results everytime."})]})]}),e.jsx("div",{className:"bg-[#0c2b5e] text-white font-bold text-center py-1.5 px-4 text-xs tracking-widest uppercase mb-4 shadow-2xs",children:"TAX INVOICE"}),e.jsxs("div",{className:"grid grid-cols-12 gap-2 mb-4",children:[e.jsxs("div",{className:"col-span-5 border border-slate-300 flex flex-col",children:[e.jsx("div",{className:"bg-[#cfe2ff] text-[#0c2b5e] font-bold px-2 py-1 border-b border-slate-300 text-[10.5px]",children:"Bill To"}),e.jsxs("div",{className:"p-2 space-y-1 text-[10px] flex-1",children:[e.jsxs("div",{children:[e.jsx("span",{className:"font-bold text-slate-900 text-[11px] block",children:C}),re&&re!=="India"&&e.jsxs("span",{className:"text-[10px] text-slate-600 block",children:["Country: ",re]})]}),D&&e.jsxs("div",{className:"text-slate-700 leading-tight",children:[e.jsx("span",{className:"font-semibold text-slate-800",children:"Address: "}),D]}),T&&e.jsxs("div",{className:"text-slate-700",children:[e.jsx("span",{className:"font-semibold text-slate-800",children:"Email: "}),T]}),q&&e.jsxs("div",{className:"text-slate-700",children:[e.jsx("span",{className:"font-semibold text-slate-800",children:"Phone: "}),q]}),V&&!g&&e.jsxs("div",{className:"text-slate-900 font-bold pt-0.5",children:["GSTIN: ",V]})]})]}),e.jsx("div",{className:"col-span-4 border border-slate-300 text-[10px]",children:e.jsx("table",{className:"w-full border-collapse",children:e.jsxs("tbody",{children:[e.jsxs("tr",{className:"border-b border-slate-200",children:[e.jsx("td",{className:"bg-slate-100 font-semibold text-slate-700 p-1.5 w-[42%] border-r border-slate-300",children:"Invoice Number"}),e.jsx("td",{className:"p-1.5 font-bold text-slate-900 font-mono",children:n})]}),e.jsxs("tr",{className:"border-b border-slate-200",children:[e.jsx("td",{className:"bg-slate-100 font-semibold text-slate-700 p-1.5 border-r border-slate-300",children:"Invoice Date"}),e.jsx("td",{className:"p-1.5 text-slate-800 font-medium",children:x})]}),e.jsxs("tr",{className:"border-b border-slate-200",children:[e.jsx("td",{className:"bg-[#cfe2ff] font-semibold text-[#0c2b5e] p-1.5 border-r border-slate-300",children:"Due Date"}),e.jsx("td",{className:"p-1.5 text-slate-900 font-semibold",children:p})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"bg-slate-100 font-semibold text-slate-700 p-1.5 border-r border-slate-300",children:"Place of Supply"}),e.jsx("td",{className:"p-1.5 font-medium text-slate-800",children:g?"Outside India":i})]})]})})}),e.jsxs("div",{className:"col-span-3 border border-slate-300 text-[10px]",children:[e.jsx("div",{className:"bg-[#cfe2ff] text-[#0c2b5e] font-bold px-2 py-1 border-b border-slate-300 text-[10.5px] text-center",children:"Other References"}),e.jsx("table",{className:"w-full border-collapse",children:e.jsxs("tbody",{children:[e.jsxs("tr",{className:"border-b border-slate-200",children:[e.jsx("td",{className:"bg-slate-50 font-semibold text-slate-700 p-1.5 w-[50%] border-r border-slate-300",children:"Project Name"}),e.jsx("td",{className:"p-1.5 font-medium text-slate-900 truncate",title:f,children:f||"â"})]}),e.jsxs("tr",{className:"border-b border-slate-200",children:[e.jsx("td",{className:"bg-slate-50 font-semibold text-slate-700 p-1.5 border-r border-slate-300",children:"Payment Terms"}),e.jsx("td",{className:"p-1.5 font-medium text-slate-900",children:h||"5 Days"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"bg-slate-50 font-semibold text-slate-700 p-1.5 border-r border-slate-300",children:"Currency"}),e.jsxs("td",{className:"p-1.5 font-bold text-slate-900",children:[b," (",y,")"]})]})]})})]})]}),e.jsx("div",{className:"border border-slate-300 mb-4 overflow-hidden",children:e.jsxs("table",{className:"w-full border-collapse text-[10px]",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-[#0c2b5e] text-white font-bold text-center",children:[e.jsx("th",{className:"py-1.5 px-2 border-r border-slate-600 w-10",children:"Sr No."}),e.jsx("th",{className:"py-1.5 px-3 border-r border-slate-600 text-left",children:"Description of Services"}),e.jsx("th",{className:"py-1.5 px-2 border-r border-slate-600 w-20",children:"SAC Code"}),e.jsx("th",{className:"py-1.5 px-2 border-r border-slate-600 w-20",children:g?"Days":"Hours / Days"}),e.jsxs("th",{className:"py-1.5 px-2 border-r border-slate-600 w-24 text-right",children:["Rate (",y,")"]}),e.jsxs("th",{className:"py-1.5 px-3 w-28 text-right",children:["Amount (",y,")"]})]})}),e.jsx("tbody",{children:o&&o.length>0?o.map((s,r)=>e.jsxs("tr",{className:"border-b border-slate-200 text-slate-800 hover:bg-slate-50/50",children:[e.jsx("td",{className:"py-2 px-2 text-center border-r border-slate-300 font-medium",children:s.srNo||r+1}),e.jsx("td",{className:"py-2 px-3 border-r border-slate-300 font-medium whitespace-pre-line",children:s.description}),e.jsx("td",{className:"py-2 px-2 text-center border-r border-slate-300 font-mono text-slate-700",children:s.sacCode||"998313"}),e.jsx("td",{className:"py-2 px-2 text-center border-r border-slate-300 text-slate-600",children:s.hoursOrDays||"-"}),e.jsx("td",{className:"py-2 px-2 text-right border-r border-slate-300 font-mono text-slate-700",children:s.rate&&s.rate!=="-"?N(s.rate):"-"}),e.jsx("td",{className:"py-2 px-3 text-right font-bold font-mono text-slate-900",children:N(s.amount)})]},r)):e.jsxs("tr",{className:"border-b border-slate-200 text-slate-800",children:[e.jsx("td",{className:"py-2.5 px-2 text-center border-r border-slate-300",children:"1"}),e.jsx("td",{className:"py-2.5 px-3 border-r border-slate-300 font-medium",children:"Professional IT Software Development Services"}),e.jsx("td",{className:"py-2.5 px-2 text-center border-r border-slate-300 font-mono",children:"998313"}),e.jsx("td",{className:"py-2.5 px-2 text-center border-r border-slate-300",children:"-"}),e.jsx("td",{className:"py-2.5 px-2 text-right border-r border-slate-300 font-mono",children:"-"}),e.jsx("td",{className:"py-2.5 px-3 text-right font-bold font-mono",children:N(M)})]})})]})}),e.jsxs("div",{className:"grid grid-cols-12 gap-3 mb-4 items-start",children:[e.jsx("div",{className:"col-span-7 flex flex-col justify-between h-full",children:e.jsxs("div",{className:"border border-slate-300 bg-[#cfe2ff]/40 p-2.5 rounded-sm",children:[e.jsx("span",{className:"font-bold text-[#0c2b5e] text-[10.5px] block mb-0.5",children:"Amount in Words"}),e.jsx("p",{className:"text-slate-900 font-semibold text-[10.5px] italic leading-snug",children:oe})]})}),e.jsx("div",{className:"col-span-5 border border-slate-300 text-[10px]",children:e.jsx("table",{className:"w-full border-collapse",children:e.jsxs("tbody",{children:[e.jsxs("tr",{className:"border-b border-slate-200 bg-slate-50",children:[e.jsx("td",{className:"p-1.5 font-semibold text-slate-700 border-r border-slate-300",children:"Sub Total"}),e.jsx("td",{className:"p-1.5 text-right font-bold font-mono text-slate-900",children:N(X)})]}),e.jsxs("tr",{className:"border-b border-slate-200",children:[e.jsx("td",{className:"p-1.5 text-slate-600 border-r border-slate-300",children:"Discount (-)"}),e.jsx("td",{className:"p-1.5 text-right font-mono text-slate-700",children:N(ee)})]}),g?e.jsxs("tr",{className:"bg-[#2e7d32] text-white",children:[e.jsxs("td",{className:"p-2 font-extrabold uppercase text-[10.5px]",children:["Total (",b,")"]}),e.jsx("td",{className:"p-2 text-right font-black font-mono text-xs",children:N(M)})]}):e.jsxs(e.Fragment,{children:[e.jsxs("tr",{className:"border-b border-slate-200 bg-slate-50",children:[e.jsx("td",{className:"p-1.5 font-semibold text-slate-700 border-r border-slate-300",children:"Taxable Amou
1nt"}),e.jsx("td",{className:"p-1.5 text-right font-bold font-mono text-slate-900",children:N(L)})]}),e.jsx("tr",{children:e.jsxs("td",{colSpan:2,className:"p-0",children:[e.jsx("div",{className:"bg-[#2e7d32] text-white text-center font-bold text-[9.5px] py-0.5 uppercase",children:"GST (18%)"}),e.jsxs("div",{className:"grid grid-cols-3 text-center border-b border-slate-300 bg-slate-50 font-semibold text-[9px] py-1 text-slate-700",children:[e.jsx("div",{className:"border-r border-slate-300",children:"CGST (â¹) (9%)"}),e.jsx("div",{className:"border-r border-slate-300",children:"SGST (â¹) (9%)"}),e.jsx("div",{children:"IGST (â¹) (18%)"})]}),e.jsxs("div",{className:"grid grid-cols-3 text-center border-b border-slate-300 py-1 font-mono text-[9.5px] text-slate-800",children:[e.jsx("div",{className:"border-r border-slate-300",children:N(te)}),e.jsx("div",{className:"border-r border-slate-300",children:N(se)}),e.jsx("div",{children:N(A)})]})]})}),e.jsxs("tr",{className:"border-b border-slate-200 bg-slate-50",children:[e.jsx("td",{className:"p-1.5 font-semibold text-slate-700 border-r border-slate-300",children:"Total GST"}),e.jsx("td",{className:"p-1.5 text-right font-bold font-mono text-slate-900",children:N(_)})]}),e.jsxs("tr",{className:"bg-[#0c2b5e] text-white",children:[e.jsxs("td",{className:"p-2 font-extrabold uppercase text-[10.5px]",children:["Total Invoice Value (",y,")"]}),e.jsx("td",{className:"p-2 text-right font-black font-mono text-xs",children:N(M)})]})]})]})})})]}),e.jsxs("div",{className:"grid grid-cols-12 gap-3 mb-4",children:[e.jsxs("div",{className:"col-span-7 border border-slate-300",children:[e.jsx("div",{className:"bg-[#cfe2ff] text-[#0c2b5e] font-bold px-2.5 py-1 border-b border-slate-300 text-[10px]",children:"Bank Details"}),e.jsxs("div",{className:"p-2.5 text-[10px] space-y-1",children:[e.jsxs("div",{className:"grid grid-cols-12",children:[e.jsx("span",{className:"col-span-4 font-semibold text-slate-700",children:"Bank Name"}),e.jsx("span",{className:"col-span-8 font-bold text-slate-900",children:c})]}),e.jsxs("div",{className:"grid grid-cols-12",children:[e.jsx("span",{className:"col-span-4 font-semibold text-slate-700",children:"Branch"}),e.jsx("span",{className:"col-span-8 text-slate-800",children:J})]}),H&&e.jsxs("div",{className:"grid grid-cols-12 items-start",children:[e.jsx("span",{className:"col-span-4 font-semibold text-slate-700",children:"Bank Address"}),e.jsx("span",{className:"col-span-8 text-slate-700 leading-tight",children:H})]}),e.jsxs("div",{className:"grid grid-cols-12 pt-0.5",children:[e.jsx("span",{className:"col-span-4 font-semibold text-slate-700",children:"A/c No."}),e.jsx("span",{className:"col-span-8 font-black font-mono text-slate-900 text-[11px] tracking-wider",children:$})]}),e.jsxs("div",{className:"grid grid-cols-12",children:[e.jsx("span",{className:"col-span-4 font-semibold text-slate-700",children:"IFSC Code"}),e.jsx("span",{className:"col-span-8 font-bold font-mono text-slate-900",children:fe})]}),Z&&e.jsxs("div",{className:"grid grid-cols-12",children:[e.jsx("span",{className:"col-span-4 font-semibold text-slate-700",children:"Swift Code"}),e.jsx("span",{className:"col-span-8 font-bold font-mono text-slate-900",children:Z})]})]})]}),e.jsxs("div",{className:"col-span-5 border border-slate-300 flex flex-col justify-between",children:[e.jsx("div",{className:"bg-[#cfe2ff] text-[#0c2b5e] font-bold px-2.5 py-1 border-b border-slate-300 text-[10px] text-center",children:g?"Wire Transfer Instructions":"UPI QR code (Scan to Pay)"}),g?e.jsxs("div",{className:"p-3 text-[9.5px] text-slate-700 space-y-1.5 flex-1 flex flex-col justify-center",children:[e.jsx("p",{className:"font-bold text-slate-900",children:"Direct Inward Remittance (FIRC / SWIFT):"}),e.jsxs("p",{children:["1. Please instruct your correspondent bank to quote Swift Code: ",e.jsx("strong",{className:"font-mono text-blue-900",children:Z})]}),e.jsxs("p",{children:["2. Credit to Beneficiary: ",e.jsx("strong",{children:"Tekki Web Solutions Pvt. Ltd."})]}),e.jsxs("p",{children:["3. Account No: ",e.jsx("strong",{className:"font-mono",children:$})]}),e.jsx("p",{className:"text-[9px] text-slate-500 italic",children:"Intermediary bank charges to be borne by remitter."})]}):e.jsxs("div",{className:"p-2 flex flex-col items-center justify-center flex-1 space-y-1 text-center",children:[ae?e.jsx("div",{className:"w-24 h-24 p-1 bg-white border border-slate-300 rounded shadow-xs flex items-center justify-center",children:e.jsx("img",{src:ae,alt:"UPI QR Code",className:"w-full h-full object-contain"})}):e.jsx("div",{className:"w-24 h-24 bg-slate-100 border border-slate-300 rounded flex items-center justify-center text-slate-400 text-[9px]",children:"QR Code"}),e.jsxs("div",{className:"font-bold text-slate-800 text-[9.5px]",children:["UPI ID: ",e.jsx("span",{className:"font-mono text-blue-900",children:K})]}),e.jsxs("div",{className:"flex items-center gap-1.5 text-[8.5px] text-slate-500 font-semibold",children:[e.jsx("span",{className:"px-1.5 py-0.5 rounded bg-blue-50 text-blue-600 font-bold border border-blue-200",children:"Paytm"}),e.jsx("span",{className:"px-1.5 py-0.5 rounded bg-emerald-50 text-emerald-600 font-bold border border-emerald-200",children:"GPay"}),e.jsx("span",{className:"px-1.5 py-0.5 rounded bg-purple-50 text-purple-600 font-bold border border-purple-200",children:"BHIM"})]})]})]})]}),e.jsxs("div",{className:"grid grid-cols-12 gap-4 text-[9.5px] pt-1",children:[e.jsxs("div",{className:"col-span-8 space-y-2",children:[e.jsxs("div",{children:[e.jsx("span",{className:"font-bold text-slate-800 block mb-0.5 underline",children:"Terms & Conditions:"}),e.jsxs("ol",{className:"list-decimal list-inside space-y-0.5 text-slate-600 pl-1 leading-snug",children:[e.jsx("li",{children:"Payment should be made to the mentioned account only."}),e.jsx("li",{children:"GST will be charged as applicable under Indian tax laws."}),e.jsx("li",{children:"Billing is based on agreed scope, approved timesheets."}),e.jsx("li",{children:"Any discrepancy must be reported within 7 days of receipt."})]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"font-bold text-slate-800 block mb-0.5 underline",children:"Declarations:"}),g?e.jsxs("ol",{className:"list-decimal list-inside space-y-0.5 text-slate-600 pl-1 leading-snug",children:[e.jsx("li",{children:"Certified that the particulars given above are true and correct."}),e.jsx("li",{children:"Supply meant for export under LUT without payment of IGST."}),e.jsx("li",{children:"Place of supply is outside India as per Section 13 of IGST Act."}
1),e.jsx("li",{children:"Payment to be received in convertible foreign currency."}),e.jsx("li",{children:"GST: Not Applicable on export of services."}),e.jsx("li",{children:"E. & O. E."})]}):e.jsxs("ol",{className:"list-decimal list-inside space-y-0.5 text-slate-600 pl-1 leading-snug",children:[e.jsx("li",{children:"Certified that the particulars given above are true and correct."}),e.jsx("li",{children:"Whether tax is payable on reverse charge basis: No"}),e.jsx("li",{children:"E. & O. E."})]})]})]}),e.jsx("div",{className:"col-span-4 flex flex-col items-end justify-end text-right",children:e.jsxs("div",{className:"text-center w-48",children:[e.jsx("div",{className:"text-2xl text-blue-900 pb-1 font-serif italic select-none",style:{fontFamily:"'Dancing Script', 'Brush Script MT', cursive, serif"},children:j}),e.jsx("div",{className:"border-t border-slate-400 pt-1 text-[9.5px] font-semibold text-slate-700",children:"For Company Authorised Signatory"})]})})]}),e.jsx("div",{className:"mt-8 text-center border-t border-slate-200 pt-3",children:e.jsx("span",{className:"font-serif italic text-base text-slate-700 tracking-wider",children:"ââ Thank You! ââ"})})]})]})}function St({open:n,onOpenChange:x,invoiceData:p}){const i=()=>{window.print()};return e.jsx(_e,{open:n,onOpenChange:x,children:e.jsxs(qe,{className:"max-w-4xl max-h-[92vh] p-0 overflow-hidden flex flex-col bg-slate-100 dark:bg-slate-950 border-slate-300 dark:border-slate-800 shadow-2xl",children:[e.jsxs("div",{className:"px-6 py-3 border-b border-border bg-white dark:bg-slate-900 flex items-center justify-between no-print shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-blue-50 dark:bg-blue-950/50 text-blue-600 dark:text-blue-400 flex items-center justify-center border border-blue-200 dark:border-blue-800",children:e.jsx(Ge,{className:"w-4 h-4"})}),e.jsxs("div",{children:[e.jsxs(Ve,{className:"text-sm font-bold text-slate-900 dark:text-slate-100 flex items-center gap-2",children:["Official Tax Invoice: ",p.invoiceNo]}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Verified Tekki Web Solutions standard client billing document"})]})]}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs("button",{type:"button",onClick:i,className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-blue-600 hover:bg-blue-700 text-white font-medium text-xs shadow-xs transition-colors cursor-pointer",children:[e.jsx(me,{className:"w-3.5 h-3.5"})," Print / Save PDF"]})})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-4 sm:p-6 custom-scrollbar bg-slate-100 dark:bg-slate-950 flex justify-center",children:e.jsx(We,{...p,showPrintButton:!1})})]})})}const It=["Pending","Paid","Partial","Overdue"],Tt=["3 Days","5 Days","7 Days","10 Days","15 Days","30 Days","Due on Receipt","Immediate"],At=[{value:"INR",label:"INR (â¹) - Indian Rupee",symbol:"â¹"},{value:"USD",label:"USD ($) - US Dollar",symbol:"$"},{value:"AUD",label:"AUD (A$) - Australian Dollar",symbol:"AUD"},{value:"EUR",label:"EUR (â¬) - Euro",symbol:"â¬"},{value:"GBP",label:"GBP (£) - British Pound",symbol:"£"},{value:"CAD",label:"CAD (C$) - Canadian Dollar",symbol:"CAD"}],Pt=["Punjab","Outside India","Odisha","Maharashtra","Delhi","Karnataka","Haryana","Chandigarh","Tamil Nadu","Telangana","Uttar Pradesh","West Bengal","Gujarat","Rajasthan"],Dt={};function Re(){const n=new Date().getFullYear().toString().slice(-2),x=Math.floor(20+Math.random()*80);return`TWS-${n}-${x}`}function w({label:n,children:x,required:p,error:i,hint:f}){return e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between min-h-[18px]",children:[e.jsxs("label",{className:"text-[11px] font-semibold text-slate-700 dark:text-slate-300 tracking-tight whitespace-nowrap",children:[n," ",p&&e.jsx("span",{className:"text-red-500",children:"*"})]}),f&&e.jsx("span",{className:"text-[10px] text-slate-400 font-normal truncate ml-1",children:f})]}),x,i&&e.jsx("p",{className:"text-[10px] text-red-500 font-medium",children:i})]})}function Be(){const n=ze(),x=Qe(),[p]=Je(),i=p.get("editId"),[f,h]=u.useState(!1),[G,C]=u.useState("particulars"),[D,T]=u.useState(!1),[q,V]=u.useState(!1),{fmtConv:re}=vt(),o="h-9 w-full rounded-md border border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-900 px-3 text-xs text-slate-900 dark:text-slate-100 focus:outline-none focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 transition-all shadow-2xs",{data:le}=He({limit:500}),{data:Ae=[]}=Ze(),{data:Pe=[]}=yt(),{data:be}=Ke({limit:1e3,sortBy:"name",sortOrder:"asc"}),{data:ne}=Ye({limit:1e3}),{data:ie}=Xe({limit:200}),[pe]=et(),[he]=tt(),z=u.useMemo(()=>(le?.items??[]).map(jt),[le]),Q=u.useMemo(()=>ne?.items??[],[ne]),F=u.useMemo(()=>{const t=(ie?.items??[]).map(gt);return(t.length>0?t:wt).map(r=>{let l=null;try{const v=(r.accountNo||"").replace(/\s+/g,""),R=localStorage.getItem(`bank_account_custom_${v}`);R&&(l=JSON.parse(R))}catch{}const d=(r.accountNo||"").replace(/\s+/g,""),m=Dt[d]||{};return{...r,branch:r.branch||l?.branch||m.branch||"Civil Lines, Ludhiana",bankAddress:r.bankAddress||l?.bankAddress||m.bankAddress||"Ludhiana, Punjab, INDIA.",ifscCode:r.ifscCode||l?.ifscCode||m.ifscCode||"HDFC0000034",swiftCode:r.swiftCode||l?.swiftCode||m.swiftCode||"HDFCINBB",upiId:r.upiId||l?.upiId||m.upiId||"tekkiweb@hdfcbank",qrCodeUrl:r.qrCodeUrl||l?.qrCodeUrl||m.qrCodeUrl||""}})},[ie]),ue=u.useMemo(()=>Tt.map(t=>({value:t,label:t})),[]),De=u.useMemo(()=>Pt.map(t=>({value:t,label:t})),[]),[a,c]=u.useState({invoiceNo:Re(),issueDate:at(!0),dueDate:st(new Date(Date.now()+7200*60*1e3),12,0,"PM",!0),paymentTerms:"5 Days",placeOfSupply:"Punjab",currency:"INR",client:"",clientAddress:"",clientCountry:"India",clientEmail:"",clientPhone:"",clientGstin:"",project:"",company:"Tekki Web Solutions Pvt. Ltd.",discount:0,bankAccountId:"BA0",paid:0,status:"Pending",attachmentUrl:"",attachmentName:"",description:"",lineItems:[{id:"1",srNo:1,description:"Web Development Charges [From 01 August 2026 to 31 August 2026]",sacCode:"998313",hoursOrDays:"31",rate:"",amount:64500},{id:"2",srNo:2,description:"Web Development Charges [Overtime / Additional Support]",sacCode:"998313",hoursOrDays:"-",rate:"",amount:3115}]}),[J,H]=u.useState({}),[$,fe]=u.useState([]);u.useEffect(()=>{let t=!0;return rt.getProjects().then(s=>{t&&Array.isArray(s)&&fe(s.map(r=>({id:r.id,name:r.name,projectCode:r.projectCode})))}).catch(s=>{console.warn("Could not load PMS projects for invoices:",s)}),()=>{t=!1}},[]);const Z=u.useMemo(()=>{const t=[],s=new Set;return $.length>0&&$.forEach((r,l)=>{r.name&&!s.has(r.name.trim().toLowerCase())&&(t.push({value:r.name,label:r.name,sub:r.projectCode?`PMS Code: ${r.projectCode}`:`PMS Project #${1001+l}`}),s.add(r.name.trim().toLowerCase()))}),s.has("ticketwiz")||t.unshift({value:"TicketWiz",label:"TicketWiz",sub:"PMS Code: #PRJ-1001"}),s.has("visionx")||t.push({value:"VisionX",label:"VisionX",sub:"PMS Code: #PRJ-1002"}),t.sort((r,l)=>r.label.localeCompare(l.label))},[$]),K=u.useMemo(()=>{const t=[],s=new Set;for(const l of Q)if(l.name&&l.name.trim()&&!s.has(l.name.trim().toLowerCase())){const d=l.name.trim(),m=l.companyName&&l.companyName.trim()?l.companyName.trim():"",v=m?`${d} (${m})`:d;t.push({value:d,label:v,sub:l.email||l.phone||void 0}),s.add(d.toLowerCase())}
1return[{value:"Strivesteam Private Limited",label:"Strivesteam Private Limited",sub:"Bhubaneswar, Odisha"},{value:"Palwinder Singh Gill",label:"Palwinder Singh Gill (Quick Bin Hire)",sub:"Victoria, Australia"},{value:"Daniel Cohen",label:"Daniel Cohen (Ticket Liberty)",sub:"United States of America"}].forEach(l=>{s.has(l.value.toLowerCase())||(t.unshift(l),s.add(l.value.toLowerCase()))}),t.sort((l,d)=>l.label.localeCompare(d.label))},[Q]);u.useEffect(()=>{if(i&&z.length>0){const t=z.find(s=>s.id===i);if(t){let s=null;try{const r=localStorage.getItem(`invoice_extended_${t.id}`)||localStorage.getItem(`invoice_extended_${t.invoiceNo}`);r&&(s=JSON.parse(r))}catch{}c(r=>({...r,invoiceNo:t.invoiceNo,issueDate:t.issueDate||r.issueDate,dueDate:t.dueDate||r.dueDate,client:t.client,project:t.project||r.project,paid:t.paid,status:t.status,attachmentUrl:t.attachmentUrl||"",attachmentName:t.attachmentName||"",...s||{}}))}}},[i,z]);const je=t=>{const s=Q.find(P=>P.name?.trim().toLowerCase()===t.trim().toLowerCase()||P.companyName?.trim().toLowerCase()===t.trim().toLowerCase());let r="",l="India",d="",m="",v="",R=a.currency,de=a.placeOfSupply;s&&(r=s.address||s.streetAddress||"",l=s.country||"India",d=s.email||"",m=s.phone||s.mobile||"",v=s.gstin||s.taxId||""),t==="Strivesteam Private Limited"?(r="Plot No-397/4763, Kanak Durga Nagar, Chandrasekharpur, Bhubaneswar, Khordha, Odisha - 751024.",l="India",d="[email protected]",v="21ABMCS7476C1Z8",de="Odisha",R="INR"):t.includes("Palwinder Singh Gill")?(r="Victoria, Australia",l="Australia",m="+61 426 500 577",de="Outside India",R="AUD"):t.includes("Daniel Cohen")&&(r="United States of America",l="United States of America",d="[email protected]",m="+1 516-667-0269",de="Outside India",R="USD"),c(P=>({...P,client:t,clientAddress:r||P.clientAddress,clientCountry:l||P.clientCountry,clientEmail:d||P.clientEmail,clientPhone:m||P.clientPhone,clientGstin:v||P.clientGstin,currency:R,placeOfSupply:de}))},j=u.useMemo(()=>F.find(t=>t.id===a.bankAccountId)||F[0]||{bank:"",branch:"",bankAddress:"",accountNo:"",ifscCode:"",swiftCode:"",upiId:"",qrCodeUrl:""},[F,a.bankAccountId]),k=u.useMemo(()=>a.currency.toUpperCase()!=="INR"||a.placeOfSupply.toLowerCase().includes("outside"),[a.currency,a.placeOfSupply]),W=u.useMemo(()=>a.lineItems.reduce((t,s)=>t+(Number(s.amount)||0),0),[a.lineItems]),b=Number(a.discount)||0,O=Math.max(0,W-b),U=!k&&a.placeOfSupply.toLowerCase().includes("punjab"),g=U?Math.round(O*9/100):0,y=U?Math.round(O*9/100):0,N=!k&&!U?Math.round(O*18/100):0,Y=k?0:g+y+N,S=k?O:O+Y,X=Number(a.paid)||0,ee=Math.max(0,S-X),L=u.useMemo(()=>$e(S,a.currency),[S,a.currency]),te=()=>{const t=a.lineItems.length+1;c(s=>({...s,lineItems:[...s.lineItems,{id:String(Date.now()),srNo:t,description:"Software Engineering & Technical Support",sacCode:"998313",hoursOrDays:"31",rate:"",amount:0}]}))},se=t=>{if(a.lineItems.length<=1){I.error("Invoice must contain at least one line item");return}const s=a.lineItems.filter((r,l)=>l!==t).map((r,l)=>({...r,srNo:l+1}
1));c(r=>({...r,lineItems:s}))},A=(t,s,r)=>{const l=[...a.lineItems],d={...l[t],[s]:r};if((s==="hoursOrDays"||s==="rate")&&d.hoursOrDays&&d.rate){const m=Number(d.hoursOrDays),v=Number(d.rate);!isNaN(m)&&!isNaN(v)&&m>0&&v>0&&(d.amount=Math.round(m*v))}l[t]=d,c(m=>({...m,lineItems:l}))},_=async t=>{const s=t.name.split(".").pop()?.toLowerCase()||"";if(["exe","bat","cmd","sh","php","pl","cgi","js","jar","vbs","scr","msi","com"].includes(s)){I.error(`Security Alert: Executable file extension (.${s}) is prohibited!`);return}if(t.size>25*1024*1024){I.error("File size exceeds maximum limit of 25MB");return}V(!0);try{const l=await new Promise((d,m)=>{const v=new FileReader;v.onload=()=>d(v.result),v.onerror=m,v.readAsDataURL(t)});c(d=>({...d,attachmentUrl:l,attachmentName:t.name})),I.success(`Attached invoice document: ${t.name}`)}catch{I.error("Failed to process invoice file upload")}finally{V(!1)}},M=()=>{const t={};return a.invoiceNo.trim()||(t.invoiceNo="Invoice number is required"),a.client.trim()||(t.client="Client selection is required"),a.issueDate||(t.issueDate="Issue date is required"),H(s=>({...s,...t})),Object.keys(t).length>0?(I.error("Please fill all required fields in Tab 1"),!1):!0},oe=()=>{const t={};return S<=0&&(t.amount="Invoice total amount must be greater than 0"),H(s=>({...s,...t})),Object.keys(t).length>0?(I.error("Please ensure invoice has valid line items and amount > 0"),!1):!0},ce=async()=>{if(!M()){C("particulars");return}if(!oe()){C("lineItems");return}h(!0);try{const t=Nt({invoiceNo:a.invoiceNo.trim(),client:a.client.trim(),project:a.project.trim(),issueDate:a.issueDate,dueDate:a.dueDate,amount:S,paid:X,outstanding:ee,status:a.status,attachmentUrl:a.attachmentUrl||null,attachmentName:a.attachmentName||null}),s={invoiceNo:a.invoiceNo.trim(),clientAddress:a.clientAddress,clientCountry:a.clientCountry,clientEmail:a.clientEmail,clientPhone:a.clientPhone,clientGstin:a.clientGstin,paymentTerms:a.paymentTerms,placeOfSupply:a.placeOfSupply,currency:a.currency,lineItems:a.lineItems,discount:b,bankAccountId:a.bankAccountId,isExport:k};if(i){await he({id:i,body:t}).unwrap();try{localStorage.setItem(`invoice_extended_${i}`,JSON.stringify(s)),localStorage.setItem(`invoice_extended_${a.invoiceNo.trim()}`,JSON.stringify(s))}catch{}I.success(`Invoice ${a.invoiceNo} updated successfully`)}else{const r=await pe(t).unwrap();try{r?.id&&localStorage.setItem(`invoice_extended_${r.id}`,JSON.stringify(s)),localStorage.setItem(`invoice_extended_${a.invoiceNo.trim()}`,JSON.stringify(s))}catch{}I.success(`Official Tax Invoice ${a.invoiceNo} created successfully`)}x(`${n}/invoices`)}catch(t){I.error(t?.data?.message||"Failed to save invoice")}finally{h(!1)}},ae={invoiceNo:a.invoiceNo,issueDate:a.issueDate,dueDate:a.dueDate,placeOfSupply:a.placeOfSupply,projectName:a.project,paymentTerms:a.paymentTerms,currency:a.currency,clientName:a.client,clientAddress:a.clientAddress,clientEmail:a.clientEmail,clientPhone:a.clientPhone,clientGstin:a.clientGstin,clientCountry:a.clientCountry,lineItems:a.lineItems,subTotal:W,discount:b,taxableAmount:O,isExport:k,gstType:U?"intra":"inter",cgstAmount:g,sgstAmount:y,igstAmount:N,totalGst:Y,totalAmount:S,bankName:j.bank||"",branch:j.branch||"",bankAddress:j.bankAddress||"",accountNo:j.accountNo||"",ifscCode:j.ifscCode||"",swiftCode:j.swiftCode||"",upiId:j.upiId||"",qrCodeUrl:j.qrCodeUrl||"",authorizedSignatory:"Authorized Signatory"};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.jsxs("div",{className:"shrink-0 bg-white dark:bg-slate-900 border-b border-border px-3 sm:px-6 py-3 sm:py-4 flex flex-col sm:flex-row items-stretch sm:items-center justify-between gap-3 shadow-2xs",children:[e.jsxs("div",{className:"flex items-center gap-2.5 sm:gap-3 min-w-0",children:[e.jsx("div",{className:"w-2.5 h-7 sm:h-8 bg-blue-600 rounded-full shrink-0 shadow-xs"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("h1",{className:"text-sm sm:text-base md:text-lg font-bold text-slate-900 dark:text-slate-100 flex items-center gap-1.5 sm:gap-2 flex-wrap min-w-0",children:[e.jsx("span",{className:"truncate",children:i?"Edit Tax Invoice":"New Tax Invoice & Billing"}),e.jsx("span",{className:"text-[10px] sm:text-xs font-semibold px-2 py-0.5 rounded-full bg-blue-50 text-blue-700 dark:bg-blue-950/60 dark:text-blue-300 border border-blue-200 dark:border-blue-800 shrink-0",children:"Official TWS Format"})]}),e.jsx("p",{className:"text-[11px] sm:text-xs text-muted-foreground mt-0.5 truncate sm:whitespace-normal",children:"Multi-currency billing, SAC service line items, corporate banking integration & print-ready tax invoices"})]})]}),e.jsxs("div",{className:"flex items-center gap-2 justify-end shrink-0",children:[e.jsxs(Oe,{to:`${n}/invoices`,className:"inline-flex items-center gap-1.5 px-2.5 sm:px-3 py-1.5 rounded-lg border border-border text-xs font-medium text-slate-700 dark:text-slate-300 hover:bg-slate-100 dar
1k:hover:bg-slate-800 transition-colors",children:[e.jsx(ge,{className:"w-3.5 h-3.5"})," ",e.jsx("span",{className:"hidden sm:inline",children:"Back to Invoices"}),e.jsx("span",{className:"sm:hidden",children:"Back"})]}),e.jsxs("button",{type:"button",onClick:()=>T(!0),className:"inline-flex items-center gap-1.5 px-2.5 sm:px-3 py-1.5 rounded-lg bg-slate-100 hover:bg-slate-200 dark:bg-slate-800 dark:hover:bg-slate-700 text-slate-800 dark:text-slate-200 text-xs font-medium border border-border transition-colors cursor-pointer",children:[e.jsx(Ue,{className:"w-3.5 h-3.5 text-blue-600"})," ",e.jsx("span",{className:"hidden sm:inline",children:"Fullscreen Preview"}),e.jsx("span",{className:"sm:hidden",children:"Preview"})]})]})]}),e.jsx("div",{className:"flex-1 min-h-0 flex flex-col overflow-hidden",children:e.jsxs(lt,{value:G,onValueChange:C,className:"flex-1 flex flex-col min-h-0",children:[e.jsxs("div",{className:"px-3 sm:px-6 py-2 bg-white dark:bg-slate-900 border-b border-border flex items-center justify-between gap-2 shrink-0 overflow-x-auto no-scrollbar",children:[e.jsxs(nt,{className:"bg-slate-100 dark:bg-slate-800/80 p-1 h-9 rounded-lg flex-nowrap shrink min-w-0",children:[e.jsx(Ne,{value:"particulars",className:"text-xs font-semibold px-2.5 sm:px-3 py-1 data-[state=active]:bg-white dark:data-[state=active]:bg-slate-900 data-[state=active]:shadow-xs whitespace-nowrap",children:"1. Particulars & Client"}),e.jsx(Ne,{value:"lineItems",className:"text-xs font-semibold px-2.5 sm:px-3 py-1 data-[state=active]:bg-white dark:data-[state=active]:bg-slate-900 data-[state=active]:shadow-xs whitespace-nowrap",children:"2. Line Items, Tax & Banking"}),e.jsxs(Ne,{value:"review",className:"text-xs font-semibold px-2.5 sm:px-3 py-1 data-[state=active]:bg-white dark:data-[state=active]:bg-slate-900 data-[state=active]:shadow-xs flex items-center gap-1.5 whitespace-nowrap",children:[e.jsx(me,{className:"w-3.5 h-3.5 text-blue-600"})," 3. Official Review & Print"]})]}),e.jsx("div",{className:"hidden sm:flex items-center gap-2 shrink-0",children:e.jsxs("span",{className:"text-[11px] font-semibold text-slate-500",children:["Invoice Total: ",e.jsxs("strong",{className:"font-mono text-slate-900 dark:text-slate-100 text-xs",children:[a.currency," ",S.toLocaleString("en-IN")]})]})})]}),e.jsx(ve,{value:"particulars",className:"flex-1 min-h-0 overflow-y-auto p-3 sm:p-6 m-0 no-scrollbar sm:custom-scrollbar",children:e.jsxs("div",{className:"max-w-6xl mx-auto grid grid-cols-12 gap-6",children:[e.jsxs("div",{className:"col-span-12 lg:col-span-8 space-y-5",children:[e.jsxs("div",{className:"p-5 rounded-xl bg-white dark:bg-slate-900 border border-border shadow-2xs space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-border pb-3",children:[e.jsxs("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary flex items-center gap-1.5",children:[e.jsx(Ge,{className:"w-4 h-4"})," Invoice Identification & Schedule"]}),e.jsxs("button",{type:"button",onClick:()=>c(t=>({...t,invoiceNo:Re()})),className:"text-[11px] text-blue-600 hover:underline inline-flex items-center gap-1",children:[e.jsx(it,{className:"w-3 h-3"})," Auto-generate No"]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[e.jsx(w,{label:"Invoice Number",required:!0,error:J.invoiceNo,children:e.jsx("input",{type:"text",value:a.invoiceNo,onChange:t=>c(s=>({...s,invoiceNo:t.target.value})),className:o,placeholder:"e.g. TWS-26-38"})}),e.jsx(w,{label:"Issue Date & Time",required:!0,error:J.issueDate,children:e.jsx(Le,{value:a.issueDate,onChange:t=>c(s=>({...s,issueDate:t})),showTime:!0,className:o})}),e.jsx(w,{label:"Payment Due Date",required:!0,children:e.jsx(Le,{value:a.dueDate,onChange:t=>c(s=>({...s,dueDate:t})),showTime:!0,className:o})})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 pt-1",children:[e.jsx(w,{label:"Payment Terms",hint:"Standard credit window",children:e.jsx(xe,{value:a.paymentTerms,onChange:t=>c(s=>({...s,paymentTerms:t})),options:ue,placeholder:"Select payment terms...",className:o})}),e.jsx(w,{label:"Place of Supply",hint:"Controls GST (Intra vs Inter vs Export)",children:e.jsx(xe,{value:a.placeOfSupply,onChange:t=>c(s=>({...s,placeOfSupply:t})),options:De,placeholder:"Select place of supply...",className:o})})]})]}),e.jsxs("div",{className:"p-5 rounded-xl bg-white dark:bg-slate-900 border border-border shadow-2xs space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-border pb-3",children:[e.jsxs("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary flex items-center gap-1.5",children:[e.jsx(ot,{className:"w-4 h-4"})," Client & Project Allocation"]}),e.jsx("span",{className:"text-[10px] text-muted-foreground",children:"Synced with Sales CRM & PMS"})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsx(w,{label:"Client Name",required:!0,error:J.client,hint:"Sales Module Contacts",children:e.jsx(xe,{value:a.client,onChange:je,options:K,placeholder:"Select Client...",className:o})}),e.jsx(w,{label:"Project Name",hint:"PMS Module Project",children:e.jsx(xe,{value:a.project,onChange:t=>c(s=>({...s,project:t})),options:Z,placeholder:"Select PMS Project...",className:o})})]}),e.jsxs("div",{className:"p-3.5 rounded-lg bg-slate-50 dark:bg-slate-800/40 border border-border space-y-3",children:[e.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider text-slate-500 block",children:'Client Contact & Tax Information (Prints under "Bill To")'}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[e.jsx(w,{label:"Client Country",children:e.jsx("input",{type:"text",value:a.clientCountry,onChange:t=>c(s=>({...s,clientCountry:t.target.value})),className:o,placeholder:"e.g. India / USA"})}),e.jsx(w,{label:"Client Email",children:e.jsx("input",{type:"email",value:a.clientEmail,onChange:t=>c(s=>({...s,clientEmail:t.target.value})),className:o,placeholder:"e.g. [email protected]"})}),e.jsx(w,{label:"Client GSTIN / Tax ID",children:e.jsx("input",{type:"text",value:a.clientGstin,onChange:t=>c(s=>({...s,clientGstin:t.target.value.toUpperCase()})),className:o,placeholder:"e.g. 21ABMCS7476C1Z8"})})]}),e.jsx(w,{label:"Client Complete Billing Address",children:e.jsx("input",{type:"text",value:a.clientAddress,onChange:t=>c(s=>({...s,clientAddress:t.target.value})),className:o,placeholder:"e.g. Plot No-397/4763, Kanak Durga Nagar, Chandrasekharpur, Bhubane
1swar - 751024"})})]})]}),e.jsx("div",{className:"flex justify-end pt-2",children:e.jsxs("button",{type:"button",onClick:()=>{M()&&C("lineItems")},className:"inline-flex items-center gap-1.5 px-5 py-2.5 rounded-lg bg-blue-600 hover:bg-blue-700 text-white font-semibold text-xs shadow-md transition-all cursor-pointer",children:["Next: Line Items, Tax & Banking ",e.jsx(Ee,{className:"w-3.5 h-3.5"})]})})]}),e.jsx("div",{className:"col-span-12 lg:col-span-4 space-y-4",children:e.jsxs("div",{className:"p-5 rounded-xl bg-white dark:bg-slate-900 border border-border shadow-2xs space-y-4 sticky top-4",children:[e.jsxs("h4",{className:"text-xs font-bold uppercase tracking-wider text-slate-800 dark:text-slate-200 border-b border-border pb-2.5 flex items-center justify-between",children:[e.jsx("span",{children:"Live Invoice Summary"}),e.jsx("span",{className:"px-2 py-0.5 rounded text-[10px] font-bold bg-blue-50 text-blue-700 dark:bg-blue-950 dark:text-blue-300",children:a.currency})]}),e.jsxs("div",{className:"space-y-2 text-xs",children:[e.jsxs("div",{className:"flex justify-between py-1 border-b border-border/50",children:[e.jsx("span",{className:"text-muted-foreground",children:"Invoice No"}),e.jsx("span",{className:"font-mono font-bold",children:a.invoiceNo})]}),e.jsxs("div",{className:"flex justify-between py-1 border-b border-border/50",children:[e.jsx("span",{className:"text-muted-foreground",children:"Client"}),e.jsx("span",{className:"font-semibold text-right max-w-[180px] truncate",children:a.client||"Not selected"})]}),e.jsxs("div",{className:"flex justify-between py-1 border-b border-border/50",children:[e.jsx("span",{className:"text-muted-foreground",children:"Place of Supply"}),e.jsx("span",{className:"font-semibold",children:a.placeOfSupply})]}),e.jsxs("div",{className:"flex justify-between py-1 border-b border-border/50",children:[e.jsx("span",{className:"text-muted-foreground",children:"Tax Regime"}),e.jsx("span",{className:B("font-bold text-[11px]",k?"text-emerald-600":"text-blue-600"),children:k?"Zero-rated Export (LUT)":U?"Intra-state (9% + 9%)":"Inter-state IGST (18%)"})]}),e.jsxs("div",{className:"flex justify-between py-2 border-b border-border text-sm",children:[e.jsx("span",{className:"font-bold",children:"Total Payable"}),e.jsxs("span",{className:"font-bold font-mono text-blue-600 dark:text-blue-400",children:[a.currency," ",S.toLocaleString("en-IN")]})]})]}),e.jsx("div",{className:"pt-2",children:e.jsxs("button",{type:"button",onClick:()=>T(!0),className:"w-full py-2 px-3 rounded-lg border border-border text-xs font-semibold text-slate-700 dark:text-slate-200 hover:bg-slate-100 dark:hover:bg-slate-800 transition-colors flex items-center justify-center gap-1.5 cursor-pointer",children:[e.jsx(ct,{className:"w-3.5 h-3.5 text-blue-600"})," Preview Full Document"]})})]})})]})}),e.jsx(ve,{value:"lineItems",className:"flex-1 min-h-0 overflow-y-auto p-6 m-0 custom-scrollbar",children:e.jsxs("div",{className:"max-w-6xl mx-auto space-y-6",children:[e.jsxs("div",{className:"p-4 rounded-xl bg-white dark:bg-slate-900 border border-border shadow-2xs flex items-center justify-between flex-wrap gap-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-9 h-9 rounded-lg bg-primary/10 text-primary flex items-center justify-center font-bold text-sm",children:a.currency}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-bold text-slate-900 dark:text-slate-100 block",children:"Billing Currency & Taxation Engine"}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Select currency; exports under LUT automatically apply zero GST"})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-48",children:e.jsxs(ye,{value:a.currency,onValueChange:t=>c(s=>({...s,currency:t})),children:[e.jsx(we,{className:o,children:e.jsx(ke,{placeholder:"Select Currency"})}),e.jsx(Ce,{children:At.map(t=>e.jsx(Se,{value:t.value,children:t.label},t.value))})]})}),k&&e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-bold bg-emerald-50 text-emerald-700 dark:bg-emerald-950/60 dark:text-emerald-300 border border-emerald-200 dark:border-emerald-800",children:[e.jsx(Te,{className:"w-3.5 h-3.5"})," Export LUT (0% GST)"]})]})]}),e.jsxs("div",{className:"p-5 rounded-xl bg-white dark:bg-slate-900 border border-border shadow-2xs space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-border pb-3",children:[e.jsxs("div",{children:[e.jsxs("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary flex items-center gap-1.5",children:[e.jsx(dt,{className:"w-4 h-4"})," Description of Services & SAC Breakdown"]}),e.jsx("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:"Add services with standard Indian SAC codes and specific billing units"})]}),e.jsxs("button",{type:"button",onClick:te,className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-blue-50 text-blue-700 dark:bg-blue-950/60 dark:text-blue-300 border border-blue-200 dark:border-blue-800 text-xs font-semibold hover:bg-blue-100 transition-colors cursor-pointer",children:[e.jsx(xt,{className:"w-3.5 h-3.5"})," Add Service Row"]})]}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border text-slate-500 font-semibold text-[11px] text-left",children:[e.jsx("th",{className:"py-2 px-2 w-10 text-center",children:"#"}),e.jsx("th",{className:"py-2 px-3",children:"Description of Services"}),e.jsx("th",{className:"py-2 px-2 w-28",children:"SAC Code"}),e.jsx("th",{className:"py-2 px-2 w-24 text-center",children:k?"Days":"Hours/Days"}),e.jsxs("th",{className:"py-2 px-2 w-28 text-right",children:["Rate (",a.currency,")"]}),e.jsxs("th",{className:"py-2 px-3 w-32 text-right",children:["Amount (",a.currency,") *"]}),e.jsx("th",{className:"py-2 px-2 w-10 text-center"})]})}),e.jsx("tbody",{className:"divide-y divide-border/60",children:a.lineItems.map((t,s)=>e.jsxs("tr",{className:"group hover:bg-slate-50/50 dark:hover:bg-slate-800/30",children:[e.jsx("td",{className:"py-2 px-2 text-center font-bold text-slate-500",children:s+1}),e.jsx("td",{className:"py-2 px-3",children:e.jsx("input",{type:"text",value:t.description,onChange:r=>A(s,"description",r.target.value),className:o,placeholder:"e.g. Web Development Charges [From 01 Aug to 31 Aug]"})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx("input",{type:"text",value:t.sacCode,onChange:r=>
1A(s,"sacCode",r.target.value),className:B(o,"font-mono text-center"),placeholder:"998313"})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx("input",{type:"text",value:t.hoursOrDays||"",onChange:r=>A(s,"hoursOrDays",r.target.value),className:B(o,"text-center"),placeholder:"31"})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx("input",{type:"number",value:t.rate||"",onChange:r=>A(s,"rate",r.target.value),className:B(o,"text-right font-mono"),placeholder:"0.00"})}),e.jsx("td",{className:"py-2 px-3",children:e.jsx("input",{type:"number",value:t.amount||"",onChange:r=>A(s,"amount",Number(r.target.value)),className:B(o,"text-right font-mono font-bold"),placeholder:"0.00"})}),e.jsx("td",{className:"py-2 px-2 text-center",children:e.jsx("button",{type:"button",onClick:()=>se(s),className:"p-1 rounded text-slate-400 hover:text-rose-600 hover:bg-rose-50 dark:hover:bg-rose-950/40 transition-colors",title:"Delete Row",children:e.jsx(mt,{className:"w-3.5 h-3.5"})})})]},t.id||s))})]})}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-4 pt-3 border-t border-border items-center",children:[e.jsxs("div",{className:"md:col-span-7 space-y-1",children:[e.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:"Amount in Words (Auto-generated)"}),e.jsx("p",{className:"text-xs font-semibold text-slate-800 dark:text-slate-200 italic bg-slate-50 dark:bg-slate-800/50 p-2 rounded-lg border border-border",children:L})]}),e.jsxs("div",{className:"md:col-span-5 space-y-2 text-xs",children:[e.jsxs("div",{className:"flex justify-between py-1",children:[e.jsx("span",{className:"text-slate-600 dark:text-slate-400",children:"Sub Total"}),e.jsxs("span",{className:"font-mono font-bold",children:[a.currency," ",W.toLocaleString("en-IN")]})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-slate-600 dark:text-slate-400",children:"Discount (-)"}),e.jsx("div",{className:"w-32",children:e.jsx("input",{type:"number",value:a.discount,onChange:t=>c(s=>({...s,discount:t.target.value})),className:B(o,"h-7 text-right font-mono"),placeholder:"0.00"})})]}),k?e.jsxs("div",{className:"flex justify-between py-1 text-emerald-600 font-semibold border-t border-border/60",children:[e.jsx("span",{children:"Export GST (LUT)"}),e.jsx("span",{children:"0% (Zero-rated)"})]}):e.jsxs("div",{className:"space-y-1.5 pt-1 border-t border-border/60",children:[U?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex justify-between text-slate-600 dark:text-slate-400",children:[e.jsx("span",{children:"CGST (9%)"}),e.jsxs("span",{className:"font-mono",children:["â¹",g.toLocaleString("en-IN")]})]}),e.jsxs("div",{className:"flex justify-between text-slate-600 dark:text-slate-400",children:[e.jsx("span",{children:"SGST (9%)"}),e.jsxs("span",{className:"font-mono",children:["â¹",y.toLocaleString("en-IN")]})]})]}):e.jsxs("div",{className:"flex justify-between text-slate-600 dark:text-slate-400",children:[e.jsx("span",{children:"IGST (18%)"}),e.jsxs("span",{className:"font-mono",children:["â¹",N.toLocaleString("en-IN")]})]}),e.jsxs("div",{className:"flex justify-between font-bold text-slate-900 dark:text-slate-100",children:[e.jsx("span",{children:"Total GST (18%)"}),e.jsxs("span",{className:"font-mono",children:["â¹",Y.toLocaleString("en-IN")]})]})]}),e.jsxs("div",{className:"flex justify-between py-2 border-t border-slate-900 dark:border-slate-100 text-sm font-extrabold text-blue-600 dark:text-blue-400",children:[e.jsx("span",{children:"Total Invoice Amount"}),e.jsxs("span",{className:"font-mono",children:[a.currency," ",S.toLocaleString("en-IN")]})]})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"p-5 rounded-xl bg-white dark:bg-slate-900 border border-border shadow-2xs space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-border pb-3",children:[e.jsxs("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary flex items-center gap-1.5",children:[e.jsx(bt,{className:"w-4 h-4"})," Corporate Bank Account for Invoice"]}),e.jsx(Oe,{to:`${n}/bank-accounts`,className:"text-[10px] text-blue-600 hover:underline",children:"Manage Accounts"})]}),e.jsx(w,{label:"Select Bank Account",hint:"Fetches branch, address, IFSC, SWIFT & QR code",children:e.jsxs(ye,{value:a.bankAccountId,onValueChange:t=>c(s=>({...s,bankAccountId:t})),children:[e.jsx(we,{className:o,children:e.jsx(ke,{placeholder:"Select Bank"})}),e.jsx(Ce,{children:F.map(t=>
1e.jsxs(Se,{value:t.id,children:[t.bank," - ",t.account," (",t.accountNo,")"]},t.id))})]})}),e.jsxs("div",{className:"p-3.5 rounded-lg border border-slate-200 dark:border-slate-800 bg-slate-50 dark:bg-slate-800/40 flex items-start justify-between gap-3 text-[11px]",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"font-bold text-slate-900 dark:text-slate-100",children:[j.bank," (",j.accountNo,")"]}),e.jsxs("div",{className:"text-slate-600 dark:text-slate-400",children:["Branch: ",j.branch||"Main Branch"]}),e.jsxs("div",{className:"text-slate-500 text-[10px]",children:["IFSC: ",j.ifscCode||"â"," | Swift: ",j.swiftCode||"â"]}),j.upiId&&e.jsxs("div",{className:"text-blue-600 font-semibold text-[10px]",children:["UPI: ",j.upiId]})]}),j.qrCodeUrl&&e.jsx("div",{className:"w-14 h-14 bg-white p-1 rounded border border-slate-200 shrink-0 flex items-center justify-center",children:e.jsx("img",{src:j.qrCodeUrl,alt:"UPI QR",className:"w-full h-full object-contain"})})]})]}),e.jsxs("div",{className:"p-5 rounded-xl bg-white dark:bg-slate-900 border border-border shadow-2xs space-y-4",children:[e.jsx("div",{className:"flex items-center justify-between border-b border-border pb-3",children:e.jsxs("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary flex items-center gap-1.5",children:[e.jsx(pt,{className:"w-4 h-4"})," Payment Tracking & Status"]})}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(w,{label:"Amount Paid to Date",children:e.jsx("input",{type:"number",value:a.paid,onChange:t=>c(s=>({...s,paid:t.target.value})),className:B(o,"font-mono font-semibold text-emerald-600"),placeholder:"0.00"})}),e.jsx(w,{label:"Invoice Status",children:e.jsxs(ye,{value:a.status,onValueChange:t=>c(s=>({...s,status:t})),children:[e.jsx(we,{className:o,children:e.jsx(ke,{placeholder:"Status"})}),e.jsx(Ce,{children:It.map(t=>e.jsx(Se,{value:t,children:t},t))})]})})]}),e.jsxs("div",{className:"p-3 rounded-lg bg-slate-50 dark:bg-slate-800/40 border border-border flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-muted-foreground uppercase font-bold block",children:"Outstanding Balance"}),e.jsxs("span",{className:"font-mono text-base font-black text-rose-600",children:[a.currency," ",ee.toLocaleString("en-IN")]})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-border bg-white dark:bg-slate-800 text-xs font-medium text-slate-700 dark:text-slate-200 hover:bg-slate-50 cursor-pointer shadow-2xs",children:[e.jsx(ht,{className:"w-3.5 h-3.5 text-blue-600"}),a.attachmentName?"Change Attachment":"Attach Document",e.jsx("input",{type:"file",className:"hidden",onChange:t=>{const s=t.target.files?.[0];s&&_(s)}})]}),a.attachmentName&&e.jsx("span",{className:"block text-[10px] text-blue-600 truncate max-w-[150px] mt-1 text-right",children:a.attachmentName})]})]})]})]}),e.jsxs("div",{className:"flex items-center justify-between pt-4 border-t border-border",children:[e.jsxs("button",{type:"button",onClick:()=>C("particulars"),className:"inline-flex items-center gap-1.5 px-4 py-2 rounded-lg border border-border text-xs font-medium text-slate-700 hover:bg-slate-100 transition-colors cursor-pointer",children:[e.jsx(ge,{className:"w-3.5 h-3.5"})," Back: Particulars"]}),e.jsxs("button",{type:"button",onClick:()=>{oe()&&C("review")},className:"inline-flex items-center gap-1.5 px-5 py-2.5 rounded-lg bg-blue-600 hover:bg-blue-700 text-white font-semibold text-xs shadow-md transition-all cursor-pointer",children:["Next: Official Review & Print ",e.jsx(Ee,{className:"w-3.5 h-3.5"})]})]})]})}),e.jsx(ve,{value:"review",className:"flex-1 min-h-0 overflow-y-auto p-6 m-0 custom-scrollbar bg-slate-100 dark:bg-slate-950",children:e.jsxs("div",{className:"max-w-4xl mx-auto space-y-6",children:[e.jsxs("div",{className:"p-4 rounded-xl bg-white dark:bg-slate-900 border border-border shadow-2xs flex items-center justify-between flex-wrap gap-4 no-print",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-emerald-50 text-emerald-600 flex items-center justify-center font-bold",children:e.jsx(Te,{className:"w-6 h-6"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-bold text-slate-900 dark:text-slate-100",children:"Official Tax Invoice Preview & Executive Audit"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Verify client billing, GST/LUT computations, and bank details before issuing"})]})]}),e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsxs("button",{type:"button",onClick:()=>T(!0),className:"inline-flex items-center gap-1.5 px-3 py-2 rounded-lg border border-border bg-slate-50 hover:bg-slate-100 dar
1k:bg-slate-800 text-slate-700 dark:text-slate-200 text-xs font-semibold shadow-2xs transition-colors cursor-pointer",children:[e.jsx(Ue,{className:"w-3.5 h-3.5 text-blue-600"})," Fullscreen"]}),e.jsxs("button",{type:"button",onClick:()=>window.print(),className:"inline-flex items-center gap-1.5 px-3.5 py-2 rounded-lg bg-blue-50 text-blue-700 dark:bg-blue-950/60 dark:text-blue-300 border border-blue-200 dark:border-blue-800 text-xs font-bold hover:bg-blue-100 transition-colors cursor-pointer",children:[e.jsx(me,{className:"w-3.5 h-3.5"})," Print / Save PDF"]}),e.jsxs("button",{type:"button",disabled:f,onClick:ce,className:"inline-flex items-center gap-2 px-5 py-2 rounded-lg bg-emerald-600 hover:bg-emerald-700 text-white text-xs font-bold shadow-md transition-all cursor-pointer disabled:opacity-50",children:[f?e.jsx(Me,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(ut,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:i?"Update & Issue Invoice":"Confirm & Issue Invoice"})]})]})]}),e.jsx("div",{className:"flex justify-center",children:e.jsx(We,{...ae,showPrintButton:!1})}),e.jsxs("div",{className:"flex items-center justify-between pt-4 border-t border-border no-print",children:[e.jsxs("button",{type:"button",onClick:()=>C("lineItems"),className:"inline-flex items-center gap-1.5 px-4 py-2 rounded-lg border border-border bg-white text-xs font-medium text-slate-700 hover:bg-slate-50 transition-colors cursor-pointer",children:[e.jsx(ge,{className:"w-3.5 h-3.5"})," Back: Edit Line Items"]}),e.jsxs("button",{type:"button",disabled:f,onClick:ce,className:"inline-flex items-center gap-2 px-6 py-2.5 rounded-lg bg-emerald-600 hover:bg-emerald-700 text-white text-xs font-bold shadow-md transition-all cursor-pointer disabled:opacity-50",children:[f?e.jsx(Me,{className:"w-4 h-4 animate-spin"}):e.jsx(ft,{className:"w-4 h-4"}),e.jsx("span",{children:"Save & Complete Invoice Registration"})]})]})]})})]})}),e.jsx(St,{open:D,onOpenChange:T,invoiceData:ae})]})}const Rt=Object.freeze(Object.defineProperty({__proto__:null,NewInvoicePage:Be,default:Be},Symbol.toStringTag,{value:"Module"}));export{Be as N,St as O,Rt as i};
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.