Fix
This commit is contained in:
parent
2e9e5cda87
commit
aff63db506
7
folio.py
7
folio.py
|
@ -455,9 +455,10 @@ class Folio(ModelSQL, ModelView):
|
|||
instead of flat price. Fee is linked to channel management.
|
||||
"""
|
||||
res = []
|
||||
if name == 'total_amount' or not self.invoice_line:
|
||||
if self.nights_quantity and self.unit_price_w_tax:
|
||||
res = [self.nights_quantity * self.unit_price_w_tax]
|
||||
if self.nights_quantity and self.unit_price_w_tax:
|
||||
amount_nights = [self.nights_quantity * self.unit_price_w_tax]
|
||||
if name == 'total_amount' or (name == 'total_balance' and not self.invoice_line):
|
||||
res.append(amount_nights)
|
||||
for charge in self.charges:
|
||||
res.append(charge.amount)
|
||||
res = round(sum(res), Folio.total_amount.digits[1])
|
||||
|
|
Loading…
Reference in New Issue