From 836936b33c8206cf5344df189642e7a65f095480 Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Tue, 3 Sep 2024 10:16:32 +0700 Subject: add others info in dunning run --- indoteknik_custom/models/dunning_run.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indoteknik_custom/models/dunning_run.py') diff --git a/indoteknik_custom/models/dunning_run.py b/indoteknik_custom/models/dunning_run.py index d75d7c51..90159cd0 100644 --- a/indoteknik_custom/models/dunning_run.py +++ b/indoteknik_custom/models/dunning_run.py @@ -27,6 +27,10 @@ class DunningRun(models.Model): shipper_faktur_id = fields.Many2one('delivery.carrier', string='Shipper Faktur') is_validated = fields.Boolean(string='Validated') notification = fields.Char(string='Notification') + is_paid = fields.Boolean(string='Paid') + description = fields.Char(string='Description') + comment = fields.Char(string='Comment') + def copy_date_faktur(self): if not self.is_validated: -- cgit v1.2.3 From d2bb21ae878db2a3b77dbb3341046c9d12ba1de5 Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Fri, 20 Sep 2024 14:12:00 +0700 Subject: add grand total on dunning run and bill receipt --- indoteknik_custom/models/dunning_run.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'indoteknik_custom/models/dunning_run.py') 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: -- cgit v1.2.3