summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2025-08-07 09:22:07 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2025-08-07 09:22:07 +0700
commitd1a6e4a2d63cf3dd82ede0f8906957675ca38934 (patch)
tree8c28af1f7c95cd92c0ab7e3889417d1b32aeac9c /indoteknik_custom/models
parentecb8be24f66447fa2ab528c370a4b2eedbf7bd7e (diff)
payment partial
Diffstat (limited to 'indoteknik_custom/models')
-rw-r--r--indoteknik_custom/models/account_move.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py
index 595c5655..c5e01f0c 100644
--- a/indoteknik_custom/models/account_move.py
+++ b/indoteknik_custom/models/account_move.py
@@ -95,6 +95,14 @@ class AccountMove(models.Model):
)
payment_date = fields.Date(string="Payment Date", compute='_compute_payment_date')
+ partial_payment = fields.Float(string="Partial Payment", compute='compute_partial_payment')
+
+ def compute_partial_payment(self):
+ for move in self:
+ if move.amount_total_signed > 0 and move.amount_residual_signed > 0 and move.payment_state == 'partial':
+ move.partial_payment = move.amount_total_signed - move.amount_residual_signed
+ else:
+ move.partial_payment = 0
def _compute_payment_date(self):
for move in self: