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:
@@ -71,7 +71,7 @@ export async function consultarManual(req: Request, res: Response, next: NextFun
|
||||
// Declaraciones provisionales
|
||||
// ============================================================================
|
||||
|
||||
const ROLES_UPLOAD = ['owner', 'cfo', 'contador', 'auxiliar'];
|
||||
const ROLES_UPLOAD = ['owner', 'cfo', 'contador', 'auxiliar', 'supervisor'];
|
||||
|
||||
function canUpload(req: Request): boolean {
|
||||
return ROLES_UPLOAD.includes(req.user!.role);
|
||||
|
||||
@@ -76,7 +76,7 @@ function getPeriodLabel(periodicidad: string, mes: number): string {
|
||||
const options = getPeriodOptions(periodicidad as Periodicidad);
|
||||
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 }) {
|
||||
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.)
|
||||
// ============================================================================
|
||||
|
||||
const ROLES_UPLOAD_EXTRA = ['owner', 'cfo', 'contador', 'auxiliar'];
|
||||
const ROLES_UPLOAD_EXTRA = ['owner', 'cfo', 'contador', 'auxiliar', 'supervisor'];
|
||||
|
||||
function ExtrasTab() {
|
||||
const user = useAuthStore((s) => s.user);
|
||||
|
||||
Reference in New Issue
Block a user