سامانه صدور فاکتور و حسابداری
Mirrored from https://github.com/davoodmehraban89/Factor-easy.git
Synced Dec 3, 15:45 UTC
docs(pilot): archive completed purchase correction and exact gate evidence
davoodmehraban89 committed
Oct 14, 2026 at 09:15 UTC
d4d9e6df34f67c5f80b51daa4bb6e5512be31a8a
1 file changed
+8
PROJECT_STATE.md
+8
@@ -203,6 +203,14 @@ The latest user message is the sole source of new instructions. Read AGENTS.md t
203
- Two synthetic authenticated Chromium journeys appended to `scripts/accounting-document-workflow.spec.js`: posted purchase→UI return→manual edit→draft save→explicit repost with old lines unchanged and balanced, linked history and reload; payment-allocation block, stock-consumption block, cancel with original retained. Fixture adds isolated supplier and purchase accounts. **Six changed JS/Playwright files parsed PASS in V8**, actual DOM, Golden, 3 disposable PostgreSQL, CodeQL and protected release gates **NOT YET RUN** at this checkpoint.
204
- **Known boundary:** Other document classes (receipts/payments as sources, expenses/income, taxpayer submissions, standalone legacy unlinked) are not touched. Production financial rows and SQL/Auth/RLS/schema remain unchanged. The no-negative-inventory guard is a bounded catalog/derived-stock check, not evidence of fully reconciled warehouse reservations. User authenticated on-site correction acceptance OPEN. Do not merge without tests.
205
206
+### 2026-10-14 Owner-approved purchase correction — PR #126 MERGED / EXACT-SHA QA + PAGES VERIFIED
207
+- **Owner-approved execution:** requested in-system view after sale/manual pilot correction, and continuation toward more editable finalized documents. Latest shipped **purchase invoice** corrective workflow merges [PR #126](https://github.com/davoodmehraban89/Factor-easy/pull/126) to protected `main=07de4f974916180399d40b0064322a9480748cdf`. New purchase rows appear under **حسابداری ← مدیریت اسناد** and in purchase register; posted→reversed with posted compensating journal and a separate uniquely numbered/linked editable draft→edit→explicit repost. Original voucher/lines and original purchase record are kept immutable. Cancel posted purchase by balancing reversal; physical delete only for never-posted drafts. No existing production financial records were converted on release.
208
+- **Scope verification:** `js/purchases.js` source/voucher matching, owner+company, open fiscal year, payment-linked and stock availability guards; `js/accounting.js` removes reversed/correction-draft purchases from derived stock and project cost calculations but maintains legacy unlinked accounting semantics; `js/payments.js` allocates only to posted purchase invoices; `js/journal-ui.js` and `js/document-management.js` central purchase UX. Original new purchase creation remains auto-posted, while corrective drafts require explicit repost.
209
+- **Verified PR head `dfdb8221404b440e1bc9d8a148786f3a386801e9`:** Quality `38517172479` SUCCESS, static job `115698467172` **112/112 actual Chromium PASS (2.3m)** including two new purchase correction, inventory/payment-denial/cancellation scenarios, accounting Golden PASS, all three disposable PostgreSQL jobs SUCCESS; Security `38517172309` SUCCESS. Initial QA for prior commit failed **one unrelated transient CSS transition**: light-mode button background luminance sampled mid-animation (0.456 below >0.5), whereas purchase scenarios PASSED; fix made test await steady-state target luminance while preserving existing contrast/luminance assertions; full retest PASS.
210
+- **Protected-main exact-runtime-SHA `07de4f974916180399d40b0064322a9480748cdf`:** Quality **`38517528253` SUCCESS**, Security **`38517528297` SUCCESS**, Release Gate **`38517811727` SUCCESS**, gated Pages **`38517838093` SUCCESS**. Duplicate release `38517673640` CANCELLED, Pages `38517826545` SKIPPED; not counted as successful gates. Browser session on owner's affected ISP **NOT VERIFIED**; workflow success ≠ authenticated owner acceptance.
211
+- **Still OPEN:** receipts/payments and expense/income source corrections, taxpayer-submitted documents, linked bank/warehouse allocations beyond bounded guards, legacy chartless records and closed fiscal years; two-user adversarial permission tests, production correction atomicity/reload and owner confirmation. Global 'all documents' request is partially implemented only; no bulk unposting or physical deletion of posted evidence. F0-01 slow startup remains separately OPEN.
212
+- **Security/cost:** no production SQL DDL/DML, Auth/RLS/grant/role changes, external messaging, paid resource, existing posted ledger rewrite or live financial test transaction. Version rollback by reverting the targeted PR; real user reversal history, once created in future, is immutable and cannot be erased by reverting UI.
213
+
214
## Current change ledger
215
| 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. |
216