Commit 15a8ad69 authored by Jean-Baptiste's avatar Jean-Baptiste

Merge branch 'bug/htAmount' into 'master'

HtAmount return statement

See merge request !1
parents a43478d6 a130065d
Pipeline #2898 passed with stage
in 27 seconds
......@@ -60,9 +60,11 @@ class CustomerInvoice(Model):
invoicingDate = models.DateField(default=datetime.date.today)
def htAmount(self):
htAmount = Decimal(0)
if self.batches is None:
return self.batches.aggregate(total=Sum('tasks__htAmount'))['total']
return 0
htAmount = self.batches.aggregate(total=Sum('tasks__htAmount'))['total']
return htAmount
def tvaAmount(self):
return Decimal(self.tvaRate * self.htAmount() / Decimal(100))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment