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

docs(ux): record released same-form correction, exact CI gates and owner-acceptance caveats

davoodmehraban89 committed Oct 14, 2026 at 10:11 UTC c7390bb19a6c05c5fb7f718150c43f1ca124e3c0
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 Same-document sales/purchase amendments — RELEASED PR #128 / EXACT SHA VERIFIED / OWNER ACCEPTANCE OPEN
227 +- **Owner UX contract:** Click «اصلاح فاکتور» on an already-posted sale/purchase to open the same invoice form, with its original business number. No technical correction-number, separate new invoice or reversal confirmation is shown to employees; cancelling does not post/reverse anything. Saving internally preserves the initial immutable voucher and source, records a linked compensating reversal and amended voucher/source, waits for server synchronization, and presents one current logical business invoice in manager/list/print. The technical source revisions remain visible for authorized accounting audit. Historical legacy user-issued correction drafts are still editable with their internal IDs preserved.
228 +- **Merged source:** [PR #128](https://github.com/davoodmehraban89/Factor-easy/pull/128) squash-merged protected main **635db7de4e71143fd167539780731f9277e20da0**. Updated js/invoices.js, js/purchases.js, js/document-management.js, js/print.js, scripts/accounting-document-workflow.spec.js. Pre-implementation scope + checkpoint committed to this file on isolated PR branch.
229 +- **Feature PR head:** **faeae40835631c08da12c6145913419549f1c6ed**. Quality **38522695691 SUCCESS**, static job **114/114 actual Chromium PASS**, Golden accounting PASS, three disposable PostgreSQL jobs SUCCESS. Security **38522695697 SUCCESS**. Earlier intermediate test runs at prior heads failed regression checks and were corrected/retested; do not count earlier failure as acceptance.
230 +- **Exact released main SHA:** Quality **38523130482 SUCCESS**, Security **38523130453 SUCCESS**, Release Gate **38523454291 SUCCESS**, gated Pages **38523518579 SUCCESS**. Duplicate Release **38523282456 CANCELLED** and Pages **38523502557 SKIPPED**, not counted as passes. Gated Pages attests workflow publishing; owner-authenticated real ISP/login/finance browser test not yet verified.
231 +- **Financial/operational limits:** Existing live customer financial records, permissions, RLS, roles, schema, Stripe, SMS and production DB rows were not modified by this source release. Sale/purchase historical accounting remains immutable. This is an application-level linked revision workflow using multiple sync stages, not independently verified as one server-side atomic amendment transaction; if a stage loses server confirmation, recovery must inspect state before retry. Closed periods, settled allocations, submitted tax invoices and historical unlinked vouchers still fail closed. Manual journal, payment/receipt, expense/income, taxpayer and multi-tenant concurrent correction acceptance remain separate tasks. F0-01 slow real owner sign-in still open.
232 +- **User-visible acceptance next:** In browser, refresh site, open posted purchase/sale, select اصلاح فاکتور, verify original number and edit form; cancel = zero posting, then authorized disposable test edit/save/print yields one visible record and same number after reload, while auditing all linked vouchers. Never use actual production business financial records solely as test fixtures.
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