Store UI cleanup and rework
This commit is contained in:
@@ -432,7 +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()
|
||||
seller = (data.get('seller') or '').strip()
|
||||
cart_items = data.get('cart_items', []) # [{id, name, price, qty, image}]
|
||||
|
||||
# Deduct stock for each sold item
|
||||
@@ -448,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, buyer):
|
||||
if data_manager.log_payment(items, total, balance_before, balance_after, seller):
|
||||
return jsonify({'success': True})
|
||||
return jsonify({'success': False, 'message': 'Error logging payment'}), 400
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user