From b033b3b0d6a7a286e253a24d7432b607eaa14d09 Mon Sep 17 00:00:00 2001 From: Husam Hammad <85282854+husamhammad@users.noreply.github.com> Date: Wed, 2 Aug 2023 13:58:05 +0300 Subject: [PATCH] fix: handle None value in payment_term_outstanding * Fix payment entry bug: Handle None value in payment_term_outstanding * fix: Handle None value in payment_term_outstanding V2 fix linting issue (cherry picked from commit 27ebf14f9d516ec555ed702a2edd78c6e65d517f) --- erpnext/accounts/doctype/payment_entry/payment_entry.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.py b/erpnext/accounts/doctype/payment_entry/payment_entry.py index b71e2235612..bece3f9c280 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.py +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.py @@ -238,7 +238,8 @@ class PaymentEntry(AccountsController): d.payment_term and ( (flt(d.allocated_amount)) > 0 - and flt(d.allocated_amount) > flt(latest.payment_term_outstanding) + and latest.payment_term_outstanding + and (flt(d.allocated_amount) > flt(latest.payment_term_outstanding)) ) and self.term_based_allocation_enabled_for_reference(d.reference_doctype, d.reference_name) ):