سامانه صدور فاکتور و حسابداری
docs(phase3): archive verified treasury amendment release and remaining gates
davoodmehraban89 committed
Oct 14, 2026 at 11:16 UTC
c5a1a93dc13f1cf39dc55d0a47a75a35d7ef50c5
1 file changed
+8
PROJECT_STATE.md
+8
@@ -246,6 +246,14 @@ The latest user message is the sole source of new instructions. Read AGENTS.md t
246
- **Tests authored:** four new `scripts/accounting-document-workflow.spec.js` isolated real-DOM scenarios: employee central-manager → same form → cancel=no writes; amendment → original journal reversed + balancing compensator + new posting in **one server diff** with one visible row, same reference, old lines unchanged, reload; denial for cheque, invoice-linked and fiscal lock; cancellation keeps original history; simulated one-RPC network failure produces no partial server commit and no false UI success. Syntax 5/5 PASS on actual branch files; **real browser/Golden/three disposable PostgreSQL/Security PR-head and exact-main release NOT VERIFIED at this checkpoint**. Fail CI → fix/retest, never release red.
247
- **Remaining risk:** client-side multi-record staging uses existing shared sync RPC and auto-retry; single-call SQL atomicity, lost-ack retry behavior and concurrency cannot be considered owner-accepted solely from synthetic browser tests. Full integrated receipt→invoice settlement/cheque/bank reconciliation and independent authorized two-user tests remain Phase 3/Phase 5 dependencies. Owner live acceptance open; original Phase 0 startup F0-01 open.
248
249
+### 2026-10-14 Phase 3 treasury source correction — PR #131 RELEASED / EXACT-SHA GATES PASS / OWNER ACCEPTANCE OPEN
250
+- **Delivered and shipped:** PR [#131](https://github.com/davoodmehraban89/Factor-easy/pull/131) merged to protected **main=e32a540b863d7931afefc140ed3417065b9a3d01**. New owner-approved bounded UX under `حسابداری ← مدیریت اسناد` and native `دریافت و پرداخت` form: employee sees one effective posted receipt/payment, opens existing form for amount/method (cash, card, bank), reference and note editing, with no reversal on open/cancel. On Save, original source and posted accounting lines stay immutable; one compensating journal and one new balanced posting with linked internal source revision are staged synchronously and sent in one RPC diff. Posted cancellation creates only an auditable accounting reversal; **does not reverse an actual bank/card transfer**. Invoice outstanding and project cash summaries skip reversed prior physical revisions; legacy unlinked history retains separate review handling.
251
+- **Mandatory limitations:** corrections only for **unallocated non-cheque** posted canonical receipts/payments within operator's company and open fiscal year. Invoice-linked settlements, cheques, bank reconciliation, noncurrent/legacy vouchers, cross-party/direction changes fail closed. Correction does not authorize real bank operations, automatic historical ledger bulk changes or financial DDL; the broader Phase 3 and fully authenticated owner acceptance remain open. F0-01 login startup slowness remains open/deferred.
252
+- **Exact PR head=68d9c99368f17cbd81ae77dc3f98971e07e4123b:** GitHub Quality **38528960651 SUCCESS**, static job **115735923478** **117/117 Playwright Chromium PASS** (including three newly authored treasury test cases; fourth item cancellation included in guarded case), accounting Golden sale→receipt→purchase→payment→expense/income→reversal→statements PASS, three disposable PostgreSQL jobs `115735923279`, `115735923290`, `115735923452` SUCCESS; Security **38528960665 SUCCESS** with CodeQL/release-safety and dependency review SKIPPED (not passed).
253
+- **Exact protected main=e32a540b863d7931afefc140ed3417065b9a3d01:** Quality **38529415899 SUCCESS**, Security **38529415779 SUCCESS**, Release Gate **38529791374 SUCCESS**, gated Pages **38529861751 SUCCESS**. Superseded Release `38529592570` CANCELLED and Pages `38529842842` SKIPPED, not classified as success. This proves release workflow, **not** user ISP login/customer-document UI acceptance.
254
+- **Independent live backend review:** `pg_get_functiondef(public.finora_sync_records)` shows both 2-param and 3-param overloads are PostgreSQL `plpgsql` routines without `EXCEPTION WHEN` partial-success handling, using transaction-scoped upsert/deletes. The browser test confirmed one RPC call for combined reversal+new posted source and no partial server writes on a simulated failed RPC. **Lost-response retries, concurrency, true bank statement reconciliation and offboarding two-user access remain unverified**; no promise of real-world exactly-once payment transfer semantics. Supabase `hcsixhqbyuhpshfwqpjx` ACTIVE_HEALTHY; no production financial rows, grants, roles, Auth/RLS/schema, vendor/SMS or paid resources changed by PR.
255
+- **Next verified work:** owner authenticated disposable receipt/payment test (do not use actual bank entries) then controlled separate slices for **expense/income** source correction and **allocated receipts/cheques** after complete settlement/treasury reconciliation. Maintain immutable original accounting and single visible employee-facing document. No owner acceptance claimed yet.
256
+
257
## Current change ledger
258
| 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. |
259