diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.js b/erpnext/accounts/doctype/payment_entry/payment_entry.js index ffba8c8f7f..2c382c58f6 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.js +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.js @@ -30,13 +30,20 @@ frappe.ui.form.on('Payment Entry', { } } }); - frm.set_query("bank_account", function() { + frm.set_query("party_bank_account", function() { return { filters: { "is_company_account":0 } } }); + frm.set_query("bank_account", function() { + return { + filters: { + "is_company_account":1 + } + } + }); frm.set_query("contact_person", function() { if (frm.doc.party) { return { diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.json b/erpnext/accounts/doctype/payment_entry/payment_entry.json index b988b481d1..1fb4b7bf8d 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.json +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.json @@ -19,6 +19,7 @@ "party_name", "column_break_11", "bank_account", + "party_bank_account", "contact_person", "contact_email", "payment_accounts_section", @@ -532,22 +533,29 @@ "label": "Title", "print_hide": 1 }, - { - "fieldname": "status", - "fieldtype": "Select", - "label": "Status", - "options": "Initiated\nCompleted" - }, { "depends_on": "party", "fieldname": "bank_account", "fieldtype": "Link", - "label": "Bank Account", + "label": "Company Bank Account", "options": "Bank Account" + }, + { + "depends_on": "party", + "fieldname": "party_bank_account", + "fieldtype": "Link", + "label": "Party Bank Account", + "options": "Bank Account" + }, + { + "fieldname": "status", + "fieldtype": "Select", + "label": "Payment Order Status", + "options": "Initiated\nCompleted" } ], "is_submittable": 1, - "modified": "2019-05-08 12:35:05.407422", + "modified": "2019-05-14 17:00:48.759155", "modified_by": "Administrator", "module": "Accounts", "name": "Payment Entry", diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.py b/erpnext/accounts/doctype/payment_entry/payment_entry.py index c506090f32..e224ee7146 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.py +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.py @@ -975,7 +975,7 @@ def make_payment_order(source_name, target_doc=None): target.payment_order_type = "Payment Entry" def update_item(source_doc, target_doc, source_parent): - target_doc.bank_account = source_parent.bank_account + target_doc.bank_account = source_parent.party_bank_account target_doc.amount = source_parent.base_paid_amount target_doc.account = source_parent.paid_to target_doc.payment_entry = source_parent.name