PageSourceSearch

https://vizops360.ai/assets/revenue.new-CrdqFNW1.js

js vizops360.ai collected 2026-10-05 13:51:14 UTC 32,177 bytes, 1 lines download raw bytes

1import{d4 as Le,ax as Pe,aJ as Ee,r as c,dr as Ae,dZ as Te,e1 as De,dC as Me,e2 as Fe,d5 as Oe,d6 as qe,di as Ve,dY as $e,d_ as Ue,e0 as Ge,j as e,J as He,L as Be,K as ee,cS as Qe,cT as _e,cU as te,O as ze,b as se,cV as ae,e3 as Je,as as re,S as Ke,b7 as j,bC as le,cf as ne,cg as de,ch as oe,ci as ie,cj as ce,bD as We,bE as Ze,bH as Xe,N as Ye,a0 as et,V as tt,aI as N}from"./index-CpeGhXo5.js";import{a as st}from"./Panel-Cf_wAUzv.js";import{c as at,d as rt}from"./financeMappers-CUv1G2pV.js";import{u as lt}from"./useCurrencyHelpers-D5hUvgaW.js";import{f as me,a as P}from"./financeEmployeeDisplay-CYwTzdnu.js";import{u as nt}from"./companySettingsMockApi-D8Uh5efq.js";import"./currency-CACMzR5Q.js";const dt=["INR","USD","EUR","GBP","AED","AUD","CAD","SGD"],ot=["Pending","Approved","Received","Overdue","Cancelled"];function ue(){return`INV-${new Date().getFullYear()}-${Math.floor(100+Math.random()*900)}`}function p({label:y,children:E,required:k,error:b,hint:C}){return e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("label",{className:"text-[11px] font-semibold text-slate-700 dark:text-slate-300 tracking-tight",children:[y," ",k&&e.jsx("span",{className:"text-red-500",children:"*"})]}),C&&e.jsx("span",{className:"text-[10px] text-slate-400 font-normal",children:C})]}),E,b&&e.jsx("p",{className:"text-[10px] text-red-500 font-medium",children:b})]})}function kt(){const y=Le(),E=Pe(),[k]=Ee(),b=k.get("editId")||k.get("id"),[C,pe]=c.useState(!1),[A,G]=c.useState(!1),[T,w]=c.useState("details"),[it,ct]=c.useState(null),I=c.useRef(null),{activeCurrency:D,sym:M,fmt:mt}=lt(),x="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:H}=Ae({limit:2e3}),{data:xe,isLoading:ut}=Te({limit:1e3,sortBy:"name",sortOrder:"asc"}),[be]=De(),[he]=Me(),B=c.useMemo(()=>(H?.items??[]).map(at),[H]),fe=xe?.items??[],[s,Q]=c.useState({date:Fe(!0),invoiceNo:ue(),company:"Tekki Web Solutions Pvt. Ltd.",companyId:"",client:"",clientId:"",project:"",projectId:"",department:"",departmentId:"",team:"",teamId:"",employee:"",employeeId:"",salesPerson:"",salesPersonId:"",gross:0,currency:"INR",tax:0,status:"Pending",description:""}),[h,F]=c.useState({}),{data:S=[],isLoading:pt}=Oe(),{data:R=[],isLoading:xt}=qe(),{data:ge,isLoading:bt}=Ve({limit:500,status:"Active"}),{data:O=[]}=$e(),{data:_=[]}=nt(),g=ge?.items??[],[q,je]=c.useState([]);c.useEffect(()=>{let t=!0;return Ue.getProjects().then(a=>{t&&Array.isArray(a)&&je(a.map(r=>({id:r.id,name:r.name,projectCode:r.projectCode})))}).catch(a=>{console.warn("Could not load PMS projects for revenue:",a)}),()=>{t=!1}},[]);const V=c.useMemo(()=>{const t=[],a=new Set,r=(l,d)=>{const n=l.projectCode||l.project_code||l.upperId||l.upper_id;return n&&!/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(n)?n.startsWith("#")?n:`#${n}`:`#PRJ-${1001+d}`};return q.length>0&&q.forEach((l,d)=>{if(l.name&&!a.has(l.name.trim().toLowerCase())){const n=r(l,d);t.push({value:l.id||l.name,label:l.name,sub:`PMS Code: ${n}`,name:l.name}),a.add(l.name.trim().toLowerCase())}}),a.has("visionx")||t.unshift({value:"pms-visionx",label:"VisionX",sub:"PMS Code: #PRJ-1001",name:"VisionX"}),t.sort((l,d)=>l.name.localeCompare(d.name))},[q]),z=c.useMemo(()=>{const t=O.filter(r=>r.status==="Active").map(r=>({value:r.id,label:r.name,sub:r.code})),a=new Set(t.map(r=>r.label));for(const r of _)a.has(r.name)||(t.push({value:r.id,label:r.name,sub:r.isPrimary?"Primary Company":"Sub Company"}),a.add(r.name));return a.has("Tekki Web Solutions Pvt. Ltd.")||t.push({value:"comp-primary-1",label:"Tekki Web Solutions Pvt. Ltd.",sub:"Primary Company"}),t.sort((r,l)=>r.label.localeCompare(l.label))},[O,_]),{data:J}=Ge({limit:500}),K=c.useMemo(()=>J?.items??[],[J]),W=c.useMemo(()=>{const t=[],a=new Set;for(const r of K)if(r.name&&r.name.trim()&&!a.has(r.name.trim().toLowerCase())){const l=r.name.trim(),d=r.companyName&&r.companyName.trim()?r.companyName.trim():"",n=d?`${l} (${d})`:l;t.push({value:l,label:n}),a.add(l.toLowerCase())}return t.sort((r,l)=>r.label.localeCompare(l.label))},[K]),ve=c.useMemo(()=>{let t=S;
1const a=(s.company||"").toLowerCase().trim(),r=s.companyId;if(a||r){const d=t.filter(n=>{const i=n.companyId||n.legalEntityId||n.company_id,m=(n.companyName||n.company||n.company_name||"").toLowerCase().trim();return r&&i&&i===r||a&&m&&(m===a||a.includes(m)||m.includes(a))?!0:!(m&&a&&!m.includes(a)&&!a.includes(m))});d.length>0&&(t=d)}const l=new Map;for(const d of t)d.name&&!l.has(d.name.trim())&&l.set(d.name.trim(),{value:d.id||d.name,label:d.name.trim()});return Array.from(l.values()).sort((d,n)=>d.label.localeCompare(n.label))},[S,s.companyId,s.company]),Ne=c.useMemo(()=>{let t=R;const a=s.companyId,r=(s.company||"").toLowerCase().trim(),l=s.departmentId,d=(s.department||"").toLowerCase().trim();if(a||r){const n=t.filter(i=>{if(a&&i.companyId&&i.companyId===a)return!0;const m=(i.companyName||i.company||"").toLowerCase().trim();return!!(r&&m&&(m===r||r.includes(m)||m.includes(r)))});n.length>0&&(t=n)}if(l||d){const n=t.filter(i=>!!(l&&i.departmentId===l||d&&(i.departmentName?.toLowerCase().trim()===d||i.department?.name?.toLowerCase().trim()===d)));n.length>0&&(t=n)}return t.map(n=>({value:n.id||n.name,label:n.name}))},[s.companyId,s.company,s.departmentId,s.department,R]),ye=c.useMemo(()=>{let t=g;const a=s.departmentId,r=(s.department||"").toLowerCase().trim(),l=s.teamId,d=(s.team||"").toLowerCase().trim();if(a||r){const n=t.filter(i=>!!(a&&(i.departments?.some(m=>m.departmentId===a)||i.departmentId===a)||r&&(i.departmentName?.toLowerCase().trim()===r||i.department?.toLowerCase().trim()===r)));n.length>0&&(t=n)}if(l||d){const n=t.filter(i=>!!(l&&(i.teams?.some(m=>m.teamId===l)||i.teamId===l)||d&&(i.teamName?.toLowerCase().trim()===d||i.team?.toLowerCase().trim()===d)));n.length>0&&(t=n)}return t.map(n=>({value:n.id,label:me(n),sub:n.designation}))},[s.departmentId,s.department,s.teamId,s.team,g]),ke=c.useMemo(()=>{let t=g.filter(a=>{const r=a.departments?.some(d=>d.departmentName?.toLowerCase().includes("sales")||d.departmentName?.toLowerCase().includes("growth")||d.departmentId==="dept-sales"),l=a.designation?.toLowerCase().includes("sales")||a.designation?.toLowerCase().includes("bdm")||a.designation?.toLowerCase().includes("business development")||a.designation?.toLowerCase().includes("account executive");return r||l});return t.length>0?t.map(a=>({value:a.id,label:me(a),sub:a.designation||"Sales Department"})):[{value:"sp-1",label:"Nancy Arya",sub:"Sales Executive (Sales Department)"},{value:"sp-2",label:"Janvi Arora",sub:"Business Development Manager (Sales Department)"},{value:"sp-3",label:"Rohit Kumar",sub:"Senior Sales Representative (Sales Department)"},{value:"sp-4",label:"Pooja Sharma",sub:"Key Account Manager (Sales Department)"}]},[g]);c.useEffect(()=>{if(b){const t=B.find(a=>a.id===b);
1t&&Q({date:t.date,invoiceNo:t.invoiceNo,company:t.company,companyId:t.companyId??"",client:t.client,clientId:t.clientId??"",project:t.project,projectId:t.projectId??"",department:t.department,departmentId:t.departmentId??"",team:t.team,teamId:t.teamId??"",employee:t.employee,employeeId:t.employeeId??"",salesPerson:t.salesPerson,salesPersonId:t.salesPersonId??"",gross:t.gross,currency:"INR",tax:t.gross>0?Math.round((t.net/t.gross-1)*100):0,status:t.status,description:t.description||""})}},[b,B]);const v=s.currency==="USD"||s.currency!=="INR",f=Number(s.gross)||0,Z=v?0:Number(s.tax)||0,L=v?0:Math.round(f*Z/100),$=f+L,o=(t,a)=>{Q(r=>({...r,[t]:a})),h[t]&&F(r=>({...r,[t]:""}))},X=()=>{const t={};return s.date||(t.date="Entry date is required"),s.invoiceNo.trim()||(t.invoiceNo="Invoice number is required"),s.client||(t.client="Client selection is required"),!s.companyId&&!s.company&&(t.company="Company selection is required"),(!f||f<=0)&&(t.gross="Enter a valid gross amount (> 0)"),F(a=>({...a,...t})),Object.keys(t).length>0?(N.error("Please fill all required entry fields before proceeding"),!1):!0},Ce=t=>{t==="audit"&&T==="details"&&!X()||w(t)},we=()=>{X()&&w("audit")},Ie=()=>{const t={};return s.date||(t.date="Entry date is required"),s.invoiceNo.trim()||(t.invoiceNo="Invoice number is required"),s.client||(t.client="Client selection is required"),!s.companyId&&!s.company&&(t.company="Company selection is required"),(!f||f<=0)&&(t.gross="Enter a valid gross amount (> 0)"),F(t),(t.date||t.invoiceNo||t.client||t.company||t.gross)&&w("details"),Object.keys(t).length===0},Se=async t=>{if(t.preventDefault(),A)return;if(!Ie()){N.error("Please fix errors before submitting");return}G(!0);const a=S.find(u=>u.id===s.departmentId),r=R.find(u=>u.id===s.teamId),l=g.find(u=>u.id===s.employeeId),d=g.find(u=>u.id===s.salesPersonId),n=O.find(u=>u.id===s.companyId),i=fe.find(u=>u.id===s.clientId),m=V.find(u=>u.value===s.projectId),Re={date:s.date,invoiceNo:s.invoiceNo,client:i?.name??s.client,clientId:s.clientId||void 0,project:m?.name??s.project,projectId:s.projectId||void 0,department:a?.name??s.department,departmentId:s.departmentId||void 0,team:r?.name??s.team,teamId:s.teamId||void 0,employee:l?P(l):s.employee,employeeId:s.employeeId||void 0,salesPerson:d?P(d):s.salesPerson,salesPersonId:s.salesPersonId||void 0,company:n?.name??s.company,companyId:s.companyId||void 0,description:s.description||"",gross:f,tax:L,net:$,status:s.status},Y=rt(Re);try{b?(await he({id:b,body:Y}).unwrap(),N.success(`Revenue entry ${s.invoiceNo} updated successfully!`)):(await be(Y).unwrap(),N.success(`Revenue entry ${s.invoiceNo} submitted successfully!`)),pe(!0),E(`${y}/revenue`)}catch(u){N.error(u?.data?.message||u?.message||"Failed to save revenue entry")}finally{G(!1)}},U=(t,a=void 0)=>{document.execCommand(t,!1,a),I.current&&o("description",I.current.innerHTML)};return C?e.jsx("div",{className:"h-full flex items-center justify-center p-6 bg-muted/10",children:e.jsxs("div",{className:"max-w-md w-full bg-card border border-border rounded-2xl p-10 text-center shadow-2xl animate-in fade-in zoom-in duration-500",children:[e.jsx("div",{className:"w-24 h-24 bg-success/10 rounded-full flex items-center justify-center mx-auto mb-8 shadow-inner",children:e.jsx(He,{className:"w-12 h-12 text-success animate-bounce"})}),e.jsx("h2",{className:"text-3xl font-black mb-3 tracking-tight",children:b?"Entry Updated!":"Entry Saved!"}),e.jsxs("p",{className:"text-muted-foreground mb-10 leading-relaxed",children:["The revenue record for ",e.jsx("span",{className:"font-bold text-foreground px-2 py-0.5 bg-muted rounded",children:s.invoiceNo})," has been successfully saved."]})]})}):e.jsxs("div",{className:"w-full flex-1 flex flex-col bg-slate-50/50 dark:bg-slate-950/50",children:[e.jsx("div",{className:"px-6 py-4 border-b border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-900",children:e.jsx(st,{title:b?"Edit Revenue Record":"New Revenue Entry",subtitle:"Comprehensive MIS data entry module · Allocate revenue to client, project, and company entity",accent:"mod-expense",actions:e.jsxs(Be,{to:`${y}/revenue`,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 dark:hover:bg-slate-800 text-xs font-semibold text-slate-700 dark:text-slate-200 inline-flex items-center gap-1.5 transition-colors shadow-2xs",children:[e.jsx(ee,{className:"w-3.5 h-3.5"})," Back to Revenue Entries"]})})}),e.jsx("form",{onSubmit:Se,className:"flex-1 flex flex-col",children:e.jsxs(Qe,{value:T,onValueChange:Ce,className:"w-full flex-1 flex flex-col",children:[e.jsxs("div",{className:"px-6 border-b border-slate-200 dark:border-slate-800 bg-slate-50/70 dark:bg-slate-900/70 flex items-center justify-between",children:[e.jsxs(_e,{className:"h-auto p-0 bg-transparent gap-8",children:[e.jsxs(te,{value:"details",className:"rounded-none border-b-2 border-transparent data-[state=active]:border-blue-600 dar
1k:data-[state=active]:border-blue-400 data-[state=active]:bg-transparent data-[state=active]:text-blue-600 dark:data-[state=active]:text-blue-400 text-slate-600 dark:text-slate-400 hover:text-slate-900 dark:hover:text-slate-200 text-xs font-bold px-0 py-3 shadow-none transition-all cursor-pointer flex items-center gap-2",children:[e.jsx(ze,{className:"w-3.5 h-3.5 text-blue-600"}),e.jsx("span",{children:"1. Core Details, HRMS & Valuation"})]}),e.jsxs(te,{value:"audit",className:"rounded-none border-b-2 border-transparent data-[state=active]:border-blue-600 dark:data-[state=active]:border-blue-400 data-[state=active]:bg-transparent data-[state=active]:text-blue-600 dark:data-[state=active]:text-blue-400 text-slate-600 dark:text-slate-400 hover:text-slate-900 dark:hover:text-slate-200 text-xs font-bold px-0 py-3 shadow-none transition-all cursor-pointer flex items-center gap-2",children:[e.jsx(se,{className:"w-3.5 h-3.5 text-emerald-600"}),e.jsx("span",{children:"2. Audit Trail & CFO Authorization"})]})]}),e.jsx("div",{className:"flex items-center gap-3",children:e.jsx("span",{className:"text-[11px] font-semibold text-slate-500",children:T==="details"?"Step 1 of 2: Entry Particulars":"Step 2 of 2: Audit & Authorization"})})]}),e.jsxs("div",{className:"w-full flex-1 grid grid-cols-1 lg:grid-cols-12 gap-0 bg-white dark:bg-slate-900",children:[e.jsxs("div",{className:"lg:col-span-9 p-6 border-b lg:border-b-0 lg:border-r border-slate-200 dark:border-slate-800 space-y-6 flex flex-col justify-between",children:[e.jsxs(ae,{value:"details",className:"space-y-6 mt-0",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 pb-1.5 border-b border-slate-100 dark:border-slate-800/80",children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-blue-600 dark:bg-blue-400 shrink-0"}),e.jsx("h3",{className:"text-xs font-bold text-slate-800 dark:text-slate-200 uppercase tracking-wider",children:"Core Revenue Details"})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-3.5 pt-1",children:[e.jsx(p,{label:"Entry Date & Time",required:!0,error:h.date,hint:"PMS-style selector",children:e.jsx(Je,{value:s.date,onChange:t=>o("date",t),showTime:!0,placeholder:"Select Date & Time",className:re("h-9 text-xs font-semibold",h.date&&"border-red-500 ring-1 ring-red-500")})}),e.jsx(p,{label:"Invoice Number",required:!0,error:h.invoiceNo,hint:"Auto-generated",children:e.jsxs("div",{className:"flex gap-1",children:[e.jsx("input",{value:s.invoiceNo,onChange:t=>o("invoiceNo",t.target.value),className:x}),e.jsx("button",{type:"button",onClick:()=>o("invoiceNo",ue()),className:"h-9 px-2.5 rounded-md border border-slate-200 dark:border-slate-800 bg-slate-50 dark:bg-slate-800 hover:bg-slate-100 text-xs inline-flex items-center gap-1 shrink-0 cursor-pointer",title:"Generate new invoice number",children:e.jsx(Ke,{className:"w-3.5 h-3.5 text-blue-600"})})]})}),e.jsx(p,{label:"Client Name",required:!0,error:h.client,children:e.jsx(j,{options:W,value:s.client,onChange:t=>{const a=W.find(r=>r.value===t);o("client",a?.label??t),o("clientId",t)},placeholder:"Select Client...",triggerClassName:x})}),e.jsx(p,{label:"Project Name",children:e.jsx(j,{options:V,value:s.projectId,onChange:t=>{const a=V.find(r=>r.value===t);o("project",a?.name??t),o("projectId",t)},placeholder:"Select Project (PMS)...",triggerClassName:x})})]})]}),e.jsxs("div",{className:"space-y-3 pt-1",children:[e.jsxs("div",{className:"flex items-center gap-2 pb-1.5 border-b border-slate-100 dark:border-slate-800/80",children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-purple-600 dark:bg-purple-400 shrink-0"}),e.jsx("h3",{className:"text-xs font-bold text-slate-800 dark:text-slate-200 uppercase tracking-wider",children:"Department & HRMS Allocation"})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-3.5 pt-1",children:[e.jsx(p,{label:"Company",required:!0,error:h.company,children:e.jsx(j,{options:z,value:s.companyId||"",onChange:t=>{const a=z.find(r=>r.value===t);o("company",a?.label??t),o("companyId",t),o("department",""),o("departmentId",""),o("team",""),o("teamId",""),o("employee",""),o("employeeId","")},placeholder:"Select Company Entity...",triggerClassName:x})}),e.jsx(p,{label:"Department",children:e.jsx(j,{options:ve,value:s.departmentId,onChange:t=>{const a=S.find(r=>r.id===t);o("department",a?.name??""),o("departmentId",t),o("team",""),o("teamId",""),o("employee",""),o("employeeId","")},placeholder:"Select Department...",triggerClassName:x})}),e.jsx(p,{label:"Team",children:e.jsx(j,{options:Ne,value:s.teamId,onChange:t=>{const a=R.find(r=>r.id===t);o("team",a?.name??""),o("teamId",t),o("employee",""),o("employeeId","")},placeholder:"Select Team...",triggerClassName:x})}),e.jsx(p,{label:"Allocated To (Employee)",children:e.jsx(j,{options:ye,value:s.employeeId,onChange:t=>{const a=g.find(r=>r.id===t);o("employee",a?P(a):""),o("employeeId",t)},placeholder:"Select Employee...",triggerClassName:x})}),e.jsx(p,{label:"Sales Person",children:e.jsx(j,{options:ke,value:s.salesPersonId,onChange:t=>{const a=g.find(r=>r.id===t);o("salesPerson",a?P(a):""),o("salesPersonId",t)},placeholder:"Select Sales Person...",triggerClassName:x})})]}),e.jsxs("div",{className:"col-span-full p-2.5 rounded-lg border border-blue-100 bg-blue-50/50 dark:bg-blue-950/20 dark:border-blue-900/40 flex items-center gap-2",children:[e.jsx(le,{className:"w-4 h-4 text-blue-600 dar
1k:text-blue-400 shrink-0"}),e.jsxs("div",{className:"text-[11px] text-slate-600 dark:text-slate-300 leading-tight",children:[e.jsx("span",{className:"font-semibold text-slate-800 dark:text-slate-100",children:"HRMS Master Entities: "}),"Company, Department, Team, Employee, and Sales Representative are linked directly to your organization structure."]})]})]}),e.jsxs("div",{className:"space-y-3 pt-1",children:[e.jsxs("div",{className:"flex items-center gap-2 pb-1.5 border-b border-slate-100 dark:border-slate-800/80",children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-emerald-600 dark:bg-emerald-400 shrink-0"}),e.jsx("h3",{className:"text-xs font-bold text-slate-800 dark:text-slate-200 uppercase tracking-wider",children:"Amount, Tax & Valuation"})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-3.5 pt-1",children:[e.jsx(p,{label:"Currency",required:!0,children:e.jsxs(ne,{value:s.currency,onValueChange:t=>{o("currency",t),(t==="USD"||t!=="INR")&&o("tax",0)},children:[e.jsx(de,{className:x,children:e.jsx(oe,{placeholder:"Select Currency"})}),e.jsx(ie,{children:dt.map(t=>e.jsx(ce,{value:t,children:t},t))})]})}),e.jsx(p,{label:"Gross Amount",required:!0,error:h.gross,children:e.jsx("input",{type:"text",inputMode:"decimal",placeholder:"0.00",value:s.gross===0?"":s.gross,onChange:t=>{const a=t.target.value;(a===""||/^\d*\.?\d*$/.test(a))&&o("gross",a===""?0:a)},className:re(x,h.gross&&"border-red-500 focus:ring-red-500 ring-1 ring-red-500")})}),v?e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between min-h-[17px]",children:[e.jsx("label",{className:"text-[11px] font-semibold text-slate-700 dark:text-slate-300 tracking-tight",children:"Taxation Status"}),e.jsx("span",{className:"text-[10px] text-emerald-600 font-medium",children:"Export"})]}),e.jsxs("div",{className:"h-9 w-full rounded-md border border-emerald-200 dark:border-emerald-800 bg-emerald-50/60 dark:bg-emerald-950/40 px-3 text-xs font-semibold text-emerald-700 dark:text-emerald-300 flex items-center justify-between shadow-2xs",children:[e.jsx("span",{children:"Zero-rated Export"}),e.jsx("span",{className:"text-[10px] uppercase font-bold bg-emerald-100 dark:bg-emerald-900/60 px-1.5 py-0.5 rounded",children:"0% Tax"})]})]}):e.jsx(p,{label:"Tax Rate (%)",error:h.tax,hint:"Default 0%",children:e.jsx("input",{type:"text",inputMode:"decimal",placeholder:"0",value:s.tax===0?"":s.tax,onChange:t=>{const a=t.target.value;(a===""||/^\d*\.?\d*$/.test(a))&&o("tax",a===""?0:a)},className:x})}),e.jsx(p,{label:"Payment Status",required:!0,error:h.status,children:e.jsxs(ne,{value:s.status,onValueChange:t=>o("status",t),children:[e.jsx(de,{className:x,children:e.jsx(oe,{placeholder:"Select Status"})}),e.jsx(ie,{children:ot.map(t=>e.jsx(ce,{value:t,children:t},t))})]})})]})]}),e.jsxs("div",{className:"space-y-3 pt-1",children:[e.jsxs("div",{className:"flex items-center gap-2 pb-1.5 border-b border-slate-100 dark:border-slate-800/80",children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-blue-600 dark:bg-blue-400 shrink-0"}),e.jsx("h3",{className:"text-xs font-bold text-slate-800 dark:text-slate-200 uppercase tracking-wider",children:"Additional Information & Remarks"})]}),e.jsx("div",{className:"p-1 space-y-4",children:e.jsx(p,{label:"Description & Notes",children:e.jsxs("div",{className:"border border-slate-200 dark:border-slate-800 rounded-lg overflow-hidden bg-white dark:bg-slate-900 shadow-2xs",children:[e.jsxs("div",{className:"flex items-center gap-1 border-b border-slate-100 dark:border-slate-800 bg-slate-50 dark:bg-slate-800/50 p-1.5",children:[e.jsx("button",{type:"button",onClick:()=>U("bold"),className:"p-1.5 hover:bg-slate-200 dark:hover:bg-slate-700 rounded text-slate-600 dark:text-slate-300 cursor-pointer",children:e.jsx(We,{className:"w-3.5 h-3.5"})}),e.jsx("button",{type:"button",onClick:()=>U("italic"),className:"p-1.5 hover:bg-slate-200 dark:hover:bg-slate-700 rounded text-slate-600 dark:text-slate-300 cursor-pointer",children:e.jsx(Ze,{className:"w-3.5 h-3.5"})}),e.jsx("button",{type:"button",onClick:()=>U("insertUnorderedList"),className:"p-1.5 hover:bg-slate-200 dark:hover:bg-slate-700 rounded text-slate-600 dar
1k:text-slate-300 cursor-pointer",children:e.jsx(Xe,{className:"w-3.5 h-3.5"})})]}),e.jsx("div",{ref:I,contentEditable:!0,onInput:()=>o("description",I.current?.innerHTML||""),className:"min-h-[85px] p-3 text-xs focus:outline-none custom-scrollbar",dangerouslySetInnerHTML:{__html:s.description}})]})})})]}),e.jsx("div",{className:"flex justify-end pt-3 border-t border-slate-100 dark:border-slate-800",children:e.jsxs("button",{type:"button",onClick:we,className:"h-9 px-5 rounded-lg bg-blue-600 hover:bg-blue-700 text-white text-xs font-semibold inline-flex items-center gap-1.5 shadow-2xs transition-colors cursor-pointer",children:["Next: Audit Trail & CFO Sign-Off ",e.jsx(Ye,{className:"w-3.5 h-3.5"})]})})]}),e.jsxs(ae,{value:"audit",className:"space-y-6 mt-0",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2 pb-1.5 border-b border-slate-100 dark:border-slate-800/80",children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-purple-600 dark:bg-purple-400 shrink-0"}),e.jsx("h3",{className:"text-xs font-bold text-slate-800 dark:text-slate-200 uppercase tracking-wider",children:"Revenue Final Clearance & Approvals"})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[e.jsxs("div",{className:"p-3.5 bg-emerald-50/60 dark:bg-emerald-950/40 border border-emerald-200 dark:border-emerald-800/60 rounded-xl space-y-1",children:[e.jsx("span",{className:"text-[10px] font-bold uppercase text-emerald-700 dark:text-emerald-300 block",children:"1. Client Validation"}),e.jsx("p",{className:"text-xs text-slate-700 dark:text-slate-300 font-medium",children:"Billing Address & GST Validated"})]}),e.jsxs("div",{className:"p-3.5 bg-blue-50/60 dark:bg-blue-950/40 border border-blue-200 dark:border-blue-800/60 rounded-xl space-y-1",children:[e.jsx("span",{className:"text-[10px] font-bold uppercase text-blue-700 dark:text-blue-300 block",children:"2. Revenue Recognition"}),e.jsx("p",{className:"text-xs text-slate-700 dark:text-slate-300 font-medium",children:"Accrual Date & Amount Confirmed"})]}),e.jsxs("div",{className:"p-3.5 bg-purple-50/60 dark:bg-purple-950/40 border border-purple-200 dark:border-purple-800/60 rounded-xl space-y-1",children:[e.jsx("span",{className:"text-[10px] font-bold uppercase text-purple-700 dark:text-purple-300 block",children:"3. CFO Clearance"}),e.jsx("p",{className:"text-xs text-slate-700 dark:text-slate-300 font-medium",children:"Ready for Ledger Settlement"})]})]}),e.jsx("div",{className:"p-4 bg-slate-50/70 dark:bg-slate-900/70 rounded-xl border border-slate-200 dark:border-slate-800 space-y-2",children:e.jsx(p,{label:"Assign Line Manager / Final Approver",required:!0,hint:"CFO Pawandeep Kaur",children:e.jsxs("div",{className:"h-9 w-full rounded-md border border-slate-200 dark:border-slate-700 bg-white dark:bg-slate-800 px-3 text-xs font-semibold text-slate-800 dark:text-slate-100 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2 truncate",children:[e.jsx(se,{className:"w-4 h-4 text-purple-600 shrink-0"}),e.jsx("span",{children:"Pawandeep Kaur (CFO / Managing Director)"})]}),e.jsx("span",{className:"text-[10px] uppercase font-bold text-purple-600 dark:text-purple-400 bg-purple-50 dark:bg-purple-950/60 px-2 py-0.5 rounded border border-purple-200 dark:border-purple-800",children:"Authorized Signatory"})]})})}),e.jsxs("div",{className:"space-y-3 pt-1",children:[e.jsxs("div",{className:"flex items-center gap-2 pb-1.5 border-b border-slate-100 dark:border-slate-800/80",children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-blue-600 dark:bg-blue-400 shrink-0"}),e.jsx("h3",{className:"text-xs font-bold text-slate-800 dark:text-slate-200 uppercase tracking-wider",children:"Revenue Entry Audit Trail & Activity Logs"})]}),e.jsx("div",{className:"p-4 bg-slate-50/50 dark:bg-slate-900/50 rounded-xl border border-slate-200 dark:border-slate-800 space-y-4",children:e.jsxs("div",{className:"relative pl-6 space-y-4 before:absolute before:left-2 before:top-2 before:bottom-2 before:w-0.5 before:bg-slate-200 dark:before:bg-slate-800",children:[e.jsxs("div",{className:"relative",children:[e.jsx("span",{className:"absolute -left-6 top-0 w-4 h-4 rounded-full bg-emerald-500 text-white flex items-center justify-center text-[10px] font-bold",children:"✓"}),e.jsx("div",{className:"text-xs font-bold text-slate-900 dark:text-slate-100",children:"Revenue Draft Created"}),e.jsxs("div",{className:"text-[11px] text-slate-500",children:["Invoice Ref ",s.invoiceNo||"INV-2026-001"," registered in revenue ledger store."]})]}),e.jsxs("div",{className:"relative",children:[e.jsx("span",{className:"absolute -left-6 top-0 w-4 h-4 rounded-full bg-blue-500 text-white flex items-center justify-center text-[10px] font-bold",children:"i"}),e.jsx("div",{className:"text-xs font-bold text-slate-900 dark:text-slate-100",children:"Client & HRMS Allocation Verified"}),e.jsxs("div",{className:"text-[11px] text-slate-500",children:["Client: ",s.client||"Acme Corp"," | Dept: ",s.department||"Executive"]})]}),e.jsxs("div",{className:"relative",children:[e.jsx("span",{className:"absolute -left-6 top-0 w-4 h-4 rounded-full bg-amber-500 text-white flex items-center justify-center text-[10px] font-bold",children:"!"}),e.jsx("div",{className:"text-xs font-bold text-slate-900 dark:text-slate-100",children:"CFO Audit & Lock Pending"}),e.jsx("div",{className:"text-[11px] text-slate-500",children:"Scheduled for CFO authorization desk review & GL lock."})]})]})})]})]}),e.jsxs("div",{className:"flex justify-between pt-3 border-t border-slate-200 dark:border-slate-800",children:[e.jsxs("button",{type:"button",onClick:()=>w("details"),className:"h-9 px-3.5 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-xs font-medium text-slate-700 dark:text-slate-200 inline-flex items-center gap-1.5 transition-colors cursor-pointer",children:[e.jsx(ee,{className:"w-3.5 h-3.5"})," Back: Revenue Details"]}
1),e.jsxs("button",{type:"submit",disabled:A,className:"h-9 px-5 rounded-lg bg-emerald-600 hover:bg-emerald-700 text-white text-xs font-bold inline-flex items-center gap-1.5 shadow-2xs transition-colors disabled:opacity-50 cursor-pointer",children:[e.jsx(et,{className:"w-3.5 h-3.5"})," ",A?"Saving...":b?"Update Revenue Entry":"Final Approval & Submit"]})]})]})]}),e.jsxs("div",{className:"lg:col-span-3 bg-slate-50/60 dark:bg-slate-900/60 p-6 space-y-5 flex flex-col justify-between h-full",children:[e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-slate-200 dark:border-slate-800 pb-3.5",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"p-2 rounded-xl bg-blue-50 dark:bg-blue-950/60 text-blue-600 dark:text-blue-400 border border-blue-100 dark:border-blue-900/40",children:e.jsx(tt,{className:"w-4 h-4"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-xs font-bold text-slate-800 dark:text-slate-100 uppercase tracking-wider",children:"Live Summary"}),e.jsx("span",{className:"text-[11px] text-slate-400 font-medium",children:"Revenue Calculation"})]})]}),e.jsx("span",{className:"text-[10px] font-bold px-2 py-0.5 rounded-full bg-blue-50 text-blue-700 dark:bg-blue-950/50 dark:text-blue-300 border border-blue-200 dark:border-blue-800",children:s.currency})]}),e.jsxs("div",{className:"space-y-3 bg-white dark:bg-slate-900 p-4 rounded-xl border border-slate-200 dark:border-slate-800 shadow-2xs",children:[e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsx("span",{className:"text-slate-500 font-medium",children:"Gross Revenue"}),e.jsxs("span",{className:"font-semibold font-data text-slate-800 dark:text-slate-200",children:[M," ",D==="INR"?f.toLocaleString("en-IN"):f.toLocaleString("en-US")]})]}),e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsx("span",{className:"text-slate-500 font-medium",children:v?"Tax (Export 0%)":`Tax (${Z}%)`}),e.jsx("span",{className:"font-medium font-data text-slate-600 dark:text-slate-400",children:v?e.jsx("span",{className:"text-emerald-600 dark:text-emerald-400 font-semibold text-[11px]",children:"Zero-rated (No Tax)"}):`+ ${M} ${D==="INR"?L.toLocaleString("en-IN"):L.toLocaleString("en-US")}`})]}),e.jsxs("div",{className:"border-t border-slate-100 dark:border-slate-800 pt-2.5 flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-bold text-slate-900 dark:text-slate-100 uppercase tracking-wider",children:"Net Receipt"}),e.jsxs("span",{className:"text-sm font-black font-data text-emerald-600 dark:text-emerald-400",children:[M," ",D==="INR"?$.toLocaleString("en-IN"):$.toLocaleString("en-US")]})]})]}),e.jsxs("div",{className:"p-3.5 rounded-xl border border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-900 space-y-2 text-xs",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-slate-400",children:"Invoice No:"}),e.jsx("span",{className:"font-semibold font-data text-slate-700 dark:text-slate-300",children:s.invoiceNo})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-slate-400",children:"Status:"}),e.jsx("span",{className:"px-2 py-0.5 rounded-full text-[10px] font-bold bg-amber-50 text-amber-700 dark:bg-amber-950/40 dark:text-amber-300 border border-amber-200 dark:border-amber-800",children:s.status})]}),s.client&&e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-slate-400",children:"Client:"}),e.jsx("span",{className:"font-semibold text-slate-700 dark:text-slate-300 truncate max-w-[120px]",children:s.client})]})]})]}),e.jsxs("div",{className:"p-3.5 rounded-xl bg-blue-50/50 dark:bg-blue-950/20 border border-blue-100 dark:border-blue-900/40 space-y-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-blue-700 dark:text-blue-300 text-xs font-semibold",children:[e.jsx(le,{className:"w-3.5 h-3.5 shrink-0"})," MIS Data Accuracy"]}
1),e.jsx("p",{className:"text-[11px] text-slate-600 dark:text-slate-400 leading-normal",children:"All saved revenue entries update the P&L dashboard and financial reports automatically."})]})]})]})]})})]})}export{kt as NewRevenuePage,kt 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.