feat(customers): hard-delete customers
DELETE /customers/<id> now removes the row. - Deletes layaways and dependent items/payments. - Nullifies customer_id in sales, service_orders, fleet_vehicles, plate_vehicles, quotations, returns, warranties, bnpl_transactions, customer_payments. - Cascade-delete CRM tables are handled by FK constraints.
This commit is contained in:
@@ -442,7 +442,7 @@ const Customers = (() => {
|
||||
alert('No tienes permiso para eliminar clientes');
|
||||
return;
|
||||
}
|
||||
if (!confirm(`¿Eliminar al cliente "${currentCustomer.name}"? Se marcará como inactivo.`)) return;
|
||||
if (!confirm(`¿Eliminar al cliente "${currentCustomer.name}"? Se borrará completamente. Las ventas, órdenes y vehículos conservarán sus datos pero quedarán sin cliente asignado.`)) return;
|
||||
try {
|
||||
await api(`/pos/api/customers/${currentCustomer.id}`, { method: 'DELETE' });
|
||||
alert('Cliente eliminado');
|
||||
|
||||
Reference in New Issue
Block a user