Skip to content

Commit

Permalink
Merge pull request #161 from QuanMPhm/157/invoice_rounding
Browse files Browse the repository at this point in the history
Added rounding to Cost and Rate for storage invoice
  • Loading branch information
knikolla committed May 31, 2024
2 parents 4852752 + 775afd2 commit 6a2d53a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import csv
from decimal import Decimal
from decimal import Decimal, ROUND_HALF_UP
import dataclasses
from datetime import datetime, timedelta
import logging
Expand Down Expand Up @@ -161,7 +161,7 @@ def process_invoice_row(allocation, attrs, su_name, rate):
Invoice_Type_Hours=time,
Invoice_Type=su_name,
Rate=rate,
Cost=time * rate
Cost=(time * rate).quantize(Decimal('.01'), rounding=ROUND_HALF_UP)
)
csv_invoice_writer.writerow(
row.get_values()
Expand Down

0 comments on commit 6a2d53a

Please sign in to comment.