Merge pull request #51340 from aerele/bank-reconciliation-pass-company-bank-account

fix(bank reconciliation tool): carry bank account to payment entry
This commit is contained in:
ruthra kumar
2025-12-30 15:57:26 +05:30
committed by GitHub
2 changed files with 21 additions and 0 deletions

View File

@@ -304,6 +304,7 @@ def create_payment_entry_bts(
project=None, project=None,
cost_center=None, cost_center=None,
allow_edit=None, allow_edit=None,
company_bank_account=None,
): ):
# Create a new payment entry based on the bank transaction # Create a new payment entry based on the bank transaction
bank_transaction = frappe.db.get_values( bank_transaction = frappe.db.get_values(
@@ -345,6 +346,9 @@ def create_payment_entry_bts(
pe.project = project pe.project = project
pe.cost_center = cost_center pe.cost_center = cost_center
if company_bank_account:
pe.bank_account = company_bank_account
pe.validate() pe.validate()
if allow_edit: if allow_edit:

View File

@@ -361,6 +361,21 @@ erpnext.accounts.bank_reconciliation.DialogManager = class DialogManager {
mandatory_depends_on: mandatory_depends_on:
"eval:doc.action=='Create Voucher' && doc.document_type=='Payment Entry'", "eval:doc.action=='Create Voucher' && doc.document_type=='Payment Entry'",
}, },
{
fieldname: "bank_account",
fieldtype: "Link",
label: "Company Bank Account",
options: "Bank Account",
depends_on: "eval:doc.party",
get_query: function () {
return {
filters: {
is_company_account: 1,
company: this.company,
},
};
},
},
{ {
fieldname: "project", fieldname: "project",
fieldtype: "Link", fieldtype: "Link",
@@ -511,6 +526,7 @@ erpnext.accounts.bank_reconciliation.DialogManager = class DialogManager {
mode_of_payment: values.mode_of_payment, mode_of_payment: values.mode_of_payment,
project: values.project, project: values.project,
cost_center: values.cost_center, cost_center: values.cost_center,
company_bank_account: values?.bank_account || this?.bank_account,
}, },
callback: (response) => { callback: (response) => {
const alert_string = __("Bank Transaction {0} added as Payment Entry", [ const alert_string = __("Bank Transaction {0} added as Payment Entry", [
@@ -582,6 +598,7 @@ erpnext.accounts.bank_reconciliation.DialogManager = class DialogManager {
project: values.project, project: values.project,
cost_center: values.cost_center, cost_center: values.cost_center,
allow_edit: true, allow_edit: true,
company_bank_account: values?.bank_account || this?.bank_account,
}, },
callback: (r) => { callback: (r) => {
const doc = frappe.model.sync(r.message); const doc = frappe.model.sync(r.message);