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

fix: restore JavaScript test file newlines

davoodmehraban89 committed Nov 17, 2026 at 17:16 UTC 0863ef85e443845c5d1c1565be8a464cb4ab7386
1 file changed +6 -1
scripts/commercial-rnd-check.mjs
+6 -1
@@ -17,5 +17,10 @@ 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 -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.');
20 +const purchaseSaveStart=purchase.indexOf('window.purSave=async function(){');
21 +const purchaseSaveEnd=purchase.indexOf('window.purCancelEdit=function(){',purchaseSaveStart);
22 +const purchaseSaveFlow=purchase.slice(purchaseSaveStart,purchaseSaveEnd);
23 +ok(purchaseSaveStart>=0&&purchaseSaveEnd>purchaseSaveStart,'Purchase save flow must remain discoverable.');
24 +ok(purchaseSaveFlow.includes("jeRpcAutoPost('purchase',record.id)"),'Purchase posting must use the authoritative server RPC.');
25 +ok(!purchaseSaveFlow.includes('jePostSourceRecord'),'Purchase posting must not use the legacy client-side source-post path.');
26 console.log('Commercial R&D invariants passed.');