From 95103280c3beabcc88d9031f3a2528ec12e19dac Mon Sep 17 00:00:00 2001 From: jtricerolph Date: Thu, 23 Jul 2026 11:33:45 +0000 Subject: [PATCH] =?UTF-8?q?Fix=20employee=20name=20lookup=20=E2=80=94=20us?= =?UTF-8?q?e=20name=20field=20not=20first=5Fname/last=5Fname;=20remove=20t?= =?UTF-8?q?emp=20logs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/lib/workforce.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/backend/src/lib/workforce.js b/backend/src/lib/workforce.js index e66715e..8930edb 100644 --- a/backend/src/lib/workforce.js +++ b/backend/src/lib/workforce.js @@ -76,9 +76,8 @@ async function getDeptNameMap() { async function getUserNameMap() { const all = await wfFetchPaged('/api/v2/users') - if (all.length > 0) console.log('USER_SAMPLE', JSON.stringify(all[0])) return Object.fromEntries( - all.map(u => [String(u.id), `${u.first_name || ''} ${u.last_name || ''}`.trim() || `User ${u.id}`]) + all.map(u => [String(u.id), u.name || `${u.legal_first_name || ''} ${u.legal_last_name || ''}`.trim() || `User ${u.id}`]) ) } @@ -92,9 +91,6 @@ export async function syncActuals(from, to) { const shifts = await wfFetchPaged(path) const [deptNameMap, userNameMap] = await Promise.all([getDeptNameMap(), getUserNameMap()]) - const statusCosts = {} - for (const s of shifts) { statusCosts[s.status] = (statusCosts[s.status] || 0) + parseFloat(s.cost_with_oncosts ?? s.cost ?? 0) } - console.log('SHIFT_STATUS_COSTS', JSON.stringify(statusCosts)) const byDateDept = {} const byDateDeptEmp = {}