From e835c6cb3c68021a688de0027daba30565d0bcd2 Mon Sep 17 00:00:00 2001 From: Adamko <33964772+cRaZy92@users.noreply.github.com> Date: Thu, 27 Jul 2023 20:29:14 +0200 Subject: [PATCH] Fixed incorrect sum of the total items price https://github.com/hay-kot/homebox/issues/458 --- backend/internal/data/repo/repo_group.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/internal/data/repo/repo_group.go b/backend/internal/data/repo/repo_group.go index fab543c295..3e5e584f7e 100644 --- a/backend/internal/data/repo/repo_group.go +++ b/backend/internal/data/repo/repo_group.go @@ -233,7 +233,7 @@ func (r *GroupRepository) StatsGroup(ctx context.Context, GID uuid.UUID) (GroupS (SELECT COUNT(*) FROM items WHERE group_items = ? AND items.archived = false) AS total_items, (SELECT COUNT(*) FROM locations WHERE group_locations = ?) AS total_locations, (SELECT COUNT(*) FROM labels WHERE group_labels = ?) AS total_labels, - (SELECT SUM(purchase_price) FROM items WHERE group_items = ? AND items.archived = false) AS total_item_price, + (SELECT SUM(purchase_price*quantity) FROM items WHERE group_items = ? AND items.archived = false) AS total_item_price, (SELECT COUNT(*) FROM items WHERE group_items = ?