From 195449562c6cd9adb5aa9e7fa9db1fe9dcb75783 Mon Sep 17 00:00:00 2001 From: Luis Rendon Date: Fri, 19 Jan 2024 15:24:26 -0600 Subject: [PATCH] se agrego un nuevo reportes de Consolidados sin firma banco en Gemco/Operaciones. --- .../Anexo/RptConsolidadosSinFirmaBanco.tsx | 125 ++++++++++++++++++ .../Anexo/IConsolidadosSinFirmaBanco.ts | 7 + .../Operaciones/Operaciones.Services.ts | 17 +++ src/index.tsx | 6 + 4 files changed, 155 insertions(+) create mode 100644 src/Components/GEMCO/Facturacion/Anexo/RptConsolidadosSinFirmaBanco.tsx create mode 100644 src/Interfaces/Facturacion/Anexo/IConsolidadosSinFirmaBanco.ts diff --git a/src/Components/GEMCO/Facturacion/Anexo/RptConsolidadosSinFirmaBanco.tsx b/src/Components/GEMCO/Facturacion/Anexo/RptConsolidadosSinFirmaBanco.tsx new file mode 100644 index 0000000..26091e8 --- /dev/null +++ b/src/Components/GEMCO/Facturacion/Anexo/RptConsolidadosSinFirmaBanco.tsx @@ -0,0 +1,125 @@ +import { useEffect, useState } from 'react' +import { Button, Card, Col, Row } from 'react-bootstrap' +import DataTable from 'react-data-table-component' +import IConsolidadosSinFirmaBanco from '../../../../Interfaces/Facturacion/Anexo/IConsolidadosSinFirmaBanco' +import DSOperaciones from '../../../../Services/Operaciones/Operaciones.Services' +import * as XLSX from 'xlsx' +import { BsFileEarmarkExcel } from 'react-icons/bs' + +export interface IRtpConsolidadosSinFirmaBancoProps {} + +export default function RtpConsolidadosSinFirmaBanco( + props: IRtpConsolidadosSinFirmaBancoProps +) { + const [Data, setData] = useState([]) + const [Total, setTotal] = useState(0) + const columnsConcepts = [ + { + name: 'Referencia', + width: '150px', + cell: (row: IConsolidadosSinFirmaBanco) => row.referencia, + sortable: true + }, + { + name: 'Fecha Pago', + width: '250px', + cell: (row: IConsolidadosSinFirmaBanco) => row.fechaPago, + sortable: true + }, + { + name: 'Fecha Validacion', + width: '250px', + cell: (row: IConsolidadosSinFirmaBanco) => row.firmaValidacion, + sortable: true + }, + { + name: 'Firma Banco', + with: '250px', + cell: (row: IConsolidadosSinFirmaBanco) => row.firmaBanco, + sortable: true + } + ] + + const downloadExcel = () => { + exportExcel(Data, 'Consolidados sin firma de banco') + } + + function exportExcel(jsonData: any[], fileName: string): void { + let Heading = [ + ['Referencia', 'FechaPago', 'Fecha Validacion', 'Firma Banco'] + ] + const wb = XLSX.utils.book_new() + const ws: XLSX.WorkSheet = XLSX.utils.json_to_sheet([]) + XLSX.utils.sheet_add_aoa(ws, Heading) + XLSX.utils.sheet_add_json(ws, jsonData, { origin: 'A2', skipHeader: true }) + XLSX.utils.book_append_sheet(wb, ws, 'Sheet1') + XLSX.writeFile(wb, fileName + '.xlsx') + var range = XLSX.utils.decode_range(ws['!ref?']) + for (var C = range.s.c; C <= range.e.c; ++C) { + var address = XLSX.utils.encode_col(C) + '1' // <-- first row, column number C + if (!ws[address]) continue + ws[address].v = ws[address].v.toUpperCase() + } + } + + const generaReporte = () => { + DSOperaciones.OperacionesSinFirmaBancoGet() + .then((response) => { + setData(response.data) + setTotal(response.data.length) + }) + .catch((e: Error) => { + console.log(e) + }) + } + + useEffect(() => { + generaReporte() + }, []) + + return ( +
+ + + + + Consolidados sin firma banco : {Total} registros + + + + + + + + + + + + + +
+ ) +} diff --git a/src/Interfaces/Facturacion/Anexo/IConsolidadosSinFirmaBanco.ts b/src/Interfaces/Facturacion/Anexo/IConsolidadosSinFirmaBanco.ts new file mode 100644 index 0000000..9fa965c --- /dev/null +++ b/src/Interfaces/Facturacion/Anexo/IConsolidadosSinFirmaBanco.ts @@ -0,0 +1,7 @@ +export default interface IConsolidadosSinFirmaBanco{ + referencia: string, + fechaPago: string, + firmaValidacion: string, + firmaBanco: string + +} \ No newline at end of file diff --git a/src/Services/Operaciones/Operaciones.Services.ts b/src/Services/Operaciones/Operaciones.Services.ts index 6a89488..b0f7b75 100644 --- a/src/Services/Operaciones/Operaciones.Services.ts +++ b/src/Services/Operaciones/Operaciones.Services.ts @@ -1,6 +1,8 @@ import http from '../common/http-common' import IConsolidadosSinCerrar from '../../Interfaces/Facturacion/Anexo/IConsolidadosSinCerrar' import DTOAnexoFacturacionMission from '../../DTO/Facturacion/Anexo/DTOAnexoFacturacionMission' +import IConsolidadosSinFirmaBanco from '../../Interfaces/Facturacion/Anexo/IConsolidadosSinFirmaBanco' + class OperacionesDataService { Get() { @@ -8,5 +10,20 @@ class OperacionesDataService { `/AnexoFacturacion/GetRptConsolidadosSinCerrar` ) } + + OperacionesSinFirmaBancoGet(){ + return http.post( + `/AnexoFacturacion/GetRptConsolidadosSinFirmaBanco` + ) + } + + + + } + + + + + export default new OperacionesDataService() diff --git a/src/index.tsx b/src/index.tsx index 40f0a68..955589b 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -29,6 +29,7 @@ import RptArchivoElectronicoOficial from './Components/Reportes/RptArchivoElectr import RptBattery from './Components/Reportes/RptBattery' import RptControlDocumentosClientes from './Components/Reportes/RptControlDocumentosClientes' import RptConsolidadosSinCerrar from './Components/GEMCO/Facturacion/Anexo/RptConsolidadosSinCerrar' +import RtpConsolidadosSinFirmaBanco from './Components/GEMCO/Facturacion/Anexo/RptConsolidadosSinFirmaBanco' import RptDetalleAnexo24 from './Components/Reportes/RptDetalleAnexo24' import RptFacturasTxtHeineken from './Components/Reportes/RptFacturasTxtHeineken' import Notificaciones from './Components/Utils/Notificaciones/Notificaciones' @@ -144,6 +145,11 @@ ReactDOM.render( path="/RptConsolidadosSinCerrar" element={} /> + } + /> + }