From 4d5067d6d4e187feacc4b02d22de5c5f3ef4d051 Mon Sep 17 00:00:00 2001 From: Gughan Ravikumar Date: Mon, 9 Jan 2023 23:26:51 +0530 Subject: [PATCH] fix(accounts): currency fields no longer read as strings by validation function in Payment Entry (#33535) explicitly cast paid_amount and received_amount to float in the Payment Entry set_unallocated_amount validation function --- erpnext/accounts/doctype/payment_entry/payment_entry.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.py b/erpnext/accounts/doctype/payment_entry/payment_entry.py index 26192eca2e..ff2690f675 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.py +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.py @@ -622,7 +622,7 @@ class PaymentEntry(AccountsController): self.payment_type == "Receive" and self.base_total_allocated_amount < self.base_received_amount + total_deductions and self.total_allocated_amount - < self.paid_amount + (total_deductions / self.source_exchange_rate) + < flt(self.paid_amount) + (total_deductions / self.source_exchange_rate) ): self.unallocated_amount = ( self.base_received_amount + total_deductions - self.base_total_allocated_amount @@ -632,7 +632,7 @@ class PaymentEntry(AccountsController): self.payment_type == "Pay" and self.base_total_allocated_amount < (self.base_paid_amount - total_deductions) and self.total_allocated_amount - < self.received_amount + (total_deductions / self.target_exchange_rate) + < flt(self.received_amount) + (total_deductions / self.target_exchange_rate) ): self.unallocated_amount = ( self.base_paid_amount - (total_deductions + self.base_total_allocated_amount)