Skip to content

Repository files navigation

opencli-expense-orders

⚠️ DEPRECATED — Repository Moved

This codebase has been merged into xwzhangSZU/opencli-stack under plugins/expense-orders/ (full git history preserved via git subtree). All future development happens there. This repository is archived and read-only.

OpenCLI adapters for reimbursement prep on JD and Taobao/Tmall.

This plugin is intentionally OpenCLI-only and does not rely on MCP. The first version does three things:

  • list reimbursement candidates from JD orders
  • list issued-invoice reimbursement candidates from Taobao/Tmall invoice records
  • export invoice PDFs and compact order-summary screenshots with consistent file names

Scope

  • JD: read personal order history, use existing 查看发票, download invoice PDFs, generate compact reimbursement summary cards from captured order data
  • Taobao/Tmall: read 我的发票, only process records that are already 已开票, download invoice PDFs, generate compact reimbursement summary cards from captured order data
  • no automatic Taobao invoice application
  • no parallel browser runs across JD and Taobao

Commands

opencli jd expense-list --from YYYY-MM-DD --to YYYY-MM-DD --output manifest.json
opencli jd expense-export --manifest manifest.json --output /path/to/export-root

opencli taobao expense-list --from YYYY-MM-DD --to YYYY-MM-DD --output manifest.json
opencli taobao expense-export --manifest manifest.json --output /path/to/export-root

bash scripts/export-all.sh --from YYYY-MM-DD --to YYYY-MM-DD --output /path/to/export-root

Output Layout

Each exported order is written to:

<output>/<图书类|其他商品服务支出>/<YYYY-MM>/<YYYY-MM-DD>__<title>__<JD|TAOBAO>__order-<orderId>/

With these files:

  • <YYYY-MM-DD>__<title>__<JD|TAOBAO>__order-<orderId>__订单截图.png
  • <YYYY-MM-DD>__<title>__<JD|TAOBAO>__order-<orderId>__发票.pdf
  • meta.json

order-detail.png is a compact reimbursement-friendly horizontal summary strip, not a full-page dump. It is intentionally normalized to keep these fields visible:

  • product title
  • order number
  • order date

The manifest also suggests a future bank-record screenshot name in the same style:

  • <YYYY-MM-DD>__<title>__<JD|TAOBAO>__order-<orderId>__支付记录.png

If an include order still fails to download its invoice, scripts/export-all.sh also writes:

  • manual-invoice-followup.json
  • manual-invoice-followup.md

These files are the handoff checklist for manual invoice recovery.

Date Semantics

This repo now distinguishes three date concepts explicitly:

  • order_date: user-facing date kept for backward compatibility
  • invoice_date: invoice issuance date when the source page exposes it
  • real_order_date: actual order-placement date fetched from the order detail page when available

For reimbursement month grouping, downstream tools should use accounting_date:

  • JD: accounting_date = order_date
  • Taobao/Tmall: accounting_date = invoice_date, falling back to order_date for legacy manifests

This matters for Taobao preorder items, where the real order-placement date may be much earlier than the invoice issuance month.

Install

bash install.sh

Optional custom OpenCLI home:

OPENCLI_HOME=/path/to/.opencli bash install.sh

Uninstall

bash uninstall.sh

Classification Rules

The first version is conservative:

  • include: books, journals, software, licenses, clear computer accessories such as docks, hubs, adapters
  • review: ambiguous computer-related or generic electronics
  • exclude: pets, medicine, home goods, phone accessories, games, coffee gear and other clearly unrelated items

Migration

If another machine already has OpenCLI installed, follow MIGRATION-OTHER-MACHINE.md.

For acceptance checks after migration, use TEST-MATRIX.md.

If you want Codex / Claude Code to pull, install, and verify the repo on another machine, start from AGENT-SYNC-VERIFY-PROMPT.md.

About

DEPRECATED — 已并入 opencli-stack 的 plugins/expense-orders/。京东 / 淘宝天猫报销单据整理的 OpenCLI 适配器。

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages