سامانه صدور فاکتور و حسابداری

docs(ux): archive shipped same-form correction gates and unresolved financial boundaries

davoodmehraban89 committed Oct 14, 2026 at 10:11 UTC 3ae0ea6d5daf1e9aebf9e770549de6303b644603
1 file changed +8
PROJECT_STATE.md
+8
@@ -223,6 +223,14 @@ The latest user message is the sole source of new instructions. Read AGENTS.md t
223 - **Automated test coverage added:** 2 browser journeys for posted sale and purchase: click same document→cancel=no write→reopen→edit→single Save→internal reversal/repost→single visible item, same printed number, original transaction unchanged, reload consistency. **5/5 V8 syntax PASS**. Full Chromium/Golden/3 DB/CodeQL and exact-main Pages: PENDING; do not merge if any gate fails.
224 - **Caveats:** source amendment is currently a multi-step application sync (not a server transaction) and waits for acknowledged stages; fail closed on sync trouble and do not retry blindly. Do not edit production historical customer records for testing; owner sign-in & UI acceptance remain OPEN. Payment/expense/tax source families remain unimplemented.
225
226 +### 2026-10-14 Owner's same-form correction UX — PR #128 MERGED / EXACT SHA QA + PAGES SUCCESS
227 +- **New owner-directed UX (no employee-facing technical revision):** user selects «اصلاح» on a previously posted sale or purchase; the **same business invoice number and same edit form** open without creating any ledger entry. Cancel / close causes **zero accounting changes**. Save applies corrected fields via internal linked reversal, new traceable source revision and balanced accounting repost. Public archive/central document manager shows **one current visible business invoice per correction chain**, original document number, and corrected print values/number; old original business source and journal voucher + lines remain intact only in accounting audit. Existing old in-progress correction drafts still save safely with their internal unique storage numbers, even when the form shows original business number. Internal source revisions still physically exist, not destructive overwrites; source tax/settlement/locked period guards retained.
228 +- **Shipped implementation:** [PR #128](https://github.com/davoodmehraban89/Factor-easy/pull/128) protected `main=635db7de4e71143fd167539780731f9277e20da0`. Changed `js/invoices.js`, `js/purchases.js`, `js/document-management.js`, `js/print.js`, `scripts/accounting-document-workflow.spec.js`, plus pre/post ledger notes. No production finance data modified by publishing code. User/browser real-world acceptance is OPEN. Scope: sale + purchase only, separate from manual journal/history UI and payment/expense/tax documents.
229 +- **PR head `faeae40835631c08da12c6145913419549f1c6ed`:** Quality `38522695691` SUCCESS, static job Chromium **114/114 PASS** including two new full real-DOM employee journeys for both types, print same original number, one visible row, open-cancel no writes, balanced reversal and persisted corrected posting after reload; accounting Golden PASS, 3 disposable PG jobs PASS. Security `38522695697` SUCCESS. Two earlier PR heads correctly BLOCKED at 112/114 and 113/114 due test/old draft number expectations; fixes made and entire suite rerun PASS.
230 +- **Exact protected-main SHA `635db7de4e71143fd167539780731f9277e20da0`:** Quality **`38523130482` SUCCESS**, Security **`38523130453` SUCCESS**, Release Gate **`38523454291` SUCCESS**, gated Pages **`38523518579` SUCCESS**. Duplicate earlier Release `38523282456` CANCELLED and Pages `38523502557` SKIPPED are NOT reported as passes.
231 +- **Open/risks:** authenticated owner screen smoke on factoreasy.ir is NOT VERIFIED, F0-01 ISP startup slowness remains OPEN. This feature spans multiple acknowledged sync RPC steps, not a single atomic DB transaction; on interrupted sync, UI blocks success and requires reload/reconciliation, **no blind retry**. Do not automatically modify old real invoices. Manual journal editor remains an explicit accounting document with visible voucher audit; receipt/payment, expense/income, e-tax and legacy unlinked records need type-specific design; the requested all-document workflow is NOT universally accepted.
232 +- **Rollback:** revert scoped UI PR using protected gates. Previously created legitimate compensating journal vouchers must stay in audit history; no Auth/RLS/schema/migration, paid services or production customer data changed by this work.
233 +
234 ## Current change ledger
235 | 2026-10-07 | Owner requested accounting/product usability refinement from live screenshots: automatic non-user-entered floating-detail codes, contextual in-product guides (especially accounting/chart/dimensions), remove duplicate product internal tax ID and use product code as internal item ID, strengthen in-control product/person search, introduce hierarchical product group/subgroup coding with deterministic 6-digit product codes, and keep sale/purchase commercial-document workspace layout stable while only semantic fields change. | **IMPLEMENTED / LOCAL VERIFICATION PASSED / CI PENDING** | Baseline main = `7e58c75f7d754f378d94ca3f356c1ae580aa7ee3`. Automatic dimension type/value codes, contextual guides, product-code-as-internal-ID, normalized multi-token search, and additive six-digit product coding implemented. Existing historical codes preserved. Commercial sale/purchase workspaces now share a stable `صدور سند تجاری` header/actions layout; duplicate purchase sidebar injection removed; the public selector is the single document-type selector and the legacy internal invoice-kind control is hidden. Local syntax/static/commerce/UX/accounting phases 2–6/Golden checks passed; protected-branch CI remains pending. |
236