Skip to content

Commit 10c4c7f

Browse files
cRaZy92Allram
authored andcommitted
Fixed incorrect sum of the total items price
hay-kot#458
1 parent 9fa17be commit 10c4c7f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: backend/internal/data/repo/repo_group.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ func (r *GroupRepository) StatsGroup(ctx context.Context, GID uuid.UUID) (GroupS
233233
(SELECT COUNT(*) FROM items WHERE group_items = ? AND items.archived = false) AS total_items,
234234
(SELECT COUNT(*) FROM locations WHERE group_locations = ?) AS total_locations,
235235
(SELECT COUNT(*) FROM labels WHERE group_labels = ?) AS total_labels,
236-
(SELECT SUM(purchase_price) FROM items WHERE group_items = ? AND items.archived = false) AS total_item_price,
236+
(SELECT SUM(purchase_price*quantity) FROM items WHERE group_items = ? AND items.archived = false) AS total_item_price,
237237
(SELECT COUNT(*)
238238
FROM items
239239
WHERE group_items = ?

0 commit comments

Comments
 (0)