<?php require_once __DIR__ . '/../includes/bootstrap.php'; require_login(); ensure_can_manage_payroll();
$id = (int)($_GET['id'] ?? 0);
db()->prepare("DELETE FROM salary_advances WHERE id=?")->execute([$id]);
audit_log('delete', 'salary_advances', $id, 'Eliminación adelanto salarial');
set_flash('success','Adelanto eliminado.');
redirect('advances/index.php');
