سامانه صدور فاکتور و حسابداری
Mirrored from https://github.com/davoodmehraban89/Factor-easy.git
Synced Dec 4, 13:00 UTC
docs(expense): record owner continuation, scope, risk and baseline before implementation
davoodmehraban89 committed
Oct 14, 2026 at 11:44 UTC
da2f97f01ae7bab6e9f2a70c6a036d647dacae68
1 file changed
+8
PROJECT_STATE.md
+8
@@ -254,6 +254,14 @@ The latest user message is the sole source of new instructions. Read AGENTS.md t
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
+### 2026-10-14 Owner continuation — expense/income same-form correction phase 3 — STARTED
258
+- Latest owner instruction «ادامه.و تکمیل کن» continues the actual in-scope accounting pilot amendment initiative; complete next missing **expense/income source** category with in-place employee UX while keeping previous sale, purchase, manual journal and unallocated receipt/payment releases intact. Do not portray this bounded slice as all remaining ERP, cheque/settlement/tax integration or V1 owner acceptance.
259
+- **Live baseline:** main `c5a1a93dc13f1cf39dc55d0a47a75a35d7ef50c5`, exact-main Quality `38530530684`, Security `38530530636`, Release Gate `38530911178`, gated Pages `38531000314` all SUCCESS. Live Supabase `hcsixhqbyuhpshfwqpjx` `ACTIVE_HEALTHY`. PRs #6, #39, #40, #58 and obsolete #129 open; do not merge them during this feature. Underlying F0-01 owner affected-ISP login, two-user isolation, real printer and finance acceptance remain unverified.
260
+- **Confirmed current code:** `js/expenses.js` creates posted `expense`/`income` `jePostSourceRecord` but has **no edit/cancel flow**; it renders 4 cells despite the existing 7-column expense table, with existing `expense-edit-cancel-btn` unused. `js/accounting.js` project totals sum raw expenses/income and would double count internal correction records. Existing `jeReverse` + source-version posting guard and `finora_sync_records` must be preserved.
261
+- **Proposed bounded delivery:** one visible current expense/income row and original form; user click اصلاح→prefill→cancel creates no journal entry; allow adjusting amount, description and category while holding immutable company, kind, contact/project, original business date. On Save stage balanced posted reversal + new posted source version before async boundary, send a single sync RPC batch, require acknowledged result; on error never claim successful posting or blindly retry. Audited cancel is reversal, not physical deletion. Block legacy unlinked, cross-company, locked fiscal years, noncurrent or invalid source. Central مدیریت اسناد must include expense/income table; project totals should exclude superseded/reversed originals and count only the current active logical version. No production customer rows, SQL schema/Auth/RLS/roles or paid/external messaging.
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
## Current change ledger
266
| 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. |
267