This commit is contained in:
oscar alvarez 2022-03-21 23:30:24 -05:00
parent ef1c4a0291
commit 8f34a4e5c2
4 changed files with 22 additions and 14 deletions

View File

@ -75,6 +75,7 @@ def register():
booking.BookingForecastReport,
booking.RoomsOccupancyReport,
booking.BookingDailyReport,
booking.BookingStatementReport,
folio.Migration,
folio.GuestsListReport,
folio.RegistrationCardReport,

View File

@ -537,7 +537,6 @@ class Booking(Workflow, ModelSQL, ModelView):
for charge in folio.charges:
if not charge.invoice_line and charge.to_invoice:
_charges.append(charge)
print('_charges.... ', _charges)
return _folios, _charges
@classmethod
@ -786,6 +785,7 @@ class Booking(Workflow, ModelSQL, ModelView):
def get_pending_to_pay(self, name):
if self.total_amount:
return self.total_amount - (self.total_advance or 0)
return 0
def get_total_amount(self, name):
res = 0
@ -857,6 +857,17 @@ class BookingReport(Report):
return report_context
class BookingStatementReport(Report):
__name__ = 'hotel.booking_statement'
@classmethod
def get_context(cls, records, header, data):
report_context = super().get_context(records, header, data)
user = Pool().get('res.user')(Transaction().user)
report_context['company'] = user.company
return report_context
class SelectRoomsAsk(ModelView):
'Select Rooms Assistant'
__name__ = 'hotel.booking.select_rooms.ask'

View File

@ -210,21 +210,17 @@ this repository contains the full copyright notices and license terms. -->
<field name="action" ref="act_open_booking_invoices_form"/>
</record>
<!--
<record model="ir.action.act_window" id="act_open_booking_operations_form">
<field name="name">Operations</field>
<field name="res_model">hotel.operation</field>
<field name="domain"
eval="[
(Eval('active_id'), '=', 'origin.booking.id'),
]"
pyson="1"/>
<record model="ir.action.report" id="report_booking_statement">
<field name="name">Booking Statement</field>
<field name="model">hotel.booking</field>
<field name="report_name">hotel.booking_statement</field>
<field name="report">hotel/statement.fodt</field>
</record>
<record model="ir.action.keyword" id="act_open_booking_operations_keyword1">
<field name="keyword">form_relate</field>
<record model="ir.action.keyword" id="report_booking_statement_keyword">
<field name="keyword">form_print</field>
<field name="model">hotel.booking,-1</field>
<field name="action" ref="act_open_booking_operations_form"/>
</record> -->
<field name="action" ref="report_booking_statement"/>
</record>
<record model="ir.action.report" id="report_rooms_occupancy">
<field name="name">Rooms Occupancy Report</field>

BIN
statement.fodt Normal file

Binary file not shown.