import Image from 'next/image' import PropTypes from 'prop-types' import React from 'react' import styles from './Bill.module.css' /** * Componente Ticket * @param {Object} props - Propiedades del componente. * @param {Object} props.client - Datos del client?. * @param {Array} props.products - Lista de products. * @param {Object} props.restaurant - Datos del restaurant?. * @returns {JSX.Element} Elemento JSX del ticket. */ export const Bill = ({ client, urlStore = null, bill = {}, products = [], restaurant = {}, total = 0, discount = { discount: 0 }, numberFormat = () => { } }) => { const iva = 0 * 0.19 const definedValue = 'SIN DEFINIR' return (
NIT: {restaurant?.NitStore ?? definedValue}
Forma de pago: {restaurant?.paymentMethod ?? definedValue}
Direccion: {restaurant?.address ?? definedValue}
Telefono: {restaurant?.tlf ?? definedValue}
Cliente: {client?.clientName} {client.clientLastName}
Direccion: {client?.ClientAddress ?? definedValue}
Telefono: {client?.clientNumber ?? definedValue}
Valor Inicial Fact: {total || 0}
IVA: ${iva || 0}
DESCUENTO: {numberFormat(discount?.discount) || 0}
CAMBIO: {numberFormat(restaurant?.change) || 0}
Total Factura: {total || 0}
Gracias por su compra