diff --git a/booking.py b/booking.py
index 1ab707f..fb4fbc3 100644
--- a/booking.py
+++ b/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
diff --git a/booking_daily.fods b/booking_daily.fods
index 9e3d568..6d0630c 100644
Binary files a/booking_daily.fods and b/booking_daily.fods differ
diff --git a/folio.py b/folio.py
index 8948f6d..3290b73 100644
--- a/folio.py
+++ b/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:
diff --git a/view/board_folio_form.xml b/view/board_folio_form.xml
index a227358..cd3d03f 100644
--- a/view/board_folio_form.xml
+++ b/view/board_folio_form.xml
@@ -33,10 +33,8 @@ this repository contains the full copyright notices and license terms. -->
-
-
-
-
+
+
diff --git a/view/booking_folio_form.xml b/view/booking_folio_form.xml
index b92bc0e..fc6e195 100644
--- a/view/booking_folio_form.xml
+++ b/view/booking_folio_form.xml
@@ -35,10 +35,8 @@ this repository contains the full copyright notices and license terms. -->
-
-
-
-
+
+
diff --git a/view/booking_form.xml b/view/booking_form.xml
index 98af860..0a5e8f8 100644
--- a/view/booking_form.xml
+++ b/view/booking_form.xml
@@ -22,10 +22,12 @@ this repository contains the full copyright notices and license terms. -->
+
+
+ icon="tryton-open" colspan="2"/>
@@ -75,6 +77,8 @@ this repository contains the full copyright notices and license terms. -->
+
+
@@ -103,11 +107,4 @@ this repository contains the full copyright notices and license terms. -->
-
-
-
-
-
-
-
diff --git a/view/guest_tree.xml b/view/guest_tree.xml
index db24ee8..a68affc 100644
--- a/view/guest_tree.xml
+++ b/view/guest_tree.xml
@@ -1,7 +1,7 @@
-
+