import React, { useEffect, useState } from "react"; import { obtenerEspecifico, obtenerGet, procesarBoleta, registrarPost } from "../lib/conexionApi"; import { Navigate } from "react-router"; const ModalBoleta = ({ fecha, setModalBoleta, precioTotal, carrito, prescripcion, adelanto, precioLunas, setPrescripcion, setPrecioTotal, setCarrito }) => { const [clienteBoleta, setClienteBoleta] = useState({}) const [errorClienteBoleta, setErrorClienteBoleta] = useState(false) const [boleta, setBoleta] = useState({}) const [errorBoleta, setErrorBoleta] = useState(false) const [boletaEmitida, setBoletaEmitida] = useState(false) useEffect(() => { obtenerEspecifico("clientes/prescripcion", { "id_prescripcion": prescripcion[0]["id_prescripcion"] }, setClienteBoleta, setErrorClienteBoleta) }, []) return (
Arte Visual
Av. Los Héroes 632 S. J. M
902 501 054/968 600 415
Señor(a): {clienteBoleta["nombres_y_apellidos"]}
Dirección: {clienteBoleta["direccion"]}
Teléfono: {clienteBoleta["telefono"]}
NOTA DE PEDIDO
00000{prescripcion[0]["id_prescripcion"]}
Fecha: {fecha}
Tabla de productos
| Cantidad | Descripción | Precio Unit. | Importe |
|---|---|---|---|
| {item["cantidad"]} | {item["montura"]["nombre_montura"]} | S/.{item["monturaInventario"]["precio_unit"]} | S/.{item["monturaInventario"]["precio_unit"]*item["cantidad"]} |
| {1} | detalle de lunas: {prescripcion[0]["detalle_lunas"]} | S/.{parseFloat(precioLunas)} | S/.{1*parseFloat(precioLunas)} |
Adelanto: S/.{adelanto}
Saldo: S/.{precioTotal-adelanto}
Total: S/.{precioTotal}