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

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

docs(expense): record delivered same-form correction scope and unverified QA gates

davoodmehraban89 committed Oct 14, 2026 at 11:49 UTC c16f272172a5db50b944b49675a0a710a5c11621
1 file changed +6
PROJECT_STATE.md
+6
@@ -262,6 +262,12 @@ The latest user message is the sole source of new instructions. Read AGENTS.md t
262 - **Required evidence:** isolated authenticated-mock Chromium editing from central manager, cancel/no ledger mutation, server-ack save, original voucher/lines untouched, balanced compensator+new posting, one visible row and project total after reload; cancelled status and fiscal/tenant guards; failed RPC no partial persisted source. Full original Golden + 3 disposable PostgreSQL + Security/CodeQL, PR-head and exact-main Quality/Release/Pages before calling released. Owner's real browser finance acceptance OPEN.
263 - Rollback runtime by targeted PR revert; legitimate financial reversal entries created by actual future users cannot be physically erased by code revert.
264
265 +### 2026-10-14 Expense/income same-form correction — 5/5 source+test syntax PASS, QA PENDING
266 +- **Implementation on isolated branch:** `js/expenses.js` adds posted-source correction for income/expense with `expensePostingStatus`, `expenseCurrentVisible`, `expenseVisibleRecords`, `expenseEffectiveRecords`, `expenseCorrectionEligibility`, `expenseAmendPosted`, `expenseCancelPosted` and in-form `editExpense`/`cancelExpenseEdit`. Employee sees one active expense/income entry and edits the existing form without side effects on open/cancel. On Save it verifies current posted source-voucher, owner/company, open fiscal year, immutable kind/contact/project, positive amount and valid posting profile. A balanced compensating reversal plus new posted source revision are synchronously staged prior to the first async boundary and sent as one `finora_sync_records` RPC; existing posted history is untouched. UI blocks button during pending commit and never claims success before server acknowledgment. Cancellation reverses bookkeeping without deleting original or reversing a real external transfer. Legacy unlinked source histories stay in manual reconciliation.
267 +- **Presentation & reports:** existing 7-column `#expenses-ledger-table-body` now filled correctly with actions and one current logical record; `js/journal-ui.js` adds expense/income register in central `حسابداری ← مدیریت اسناد`, `js/document-management.js` routes «اصلاح» to existing `view-expenses` form and exposes traceable cancellation. `js/accounting.js` project totals now use effective current income/expense only, preventing double-counting of reversed originals.
268 +- **QA authored:** three isolated Chrome journeys in `scripts/accounting-document-workflow.spec.js` cover expense initial→same-form opening/cancel zero financial writes→single-transaction revision→original lines unchanged, 3 balanced vouchers, one visible register row and current project amount across reload; income post→amend→cancel and fiscal lock denial; reject change of posted source kind and simulate RPC failure with no partial server commit/false success. Fixture gains minimal synthetic expense and other-income accounts. All **5/5 actual branch JS/Playwright files V8 syntax PASS**. Full Chromium Golden 3 disposable DB Security and exact-main Pages **PENDING**; do not merge if failed.
269 +- **Known limitations:** existing automatic first-post flow preserved, only source kind/category/amount/description first-party contract supported; company, fiscal date, contact, project cannot be reassigned in posted correction. External cheques, invoices linked to settlements, tax documents and bank rec require their own independently tested workflows. Supabase SQL DDL/DML/Auth/RLS/roles/prod financial records unchanged. Client-level sync acknowledgment is not proof of concurrent update safety or lost-reply exactly-once. OWNER LIVE ACCEPTANCE OPEN; F0-01 issue remains open.
270 +
271 ## Current change ledger
272 | 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. |
273