Skip to content

Commit

Permalink
fix(accounts): currency fields no longer read as strings by validatio…
Browse files Browse the repository at this point in the history
…n function in Payment Entry (#33535)

explicitly cast paid_amount and received_amount to float in the Payment Entry set_unallocated_amount validation function
  • Loading branch information
SvbZ3r0 authored Jan 9, 2023
1 parent bbe5e5d commit 4d5067d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions erpnext/accounts/doctype/payment_entry/payment_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ def set_unallocated_amount(self):
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
Expand All @@ -632,7 +632,7 @@ def set_unallocated_amount(self):
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)
Expand Down

0 comments on commit 4d5067d

Please sign in to comment.