Skip to content

feat(ui-plugins): add Invoice Maker (invoice-maker) - #252

Open
ppppp2005-p wants to merge 11 commits into
zai-org:mainfrom
ppppp2005-p:feat/invoice-maker
Open

ppppp2005-p wants to merge 11 commits into
zai-org:mainfrom
ppppp2005-p:feat/invoice-maker

Conversation

@ppppp2005-p

Copy link
Copy Markdown

Plugin type (required) / 插件类型(必填)

  • UI Plugin / 是 UI 插件 — provides MCP Apps interactive pages / 提供 MCP Apps 交互页面
  • Standard plugin / 普通插件(非 UI)
  • Not applicable / 不适用

Affected plugin name(s) / 涉及的插件名称:invoice-maker (UI Plugin, new)

What / 改动内容

New community UI plugin Invoice Maker / 批量开发票: Turn a sheet of line items (.xlsx/.csv) into numbered PDF invoices: rows are grouped by invoice number or client, amounts, tax and totals are calculated, and bad numbers or missing clients are flagged. Fix any cell in the panel, preview the invoice and export one PDF per invoice plus an Excel/CSV ledger. Runs locally; no API keys.

  • Tools: invoice_open, invoice_edit, invoice_status, invoice_export (all share one side panel: file picker, settings, issue list, editable table, preview, export).
  • Input: one row per line item. Chinese or English column names (发票号 / invoice no., 客户 / client, 地址 / address, 项目 / item, 数量 / qty, 单价 / price, 税率 / tax) are matched automatically; prices like ¥26,000 or $320.00 and quantities like 一 are understood.
  • Grouping and numbering: rows with the same invoice number form one invoice; rows without a number are grouped by client and numbered from your prefix and first number (e.g. INV-0001).
  • Checks: non-numeric quantities and prices, tax rates outside 0–100, missing clients, one invoice number used for two clients, missing addresses and invoices that will not fit on one page.
  • PDF: your business name and details, client block, item table, subtotal, tax and total, payment due date and notes; Chinese, English or bilingual labels; A4 or Letter; accent colour. Chinese text uses a font already on your computer.
  • Ledger: invoices.xlsx (summary and lines), invoices.csv and an HTML list.
  • Scope (v0.1):
    • One currency per project; tax is a percentage per line (no compound or withholding taxes).
    • One page per invoice (about 20 lines). Not an official tax invoice (e.g. China fapiao or EU e-invoice formats); nothing is sent by email.
    • Old .xls files: save as .xlsx first.
  • Local only; writes only invoice-maker/ in the workspace. Workspace paths are checked so symlinks cannot lead reads or writes outside the workspace (regression test included).
  • Tests: vitest unit + MCP tool tests on real sample files, and a browser e2e with the official AppBridge host (panel → open → edit → export).

A ZCode Desktop demo recording is attached in the comments. / ZCode 桌面版演示录屏见评论。

Self-check / 自查清单

  • Plugin name is unique kebab-case; new external plugin directory is external_plugins/<name>/
  • Usage category is set (productivity)
  • Plugin type and affected names are declared above
  • version 0.1.0 in both plugin.json and marketplace.json
  • README.md (EN) and README_CN.md (中文) both provided and equivalent
  • description_i18n has both en and zh-CN
  • No secrets, machine-specific paths, or private dependencies
  • Model/API/network dependencies documented
  • python3 scripts/validate.py and python3 scripts/build_dist.py pass locally
  • Exercised in ZCode Desktop (ZCode 4.0.0, macOS arm64: installed from a local marketplace, opened p100/invoice-maker/invoices-2026-11.xlsx and exported 3 invoice PDFs, the merged PDF and the ledger; demo video in the comments)

@ppppp2005-p

Copy link
Copy Markdown
Author

ZCode desktop demo (ZCode 4.0.0, macOS arm64)

invoice-maker-demo.mp4

Flow shown:

  1. Installed invoice-maker from a local marketplace built from this PR's branch.
  2. Asked ZCode to open p100/invoice-maker/invoices-2026-11.xlsx and export right away (only invoice_open and invoice_export).
  3. invoice_open grouped the sheet into 3 invoices from 7 line items (grand total ¥57,457.50 incl. tax). The side panel shows the 批量开发票 settings (currency CNY, numbering INV-, date, due days, bilingual, A4) and the invoice list. It warned that the seller name is empty.
  4. invoice_export wrote invoice-maker/invoices-2026-11/: one PDF per invoice (INV-0001-杭州青禾设计工作室.pdf …), all-invoices.pdf, and the ledger invoices.xlsx / invoices.csv / invoices.html. Messy inputs such as ¥26,000 and the quantity 一 were parsed correctly. The last card shows the final state and the first invoice PDF.

演示流程:本地 marketplace 安装 → invoice_open(3 张发票、7 行明细、含税合计 ¥57,457.50,提示未填开票方名称)→ invoice_export 生成每张发票 PDF、合并 PDF 和台账;面板显示设置和发票列表。

@panda920

Copy link
Copy Markdown
Collaborator

✅ Internal validation passed. A ZCode maintainer will review the change next; after acceptance, release checks run separately and this PR is closed automatically.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants