mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-31 10:49:09 +00:00
fix: Bank Reconciliation Allows to Over Reconcile (#19461)
* Update bank_reconciliation.py * fix: improve error message while over reconciling * fix: only check over-reconciliation when against payment entry Co-authored-by: Saqib <thefalconx33@gmail.com>
This commit is contained in:
@@ -18,6 +18,10 @@ def reconcile(bank_transaction, payment_doctype, payment_name):
|
|||||||
account = frappe.db.get_value("Bank Account", transaction.bank_account, "account")
|
account = frappe.db.get_value("Bank Account", transaction.bank_account, "account")
|
||||||
gl_entry = frappe.get_doc("GL Entry", dict(account=account, voucher_type=payment_doctype, voucher_no=payment_name))
|
gl_entry = frappe.get_doc("GL Entry", dict(account=account, voucher_type=payment_doctype, voucher_no=payment_name))
|
||||||
|
|
||||||
|
if payment_doctype == "Payment Entry" and payment_entry.unallocated_amount > transaction.unallocated_amount:
|
||||||
|
frappe.throw(_("The unallocated amount of Payment Entry {0} \
|
||||||
|
is greater than the Bank Transaction's unallocated amount").format(payment_name))
|
||||||
|
|
||||||
if transaction.unallocated_amount == 0:
|
if transaction.unallocated_amount == 0:
|
||||||
frappe.throw(_("This bank transaction is already fully reconciled"))
|
frappe.throw(_("This bank transaction is already fully reconciled"))
|
||||||
|
|
||||||
@@ -373,4 +377,4 @@ def sales_invoices_query(doctype, txt, searchfield, start, page_len, filters):
|
|||||||
'start': start,
|
'start': start,
|
||||||
'page_len': page_len
|
'page_len': page_len
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user