mirror of
https://bitbucket.org/presik/trytonpsk-hotel.git
synced 2023-12-14 07:52:52 +01:00
Refactory 05
This commit is contained in:
parent
dbc84af904
commit
27151e1bb4
8 changed files with 18 additions and 15 deletions
18
booking.py
18
booking.py
|
@ -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)
|
||||
|
|
|
@ -92,3 +92,9 @@ COMPLEMENTARY = [
|
|||
('in_house', 'In House'),
|
||||
('courtesy', 'Courtesy')
|
||||
]
|
||||
|
||||
INVOICE_STATES = [
|
||||
('', 'None'),
|
||||
('invoiced', 'Invoiced'),
|
||||
('paid', 'Paid'),
|
||||
]
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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"/>
|
||||
|
|
|
@ -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"/>
|
||||
|
|
Loading…
Reference in a new issue