当前位置: 首页 > Skill >

Expense Categorization

Expense Categorization

Expense Categorization

从收据或账单中提取、分类费用,映射到GL科目代码,核对政策合规,标识异常待审查。

1.0.1 2026.11.26 828
获取Skill文件查看使用说明
作 者:顾禾 许可证: 更新时间:2026.11.26
本文目录展开

Expense Categorization

Receipt OCR, GL mapping, policy compliance, and anomaly detection for business expenses.

Workflow

1. Receipt Extraction (OCR)

Use tesseract (local) or Vision API for image receipts; pdfplumber for PDF receipts.

Key fields to extract:

  • Vendor name, date, total amount, line items
  • Payment method (last 4 digits if visible)
  • Tax amount (HST/GST/sales tax)
  • Tips/gratuity (separate from subtotal)
# Tesseract OCR on receipt image
tesseract receipt.jpg stdout --psm 4 | python3 scripts/parse_receipt.py

# Or use Claude vision directly for complex layouts

For complex or handwritten receipts → use vision model with prompt in references/ocr-prompt.md.

2. GL Code Mapping

Map extracted expense category to chart of accounts. See references/gl-mapping.md for:

  • Standard QBO GL codes for common expense types
  • IRS-aligned categories (meals 50%, travel, home office, etc.)
  • Crypto/DeFi expense categories

Matching logic:

  1. Exact vendor name match (known vendor list)
  2. MCC code match (credit card transactions)
  3. Keyword match on description/line items
  4. Fallback: prompt user to select category

3. Policy Compliance Check

Apply policy rules before approval routing. See references/policy-rules.md for standard rules.

Core checks:

  • Per diem limits: Meals >$75 require itemized receipt; travel per diem by city
  • Receipt threshold: Receipt required for any expense ≥$25 (IRS standard)
  • Time limit: Receipts must be submitted within 30/60/90 days (configurable)
  • Duplicate detection: Same vendor + amount ± $1 within 7 days = flag
  • Split transactions: Same vendor, sequential dates, amounts just below approval threshold = flag

4. Anomaly Detection

Flag for human review:

  • Amount > 2× historical average for that vendor/category
  • Weekend or holiday transactions (especially travel/entertainment)
  • Round-number amounts (potential personal purchase)
  • Vendor in restricted list (casinos, adult entertainment, competitors)
  • Missing required fields (date, vendor, business purpose)
  • Out-of-state purchases for office supply categories

5. Output Format

{
  "receipt_id": "REC-20260315-001",
  "vendor": "Delta Air Lines",
  "date": "2026-03-15",
  "amount": 487.50,
  "currency": "USD",
  "gl_code": "6200",
  "category": "Travel - Air",
  "policy_status": "approved",
  "flags": [],
  "confidence": 0.94,
  "requires_review": false,
  "notes": "Business purpose required for reimbursement"
}

Batch Processing

For expense report batches:

# Process folder of receipts
import glob
receipts = glob.glob("receipts/*.{jpg,png,pdf}")
results = [categorize(r) for r in receipts]

# Summary stats
flagged = [r for r in results if r["requires_review"]]
total = sum(r["amount"] for r in results)
by_category = group_by(results, "category")

Output batch summary as CSV or feed directly to QBO via qbo-automation skill.

Common Patterns

Credit card statement import:

  1. Parse CSV/OFX from bank
  2. Match known vendors → auto-categorize
  3. Unknown vendors → ML classification or prompt
  4. Export mapped transactions to QBO

Expense report approval routing:

  • Auto-approve: policy-compliant, under $250, no flags
  • Manager approval: $250–$2,500 or single flag
  • Finance review: >$2,500, multiple flags, or restricted category

Mileage reimbursement:

  • Extract start/end locations + business purpose
  • Calculate at current IRS rate (check references/irs-rates.md)
  • Map to GL 6210 (Auto/Mileage)

Integration Points

  • qbo-automation: Push categorized transactions directly to QBO
  • crypto-tax-agent: Route DeFi/crypto expenses for cost basis tracking
  • kpi-alert-system: Trigger alerts when department spend exceeds budget
  • invoice-automation: Cross-reference receipts with vendor invoices

Negative Boundaries

  • Not for PTIN-backed tax work — categorization ≠ tax advice; defer to licensed preparer
  • Not for payroll — employee expense reimbursement != payroll processing
  • Not a real-time feed — batch review with human sign-off before posting to GL
  • Not for legal contracts — use contract-review-agent for vendor agreements
  • Confidence <0.7 → always route to human review, never auto-post

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,017
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,005
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,003
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,003
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,002
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,001
Skill 文件
  • SKILL.md
    • Expense Categorization
    • Workflow
      • 1. Receipt Extraction (OCR)
      • 2. GL Code Mapping
      • 3. Policy Compliance Check
      • 4. Anomaly Detection
      • 5. Output Format
    • Batch Processing
    • Common Patterns
    • Integration Points
    • Negative Boundaries
  • 项目或源文件

相关 Skill

更多
expense-categorization-optimizer expense-categorization-optimizer Optimizes expense categorization rules and suggests improvements for better financial tracking. This is a descriptive skill that provides templates, frameworks, and heuristic analysis without executing real code, accessing external APIs, or performing actual financial transactions.
Expense Categorization Optimizer Expense Categorization Optimizer 提供结构化指导、模板和建议,以优化费用分类,提升财务追踪与规划。
service-qa-coach service-qa-coach Review support quality for chat, email, phone, social DM, or marketplace service teams. Use when a team needs a QA scorecard, failure-mode analysis, coaching plan, calibration checklist, or service-improvement brief without live ticketing, CRM, or contact-center system access.
高中数学作业批改助手 高中数学作业批改助手 >图片识别 直接读取学生手写作答照片,识别公式、符号、步骤 🧮 自动推导 根据题目自动生成参考答案和评分细则,无需教师预设 📊 逐步给分 每个关键步骤独立评分,体现过程分 📝 结构化报告 输出含识别内容、参考答案、逐步评分、改进建议的完整报告 🗂 批量批改 支持一次性批改多道题,最终汇总得分表
Vibration Analysis Vibration Analysis 分析来自CMS趋势、RMS/峰值、频谱及SCADA报警的风机传动链(主轴、齿轮箱、发电机)振动数据。