From 6ee4737fc4c25a295e220fe09aad72ac6727a5e7 Mon Sep 17 00:00:00 2001 From: Sheppy Date: Mon, 4 Sep 2023 19:20:30 +0000 Subject: [PATCH] fix: prevent rounding errors --- roles/timetracking/files/full-days-85.html.twig | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/roles/timetracking/files/full-days-85.html.twig b/roles/timetracking/files/full-days-85.html.twig index 7c8f528..09cfe54 100644 --- a/roles/timetracking/files/full-days-85.html.twig +++ b/roles/timetracking/files/full-days-85.html.twig @@ -91,13 +91,8 @@ {% for entry in model.calculator.entries %} - {% set duration = entry.duration|duration(isDecimal) %} - {% if entry.fixedRate %} - {% set rate = entry.fixedRate %} - {% set duration = entry.amount/8.5|amount %} - {% else %} - {% set rate = entry.hourlyRate*8.5 %} - {% endif %} + {% set days = entry.duration // (60*60*8.5)%} + {% set rate = entry.hourlyRate*8.5 %}