Skip to content

Commit

Permalink
Bugfix: summed amount in bills were incorrectly added to report
Browse files Browse the repository at this point in the history
  • Loading branch information
Volmarg committed Oct 16, 2019
1 parent 866d6a8 commit c69d90c
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/Repository/Modules/Reports/ReportsRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,15 @@ public function buildPaymentsSummariesForMonthsAndYears() {
SUM(
mpm.money
) +
CASE
WHEN payment_bills.money IS NULL THEN 0
ELSE
payment_bills.money
END,
IF(
DATE_FORMAT(mpm.date,'%Y-%m') = yearAndMonth,
CASE
WHEN payment_bills.money IS NULL THEN 0
ELSE
payment_bills.money
END,
0
),
2) AS money
FROM my_payments_monthly mpm
Expand Down

0 comments on commit c69d90c

Please sign in to comment.