سامانه صدور فاکتور و حسابداری
Mirrored from https://github.com/davoodmehraban89/Factor-easy.git
Synced Dec 4, 01:45 UTC
test: align commerce and sync invariants with authoritative RPC
davoodmehraban89 committed
Nov 17, 2026 at 17:14 UTC
1cfe76d2baf902ac31e49f0aac2c08d5ee453150
1 file changed
+1
-1
scripts/commercial-rnd-check.mjs
+1
-1
@@ -17,5 +17,5 @@ ok(html.includes('js/commercial-rnd.js'),'Commerce slice must be loaded.');
17
ok(!html.includes('🧾 فاکتور فروش</button>')&&!html.includes('🛒 فاکتور خرید</button>'),'Invoice form must not duplicate sale/purchase shortcut buttons beside the document heading.');
18
ok(!fs.readFileSync('js/ux-hardening-r2.js','utf8').includes('finora-commerce-toolbar'),'Invoice workspace must not duplicate sale/purchase/pre-invoice workflow buttons above the form.');
19
ok(['sale','purchase','pre_invoice','contract_statement'].every(v=>commerce.includes('<option value="'+v+'"')),'Context-specific document selectors must retain existing purchase and sales document types.');
20
-ok(purchase.includes("jePostSourceRecord('purchase',record)"),'Purchase posting must remain automatic.');
20
+const purchaseSaveStart=purchase.indexOf('window.purSave=async function(){');\nconst purchaseSaveEnd=purchase.indexOf('window.purCancelEdit=function(){',purchaseSaveStart);\nconst purchaseSaveFlow=purchase.slice(purchaseSaveStart,purchaseSaveEnd);\nok(purchaseSaveStart>=0&&purchaseSaveEnd>purchaseSaveStart,'Purchase save flow must remain discoverable.');\nok(purchaseSaveFlow.includes("jeRpcAutoPost('purchase',record.id)"),'Purchase posting must use the authoritative server RPC.');\nok(!purchaseSaveFlow.includes('jePostSourceRecord'),'Purchase posting must not use the legacy client-side source-post path.');
21
console.log('Commercial R&D invariants passed.');