Commit b2b66832 authored by Matthieu Fesselier's avatar Matthieu Fesselier

Merge branch 'master' of git.happy-dev.fr:startinblox/djangoldp-packages/djangoldp_invoices

parents 3c95991e 15a8ad69
Pipeline #2903 passed with stage
in 27 seconds
...@@ -61,9 +61,11 @@ class CustomerInvoice(Model): ...@@ -61,9 +61,11 @@ class CustomerInvoice(Model):
additionalText = models.CharField(max_length=255, blank=True, null=True) additionalText = models.CharField(max_length=255, blank=True, null=True)
def htAmount(self): def htAmount(self):
htAmount = Decimal(0)
if self.batches is None: if self.batches is None:
return self.batches.aggregate(total=Sum('tasks__htAmount'))['total'] htAmount = self.batches.aggregate(total=Sum('tasks__htAmount'))['total']
return 0
return htAmount
def tvaAmount(self): def tvaAmount(self):
return Decimal(self.tvaRate * self.htAmount() / Decimal(100)) 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