Commit a130065d authored by Sydney Cohen's avatar Sydney Cohen Committed by Jean-Baptiste

return decimal(0) if none

parent a43478d6
Pipeline #2896 passed with stage
in 31 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