mirror of
https://bitbucket.org/presik/trytonpsk-hotel.git
synced 2023-12-14 07:52:52 +01:00
Fix
This commit is contained in:
parent
2497d76753
commit
389719afe1
7 changed files with 22 additions and 23 deletions
15
booking.py
15
booking.py
|
@ -372,11 +372,12 @@ class Booking(Workflow, ModelSQL, ModelView):
|
|||
@ModelView.button
|
||||
def bill(cls, records):
|
||||
for rec in records:
|
||||
cls.bill_to_channel()
|
||||
cls.create_invoice(rec.lines)
|
||||
cls.check_finished(records)
|
||||
|
||||
@classmethod
|
||||
@ModelView.button
|
||||
# @ModelView.button
|
||||
def bill_to_channel(cls, records):
|
||||
|
||||
for rec in records:
|
||||
|
@ -855,9 +856,13 @@ class Booking(Workflow, ModelSQL, ModelView):
|
|||
return res
|
||||
|
||||
def get_channel_commission(self, name):
|
||||
res = sum(line.commission_amount for line in self.lines if
|
||||
line.commission_amount)
|
||||
return res
|
||||
res = [line.commission_amount for line in self.lines if line.commission_amount]
|
||||
total_commission = sum(res)
|
||||
base_comm = [folio.on_change_with_room_amount() for folio in self.lines]
|
||||
for comm in self.extra_commissions:
|
||||
extras = sum(base_comm) * Decimal(comm.commission / 100)
|
||||
res.append(extras)
|
||||
return sum(res)
|
||||
|
||||
def send_email_to(self):
|
||||
pool = Pool()
|
||||
|
@ -1301,7 +1306,7 @@ class BookingDailyReport(Report):
|
|||
], order=[('room.code', 'ASC')])
|
||||
|
||||
report_context['records'] = records
|
||||
report_context['company'] = Company(data['company']).party.name
|
||||
report_context['company'] = Company(data['company'])
|
||||
report_context['date'] = data['date']
|
||||
return report_context
|
||||
|
||||
|
|
Binary file not shown.
3
folio.py
3
folio.py
|
@ -306,7 +306,8 @@ class Folio(ModelSQL, ModelView):
|
|||
res = value['base'] + value['amount']
|
||||
return res
|
||||
|
||||
@fields.depends('unit_price', 'nights_quantity', 'arrival_date', 'departure_date')
|
||||
@fields.depends('unit_price', 'nights_quantity', 'arrival_date',
|
||||
'departure_date')
|
||||
def on_change_with_room_amount(self, name=None):
|
||||
res = 0
|
||||
if self.unit_price and self.nights_quantity:
|
||||
|
|
|
@ -33,10 +33,8 @@ this repository contains the full copyright notices and license terms. -->
|
|||
<label name="estimated_arrival_time"/>
|
||||
<field name="estimated_arrival_time"/>
|
||||
<notebook colspan="6">
|
||||
<page string="Charges" id="hotel_charges">
|
||||
<field name="charges" colspan="4"/>
|
||||
</page>
|
||||
<page string="Guests" id="hotel_guests">
|
||||
<page string="Charges and Guests" id="hotel_charges">
|
||||
<field name="charges" colspan="4"/>
|
||||
<field name="guests" colspan="4"/>
|
||||
</page>
|
||||
<page string="Stock" id="stock">
|
||||
|
|
|
@ -35,10 +35,8 @@ this repository contains the full copyright notices and license terms. -->
|
|||
<label name="estimated_arrival_time"/>
|
||||
<field name="estimated_arrival_time"/>
|
||||
<notebook colspan="6">
|
||||
<page string="Charges" id="hotel_charges">
|
||||
<field name="charges" colspan="4"/>
|
||||
</page>
|
||||
<page string="Guests" id="hotel_guests">
|
||||
<page string="Charges and Guests" id="hotel_charges">
|
||||
<field name="charges" colspan="4"/>
|
||||
<field name="guests" colspan="4"/>
|
||||
</page>
|
||||
<page string="Additional Info" id="folio_additional_info">
|
||||
|
|
|
@ -22,10 +22,12 @@ this repository contains the full copyright notices and license terms. -->
|
|||
<field name="channel" widget="selection"/>
|
||||
<label name="ota_booking_code"/>
|
||||
<field name="ota_booking_code"/>
|
||||
<label name="channel_paymode"/>
|
||||
<field name="channel_paymode"/>
|
||||
<label name="price_list"/>
|
||||
<field name="price_list" widget="selection"/>
|
||||
<button name="select_rooms" string="Select Rooms"
|
||||
icon="tryton-open" colspan="4"/>
|
||||
icon="tryton-open" colspan="2"/>
|
||||
<button name="do_pay" string="Do Pay" icon="tryton-open"/>
|
||||
<button name="send_email" string="Send Email" icon="tryton-open"/>
|
||||
<notebook colspan="6">
|
||||
|
@ -75,6 +77,8 @@ this repository contains the full copyright notices and license terms. -->
|
|||
<field name="created_channel"/>
|
||||
<label name="channel_commission"/>
|
||||
<field name="channel_commission"/>
|
||||
<label name="channel_invoice"/>
|
||||
<field name="channel_invoice"/>
|
||||
<field name="extra_commissions" colspan="4"/>
|
||||
</page>
|
||||
</notebook>
|
||||
|
@ -103,11 +107,4 @@ this repository contains the full copyright notices and license terms. -->
|
|||
<label name="pending_to_pay"/>
|
||||
<field name="pending_to_pay"/>
|
||||
</group>
|
||||
<group col="5" colspan="4" xfill="1" id="ota_management">
|
||||
<label name="channel_paymode"/>
|
||||
<field name="channel_paymode"/>
|
||||
<button name="bill_to_channel" string="Bill to Channel"/>
|
||||
<label name="channel_invoice"/>
|
||||
<field name="channel_invoice"/>
|
||||
</group>
|
||||
</form>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0"?>
|
||||
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
this repository contains the full copyright notices and license terms. -->
|
||||
<tree editable="1">
|
||||
<tree>
|
||||
<field name="party" expand="1"/>
|
||||
<field name="type_document"/>
|
||||
<field name="name" expand="1"/>
|
||||
|
|
Loading…
Reference in a new issue