refactor: pass gain loss posting date to controller

(cherry picked from commit 7e600a6494)

# Conflicts:
#	erpnext/accounts/utils.py
This commit is contained in:
ruthra kumar
2023-10-22 20:26:45 +05:30
committed by Mergify
parent 39571d828e
commit 125722ae41
5 changed files with 13 additions and 2 deletions

View File

@@ -1360,7 +1360,9 @@ class AccountsController(TransactionBase):
self.name,
arg.get("referenced_row"),
):
posting_date = frappe.db.get_value(arg.voucher_type, arg.voucher_no, "posting_date")
posting_date = arg.get("difference_posting_date") or frappe.db.get_value(
arg.voucher_type, arg.voucher_no, "posting_date"
)
je = create_gain_loss_journal(
self.company,
posting_date,
@@ -1444,7 +1446,7 @@ class AccountsController(TransactionBase):
je = create_gain_loss_journal(
self.company,
self.posting_date,
args.get("difference_posting_date") if args else self.posting_date,
self.party_type,
self.party,
party_account,