Skip to content

Commit

Permalink
Merge pull request #37915 from ruthra-kumar/prevent_precision_based_v…
Browse files Browse the repository at this point in the history
…alidation_error_reconciliation

refactor: avoid precision based validation error on reconciliation
  • Loading branch information
ruthra-kumar authored Nov 5, 2023
2 parents 65dfef0 + be925d2 commit c2001be
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions erpnext/accounts/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ def check_if_advance_entry_modified(args):
party_account_field = (
"paid_from" if erpnext.get_party_account_type(args.party_type) == "Receivable" else "paid_to"
)

precision = frappe.get_precision("Payment Entry", "unallocated_amount")
if args.voucher_detail_no:
ret = frappe.db.sql(
"""select t1.name
Expand All @@ -533,9 +533,9 @@ def check_if_advance_entry_modified(args):
where
name = %(voucher_no)s and docstatus = 1
and party_type = %(party_type)s and party = %(party)s and {0} = %(account)s
and unallocated_amount = %(unreconciled_amount)s
and round(unallocated_amount, {1}) = %(unreconciled_amount)s
""".format(
party_account_field
party_account_field, precision
),
args,
)
Expand Down

0 comments on commit c2001be

Please sign in to comment.