From 10d63ae286a5f4819c5da62dd98a86414cab17d5 Mon Sep 17 00:00:00 2001 From: Jonathan Rosenbaum Date: Fri, 26 Oct 2018 20:51:13 +0000 Subject: [PATCH] Corrects the report math for stats_userhours_season and stats_userhours_year as pointed out at #42. --- stats/stats_userhours_season.php | 2 +- stats/stats_userhours_year.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/stats/stats_userhours_season.php b/stats/stats_userhours_season.php index bbdc26b..800e87d 100644 --- a/stats/stats_userhours_season.php +++ b/stats/stats_userhours_season.php @@ -18,7 +18,7 @@ default: mysql_select_db($database_YBDB, $YBDB); $query_Recordset1 = "SELECT * FROM (SELECT contacts.contact_id, CONCAT(last_name, ', ', first_name, ' ',middle_initial) AS full_name, COUNT(shop_hours.contact_id) as sort_visits, -ROUND(SUM(HOUR(SUBTIME( TIME(time_out), TIME(time_in))) + MINUTE(SUBTIME( TIME(time_out), TIME(time_in)))/60)) AS sort_hours +ROUND(SUM(HOUR(TIMEDIFF( time_out, time_in)) + MINUTE(TIMEDIFF( time_out, time_in))/60)) AS sort_hours FROM shop_hours LEFT JOIN contacts ON shop_hours.contact_id = contacts.contact_id LEFT JOIN shop_user_roles ON shop_hours.shop_user_role = shop_user_roles.shop_user_role_id diff --git a/stats/stats_userhours_year.php b/stats/stats_userhours_year.php index 9d988a1..0c7ed71 100644 --- a/stats/stats_userhours_year.php +++ b/stats/stats_userhours_year.php @@ -20,7 +20,7 @@ $query_Recordset1 = "SELECT * FROM (SELECT contacts.contact_id, CONCAT(last_name, ', ', first_name, ' ',middle_initial) AS full_name, COUNT(shop_hours.contact_id) as sort_visits, -ROUND(SUM(HOUR(SUBTIME( TIME(time_out), TIME(time_in))) + MINUTE(SUBTIME( TIME(time_out), TIME(time_in)))/60)) AS sort_hours +ROUND(SUM(HOUR(TIMEDIFF( time_out, time_in)) + MINUTE(TIMEDIFF( time_out, time_in))/60)) AS sort_hours FROM shop_hours LEFT JOIN contacts ON shop_hours.contact_id = contacts.contact_id LEFT JOIN shop_user_roles ON shop_hours.shop_user_role = shop_user_roles.shop_user_role_id