mirror of
https://github.com/rjNemo/rentease.git
synced 2026-06-06 02:36:49 +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
|
||||
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).
|
||||
|
|
|
|||
Loading…
Reference in a new issue