mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 05:22:16 +00:00
Fixed issue with calculating the balance on an invoice
Improvements to the invoice importer
This commit is contained in:
@@ -329,10 +329,12 @@ class Invoice(models.Model):
|
||||
|
||||
@property
|
||||
def payment_total(self):
|
||||
total = self.payment_set.aggregate(models.Sum('amount'))
|
||||
sum = self.payment_set.aggregate(models.Sum('amount'))['amount__sum']
|
||||
# for payment in self.payment_set.all():
|
||||
# total += payment.amount
|
||||
return total
|
||||
if sum:
|
||||
return sum
|
||||
return 0
|
||||
|
||||
@property
|
||||
def balance(self):
|
||||
|
||||
Reference in New Issue
Block a user