diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2025-07-28 15:06:26 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2025-07-28 15:06:26 +0700 |
| commit | b4fa8f4df995f946b642eda78ca5fc2b8badada2 (patch) | |
| tree | 693c6595a2628ded19a4525da7530075cccbfde4 /indoteknik_custom/models/sale_order.py | |
| parent | 6983b0f81beb28b0df43c78e50dbcf310235a9dd (diff) | |
<hafid> fixing journal
Diffstat (limited to 'indoteknik_custom/models/sale_order.py')
| -rwxr-xr-x | indoteknik_custom/models/sale_order.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py index 4d0b1d7b..46dad6ff 100755 --- a/indoteknik_custom/models/sale_order.py +++ b/indoteknik_custom/models/sale_order.py @@ -3111,6 +3111,7 @@ class SaleOrder(models.Model): self.ensure_one() invoice_ids = self.invoice_ids.filtered(lambda inv: inv.state != 'cancel') + total_so = sum(self.mapped('amount_total')) return { 'name': 'Refund Sale Order', @@ -3121,7 +3122,7 @@ class SaleOrder(models.Model): 'context': { 'default_sale_order_ids': [(6, 0, [self.id])], 'default_invoice_ids': [(6, 0, invoice_ids.ids)], - 'default_uang_masuk': sum(invoice_ids.mapped('amount_total')) + (self.delivery_amt or 0.0) + 1000, + 'default_uang_masuk': total_so, 'default_ongkir': self.delivery_amt or 0.0, 'default_bank': '', # bisa isi default bank kalau mau 'default_account_name': '', @@ -3150,6 +3151,7 @@ class SaleOrder(models.Model): invoice_ids = self.mapped('invoice_ids').filtered(lambda inv: inv.state != 'cancel') delivery_total = sum(self.mapped('delivery_amt')) total_invoice = sum(invoice_ids.mapped('amount_total_signed')) + total_so = sum(self.mapped('amount_total')) return { 'type': 'ir.actions.act_window', @@ -3160,7 +3162,7 @@ class SaleOrder(models.Model): 'context': { 'default_sale_order_ids': [(6, 0, self.ids)], 'default_invoice_ids': [(6, 0, invoice_ids.ids)], - 'default_uang_masuk': total_invoice + delivery_total + 1000, + 'default_uang_masuk': total_so, 'default_ongkir': delivery_total, 'default_bank': '', 'default_account_name': '', |
