mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-08 15:51:19 +00:00
Merge pull request #49121 from rehanrehman389/je-reversal-duplicate
fix: prevent duplicate reverse Journal Entry
This commit is contained in:
@@ -1796,6 +1796,14 @@ def make_inter_company_journal_entry(name, voucher_type, company):
|
|||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def make_reverse_journal_entry(source_name, target_doc=None):
|
def make_reverse_journal_entry(source_name, target_doc=None):
|
||||||
|
existing_reverse = frappe.db.exists("Journal Entry", {"reversal_of": source_name, "docstatus": 1})
|
||||||
|
if existing_reverse:
|
||||||
|
frappe.throw(
|
||||||
|
_("A Reverse Journal Entry {0} already exists for this Journal Entry.").format(
|
||||||
|
get_link_to_form("Journal Entry", existing_reverse)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
from frappe.model.mapper import get_mapped_doc
|
from frappe.model.mapper import get_mapped_doc
|
||||||
|
|
||||||
def post_process(source, target):
|
def post_process(source, target):
|
||||||
|
|||||||
Reference in New Issue
Block a user