feat: Add posting date param for reverse GL entries

(cherry picked from commit 38988bf797)
This commit is contained in:
Deepesh Garg
2025-10-23 13:00:15 +05:30
committed by Mergify
parent fcd05bb7e4
commit 1a7092d7b6

View File

@@ -648,6 +648,7 @@ def make_reverse_gl_entries(
adv_adj=False, adv_adj=False,
update_outstanding="Yes", update_outstanding="Yes",
partial_cancel=False, partial_cancel=False,
posting_date=None
): ):
""" """
Get original gl entries of the voucher Get original gl entries of the voucher
@@ -745,6 +746,8 @@ def make_reverse_gl_entries(
if immutable_ledger_enabled: if immutable_ledger_enabled:
new_gle["is_cancelled"] = 0 new_gle["is_cancelled"] = 0
new_gle["posting_date"] = frappe.form_dict.get("posting_date") or getdate() new_gle["posting_date"] = frappe.form_dict.get("posting_date") or getdate()
elif posting_date:
new_gle["posting_date"] = posting_date
if new_gle["debit"] or new_gle["credit"]: if new_gle["debit"] or new_gle["credit"]:
make_entry(new_gle, adv_adj, "Yes") make_entry(new_gle, adv_adj, "Yes")