summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/sale_order.py
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2025-07-28 15:06:26 +0700
committerit-fixcomart <it@fixcomart.co.id>2025-07-28 15:06:26 +0700
commitb4fa8f4df995f946b642eda78ca5fc2b8badada2 (patch)
tree693c6595a2628ded19a4525da7530075cccbfde4 /indoteknik_custom/models/sale_order.py
parent6983b0f81beb28b0df43c78e50dbcf310235a9dd (diff)
<hafid> fixing journal
Diffstat (limited to 'indoteknik_custom/models/sale_order.py')
-rwxr-xr-xindoteknik_custom/models/sale_order.py6
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': '',