feat(customers): show vehicles and delete customer
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled

- get_customer now returns fleet_vehicles assigned to the customer.

- Added DELETE /pos/api/customers/<id> soft-delete (is_active=false) with customers.delete permission.

- Added Vehicles section in customer detail panel.

- Added Eliminar button in quick actions (owner/admin/customers.delete).
This commit is contained in:
2026-06-30 19:58:45 +00:00
parent 66b8fe3d69
commit 073c97406b
4 changed files with 114 additions and 3 deletions

View File

@@ -15,7 +15,7 @@
<meta name="theme-color" content="#F5A623" />
<link rel="shortcut icon" type="image/png" href="/pos/static/pwa/icon-192.png" />
<link rel="stylesheet" href="/pos/static/css/customers.css"></head>
<link rel="stylesheet" href="/pos/static/css/customers.css?v=34"></head>
<body>
@@ -451,6 +451,14 @@
</div>
</div>
<!-- Vehicles -->
<div class="detail-section">
<div class="detail-section__title">Veh&iacute;culos</div>
<div id="detailVehicles" style="display:flex;flex-direction:column;gap:var(--space-2);">
<span style="color:var(--color-text-muted);">Sin veh&iacute;culos registrados</span>
</div>
</div>
<!-- Quick Actions -->
<div class="detail-section">
<div class="detail-section__title">Acciones Rápidas</div>
@@ -489,6 +497,15 @@
</span>
Historial
</button>
<button class="action-btn action-btn--danger" id="btnDeleteCustomer" onclick="deleteCustomer()">
<span class="action-btn__icon">
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round">
<polyline points="3 6 5 6 13 6"/><path d="M5 6v7a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2V6"/>
<line x1="7" y1="3" x2="9" y2="3"/><line x1="4" y1="3" x2="14" y2="3"/>
</svg>
</span>
Eliminar
</button>
</div>
</div>
@@ -639,7 +656,7 @@
<script src="/pos/static/js/pos-utils.js?v=33" defer></script>
<script src="/pos/static/js/sidebar.js?v=36" defer></script>
<script src="/pos/static/js/virtual-scroll.js" defer></script>
<script src="/pos/static/js/customers.js?v=33" defer></script>
<script src="/pos/static/js/customers.js?v=34" defer></script>
<script src="/pos/static/js/offline-banner.js" defer></script>
<script src="/pos/static/js/sync-engine.js" defer></script>
<script>if('serviceWorker' in navigator){navigator.serviceWorker.register('/pos/sw.js',{scope:'/pos/'});}</script>