From ae65e6c0d81a0b1b71477364e09846f10503419d Mon Sep 17 00:00:00 2001 From: Pablo Date: Mon, 28 Jan 2019 11:15:20 +0100 Subject: [PATCH] [UPD] Show price_room_services_set, pending_amount and invoices_paid --- hotel_calendar/models/bus_hotel_calendar.py | 4 ++-- hotel_calendar/models/inherited_hotel_reservation.py | 11 ++++++----- .../js/views/calendar/hotel_calendar_controller.js | 4 ++-- .../static/src/xml/hotel_calendar_templates.xml | 6 +++--- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/hotel_calendar/models/bus_hotel_calendar.py b/hotel_calendar/models/bus_hotel_calendar.py index cd07b9057..e81ac1385 100644 --- a/hotel_calendar/models/bus_hotel_calendar.py +++ b/hotel_calendar/models/bus_hotel_calendar.py @@ -63,9 +63,9 @@ class BusHotelCalendar(models.TransientModel): 'checkout': vals['checkout'], 'arrival_hour': vals['arrival_hour'], 'departure_hour': vals['departure_hour'], - 'amount_total': vals['amount_total'], + 'price_room_services_set': vals['price_room_services_set'], + 'invoices_paid': vals['invoices_paid'], 'pending_amount': vals['pending_amount'], - 'amount_paid': vals['amount_paid'], 'type': vals['reservation_type'], 'closure_reason': vals['closure_reason'], 'out_service_description': vals['out_service_description'], diff --git a/hotel_calendar/models/inherited_hotel_reservation.py b/hotel_calendar/models/inherited_hotel_reservation.py index b09828a82..5c145ec38 100644 --- a/hotel_calendar/models/inherited_hotel_reservation.py +++ b/hotel_calendar/models/inherited_hotel_reservation.py @@ -109,9 +109,9 @@ class HotelReservation(models.Model): 'checkout': reserv['checkout'], 'arrival_hour': reserv['arrival_hour'], 'departure_hour': reserv['departure_hour'], - 'amount_total': reserv['amount_total'], + 'price_room_services_set': reserv['price_room_services_set'], + 'invoices_paid': reserv['invoices_paid'], 'pending_amount': reserv['pending_amount'], - 'amount_paid': reserv['amount_total'] - (reserv['pending_amount'] or 0.0), 'type': reserv['reservation_type'] or 'normal', 'closure_reason': reserv['closure_reason'], 'out_service_description': reserv['out_service_description'] @@ -189,8 +189,9 @@ class HotelReservation(models.Model): hr.id, hr.room_id, hr.adults, hr.children, hr.checkin, hr.checkout, hr.reserve_color, hr.reserve_color_text, hr.splitted, hr.parent_reservation, hr.overbooking, hr.state, hr.real_checkin, hr.real_checkout, hr.out_service_description, hr.arrival_hour, hr.departure_hour, hr.channel_type, + hr.price_room_services_set, - hf.id as folio_id, hf.name as folio_name, hf.reservation_type, hf.amount_total, hf.pending_amount, + hf.id as folio_id, hf.name as folio_name, hf.reservation_type, hf.invoices_paid, hf.pending_amount, rp.mobile, rp.phone, rp.email, rp.name as partner_name, @@ -415,9 +416,9 @@ class HotelReservation(models.Model): 'state': self.state, 'fix_days': self.splitted, 'overbooking': self.overbooking, - 'amount_total': self.folio_id.amount_total, + 'price_room_services_set': self.price_room_services_set, + 'invoices_paid': self.folio_id.invoices_paid, 'pending_amount': self.folio_id.pending_amount, - 'amount_paid': self.folio_id.amount_total - self.folio_id.pending_amount, 'reservation_type': self.reservation_type or 'normal', 'closure_reason': self.closure_reason_id.name, 'out_service_description': self.out_service_description diff --git a/hotel_calendar/static/src/js/views/calendar/hotel_calendar_controller.js b/hotel_calendar/static/src/js/views/calendar/hotel_calendar_controller.js index d57898dff..c5a40b90d 100644 --- a/hotel_calendar/static/src/js/views/calendar/hotel_calendar_controller.js +++ b/hotel_calendar/static/src/js/views/calendar/hotel_calendar_controller.js @@ -754,9 +754,9 @@ var PMSCalendarController = AbstractController.extend({ 'checkout_day_of_week': HotelCalendar.toMomentUTC(tp['real_dates'][1], '').format("dddd"), 'arrival_hour': tp['arrival_hour'], 'departure_hour': tp['departure_hour'], - 'amount_total': Number(tp['amount_total']).toLocaleString(), + 'price_room_services_set': Number(tp['price_room_services_set']).toLocaleString(), + 'invoices_paid': Number(tp['invoices_paid']).toLocaleString(), 'pending_amount': Number(tp['pending_amount']).toLocaleString(), - 'amount_paid': Number(tp['amount_paid']).toLocaleString(), 'reservation_type': tp['type'], 'closure_reason': tp['closure_reason'], 'out_service_description': tp['out_service_description'], diff --git a/hotel_calendar/static/src/xml/hotel_calendar_templates.xml b/hotel_calendar/static/src/xml/hotel_calendar_templates.xml index 703a8a70a..bd2afec55 100644 --- a/hotel_calendar/static/src/xml/hotel_calendar_templates.xml +++ b/hotel_calendar/static/src/xml/hotel_calendar_templates.xml @@ -123,7 +123,7 @@

- +

Adults:

Children:

@@ -135,11 +135,11 @@

Folio Pending

-

+

-

+

Total Paid