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

Add accounting engine and company scoping to quality gates

davoodmehraban89 committed Sep 28, 2026 at 15:17 UTC 5c4951f1d1978d5a52fcd62aada14ab7547040af
1 file changed +4 -3
scripts/quality-check.mjs
+4 -3
@@ -10,7 +10,7 @@ if(dup.length)throw new Error('Duplicate static HTML ids: '+dup.join(', '));
10 const requiredIds=['view-dashboard','view-invoices','view-products','view-contacts','view-cheques','view-expenses','invoice-payment-method','contacts-ledger-table-body','printable-invoice'];
11 for(const id of requiredIds)if(!ids.includes(id))throw new Error('Missing required element #'+id);
12
13 -const requiredScripts=['js/core.js','js/sync.js','js/invoices.js','js/print.js','js/contacts.js','js/companies.js','js/projects.js','js/purchases.js','js/operations.js','js/payments.js','js/drilldown.js','js/selfcheck.js'];
13 +const requiredScripts=['js/core.js','js/sync.js','js/invoices.js','js/print.js','js/contacts.js','js/companies.js','js/projects.js','js/purchases.js','js/operations.js','js/payments.js','js/accounting.js','js/drilldown.js','js/selfcheck.js'];
14 if(index.includes('</script>\\n<script'))throw new Error('Literal \\n found between script tags');
15 for(const s of requiredScripts)if(!index.includes(s))throw new Error('Missing script load: '+s);
16
@@ -23,10 +23,11 @@ const all=Object.fromEntries(files.map(n=>[n,fs.readFileSync(path.join(root,'js'
23 const must={
24 'invoices.js':['function commitSaveInvoice','function editInvoice','paymentMethod'],
25 'print.js':['function renderAndPrintDirect','FORMAL_ROWS_PER_PAGE=12','size: A4 portrait','size: A5 landscape'],
26 - 'purchases.js':['window.purSave=function','window.purEdit=function','window.purPrint=function','window.purRefreshProjects=function','pur-payment-method'],
26 + 'purchases.js':['window.purSave=function','window.purEdit=function','window.purPrint=function','window.purRefreshProjects=function','pur-payment-method','companyId'],
27 'projects.js':['editContactProject','deleteContactProject','addSubproject','editSubproject','deleteSubproject','usedExpense'],
28 - 'operations.js':['editContact','editProduct','editCheque','editExpense','deleteInvoice','refreshExpenseProjects','projectId','getMyPayments'],
28 + 'operations.js':['editContact','editProduct','editCheque','editExpense','deleteInvoice','refreshExpenseProjects','projectId','getMyPayments','companyId'],
29 'payments.js':['commitSavePayment','invoiceOutstanding','purchaseOutstanding','amount>outstanding',"direction!=='inbound'","direction!=='outbound'",'projectId',"paymentMethod!=='credit'"],
30 + 'accounting.js':['productMovement','getInventorySnapshot','getProjectFinancials','accrualProfit','cashNet'],
31 'drilldown.js':['openContactLedger','openDashboardDetail','openReportDetail',"status==='cleared'"],
32 'sync.js':['getMyPurchases'],
33 'backup.js':['purchases:getMyPurchases()','payments:getMyPayments()']