# #024 Calendar — Separate double-entry voucher screen (Package 1.0.199)

Status: Candidate / NOT COMPLETED. No changes to completed #029 NumberBox, #048 Table, or #054 Display Timeline Runtime.

## Operation

1. Open `http://localhost/boneflow/sample/024/calendar/minimal.html` and the Task Manager.
2. Select an existing task (or save a new task), then choose **伝票入力画面を開く（借方／貸方）**.
3. The dedicated page `/boneflow/sample/024/calendar/finance-voucher.html` opens in a new browser window. Keep the Calendar tab open; popup blockers must allow the user-triggered window.
4. Enter voucher date, number, description, debit/credit account codes, subaccount codes and separate amounts in each row. A saved posting pattern can add a row without choosing a cash account automatically.
5. The voucher saves **only when debit and credit totals match and the total is positive**. A stable `voucherId` is attached to the original Calendar task.
6. Select an existing voucher to edit; save the same ID or explicitly delete it. Future timeline totals may use `BoneCalendar.financeVoucherTotals(root, taskId)` and `BoneCalendar.openFinanceVoucher(root, taskId, voucherId)`.

### Example: payroll breakdown (display amounts only, account classification is user-defined)

| Debit | Debit amount | Credit | Credit amount |
|---|---:|---|---:|
| Ordinary deposit | 245,000 | Payroll receipts (personal ledger) | 300,000 |
| Insurance withholding / account chosen by operator | 45,000 | — | 0 |
| Income tax withholding / account chosen by operator | 10,000 | — | 0 |
| **Total** | **300,000** | **Total** | **300,000** |

Payroll receipts are **not** automatically treated as business sales. These are illustrative financial figures, not a recommendation of tax/bookkeeping classification. Account codes are never inferred from account names.

## Data compatibility and accounting exports

`financeVouchers: [{voucherId, date, number, description, lines:[{lineId, debitAccount, debitSub, debitAmount, creditAccount, creditSub, creditAmount, memo, taxCategory, taxRate}]}]` is an **optional new task property**. Older `financeEntries` remain unchanged and may still be edited through the collapsed compatibility section. The calendar's existing SQLite task serialization path carries the new field along with all task data; live IndexedDB/SQLite persisted round-trip on Windows is not yet verified.

Existing JDL review and Freeway Lite exports combine old entries and vouchers. Compound debit/credit sides are paired by remaining amounts in original order without inventing counterpart accounts. Existing importer requirements still apply: missing account codes, tax settings, noninteger amounts and other required mapping values can stop export. No assurance of import into actual vendor software has been made.

## Formal components

The separate page uses `bf-table` from **#048 Table HTML Functional Class** for voucher display and `renderer:'029'` for full-height #029 NumberBox voucher amount cells. It loads those components only from the already-installed local Bone Flow runtime. New custom NumberBox, Shape, and Table runtime files are not included. If #029/#048 or their prerequisites are not installed, a fallback HTML table is shown with an explicit dependency warning, and numeric editing remains possible via standard accessible HTML inputs.

Asset URLs contain no `?v=` or other cache-busting query strings. The navigation URL may use the task/voucher identifiers solely to select the saved record in the same-origin Calendar tab.
