Automates the full workflow of turning a pile of receipt images and PDFs into
clean, submission-ready expense claim packages — sorted by date and category,
with currency conversions and a summary table.
Run these five phases in order. Never skip a phase.
Phase 1 → Ingest & Parse all uploaded files
Phase 2 → Classify each bill (date, vendor, category, currency, amount)
Phase 3 → Generate per-day per-category PDFs
Phase 4 → Generate the expense spreadsheet (XLSX)
Phase 5 → Output summary tables for manual form entry
/mnt/user-data/uploads/.png, .jpg, .jpeg): read visually — extract date, vendor,amount, currency, bill number, and any GST/VAT breakdown
.pdf): use pypdf to extract text; if text is sparse, treatas scanned and read visually
Map every bill to this schema:
date : DD-Mon-YY (e.g. 13-Feb-26)
vendor : string
location : city / airport / country
category : one of the TCS categories below
currency : INR | USD | EUR | GBP | SGD | AED | ...
amount_orig : float (as printed on bill)
bill_no : string (from receipt; use "attached" if none)
notes : brief description of items
| TCS Category | What goes here |
|---|---|
| --- | --- |
| Travel Expenses – Conveyance | Uber, Ola, Lyft, taxis, local cabs, airport transfers |
| Ticket Expenses – Air Tickets | Airline tickets, excess baggage fees (keep SEPARATE per bill) |
| Ticket Expenses – Train Tickets | Rail bookings |
| Ticket Expenses – Bus Tickets | Bus / coach bookings |
| Hotel Accommodation | Hotel folios, checkout invoices (NOT room dining — that's Meal) |
| Travel Expenses – Meal | All food, beverages, airport snacks, restaurant bills, delivery (Zomato/Swiggy), cafe receipts |
| Client Entertainment – Travel | Meals/entertainment where clients were present |
| Car Expenses | Fuel, parking, tolls |
| Communication Expenses | SIM cards, roaming, internet dongles |
| Conference and Training Courses | Registration fees, course materials |
into ONE line item with the combined total
"verify if gift policy applies")
Read /mnt/skills/public/pdf/SKILL.md before running this phase.
Naming convention:
DD_Mon_YYYY_<TCS_Category_Underscored>.pdf
Examples:
13_Feb_2026_Travel_Expenses_Conveyance.pdf
13_Feb_2026_Travel_Expenses_Meal.pdf
13_Feb_2026_Ticket_Expenses_Air_Tickets.pdf
20_Feb_2026_Hotel_Accommodation.pdf
Script to use: scripts/build_pdfs.py
img2pdf + Pillowpypdf/mnt/user-data/outputs/bills_by_category/Run: python3 scripts/build_pdfs.py
Present all generated PDFs to the user using present_files.
Read /mnt/skills/public/xlsx/SKILL.md before running this phase.
Script to use: scripts/build_xlsx.py
The spreadsheet has two sheets:
Columns: `#, Date, Vendor, Location, Category, Currency, Amount (Original),
Amount (INR equiv.), Notes`
Color coding:
Rows = TCS categories; Columns = Category, # Items, Original Amounts, INR Equiv.
Plus a Grand Total row with all-in USD equivalent.
Currency conversion — use rates from references/fx_rates.md or fetch live
rates if web search is available. Always show the rate used and its date.
Output to /mnt/user-data/outputs/expense_claim.xlsx
Always output three tables in chat so the user can fill their expense portal
directly:
Bill Date | From Location | To Location | Bill No | Currency | Amount | Remarks
Bill Date | Name of Hotel/Restaurant | Bill No | Currency | Amount | Remarks
Bill Date | From Date | To Date | Bill No | Currency | Amount | Remarks
Bill Date | Bill No | Currency | Amount | Remarks
Date | Conveyance | Air Ticket | Hotel | Meal (local currency) | Day Total (USD)
— Include a GRAND TOTAL row at the bottom.
See references/fx_rates.md for standard rates.
currency (possible forex fee)
Before finishing, confirm all of these exist:
/mnt/user-data/outputs/bills_by_category/expense_claim.xlsx with both sheets| Problem | Action |
|---|---|
| --- | --- |
| Can't read a receipt | Note it, ask user to confirm amount manually |
| Date missing from bill | Infer from surrounding bills or ask user |
| Currency ambiguous | Default to country of purchase; flag for user |
| Bill number not on receipt | Use "attached" |
| Multiple receipts same vendor same day | Merge into one line, note qty |
references/fx_rates.md — Standard FX rates for common travel corridorsreferences/tcs_categories.md — Full TCS category eligibility rulesscripts/build_pdfs.py — PDF generation scriptscripts/build_xlsx.py — Excel generation script共 1 个版本