diff options
| author | FIN-IT_AndriFP <andrifebriyadiputra@gmail.com> | 2026-02-02 14:54:14 +0700 |
|---|---|---|
| committer | FIN-IT_AndriFP <andrifebriyadiputra@gmail.com> | 2026-02-02 14:54:14 +0700 |
| commit | 750cdae1141d0039ab2c8d5796c5fb7bb2726bcc (patch) | |
| tree | 2d6d70aa7c8d93357f2c977a49b30709412b413f | |
| parent | c4880a2b65347852685faaa2e33bc8ac5ed7c119 (diff) | |
(andri) fix compute when PUM is canceled
| -rw-r--r-- | indoteknik_custom/models/advance_payment_request.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/indoteknik_custom/models/advance_payment_request.py b/indoteknik_custom/models/advance_payment_request.py index ed0b0809..8cadb1b6 100644 --- a/indoteknik_custom/models/advance_payment_request.py +++ b/indoteknik_custom/models/advance_payment_request.py @@ -641,10 +641,16 @@ class AdvancePaymentRequest(models.Model): today = date.today() for rec in self: - current_days = rec.days_remaining or 0 - current_due_date = rec.estimated_return_date or False - if rec.type_request == 'pum': - is_settlement_approved = any(s.status == 'approved' for s in rec.settlement_ids) + # current_days = rec.days_remaining or 0 + # current_due_date = rec.estimated_return_date or False + current_days = 0 + current_due_date = False + + is_settlement_approved = any(s.status == 'approved' for s in rec.settlement_ids) + is_pum_canceled = (rec.status == 'cancel') + + if rec.type_request == 'pum' and not is_pum_canceled and not is_settlement_approved: + if not is_settlement_approved: due_date = False |
