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

This commit is contained in:
ruthra kumar
2023-09-04 20:38:10 +05:30
parent 6a7bdeffdf
commit f7865da4d2
3 changed files with 6 additions and 1 deletions

View File

@@ -1096,8 +1096,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,
@@ -1177,6 +1179,7 @@ class AccountsController(TransactionBase):
je = create_gain_loss_journal(
self.company,
self.posting_date,
self.party_type,
self.party,
party_account,