refactor: gain/loss should use same posting date as payment

(cherry picked from commit f7865da4d2)
This commit is contained in:
ruthra kumar
2023-09-04 20:38:10 +05:30
committed by Mergify
parent b43c6ff1ae
commit 01eae2b758
3 changed files with 6 additions and 1 deletions

View File

@@ -1042,8 +1042,10 @@ class AccountsController(TransactionBase):
self.name,
arg.get("referenced_row"),
):
posting_date = frappe.db.get_value(arg.voucher_type, arg.voucher_no, "posting_date")
je = create_gain_loss_journal(
self.company,
posting_date,
arg.get("party_type"),
arg.get("party"),
party_account,
@@ -1123,6 +1125,7 @@ class AccountsController(TransactionBase):
je = create_gain_loss_journal(
self.company,
self.posting_date,
self.party_type,
self.party,
party_account,