# TradiXor — Deferred Items by Phase

**Purpose:** Track features and integrations that were deliberately left incomplete during Phases 3–9 for implementation in the Finance, Sales, and Accounting phases (13–14 and 11–12). All items here have working operational counterparts; what is missing is the corresponding GL/journal entry or advanced financial logic.

---

## Phase 3 — Supplier & Customer Registry

| Deferred Item | Target Phase | Notes |
|---|---|---|
| Accounts Receivable aging | Phase 14 | Customer payment terms exist on the model but no AR aging report or outstanding balance tracking |
| Customer credit limits | Phase 11–12 (Sales) | No enforcement at point-of-sale; deferred to `SaleService` |
| Supplier payment terms enforcement | Phase 9+ / 13 | `payment_terms` field on Supplier exists; not used to flag overdue AP |

---

## Phase 4 — International Procurement

| Deferred Item | Target Phase | Notes |
|---|---|---|
| PI payment journal entries | Phase 13 | `SupplierPaymentService::recordPayment()` records the payment row but does **not** post AP DR / Cash & Bank CR to the general ledger |
| Proforma invoice confirmation journal | Phase 13 | No accrued liability entry when a PI is confirmed |
| Sourcing trip expenditure journal | Phase 13 | Trip costs (accommodation, travel) not journalised |

---

## Phase 5 — Logistics & Shipping

| Deferred Item | Target Phase | Notes |
|---|---|---|
| Shipment delivery GL posting | Phase 13 | `InventoryLotService::createFromShipment()` was designed to post Inventory — Warehouses DR / Accounts Payable CR; the call is present but the actual journal creation is not implemented |
| Tax clearance payment journal | Phase 13 | Tax assessed/paid amounts are recorded on `tax_clearance_records` but no journal entry (Tax Expense DR / Cash CR) is created |
| CFA service fee journal | Phase 13 | CFA fee on `tax_clearance_records` not posted to GL |
| Haulage cost journal | Phase 13 | Haulage records track cost but no journal entry |
| Freight / insurance accrual | Phase 13 | Shipment freight and insurance costs are stored for costing but not accrued in GL |

---

## Phase 6 — Costing & Landed Cost Engine

| Deferred Item | Target Phase | Notes |
|---|---|---|
| Landed cost GL posting | Phase 13 | Cost allocations confirmed and stored; not posted as GL adjustments to inventory valuation accounts |
| Inventory valuation account split | Phase 13 | All inventory sits in a single "Inventory" account; no breakdown by cost component (freight, insurance, tax) in the COA |

---

## Phase 7 — Inventory: Lots, Stock Levels, Movements

| Deferred Item | Target Phase | Notes |
|---|---|---|
| Inventory DR / AP CR on lot receipt | Phase 13 | `InventoryLotService::createFromShipment()` and `GrnPostingService` both have `// TODO: GL posting` comments; no journal created on lot creation |
| Opening stock GL posting | Phase 13 | Opening stock creates a lot and stock movement but no journal (Inventory DR / Opening Balance Equity CR) |
| WAC average_cost journal entries | Phase 13 | WAC `average_cost` is tracked on `stock_levels` but no corresponding GL entry is made when WAC changes |
| Stock write-down entries | Phase 13 | `LotPricingService` can set prices below cost; no GL impairment entry |

---

## Phase 8 — Inventory: Transfers, Stock Takes, Serial Numbers

| Deferred Item | Target Phase | Notes |
|---|---|---|
| Transfer order GL (WIP / in-transit) | Phase 13 | No in-transit account entry on dispatch; no destination receipt entry on receive |
| Stock adjustment journal entries | Phase 13 | `StockMovementService::adjust()` updates stock levels but does not post Inventory Shrinkage/Surplus DR/CR |
| Stock take variance journal | Phase 13 | Posting a stock take with variances calls `adjust()` but no GL entry for Inventory Loss / Gain |
| Write-off journal entry | Phase 13 | Serial write-offs change serial status but do not post Inventory Write-Off Expense DR / Inventory CR |

---

## Phase 9 — Local Procurement

| Deferred Item | Target Phase | Notes |
|---|---|---|
| GRN posting GL journal (Inventory DR / AP CR) | Phase 13 | `GrnPostingService` has explicit `// TODO: GL posting (Inventory DR / AP CR) — defer to Accounting phase` comment; not implemented |
| Input VAT journal on GRN | Phase 13 | VAT is intentionally excluded from `landed_cost_per_unit` (recoverable input tax). No Input VAT DR / AP CR journal at posting |
| Invoice approval / payment GL entries | Phase 13 | Approving a supplier invoice or recording a payment does NOT post AP DR / Cash CR; no accrual entry on invoice approval |
| Supplier credit note GL reversal | Phase 13 | Credit note `apply()` reduces `amount_paid_*` on the invoice but creates no GL reversal journal (AP CR reversal / Income CR) |
| Automated serial-level returns | Phase 9 (future) | `SupplierReturnPostingService::post()` only changes document status. Stock reduction requires manual reconciliation on the ShowLot page (mark individual serials as `returned_to_supplier`). Automated serial selection at return posting is not implemented |
| AP ageing formal ledger | Phase 14 | An aged creditors *report* exists in Local Procurement Reports but it is a query-based view, not a formal AP sub-ledger |
| Supplier statement of account (formal) | Phase 14 | A printable supplier statement document exists; it is not reconciled against a formal AP ledger |
| Credit note multi-invoice application | Post-Phase 9 | A credit note can currently be applied once (fully or partially). Applying the remainder to a second invoice is not implemented; user must create a new credit note for any remaining balance |

---

## Phase 10 — Production

| Deferred Item | Target Phase | Notes |
|---|---|---|
| Material consumption journal (WIP DR / Inventory CR) | Phase 13 | `ProductionOrderService::complete()` calls `StockMovementService::issue()` for confirmed consumptions but does **not** post WIP DR / Inventory CR to the general ledger |
| Production completion journal (Inventory DR / WIP CR) | Phase 13 | `ProductionOrderService::complete()` creates the output `InventoryLot` and calls `StockMovementService::receive()` but does **not** post Inventory — Finished Goods DR / Work in Progress CR |
| Production cost variance journal | Phase 13 | When actual production costs differ from estimates, no variance journal (Production Variance DR/CR) is posted |
| Labour / overhead cost accrual | Phase 13 | Labour and overhead cost lines are recorded on `production_cost_lines` but no journal entries (WIP DR / Wages Payable CR or WIP DR / Overhead Applied CR) are created |

---

## Phase 11 — Sales: Full Payment & POS

| Deferred Item | Target Phase | Notes |
|---|---|---|
| Sale revenue journal (Cash & Bank DR / Sales Revenue CR) | Phase 13 | `SaleService::finalize()` records payment rows but does NOT post to the general ledger |
| COGS journal (COGS DR / Inventory — Outlets CR) | Phase 13 | Stock movements are created at finalize but no corresponding COGS journal entry is posted |
| Sales return journals | Phase 13 | `SalesReturnService` (Phase 12) handles the operational return; reversal journals deferred to Phase 13 |
| Serial reconciliation workflow UI | Phase 12 / Inventory | `serial_reconciliations` table is populated at finalize for serialized items sold via quantity mode; no UI to assign specific serials post-sale. Managed manually via inventory stock take until a dedicated reconciliation screen is built |
| B2B credit sales / payment-on-delivery (formal AR) | Phase 13+ | `allow_delivery_before_payment=true` on instalment configurations covers the operational flow; formal AR module, customer credit limits, and invoice-based billing deferred to Finance phases |
| Direct thermal printer integration (QZ Tray) | Phase 17 / future | Receipts currently use browser `window.print()`. Silent direct printing to Xprinter/Epson thermal printers requires QZ Tray local agent — deferred |
| Bank account assignment on sale payments | Phase 13 | `sale_payments.bank_account_id` column and FK exist; cashier UI intentionally excluded (this is an AR/accounting function). Bank account will be assigned during finance reconciliation in Phase 14 |

---

## Summary — All Deferred GL/Journal Entries

The following journal types are **not yet posted anywhere** in the system. All will be implemented together in Phase 13 (Finance: COA, Journals, Fiscal Periods):

| Event | Expected Journal |
|---|---|
| GRN / Lot posted (import or local) | Inventory — Warehouses DR / Accounts Payable CR |
| Input VAT on GRN | Input VAT DR / Accounts Payable CR |
| Opening stock | Inventory — Warehouses DR / Opening Balance Equity CR |
| Supplier invoice approved | Accounts Payable accrual (or already covered by GRN journal) |
| Supplier invoice payment | Accounts Payable DR / Cash & Bank CR |
| Proforma invoice payment | Accounts Payable DR / Cash & Bank CR |
| Tax clearance payment | Tax Expense DR / Cash & Bank CR |
| CFA service fee | CFA Expense DR / Cash & Bank CR |
| Stock adjustment (shortage) | Inventory Shrinkage Expense DR / Inventory CR |
| Stock adjustment (surplus) | Inventory CR / Inventory Gain CR |
| Serial / lot write-off | Inventory Write-Off Expense DR / Inventory CR |
| Transfer order dispatch | Inventory in Transit DR / Inventory — Warehouses CR |
| Transfer order receipt | Inventory — Warehouses DR / Inventory in Transit CR |
| Production material consumption | WIP DR / Inventory — Warehouses CR |
| Production completion | Inventory — Finished Goods DR / Work in Progress CR |
| Sale (COGS) | COGS DR / Inventory — Outlets CR |
| Sale (revenue) | Cash & Bank DR / Sales Revenue CR |
| Sales return (resaleable) | Inventory DR / COGS CR + Sales Revenue DR / Customer Refund CR |
| Supplier credit note applied | Accounts Payable DR (partial reversal) |

---

*Last updated: Phase 11 completion — June 2026*
