# Invoice Analyzer

> Analyze invoices in财务管理 directory and extract key information. Update financial list with invoice status. Use when user mentions invoice recognition, 开票状态, or checking which items have been invoiced.

- **Type:** Skill
- **Install:** `agentstack add skill-phanghonghao-thu-awesome-skills-invoice-analyzer`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [phanghonghao](https://agentstack.voostack.com/s/phanghonghao)
- **Installs:** 0
- **Category:** [Finance & Payments](https://agentstack.voostack.com/c/finance-and-payments)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [phanghonghao](https://github.com/phanghonghao)
- **Source:** https://github.com/phanghonghao/THU-Awesome-Skills/tree/main/skills/invoice-analyzer

## Install

```sh
agentstack add skill-phanghonghao-thu-awesome-skills-invoice-analyzer
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Invoice Analyzer Skill

发票识别和财务清单更新工具。

## 工作流程

### Step 1: 读取财务清单

读取 `财务管理/财务清单.MD`，获取当前采购清单：

```bash
Read: 财务管理/财务清单.MD
```

提取所有待开票项目（开票状态 = "申请中" 或 "未开票"）。

---

### Step 2: 读取所有发票

读取 `财务管理/发票集中/` 目录下的所有发票文件：

```bash
Read: 财务管理/发票集中/*.pdf
Read: 财务管理/发票集中/*.jpg
Read: 财务管理/发票集中/*.png
```

---

### Step 3: 提取发票信息

从每张发票中提取以下信息：

| 字段 | 说明 |
|------|------|
| 商品名称 | 发票上的货物或服务名称 |
| 金额 | 不含税金额或含税金额 |
| 开票日期 | YYYY年MM月DD日 |
| 发票号码 | 完整发票号码 |
| 销售方 | 开票商家名称 |

---

### Step 4: 匹配并更新

将发票信息与财务清单进行匹配：

1. **金额匹配**：发票金额 ≈ 清单金额（允许±0.01误差）
2. **商品名匹配**：关键词相似度匹配
3. **更新状态**：将匹配项目的"开票状态"改为"✅已开票"

匹配示例：

| 清单项目 | 发票商品名 | 匹配结果 |
|----------|------------|----------|
| 7.4V锂电池组(2A) | 7.4V锂电池组(2A) | ✅ 完全匹配 |
| 310编码器电机 | 310编码器直流减速电机 | ✅ 关键词匹配 |
| 视频剪辑费 | 视频剪辑服务费 | ✅ 语义匹配 |

---

### Step 5: 生成报告

输出识别结果：

```
📋 发票识别结果

已识别 X 张发票：

| # | 商品名称 | 金额 | 开票日期 | 发票号码 | 状态 |
|:-:|---------|:----:|:--------:|:--------:|:----:|
| 1 | xxx | ¥xx.xx | YYYY/MM/DD | xxxxxxxx | ✅ 已开票 |
...

总计: ¥xxx.xx

已开票: X 项
待开票: X 项
```

---

### Step 6: 确认更新

询问用户是否更新财务清单：

```
是否更新财务清单.MD中的开票状态？(yes/no)
```

如果用户确认，则更新财务清单并提交。

---

## 重要说明

- **发票格式**：支持 PDF 电子发票（文本型）、图片发票（需 OCR）
- **匹配规则**：金额优先，商品名辅助验证
- **更新方式**：仅修改"开票状态"字段，不改变其他数据
- **错误处理**：无法识别的发票标记为 ⚠️ 待人工确认

---

## 文件路径约定

```
财务管理/
├── 财务清单.MD          # 主财务清单
└── 发票集中/
    ├── *.pdf            # 电子发票
    ├── *.jpg            # 发票图片
    └── *.png            # 发票图片
```

---

## 使用示例

**用户输入**:
```
/invoice-analyzer
```
或
```
检查哪些发票已经开了
```

**输出**:
发票识别报告 + 更新确认提示

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [phanghonghao](https://github.com/phanghonghao)
- **Source:** [phanghonghao/THU-Awesome-Skills](https://github.com/phanghonghao/THU-Awesome-Skills)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-phanghonghao-thu-awesome-skills-invoice-analyzer
- Seller: https://agentstack.voostack.com/s/phanghonghao
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
