point of sale plugin set amount to None if the exchanger fails
This commit is contained in:
parent
c71af98cbc
commit
f892671a18
|
@ -65,7 +65,10 @@ class QR_Window(QWidget):
|
|||
amount_text = ''
|
||||
if amount:
|
||||
if currency:
|
||||
try:
|
||||
self.amount = Decimal(amount) / self.exchanger.exchange(1, currency) if currency else amount
|
||||
except Exception:
|
||||
self.amount = None
|
||||
else:
|
||||
self.amount = Decimal(amount)
|
||||
self.amount = self.amount.quantize(Decimal('1.0000'))
|
||||
|
|
Loading…
Reference in New Issue