Created a script to update the csv imports that don't have the date

This commit is contained in:
Jonas Linter
2025-11-20 11:14:07 +01:00
parent d83f4c2f38
commit 7918cc1489
6 changed files with 1926 additions and 1158 deletions

View File

@@ -9,25 +9,25 @@ select sum(room.total_revenue::float)
where con.reservation_id is not null and room.total_revenue is not null
and res.start_date <= room.arrival_date + INTERVAL '7 days'
;
```
```
select res.created_at, con.reservation_date, res.start_date, room.arrival_date,res.end_date,
select res.created_at,directly_attributable ,con.reservation_date, res.start_date, room.arrival_date,res.end_date,
room.departure_date, reservation_type, booking_channel, advertising_medium,
guest_first_name,guest_last_name, total_revenue,
guest_first_name,guest_last_name, total_revenue,is_regular,
room.room_status
from alpinebits.conversions as con
join alpinebits.conversion_rooms as room on room.conversion_id = con.id
join alpinebits.reservations as res on res.id = con.reservation_id
join alpinebits.conversion_guests as guest on guest.guest_id = con.guest_id
where con.reservation_id is not null and room.total_revenue is not null
and res.start_date <= room.arrival_date + INTERVAL '7 days'
order by reservation_date;
@@ -63,4 +63,21 @@ select round(sum(room.total_revenue::numeric)::numeric, 3), con.advertising_medi
;
```
```
select sum(room.total_revenue::float), is_regular
from alpinebits.conversions as con
join alpinebits.conversion_rooms as room on room.conversion_id = con.id
join alpinebits.reservations as res on res.id = con.reservation_id
join alpinebits.conversion_guests as g on g.guest_id = con.guest_id
where room.total_revenue is not null
and directly_attributable = true
group by is_regular
;
```