From be4ea06fdf5dafa1ef42914045168e0f8edc557e Mon Sep 17 00:00:00 2001 From: Guilherme Chaguri Date: Tue, 29 Nov 2022 18:18:47 -0300 Subject: [PATCH 1/2] (Bug) Fix reservations count from spaces in availabilities export --- app/views/exports/availabilities_index.xlsx.axlsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/exports/availabilities_index.xlsx.axlsx b/app/views/exports/availabilities_index.xlsx.axlsx index c08414983..58748e4c4 100644 --- a/app/views/exports/availabilities_index.xlsx.axlsx +++ b/app/views/exports/availabilities_index.xlsx.axlsx @@ -88,7 +88,7 @@ if Setting.get('spaces_module') ((a.end_at - a.start_at) / slot_duration.minutes).to_i.times do |i| start_at = a.start_at + (i * slot_duration).minutes end_at = a.start_at + (i * slot_duration).minutes + slot_duration.minutes - reservations = a.slots.where(start_at: start_at).count + reservations = a.slots_reservations.where(slots: { start_at: start_at }).count data = [ start_at.to_date, From 4f03f7019982c6944e1aa216516522cb0c1183e1 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Wed, 14 Dec 2022 13:33:26 +0100 Subject: [PATCH 2/2] (doc) updated changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ff42cb86a..742bc28db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Changelog Fab-manager +- Fix a bug: wrong reservations count for spaces in availabilities export (#415) + ## v5.5.7 2022 December 13 - Fix a bug: unable to update/delete a space