Ajustes de reportes y controles.
Se implementan DataGrid a los reportes y se mejoran los controles de selección y presentación.
This commit is contained in:
@@ -14,345 +14,393 @@ import type { ConsumoBobinasSeccionDto } from '../../models/dtos/Reportes/Consum
|
||||
import type { ConsumoBobinasPublicacionDto } from '../../models/dtos/Reportes/ConsumoBobinasPublicacionDto';
|
||||
import type { ComparativaConsumoBobinasDto } from '../../models/dtos/Reportes/ComparativaConsumoBobinasDto';
|
||||
import type { ReporteCuentasDistribuidorResponseDto } from '../../models/dtos/Reportes/ReporteCuentasDistribuidorResponseDto';
|
||||
import type { ListadoDistribucionDistribuidoresResponseDto } from '../../models/dtos/Reportes/ListadoDistribucionDistribuidoresResponseDto';
|
||||
import type { ControlDevolucionesDataResponseDto } from '../../models/dtos/Reportes/ControlDevolucionesDataResponseDto';
|
||||
|
||||
interface GetExistenciaPapelParams {
|
||||
fechaDesde: string; // yyyy-MM-dd
|
||||
fechaHasta: string; // yyyy-MM-dd
|
||||
idPlanta?: number | null;
|
||||
consolidado: boolean;
|
||||
fechaDesde: string; // yyyy-MM-dd
|
||||
fechaHasta: string; // yyyy-MM-dd
|
||||
idPlanta?: number | null;
|
||||
consolidado: boolean;
|
||||
}
|
||||
|
||||
const getExistenciaPapelPdf = async (params: GetExistenciaPapelParams): Promise<Blob> => {
|
||||
const queryParams: Record<string, string | number | boolean> = {
|
||||
fechaDesde: params.fechaDesde,
|
||||
fechaHasta: params.fechaHasta,
|
||||
consolidado: params.consolidado,
|
||||
};
|
||||
if (params.idPlanta && !params.consolidado) {
|
||||
queryParams.idPlanta = params.idPlanta;
|
||||
}
|
||||
const queryParams: Record<string, string | number | boolean> = {
|
||||
fechaDesde: params.fechaDesde,
|
||||
fechaHasta: params.fechaHasta,
|
||||
consolidado: params.consolidado,
|
||||
};
|
||||
if (params.idPlanta && !params.consolidado) {
|
||||
queryParams.idPlanta = params.idPlanta;
|
||||
}
|
||||
|
||||
const response = await apiClient.get('/reportes/existencia-papel/pdf', {
|
||||
params: queryParams,
|
||||
responseType: 'blob', // ¡Importante para descargar archivos!
|
||||
});
|
||||
return response.data; // response.data será un Blob
|
||||
const response = await apiClient.get('/reportes/existencia-papel/pdf', {
|
||||
params: queryParams,
|
||||
responseType: 'blob', // ¡Importante para descargar archivos!
|
||||
});
|
||||
return response.data; // response.data será un Blob
|
||||
};
|
||||
|
||||
const getExistenciaPapel = async (params: GetExistenciaPapelParams): Promise<ExistenciaPapelDto[]> => {
|
||||
// Construir los query params, omitiendo idPlanta si es consolidado o no está definido
|
||||
const queryParams: Record<string, string | number | boolean> = {
|
||||
fechaDesde: params.fechaDesde,
|
||||
fechaHasta: params.fechaHasta,
|
||||
consolidado: params.consolidado,
|
||||
};
|
||||
if (params.idPlanta && !params.consolidado) {
|
||||
queryParams.idPlanta = params.idPlanta;
|
||||
}
|
||||
// Construir los query params, omitiendo idPlanta si es consolidado o no está definido
|
||||
const queryParams: Record<string, string | number | boolean> = {
|
||||
fechaDesde: params.fechaDesde,
|
||||
fechaHasta: params.fechaHasta,
|
||||
consolidado: params.consolidado,
|
||||
};
|
||||
if (params.idPlanta && !params.consolidado) {
|
||||
queryParams.idPlanta = params.idPlanta;
|
||||
}
|
||||
|
||||
const response = await apiClient.get<ExistenciaPapelDto[]>('/reportes/existencia-papel', { params: queryParams });
|
||||
return response.data;
|
||||
const response = await apiClient.get<ExistenciaPapelDto[]>('/reportes/existencia-papel', { params: queryParams });
|
||||
return response.data;
|
||||
};
|
||||
|
||||
const getMovimientoBobinas = async (params: {
|
||||
fechaDesde: string;
|
||||
fechaHasta: string;
|
||||
idPlanta: number;
|
||||
fechaDesde: string;
|
||||
fechaHasta: string;
|
||||
idPlanta: number;
|
||||
}): Promise<MovimientoBobinasDto[]> => {
|
||||
const response = await apiClient.get<MovimientoBobinasDto[]>('/reportes/movimiento-bobinas', { params });
|
||||
return response.data;
|
||||
const response = await apiClient.get<MovimientoBobinasDto[]>('/reportes/movimiento-bobinas', { params });
|
||||
return response.data;
|
||||
};
|
||||
|
||||
const getMovimientoBobinasPdf = async (params: {
|
||||
fechaDesde: string;
|
||||
fechaHasta: string;
|
||||
idPlanta: number;
|
||||
fechaDesde: string;
|
||||
fechaHasta: string;
|
||||
idPlanta: number;
|
||||
}): Promise<Blob> => {
|
||||
const response = await apiClient.get('/reportes/movimiento-bobinas/pdf', {
|
||||
params,
|
||||
responseType: 'blob',
|
||||
});
|
||||
return response.data;
|
||||
const response = await apiClient.get('/reportes/movimiento-bobinas/pdf', {
|
||||
params,
|
||||
responseType: 'blob',
|
||||
});
|
||||
return response.data;
|
||||
};
|
||||
|
||||
const getMovimientoBobinasEstado = async (params: {
|
||||
fechaDesde: string;
|
||||
fechaHasta: string;
|
||||
idPlanta: number;
|
||||
fechaDesde: string;
|
||||
fechaHasta: string;
|
||||
idPlanta: number;
|
||||
}): Promise<MovimientoBobinasPorEstadoResponseDto> => { // <- Devuelve el DTO combinado
|
||||
const response = await apiClient.get<MovimientoBobinasPorEstadoResponseDto>('/reportes/movimiento-bobinas-estado', { params });
|
||||
return response.data;
|
||||
const response = await apiClient.get<MovimientoBobinasPorEstadoResponseDto>('/reportes/movimiento-bobinas-estado', { params });
|
||||
return response.data;
|
||||
};
|
||||
|
||||
const getMovimientoBobinasEstadoPdf = async (params: {
|
||||
fechaDesde: string;
|
||||
fechaHasta: string;
|
||||
idPlanta: number;
|
||||
fechaDesde: string;
|
||||
fechaHasta: string;
|
||||
idPlanta: number;
|
||||
}): Promise<Blob> => {
|
||||
const response = await apiClient.get('/reportes/movimiento-bobinas-estado/pdf', {
|
||||
params,
|
||||
responseType: 'blob',
|
||||
});
|
||||
return response.data;
|
||||
const response = await apiClient.get('/reportes/movimiento-bobinas-estado/pdf', {
|
||||
params,
|
||||
responseType: 'blob',
|
||||
});
|
||||
return response.data;
|
||||
};
|
||||
|
||||
const getListadoDistribucionGeneral = async (params: {
|
||||
idPublicacion: number;
|
||||
fechaDesde: string; // YYYY-MM-DD (primer día del mes)
|
||||
fechaHasta: string; // YYYY-MM-DD (último día del mes)
|
||||
idPublicacion: number;
|
||||
fechaDesde: string; // YYYY-MM-DD (primer día del mes)
|
||||
fechaHasta: string; // YYYY-MM-DD (último día del mes)
|
||||
}): Promise<ListadoDistribucionGeneralResponseDto> => {
|
||||
const response = await apiClient.get<ListadoDistribucionGeneralResponseDto>('/reportes/listado-distribucion-general', { params });
|
||||
return response.data;
|
||||
const response = await apiClient.get<ListadoDistribucionGeneralResponseDto>('/reportes/listado-distribucion-general', { params });
|
||||
return response.data;
|
||||
};
|
||||
|
||||
const getListadoDistribucionGeneralPdf = async (params: {
|
||||
idPublicacion: number;
|
||||
fechaDesde: string;
|
||||
fechaHasta: string;
|
||||
idPublicacion: number;
|
||||
fechaDesde: string;
|
||||
fechaHasta: string;
|
||||
}): Promise<Blob> => {
|
||||
const response = await apiClient.get('/reportes/listado-distribucion-general/pdf', {
|
||||
params,
|
||||
responseType: 'blob',
|
||||
});
|
||||
return response.data;
|
||||
const response = await apiClient.get('/reportes/listado-distribucion-general/pdf', {
|
||||
params,
|
||||
responseType: 'blob',
|
||||
});
|
||||
return response.data;
|
||||
};
|
||||
|
||||
const getListadoDistribucionCanillas = async (params: {
|
||||
idPublicacion: number;
|
||||
fechaDesde: string;
|
||||
fechaHasta: string;
|
||||
idPublicacion: number;
|
||||
fechaDesde: string;
|
||||
fechaHasta: string;
|
||||
}): Promise<ListadoDistribucionCanillasResponseDto> => {
|
||||
const response = await apiClient.get<ListadoDistribucionCanillasResponseDto>('/reportes/listado-distribucion-canillas', { params });
|
||||
return response.data;
|
||||
const response = await apiClient.get<ListadoDistribucionCanillasResponseDto>('/reportes/listado-distribucion-canillas', { params });
|
||||
return response.data;
|
||||
};
|
||||
|
||||
|
||||
const getListadoDistribucionCanillasPdf = async (params: {
|
||||
idPublicacion: number;
|
||||
fechaDesde: string;
|
||||
fechaHasta: string;
|
||||
idPublicacion: number;
|
||||
fechaDesde: string;
|
||||
fechaHasta: string;
|
||||
}): Promise<Blob> => {
|
||||
const response = await apiClient.get('/reportes/listado-distribucion-canillas/pdf', {
|
||||
params,
|
||||
responseType: 'blob',
|
||||
});
|
||||
return response.data;
|
||||
const response = await apiClient.get('/reportes/listado-distribucion-canillas/pdf', {
|
||||
params,
|
||||
responseType: 'blob',
|
||||
});
|
||||
return response.data;
|
||||
};
|
||||
|
||||
const getListadoDistribucionCanillasImporte = async (params: {
|
||||
idPublicacion: number;
|
||||
fechaDesde: string;
|
||||
fechaHasta: string;
|
||||
esAccionista: boolean;
|
||||
}): Promise<ListadoDistribucionCanillasImporteDto[]> => {
|
||||
const response = await apiClient.get<ListadoDistribucionCanillasImporteDto[]>('/reportes/listado-distribucion-canillas-importe', { params });
|
||||
return response.data;
|
||||
};
|
||||
idPublicacion: number;
|
||||
fechaDesde: string;
|
||||
fechaHasta: string;
|
||||
esAccionista: boolean;
|
||||
}): Promise<ListadoDistribucionCanillasImporteDto[]> => {
|
||||
const response = await apiClient.get<ListadoDistribucionCanillasImporteDto[]>('/reportes/listado-distribucion-canillas-importe', { params });
|
||||
return response.data;
|
||||
};
|
||||
|
||||
const getListadoDistribucionCanillasImportePdf = async (params: {
|
||||
idPublicacion: number;
|
||||
fechaDesde: string;
|
||||
fechaHasta: string;
|
||||
esAccionista: boolean;
|
||||
}): Promise<Blob> => {
|
||||
const response = await apiClient.get('/reportes/listado-distribucion-canillas-importe/pdf', {
|
||||
params,
|
||||
responseType: 'blob',
|
||||
});
|
||||
return response.data;
|
||||
};
|
||||
const getListadoDistribucionCanillasImportePdf = async (params: {
|
||||
idPublicacion: number;
|
||||
fechaDesde: string;
|
||||
fechaHasta: string;
|
||||
esAccionista: boolean;
|
||||
}): Promise<Blob> => {
|
||||
const response = await apiClient.get('/reportes/listado-distribucion-canillas-importe/pdf', {
|
||||
params,
|
||||
responseType: 'blob',
|
||||
});
|
||||
return response.data;
|
||||
};
|
||||
|
||||
const getVentaMensualSecretariaElDia = async (params: { fechaDesde: string; fechaHasta: string }): Promise<VentaMensualSecretariaElDiaDto[]> => {
|
||||
const response = await apiClient.get<VentaMensualSecretariaElDiaDto[]>('/reportes/venta-mensual-secretaria/el-dia', { params });
|
||||
return response.data;
|
||||
};
|
||||
const getVentaMensualSecretariaElDia = async (params: { fechaDesde: string; fechaHasta: string }): Promise<VentaMensualSecretariaElDiaDto[]> => {
|
||||
const response = await apiClient.get<VentaMensualSecretariaElDiaDto[]>('/reportes/venta-mensual-secretaria/el-dia', { params });
|
||||
return response.data;
|
||||
};
|
||||
|
||||
const getVentaMensualSecretariaElDiaPdf = async (params: { fechaDesde: string; fechaHasta: string }): Promise<Blob> => {
|
||||
const response = await apiClient.get('/reportes/venta-mensual-secretaria/el-dia/pdf', { params, responseType: 'blob' });
|
||||
return response.data;
|
||||
};
|
||||
const getVentaMensualSecretariaElDiaPdf = async (params: { fechaDesde: string; fechaHasta: string }): Promise<Blob> => {
|
||||
const response = await apiClient.get('/reportes/venta-mensual-secretaria/el-dia/pdf', { params, responseType: 'blob' });
|
||||
return response.data;
|
||||
};
|
||||
|
||||
const getVentaMensualSecretariaElPlata = async (params: { fechaDesde: string; fechaHasta: string }): Promise<VentaMensualSecretariaElPlataDto[]> => {
|
||||
const response = await apiClient.get<VentaMensualSecretariaElPlataDto[]>('/reportes/venta-mensual-secretaria/el-plata', { params });
|
||||
return response.data;
|
||||
};
|
||||
const getVentaMensualSecretariaElPlata = async (params: { fechaDesde: string; fechaHasta: string }): Promise<VentaMensualSecretariaElPlataDto[]> => {
|
||||
const response = await apiClient.get<VentaMensualSecretariaElPlataDto[]>('/reportes/venta-mensual-secretaria/el-plata', { params });
|
||||
return response.data;
|
||||
};
|
||||
|
||||
const getVentaMensualSecretariaElPlataPdf = async (params: { fechaDesde: string; fechaHasta: string }): Promise<Blob> => {
|
||||
const response = await apiClient.get('/reportes/venta-mensual-secretaria/el-plata/pdf', { params, responseType: 'blob' });
|
||||
return response.data;
|
||||
};
|
||||
const getVentaMensualSecretariaElPlataPdf = async (params: { fechaDesde: string; fechaHasta: string }): Promise<Blob> => {
|
||||
const response = await apiClient.get('/reportes/venta-mensual-secretaria/el-plata/pdf', { params, responseType: 'blob' });
|
||||
return response.data;
|
||||
};
|
||||
|
||||
const getVentaMensualSecretariaTirDevo = async (params: { fechaDesde: string; fechaHasta: string }): Promise<VentaMensualSecretariaTirDevoDto[]> => {
|
||||
const response = await apiClient.get<VentaMensualSecretariaTirDevoDto[]>('/reportes/venta-mensual-secretaria/tirada-devolucion', { params });
|
||||
return response.data;
|
||||
};
|
||||
const getVentaMensualSecretariaTirDevoPdf = async (params: { fechaDesde: string; fechaHasta: string }): Promise<Blob> => {
|
||||
const response = await apiClient.get('/reportes/venta-mensual-secretaria/tirada-devolucion/pdf', { params, responseType: 'blob' });
|
||||
return response.data;
|
||||
};
|
||||
const getVentaMensualSecretariaTirDevo = async (params: { fechaDesde: string; fechaHasta: string }): Promise<VentaMensualSecretariaTirDevoDto[]> => {
|
||||
const response = await apiClient.get<VentaMensualSecretariaTirDevoDto[]>('/reportes/venta-mensual-secretaria/tirada-devolucion', { params });
|
||||
return response.data;
|
||||
};
|
||||
const getVentaMensualSecretariaTirDevoPdf = async (params: { fechaDesde: string; fechaHasta: string }): Promise<Blob> => {
|
||||
const response = await apiClient.get('/reportes/venta-mensual-secretaria/tirada-devolucion/pdf', { params, responseType: 'blob' });
|
||||
return response.data;
|
||||
};
|
||||
|
||||
const getReporteDistribucionCanillas = async (params: {
|
||||
fecha: string;
|
||||
idEmpresa: number;
|
||||
}): Promise<ReporteDistribucionCanillasResponseDto> => {
|
||||
const response = await apiClient.get<ReporteDistribucionCanillasResponseDto>('/reportes/distribucion-canillas', { params });
|
||||
return response.data;
|
||||
};
|
||||
const getReporteDistribucionCanillas = async (params: {
|
||||
fecha: string;
|
||||
idEmpresa: number;
|
||||
}): Promise<ReporteDistribucionCanillasResponseDto> => {
|
||||
const response = await apiClient.get<ReporteDistribucionCanillasResponseDto>('/reportes/distribucion-canillas', { params });
|
||||
return response.data;
|
||||
};
|
||||
|
||||
const getReporteDistribucionCanillasPdf = async (params: {
|
||||
fecha: string;
|
||||
idEmpresa: number;
|
||||
soloTotales: boolean; // Nuevo parámetro
|
||||
}): Promise<Blob> => {
|
||||
const response = await apiClient.get('/reportes/distribucion-canillas/pdf', { // La ruta no necesita cambiar si el backend lo maneja
|
||||
params, // soloTotales se enviará como query param si el backend lo espera así
|
||||
responseType: 'blob',
|
||||
});
|
||||
return response.data;
|
||||
};
|
||||
const getReporteDistribucionCanillasPdf = async (params: {
|
||||
fecha: string;
|
||||
idEmpresa: number;
|
||||
soloTotales: boolean; // Nuevo parámetro
|
||||
}): Promise<Blob> => {
|
||||
const response = await apiClient.get('/reportes/distribucion-canillas/pdf', { // La ruta no necesita cambiar si el backend lo maneja
|
||||
params, // soloTotales se enviará como query param si el backend lo espera así
|
||||
responseType: 'blob',
|
||||
});
|
||||
return response.data;
|
||||
};
|
||||
|
||||
const getTiradasPublicacionesSecciones = async (params: {
|
||||
idPublicacion: number;
|
||||
fechaDesde: string;
|
||||
fechaHasta: string;
|
||||
idPlanta?: number | null;
|
||||
consolidado: boolean;
|
||||
}): Promise<TiradasPublicacionesSeccionesDto[]> => {
|
||||
const response = await apiClient.get<TiradasPublicacionesSeccionesDto[]>('/reportes/tiradas-publicaciones-secciones', { params });
|
||||
return response.data;
|
||||
};
|
||||
const getTiradasPublicacionesSecciones = async (params: {
|
||||
idPublicacion: number;
|
||||
fechaDesde: string;
|
||||
fechaHasta: string;
|
||||
idPlanta?: number | null;
|
||||
consolidado: boolean;
|
||||
}): Promise<TiradasPublicacionesSeccionesDto[]> => {
|
||||
const response = await apiClient.get<TiradasPublicacionesSeccionesDto[]>('/reportes/tiradas-publicaciones-secciones', { params });
|
||||
return response.data;
|
||||
};
|
||||
|
||||
const getTiradasPublicacionesSeccionesPdf = async (params: {
|
||||
idPublicacion: number;
|
||||
fechaDesde: string;
|
||||
fechaHasta: string;
|
||||
idPlanta?: number | null;
|
||||
consolidado: boolean;
|
||||
}): Promise<Blob> => {
|
||||
const response = await apiClient.get('/reportes/tiradas-publicaciones-secciones/pdf', {
|
||||
params,
|
||||
responseType: 'blob',
|
||||
});
|
||||
return response.data;
|
||||
};
|
||||
const getTiradasPublicacionesSeccionesPdf = async (params: {
|
||||
idPublicacion: number;
|
||||
fechaDesde: string;
|
||||
fechaHasta: string;
|
||||
idPlanta?: number | null;
|
||||
consolidado: boolean;
|
||||
}): Promise<Blob> => {
|
||||
const response = await apiClient.get('/reportes/tiradas-publicaciones-secciones/pdf', {
|
||||
params,
|
||||
responseType: 'blob',
|
||||
});
|
||||
return response.data;
|
||||
};
|
||||
|
||||
const getConsumoBobinasSeccion = async (params: {
|
||||
fechaDesde: string;
|
||||
fechaHasta: string;
|
||||
idPlanta?: number | null;
|
||||
consolidado: boolean;
|
||||
}): Promise<ConsumoBobinasSeccionDto[]> => {
|
||||
const response = await apiClient.get<ConsumoBobinasSeccionDto[]>('/reportes/consumo-bobinas-seccion', { params });
|
||||
return response.data;
|
||||
};
|
||||
const getConsumoBobinasSeccion = async (params: {
|
||||
fechaDesde: string;
|
||||
fechaHasta: string;
|
||||
idPlanta?: number | null;
|
||||
consolidado: boolean;
|
||||
}): Promise<ConsumoBobinasSeccionDto[]> => {
|
||||
const response = await apiClient.get<ConsumoBobinasSeccionDto[]>('/reportes/consumo-bobinas-seccion', { params });
|
||||
return response.data;
|
||||
};
|
||||
|
||||
const getConsumoBobinasSeccionPdf = async (params: {
|
||||
fechaDesde: string;
|
||||
fechaHasta: string;
|
||||
idPlanta?: number | null;
|
||||
consolidado: boolean;
|
||||
}): Promise<Blob> => {
|
||||
const response = await apiClient.get('/reportes/consumo-bobinas-seccion/pdf', {
|
||||
params,
|
||||
responseType: 'blob',
|
||||
});
|
||||
return response.data;
|
||||
};
|
||||
const getConsumoBobinasSeccionPdf = async (params: {
|
||||
fechaDesde: string;
|
||||
fechaHasta: string;
|
||||
idPlanta?: number | null;
|
||||
consolidado: boolean;
|
||||
}): Promise<Blob> => {
|
||||
const response = await apiClient.get('/reportes/consumo-bobinas-seccion/pdf', {
|
||||
params,
|
||||
responseType: 'blob',
|
||||
});
|
||||
return response.data;
|
||||
};
|
||||
|
||||
const getConsumoBobinasPorPublicacion = async (params: {
|
||||
fechaDesde: string;
|
||||
fechaHasta: string;
|
||||
}): Promise<ConsumoBobinasPublicacionDto[]> => {
|
||||
const response = await apiClient.get<ConsumoBobinasPublicacionDto[]>('/reportes/consumo-bobinas-publicacion', { params });
|
||||
return response.data;
|
||||
};
|
||||
const getConsumoBobinasPorPublicacion = async (params: {
|
||||
fechaDesde: string;
|
||||
fechaHasta: string;
|
||||
}): Promise<ConsumoBobinasPublicacionDto[]> => {
|
||||
const response = await apiClient.get<ConsumoBobinasPublicacionDto[]>('/reportes/consumo-bobinas-publicacion', { params });
|
||||
return response.data;
|
||||
};
|
||||
|
||||
const getConsumoBobinasPorPublicacionPdf = async (params: {
|
||||
fechaDesde: string;
|
||||
fechaHasta: string;
|
||||
}): Promise<Blob> => {
|
||||
const response = await apiClient.get('/reportes/consumo-bobinas-publicacion/pdf', {
|
||||
params,
|
||||
responseType: 'blob',
|
||||
});
|
||||
return response.data;
|
||||
};
|
||||
const getConsumoBobinasPorPublicacionPdf = async (params: {
|
||||
fechaDesde: string;
|
||||
fechaHasta: string;
|
||||
}): Promise<Blob> => {
|
||||
const response = await apiClient.get('/reportes/consumo-bobinas-publicacion/pdf', {
|
||||
params,
|
||||
responseType: 'blob',
|
||||
});
|
||||
return response.data;
|
||||
};
|
||||
|
||||
const getComparativaConsumoBobinas = async (params: {
|
||||
fechaInicioMesA: string; fechaFinMesA: string;
|
||||
fechaInicioMesB: string; fechaFinMesB: string;
|
||||
idPlanta?: number | null; consolidado: boolean;
|
||||
}): Promise<ComparativaConsumoBobinasDto[]> => {
|
||||
const response = await apiClient.get<ComparativaConsumoBobinasDto[]>('/reportes/comparativa-consumo-bobinas', { params });
|
||||
return response.data;
|
||||
};
|
||||
const getComparativaConsumoBobinas = async (params: {
|
||||
fechaInicioMesA: string; fechaFinMesA: string;
|
||||
fechaInicioMesB: string; fechaFinMesB: string;
|
||||
idPlanta?: number | null; consolidado: boolean;
|
||||
}): Promise<ComparativaConsumoBobinasDto[]> => {
|
||||
const response = await apiClient.get<ComparativaConsumoBobinasDto[]>('/reportes/comparativa-consumo-bobinas', { params });
|
||||
return response.data;
|
||||
};
|
||||
|
||||
const getComparativaConsumoBobinasPdf = async (params: {
|
||||
fechaInicioMesA: string; fechaFinMesA: string;
|
||||
fechaInicioMesB: string; fechaFinMesB: string;
|
||||
idPlanta?: number | null; consolidado: boolean;
|
||||
}): Promise<Blob> => {
|
||||
const response = await apiClient.get('/reportes/comparativa-consumo-bobinas/pdf', {
|
||||
params,
|
||||
responseType: 'blob',
|
||||
});
|
||||
return response.data;
|
||||
};
|
||||
const getComparativaConsumoBobinasPdf = async (params: {
|
||||
fechaInicioMesA: string; fechaFinMesA: string;
|
||||
fechaInicioMesB: string; fechaFinMesB: string;
|
||||
idPlanta?: number | null; consolidado: boolean;
|
||||
}): Promise<Blob> => {
|
||||
const response = await apiClient.get('/reportes/comparativa-consumo-bobinas/pdf', {
|
||||
params,
|
||||
responseType: 'blob',
|
||||
});
|
||||
return response.data;
|
||||
};
|
||||
|
||||
const getReporteCuentasDistribuidor = async (params: {
|
||||
idDistribuidor: number;
|
||||
idEmpresa: number;
|
||||
fechaDesde: string;
|
||||
fechaHasta: string;
|
||||
}): Promise<ReporteCuentasDistribuidorResponseDto> => {
|
||||
const response = await apiClient.get<ReporteCuentasDistribuidorResponseDto>('/reportes/cuentas-distribuidores', { params });
|
||||
return response.data;
|
||||
};
|
||||
const getReporteCuentasDistribuidor = async (params: {
|
||||
idDistribuidor: number;
|
||||
idEmpresa: number;
|
||||
fechaDesde: string;
|
||||
fechaHasta: string;
|
||||
}): Promise<ReporteCuentasDistribuidorResponseDto> => {
|
||||
const response = await apiClient.get<ReporteCuentasDistribuidorResponseDto>('/reportes/cuentas-distribuidores', { params });
|
||||
return response.data;
|
||||
};
|
||||
|
||||
const getReporteCuentasDistribuidorPdf = async (params: {
|
||||
idDistribuidor: number;
|
||||
idEmpresa: number;
|
||||
fechaDesde: string;
|
||||
fechaHasta: string;
|
||||
}): Promise<Blob> => {
|
||||
const response = await apiClient.get('/reportes/cuentas-distribuidores/pdf', {
|
||||
params,
|
||||
responseType: 'blob',
|
||||
});
|
||||
return response.data;
|
||||
};
|
||||
const getReporteCuentasDistribuidorPdf = async (params: {
|
||||
idDistribuidor: number;
|
||||
idEmpresa: number;
|
||||
fechaDesde: string;
|
||||
fechaHasta: string;
|
||||
}): Promise<Blob> => {
|
||||
const response = await apiClient.get('/reportes/cuentas-distribuidores/pdf', {
|
||||
params,
|
||||
responseType: 'blob',
|
||||
});
|
||||
return response.data;
|
||||
};
|
||||
|
||||
const getListadoDistribucionDistribuidores = async (params: {
|
||||
idDistribuidor: number;
|
||||
idPublicacion: number;
|
||||
fechaDesde: string;
|
||||
fechaHasta: string;
|
||||
}): Promise<ListadoDistribucionDistribuidoresResponseDto> => {
|
||||
const response = await apiClient.get<ListadoDistribucionDistribuidoresResponseDto>('/reportes/listado-distribucion-distribuidores', { params });
|
||||
return response.data;
|
||||
};
|
||||
|
||||
const getListadoDistribucionDistribuidoresPdf = async (params: {
|
||||
idDistribuidor: number;
|
||||
idPublicacion: number;
|
||||
fechaDesde: string;
|
||||
fechaHasta: string;
|
||||
}): Promise<Blob> => {
|
||||
const response = await apiClient.get('/reportes/listado-distribucion-distribuidores/pdf', {
|
||||
params,
|
||||
responseType: 'blob',
|
||||
});
|
||||
return response.data;
|
||||
};
|
||||
|
||||
const getControlDevolucionesData = async (params: {
|
||||
fecha: string; // YYYY-MM-DD
|
||||
idEmpresa: number;
|
||||
}): Promise<ControlDevolucionesDataResponseDto> => {
|
||||
const response = await apiClient.get<ControlDevolucionesDataResponseDto>('/reportes/control-devoluciones', { params });
|
||||
return response.data;
|
||||
};
|
||||
|
||||
const getControlDevolucionesPdf = async (params: {
|
||||
fecha: string; // YYYY-MM-DD
|
||||
idEmpresa: number;
|
||||
}): Promise<Blob> => {
|
||||
const response = await apiClient.get('/reportes/control-devoluciones/pdf', {
|
||||
params,
|
||||
responseType: 'blob',
|
||||
});
|
||||
return response.data;
|
||||
};
|
||||
|
||||
const reportesService = {
|
||||
getExistenciaPapel,
|
||||
getExistenciaPapelPdf,
|
||||
getMovimientoBobinas,
|
||||
getMovimientoBobinasPdf,
|
||||
getMovimientoBobinasEstado,
|
||||
getMovimientoBobinasEstadoPdf,
|
||||
getListadoDistribucionGeneral,
|
||||
getListadoDistribucionGeneralPdf,
|
||||
getListadoDistribucionCanillas,
|
||||
getListadoDistribucionCanillasPdf,
|
||||
getListadoDistribucionCanillasImporte,
|
||||
getListadoDistribucionCanillasImportePdf,
|
||||
getVentaMensualSecretariaElDia,
|
||||
getVentaMensualSecretariaElDiaPdf,
|
||||
getVentaMensualSecretariaElPlata,
|
||||
getVentaMensualSecretariaElPlataPdf,
|
||||
getVentaMensualSecretariaTirDevo,
|
||||
getVentaMensualSecretariaTirDevoPdf,
|
||||
getReporteDistribucionCanillas,
|
||||
getReporteDistribucionCanillasPdf,
|
||||
getTiradasPublicacionesSecciones,
|
||||
getTiradasPublicacionesSeccionesPdf,
|
||||
getConsumoBobinasSeccion,
|
||||
getConsumoBobinasSeccionPdf,
|
||||
getConsumoBobinasPorPublicacion,
|
||||
getConsumoBobinasPorPublicacionPdf,
|
||||
getComparativaConsumoBobinas,
|
||||
getComparativaConsumoBobinasPdf,
|
||||
getReporteCuentasDistribuidor,
|
||||
getReporteCuentasDistribuidorPdf,
|
||||
getExistenciaPapel,
|
||||
getExistenciaPapelPdf,
|
||||
getMovimientoBobinas,
|
||||
getMovimientoBobinasPdf,
|
||||
getMovimientoBobinasEstado,
|
||||
getMovimientoBobinasEstadoPdf,
|
||||
getListadoDistribucionGeneral,
|
||||
getListadoDistribucionGeneralPdf,
|
||||
getListadoDistribucionCanillas,
|
||||
getListadoDistribucionCanillasPdf,
|
||||
getListadoDistribucionCanillasImporte,
|
||||
getListadoDistribucionCanillasImportePdf,
|
||||
getVentaMensualSecretariaElDia,
|
||||
getVentaMensualSecretariaElDiaPdf,
|
||||
getVentaMensualSecretariaElPlata,
|
||||
getVentaMensualSecretariaElPlataPdf,
|
||||
getVentaMensualSecretariaTirDevo,
|
||||
getVentaMensualSecretariaTirDevoPdf,
|
||||
getReporteDistribucionCanillas,
|
||||
getReporteDistribucionCanillasPdf,
|
||||
getTiradasPublicacionesSecciones,
|
||||
getTiradasPublicacionesSeccionesPdf,
|
||||
getConsumoBobinasSeccion,
|
||||
getConsumoBobinasSeccionPdf,
|
||||
getConsumoBobinasPorPublicacion,
|
||||
getConsumoBobinasPorPublicacionPdf,
|
||||
getComparativaConsumoBobinas,
|
||||
getComparativaConsumoBobinasPdf,
|
||||
getReporteCuentasDistribuidor,
|
||||
getReporteCuentasDistribuidorPdf,
|
||||
getListadoDistribucionDistribuidores,
|
||||
getListadoDistribucionDistribuidoresPdf,
|
||||
getControlDevolucionesData,
|
||||
getControlDevolucionesPdf,
|
||||
};
|
||||
|
||||
export default reportesService;
|
||||
Reference in New Issue
Block a user