---
name: receipt-tax-ocr
description: "Organize receipt images and subscription invoice/receipt PDFs for Japanese sole-proprietor or side-business bookkeeping: extract evidence, rename files, and update monthly memos. Use for 領収書, レシート, receipt, OCR, リネーム, 確定申告, 勘定科目, 経費, subscription receipts, or payment-method change history. Not for company/D365 travel expense claims."
argument-hint: "Receipt files or service, period, payment-method change, save scope, or receipt corrections"
user-invocable: true
license: CC BY-NC-SA 4.0
metadata:
  author: yamapan (https://github.com/aktsmm)
---

# Receipt Tax OCR

## When To Use

- **領収書**, **レシート**, **receipt**, **OCR**, **リネーム**
- 日本の個人事業・副業の経費整理をしているとき
- 領収書フォルダで作業しているとき
- 画像ファイルをOCRしてリネームしたいとき
- Retrieve subscription invoices/receipts or identify when payments switched to a business card
- 確定申告準備で経費整理をしているとき

## Core Rules

- **Account unclear** → Ask the user, do not guess
- **Context affecting the account is missing** → Ask before renaming or updating the memo when the recipient name, the relationship to that person, or the business purpose is unclear. These change the account (e.g. 接待交際費 / 会議費 / 事業主貸). Never infer them from vendor or amount alone.
- **Scope** → The default examples assume Japanese bookkeeping and Japanese tax-filing terminology
- **Filename format** → Use `YYYY-MM-DD-content-vendor-note-amount-勘定科目[-メモ].ext`
- **Date** → Use the documented service date (subscription period start), not screenshot date or settlement date; record conflicting history/PDF dates in the memo.
- **Evidence priority when values conflict** → Trust EXIF first, then the existing filename, then the OCR result, and use the file timestamp only as a last resort. The file timestamp shifts on copy, sync, and re-save, so never let it override a date visible in the receipt.
- **Private card payment** → Keep the actual business expense account on the receipt; record personal funding as 事業主借 separately from the expense and any later reimbursement. Payment method alone does not establish business purpose.
- **Payment-method change** → Confirm the business card's last four digits and inspect each transaction's paid receipt; the current default card does not prove past payments. Confirm which periods to save before a batch.
- **Personal withdrawal from booked business account** → Use `借方: 事業主貸 / 貸方: 普通預金`, never `対象外`; include the source account and journal entry in the monthly memo.
- **Cash withdrawal source or use unclear** → Ask whether the source is a booked business `普通預金` and whether the cash was for private or business use before renaming or updating the memo.
- **Amount** → Preserve the displayed tax-inclusive amount and currency; do not invent a JPY total or mistake a tax-only JPY display for the total.
- **Multiple categories** → Use the primary one, hint at others in note
- **Only surviving evidence is non-expense** → Cart screens, canceled bookings, and other non-expense screenshots should not be treated as 補助画像 when they are the only remaining evidence. Record them in the monthly memo table as `対象外` with amount and reason.
- **Multiple items in one image** → When one screenshot contains multiple products, tickets, books, or shipping supplies, keep one file but add item-by-item breakdown notes in the monthly memo.
- **Duplicate evidence** → Compare incoming and saved records by transaction date, vendor, amount, and receipt/order number, not hashes alone. Different photos, card slips, and receipts can represent one transaction; retain originals as main/supplemental evidence and count the transaction once. Matching amounts alone do not prove duplication.

## Procedure

1. Identify local receipt files or the requested service, period, and save scope
2. Extract native PDF text before OCR; extract date, vendor, amount, currency, and transaction type
3. Reconcile duplicate evidence and determine the accounting category; ask only unresolved material facts and continue independent confirmed items
4. Present a rename/move dry-run and execute after confirmation; reuse explicit approval for the same scope without asking again. A check-only or preview request does not authorize moves
5. Save/rename the originals and update the monthly memo; do not stop at the candidate list for an authorized organization request
6. Apply later purpose/person corrections to the same files, memo links, totals, and pending labels; prefer the user's clarification over tentative handwriting interpretation
7. Verify destination files, unchanged original hashes, valid memo links, and non-duplicated totals; show old → new filenames, final classifications, and destination links, distinguishing organization from ledger entry

## References

- Filename parts, vocabulary, category examples, and sample outputs: [references/filename-rules.md](references/filename-rules.md)
- Monthly memo rules and `対象外` / 補助画像 handling: [references/monthly-memo.md](references/monthly-memo.md)
- Payment-method history, foreign-currency subscriptions, and PDF matching: [references/subscription-receipts.md](references/subscription-receipts.md)
