Minor fixes

This commit is contained in:
oscar alvarez 2023-10-30 11:19:39 -05:00
parent f81d2f22aa
commit 479752d298
4 changed files with 801 additions and 62 deletions

View File

@ -268,19 +268,26 @@ class Folio(ModelSQL, ModelView):
if self.booking:
return self.booking.plan
def _get_paid(self, kind):
res = []
for charge in self.charges:
if charge.status == 'paid' and charge.kind == kind:
res.append(charge.taxed_amount or 0)
return sum(res)
def get_pending_to_pay(self, name=None):
res = 0
if name == 'pending_accommodation':
# if self.payment_status != 'paid':
res = self.get_total_accommodation()
if name == 'pending_charges':
total_charges = self.get_total_products()
charge_paid = 0
for charge in self.charges:
if charge.status == 'paid':
charge_paid += charge.amount
res = total_charges - charge_paid
if name == 'pending_total':
charge_paid = self._get_paid('accommodation')
print(self.registration_card, "ACO ====", res, charge_paid)
res = res - charge_paid
elif name == 'pending_charges':
res = self.get_total_products()
charge_paid = self._get_paid('product')
print(self.registration_card, "Product ====", res, charge_paid)
res = res - charge_paid
elif name == 'pending_total':
res = self.total_amount - self.total_advances
res = round(res, 2)
return res
@ -989,7 +996,7 @@ class Folio(ModelSQL, ModelView):
res = []
for charge in self.charges:
if charge.kind == 'product':
res.append(charge.amount)
res.append(charge.taxed_amount)
return sum(res)
def get_total_amount(self, name):

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -24,10 +24,11 @@ this repository contains the full copyright notices and license terms. -->
<label name="dinner"/>
<field name="dinner"/>
</group>
<group string="Price Lists" id="weedays" colspan="2">
<field name="price_lists" colspan="4"/>
<group id="price_lists" colspan="2" yfill="1" yexpand="1" yalign="0">
<field name="price_lists" yfill="1" yexpand="1" height="300"/>
</group>
<group string="Weedays" col="2" id="weedays" colspan="2">
<group string="Weekdays" col="2" id="weekdays" colspan="2" yalign="0"
yexpand="1">
<label name="monday"/>
<field name="monday"/>
<label name="tuesday"/>