mirror of
https://github.com/rjNemo/rentease.git
synced 2026-06-12 13:46:51 +00:00
fix: only report the non canceled bookings
This commit is contained in:
parent
106aa475d6
commit
041b77c205
1 changed files with 2 additions and 0 deletions
|
|
@ -52,6 +52,7 @@ func (ps *PgStore) List(from, to time.Time) ([]*booking.Line, error) {
|
||||||
from bookings
|
from bookings
|
||||||
join items on bookings.id = items.booking_id
|
join items on bookings.id = items.booking_id
|
||||||
where "to" between ? and ?
|
where "to" between ? and ?
|
||||||
|
and canceled = false
|
||||||
group by bookings.id
|
group by bookings.id
|
||||||
order by id desc;
|
order by id desc;
|
||||||
`, from, to).
|
`, from, to).
|
||||||
|
|
@ -69,6 +70,7 @@ func (ps *PgStore) CardTotal(from, to time.Time) (float64, error) {
|
||||||
from bookings
|
from bookings
|
||||||
join items on bookings.id = items.booking_id
|
join items on bookings.id = items.booking_id
|
||||||
where "to" between ? and ?
|
where "to" between ? and ?
|
||||||
|
and canceled = false
|
||||||
and payment_method = 'Card'
|
and payment_method = 'Card'
|
||||||
group by booking_id) as t;
|
group by booking_id) as t;
|
||||||
`, from, to).
|
`, from, to).
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue