diff --git a/internal/booking/service.go b/internal/booking/service.go index 1b401ce..c546810 100644 --- a/internal/booking/service.go +++ b/internal/booking/service.go @@ -23,7 +23,7 @@ func NewService(db *gorm.DB) *Service { func (bs Service) All() []*Line { bookings := make([]*Line, 0) bs.db.Raw(` - select bookings.id, customer_name, "from", "to", platform, sum(price) as total + select bookings.id, customer_name, "from", "to", platform, sum(price * quantity) as total from bookings join items on bookings.id = items.booking_id group by bookings.id