feat(declaraciones): supervisor puede crear declaraciones y extras

- Backend: agrega 'supervisor' a ROLES_UPLOAD en documentos.controller.ts
- Frontend: agrega 'supervisor' a ROLES_UPLOAD y ROLES_UPLOAD_EXTRA en
  documentos/page.tsx para habilitar botones de subir declaración,
  comprobante de pago, eliminar y subir PDFs extra
This commit is contained in:
Horux Dev
2026-05-25 21:49:01 +00:00
parent 4a885de520
commit 929aeec641
2 changed files with 3 additions and 3 deletions

View File

@@ -71,7 +71,7 @@ export async function consultarManual(req: Request, res: Response, next: NextFun
// Declaraciones provisionales // Declaraciones provisionales
// ============================================================================ // ============================================================================
const ROLES_UPLOAD = ['owner', 'cfo', 'contador', 'auxiliar']; const ROLES_UPLOAD = ['owner', 'cfo', 'contador', 'auxiliar', 'supervisor'];
function canUpload(req: Request): boolean { function canUpload(req: Request): boolean {
return ROLES_UPLOAD.includes(req.user!.role); return ROLES_UPLOAD.includes(req.user!.role);

View File

@@ -76,7 +76,7 @@ function getPeriodLabel(periodicidad: string, mes: number): string {
const options = getPeriodOptions(periodicidad as Periodicidad); const options = getPeriodOptions(periodicidad as Periodicidad);
return options.find(o => o.value === mes)?.label || MESES[mes - 1] || String(mes); return options.find(o => o.value === mes)?.label || MESES[mes - 1] || String(mes);
} }
const ROLES_UPLOAD = ['owner', 'cfo', 'contador', 'auxiliar']; const ROLES_UPLOAD = ['owner', 'cfo', 'contador', 'auxiliar', 'supervisor'];
function EstatusBadge({ estatus }: { estatus: string }) { function EstatusBadge({ estatus }: { estatus: string }) {
if (estatus === 'Positiva') return <span className="inline-flex items-center gap-1 px-2.5 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400"><CheckCircle2 className="h-3 w-3" /> {estatus}</span>; if (estatus === 'Positiva') return <span className="inline-flex items-center gap-1 px-2.5 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400"><CheckCircle2 className="h-3 w-3" /> {estatus}</span>;
@@ -700,7 +700,7 @@ function ComprobantePagoDialog({ declaracion, onClose }: { declaracion: Declarac
// Extras — PDFs libres (acuses, contratos, poderes, estados de cuenta, etc.) // Extras — PDFs libres (acuses, contratos, poderes, estados de cuenta, etc.)
// ============================================================================ // ============================================================================
const ROLES_UPLOAD_EXTRA = ['owner', 'cfo', 'contador', 'auxiliar']; const ROLES_UPLOAD_EXTRA = ['owner', 'cfo', 'contador', 'auxiliar', 'supervisor'];
function ExtrasTab() { function ExtrasTab() {
const user = useAuthStore((s) => s.user); const user = useAuthStore((s) => s.user);