invoice-processing
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseInvoice Processing
发票处理
Extract structured data from invoices, validate fields against purchase orders and vendor records, categorize line items by general ledger (GL) codes, and flag discrepancies for review. This skill handles both single invoice processing and batch operations, producing clean, auditable output ready for import into accounting systems.
从发票中提取结构化数据,针对采购订单和供应商记录验证字段信息,按总账(GL)代码分类行项目,并标记差异以供审核。该技能支持单张发票处理和批量操作,生成可直接导入会计系统的清晰、可审计输出结果。
Workflow
工作流程
-
Receive and Parse Invoice Accept invoice data in any format — raw text, OCR output, structured JSON, or CSV. Identify the document type (standard invoice, credit memo, debit note, proforma) and extract the header block: invoice number, date, due date, vendor name, vendor address, and payment terms.
-
Extract Line Items and Totals Parse each line item for description, quantity, unit price, extended amount, and tax. Validate that line item totals sum to the stated subtotal. Extract tax amounts, shipping charges, discounts, and the grand total. Flag any arithmetic inconsistencies between line items and totals.
-
Validate Against Purchase Order Match the invoice to its corresponding PO by PO number, vendor, or line item descriptions. Compare quantities and unit prices. Compute a three-way match score across PO, goods receipt, and invoice. Flag invoices where price variance exceeds a configurable threshold (default: 2%) or quantities don't match.
-
Categorize by GL Code Assign each line item to the appropriate general ledger account based on item description, vendor category, and historical patterns. Common mappings include office supplies → 6200, software subscriptions → 6500, professional services → 6300, raw materials → 5100. Apply department cost center codes where applicable.
-
Flag Discrepancies and Generate Output Produce a structured record for each invoice with all extracted fields, validation status, GL assignments, and any flags. Group flags by severity: blocking errors (missing PO, total mismatch > 5%), warnings (minor price variance, missing fields), and informational (new vendor, first invoice from vendor).
-
Generate Processing Summary For batch operations, produce a summary report showing total invoices processed, pass/fail counts, total dollar value, and a breakdown of flag types. List all blocked invoices requiring manual review with specific reasons.
-
接收并解析发票 支持接收任意格式的发票数据——原始文本、OCR输出、结构化JSON或CSV。识别文档类型(标准发票、贷项通知单、借项通知单、形式发票)并提取表头信息:发票编号、日期、到期日、供应商名称、供应商地址以及付款条款。
-
提取行项目与总计信息 解析每个行项目的描述、数量、单价、扩展金额和税费。验证行项目总计是否与列明的小计一致。提取税额、运费、折扣和总金额。标记行项目与总计之间的任何算术不一致。
-
针对采购订单验证 通过采购订单编号、供应商或行项目描述将发票与对应采购订单(PO)匹配。对比数量和单价。计算PO、收货单与发票之间的三方匹配得分。当价格差异超过可配置阈值(默认:2%)或数量不匹配时,标记发票。
-
按GL代码分类 根据项目描述、供应商类别和历史模式,为每个行项目分配合适的总账科目。常见映射包括:办公用品→6200、软件订阅→6500、专业服务→6300、原材料→5100。适用时应用部门成本中心代码。
-
标记差异并生成输出 为每张发票生成包含所有提取字段、验证状态、GL分配和任何标记的结构化记录。按严重程度分组标记:阻塞错误(缺少PO、总金额差异>5%)、警告(轻微价格差异、缺失字段)和信息提示(新供应商、供应商首张发票)。
-
生成处理汇总 对于批量操作,生成汇总报告,显示处理的发票总数、通过/失败数量、总金额以及标记类型细分。列出所有需要人工审核的阻塞发票及具体原因。
Usage
使用方法
Provide invoice data as text, structured data, or describe the invoices you need processed. Specify any PO data for validation and your GL code mapping preferences.
Example prompt:
Process this vendor invoice: Invoice #INV-2024-0847 from Acme Cloud Services, dated 2024-11-15, PO #PO-4521. Line items: 10x API Gateway licenses at $150/ea, 1x Premium Support at $2,400/yr. Tax 8.5%. Validate against PO and assign GL codes.
提供文本形式、结构化数据形式的发票数据,或描述需要处理的发票。指定用于验证的PO数据以及您的GL代码映射偏好。
示例提示:
处理此供应商发票:发票编号INV-2024-0847,来自Acme Cloud Services,日期2024-11-15,PO编号PO-4521。行项目:10份API Gateway许可证,单价$150;1份Premium Support,年费$2,400。税率8.5%。针对PO验证并分配GL代码。
Examples
示例
Example 1: Single Invoice Processing
示例1:单张发票处理
Input:
Invoice #INV-2024-0847
Vendor: Acme Cloud Services (Vendor ID: V-1042)
Date: 2024-11-15 | Due: 2024-12-15 | Terms: Net 30
PO Reference: PO-4521
Line Items:
1. API Gateway License (qty: 10, unit: $150.00) — $1,500.00
2. Premium Support Annual (qty: 1, unit: $2,400.00) — $2,400.00
Subtotal: $3,900.00
Tax (8.5%): $331.50
Total: $4,231.50Output:
json
{
"invoice_number": "INV-2024-0847",
"vendor": { "name": "Acme Cloud Services", "id": "V-1042" },
"date": "2024-11-15",
"due_date": "2024-12-15",
"po_reference": "PO-4521",
"line_items": [
{
"description": "API Gateway License",
"quantity": 10,
"unit_price": 150.00,
"amount": 1500.00,
"gl_code": "6500",
"gl_name": "Software Subscriptions",
"cost_center": "IT-200"
},
{
"description": "Premium Support Annual",
"quantity": 1,
"unit_price": 2400.00,
"amount": 2400.00,
"gl_code": "6510",
"gl_name": "Software Maintenance & Support",
"cost_center": "IT-200"
}
],
"subtotal": 3900.00,
"tax": 331.50,
"total": 4231.50,
"validation": {
"arithmetic_check": "PASS",
"po_match": "PASS",
"price_variance": "0.0%",
"three_way_match": "PASS"
},
"flags": []
}输入:
Invoice #INV-2024-0847
Vendor: Acme Cloud Services (Vendor ID: V-1042)
Date: 2024-11-15 | Due: 2024-12-15 | Terms: Net 30
PO Reference: PO-4521
Line Items:
1. API Gateway License (qty: 10, unit: $150.00) — $1,500.00
2. Premium Support Annual (qty: 1, unit: $2,400.00) — $2,400.00
Subtotal: $3,900.00
Tax (8.5%): $331.50
Total: $4,231.50输出:
json
{
"invoice_number": "INV-2024-0847",
"vendor": { "name": "Acme Cloud Services", "id": "V-1042" },
"date": "2024-11-15",
"due_date": "2024-12-15",
"po_reference": "PO-4521",
"line_items": [
{
"description": "API Gateway License",
"quantity": 10,
"unit_price": 150.00,
"amount": 1500.00,
"gl_code": "6500",
"gl_name": "Software Subscriptions",
"cost_center": "IT-200"
},
{
"description": "Premium Support Annual",
"quantity": 1,
"unit_price": 2400.00,
"amount": 2400.00,
"gl_code": "6510",
"gl_name": "Software Maintenance & Support",
"cost_center": "IT-200"
}
],
"subtotal": 3900.00,
"tax": 331.50,
"total": 4231.50,
"validation": {
"arithmetic_check": "PASS",
"po_match": "PASS",
"price_variance": "0.0%",
"three_way_match": "PASS"
},
"flags": []
}Example 2: Batch Processing with Validation Errors
示例2:含验证错误的批量处理
Input: 4 invoices from different vendors processed in batch.
Output — Error Report:
| Invoice # | Vendor | Amount | Status | Flags |
|---|---|---|---|---|
| INV-2024-0847 | Acme Cloud Services | $4,231.50 | PASS | — |
| INV-2024-1193 | Delta Office Supply | $892.40 | WARNING | Unit price $14.20 vs PO price $12.99 (+9.3%) |
| INV-2024-1205 | Spark Consulting | $18,750.00 | BLOCKED | No matching PO found |
| INV-2024-1210 | GreenLeaf Catering | $1,345.00 | BLOCKED | Line item total $1,280 ≠ stated subtotal $1,345 |
Batch Summary:
- Total Processed: 4
- Passed: 1 (25%) — $4,231.50
- Warnings: 1 (25%) — $892.40
- Blocked: 2 (50%) — $20,095.00
- Total Value: $25,168.90
- Action Required: 2 invoices require manual review before payment authorization.
输入: 批量处理来自不同供应商的4张发票。
输出——错误报告:
| 发票编号 | 供应商 | 金额 | 状态 | 标记内容 |
|---|---|---|---|---|
| INV-2024-0847 | Acme Cloud Services | $4,231.50 | 通过 | — |
| INV-2024-1193 | Delta Office Supply | $892.40 | 警告 | 单价$14.20与PO单价$12.99不符(+9.3%) |
| INV-2024-1205 | Spark Consulting | $18,750.00 | 阻塞 | 未找到匹配的PO |
| INV-2024-1210 | GreenLeaf Catering | $1,345.00 | 阻塞 | 行项目总计$1,280 ≠ 列明小计$1,345 |
批量汇总:
- 处理总数: 4
- 通过: 1(25%)—— $4,231.50
- 警告: 1(25%)—— $892.40
- 阻塞: 2(50%)—— $20,095.00
- 总金额: $25,168.90
- 需执行操作: 2张发票需人工审核后方可授权付款。
Best Practices
最佳实践
- Always verify arithmetic independently — never trust the stated totals without recalculating from line items.
- Maintain a vendor-to-GL mapping table and update it as new vendors or expense types appear.
- Set price variance thresholds appropriate to your industry: 2% for commodities, up to 10% for services with variable scope.
- Require PO matching for all invoices above a configurable dollar threshold to prevent unauthorized spending.
- Retain the raw invoice data alongside extracted fields for audit trail purposes.
- Process invoices in batch during off-peak hours and route exceptions to AP staff immediately.
- 始终独立验证算术运算——绝不直接信任列明的总计,务必通过行项目重新计算。
- 维护供应商到GL的映射表,并在出现新供应商或费用类型时更新。
- 设置符合行业特性的价格差异阈值:大宗商品为2%,范围可变的服务最高可达10%。
- 要求超过可配置金额阈值的所有发票必须匹配PO,以防止未经授权的支出。
- 保留原始发票数据和提取字段,用于审计追踪。
- 在非高峰时段批量处理发票,并立即将异常情况发送给应付账款(AP)人员。
Edge Cases
边缘情况
- Invoices with no PO reference: Flag as requiring manual approval. Check if the vendor has a blanket PO or standing agreement that covers the charges.
- Credit memos and negative amounts: Process as negative invoice entries. Validate that the credit references an existing invoice and that the credit amount doesn't exceed the original.
- Multi-currency invoices: Extract the stated currency, apply the exchange rate as of invoice date, and record both the original and converted amounts.
- Duplicate invoice detection: Check invoice number + vendor + amount + date against the last 90 days of records. Flag exact matches as likely duplicates and near-matches (same vendor + amount, different invoice number) as potential duplicates.
- Partial shipments: When goods receipt quantity is less than PO quantity, validate the invoice against received quantity, not PO quantity. Hold remaining balance as open.
- 无PO参考的发票: 标记为需人工审批。检查供应商是否有涵盖该费用的 blanket PO( blanket订单)或长期协议。
- 贷项通知单和负金额: 作为负发票分录处理。验证贷项是否关联现有发票,且贷项金额不超过原始金额。
- 多币种发票: 提取列明的货币,应用发票日期的汇率,同时记录原始金额和转换后金额。
- 重复发票检测: 对比近90天记录中的发票编号+供应商+金额+日期。标记完全匹配的发票为疑似重复,标记(同一供应商+金额,不同发票编号)的近似匹配为潜在重复。
- 部分发货: 当收货数量少于PO数量时,针对收货数量而非PO数量验证发票。剩余余额列为未结。