UI cleanup

This commit is contained in:
2026-05-30 23:39:56 +02:00
parent 44c45f5410
commit fc831478de
9 changed files with 1313 additions and 561 deletions
+2 -1
View File
@@ -432,6 +432,7 @@ def log_payment():
total = float(data.get('total', 0))
balance_before = float(data.get('balance_before', 0))
balance_after = float(data.get('balance_after', 0))
buyer = (data.get('buyer') or '').strip()
cart_items = data.get('cart_items', []) # [{id, name, price, qty, image}]
# Deduct stock for each sold item
@@ -447,7 +448,7 @@ def log_payment():
# Update balance atomically with payment log
data_manager.set_balance(balance_after)
if data_manager.log_payment(items, total, balance_before, balance_after):
if data_manager.log_payment(items, total, balance_before, balance_after, buyer):
return jsonify({'success': True})
return jsonify({'success': False, 'message': 'Error logging payment'}), 400
except Exception as e: