refactor: pass gain loss posting date to controller

(cherry picked from commit 7e600a6494)
This commit is contained in:
ruthra kumar
2023-10-22 20:26:45 +05:30
committed by Mergify
parent 063d658b04
commit 515bed8c80
5 changed files with 12 additions and 3 deletions

View File

@@ -1131,7 +1131,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,
@@ -1214,7 +1216,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,