37 lines
1.6 KiB
TypeScript
37 lines
1.6 KiB
TypeScript
import { apiClient } from './client';
|
|
import type { EstadoResultados, FlujoEfectivo, ComparativoPeriodos, ConcentradoRfc } from '@horux/shared';
|
|
|
|
export async function getEstadoResultados(fechaInicio?: string, fechaFin?: string): Promise<EstadoResultados> {
|
|
const params = new URLSearchParams();
|
|
if (fechaInicio) params.set('fechaInicio', fechaInicio);
|
|
if (fechaFin) params.set('fechaFin', fechaFin);
|
|
const response = await apiClient.get<EstadoResultados>(`/reportes/estado-resultados?${params}`);
|
|
return response.data;
|
|
}
|
|
|
|
export async function getFlujoEfectivo(fechaInicio?: string, fechaFin?: string): Promise<FlujoEfectivo> {
|
|
const params = new URLSearchParams();
|
|
if (fechaInicio) params.set('fechaInicio', fechaInicio);
|
|
if (fechaFin) params.set('fechaFin', fechaFin);
|
|
const response = await apiClient.get<FlujoEfectivo>(`/reportes/flujo-efectivo?${params}`);
|
|
return response.data;
|
|
}
|
|
|
|
export async function getComparativo(año?: number): Promise<ComparativoPeriodos> {
|
|
const params = año ? `?año=${año}` : '';
|
|
const response = await apiClient.get<ComparativoPeriodos>(`/reportes/comparativo${params}`);
|
|
return response.data;
|
|
}
|
|
|
|
export async function getConcentradoRfc(
|
|
tipo: 'cliente' | 'proveedor',
|
|
fechaInicio?: string,
|
|
fechaFin?: string
|
|
): Promise<ConcentradoRfc[]> {
|
|
const params = new URLSearchParams({ tipo });
|
|
if (fechaInicio) params.set('fechaInicio', fechaInicio);
|
|
if (fechaFin) params.set('fechaFin', fechaFin);
|
|
const response = await apiClient.get<ConcentradoRfc[]>(`/reportes/concentrado-rfc?${params}`);
|
|
return response.data;
|
|
}
|