From e866dbf854cbf27c964c13eb5c6c71ec957b5eeb Mon Sep 17 00:00:00 2001 From: Felix Morales Date: Tue, 2 Jan 2024 11:04:50 -0600 Subject: [PATCH] Agregar columnas faltantes al DataTable del componente de facturas --- .../ProveedorFactura/ProveedorFactura.tsx | 89 +++++++++++++++++-- 1 file changed, 81 insertions(+), 8 deletions(-) diff --git a/src/Components/Corresponsales/ProveedorFactura/ProveedorFactura.tsx b/src/Components/Corresponsales/ProveedorFactura/ProveedorFactura.tsx index c1e85ef..6495e99 100644 --- a/src/Components/Corresponsales/ProveedorFactura/ProveedorFactura.tsx +++ b/src/Components/Corresponsales/ProveedorFactura/ProveedorFactura.tsx @@ -47,11 +47,11 @@ export const ProveedorFactura: FC = (props) => { const MsgTime = 2000; const msgColor = 'primary'; const ClasificacionProveedor = 2; - const [Uuid, setUuid] = useState(); - const [FechaFactura, setFechaFactura] = useState(); - const [Cove, setCove] = useState(); - const [Entrega, setEntrega] = useState(); - const [Transporte, setTransporte] = useState(); + const [Uuid, setUuid] = useState(''); + const [FechaFactura, setFechaFactura] = useState(''); + const [Cove, setCove] = useState(''); + const [Entrega, setEntrega] = useState(''); + const [Transporte, setTransporte] = useState(''); const TblHeader: React.FC = () => ( = (props) => { + + + + +
Proveedor + UUID + + Fecha Factura + + COVE + + Entrega + + Transporte +
); const columnsFacturas = [ { - name: 'id', - width: '10%', + name: 'Id', + width: '65px', selector: (row: ICorresponsalFacturas) => row.id, sortable: true, }, { + name: 'Factura', + width:'150px', + selector: (row: ICorresponsalFacturas) => row.factura, + sortable: true, + }, + { + name: 'Valor Dls', + width:'100px', + selector: (row: ICorresponsalFacturas) => '$ ' + row.valorFacturaDls, + sortable: true, + }, + { + name: 'Pedido', + width:'130px', + selector: (row: ICorresponsalFacturas) => row.pedido, + sortable: true, + }, + { + name: 'Proveedor', + width:'150px', + selector: (row: ICorresponsalFacturas) => mProveedores.filter(x => x.id === row.proveedor)[0].nombre, + sortable: true, + center:true, + wrap: true + }, + { + name: 'UUID', + width:'160px', + selector: (row: ICorresponsalFacturas) => row.uuid ? row.uuid : '', + sortable: true, + center:true, + wrap: true + }, + { + name: 'Fecha Factura', + width: '125px', + selector: (row: ICorresponsalFacturas) => row.fechaFactura? row.fechaFactura!.substring(0,11) : '', + sortable: true, + }, + { + name: 'COVE', + selector: (row: ICorresponsalFacturas) => row.cove ? row.cove : '', + sortable: true, + allowOverflow: true + }, + { + name: 'Entrega', + selector: (row: ICorresponsalFacturas) => row.entrega ? row.entrega : '', + sortable: true, + }, + { + name: 'Transporte', + selector: (row: ICorresponsalFacturas) => row.transporte ? row.transporte : '', + sortable: true, + }, + /* { name: , width: '75%', cell: (row: ICorresponsalFacturas) => { return ; }, - }, + }, */ { name: 'Elimina', + width: '80px', cell: (row: ICorresponsalFacturas) => (
= (props) => { useEffect(() => { FacDataService.getAll(props.IDTrafico) .then((response) => { + console.log(response.data); dispatch(populateCorresponsalesFacturas(response.data)); }) .catch((e: Error) => {