mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-13 09:43:49 +00:00
fix(bank reconciliation tool): carry bank account to payment entry
(cherry picked from commit 6fc9636642)
This commit is contained in:
@@ -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(
|
||||||
@@ -344,6 +345,7 @@ def create_payment_entry_bts(
|
|||||||
pe.mode_of_payment = mode_of_payment
|
pe.mode_of_payment = mode_of_payment
|
||||||
pe.project = project
|
pe.project = project
|
||||||
pe.cost_center = cost_center
|
pe.cost_center = cost_center
|
||||||
|
pe.bank_account = company_bank_account
|
||||||
|
|
||||||
pe.validate()
|
pe.validate()
|
||||||
|
|
||||||
|
|||||||
@@ -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?.company_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?.company_bank_account || this?.bank_account,
|
||||||
},
|
},
|
||||||
callback: (r) => {
|
callback: (r) => {
|
||||||
const doc = frappe.model.sync(r.message);
|
const doc = frappe.model.sync(r.message);
|
||||||
|
|||||||
Reference in New Issue
Block a user