Skip to content

v0.3.0

Choose a tag to compare

@Edgar-311 Edgar-311 released this 27 Oct 16:35
· 6 commits to main since this release
ce532df

报销帮手:按发票内容给文件改名(可以预览、可以改回去),检查发票抬头。
For reimbursement: rename invoice files after their contents (with a preview and an undo), and check who invoices are made out to.

pip install --upgrade ofdkit
ofdkit rename 发票文件夹                    # 预览新名字 / preview the new names
ofdkit rename 发票文件夹 --apply            # 改名 / rename
ofdkit 发票文件夹 --buyer 某某有限公司       # 检查抬头 / check the buyer

Added

  • ofdkit rename: renames invoice files after their contents, by default as {开票日期}_{销售方}_{价税合计}_{发票号码}.ofd. It only previews until --apply is given, renames PDF and XML copies with the same name along with the OFD file, never overwrites a file (a clashing name gets (2)), leaves files that already have their new name alone, and writes a log that ofdkit rename --undo LOG uses to restore the old names. --pattern sets the format from 13 fields, in Chinese or English.
  • --buyer NAME_OR_TAX_ID for show and batch: flags invoices made out to another buyer (发票抬头), in the summary, the CSV warnings and in orange in Excel. The MCP tool list_ofd_invoices and ofdkit.read_invoices() take buyer too.
  • py.typed, so type checkers use ofdkit's annotations.