Update: nueva version Horux Despachos

This commit is contained in:
consultoria-as
2026-04-27 22:09:36 -06:00
commit 6b36db1403
614 changed files with 125926 additions and 0 deletions

View File

@@ -0,0 +1,69 @@
import { apiClient } from './client';
import type { EstadoResultados, FlujoEfectivo, ComparativoPeriodos, ConcentradoRfc } from '@horux/shared';
export async function getEstadoResultados(fechaInicio?: string, fechaFin?: string, contribuyenteId?: string): Promise<EstadoResultados> {
const params = new URLSearchParams();
if (fechaInicio) params.set('fechaInicio', fechaInicio);
if (fechaFin) params.set('fechaFin', fechaFin);
if (contribuyenteId) params.set('contribuyenteId', contribuyenteId);
const response = await apiClient.get<EstadoResultados>(`/reportes/estado-resultados?${params}`);
return response.data;
}
export async function getFlujoEfectivo(fechaInicio?: string, fechaFin?: string, contribuyenteId?: string): Promise<FlujoEfectivo> {
const params = new URLSearchParams();
if (fechaInicio) params.set('fechaInicio', fechaInicio);
if (fechaFin) params.set('fechaFin', fechaFin);
if (contribuyenteId) params.set('contribuyenteId', contribuyenteId);
const response = await apiClient.get<FlujoEfectivo>(`/reportes/flujo-efectivo?${params}`);
return response.data;
}
export async function getComparativo(año?: number, contribuyenteId?: string): Promise<ComparativoPeriodos> {
const params = new URLSearchParams();
if (año) params.set('año', String(año));
if (contribuyenteId) params.set('contribuyenteId', contribuyenteId);
const qs = params.toString();
const response = await apiClient.get<ComparativoPeriodos>(`/reportes/comparativo${qs ? `?${qs}` : ''}`);
return response.data;
}
export async function getConcentradoRfc(
tipo: 'cliente' | 'proveedor',
fechaInicio?: string,
fechaFin?: string,
contribuyenteId?: string,
): Promise<ConcentradoRfc[]> {
const params = new URLSearchParams({ tipo });
if (fechaInicio) params.set('fechaInicio', fechaInicio);
if (fechaFin) params.set('fechaFin', fechaFin);
if (contribuyenteId) params.set('contribuyenteId', contribuyenteId);
const response = await apiClient.get<ConcentradoRfc[]>(`/reportes/concentrado-rfc?${params}`);
return response.data;
}
export interface CuentasPendientes {
cantidadCfdis: number;
saldoTotal: number;
detalle: { rfc: string; nombre: string; cantidad: number; saldo: number }[];
}
export async function getCuentasXPagar(fechaInicio: string, fechaFin: string, regimen?: string, contribuyenteId?: string): Promise<CuentasPendientes> {
const params = new URLSearchParams();
params.set('fechaInicio', fechaInicio);
params.set('fechaFin', fechaFin);
if (regimen) params.set('regimen', regimen);
if (contribuyenteId) params.set('contribuyenteId', contribuyenteId);
const response = await apiClient.get<CuentasPendientes>(`/reportes/cuentas-x-pagar?${params}`);
return response.data;
}
export async function getCuentasXCobrar(fechaInicio: string, fechaFin: string, regimen?: string, contribuyenteId?: string): Promise<CuentasPendientes> {
const params = new URLSearchParams();
params.set('fechaInicio', fechaInicio);
params.set('fechaFin', fechaFin);
if (regimen) params.set('regimen', regimen);
if (contribuyenteId) params.set('contribuyenteId', contribuyenteId);
const response = await apiClient.get<CuentasPendientes>(`/reportes/cuentas-x-cobrar?${params}`);
return response.data;
}