From 38a47f4d2740d9a82fc226db9ca609fbf5f1fb1a Mon Sep 17 00:00:00 2001 From: Christian Date: Tue, 23 Dec 2025 15:12:45 +0100 Subject: [PATCH] fix: wizard customer_rate field name mismatch (v1.3.55) - Changed wizard.html to use customer_rate instead of customer_hourly_rate - Fixes issue where wizard displayed default 1200 DKK instead of customer-specific hourly rate - Backend API returns customer_rate field (from TModuleTimeWithContext model) - Frontend now correctly reads customer_rate from API response - Affected lines: 571, 807, 1084 in wizard.html --- app/timetracking/frontend/wizard.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/timetracking/frontend/wizard.html b/app/timetracking/frontend/wizard.html index 92c75ae..a7422c6 100644 --- a/app/timetracking/frontend/wizard.html +++ b/app/timetracking/frontend/wizard.html @@ -568,7 +568,7 @@ } // Get hourly rate (customer rate or default) - const hourlyRate = e.customer_hourly_rate || currentEntry.customer_hourly_rate || defaultHourlyRate; + const hourlyRate = e.customer_rate || currentEntry.customer_rate || defaultHourlyRate; return `
@@ -804,7 +804,7 @@ const response = await fetch(`/api/v1/timetracking/wizard/progress/${currentEntry.customer_id}`); const progress = await response.json(); - const hourlyRate = currentEntry.customer_hourly_rate || defaultHourlyRate; + const hourlyRate = currentEntry.customer_rate || defaultHourlyRate; document.getElementById('context-hourly-rate').textContent = hourlyRate.toFixed(2) + ' DKK'; // Vis antal registreringer (vi har ikke timer-totaler i progress endpointet) @@ -1081,7 +1081,7 @@ // Get billable hours and hourly rate from calculation const billableHours = window.entryBillableHours?.[entryId] || entry.original_hours; - const hourlyRate = window.entryHourlyRates?.[entryId] || entry.customer_hourly_rate || defaultHourlyRate; + const hourlyRate = window.entryHourlyRates?.[entryId] || entry.customer_rate || defaultHourlyRate; // Get travel checkbox state const travelCheckbox = document.getElementById(`travel-${entryId}`);