@davoodmehraban89 / Factor-easy / commits / f8be2d3
Fork 0

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

docs(qa): scope Issue238 inventory-count draft-first browser proof

davoodmehraban89 committed Nov 23, 2026 at 07:32 UTC f8be2d36b82c6f8e15da21a97841bc0e2450c6b5
2 files changed +12
PROJECT_STATE.md
+7
@@ -749,3 +749,10 @@ Next action: run and inspect Quality on the latest PR212 head. If any browser te
749 - **Root cause:** the actual loaded `jeReverse` implementation creates and syncs a reversal voucher locally; it does not call the fixture's `qaF0Reverse` RPC counter. The counter is therefore not an authoritative source of truth. This is a QA assertion/fixture mismatch, not evidence of a different product state.
750 - **Correction:** replace the mock RPC counter with a direct persisted graph assertion: exactly one `voucherType='reversal'`, `sourceType='reversal'`, `sourceId=original journal voucher` and status `posted`. Keep every desired product assertion unchanged: original immutable source/lines and reversal retained; new correction source and linked voucher must be DRAFT; no posted correction; balanced lines; draft excluded from effective posted balance. Any missing/duplicate/unposted reversal remains an unexpected CI failure. No product behavior or expected state weakened.
751 - Re-run Quality/WP1/WP2/Security on the successor exact code SHA before accepting this QA checkpoint.
752 +
753 +### 2026-11-23 — FIN-QA-ISSUE238-INVENTORY-COUNT-SAVE / pre-code decision
754 +- **User request:** continue Finora work, with real evidence and no duplicate accounting implementation. **Verified inherited baseline:** [Draft PR239](https://github.com/davoodmehraban89/Factor-easy/pull/239) exact SHA `47f482f389f955824f653942cd14754c376eae50`, all four exact-SHA workflows Quality #45065985973 (**264 Chromium/4 Pages PASS**), WP1 #45065985938 (both jobs PASS; staged baseline deliberately RED), WP2 #45065985935 (real-JWT sale/purchase approval P0 defects **still present**), Security #45065985921 PASS. Protected `main` remains `dab1a45fcfc4f12e675cfe055e477138cd3e99fa`. Issues #216/#229/#238 remain OPEN.
755 +- **New source-verified uncovered producer:** loaded `js/phase5-enterprise.js::p5SaveCount` creates an `inventoryCounts` row with `status:'posted'` on *Save*, inserts a `stockMovements` adjustment also posted, then `p5PostInventoryValue` calls `jeCreateDraft` followed by `jePost` and sets journal/accounting status posted when positive average cost exists. `p5Stock` counts the posted stock movement. This is distinct from explicit operational `p5PostMovement` and from receipt/payment/expense/income Save checks in PR239. It is **source-only current staged code evidence**, not a real JWT server acceptance result.
756 +- **Bounded QA-only plan:** new isolated branch `qa/finora-issue238-inventory-count-browser-red-20261123` from PR239 exact SHA, Draft child PR stacked on PR239; extend **existing** `scripts/accounting-document-workflow.spec.js` and reuse its loaded authenticated Playwright + synthetic Supabase harness. Seed only synthetic QA product buy cost and inventory-adjustment posting accounts. Drive actual `p5SaveCount()` DOM button with positive count variance, and inspect **persisted** count, movement, linked journal, balanced lines, stock quantity and effective posted ledger.
757 +- **Desired acceptance:** Save count must persist source-linked balanced DRAFT journal with corresponding non-effective draft stock adjustment; do not recognize posted voucher, stock change or postedAt before a distinct server-authorized accounting Finalize. Preserve a single movement/voucher graph and company scope; allow draft provisional number, disallow posted status/postedAt. **Known current defect:** count, movement and journal immediately POSTED, stock quantity and posted ledger changed. Classify as expected PRODUCT RED only after an exact broken fingerprint; any orphan, missing, duplicate, unbalanced or inconsistent third state is real CI FAILURE. A truly corrected linked-draft result is a normal PASS.
758 +- **Ownership:** Codex-main alone owns financial JS, SQL/RPC/schema/migrations, RLS/Auth/grants and release. This QA branch may only change `scripts/accounting-document-workflow.spec.js`, append-only `PROJECT_STATE.md` and `docs/EXECUTION_STATUS.md`. No `main`, merge, production, hosted DB or historical financial records. Run exact-head Quality/WP1/WP2/Security if triggered, record evidence without inflating phase completion.
docs/EXECUTION_STATUS.md
+5
@@ -231,3 +231,8 @@
231 - Quality روی SHA `3c9906b8` دو آزمون جدید اصلاح دریافت/پرداخت را به‌دلیل شمارندهٔ مصنوعی `server.reverseCount` رد کرد؛ اما خود لاگ، برگشت سند اصلی و سه سند ذخیره‌شده را نشان داد.
232 - مسیر واقعی برنامه برگشت را با ایجاد و همگام‌سازی سند برگشت محلی انجام می‌دهد و شمارندهٔ RPC آزمایشی را افزایش نمی‌دهد. معیار به‌درستی از شمارنده به گراف ذخیره‌شده تغییر کرد: دقیقاً یک سند reversal متصل به سند اصلی و با وضعیت posted.
233 - معیار محصول تغییر نکرد: سند اصلاحی جدید همچنان باید DRAFT و متوازن باشد و تا قطعی‌سازی مستقل در ماندهٔ قطعی محاسبه نشود. اجرای CI روی SHA بعدی لازم است.
234 +
235 +### ۱۴۰۵/۰۹/۰۲ — برنامهٔ آزمون مستقل انبارگردانی (#238)
236 +- همهٔ گیت‌های QA در [PR239](https://github.com/davoodmehraban89/Factor-easy/pull/239) روی SHA `47f482f389f955824f653942cd14754c376eae50` کامل و موفق شدند؛ بااین‌حال Issue216/229/238 و نقص‌های مالی باز هستند.
237 +- در کد فعال `js/phase5-enterprise.js::p5SaveCount` ثبت شمارش دارای اختلاف، گردش انبار و سند ارزش‌گذاری را بی‌درنگ posted می‌کند. آزمون مستقل با فرم مرورگر و سرور همگام‌سازی ساختگی بررسی می‌کند که ثبت شمارش **نباید** پیش از Finalize مستقل، موجودی قطعی یا دفترکل را تغییر دهد و سند حسابداری متصل باید DRAFT و متوازن بماند.
238 +- آزمون فقط در مجموعهٔ مرورگر موجود اضافه می‌شود؛ هیچ کد اجرایی مالی، SQL، RPC، مجوز، دادهٔ واقعی یا main تغییر نمی‌کند. قبل از تأیید CI روی SHA نهایی ادعای موفقیت ممنوع است.