Skip to content

Commit

Permalink
Refactor payment information display and submission
Browse files Browse the repository at this point in the history
- Updated the `TablaPagos` component to format currency values using the `Intl.NumberFormat` API for better readability.
- Added logging statements to `FetchPostPago` function to debug form data and parameters.
- Improved the display of payment details in the `TablaCuotas` component.
  • Loading branch information
yoelmarain committed Sep 25, 2024
1 parent dd2f7d3 commit fd6b9fc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
7 changes: 7 additions & 0 deletions FrontAdmin/src/API-Alumnos/Pagos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ export const FetchPostPago = async (
formData.append('comentario', comentario);
formData.append('nro_transferencia', nro_transferencia);

console.log('FormData:', formData);
console.log('Archivo:', archivo);
console.log('Cuotas:', cuotas);
console.log('Monto informado:', montoInformado);
console.log('Comentario:', comentario);
console.log('Nro transferencia:', nro_transferencia);

// Realiza la solicitud fetch
const response = await fetch(`http://localhost:8000/api/pagos/alumno/${dni}`, {
method: 'POST',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,11 @@ function TablaCuotas({ refresh, setCuotasSeleccionadas, cuotasSeleccionadas }: T
}
<Td textAlign="center" p={1}>{cuota.numero}</Td>
<Td textAlign="center">{cuota.fechaVencimiento}</Td>
<Td textAlign="center">{"$ " + cuota.montoActual}</Td>
<Td textAlign="center">{"$ " + cuota.valorpagado}</Td>
<Td textAlign="center">{"$ " + cuota.valorinformado}</Td>
<Td textAlign="center">{"$ " + new Intl.NumberFormat('es-ES').format( cuota.montoActual)}</Td>
<Td textAlign="center">{"$ " + new Intl.NumberFormat('es-ES').format( cuota.valorpagado)}</Td>
<Td textAlign="center">{"$ " + new Intl.NumberFormat('es-ES').format( cuota.valorinformado)}</Td>
{ cuota.estado !== "PAGADO" ?
<Td textAlign="center">{"$ " + (cuota.montoActual - cuota.valorpagado - cuota.valorinformado)}</Td>
<Td textAlign="center">{"$ " + new Intl.NumberFormat('es-ES').format((cuota.montoActual - cuota.valorpagado - cuota.valorinformado))}</Td>
:
<Td textAlign="center">{"$ " + 0}</Td>
}
Expand Down

0 comments on commit fd6b9fc

Please sign in to comment.