diff --git a/booking.py b/booking.py index 89ef2d2..f852d89 100644 --- a/booking.py +++ b/booking.py @@ -1479,9 +1479,24 @@ class GuestsListReport(Report): rooms = Room.search_read([]) _rooms_occupied = len(set(rooms_occupied)) - occupancy_rate = round(_rooms_occupied / len(rooms), 2) + num_rooms = len(rooms) + if num_rooms: + occupancy_rate = round(_rooms_occupied / num_rooms, 2) + else: + occupancy_rate = 0 print('operations ...', operations) - report_context['records'] = operations + operations_ = [] + for op in operations: + for guest in op.guests: + operations_.append({ + 'room': op.room.code, + 'guest': guest.party.name, + 'party': op.party.code, + 'start_date': op.start_date, + 'end_date': op.end_date, + 'nights_quantity': op.nights_quantity, + }) + report_context['records'] = operations_ report_context['total_rooms'] = _rooms_occupied report_context['total_guests'] = sum(total_guests) report_context['occupancy_rate'] = occupancy_rate diff --git a/booking.xml b/booking.xml index 07f7dea..d443c65 100644 --- a/booking.xml +++ b/booking.xml @@ -280,7 +280,7 @@ this repository contains the full copyright notices and license terms. --> Rooms Occupancy Report hotel.rooms_occupancy.report - hotel/rooms_occupancy.ods + hotel/rooms_occupancy.fods ods @@ -299,7 +299,7 @@ this repository contains the full copyright notices and license terms. --> Booking Forecast Report hotel.booking_forecast.report - hotel/booking_forecast.ods + hotel/booking_forecast.fods ods @@ -331,7 +331,7 @@ this repository contains the full copyright notices and license terms. --> Guests List Report hotel.guests_list.report - hotel/guests_list.ods + hotel/guests_list.fods ods @@ -356,7 +356,7 @@ this repository contains the full copyright notices and license terms. --> Booking Daily Report hotel.booking_daily.report - hotel/booking_daily.ods + hotel/booking_daily.fods ods diff --git a/code_city_migrations.ods b/code_city_migrations.fods similarity index 100% rename from code_city_migrations.ods rename to code_city_migrations.fods diff --git a/guests_list.fods b/guests_list.fods index f2e163a..b139c4d 100644 Binary files a/guests_list.fods and b/guests_list.fods differ diff --git a/migration_report.ods b/migration_report.fods similarity index 100% rename from migration_report.ods rename to migration_report.fods diff --git a/occupation_global.ods b/occupation_global.fods similarity index 100% rename from occupation_global.ods rename to occupation_global.fods diff --git a/operation.xml b/operation.xml index f537b56..7eab3ad 100644 --- a/operation.xml +++ b/operation.xml @@ -170,7 +170,7 @@ this repository contains the full copyright notices and license terms. --> Migration Report hotel.migration - hotel/migration_report.ods + hotel/migration_report.fods ods