forked from CGM_Public/pretix_original
Fixed #119 -- Explicitly set decimal rounding mode
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
import io
|
||||
from decimal import Decimal
|
||||
|
||||
import mt940
|
||||
|
||||
from pretix.base.decimal import round_decimal
|
||||
|
||||
|
||||
def parse(file):
|
||||
data = file.read()
|
||||
@@ -20,7 +21,7 @@ def parse(file):
|
||||
'reference': "\n".join([
|
||||
t.data.get(f) for f in ('transaction_details', 'customer_reference', 'bank_reference',
|
||||
'extra_details') if t.data.get(f, '')]),
|
||||
'amount': str(t.data['amount'].amount.quantize(Decimal('.01'))),
|
||||
'amount': str(round_decimal(t.data['amount'].amount)),
|
||||
'date': t.data['date'].isoformat()
|
||||
})
|
||||
return result
|
||||
|
||||
Reference in New Issue
Block a user