Commit fb1ab91f authored by Sydney Cohen's avatar Sydney Cohen

return decimal(0) if none

parent 26ccca87
Pipeline #2188 passed with stage
in 27 seconds
......@@ -57,7 +57,8 @@ class CustomerInvoice(models.Model):
invoicingDate = models.DateField(default =
def htAmount(self):
return self.batches.aggregate(total=Sum('tasks__htAmount'))['total']
htAmount = self.batches.aggregate(total=Sum('tasks__htAmount'))['total']
return htAmount or Decimal(0)
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