refactor: redefine dr_or_cr for unallocated amount

(cherry picked from commit 3e6306348ac564976fc8b0d3ef7ec12a8d9961cc)
This commit is contained in:
ruthra kumar 2023-11-28 20:04:47 +05:30 committed by Mergify
parent 8ed2ea29ac
commit 86b2de4013

View File

@ -1113,6 +1113,7 @@ class PaymentEntry(AccountsController):
gl_entries.append(gle)
if self.unallocated_amount:
dr_or_cr = "credit" if self.payment_type == "Receive" else "debit"
exchange_rate = self.get_exchange_rate()
base_unallocated_amount = self.unallocated_amount * exchange_rate