Skip to content

Commit 61725e5

Browse files
committed
fix: Reset online payment fields when bank account is not provided
1 parent 248f0db commit 61725e5

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

payment_integration_utils/payment_integration_utils/client_overrides/form/payment_entry.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,11 @@ frappe.ui.form.on("Payment Entry", {
7878

7979
bank_account: function (frm) {
8080
if (!frm.doc.bank_account) {
81-
frm.set_value("make_bank_online_payment", 0);
81+
frm.set_value({
82+
make_bank_online_payment: 0,
83+
integration_doctype: "",
84+
integration_docname: "",
85+
});
8286
}
8387
},
8488

payment_integration_utils/payment_integration_utils/server_overrides/doctype/payment_entry.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ def onload(doc: PaymentEntry, method=None):
3636
def validate(doc: PaymentEntry, method=None):
3737
validate_if_already_paid(doc)
3838

39+
# to make payment online, bank account is mandatory
40+
if not doc.bank_account:
41+
doc.integration_doctype = ""
42+
doc.integration_docname = ""
43+
doc.make_bank_online_payment = 0
44+
3945
# maybe occur when doc is duplicated
4046
if (
4147
doc.party_bank_account

0 commit comments

Comments
 (0)