diff --git a/erpnext/accounts/doctype/payment_request/test_payment_request.py b/erpnext/accounts/doctype/payment_request/test_payment_request.py index 8a10e2cbd9..747bad8bb5 100644 --- a/erpnext/accounts/doctype/payment_request/test_payment_request.py +++ b/erpnext/accounts/doctype/payment_request/test_payment_request.py @@ -127,6 +127,7 @@ class TestPaymentRequest(unittest.TestCase): recipient_id="nabin@erpnext.com", return_doc=1) pr1.grand_total = 200 pr1.submit() + pr1.set_as_paid() # Make a 2nd Payment Request pr2 = make_payment_request(dt="Sales Order", dn=so.name, diff --git a/erpnext/erpnext_integrations/doctype/mpesa_settings/mpesa_settings.js b/erpnext/erpnext_integrations/doctype/mpesa_settings/mpesa_settings.js index a7e6dec4d3..636aa99de4 100644 --- a/erpnext/erpnext_integrations/doctype/mpesa_settings/mpesa_settings.js +++ b/erpnext/erpnext_integrations/doctype/mpesa_settings/mpesa_settings.js @@ -13,7 +13,9 @@ frappe.ui.form.on('Mpesa Settings', { }, get_account_balance: function(frm) { - if (!frm.initiator_name && !frm.security_credentials) return; + if (!frm.initiator_name && !frm.security_credentials) { + frappe.throw(__("Please set the initiator name and the security credential")); + } frappe.call({ method: "get_account_balance_info", doc: frm.doc diff --git a/erpnext/erpnext_integrations/doctype/mpesa_settings/test_mpesa_settings.py b/erpnext/erpnext_integrations/doctype/mpesa_settings/test_mpesa_settings.py index 55ccff30fe..4e86d365e3 100644 --- a/erpnext/erpnext_integrations/doctype/mpesa_settings/test_mpesa_settings.py +++ b/erpnext/erpnext_integrations/doctype/mpesa_settings/test_mpesa_settings.py @@ -10,7 +10,7 @@ from erpnext.accounts.doctype.pos_invoice.test_pos_invoice import create_pos_inv class TestMpesaSettings(unittest.TestCase): def test_creation_of_payment_gateway(self): - mpesa_doc = create_mpesa_settings(payment_gateway_name="_Test") + create_mpesa_settings(payment_gateway_name="_Test") mode_of_payment = frappe.get_doc("Mode of Payment", "Mpesa-_Test") self.assertTrue(frappe.db.exists("Payment Gateway Account", {'payment_gateway': "Mpesa-_Test"})) @@ -41,7 +41,7 @@ class TestMpesaSettings(unittest.TestCase): })) def test_processing_of_callback_payload(self): - mpesa_doc = create_mpesa_settings(payment_gateway_name="Payment") + create_mpesa_settings(payment_gateway_name="Payment") mpesa_account = frappe.db.get_value("Payment Gateway Account", {"payment_gateway": 'Mpesa-Payment'}, "payment_account") frappe.db.set_value("Account", mpesa_account, "account_currency", "KES") @@ -73,7 +73,7 @@ def create_mpesa_settings(payment_gateway_name="Express"): if frappe.db.exists("Mpesa Settings", payment_gateway_name): return frappe.get_doc("Mpesa Settings", payment_gateway_name) - doc = frappe.get_doc(dict( + doc = frappe.get_doc(dict( #nosec doctype="Mpesa Settings", payment_gateway_name=payment_gateway_name, consumer_key="5sMu9LVI1oS3oBGPJfh3JyvLHwZOdTKn",