sale order
SAP-ERP Portal CI/CD / build (push) Successful in 3m57s

This commit is contained in:
John
2026-10-05 18:45:17 +05:30
parent e725a6571b
commit eead8f5ffd
129 changed files with 14252 additions and 452 deletions
+9 -1
View File
@@ -151,7 +151,15 @@ router.get('/', verifyToken, requireApprovalStep('man_power:entry', 'view'), asy
docs.forEach(d => { d.tabCounts = byDoc[d.docEntry] || {}; d.totalRows = Object.values(d.tabCounts).reduce((a, b) => a + b, 0); });
} catch (e) { console.warn('[MANPOWER] tab counts failed (non-fatal):', e.message); }
}
res.json({ success: true, data: docs });
// Genuine total (same filter, no paging) — drives "Page X of Y" on the
// client instead of an open-ended "Page X".
let total = null;
try {
const c = await sap().sapRequest('GET', `Production_Data/$count${filter ? '?' + filter.slice(1) : ''}`, null, co);
const n = Number(c);
if (!isNaN(n)) total = n;
} catch (e) { console.warn('[MANPOWER] $count failed — pager will show no total:', e.message); }
res.json({ success: true, data: docs, total });
} catch (err) { res.status(500).json({ success: false, message: err.message }); }
});