Refactory 05

This commit is contained in:
Oscar 2021-10-08 23:18:30 -05:00
parent dbc84af904
commit 27151e1bb4
8 changed files with 18 additions and 15 deletions

View file

@ -15,7 +15,7 @@ from trytond.exceptions import UserError
from trytond.i18n import gettext
from constants import (
STATE_BOOKING, REGISTRATION_STATE, SEGMENT, GUARANTEE, SATISFACTION,
MEDIA, PLAN, SOURCE, INVOICE_METHOD, COMPLEMENTARY,
MEDIA, PLAN, SOURCE, INVOICE_METHOD, COMPLEMENTARY, INVOICE_STATES,
)
STATES = {
@ -451,6 +451,8 @@ class Folio(ModelSQL, ModelView):
__name__ = 'hotel.folio'
booking = fields.Many2One('hotel.booking', 'Booking', ondelete='CASCADE',
select=True)
registration_card = fields.Char('Registration Card', readonly=True,
select=True, help="Unique sequence for card guest registration.")
room = fields.Many2One('hotel.room', 'Room', select=True, states={
'required': Eval('registration_state') == 'check_in',
'readonly': Eval('registration_state') == 'check_in',
@ -511,8 +513,7 @@ class Folio(ModelSQL, ModelView):
invoice_line = fields.Many2One('account.invoice.line', 'Invoice Line')
invoice = fields.Function(fields.Many2One('account.invoice', 'Invoice'),
'get_invoice')
registration_card = fields.Char('Registration Card', readonly=True,
select=True, help="Unique sequence for card guest registration.")
invoice_state = fields.Selection(INVOICE_STATES, 'Invoice State', readonly=True)
@classmethod
def __setup__(cls):
@ -1697,7 +1698,8 @@ class BookingDailyReport(Report):
report_context = super().get_context(records, header, data)
pool = Pool()
Company = pool.get('company.company')
records = BookingFolio.search([
Folio = pool.get('hotel.folio')
records = Folio.search([
('arrival_date', '=', data['date']),
], order=[('room.code', 'ASC')])
@ -1711,14 +1713,6 @@ class HotelCharge(Workflow, ModelSQL, ModelView):
'Hotel Charge'
__name__ = 'hotel.charge'
INVOICE_STATES = [
('', ''),
('pending', 'Pending'),
('in_process', 'In Process'),
('invoiced', 'Invoiced'),
('paid', 'Paid')
]
booking_line = fields.Many2One('', 'Booking Line',
required=True)
service_date = fields.Date('Service Date', select=True, required=True)

View file

@ -92,3 +92,9 @@ COMPLEMENTARY = [
('in_house', 'In House'),
('courtesy', 'Courtesy')
]
INVOICE_STATES = [
('', 'None'),
('invoiced', 'Invoiced'),
('paid', 'Paid'),
]

View file

@ -44,6 +44,8 @@ this repository contains the full copyright notices and license terms. -->
<field name="total_commission"/>
<label name="invoice_line"/>
<field name="invoice_line"/>
<label name="invoice_state"/>
<field name="invoice_state"/>
<separator name="notes" colspan="4"/>
<field name="notes" colspan="4"/>
</page>

View file

@ -13,5 +13,6 @@ this repository contains the full copyright notices and license terms. -->
<field name="total_amount"/>
<field name="host_quantity"/>
<field name="registration_state"/>
<field name="invoice_state"/>
<field name="booking"/>
</tree>

View file

@ -42,6 +42,8 @@ this repository contains the full copyright notices and license terms. -->
</notebook>
<label name="registration_state"/>
<field name="registration_state"/>
<label name="invoice_state"/>
<field name="invoice_state"/>
<button name="bill" string="Bill"
icon="tryton-forward"/>
</form>

View file

@ -13,5 +13,6 @@ this repository contains the full copyright notices and license terms. -->
<field name="total_amount"/>
<field name="host_quantity"/>
<field name="registration_state"/>
<field name="invoice_state"/>
<button name="check_out" string="Check Out"/>
</tree>

View file

@ -16,8 +16,6 @@ this repository contains the full copyright notices and license terms. -->
<field name="price_list" widget="selection"/>
<label name="payment_term"/>
<field name="payment_term"/>
<label name="registration_card"/>
<field name="registration_card"/>
<label name="media"/>
<field name="media"/>
<label name="party_seller"/>

View file

@ -5,7 +5,6 @@ this repository contains the full copyright notices and license terms. -->
<field name="number"/>
<field name="party"/>
<field name="contact"/>
<field name="registration_card"/>
<field name="booking_date" widget="date"/>
<field name="price_list"/>
<field name="total_amount"/>