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

This commit is contained in:
ruthra kumar
2024-01-15 16:13:26 +05:30
parent 0ec17590ae
commit ab939cc6e8
2 changed files with 26 additions and 11 deletions

View File

@@ -2046,8 +2046,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
@@ -2080,7 +2078,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(
@@ -2096,7 +2094,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()