Skip to content

Commit

Permalink
bcol refund fix float/decimal conversion
Browse files Browse the repository at this point in the history
Signed-off-by: Kial Jinnah <kialjinnah@gmail.com>
  • Loading branch information
kialj876 committed Feb 14, 2023
1 parent 7658574 commit 28ff797
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions jobs/payment-jobs/tasks/bcol_refund_confirmation_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ def _get_colin_bcol_records_for_invoices(cls, invoice_refs: List[InvoiceReferenc
AND qty = -1
"""
).fetchall()

bcol_refunds_all.update({x[0]: Decimal(x[1]) for x in bcol_refunds})
# total_amt will be type float from oracle. Convert to str first to avoid Decimal cast adding extra decimals
bcol_refunds_all.update({x[0]: Decimal(str(x[1])) for x in bcol_refunds})

# set invoice_number as the key (makes it easier map against)
return bcol_refunds_all
Expand Down

0 comments on commit 28ff797

Please sign in to comment.