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
e7bc31c7f1
commit
691d45bb68
|
@ -1119,10 +1119,12 @@ class Booking(Workflow, ModelSQL, ModelView):
|
|||
if self.total_amount:
|
||||
print('total_amount...', self.total_amount, self.total_advances)
|
||||
res = self.total_amount - (self.total_advances or 0)
|
||||
if res > -1 and res < 1:
|
||||
res = 0
|
||||
elif name == 'pending_acco':
|
||||
res = [fol.pending_accommodation for fol in self.lines]
|
||||
res = sum(fol.pending_accommodation for fol in self.lines)
|
||||
elif name == 'pending_charges':
|
||||
res = [fol.pending_charges for fol in self.lines]
|
||||
res = sum(fol.pending_charges for fol in self.lines)
|
||||
return res
|
||||
|
||||
def get_collect_amount(self, name):
|
||||
|
|
5
folio.py
5
folio.py
|
@ -259,7 +259,7 @@ class Folio(ModelSQL, ModelView):
|
|||
res = 0
|
||||
if name == 'pending_accommodation':
|
||||
# if self.payment_status != 'paid':
|
||||
res = self.get_total_accommodation()
|
||||
res = self.get_total_accommodation()
|
||||
if name == 'pending_charges':
|
||||
total_charges = self.get_total_products()
|
||||
charge_paid = 0
|
||||
|
@ -362,7 +362,8 @@ class Folio(ModelSQL, ModelView):
|
|||
def _check_accommodation(folio):
|
||||
for charge in folio.charges:
|
||||
if charge.status != 'paid':
|
||||
raise UserError(gettext('hotel.msg_accommodation_not_paid'))
|
||||
raise UserError(
|
||||
gettext('hotel.msg_accommodation_not_paid'))
|
||||
|
||||
def _check_charges(folio):
|
||||
for charge in folio.charges:
|
||||
|
|
|
@ -111,5 +111,8 @@ this repository contains the full copyright notices and license terms. -->
|
|||
<record model="ir.message" id="msg_can_not_change_departure">
|
||||
<field name="text">It can not change departure date because, it has charges of room in the new dates!</field>
|
||||
</record>
|
||||
<record model="ir.message" id="msg_charges_not_paid">
|
||||
<field name="text">There is charges not paid!</field>
|
||||
</record>
|
||||
</data>
|
||||
</tryton>
|
||||
|
|
Loading…
Reference in a new issue