Skip to content

Commit

Permalink
Use decimal instead of float. (#1118)
Browse files Browse the repository at this point in the history
  • Loading branch information
seeker25 authored Feb 21, 2023
1 parent 1eab2f8 commit 786a15c
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import csv
import os
from datetime import datetime
from decimal import Decimal
from typing import Dict, List, Tuple

from entity_queue_common.service_utils import logger
Expand Down Expand Up @@ -418,7 +419,7 @@ def _process_partial_paid_invoices(inv_ref: InvoiceReferenceModel, row):
_validate_account(inv, row)
logger.debug('Partial Invoice. Invoice Reference ID : %s, invoice ID : %s', inv_ref.id, inv_ref.invoice_id)
inv.invoice_status_code = InvoiceStatus.PARTIAL.value
inv.paid = inv.total - float(_get_row_value(row, Column.TARGET_TXN_OUTSTANDING))
inv.paid = inv.total - Decimal(_get_row_value(row, Column.TARGET_TXN_OUTSTANDING))
# Create Receipt records
receipt: ReceiptModel = ReceiptModel()
receipt.receipt_date = receipt_date
Expand Down

0 comments on commit 786a15c

Please sign in to comment.