mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-20 07:22:13 +00:00
fix: Auto reconcile only after selecting bank account (#41489)
(cherry picked from commit f24d61daea)
Co-authored-by: Nabin Hait <nabinhait@gmail.com>
This commit is contained in:
@@ -59,6 +59,10 @@ frappe.ui.form.on("Bank Reconciliation Tool", {
|
|||||||
);
|
);
|
||||||
|
|
||||||
frm.add_custom_button(__("Auto Reconcile"), function () {
|
frm.add_custom_button(__("Auto Reconcile"), function () {
|
||||||
|
if (!frm.doc.bank_account) {
|
||||||
|
frappe.msgprint(__("Please select Bank Account"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
frappe.call({
|
frappe.call({
|
||||||
method: "erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool.auto_reconcile_vouchers",
|
method: "erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool.auto_reconcile_vouchers",
|
||||||
args: {
|
args: {
|
||||||
|
|||||||
@@ -495,12 +495,12 @@ def check_matching(
|
|||||||
bank_account,
|
bank_account,
|
||||||
company,
|
company,
|
||||||
transaction,
|
transaction,
|
||||||
document_types,
|
document_types=None,
|
||||||
from_date,
|
from_date=None,
|
||||||
to_date,
|
to_date=None,
|
||||||
filter_by_reference_date,
|
filter_by_reference_date=None,
|
||||||
from_reference_date,
|
from_reference_date=None,
|
||||||
to_reference_date,
|
to_reference_date=None,
|
||||||
):
|
):
|
||||||
exact_match = True if "exact_match" in document_types else False
|
exact_match = True if "exact_match" in document_types else False
|
||||||
|
|
||||||
@@ -540,14 +540,14 @@ def get_queries(
|
|||||||
bank_account,
|
bank_account,
|
||||||
company,
|
company,
|
||||||
transaction,
|
transaction,
|
||||||
document_types,
|
document_types=None,
|
||||||
from_date,
|
from_date=None,
|
||||||
to_date,
|
to_date=None,
|
||||||
filter_by_reference_date,
|
filter_by_reference_date=None,
|
||||||
from_reference_date,
|
from_reference_date=None,
|
||||||
to_reference_date,
|
to_reference_date=None,
|
||||||
exact_match,
|
exact_match=None,
|
||||||
common_filters,
|
common_filters=None,
|
||||||
):
|
):
|
||||||
# get queries to get matching vouchers
|
# get queries to get matching vouchers
|
||||||
account_from_to = "paid_to" if transaction.deposit > 0.0 else "paid_from"
|
account_from_to = "paid_to" if transaction.deposit > 0.0 else "paid_from"
|
||||||
@@ -580,15 +580,15 @@ def get_matching_queries(
|
|||||||
bank_account,
|
bank_account,
|
||||||
company,
|
company,
|
||||||
transaction,
|
transaction,
|
||||||
document_types,
|
document_types=None,
|
||||||
exact_match,
|
exact_match=None,
|
||||||
account_from_to,
|
account_from_to=None,
|
||||||
from_date,
|
from_date=None,
|
||||||
to_date,
|
to_date=None,
|
||||||
filter_by_reference_date,
|
filter_by_reference_date=None,
|
||||||
from_reference_date,
|
from_reference_date=None,
|
||||||
to_reference_date,
|
to_reference_date=None,
|
||||||
common_filters,
|
common_filters=None,
|
||||||
):
|
):
|
||||||
queries = []
|
queries = []
|
||||||
currency = get_account_currency(bank_account)
|
currency = get_account_currency(bank_account)
|
||||||
|
|||||||
Reference in New Issue
Block a user