feat(customers): show razon_social, address, cp in customer views

- Add address and cp to list_customers() backend response
- Show razon_social as subtitle in customer table rows
- Add razon_social and cp fields to detail panel
- Update customers.html detail panel layout
This commit is contained in:
2026-06-11 18:28:31 +00:00
parent 2cbd69d5fa
commit 041efd5c5c
3 changed files with 18 additions and 6 deletions

View File

@@ -52,6 +52,7 @@ def list_customers():
# Fetch
cur.execute(f"""
SELECT c.id, c.name, c.rfc, c.razon_social, c.phone, c.email,
c.address, c.cp,
c.price_tier, c.credit_limit, c.credit_balance, c.vehicle_info,
c.branch_id
FROM customers c
@@ -64,11 +65,12 @@ def list_customers():
for r in cur.fetchall():
customers.append({
'id': r[0], 'name': r[1], 'rfc': r[2], 'razon_social': r[3],
'phone': r[4], 'email': r[5], 'price_tier': r[6],
'credit_limit': float(r[7]) if r[7] else 0,
'credit_balance': float(r[8]) if r[8] else 0,
'vehicle_info': r[9],
'branch_id': r[10],
'phone': r[4], 'email': r[5], 'address': r[6], 'cp': r[7],
'price_tier': r[8],
'credit_limit': float(r[9]) if r[9] else 0,
'credit_balance': float(r[10]) if r[10] else 0,
'vehicle_info': r[11],
'branch_id': r[12],
})
cur.close()