refactor: Credit Note and its Exc gain/loss JE inherits dimensions

(cherry picked from commit ab939cc6e8)
This commit is contained in:
ruthra kumar
2024-01-15 16:13:26 +05:30
committed by Mergify
parent 41c074d0bb
commit 937262b572
2 changed files with 26 additions and 11 deletions

View File

@@ -1998,8 +1998,6 @@ def create_gain_loss_journal(
cost_center,
dimensions,
) -> str:
# TODO: pass dimensions to Journal
journal_entry = frappe.new_doc("Journal Entry")
journal_entry.voucher_type = "Exchange Gain Or Loss"
journal_entry.company = company
@@ -2032,7 +2030,7 @@ def create_gain_loss_journal(
dr_or_cr + "_in_account_currency": 0,
}
)
journal_account.update(dimensions)
journal_entry.append("accounts", journal_account)
journal_account = frappe._dict(
@@ -2048,7 +2046,7 @@ def create_gain_loss_journal(
reverse_dr_or_cr: abs(exc_gain_loss),
}
)
journal_account.update(dimensions)
journal_entry.append("accounts", journal_account)
journal_entry.save()