feat(reportes): Permite consulta consolidada en Detalle de Distribución
All checks were successful
Optimized Build and Deploy / remote-build-and-deploy (push) Successful in 2m34s

Implementa la funcionalidad para generar el reporte "Detalle de Distribución de Canillas" de forma consolidada para todas las empresas, separando entre Canillitas y Accionistas. Adicionalmente, se realizan correcciones y mejoras visuales en otros reportes.

### Cambios Principales

-   **Frontend (`ReporteDetalleDistribucionCanillasPage`):**
    -   Se añade la opción "TODAS" al selector de Empresas.
    -   Al seleccionar "TODAS", se muestra un nuevo control para elegir entre "Canillitas" o "Accionistas".
    -   La vista del reporte se simplifica en el modo "TODAS", mostrando solo la tabla correspondiente y ocultando el resumen por tipo de vendedor.

-   **Backend (`ReportesService`, `ReportesRepository`):**
    -   Se modifica el servicio para recibir el parámetro `esAccionista`.
    -   Se implementa una nueva lógica que, si `idEmpresa` es 0, llama a los nuevos procedimientos almacenados que consultan todas las empresas.
    -   Se ajusta el `ReportesController` para aceptar y pasar el nuevo parámetro.

### Correcciones

-   **Base de Datos:**
    -   Se añade la función SQL `FN_ObtenerPrecioVigente` para los nuevos Stored Procedures.
    -   Se crean los Stored Procedures `SP_DistCanillasEntradaSalidaPubli_AllEmpresas` y `SP_DistCanillasAccEntradaSalidaPubli_AllEmpresas`.
-   **Backend (`ReportesController`):**
    -   Se corrigen errores de compilación (`CS7036`, `CS8130`) añadiendo el parámetro `esAccionista` faltante en las llamadas al servicio `ObtenerReporteDistribucionCanillasAsync`.

### Mejoras Visuales

-   **PDF (`ControlDevolucionesDocument.cs`):**
    -   Se ajustan los espaciados verticales (`Padding` y `Spacing`) en la plantilla QuestPDF del reporte "Control de Devoluciones" para lograr un diseño más compacto.
This commit is contained in:
2025-11-04 11:51:43 -03:00
parent e123dae182
commit 2c584e9383
10 changed files with 282 additions and 149 deletions

View File

@@ -27,16 +27,16 @@ namespace GestionIntegral.Api.Services.Reportes
// Reporte Distribucion Canillas (MC005) - Este es un reporte más complejo
Task<(
IEnumerable<DetalleDistribucionCanillaDto> Canillas,
IEnumerable<DetalleDistribucionCanillaDto> CanillasAcc,
IEnumerable<DetalleDistribucionCanillaAllDto> CanillasAll,
IEnumerable<DetalleDistribucionCanillaDto> CanillasFechaLiq,
IEnumerable<DetalleDistribucionCanillaDto> CanillasAccFechaLiq,
IEnumerable<ObtenerCtrlDevolucionesDto> CtrlDevolucionesRemitos, // Para SP_ObtenerCtrlDevoluciones
IEnumerable<ControlDevolucionesReporteDto> CtrlDevolucionesParaDistCan, // Para SP_DistCanillasCantidadEntradaSalida
IEnumerable<DevueltosOtrosDiasDto> CtrlDevolucionesOtrosDias, // <--- NUEVO para SP_DistCanillasCantidadEntradaSalidaOtrosDias
string? Error
)> ObtenerReporteDistribucionCanillasAsync(DateTime fecha, int idEmpresa);
IEnumerable<DetalleDistribucionCanillaDto> Canillas,
IEnumerable<DetalleDistribucionCanillaDto> CanillasAcc,
IEnumerable<DetalleDistribucionCanillaAllDto> CanillasAll,
IEnumerable<DetalleDistribucionCanillaDto> CanillasFechaLiq,
IEnumerable<DetalleDistribucionCanillaDto> CanillasAccFechaLiq,
IEnumerable<ObtenerCtrlDevolucionesDto> CtrlDevolucionesRemitos,
IEnumerable<ControlDevolucionesReporteDto> CtrlDevolucionesParaDistCan,
IEnumerable<DevueltosOtrosDiasDto> CtrlDevolucionesOtrosDias,
string? Error
)> ObtenerReporteDistribucionCanillasAsync(DateTime fecha, int idEmpresa, bool? esAccionista);
// Reporte Tiradas por Publicación y Secciones (RR008)
Task<(IEnumerable<TiradasPublicacionesSeccionesDto> Data, string? Error)> ObtenerTiradasPublicacionesSeccionesAsync(int idPublicacion, DateTime fechaDesde, DateTime fechaHasta, int idPlanta);