From 422a0f7821a4a99427bf0c5984aecba4704eeeb2 Mon Sep 17 00:00:00 2001 From: Felix Morales Date: Fri, 3 Nov 2023 18:05:14 -0500 Subject: [PATCH] avance al proceso de heineken --- src/App.tsx | 4 +- .../Corresponsales/CCorresponsalesTrafico.ts | 12 +- src/Components/Clientes/Clientes.tsx | 5 +- .../Corresponsales/TraficoCorresponsales.tsx | 390 ++++++++++++++---- .../Embarques/BuscarEmbarques.tsx | 163 ++++++++ .../Embarques/EmbarquesDespachados.tsx | 217 ++++++++++ .../Embarques/EmbarquesPorImportar.tsx | 163 ++++++++ .../Embarques/ReportesEmbarques.tsx | 31 +- src/Components/Utils/CellIcon/CellIcon.tsx | 74 ++++ .../Reportes/Embarques/DTOBuscarEmbarques.ts | 43 ++ ...ts => DTOReportesEmabarquesDespachados.ts} | 2 +- .../DTOReportesEmabarquesPorImportar.ts | 61 +++ .../Corresponsales/ICorresponsalPedimento.ts | 7 +- .../Corresponsales/ICorresponsalTrafico.ts | 2 + .../Reportes/reportesEmbarques.Service.ts | 34 ++ src/Services/Utils/FileManager.Services.ts | 10 + src/Services/Utils/MFileManager.Service.ts | 6 +- .../CorresponsalesTraficoSlice.ts | 4 +- 18 files changed, 1119 insertions(+), 109 deletions(-) create mode 100644 src/Components/ReportesClientes/Embarques/BuscarEmbarques.tsx create mode 100644 src/Components/ReportesClientes/Embarques/EmbarquesDespachados.tsx create mode 100644 src/Components/ReportesClientes/Embarques/EmbarquesPorImportar.tsx create mode 100644 src/Components/Utils/CellIcon/CellIcon.tsx create mode 100644 src/DTO/Reportes/Embarques/DTOBuscarEmbarques.ts rename src/DTO/Reportes/Embarques/{DTOReportesEmabarques.ts => DTOReportesEmabarquesDespachados.ts} (97%) create mode 100644 src/DTO/Reportes/Embarques/DTOReportesEmabarquesPorImportar.ts create mode 100644 src/Services/Reportes/reportesEmbarques.Service.ts diff --git a/src/App.tsx b/src/App.tsx index e66f6e2..4fadc58 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -11,6 +11,7 @@ import { RootState } from './store/store' import { MsgInformativo } from './Components/Utils/Toast/msgInformativo' import { IconContext } from 'react-icons' import { BsPersonCircle } from 'react-icons/bs' +import {TbDoorExit} from 'react-icons/tb' import Submenu from './Components/Submenu/Submenu' function App() { @@ -102,9 +103,8 @@ function App() { Logout
- + -  
{Depto} 
)} diff --git a/src/Classes/Corresponsales/CCorresponsalesTrafico.ts b/src/Classes/Corresponsales/CCorresponsalesTrafico.ts index 133ee8d..6445e46 100644 --- a/src/Classes/Corresponsales/CCorresponsalesTrafico.ts +++ b/src/Classes/Corresponsales/CCorresponsalesTrafico.ts @@ -45,6 +45,8 @@ export default class CCorresponsalesTrafico implements ICorresponsalTrafico { idTipoMercancia: number | null; cargoA: number; causaRectificacion: string; + totalHonorariosAA: number; + totalGastosTerceros: number; constructor() { this.id=0 @@ -91,6 +93,8 @@ export default class CCorresponsalesTrafico implements ICorresponsalTrafico { this.idTipoMercancia=null; this.cargoA = 0; this.causaRectificacion = '' + this.totalHonorariosAA = 0 + this.totalGastosTerceros = 0 } public getEmptyObject(): ICorresponsalTrafico { @@ -138,7 +142,9 @@ export default class CCorresponsalesTrafico implements ICorresponsalTrafico { activo :1 , idTipoMercancia: null, cargoA: 0, - causaRectificacion: '' + causaRectificacion: '', + totalHonorariosAA: 0, + totalGastosTerceros: 0 } } @@ -187,7 +193,9 @@ export default class CCorresponsalesTrafico implements ICorresponsalTrafico { activo : data.activo, idTipoMercancia: data.idTipoMercancia, cargoA: data.cargoA, - causaRectificacion: data.causaRectificacion + causaRectificacion: data.causaRectificacion, + totalHonorariosAA: data.totalHonorariosAA, + totalGastosTerceros: data.totalGastosTerceros } } } \ No newline at end of file diff --git a/src/Components/Clientes/Clientes.tsx b/src/Components/Clientes/Clientes.tsx index 6eefc2f..007b468 100644 --- a/src/Components/Clientes/Clientes.tsx +++ b/src/Components/Clientes/Clientes.tsx @@ -1,17 +1,16 @@ import React from "react"; import { SideBarMenu } from "../Utils/SideBar/SideBar"; -import { Outlet, Route, Routes } from "react-router-dom"; +import { Outlet} from "react-router-dom"; export const ClientesExternos: React.FC = () => { + return ( - <>
- ) } \ No newline at end of file diff --git a/src/Components/Corresponsales/TraficoCorresponsales.tsx b/src/Components/Corresponsales/TraficoCorresponsales.tsx index 38acf24..c5109d8 100644 --- a/src/Components/Corresponsales/TraficoCorresponsales.tsx +++ b/src/Components/Corresponsales/TraficoCorresponsales.tsx @@ -267,6 +267,7 @@ export default function TraficoCorresponsales (props:IProps) { ]) const [IDAduana, setIDAduana] = useState(0) const [CostoDiario, setCostoDiario] = useState(0) + const [CostoDiarioConexion, setCostoDiarioConexion] = useState(0) const [Descripcion, setDescripcion] = useState('') const [IDDestino, setIDDestino] = useState(0) const [DiasPedPagado, setDiasPedPagado] = useState(0) @@ -285,6 +286,8 @@ export default function TraficoCorresponsales (props:IProps) { const [Incoterm, setIncoterm] = useState('') const [LineaTransportistaInternacional, setLineaTransportistaInternacional] = useState('') + const [LineaNaviera, setLineaNaviera] = useState('') + const [FNotificacion, setFNotificacion] = useState('') const [MAWB, setMAWB] = useState('') const [MontoUSD, setMontoUSD] = useState(0) const [NoGuia, setNoGuia] = useState('') @@ -292,10 +295,12 @@ export default function TraficoCorresponsales (props:IProps) { const [Otros, setOtros] = useState(0) const [Transportista, setTransportista] = useState('') const [PesoNeto, setPesoNeto] = useState(0) + const [FraccionArancelaria, setFraccionArancelaria] = useState('') const [PreferenciaArancelaria, setPreferenciaArancelaria] = useState(0) const [Seguros, setSeguros] = useState(0) const [IDTipoEmbarque, setIDTipoEmbarque] = useState(0) const [TotalPagar, setTotalPagar] = useState(0) + const [TotalPagarConexion, setTotalPagarConexion] = useState(0) const [ChangePermission, setChangePermission] = useState(false) const [Ready4NextProcess, setReady4NextProcess] = useState(false) const [TerminaProceso, setTerminaProceso] = useState(-100) @@ -308,6 +313,8 @@ export default function TraficoCorresponsales (props:IProps) { const [PedimentoH, setPedimentoH] = useState('') const [ClavePedimentoH, setClavePedimentoH] = useState('') const [FechaPagoH, setFechaPagoH] = useState('') + const [TotalHonorariosAA, setTotalHonorariosAA] = useState(0) + const [TotalGastosTerceros, setTotalGastosTerceros] = useState(0) const [showNextStepModal, setShowNexStepModal] = useState(false); const [nextStepModalHeader, setNextStepModalHeader] = useState(""); @@ -419,6 +426,8 @@ export default function TraficoCorresponsales (props:IProps) { data.idTipoMercancia = IDTipoMercancia data.cargoA = CargoPara data.causaRectificacion = CausaRectificacion + data.totalHonorariosAA = TotalHonorariosAA + data.totalGastosTerceros = TotalGastosTerceros CTrafDataService.Append(data) .then((response) => { if (response.data.estatusCode === 0) { @@ -462,7 +471,12 @@ export default function TraficoCorresponsales (props:IProps) { seguros: Seguros, tipoEmbarque: IDTipoEmbarque, totalPagar: TotalPagar, - activo: 1 + activo: 1, + lineaNaviera: LineaNaviera, + fNotificacion: FNotificacion, + fraccionArancelaria: FraccionArancelaria, + costoDiarioConexion: CostoDiarioConexion, + totalPagarConexion: TotalPagarConexion } CPedimentoService.Append(Detail) /*.then((responseDetail) => { @@ -721,6 +735,8 @@ export default function TraficoCorresponsales (props:IProps) { setIDTipoMercancia(response.data.idTipoMercancia); setCargoPara(response.data.cargoA) setCausaRectificacion(response.data.causaRectificacion) + setTotalHonorariosAA(response.data.totalHonorariosAA) + setTotalGastosTerceros(response.data.totalGastosTerceros) }) .catch((e: Error) => { setHeader('Error') @@ -811,6 +827,7 @@ export default function TraficoCorresponsales (props:IProps) { }) CPedimentoService.Get(IDTrafico) .then((responsed) => { + setFDespacho(setDate(responsed.data.fDespacho)) setIDDetail(responsed.data.id) setIDAduana(responsed.data.aduana) setCostoDiario(responsed.data.costoDiario) @@ -842,6 +859,11 @@ export default function TraficoCorresponsales (props:IProps) { setSeguros(responsed.data.seguros) setIDTipoEmbarque(responsed.data.tipoEmbarque) setTotalPagar(responsed.data.totalPagar) + setFNotificacion(setDate(responsed.data.fNotificacion)) + setLineaNaviera(responsed.data.lineaNaviera) + setFraccionArancelaria(responsed.data.fraccionArancelaria) + setCostoDiarioConexion(responsed.data.costoDiarioConexion) + setTotalPagarConexion(responsed.data.totalPagarConexion) }) .catch((e: Error) => { /* setHeader('Error') @@ -1393,6 +1415,19 @@ export default function TraficoCorresponsales (props:IProps) { } const cerrarTrafico = () => { + if(TotalHonorariosAA == 0){ + setHeader('Error') + setMsg('Para cerrar la cuenta debe capturar el total de horarios') + setShowMsg(true) + return; + } + if(TotalGastosTerceros == 0){ + setHeader('Error') + setMsg('Para cerrar la cuenta debe capturar el total de gastos a terceros') + setShowMsg(true) + return; + } + saveForm(); FileManagerServices.GetClientesZip(IDTrafico) .then(response => { CTrafDataService.ValidateComplete({id: IDTrafico, idUsuario:UserId, estatus: 4, comentarios:'Todo Correcto'}) @@ -2977,12 +3012,12 @@ export default function TraficoCorresponsales (props:IProps) { - + { showModalBox(2) }} - style={{ cursor: 'pointer' }} + style={{ cursor: 'pointer', width:'100%'}} >  {LblFacturas} + {}} + className="form-select form-select-sm" + disabled={Depto !== 'Corresponsalias'} + > + {mCFacturas + ? mCFacturas.map((item, index) => { + return item.idTrafico === IDTrafico ? ( + + ) : ( + + ) + }) + : ''} + - {}} - className="form-select form-select-sm" - disabled={Depto !== 'Corresponsalias'} - > - {mCFacturas - ? mCFacturas.map((item, index) => { - return item.idTrafico === IDTrafico ? ( - - ) : ( - - ) - }) - : ''} - + + Descripcion + setDescripcion(e.target.value)} + /> + - Descripcion - setDescripcion(e.target.value)} - /> + + Linea transportista internacional + + setLineaTransportistaInternacional(e.target.value) + } + /> + - Linea transportista internacional - - setLineaTransportistaInternacional(e.target.value) - } - /> + + Linea Naviera + + setLineaNaviera(e.target.value) + } + /> + + + + + Fecha Notificacion + setFNotificacion(e.target.value)} + /> + @@ -3229,46 +3294,65 @@ export default function TraficoCorresponsales (props:IProps) { - Preferencia arancelaria - - { - setPreferenciaArancelaria(parseInt(e.target.value)) - }} - value={PreferenciaArancelaria} - className="form-select form-select-sm" - disabled={Depto !== 'Corresponsalias'} - > - - - + + + Fraccion Arancelaria + setFraccionArancelaria(e.target.value)} + /> + - Fecha/hora instrucciones - setFHInstrucciones(date)} - showTimeSelect - timeClassName={handleColor} - dateFormat="MM/dd/yyyy HH:mm:ss" - placeholderText="No definido" - isClearable - /> + + Preferencia arancelaria + { + setPreferenciaArancelaria(parseInt(e.target.value)) + }} + value={PreferenciaArancelaria} + className="form-select form-select-sm" + disabled={Depto !== 'Corresponsalias'} + > + + + + - Fecha/hora entrega en planta - setFHEntregaPlanta(date)} - showTimeSelect - timeClassName={handleColor} - dateFormat="MM/dd/yyyy HH:mm:ss" - placeholderText="No definido" - isClearable - />{' '} + + Fecha/hora instrucciones + setFHInstrucciones(date)} + showTimeSelect + timeClassName={handleColor} + dateFormat="MM/dd/yyyy HH:mm:ss" + placeholderText="No definido" + isClearable + /> + + + + + Fecha/hora entrega en planta + setFHEntregaPlanta(date)} + showTimeSelect + timeClassName={handleColor} + dateFormat="MM/dd/yyyy HH:mm:ss" + placeholderText="No definido" + isClearable + />{' '} + @@ -3630,6 +3714,72 @@ export default function TraficoCorresponsales (props:IProps) { /> + + + + Costo diario Conexion + + { + const { value } = values + setCostoDiarioConexion(value) + }} + style={ + Depto === 'Corresponsalias' + ? { + fontSize: '15px', + backgroundColor: '#FFFFFF', + border: '1px solid #000000', + width: '90px', + borderRadius: '3px' + } + : { + fontSize: '15px', + backgroundColor: '#FFFFFF', + paddingLeft: '20px', + paddingRight: '5px', + border: '1px solid #000000', + width: '90px', + borderRadius: '3px' + } + } + /> + + Total a pagar conexion + + { + const { value } = values + setTotalPagarConexion(value) + }} + style={ + Depto === 'Corresponsalias' + ? { + fontSize: '15px', + backgroundColor: '#FFFFFF', + border: '1px solid #000000', + width: '90px', + borderRadius: '3px' + } + : { + fontSize: '15px', + backgroundColor: '#FFFFFF', + paddingLeft: '20px', + paddingRight: '5px', + border: '1px solid #000000', + width: '90px', + borderRadius: '3px' + } + } + /> + + @@ -3751,7 +3901,7 @@ export default function TraficoCorresponsales (props:IProps) { IdFile={IDTrafico} FileName={''} canDelete={ - Depto === 'Corresponsalias' && Perfil !== 'Corresponsales' + Depto === 'Corresponsalias' || Perfil !== 'Corresponsal' } FileType={['pdf']} setBackgroundColor={c.id} @@ -3861,7 +4011,10 @@ export default function TraficoCorresponsales (props:IProps) { XML Cuenta Mexicana - Archivos Adicionales + + Total Honorarios A.A + Total Gastos Terceros + @@ -3897,6 +4050,85 @@ export default function TraficoCorresponsales (props:IProps) { onAppendFM={function (idFile: number): void {}} /> + + + + { + const { value } = values + setTotalHonorariosAA(value) + }} + style={{ + fontSize: '18px', + backgroundColor: '#FEFDF5', + border: '2px solid #837F5D', + width: '100%', + textAlign: 'right', + borderRadius: '10px', + paddingLeft: '20px', + paddingRight: '10px', + }} + /> + + + { + const { value } = values + setTotalGastosTerceros(value) + }} + style={{ + fontSize: '18px', + backgroundColor: '#FEFDF5', + border: '2px solid #837F5D', + width: '100%', + textAlign: 'right', + borderRadius: '10px', + paddingLeft: '20px', + paddingRight: '10px', + }} + /> + + + + + + + PDF de Gastos a Terceros + + + Archivos Adicionales + + + + + + + + + { + const gridRef = React.useRef(null) + const [Busqueda, setBusqueda] = useState(''); + const [Embarques, setEmbarques] = useState([]); + const [columnDefs] = useState([ + { field: 'id', headerName: 'id', width: 70, sortable: true, filter: true }, + { field: 'aduana', headerName: 'ADUANA', }, + { field: 'tipoEmbarque', headerName: 'TIPO DE EMBARQUE', }, + { field: 'destino', headerName: 'DESTINO', }, + { field: 'diasEnAduana', headerName: 'DIAS EN ADUANA', }, + { field: 'nombre', headerName: 'NOMBRE', }, + { field: 'noPedimento', headerName: 'NO DE PEDIMENTO', }, + { field: 'tipo', headerName: 'TIPO', }, + { field: 'ordenCompra', headerName: 'ORDEN DE COMPRA', }, + { field: 'factura', headerName: 'FACTURA', }, + { field: 'proveedor', headerName: 'PROVEEDOR', }, + { field: 'descripcionMercancia', headerName: 'DESCRIPCION', }, + { field: 'bultos', headerName: 'BULTOS', }, + { field: 'cantidadContenedores', headerName: 'CANTIDAD DE CONTENEDORES', }, + { field: 'pesoNeto', headerName: 'PESO NETO', }, + { field: 'incoterm', headerName: 'INCOTERM', }, + { field: 'fechaETA', headerName: 'FECHA ETA', }, + { field: 'estatus', headerName: 'ESTATUS', }, + { field: 'observaciones', headerName: 'OBSERVACIONES', }, + { field: 'fechaInicioGastosAlmacenaje', headerName: 'FECHA DE INICIO DE GASTOS DE ALMACENAJE', }, + { field: 'costoDiarioAlmacenaje', headerName: 'COSTO DIARIO ALMACENAJE', cellRenderer: (params: any) => {return `$ ${params.data.costoDiarioAlmacenaje}`}}, + { field: 'costoDiarioConexion', headerName: 'COSTO DIARIO CONEXION', cellRenderer: (params: any) => {return `$ ${params.data.costoDiarioConexion}`}}, + { field: 'totalPagar', headerName: 'TOTAL A PAGAR ALMACENAJE', cellRenderer: (params: any) => {return `$ ${params.data.totalPagar}`}}, + { field: 'totalPagarConexion', headerName: 'TOTAL PAGAR CONEXION', cellRenderer: (params: any) => {return `$ ${params.data.totalPagarConexion}`}}, + { field: 'fechaDespacho', headerName: 'FECHA DE DESPACHO', }, + { field: 'nombrePaqueteria', headerName: 'NOMBRE DE PAQUETERIA O TRANSPORTISTA', }, + { field: 'noGuiaEmbarqueDestino', headerName: 'NO. DE GUIA DE EMBARQUE A DESTINO', }, + { field: 'fechaEntregaDestinoFinal', headerName: 'FECHA DE ENTREGA EN DESTINO FINAL', }, + { field: 'facturaCorresponsal', headerName: 'FACTURA', cellRenderer: (params: any) => { + return + }}, + { field: 'certificadoCalidad', headerName: 'CERTIFICADO DE CALIDAD', cellRenderer: (params: any) => { + return + }}, + { field: 'packingList', headerName: 'PACKING LIST', cellRenderer: (params: any) => { + return + }}, + { field: 'hojaTecnica', headerName: 'HOJA TECNICA', cellRenderer: (params: any) => { + return + }}, + { field: 'bl', headerName: 'BL', cellRenderer: (params: any) => { + return + }}, + { field: 'pedimentoInformativo', headerName: 'PEDIMENTO INFORMATIVO', cellRenderer: (params: any) => { + return + }, width: 130}, + { field: 'pedimentoSimplificado', headerName: 'PEDIMENTO SIMPLIFICADO', cellRenderer: (params: any) => { + return + }, width: 130}, + { field: 'doda', headerName: 'DODA', cellRenderer: (params: any) => { + return + }, width: 100}, + { field: 'honorarios', headerName: 'HONORARIOS AA', cellRenderer: (params: any) => { + return + }, width: 130}, + { field: 'totalHonorarios', headerName: 'TOTAL HONORARIOS AA', cellRenderer: (params: any) => {return `$ ${params.data.totalHonorarios}`}}, + { field: 'gastosTerceros', headerName: 'GASTOS A TERCEROS', cellRenderer: (params: any) => { + return + }, width: 130}, + { field: 'totalGastosTerceros', headerName: 'TOTAL GASTOS A TERCEROS', }, + { field: 'comprobantesGastosTerceros', headerName: 'COMPROBANTES GASTOS A TERCEROS', } + ]); + + const filtraEmbarques = (e: any) => { + gridRef.current.api.setQuickFilter(e.target.value) + } + + const buscarEmbarques = () => { + if(Busqueda !== '' && Busqueda !== null && Busqueda !== undefined){ + reportesEmbarquesService.BuscarEmbarques(Busqueda) + .then((response) => { + setEmbarques(response.data); + }); + }else{ + //Mostrar mensaje de error + } + } + + const exportarEmbarques = () => { + reportesEmbarquesService.GetExcelBuscados(Busqueda) + .then(resp => { + const url = window.URL.createObjectURL(new Blob([resp.data])); + const link = document.createElement('a'); + link.href = url; + link.setAttribute('download', `ReporteBusquedaDeEmbarques.xlsx`); + document.body.appendChild(link); + link.click(); + }) + } + + return ( + <> + + + + + { + setBusqueda(e.target.value) + }} + /> + + + + { Embarques.length > 0 ? : "" } + + + + + 0 ? "visible" : "hidden"}}> + + + + { + filtraEmbarques(e) + }} + /> + + +
+ +
+
+
+ + ); +} \ No newline at end of file diff --git a/src/Components/ReportesClientes/Embarques/EmbarquesDespachados.tsx b/src/Components/ReportesClientes/Embarques/EmbarquesDespachados.tsx new file mode 100644 index 0000000..ff3b788 --- /dev/null +++ b/src/Components/ReportesClientes/Embarques/EmbarquesDespachados.tsx @@ -0,0 +1,217 @@ +import { AgGridReact } from "ag-grid-react"; +import React, { useState, useEffect } from "react"; +import { DTOReportesEmbarquesDespachados } from "../../../DTO/Reportes/Embarques/DTOReportesEmabarquesDespachados"; +import reportesEmbarquesService from "../../../Services/Reportes/reportesEmbarques.Service"; +import { Card, Row, Col, Form, Button } from "react-bootstrap"; +import { CellIcon } from "../../Utils/CellIcon/CellIcon"; +import { FaDownload } from "react-icons/fa"; + +export const EmbarquesDespachados: React.FC = () => { + const gridRef = React.useRef(null) + const [Inicio, setInicio] = useState(currentDate(-7)) + const [Fin, setFin] = useState(currentDate(0)) + const [filteredData, setFilteredData] = useState([]); + const [EmbarquesDespachados, setEmbarquesDespachados] = useState([]); + const [columnDefs] = useState([ + { field: 'id', headerName: 'id', width: 70, sortable: true, filter: true }, + { field: 'aduana', headerName: 'ADUANA', }, + { field: 'tipoEmbarque', headerName: 'TIPO DE EMBARQUE', }, + { field: 'destino', headerName: 'DESTINO', }, + { field: 'diasEnAduana', headerName: 'DIAS EN ADUANA', }, + { field: 'nombre', headerName: 'NOMBRE', }, + { field: 'trafico', headerName: 'TRAFICO', }, + { field: 'referencia', headerName: 'REFERENCIA', }, + { field: 'noPedimento', headerName: 'NO DE PEDIMENTO', }, + { field: 'clavePedimento', headerName: 'CLAVE DE PADIMENTO', }, + { field: 'tipo', headerName: 'TIPO', }, + { field: 'ordenCompra', headerName: 'ORDEN DE COMPRA', }, + { field: 'factura', headerName: 'FACTURA', }, + { field: 'proveedor', headerName: 'PROVEEDOR', }, + { field: 'descripcionMercancia', headerName: 'DESCRIPCION', }, + { field: 'lineaTransportistaInternacional', headerName: 'LINEA TRANSPORTISTA INTERNACIONAL', }, + { field: 'lineaNaviera', headerName: 'LINEA NAVIERA', }, + { field: 'mawb', headerName: 'MAWB', }, + { field: 'hawb', headerName: 'HAWB', }, + { field: 'fechaNotificacion', headerName: 'FECHA DE NOTIFICACION', }, + { field: 'bultos', headerName: 'BULTOS', }, + { field: 'cantidadContenedores', headerName: 'CANTIDAD DE CONTENEDORES', }, + { field: 'numerosContenedores', headerName: 'NO. CONTENEDORES', }, + { field: 'pesoBruto', headerName: 'PESO BRUTO', }, + { field: 'pesoNeto', headerName: 'PESO NETO', }, + { field: 'incoterm', headerName: 'INCOTERM', }, + { field: 'fechaETA', headerName: 'FECHA ETA', }, + { field: 'fechaEntrada', headerName: 'FECHA DE ENTRADA', }, + { field: 'fechaRevalidacionGuia', headerName: 'FECHA DE REVALIDACION GUIA', }, + { field: 'montoUSD', headerName: 'MONTO USD', cellRenderer: (params: any) => {return `$ ${params.data.montoUSD}`}}, + { field: 'origen', headerName: 'ORIGEN', }, + { field: 'fraccionArancelaria', headerName: 'FRACCION ARANCELARIA', }, + { field: 'descripcion', headerName: 'DESCRIPCION', }, + { field: 'preferenciaArancelaria', headerName: 'PREFERENCIA ARANCELARIA', }, + { field: 'estatus', headerName: 'ESTATUS', }, + { field: 'observaciones', headerName: 'OBSERVACIONES', }, + { field: 'fechaInicioGastosAlmacenaje', headerName: 'FECHA DE INICIO DE GASTOS DE ALMACENAJE', }, + { field: 'costoDiarioAlmacenaje', headerName: 'COSTO DIARIO ALMACENAJE', cellRenderer: (params: any) => {return `$ ${params.data.costoDiarioAlmacenaje}`}}, + { field: 'costoDiarioConexion', headerName: 'COSTO DIARIO CONEXION', cellRenderer: (params: any) => {return `$ ${params.data.costoDiarioConexion}`}}, + { field: 'totalPagar', headerName: 'TOTAL A PAGAR ALMACENAJE', cellRenderer: (params: any) => {return `$ ${params.data.totalPagar}`}}, + { field: 'totalPagarConexion', headerName: 'TOTAL PAGAR CONEXION', cellRenderer: (params: any) => {return `$ ${params.data.totalPagarConexion}`}}, + { field: 'fechaPagoPedimento', headerName: 'FECHA DE PAGO PEDIMENTO', }, + { field: 'fechaInstrucciones', headerName: 'FECHA DE INSTRUCCIONES', }, + { field: 'horaInstrucciones', headerName: 'HORA DE INSTRUCCIONES', }, + { field: 'fechaDespacho', headerName: 'FECHA DE DESPACHO', }, + { field: 'diasCPPagado', headerName: 'DIAS C/PDTO PAGADO', }, + { field: 'fechaSalidaContenedores', headerName: 'FECHA SALIDA DE CONTENEDORES', }, + { field: 'nombrePaqueteria', headerName: 'NOMBRE DE PAQUETERIA O TRANSPORTISTA', }, + { field: 'noGuiaEmbarqueDestino', headerName: 'NO. DE GUIA DE EMBARQUE A DESTINO', }, + { field: 'fechaEntregaDestinoFinal', headerName: 'FECHA DE ENTREGA EN DESTINO FINAL', }, + { field: 'horaEntregaDestinoFinal', headerName: 'HORA DE ENTREGA EN DESTINO FINAL', }, + { field: 'facturaCorresponsal', headerName: 'FACTURA', cellRenderer: (params: any) => { + return + }}, + { field: 'certificadoCalidad', headerName: 'CERTIFICADO DE CALIDAD', cellRenderer: (params: any) => { + return + }}, + { field: 'packingList', headerName: 'PACKING LIST', cellRenderer: (params: any) => { + return + }}, + { field: 'hojaTecnica', headerName: 'HOJA TECNICA', cellRenderer: (params: any) => { + return + }}, + { field: 'bl', headerName: 'BL', cellRenderer: (params: any) => { + return + }}, + { field: 'pedimentoInformativo', headerName: 'PEDIMENTO INFORMATIVO', cellRenderer: (params: any) => { + return + }, width: 130}, + { field: 'pedimentoSimplificado', headerName: 'PEDIMENTO SIMPLIFICADO', cellRenderer: (params: any) => { + return + }, width: 130}, + { field: 'doda', headerName: 'DODA', cellRenderer: (params: any) => { + return + }, width: 100}, + { field: 'honorarios', headerName: 'HONORARIOS AA', cellRenderer: (params: any) => { + return + }, width: 130}, + { field: 'totalHonorarios', headerName: 'TOTAL HONORARIOS AA', cellRenderer: (params: any) => {return `$ ${params.data.totalHonorarios}`}}, + { field: 'gastosTerceros', headerName: 'GASTOS A TERCEROS', cellRenderer: (params: any) => { + return + }, width: 130}, + { field: 'totalGastosTerceros', headerName: 'TOTAL GASTOS A TERCEROS', cellRenderer: (params: any) => {return `$ ${params.data.totalGastosTerceros}`}}, + { field: 'comprobantesGastosTerceros', headerName: 'COMPROBANTES GASTOS A TERCEROS', cellRenderer: (params: any) => { + return + }, width: 130}, + { field: 'pruebaEntrega', headerName: 'PRUEBA DE ENTREGA', }, + { field: 'descargarTodos', headerName: 'DESCARGAR TODOS', }, + ]); + + function currentDate(days: number): string { + var today = new Date() + today.setDate(today.getDate() + days) + var dd = String(today.getDate()).padStart(2, '0') + var mm = String(today.getMonth() + 1).padStart(2, '0') + var yyyy = today.getFullYear() + return yyyy + '-' + mm + '-' + dd + } + + const GetEmbarquesDespachados = () => { + reportesEmbarquesService.getReporteEmbarquesDespachados(Inicio, Fin) + .then(res => { + setEmbarquesDespachados(res.data) + setFilteredData(res.data) + }); + } + + const filtraEmbarques = (e: any) => { + gridRef.current.api.setQuickFilter(e.target.value) + } + + const exportarEmbarques = () => { + reportesEmbarquesService.GetExcelDespachados(Inicio, Fin) + .then(resp => { + const url = window.URL.createObjectURL(new Blob([resp.data])); + const link = document.createElement('a'); + link.href = url; + link.setAttribute('download', `ReporteEmbarquesDespachados.xlsx`); + document.body.appendChild(link); + link.click(); + }) + } + + return ( + <> + + + + + + Fecha Inicial + setInicio(e.target.value)} + size='sm' + /> + + + + + Fecha Final + setFin(e.target.value)} + size='sm' + /> + + + + + { EmbarquesDespachados.length > 0 ? : "" } + + + + + 0 ? "visible" : "hidden"}}> + + + + { + filtraEmbarques(e) + }} + /> + + +
+ +
+
+
+ + ); +} \ No newline at end of file diff --git a/src/Components/ReportesClientes/Embarques/EmbarquesPorImportar.tsx b/src/Components/ReportesClientes/Embarques/EmbarquesPorImportar.tsx new file mode 100644 index 0000000..92fcfc2 --- /dev/null +++ b/src/Components/ReportesClientes/Embarques/EmbarquesPorImportar.tsx @@ -0,0 +1,163 @@ +import { AgGridReact } from "ag-grid-react"; +import React, { useState, useEffect } from "react"; +import { DTOReportesEmbarquesPorImportar } from "../../../DTO/Reportes/Embarques/DTOReportesEmabarquesPorImportar"; +import reportesEmbarquesService from "../../../Services/Reportes/reportesEmbarques.Service"; +import { ColDef } from "ag-grid-community"; +import { Card, Row, Col, Form, Button } from "react-bootstrap"; +import { CellIcon } from "../../Utils/CellIcon/CellIcon"; +import { FaDownload } from "react-icons/fa"; + +export const EmbarquesPorImportar: React.FC = () => { + const gridRef = React.useRef(null) + const [EmbarquesPorImportar, setEmbarquesPorImportar] = useState([]); + const [columnDefs] = useState([ + { field: 'id', headerName: 'id', width: 70, sortable: true, filter: true }, + { field: 'aduana', headerName: 'ADUANA', }, + { field: 'tipoEmbarque', headerName: 'TIPO DE EMBARQUE', }, + { field: 'destino', headerName: 'DESTINO', }, + { field: 'diasEnAduana', headerName: 'DIAS EN ADUANA', }, + { field: 'nombre', headerName: 'NOMBRE', }, + { field: 'trafico', headerName: 'TRAFICO', }, + { field: 'referencia', headerName: 'REFERENCIA', }, + { field: 'noPedimento', headerName: 'NO DE PEDIMENTO', }, + { field: 'clavePedimento', headerName: 'CLAVE DE PADIMENTO', }, + { field: 'tipo', headerName: 'TIPO', }, + { field: 'ordenCompra', headerName: 'ORDEN DE COMPRA', }, + { field: 'factura', headerName: 'FACTURA', }, + { field: 'proveedor', headerName: 'PROVEEDOR', }, + { field: 'descripcionMercancia', headerName: 'DESCRIPCION', }, + { field: 'lineaTransportistaInternacional', headerName: 'LINEA TRANSPORTISTA INTERNACIONAL', }, + { field: 'lineaNaviera', headerName: 'LINEA NAVIERA', }, + { field: 'mawb', headerName: 'MAWB', }, + { field: 'hawb', headerName: 'HAWB', }, + { field: 'fechaNotificacion', headerName: 'FECHA DE NOTIFICACION', }, + { field: 'bultos', headerName: 'BULTOS', }, + { field: 'cantidadContenedores', headerName: 'CANTIDAD DE CONTENEDORES', }, + { field: 'numerosContenedores', headerName: 'NO. CONTENEDORES', }, + { field: 'pesoBruto', headerName: 'PESO BRUTO', }, + { field: 'pesoNeto', headerName: 'PESO NETO', }, + { field: 'incoterm', headerName: 'INCOTERM', }, + { field: 'fechaETA', headerName: 'FECHA ETA', }, + { field: 'fechaEntrada', headerName: 'FECHA DE ENTRADA', }, + { field: 'fechaRevalidacionGuia', headerName: 'FECHA DE REVALIDACION GUIA', }, + { field: 'montoUSD', headerName: 'MONTO USD', cellRenderer: (params: any) => {return `$ ${params.data.montoUSD}`}}, + { field: 'origen', headerName: 'ORIGEN', }, + { field: 'fraccionArancelaria', headerName: 'FRACCION ARANCELARIA', }, + { field: 'descripcion', headerName: 'DESCRIPCION', }, + { field: 'preferenciaArancelaria', headerName: 'PREFERENCIA ARANCELARIA', }, + { field: 'estatus', headerName: 'ESTATUS', }, + { field: 'observaciones', headerName: 'OBSERVACIONES', }, + { field: 'fechaInicioGastosAlmacenaje', headerName: 'FECHA DE INICIO DE GASTOS DE ALMACENAJE', }, + { field: 'costoDiarioAlmacenaje', headerName: 'COSTO DIARIO ALMACENAJE', cellRenderer: (params: any) => {return `$ ${params.data.costoDiarioAlmacenaje}`}}, + { field: 'costoDiarioConexion', headerName: 'COSTO DIARIO CONEXION', cellRenderer: (params: any) => {return `$ ${params.data.costoDiarioConexion}`}}, + { field: 'totalPagar', headerName: 'TOTAL A PAGAR ALMACENAJE', cellRenderer: (params: any) => {return `$ ${params.data.totalPagar}`}}, + { field: 'totalPagarConexion', headerName: 'TOTAL PAGAR CONEXION', cellRenderer: (params: any) => {return `$ ${params.data.totalPagarConexion}`}}, + { field: 'fechaPagoPedimento', headerName: 'FECHA DE PAGO PEDIMENTO', }, + { field: 'fechaInstrucciones', headerName: 'FECHA DE INSTRUCCIONES', }, + { field: 'horaInstrucciones', headerName: 'HORA DE INSTRUCCIONES', }, + { field: 'fechaDespacho', headerName: 'FECHA DE DESPACHO', }, + { field: 'diasCPPagado', headerName: 'DIAS C/PDTO PAGADO', }, + { field: 'fechaSalidaContenedores', headerName: 'FECHA SALIDA DE CONTENEDORES', }, + { field: 'nombrePaqueteria', headerName: 'NOMBRE DE PAQUETERIA O TRANSPORTISTA', }, + { field: 'noGuiaEmbarqueDestino', headerName: 'NO. DE GUIA DE EMBARQUE A DESTINO', }, + { field: 'fechaEntregaDestinoFinal', headerName: 'FECHA DE ENTREGA EN DESTINO FINAL', }, + { field: 'horaEntregaDestinoFinal', headerName: 'HORA DE ENTREGA EN DESTINO FINAL', }, + { field: 'facturaCorresponsal', headerName: 'FACTURA', cellRenderer: (params: any) => { + return + }}, + { field: 'certificadoCalidad', headerName: 'CERTIFICADO DE CALIDAD', cellRenderer: (params: any) => { + return + }}, + { field: 'packingList', headerName: 'PACKING LIST', cellRenderer: (params: any) => { + return + }}, + { field: 'hojaTecnica', headerName: 'HOJA TECNICA', cellRenderer: (params: any) => { + return + }}, + { field: 'bl', headerName: 'BL', cellRenderer: (params: any) => { + return + }}, + { field: 'pedimentoInformativo', headerName: 'PEDIMENTO INFORMATIVO', cellRenderer: (params: any) => { + return + }, width: 130}, + { field: 'pedimentoSimplificado', headerName: 'PEDIMENTO SIMPLIFICADO', cellRenderer: (params: any) => { + return + }, width: 130}, + { field: 'doda', headerName: 'DODA', cellRenderer: (params: any) => { + return + }, width: 100}, + { field: 'cuentaDeGastos', headerName: 'CUENTA DE GASTOS', cellRenderer: (params: any) => { + return + }, width: 100}, + ]); + + const fetchEmbarquesPorImportar = () => { + reportesEmbarquesService.getReporteEmbarquesPorImportar() + .then(res => { + console.log(res.data) + setEmbarquesPorImportar(res.data) + }); + } + useEffect(() => { + fetchEmbarquesPorImportar(); + },[]) + + const filtraEmbarques = (e: any) => { + gridRef.current.api.setQuickFilter(e.target.value) + } + + const exportarEmbarques = () => { + reportesEmbarquesService.GetExcelPorImportar() + .then(resp => { + const url = window.URL.createObjectURL(new Blob([resp.data])); + const link = document.createElement('a'); + link.href = url; + link.setAttribute('download', `ReporteEmbarquesPorImportar.xlsx`); + document.body.appendChild(link); + link.click(); + }) + } + + return ( + + + + + + + + +
+ + + { + filtraEmbarques(e) + }} + /> + + +
+ +
+
+
+ ); +} \ No newline at end of file diff --git a/src/Components/ReportesClientes/Embarques/ReportesEmbarques.tsx b/src/Components/ReportesClientes/Embarques/ReportesEmbarques.tsx index 9a461e8..8dae186 100644 --- a/src/Components/ReportesClientes/Embarques/ReportesEmbarques.tsx +++ b/src/Components/ReportesClientes/Embarques/ReportesEmbarques.tsx @@ -1,7 +1,12 @@ import React from 'react'; import { Card, Tab, Tabs } from 'react-bootstrap'; +import { EmbarquesPorImportar } from './EmbarquesPorImportar'; +import { EmbarquesDespachados } from './EmbarquesDespachados'; +import { BuscarEmbarques } from './BuscarEmbarques'; +import { BsTruck } from 'react-icons/bs'; -export const ReportesEmbarques: React.FC = () => { + +export const ReportesEmbarques: React.FC = () => { return (
@@ -12,36 +17,24 @@ export const ReportesEmbarques: React.FC = () => { > {"Embarques Por Importar"}} id="TabEmbarquesPorImportar" > - - - Aqui va la tabla donde se muestran los embarques del cliente - - + {} {"Embarques Despachados"}} id="TabEmbarquesdespachados" > - - - Reporte de embarques despachados - - + {} {"Buscar Embarques"}} id="TabBuscarEmbarques" > - - - Buscador de embarques - - + diff --git a/src/Components/Utils/CellIcon/CellIcon.tsx b/src/Components/Utils/CellIcon/CellIcon.tsx new file mode 100644 index 0000000..17aee14 --- /dev/null +++ b/src/Components/Utils/CellIcon/CellIcon.tsx @@ -0,0 +1,74 @@ +import { useState, useEffect } from "react"; +import { IconContext } from "react-icons"; +import { BsFillXCircleFill, BsCheckCircleFill } from "react-icons/bs"; +import IFileManager from "../../../Interfaces/Utils/IFileManager"; +import MFileManagerService from "../../../Services/Utils/MFileManager.Service"; +import FileManagerDataService from "../../../Services/Utils/FileManager.Services"; +import { Form } from "react-bootstrap"; + +interface IProps{ + hasFile: number; + idTrafico: number; + proceso: number; +} + +export const CellIcon: React.FC = (props: IProps) => { + const [Archvios, setArchivos] = useState([]); + + useEffect(() => { + MFileManagerService.Get(props.idTrafico, props.proceso).then(response => { + setArchivos(response.data); + }) + },[]); + + const getFileById = (idTrafico:number) => { + FileManagerDataService.getFileContentById(idTrafico) + .then((response:any) => { + const blob = new Blob([response.data], { type: 'application/pdf' }) + const url = window.URL.createObjectURL(blob) + window.open(url) + }) + } + + const getFileByProcess = (idTrafico:number, proceso: number) => { + FileManagerDataService.getFileContent(idTrafico, proceso) + .then((response:any) => { + const blob = new Blob([response.data], { type: 'application/pdf' }) + const url = window.URL.createObjectURL(blob) + window.open(url) + }) + } + return ( +
+ { + props.hasFile === 0 ? + + + + : [14, 15 , 16, 17, 18].includes(props.proceso) ? + {getFileById(+e.target!.value) }} + value={0} + className="form-select form-select-sm" + > + + {Archvios + ? Archvios.map((a) => { + return ( + + ) + }) + : null} + + : + + getFileByProcess(props.idTrafico, props.proceso)} style={{cursor:'pointer'}}/> + + } +
+ ) +} \ No newline at end of file diff --git a/src/DTO/Reportes/Embarques/DTOBuscarEmbarques.ts b/src/DTO/Reportes/Embarques/DTOBuscarEmbarques.ts new file mode 100644 index 0000000..22a8131 --- /dev/null +++ b/src/DTO/Reportes/Embarques/DTOBuscarEmbarques.ts @@ -0,0 +1,43 @@ +export interface DTOBuscarEmbarques{ + id:number; + aduana: string; + tipoEmbarque: string; + destino: string; + diasEnAduana: number; + nombre: string; //nombre del cliente + noPedimento: string; + tipo: string; //Tipo de operacion + ordenCompra: string; + factura: string; //Facturas concatenadas + proveedor: string; + descripcionMercancia: string; + bultos: number; + cantidadContenedores: number; + pesoNeto: number; + incoterm: string; + fechaETA: Date; + estatus: string; + observaciones: string; + fechaInicioGastosAlmacenaje: Date; + costoDiarioAlmacenaje: number; + costoDiarioConexion: number; + totalPagar: string; + totalPagarConexion: string; + fechaDespacho: Date; + nombrePaqueteria: string; + noGuiaEmbarqueDestino: string; + fechaEntregaDestinoFinal: Date; + facturaCorresponsal: number; + certificadoCalidad: number; + packingList: number; + hojaTecnica: number; + BL: number; + pedimentoInformativo: number; + pedimentoSimplificado: number; + DODA: number; + honorarios: number; + totalHonorarios: number; + gastosTerceros: number; + totalGastosTerceros: number; + comprobantesGastosTerceros: number; +} \ No newline at end of file diff --git a/src/DTO/Reportes/Embarques/DTOReportesEmabarques.ts b/src/DTO/Reportes/Embarques/DTOReportesEmabarquesDespachados.ts similarity index 97% rename from src/DTO/Reportes/Embarques/DTOReportesEmabarques.ts rename to src/DTO/Reportes/Embarques/DTOReportesEmabarquesDespachados.ts index 23e965f..e6483c4 100644 --- a/src/DTO/Reportes/Embarques/DTOReportesEmabarques.ts +++ b/src/DTO/Reportes/Embarques/DTOReportesEmabarquesDespachados.ts @@ -1,4 +1,4 @@ -export interface IDTOReportesEmbarques{ +export interface DTOReportesEmbarquesDespachados{ id:number; aduana: string; tipoEmbarque: string; diff --git a/src/DTO/Reportes/Embarques/DTOReportesEmabarquesPorImportar.ts b/src/DTO/Reportes/Embarques/DTOReportesEmabarquesPorImportar.ts new file mode 100644 index 0000000..56cb899 --- /dev/null +++ b/src/DTO/Reportes/Embarques/DTOReportesEmabarquesPorImportar.ts @@ -0,0 +1,61 @@ +export interface DTOReportesEmbarquesPorImportar{ + id:number; + aduana: string; + tipoEmbarque: string; + destino: string; + diasEnAduana: number; + nombre: string; //nombre del cliente + trafico:string; + referencia: string; + noPedimento: string; + clavePedimento: string; + tipo: string; //Tipo de operacion + ordenCompra: string; + factura: string; //Facturas concatenadas + proveedor: string; + descripcionMercancia: string; + lineaTransportistaInternacional: string; + lineaNaviera: string; + MAWB: string; + HAWB: string; + fechaNotificacion: Date; + bultos: number; + cantidadContenedores: number; + numerosContenedores: number; + pesoBruto: number; + pesoNeto: number; + incoterm: string; + fechaETA: Date; + fechaEntrada: Date; + fechaRevalidacionGuia: Date; + montoUSD: number; + origen: string; + fraccionArancelaria: string; + descripcion: string; + preferenciaArancelaria: string; + estatus: string; + observaciones: string; + fechaInicioGastosAlmacenaje: Date; + costoDiarioAlmacenaje: number; + costoDiarioConexion: number; + totalPagar: string; + totalPagarConexion: string; + fechaPagoPedimento:Date; + fechaInstrucciones: Date; + horaInstrucciones: string; + fechaDespacho: Date; + diasCPPagado: number; + fechaSalidaContenedores: Date; + nombrePaqueteria: string; + noGuiaEmbarqueDestino: string; + fechaEntregaDestinoFinal: Date; + horaEntregaDestinoFinal: string; + facturaCorresponsal: number; + certificadoCalidad: number; + packingList: number; + hojaTecnica: number; + BL: number; + pedimentoInformativo: number; + pedimentoSimplificado: number; + DODA: number; +} \ No newline at end of file diff --git a/src/Interfaces/Corresponsales/ICorresponsalPedimento.ts b/src/Interfaces/Corresponsales/ICorresponsalPedimento.ts index 3d792be..9266554 100644 --- a/src/Interfaces/Corresponsales/ICorresponsalPedimento.ts +++ b/src/Interfaces/Corresponsales/ICorresponsalPedimento.ts @@ -31,5 +31,10 @@ export default interface ICorresponsalPedimento { seguros : number, tipoEmbarque : number, totalPagar : number, - activo: number + activo: number, + lineaNaviera: string; + fNotificacion: string; + fraccionArancelaria: string; + costoDiarioConexion: number; + totalPagarConexion: number; } \ No newline at end of file diff --git a/src/Interfaces/Corresponsales/ICorresponsalTrafico.ts b/src/Interfaces/Corresponsales/ICorresponsalTrafico.ts index 14e45cf..d8b8ad1 100644 --- a/src/Interfaces/Corresponsales/ICorresponsalTrafico.ts +++ b/src/Interfaces/Corresponsales/ICorresponsalTrafico.ts @@ -43,4 +43,6 @@ export default interface ICorresponsalTrafico { idTipoMercancia: number | null, cargoA: number, causaRectificacion: string, + totalHonorariosAA: number; + totalGastosTerceros: number; } diff --git a/src/Services/Reportes/reportesEmbarques.Service.ts b/src/Services/Reportes/reportesEmbarques.Service.ts new file mode 100644 index 0000000..895f211 --- /dev/null +++ b/src/Services/Reportes/reportesEmbarques.Service.ts @@ -0,0 +1,34 @@ +import React from "react"; +import http from "../common/http-common"; +import { DTOReportesEmbarquesPorImportar } from "../../DTO/Reportes/Embarques/DTOReportesEmabarquesPorImportar"; +import { DTOReportesEmbarquesDespachados } from "../../DTO/Reportes/Embarques/DTOReportesEmabarquesDespachados"; +import { DTOBuscarEmbarques } from "../../DTO/Reportes/Embarques/DTOBuscarEmbarques"; + +class ReportesEmbarquesService{ + + getReporteEmbarquesPorImportar(){ + return http.get(`ReportesEmbarques/PorImportar`); + } + + getReporteEmbarquesDespachados(inicio: string, fin: string){ + return http.get(`ReportesEmbarques/Despachados?inicio=${inicio}&fin=${fin}`); + } + + BuscarEmbarques(filtro: string){ + return http.get(`ReportesEmbarques/BuscarEmbarques?filtro=${filtro}`); + } + + GetExcelPorImportar(){ + return http.get(`ReportesEmbarques/ExcelEmbarquesPorImportar`, {responseType: 'blob'}) + } + + GetExcelDespachados(inicio: string, fin: string){ + return http.get(`ReportesEmbarques/ExcelEmbarquesDespachados?inicio=${inicio}&fin=${fin}`, {responseType: 'blob'}) + } + + GetExcelBuscados(busqueda: string){ + return http.get(`ReportesEmbarques/ExcelBuscarEmbarques?filtro=${busqueda}`, {responseType: 'blob'}) + } +} + +export default new ReportesEmbarquesService(); \ No newline at end of file diff --git a/src/Services/Utils/FileManager.Services.ts b/src/Services/Utils/FileManager.Services.ts index 4b5eb83..3d1061a 100644 --- a/src/Services/Utils/FileManager.Services.ts +++ b/src/Services/Utils/FileManager.Services.ts @@ -31,5 +31,15 @@ class FileManagerDataService { return http.get(`/FileManager/GetClientesZip?id=${id}`, {responseType: 'blob'}); } + getFileContentById(id: number) { + return http.get(`/FileManager/GetFileById?fileId=${id}`, {responseType: 'arraybuffer'}) + .then(function (response) { + return response + }) + .catch(function (error) { + console.log(error) + }) + } + } export default new FileManagerDataService(); \ No newline at end of file diff --git a/src/Services/Utils/MFileManager.Service.ts b/src/Services/Utils/MFileManager.Service.ts index 9bb0038..6731d8e 100644 --- a/src/Services/Utils/MFileManager.Service.ts +++ b/src/Services/Utils/MFileManager.Service.ts @@ -5,7 +5,11 @@ import IFileManager from "../../Interfaces/Utils/IFileManager"; class MFileManagerDataService { Append(formData: any, IDTrafico: number, Proceso: number, Usuario: number) { - return http.post(`/Utils/MFileManager/Append?Tags=${IDTrafico}&Proceso=${Proceso}&Usuario=${Usuario}`, formData) + return http.post(`/Utils/MFileManager/Append?Tags=${IDTrafico}&Proceso=${Proceso}&Usuario=${Usuario}`, formData,{ + headers:{ + "Content-Type":'multipart/form-data' + } + }) } DeleteFile(id: number) { return http.delete(`/FileManager/DeleteById/${id}`); diff --git a/src/store/features/Corresponsales/CorresponsalesTraficoSlice.ts b/src/store/features/Corresponsales/CorresponsalesTraficoSlice.ts index a13492e..629fccf 100644 --- a/src/store/features/Corresponsales/CorresponsalesTraficoSlice.ts +++ b/src/store/features/Corresponsales/CorresponsalesTraficoSlice.ts @@ -44,7 +44,9 @@ const CorresponsalesTrafico: ICorresponsalTrafico[] = [{ activo: 0, idTipoMercancia:0, cargoA: 0, - causaRectificacion: '' + causaRectificacion: '', + totalHonorariosAA: 0, + totalGastosTerceros: 0 }] const initialState = { CorresponsalesTrafico }