AI Agent Hub
Back to skills
Email Invoice Auto-Organization icon

Email Invoice Auto-Organization

Office Efficiency Updated 2026.08.30

Paste the following prompt into your AI chat to install this skill:

Please follow https://skillhub.cn/install/skillhub.md to install @user_b8af0005/invoice-from-email.

About this skill

Problem

Expense reporting often slows down on repetitive manual work: locating invoices in email, downloading attachments, reading amounts, matching itineraries, and assembling submission-ready PDFs. This skill targets that workflow. It searches a configured mailbox for invoice-related messages, downloads PDF attachments, and produces a merged A4 PDF together with a single-sheet Excel expense list. For typical electronic invoices, it reads the PDF text layer first and falls back to OCR for scanned documents. The design emphasis is script-driven extraction, parsing, merging, and table generation, reducing manual field copying.

How It Works and Limits

Before processing, it checks mailbox credentials, PyMuPDF, openpyxl, and optional OCR components. It deduplicates by email UID and avoids truncating search results with a small --limit. After downloading, it can unzip archives from 12306 or airline messages, then runs a three-tier extraction path: L1 via PyMuPDF text layer, L2 via Tesseract OCR, and L3 via PaddleOCR. Parsed data is written to JSON files, and generate_excel.py builds a single-sheet Excel list with trip details merged into remarks. PDF merging places invoices and itineraries vertically on A4; 12306 train tickets are scaled to real ticket size and laid out top-to-bottom with a left margin for archival punching.

The scope is bounded: attachments should be PDF, while OFD, XML, and images are not automatically processed. Amount mismatches are marked in Excel remarks, and interrupted runs can resume from saved UIDs and downloaded files.

Use Cases

  • Collect ride-hailing invoices and itineraries from a QQ mailbox, then auto-download PDFs, merge A4 pages, and build an expense Excel.
  • Scale 12306 train-ticket PDFs to real ticket size, arrange them top-to-bottom on A4, and reserve a left punch hole margin.
  • Pair airline itinerary PDFs with invoices by filename prefix, then merge them into a vertically stacked reimbursement PDF.
  • Deduplicate mailbox search results by UID, skip already processed messages, and keep downloaded attachments after an interrupted run.

Best For

  • Finance staff who need to turn mailbox invoices and itineraries into reimbursement-ready materials
  • Project managers who monthly consolidate travel costs into a single-sheet expense list
  • Administrative specialists handling 12306 train tickets and airline itineraries
  • Engineers or legal support staff who want fewer manual steps for PDF download, extraction, and merging