سامانه صدور فاکتور و حسابداری
Document Phase 4 accounting and acceptance contract
davoodmehraban89 committed
Sep 29, 2026 at 12:51 UTC
5c3ac08901083489e04c212b5a2562cc118bd637
1 file changed
+41
docs/PHASE_4_REDESIGN_VERIFICATION.md
new
+41
@@ -0,0 +1,41 @@
1
+# Phase 4 Redesign Verification — Projects & Contracting
2
+
3
+Date: 2026-09-29
4
+
5
+## Scope delivered
6
+- First-class contracts linked to global projects and counterparties.
7
+- Employer, contractor and subcontractor relationships.
8
+- Controlled contract lifecycle and approved amendments.
9
+- Configurable deduction schedules: retention, insurance, withholding tax, advance recovery, penalties and other.
10
+- Guarantees with issuer, amount, expiry, extension and release event history.
11
+- Contractor statements with calculated deductions/net amount.
12
+- Double-entry posting for approved contractor statements with project/counterparty dimensions.
13
+- Reversal through the Phase 3 immutable voucher reversal mechanism.
14
+- Contract/project profitability view from posted statements, project purchases and expenses.
15
+- Audit trail for Phase 4 lifecycle events.
16
+- Cloud sync and JSON backup/restore collections.
17
+- Referential guards for contacts/projects used by contracts.
18
+
19
+## Accounting contract
20
+A contract or operational statement is a source document, not accounting truth. A statement becomes accounting truth only after posting a balanced journal voucher. Posted vouchers remain immutable and corrections use reversal. Source IDs and source versions flow into the journal engine. Phase 3 fiscal locks, dimension validation and duplicate source/version protection remain mandatory.
21
+
22
+Default contractor-statement posting for the current company-as-contractor workflow:
23
+- Debit accounts receivable (1102) for net receivable.
24
+- Debit retention receivable (1105) for deductions when present.
25
+- Credit contract revenue (4301), falling back to standard revenue when 4301 is unavailable.
26
+The contracting template provides 4301 and 1105.
27
+
28
+## Persistence
29
+Supabase migration: `phase4_contracting_collections`.
30
+Collections: contracts, contractAmendments, contractParties, contractDeductions, guarantees, guaranteeEvents, contractStatements, phase4Audit.
31
+
32
+## Acceptance gates
33
+- Syntax/quality checks.
34
+- Phase 4 behavioral reconciliation test.
35
+- Security/CodeQL.
36
+- Pages deployment.
37
+- Supabase security/performance advisors after migration.
38
+- Repository state updated with exact final evidence.
39
+
40
+## Known product boundary
41
+Guarantee memorandum/off-balance journal posting remains optional by roadmap wording; guarantee lifecycle and audit are implemented, while no mandatory accounting entry is generated merely by issuing a guarantee.