summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/dunning_run.py
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2024-09-20 14:12:00 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2024-09-20 14:12:00 +0700
commitd2bb21ae878db2a3b77dbb3341046c9d12ba1de5 (patch)
treeddea32e5e90fb1944205536365be12766d9f1101 /indoteknik_custom/models/dunning_run.py
parentb34c5cc5d6cc3dc1e9ccf43cecc14a5a7a427992 (diff)
add grand total on dunning run and bill receipt
Diffstat (limited to 'indoteknik_custom/models/dunning_run.py')
-rw-r--r--indoteknik_custom/models/dunning_run.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/indoteknik_custom/models/dunning_run.py b/indoteknik_custom/models/dunning_run.py
index 90159cd0..c167aab7 100644
--- a/indoteknik_custom/models/dunning_run.py
+++ b/indoteknik_custom/models/dunning_run.py
@@ -30,7 +30,14 @@ class DunningRun(models.Model):
is_paid = fields.Boolean(string='Paid')
description = fields.Char(string='Description')
comment = fields.Char(string='Comment')
-
+ grand_total = fields.Float(string='Grand Total', compute="_compute_grand_total")
+
+ def _compute_grand_total(self):
+ for record in self:
+ grand_total = 0
+ for line in record.dunning_line:
+ grand_total += line.total_amt
+ record.grand_total = grand_total
def copy_date_faktur(self):
if not self.is_validated: