Final de creación de Módulos de Reportes. Se procede a testeos y ordenamientos...
This commit is contained in:
@@ -4,6 +4,16 @@ import type { MovimientoBobinasDto } from '../../models/dtos/Reportes/Movimiento
|
||||
import type { MovimientoBobinasPorEstadoResponseDto } from '../../models/dtos/Reportes/MovimientoBobinasPorEstadoResponseDto';
|
||||
import type { ListadoDistribucionGeneralResponseDto } from '../../models/dtos/Reportes/ListadoDistribucionGeneralResponseDto';
|
||||
import type { ListadoDistribucionCanillasResponseDto } from '../../models/dtos/Reportes/ListadoDistribucionCanillasResponseDto';
|
||||
import type { ListadoDistribucionCanillasImporteDto } from '../../models/dtos/Reportes/ListadoDistribucionCanillasImporteDto';
|
||||
import type { VentaMensualSecretariaElDiaDto } from '../../models/dtos/Reportes/VentaMensualSecretariaElDiaDto';
|
||||
import type { VentaMensualSecretariaElPlataDto } from '../../models/dtos/Reportes/VentaMensualSecretariaElPlataDto';
|
||||
import type { VentaMensualSecretariaTirDevoDto } from '../../models/dtos/Reportes/VentaMensualSecretariaTirDevoDto';
|
||||
import type { ReporteDistribucionCanillasResponseDto } from '../../models/dtos/Reportes/ReporteDistribucionCanillasResponseDto';
|
||||
import type { TiradasPublicacionesSeccionesDto } from '../../models/dtos/Reportes/TiradasPublicacionesSeccionesDto';
|
||||
import type { ConsumoBobinasSeccionDto } from '../../models/dtos/Reportes/ConsumoBobinasSeccionDto';
|
||||
import type { ConsumoBobinasPublicacionDto } from '../../models/dtos/Reportes/ConsumoBobinasPublicacionDto';
|
||||
import type { ComparativaConsumoBobinasDto } from '../../models/dtos/Reportes/ComparativaConsumoBobinasDto';
|
||||
import type { ReporteCuentasDistribuidorResponseDto } from '../../models/dtos/Reportes/ReporteCuentasDistribuidorResponseDto';
|
||||
|
||||
interface GetExistenciaPapelParams {
|
||||
fechaDesde: string; // yyyy-MM-dd
|
||||
@@ -129,6 +139,189 @@ const getListadoDistribucionCanillasPdf = async (params: {
|
||||
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;
|
||||
};
|
||||
|
||||
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 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 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 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 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 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 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 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 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 reportesService = {
|
||||
getExistenciaPapel,
|
||||
getExistenciaPapelPdf,
|
||||
@@ -139,7 +332,27 @@ const reportesService = {
|
||||
getListadoDistribucionGeneral,
|
||||
getListadoDistribucionGeneralPdf,
|
||||
getListadoDistribucionCanillas,
|
||||
getListadoDistribucionCanillasPdf
|
||||
getListadoDistribucionCanillasPdf,
|
||||
getListadoDistribucionCanillasImporte,
|
||||
getListadoDistribucionCanillasImportePdf,
|
||||
getVentaMensualSecretariaElDia,
|
||||
getVentaMensualSecretariaElDiaPdf,
|
||||
getVentaMensualSecretariaElPlata,
|
||||
getVentaMensualSecretariaElPlataPdf,
|
||||
getVentaMensualSecretariaTirDevo,
|
||||
getVentaMensualSecretariaTirDevoPdf,
|
||||
getReporteDistribucionCanillas,
|
||||
getReporteDistribucionCanillasPdf,
|
||||
getTiradasPublicacionesSecciones,
|
||||
getTiradasPublicacionesSeccionesPdf,
|
||||
getConsumoBobinasSeccion,
|
||||
getConsumoBobinasSeccionPdf,
|
||||
getConsumoBobinasPorPublicacion,
|
||||
getConsumoBobinasPorPublicacionPdf,
|
||||
getComparativaConsumoBobinas,
|
||||
getComparativaConsumoBobinasPdf,
|
||||
getReporteCuentasDistribuidor,
|
||||
getReporteCuentasDistribuidorPdf,
|
||||
};
|
||||
|
||||
export default reportesService;
|
||||
Reference in New Issue
Block a user