59 lines
1.6 KiB
TypeScript
59 lines
1.6 KiB
TypeScript
import { apiClient } from './client';
|
|
|
|
export interface ConciliacionCfdi {
|
|
id: number;
|
|
uuid: string;
|
|
type: string;
|
|
fechaEmision: string;
|
|
rfcEmisor: string;
|
|
nombreEmisor: string;
|
|
rfcReceptor: string;
|
|
nombreReceptor: string;
|
|
total: number;
|
|
totalMxn: number;
|
|
tipoComprobante: string | null;
|
|
montoPagoMxn: number;
|
|
montoMxn: number;
|
|
metodoPago: string | null;
|
|
conciliado: string | null;
|
|
idConciliacion: number | null;
|
|
conciliacion: {
|
|
id: number;
|
|
fechaDePago: string;
|
|
banco: string;
|
|
terminacionCuenta: string;
|
|
} | null;
|
|
}
|
|
|
|
export async function getCfdisConConciliacion(params: {
|
|
tipo: string;
|
|
fechaInicio?: string;
|
|
fechaFin?: string;
|
|
regimen?: string;
|
|
estado?: string;
|
|
contribuyenteId?: string;
|
|
}): Promise<ConciliacionCfdi[]> {
|
|
const q = new URLSearchParams();
|
|
q.set('tipo', params.tipo);
|
|
if (params.fechaInicio) q.set('fechaInicio', params.fechaInicio);
|
|
if (params.fechaFin) q.set('fechaFin', params.fechaFin);
|
|
if (params.regimen) q.set('regimen', params.regimen);
|
|
if (params.estado) q.set('estado', params.estado);
|
|
if (params.contribuyenteId) q.set('contribuyenteId', params.contribuyenteId);
|
|
const res = await apiClient.get<ConciliacionCfdi[]>(`/conciliacion?${q}`);
|
|
return res.data;
|
|
}
|
|
|
|
export async function conciliar(data: {
|
|
cfdiIds: number[];
|
|
fechaDePago: string;
|
|
idBanco: number;
|
|
}): Promise<{ count: number }> {
|
|
const res = await apiClient.post<{ count: number }>('/conciliacion', data);
|
|
return res.data;
|
|
}
|
|
|
|
export async function desconciliar(id: number): Promise<void> {
|
|
await apiClient.delete(`/conciliacion/${id}`);
|
|
}
|