fix: only report the non canceled bookings

This commit is contained in:
Ruidy 2024-12-24 18:17:45 +01:00
parent 106aa475d6
commit 041b77c205
No known key found for this signature in database
GPG key ID: E00F51288CB857CC

View file

@ -52,6 +52,7 @@ func (ps *PgStore) List(from, to time.Time) ([]*booking.Line, error) {
from bookings
join items on bookings.id = items.booking_id
where "to" between ? and ?
and canceled = false
group by bookings.id
order by id desc;
`, from, to).
@ -69,6 +70,7 @@ func (ps *PgStore) CardTotal(from, to time.Time) (float64, error) {
from bookings
join items on bookings.id = items.booking_id
where "to" between ? and ?
and canceled = false
and payment_method = 'Card'
group by booking_id) as t;
`, from, to).