From 64a5f8b34da6b68524b8269ee9bd73b243ed539d Mon Sep 17 00:00:00 2001 From: Joshua Gort Date: Fri, 26 Jan 2024 17:33:49 +0100 Subject: [PATCH] fix cases where event_product is deleted --- .../java/ch/wisv/events/core/repository/OrderRepository.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/ch/wisv/events/core/repository/OrderRepository.java b/src/main/java/ch/wisv/events/core/repository/OrderRepository.java index 3af105a8..d9b8cb7e 100644 --- a/src/main/java/ch/wisv/events/core/repository/OrderRepository.java +++ b/src/main/java/ch/wisv/events/core/repository/OrderRepository.java @@ -151,7 +151,7 @@ AND EXTRACT(MONTH FROM O.PAID_AT) = :month WHERE (:includeFreeProducts OR OP.PRICE > 0) ) B INNER JOIN PRODUCT P ON B.PRODUCT_ID = P.ID - INNER JOIN EVENT_PRODUCTS EP ON P.ID = EP.PRODUCTS_ID - INNER JOIN EVENT E ON EP.EVENT_ID = E.ID""", nativeQuery = true) + LEFT JOIN EVENT_PRODUCTS EP ON P.ID = EP.PRODUCTS_ID + LEFT JOIN EVENT E ON EP.EVENT_ID = E.ID""", nativeQuery = true) List findallPaymentsByMonth(@Param("month") Integer month, @Param("year") Integer year, @Param("paymentMethods") Collection paymentMethods, @Param("includeFreeProducts") boolean includeFreeProducts); }