# Accounting account mapping readiness Repository-derived inventory only. Existence in the chart is not approval to use an account for a new posting. No account IDs or rates are invented here. | Posting purpose | Existing COA evidence | Status | Required decision/configuration | |---|---|---|---| | Cash tender | `1000.01.01` Kas Tunai Toko; `1000.01.02` Kas Kecil Operasional | Accounts exist. Default cash code is used by advance workflows, not a verified POS payment mapping. | Which cash account applies per store/register and method? | | Bank receipts | `1000.03.01` Bank BCA Rekening Perusahaan; `1000.03.02` Bank Mandiri | Accounts exist; no authoritative payment-method/account mapping for sales collections found. | Bank account per outlet, transfer, giro/cheque and reconciliation policy. | | Gateway clearing | No dedicated clearing account identified in current operational mapping. | Missing mapping. Do not substitute a bank or generic cash account. | Gateway capture vs settlement events, provider identity, fees and payout matching. | | Accounts receivable | `110302` Piutang Dagang B2B | Account exists; invoice subledger covers broader usage. | Confirm one control account or split by customer/channel. | | Inventory | `110401` Persediaan Barang Dagang | Account exists; no reliable historical cost event layer or complete GL movement posting. | Cost method, cutover, warehouse dimension and adjustment controls. | | Cost of goods sold | No verified operational postable COGS mapping identified. `5000.04` is operational expense and is used by the stock-opname shortage hook. | Missing/ambiguous for sales COGS. Do not reuse merely because it is an expense account. | Approve COGS accounts and product/category rules. | | Sales revenue | `4000.01` Mart and `4000.02` Depot Galon | Accounts exist; no configured product/channel mapping. | Approve category/product mapping, shipping and recognition. | | Output tax | No verified output-tax payable mapping. `110701` is documented as input VAT. | Missing. Never reuse input-tax account. | Tax classification, rate, basis, rounding and liability account. | | Sales discounts | No dedicated contra-revenue mapping. Discounts reside on SO lines/header. | Missing policy/mapping. | Contra-revenue vs approved treatment; tax/return allocation. | | Supplier AP | `210102` Hutang Dagang Supplier | Account exists and is used by supplier-payment hook. Full supplier invoice/AP lifecycle not verified. | Confirm AP control subledger and invoice recognition event. | | GR/IR | `211.03` Hutang Yang Belum Ditagih appears in GR accrual draft comments/lines. | Account migration exists; draft is advisory and separate from GR transaction. | Confirm GR/IR reconciliation and invoice-clearing policy. | | Input tax | `110701` PPN Masukan | Existing input-tax account; no evidence supports output-tax use. | Confirm tax registration and eligibility. | | Customer deposit liability | `2000.02` Uang Muka Penjualan / Deposit Customer | Exists and is used by advance workflows. | Confirm subledger/control reconciliation. | | Supplier advance asset | `110501` Uang Muka Pembelian | Exists and is used by advance workflows. | Confirm supplier-advance reconciliation. | | Opname shortage/surplus | `5000.04` operational expense and `7100.99` other income used by hook. | Existing hardcoded behavior; approval and valuation basis are not established. | Approve reason-based mapping and gains policy. | ## Reversal integrity status Migration `000128_journal_reversal_integrity.sql`: - Audits historical duplicate reversal links and unbalanced mirror values, aborting for explicit review without rewriting transactions. - Adds unique partial indexes for one reversal per original and one original per reversal. - Requires journals to start as drafts; posting checks minimum line count, line exclusivity, header/line totals and balance. - Makes posted journal headers and lines immutable. A source may transition `posted` → `reversed` only with a linked posted mirror whose accounts, departments, amounts and header totals are exact reversals. - The service/API no longer permits posted-journal voiding; it returns 409 and directs correction through `/reverse`. - Cross-period reversal remains blocked by period lock; no policy bypass was added. The migration was applied and tested on an isolated empty-history PostgreSQL 16 database, not a shared or production dataset. Historical preflight on deployment data remains necessary. ## Governance gaps observed - `accounts.code` is globally unique, not tenant-scoped; `accounts` has no tenant column. - Journal line resolution rejects header accounts but does not reject inactive accounts. Account updates default omitted `is_active`/`is_postable` to true. - No account-change audit table or default posting-map table was found. - The account FK prevents deletion after use, but inactive-account posting governance is incomplete. These are separate CoA governance tasks; mapping existence alone does not approve a posting policy.