Skip to content

Commit

Permalink
fix: only increment if check numer is numeric (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
agritheory authored Aug 15, 2023
1 parent 404edf3 commit 30679db
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion check_run/overrides/payment_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ def update_check_number(doc, method=None):
mode_of_payment_type = frappe.db.get_value(
"Mode of Payment", doc.mode_of_payment, "type"
)
if doc.bank_account and mode_of_payment_type == "Bank":
if (
doc.bank_account
and mode_of_payment_type == "Bank"
and str(doc.reference_no).isdigit()
):
frappe.db.set_value(
"Bank Account", doc.bank_account, "check_number", doc.reference_no
)

0 comments on commit 30679db

Please sign in to comment.