forked from CGM_Public/pretix_original
Banktransfer: Do not warn about outgoing transfers without an order code
This commit is contained in:
@@ -196,8 +196,13 @@ class ImportView(EventPermissionRequiredMixin, TemplateView):
|
|||||||
for row in data:
|
for row in data:
|
||||||
row['ok'] = False
|
row['ok'] = False
|
||||||
match = pattern.search(row['reference'].upper())
|
match = pattern.search(row['reference'].upper())
|
||||||
|
try:
|
||||||
|
amount = Decimal(amount_pattern.sub("", row['amount'].replace(",", ".")))
|
||||||
|
except:
|
||||||
|
logger.exception('Could not parse amount of transaction')
|
||||||
|
amount = 0
|
||||||
if not match:
|
if not match:
|
||||||
row['class'] = 'warning'
|
row['class'] = 'warning' if amount > 0 else ''
|
||||||
row['message'] = _('No order code detected')
|
row['message'] = _('No order code detected')
|
||||||
continue
|
continue
|
||||||
|
|
||||||
@@ -211,7 +216,6 @@ class ImportView(EventPermissionRequiredMixin, TemplateView):
|
|||||||
else:
|
else:
|
||||||
row['order'] = order
|
row['order'] = order
|
||||||
if order.status == Order.STATUS_PENDING:
|
if order.status == Order.STATUS_PENDING:
|
||||||
amount = Decimal(amount_pattern.sub("", row['amount'].replace(",", ".")))
|
|
||||||
if amount != order.total:
|
if amount != order.total:
|
||||||
row['class'] = 'danger'
|
row['class'] = 'danger'
|
||||||
row['message'] = _('Found wrong amount. Expected: %s' % str(order.total))
|
row['message'] = _('Found wrong amount. Expected: %s' % str(order.total))
|
||||||
|
|||||||
Reference in New Issue
Block a user