gui: fine-grained logging

This commit is contained in:
Dominik Pantůček 2025-07-12 17:35:38 +02:00
parent c3abceac5d
commit 829bab66b4

View file

@ -87,12 +87,14 @@ class ShopAdapter(QtCore.QObject):
Therefore, we construct a map that we can pass around easily.
We return None on unrecognized barcode. """
barcode = str(barcode)
logger.debug("barcodeInput: barcode='%s'", barcode)
if barcode and barcode[0] == "$":
credits = {'$02': 20, '$05': 50, '$10': 100, '$20': 200, '$50': 500, '$1k': 1000}
credit = credits[barcode]
if credit is None:
return None
return { "acctype": "recharge", "amount": str(credit)+".00" }
logger.debug("barcodeInput: before load_by_barcode")
acct = self.acct_map(brmbar.Account.load_by_barcode(db, barcode))
db.commit()
return acct