mirror of
https://github.com/pretix/pretix.git
synced 2026-05-06 15:24:02 +00:00
Add banktransfer API
This commit is contained in:
@@ -89,18 +89,19 @@ def _get_unknown_transactions(job: BankImportJob, data: list, event: Event=None,
|
||||
transactions = []
|
||||
for row in data:
|
||||
amount = row['amount']
|
||||
if ',' in amount and '.' in amount:
|
||||
# Handle thousand-seperator , or .
|
||||
if amount.find(',') < amount.find('.'):
|
||||
amount = amount.replace(',', '')
|
||||
else:
|
||||
amount = amount.replace('.', '')
|
||||
amount = amount_pattern.sub("", amount.replace(',', '.'))
|
||||
try:
|
||||
amount = Decimal(amount)
|
||||
except:
|
||||
logger.exception('Could not parse amount of transaction: {}'.format(amount))
|
||||
amount = Decimal("0.00")
|
||||
if not isinstance(amount, Decimal):
|
||||
if ',' in amount and '.' in amount:
|
||||
# Handle thousand-seperator , or .
|
||||
if amount.find(',') < amount.find('.'):
|
||||
amount = amount.replace(',', '')
|
||||
else:
|
||||
amount = amount.replace('.', '')
|
||||
amount = amount_pattern.sub("", amount.replace(',', '.'))
|
||||
try:
|
||||
amount = Decimal(amount)
|
||||
except:
|
||||
logger.exception('Could not parse amount of transaction: {}'.format(amount))
|
||||
amount = Decimal("0.00")
|
||||
|
||||
trans = BankTransaction(event=event, organizer=organizer, import_job=job,
|
||||
payer=row.get('payer', ''),
|
||||
|
||||
Reference in New Issue
Block a user