1import{E as f,s as x}from"./excelUtils-B6c4w-tr.js";import{S as N,E as g,V as C,P as b,a as F,C as E,B as S}from"./expenseDraft-DqR0Jp71.js";import"./index-CpeGhXo5.js";const u=[{header:"Expense Date (YYYY-MM-DD)",key:"date",width:22,section:"classification",required:!0,example:"2026-03-15"},{header:"Voucher / Ref No",key:"voucherNo",width:20,section:"classification",required:!0,example:"EXP-2026-0001"},{header:"Expense Type",key:"expenseType",width:20,section:"classification",required:!0,example:"Variable"},{header:"Expense Category",key:"category",width:24,section:"classification",required:!0,example:"Software & Subscriptions"},{header:"Sub-Category",key:"subCategory",width:24,section:"classification",required:!1,example:"SaaS Software"},{header:"Recurring? (YES/NO)",key:"recurring",width:18,section:"classification",required:!1,example:"NO"},{header:"Recurring Frequency",key:"recurringFrequency",width:20,section:"classification",required:!1,example:"Monthly"},{header:"Recurring End Date",key:"recurringEndDate",width:20,section:"classification",required:!1,example:""},{header:"Vendor / Payee Name",key:"vendorName",width:26,section:"vendor",required:!0,example:"AWS Cloud Services"},{header:"Vendor Type",key:"vendorType",width:18,section:"vendor",required:!1,example:"Supplier"},{header:"Vendor GST/PAN",key:"vendorGstPan",width:20,section:"vendor",required:!1,example:"07AAAAA0000A1Z5"},{header:"Vendor Contact",key:"vendorContact",width:24,section:"vendor",required:!1,example:"[email protected]"},{header:"Company",key:"company",width:28,section:"allocation",required:!0,example:"Tekki Web Solutions Pvt. Ltd."},{header:"Department",key:"department",width:22,section:"allocation",required:!1,example:"IT & Production"},{header:"Team",key:"team",width:20,section:"allocation",required:!1,example:"DevOps Team"},{header:"Employee Name",key:"employeeName",width:24,section:"allocation",required:!1,example:"Sarbjit Singh Grewal"},{header:"Employee ID",key:"employeeEmpCode",width:18,section:"allocation",required:!1,example:"TWS4161"},{header:"Approver Name",key:"approverName",width:24,section:"allocation",required:!1,example:"Pawandeep Kaur Grewal"},{header:"Approver ID",key:"approverEmpCode",width:18,section:"allocation",required:!1,example:"TWS4160"},{header:"Project Name",key:"project",width:24,section:"allocation",required:!1,example:"Internal Infrastructure"},{header:"Cost Center",key:"costCenter",width:20,section:"allocation",required:!1,example:"CC-TECH-01"},{header:"Gross Amount (Base)",key:"gross",width:20,section:"amount",required:!0,example:5e4},{header:"Currency",key:"currency",width:14,section:"amount",required:!0,example:"INR"},{header:"Tax Applicable? (YES/NO)",key:"taxApplicable",width:22,section:"amount",required:!1,example:"YES"},{header:"Tax Rate (%)",key:"taxRate",width:16,section:"amount",required:!1,example:18},{header:"Tax Amount",key:"tax",width:18,section:"amount",required:!1,example:9e3},{header:"Net Amount",key:"net",width:20,section:"amount",required:!0,example:59e3},{header:"Payment Status",key:"paymentStatus",width:18,section:"payment",required:!0,example:"Paid"},{header:"Payment Mode",key:"paymentMode",width:20,section:"payment",required:!0,example:"Credit Card"},{header:"Bank Account",key:"bankAccount",width:26,section:"payment",required:!1,example:"HDFC â¢â¢ 4521 (Current)"},{header:"Connected Corporate Card",key:"connectedCard",width:28,section:"payment",required:!1,example:"Executive Regalia Corporate (â¢â¢4521)"},{header:"Payment Date (YYYY-MM-DD)",key:"paymentDate",width:24,section:"payment",required:!1,example:"2026-03-15"},{header:"Amount Paid",key:"amountPaid",width:18,section:"payment",required:!1,example:59e3},{header:"Balance Due",key:"balanceDue",width:18,section:"payment",required:!1,example:0},{header:"Balance Due Date",key:"balanceDueDate",width:20,section:"payment",required:!1,example:""},{header:"Advance Reference",key:"advanceReference",width:22,section:"payment",required:!1,example:""},{header:"Clearing Liability? (YES/NO)",key:"clearsLiability",width:24,section:"liability",required:!1,example:"NO"},{header:"Linked Liability",key:"linkedLiability",width:24,section:"liability",required:!1,example:""},{header:"EMI No",key:"emiNo",width:16,section:"liability",required:!1,example:""},{header:"Description & Notes",key:"description",width:34,section:"liability",required:!1,example:"Monthly server hosting & compute instances"},{header:"Tags",key:"tags",width:24,section:"liability",required:!1,example:"Cloud, Infrastru
1cture, AWS"}],v={classification:{fg:"FFFFFFFF",bg:"FF1E293B"},vendor:{fg:"FFFFFFFF",bg:"FF4C1D95"},allocation:{fg:"FFFFFFFF",bg:"FF0F766E"},amount:{fg:"FFFFFFFF",bg:"FF065F46"},payment:{fg:"FFFFFFFF",bg:"FF1E40AF"},liability:{fg:"FFFFFFFF",bg:"FF9A3412"}};async function A(){const e=new f.Workbook;e.creator="VizOps360 Finance",e.created=new Date;const s=e.addWorksheet("Expense Master Import",{views:[{state:"frozen",ySplit:1}]});s.columns=u.map(a=>({header:a.header,key:a.key,width:a.width}));const r=s.getRow(1);r.height=32,r.alignment={vertical:"middle",horizontal:"center",wrapText:!0},u.forEach((a,y)=>{const d=r.getCell(y+1),h=v[a.section]||{fg:"FFFFFFFF",bg:"FF1E293B"};d.font={bold:!0,color:{argb:h.fg},size:10,name:"Calibri"},d.fill={type:"pattern",pattern:"solid",fgColor:{argb:h.bg}},d.border={top:{style:"thin",color:{argb:"FF334155"}},bottom:{style:"medium",color:{argb:"FF0F172A"}},left:{style:"thin",color:{argb:"FF475569"}},right:{style:"thin",color:{argb:"FF475569"}}}}),[{date:"2026-03-15",voucherNo:"EXP-2026-0001",expenseType:"Variable",category:"Software & Subscriptions",subCategory:"SaaS Software",recurring:"YES",recurringFrequency:"Monthly",recurringEndDate:"2026-12-31",vendorName:"Amazon Web Services (AWS)",vendorType:"Supplier",vendorGstPan:"07AAAAA0000A1Z5",vendorContact:"[email protected]",company:"Tekki Web Solutions Pvt. Ltd.",department:"IT & Production",team:"DevOps Team",employeeName:"Sarbjit Singh Grewal",employeeEmpCode:"TWS4161",approverName:"Pawandeep Kaur Grewal",approverEmpCode:"TWS4160",project:"Internal Cloud Infrastructure",costCenter:"CC-TECH-01",gross:45e3,currency:"INR",taxApplicable:"YES",taxRate:18,tax:8100,net:53100,paymentStatus:"Paid",paymentMode:"Credit Card",bankAccount:"HDFC â¢â¢ 4521 (Current)",connectedCard:"Executive Regalia Corporate (â¢â¢4521)",paymentDate:"2026-03-15",amountPaid:53100,balanceDue:0,balanceDueDate:"",advanceReference:"",clearsLiability:"NO",linkedLiability:"",emiNo:"",description:"Monthly production cluster & database instance hosting",tags:"AWS, Cloud, Servers, IT"},{date:"2026-03-10",voucherNo:"EXP-2026-0002",expenseType:"Fixed",category:"Rent & Utilities",subCategory:"Office Rent",recurring:"YES",recurringFrequency:"Monthly",recurringEndDate:"2027-03-31",vendorName:"City Centre Towers Management",vendorType:"Supplier",vendorGstPan:"03ABCDE1234F1Z8",vendorContact:"[email protected]",company:"Tekki Web Solutions Pvt. Ltd.",department:"Human Resources & Operations",team:"Facility & Admin",employeeName:"Gurcharan Singh Kang",employeeEmpCode:"TWS4162",approverName:"Pawandeep Kaur Grewal",approverEmpCode:"TWS4160",project:"Headquarters Operations",costCenter:"CC-ADMIN-01",gross:125e3,currency:"INR",taxApplicable:"YES",taxRate:18,tax:22500,net:147500,paymentStatus:"Paid",paymentMode:"Bank Transfer",bankAccount:"Kotak Mahindra â¢â¢ 7531 (Current)",connectedCard:"",paymentDate:"2026-03-10",amountPaid:147500,balanceDue:0,balanceDueDate:"",advanceReference:"",clearsLiability:"NO",linkedLiability:"",emiNo:"",description:"Commercial office lease rental for Floor 4 & 5",tags:"Rent, Facilities, Headquarters"},{date:"2026-03-05",voucherNo:"EXP-2026-0003",expenseType:"Variable",category:"Travel & Conveyance",subCategory:"Air Travel",recurring:"NO",recurringFrequency:"",recurringEndDate:"",vendorName:"MakeMyTrip Corporate",vendorType:"Supplier",vendorGstPan:"06AAACM1234K1ZU",vendorContact:"[email protected]",company:"Tekki Web Solutions Pvt. Ltd.",department:"Business Development",team:"Global Sales",employeeName:"Amritpal Singh",employeeEmpCode:"TWS4365",approverName:"Gurcharan Singh Kang",approverEmpCode:"TWS4162",project:"Client Acquisition US/EU",costCenter:"CC-SALES-02",gross:38200,currency:"INR",taxApplicable:"YES",taxRate:5,tax:1910,net:40110,paymentStatus:"Pending",paymentMode:"Credit Card",bankAccount:"HDFC â¢â¢ 4521 (Current)",connectedCard:"Treasury Platinum Debit (â¢â¢8830)",paymentDate:"",amountPaid:0,balanceDue:40110,balanceDueDate:"2026-03-25",advanceReference:"",clearsLiability:"NO",linkedLiability:"",emiNo:"",description:"Flight tickets for Dubai client demonstration and stakeholder meetings",tags:"Travel, Client, Dubai, Sales"},{date:"2026-03-01",voucherNo:"EXP-2026-0004",expenseType:"CapEx",category:"Hardware & Equipment",subCategory:"Laptops & Desktops",recurring:"NO",recurringFrequency:"",recurringEnd
1Date:"",vendorName:"Apple India Pvt. Ltd. Authorized Reseller",vendorType:"Supplier",vendorGstPan:"07AAACA1234J1ZQ",vendorContact:"[email protected]",company:"Tekki Web Solutions Pvt. Ltd.",department:"IT & Production",team:"Mobile Engineering",employeeName:"Gurwinder Singh",employeeEmpCode:"TWS4168",approverName:"Pawandeep Kaur Grewal",approverEmpCode:"TWS4160",project:"Mobile App Division",costCenter:"CC-CAPEX-01",gross:189900,currency:"INR",taxApplicable:"YES",taxRate:18,tax:34182,net:224082,paymentStatus:"Paid",paymentMode:"Bank Transfer",bankAccount:"HDFC â¢â¢ 4521 (Current)",connectedCard:"",paymentDate:"2026-03-01",amountPaid:224082,balanceDue:0,balanceDueDate:"",advanceReference:"",clearsLiability:"NO",linkedLiability:"",emiNo:"",description:"MacBook Pro M3 Max 16-inch 36GB for lead mobile developer",tags:"Hardware, Laptop, Apple, Asset"},{date:"2026-03-05",voucherNo:"EXP-2026-0005",expenseType:"Liabilities",category:"Loan & Debt Servicing",subCategory:"Commercial Vehicle EMI",recurring:"YES",recurringFrequency:"Monthly",recurringEndDate:"2027-11-30",vendorName:"HDFC Bank Corporate Lending",vendorType:"Bank/Lender",vendorGstPan:"03AAACH1234P1Z2",vendorContact:"[email protected]",company:"Tekki Web Solutions Pvt. Ltd.",department:"Finance & Accounts",team:"Treasury & Tax",employeeName:"Pawandeep Kaur Grewal",employeeEmpCode:"TWS4160",approverName:"Sarbjit Singh Grewal",approverEmpCode:"TWS4161",project:"Company Vehicles",costCenter:"CC-FIN-01",gross:42500,currency:"INR",taxApplicable:"NO",taxRate:0,tax:0,net:42500,paymentStatus:"Paid",paymentMode:"Bank Transfer",bankAccount:"Kotak Mahindra â¢â¢ 7531 (Current)",connectedCard:"",paymentDate:"2026-03-05",amountPaid:42500,balanceDue:0,balanceDueDate:"",advanceReference:"",clearsLiability:"YES",linkedLiability:"HDFC Commercial Vehicle Loan #9921",emiNo:"14 of 36",description:"Monthly EMI installment payment for corporate operations vehicle",tags:"Liability, Loan, EMI, HDFC"}].forEach((a,y)=>{const d=s.addRow(a);d.height=22,d.alignment={vertical:"middle",horizontal:"left"},d.font={size:9.5,name:"Calibri"},y%2===1&&(d.fill={type:"pattern",pattern:"solid",fgColor:{argb:"FFF8FAFC"}})});const i=e.addWorksheet("Reference & Allowed Values"),p=["Expense Types","Categories","Sub-Categories (Sample)","Vendor Types","Payment Modes","Payment Statuses","Currencies","Bank Accounts","Companies"];i.addRow(p);const n=i.getRow(1);n.height=28,n.font={bold:!0,color:{argb:"FFFFFFFF"},size:10},n.fill={type:"pattern",pattern:"solid",fgColor:{argb:"FF0F172A"}};const c=["Fixed","Variable","Direct","Indirect","Operational","Capital Expenditure (CapEx)","Liabilities"],t=Object.values(N).flat(),o=["Tekki Web Solutions Pvt. Ltd.","TWS USA LLC","TWS Technologies","SuperWorks"],m=Math.max(c.length,g.length,t.length,C.length,b.length,F.length,E.length,S.length,o.length);for(let a=0;a<m;a++)i.addRow([c[a]||"",g[a]||"",t[a]||"",C[a]||"",b[a]||"",F[a]||"",E[a]||"",S[a]||"",o[a]||""]);i.columns=[{width:22},{width:26},{width:26},{width:18},{width:20},{width:18},{width:14},{width:30},{width:32}],await x(e,"Finance_Expense_Master_Template.xlsx")}function P(){return`I have raw company expense receipt or ledger records that I need structured into a clean Excel/CSV file matching the official VizOps360 Finance Master Expense Import template. 2 3Here are the exact 41 columns required in Row 1: 4"Expense Date (YYYY-MM-DD)","Voucher / Ref No","Expense Type","Expense Category","Sub-Category","Recurring? (YES/NO)","Recurring Frequency","Recurring End Date","Vendor / Payee Name","Vendor Type","Vendor GST/PAN","Vendor Contact","Company","Department","Team","Employee Name","Employee ID","Approver Name","Approver ID","Project Name","Cost Center","Gross Amount (Base)","Currency","Tax Applicable? (YES/NO)","Tax Rate (%)","Tax Amount","Net Amount","Payment Status","Payment Mode","Bank Account","Connected Corporate Card","Payment Date (YYYY-MM-DD)","Amount Paid","Balance Due","Balance Due Date","Advance Reference","Clearing Liability? (YES/NO)","Linked Liability","EMI No","Description & Notes","Tags" 5 6Formatting & Validation Rules: 71. Dates: Format as YYYY-MM-DD (e.g., 2026-03-15). 82. Expense Type: Fixed, Variable, Direct, Indirect, Operational, Capital Expenditure (CapEx), or Liabilities. 93. Category: Salaries & Wages, Rent & Utilities, Travel & Conveyance, Marketing & Advertising, IT & Softw
9are, Office Supplies, Professional Services, Maintenance & Repairs, Taxes & Compliance, Bank Charges, Miscellaneous. 104. Yes/No fields: YES or NO. 115. Currency: INR, USD, EUR, GBP, AED, SGD. 126. Payment Status: Paid, Pending, Partial, or Advance. 137. Payment Mode: Bank Transfer, Credit Card, Corporate Card, UPI, Cheque, Cash, NEFT/RTGS, Auto-debit, Other. 148. Employee Name & ID: If Employee Name is provided, Employee ID (e.g. TWS4161) must also be supplied. 159. Gross Amount & Net Amount: Numbers only (no currency symbols or commas). 1610. If an optional field is not applicable, leave it blank or put "". 17 18Please convert my raw expense records into a CSV or tab-separated table with these exact 41 columns.`}function w(e){const s=Number(e.gross||0),r=Number(e.tax||0),l=Number(e.net||s+r),i=(e.status||"").toLowerCase()==="paid"||(e.paymentStatus||"").toLowerCase()==="paid",p=e.amountPaid!==void 0?Number(e.amountPaid):i?l:0,n=e.balanceDue!==void 0?Number(e.balanceDue):i?0:l,c=e.taxRate||(s>0&&r>0?Math.round(r/s*100):r>0?18:0);let t=String(e.description||"").trim(),o=e.subCategory||"",m=e.tags||"";if(!o&&t.includes("[Sub-Cat:")){const a=t.match(/\[Sub-Cat:\s*([^\]]+)\]/);a&&(o=a[1].trim(),t=t.replace(/\[Sub-Cat:\s*[^\]]+\]/,"").trim())}if(!m&&t.includes("[Tags:")){const a=t.match(/\[Tags:\s*([^\]]+)\]/);a&&(m=a[1].trim(),t=t.replace(/\[Tags:\s*[^\]]+\]/,"").trim())}return{date:e.date||e.entryDate||"",voucherNo:e.voucherNo||"",expenseType:e.expenseType||"Variable",category:e.category||"General Expense",subCategory:o,recurring:e.recurring&&String(e.recurring).toUpperCase()==="YES"?"YES":"NO",recurringFrequency:e.recurringFrequency||"",recurringEndDate:e.recurringEndDate||"",vendorName:e.vendor||e.vendorName||"",vendorType:e.vendorType||"Supplier",vendorGstPan:e.vendorGstPan||"",vendorContact:e.vendorContact||"",company:e.company||e.companyName||"Tekki Web Solutions Pvt. Ltd.",department:e.department||e.departmentName||"",team:e.team||e.teamName||"",employeeName:e.employee||e.employeeName||"",employeeEmpCode:e.employeeEmpCode||e.employeeId||"",approverName:e.approver||e.approverName||"",approverEmpCode:e.approverEmpCode||e.approverId||"",project:e.project||e.projectName||"",costCenter:e.costCenter||"",gross:s,currency:e.currency||"INR",taxApplicable:r>0||e.taxApplicable?"YES":"NO",taxRate:c,tax:r,net:l,paymentStatus:e.paymentStatus||e.status||"Pending",paymentMode:e.paymentMethod||e.paymentMode||"Bank Transfer",bankAccount:e.bankAccount||"",connectedCard:e.connectedCard||"",paymentDate:e.paymentDate||i&&(e.date||e.entryDate)||"",amountPaid:p,balanceDue:n,balanceDueDate:e.balanceDueDate||"",advanceReference:e.advanceReference||"",clearsLiability:e.clearsLiability&&String(e.clearsLiability).toUpperCase()==="YES"?"YES":"NO",linkedLiability:e.linkedLiability||"",emiNo:e.emiNo||"",description:t,tags:m}}async function R(e,s){const r=new f.Workbook;r.creator="VizOps360 Finance",r.created=new Date;const l=r.addWorksheet("Expenses Master Export",{views:[{state:"frozen",ySplit:1}]});l.columns=u.map(n=>({header:n.header,key:n.key,width:n.width}));const i=l.getRow(1);i.height=32,i.alignment={vertical:"middle",horizontal:"center",wrapText:!0},u.forEach((n,c)=>{const t=i.getCell(c+1),o=v[n.section]||{fg:"FFFFFFFF",bg:"FF1E293B"};t.font={bold:!0,color:{argb:o.fg},size:10,name:"Calibri"},t.fill={type:"pattern",pattern:"solid",fgColor:{argb:o.bg}},t.border={top:{style:"thin",color:{argb:"FF334155"}},bottom:{style:"medium",color:{argb:"FF0F172A"}},left:{style:"thin",color:{argb:"FF475569"}},right:{style:"thin",color:{argb:"FF475569"}}}}),e.forEach((n,c)=>{const t=w(n),o=l.addRow(t);o.height=22,o.alignment={vertical:"middle",horizontal:"left"},o.font={size:9.5,name:"Calibri"},c%2===1&&(o.fill={type:"pattern",pattern:"solid",fgColor:{argb:"FFF8FAFC"}})});const p=s||`Expenses_Master_Export_${new Date().toISOString().split("T")[0]}.xlsx`;await x(r,p)}function M(e,s){const r=u.map(t=>`"${t.header.replace(/"/g,'""')}"`).join(","),l=e.map(t=>{const o=w(t);return u.map(m=>{const a=o[m.key];return a==null?'""':`"${String(a).replace(/"/g,'""')}"`}).join(",")}),i=[r,...l].join(` 19`),p=new Blob([i],{type:"text/csv;charset=utf-8;"}),n=URL.createObjectURL(p),c=document.createElement("a");c.href=n,c.download=s||`Expenses_Master_Export_${new Date().toISOString().split("T")[0]}.csv`,document.body.appendChild(c),c.click(),document.body.removeChild(c),URL.revokeObjectURL(n)}export{u as EXPENSE_EXCEL_COLUMNS,A as downloadExpenseExcelTemplate,M as exportExpensesToCsv,R as exportExpensesToExcel,w as formatExpenseRowFor41Columns,P as getExpenseAiPrompt};
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.