Skip to content

Commit

Permalink
fix: incorrect gain/loss on allocation change on reconciliation tool
Browse files Browse the repository at this point in the history
(cherry picked from commit 506a577)
  • Loading branch information
ruthra-kumar authored and mergify[bot] committed Aug 14, 2023
1 parent 72a507f commit 39c439d
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,11 @@ def is_auto_process_enabled(self):
def calculate_difference_on_allocation_change(self, payment_entry, invoice, allocated_amount):
invoice_exchange_map = self.get_invoice_exchange_map(invoice, payment_entry)
invoice[0]["exchange_rate"] = invoice_exchange_map.get(invoice[0].get("invoice_number"))
if payment_entry[0].get("reference_type") in ["Sales Invoice", "Purchase Invoice"]:
payment_entry[0]["exchange_rate"] = invoice_exchange_map.get(
payment_entry[0].get("reference_name")
)

new_difference_amount = self.get_difference_amount(
payment_entry[0], invoice[0], allocated_amount
)
Expand Down

0 comments on commit 39c439d

Please sign in to comment.