Compare commits

...

58 Commits

Author SHA1 Message Date
Felix Morales 912f18efe7 Creacion de los componentes para el reporte general de facturacion 5 days ago
Felix Morales f641256dd8 Removed the navigation link on the IT dashoboard storage status indicator 3 months ago
Felix Morales f2c753a93e Created a new dashboard for the IT departament to keep visibility of the server D: drive storage. Authorized advanced payments now can be deleted. Removed the date filter and added a range of dates filter in the Alen's account statements component. 3 months ago
Felix Morales ac6a8d1ae6 A component is created for querying Alen’s account statements. An indicator is added to the billing department dashboard to access the Alen account statements component. The styling issue with the indicator of operations with charges in dollars in the accounting department dashboard is fixed. 3 months ago
Felix Morales 27a1e46ee8 Download complementary invoices insted of opening them in a new tab in browser 4 months ago
Felix Morales 0ebe4efdbb Faltaba agregar el evento onClick al boton de descarga individual de los archivos 5 months ago
Felix Morales df09d0aec5 v2.1.0 5 months ago
Felix Morales 499d39839c Merge branch 'feature/Creacion_Reporte_Archivo_Electronico_20240417' 5 months ago
Felix Morales f28d66a040 Ocultar el campo de la factura del corresponsal en la pestaña de informacion adicional para la vista del cliente 5 months ago
Felix Morales 3e81191bfb Creacion del reporte de archivo electronico, seleccionar referencias y descargar sus archivos oficiales comprimidos en un zip 5 months ago
Felix Morales 9d58d775d7 Primer avance del reporte de archivo electronico para la vista de clientes 5 months ago
Felix Morales 985d9fce89 Descargar los traficos del cliente en un excel 5 months ago
Felix Morales 3444834b2c Se agrega la opcion para seleccionar si el tabulador es de impo o expo y la moneda que aplica para el tabulador 6 months ago
Felix Morales 2716185a10 v2.0.1 6 months ago
Felix Morales 120696eff1 Se agrega el funcionamiento para asignar el catalogo a un corresponsal y poder capturar el costo del corresponsal a los conceptos de los catalogos 6 months ago
Felix Morales 7a9f236e3b v2.0.0 6 months ago
Felix Morales 31aa61c2b3 Fix: Permitia capturar rectificaciones de pedimentos aun si el pedimento original no tenia fecha de pago. Al capturar una rectificacion, el campo de la fecha de pago de la ultima rectificacion cambiaba el formato de la fecha y no se mostraba correctamente. 6 months ago
Felix Morales 3a866b416b Agregar filtro de busqueda y tab para descargar los archivos de facturacion a la vista del cliente 6 months ago
Felix Morales 7e6e222dd4 Implementacion del catalogo de tipos de contenedores y agregar el funcionamiento para asignar el tipo de contenedor 6 months ago
Felix Morales 59b149eb93 Cambiar tipo de dato de Aduna para que se trabaje como una cadena de texto 6 months ago
Felix Morales b506b818bb Crear referencias sin pedimento para generar cargos tipo OT 7 months ago
Felix Morales 4516a632da Cambiar indicadores de color para el cliente Alen, Agregar el campo Fecha Entrega en Planta en la pestana de Informacion General 7 months ago
Felix Morales e95c14e907 Merge branch 'feature/solicitar_eliminacion_de_referencia_20240219' 7 months ago
Felix Morales 2871512547 Ocultar el boton para crear solicitudes cuando la referencia ya tiene una creada, creacion del indicador de solicitudes para el supervisor de corresponsalias 7 months ago
Felix Morales 9b3b75bd0a Crear y autorizar solicitudes para eliminar traficos 7 months ago
Felix Morales 636cac25d0 Cambiar nombre a los archivos para crear y autorizar solicitudes 7 months ago
Felix Morales 344dc15e6b Creacion de la vista para descargar el reporte de cuentas cerradas 7 months ago
Felix Morales 58e15f932a reestructuracion del modal de solicitudes, se agrega el boton para eliminar la referencia 7 months ago
Felix Morales 9f2f900921 fix, los usarion sin permiso de edicion podian borrar los contenedores, asigarles facturas o editarlos 7 months ago
Felix Morales b1ed56539a Volver a cargar la informacion de un contenedor cuando se le da clic en el numero del contenedor 8 months ago
Felix Morales b2514e94b7 Merge branch 'main' into bugfix/corregir_problema_campo_semaforo_fiscal_20240215 8 months ago
Felix Morales 5c212b55b1 fix, no se mandaba a llamar correctamente el proceso para cerrar cuenta tras la implementacion de las solicitudes de reapertura de cuenta 8 months ago
Felix Morales a6c37e1593 Al agregar un contenedor ahora su semaforo inicial será en verde 8 months ago
Felix Morales 5f92a4391e Creacion de solicitudes y reapertura de cuentas ya cerradas 8 months ago
Felix Morales 4a7d51f4b0 Merge branch 'feature/cambiar_propiedades_modal_de_traficos_20240208' into feature/solicitar_reapertura_de_cuenta_20240206 8 months ago
Felix Morales 68907a58f8 Se cambia la forma en la que se determina el ancho del modal que muestra otros componentes durante la captura de un trafico 8 months ago
Felix Morales 85f1e53abc Creacion del modal para capturar el motivo de la solicitud 8 months ago
Felix Morales 21a58970aa Mostrar el historial de movimientos de contabilidad en los traficos en lugar de solo mostrar los rechazos 8 months ago
Felix Morales e2eb30c468 Validar que no se deje sin capturar el tipo de mercancia. El boton para borrar el formulario de captura de las facturas no borraba todos los campos 8 months ago
Felix Morales 0a4d596c73 Fix, los usuarios clientes podian cargar archivos a los traficos 8 months ago
Felix Morales 6d88057028 Cambiar la estructura del DTO de rechazos 8 months ago
Felix Morales e493bef165 Simplifica el proceso de guardado y rechazo de un trafico, generar el txt de facturación en el sevidor 8 months ago
Felix Morales c5077576fc Creacion del Reporte de facturas de traficos consolidados de Alen 8 months ago
Felix Morales 8a798d2249 Creacion del funcionamiento para agregar varias rectificaciones a un mismo trafico 9 months ago
Felix Morales 5ebde71d32 Merge branch 'main' into feature/Agregar_Multiples_Rectificaciones_Al_Mismo_Trafico_20240109 9 months ago
Felix Morales 36b4b3bedc limitar la longitud de la descripcion de la mercancia a 100 caracteres al generar el txt de facturacion 9 months ago
Felix Morales aed2edbc47 Agregar campos para capturar la rectificacion en modal de pedimentos consolidados 9 months ago
Felix Morales d1cab4f725 fix, no se asignaba la fecha de pago luego de procesar el txt de Alen 9 months ago
Felix Morales 3268f2d6cf Asignar la fecha de desaduanamiento tras leer el layout de Alen, ajustar el padding del boton de pedimentos consolidados para que no cambie su tamaño cuando cambie el texto 9 months ago
Felix Morales 728b6e002f fix, no se ocultaban todos los campos para capturar facturas cuando el usuario no pertenecia a corresponsalias 9 months ago
Felix Morales 30203afc87 Merge branch 'feature/Reporte_Relacion_Facturas_Alen' 9 months ago
Felix Morales 0ce15173bc Agregar mensaje de pedimento duplicado al componente de pedimentos consolidados 9 months ago
Felix Morales cb3922d007 Merge branch 'feature/ConsolidarPedimentos_20231229' 9 months ago
Felix Morales e866dbf854 Agregar columnas faltantes al DataTable del componente de facturas 9 months ago
Felix Morales 43a640ac36 fix, el orden de los encabezados del excel de los traficos no correspondia con el del contenido del documento 9 months ago
Felix Morales 6510e6a876 Agregar campos faltantes al componente ControlledInput 9 months ago
Felix Morales df552e5e75 creacion de componente para relacionar facturas y contenedores 9 months ago
Felix Morales d25724ea46 Reporte listo, avance para relacionar facturas y contenedores 9 months ago
  1. 2
      package.json
  2. 9
      src/App.tsx
  3. 19
      src/Classes/Corresponsales/CCorresponsalesTrafico.ts
  4. 32
      src/Components/Catalogos/CatCorresponsales/CatCorresponsales.tsx
  5. 2
      src/Components/Catalogos/CatCorresponsales/ControlledInput/ControlledInput.tsx
  6. 340
      src/Components/Catalogos/CatTabulador/CatTabulador.tsx
  7. 107
      src/Components/Clientes/Traficos/RptClientesTraficos.tsx
  8. 672
      src/Components/Clientes/Traficos/TraficoCliente.tsx
  9. 4
      src/Components/Corresponsales/Anticipos/Anticipos.tsx
  10. 1
      src/Components/Corresponsales/Contenedores/Contenedores.tsx
  11. 1
      src/Components/Corresponsales/Contenedores/ControlledInput/ControlledInput.tsx
  12. 118
      src/Components/Corresponsales/Contenedores/FacturasContenedor.tsx
  13. 115
      src/Components/Corresponsales/Contenedores/SelectContainer.tsx
  14. 17
      src/Components/Corresponsales/CuentasComplementarias/CuentasComplementarias.tsx
  15. 153
      src/Components/Corresponsales/PedimentosConsolidados/PedimentosConsolidados.tsx
  16. 53
      src/Components/Corresponsales/ProveedorFactura/ControlledInput/ControlledInput.tsx
  17. 151
      src/Components/Corresponsales/ProveedorFactura/ProveedorFactura.tsx
  18. 85
      src/Components/Corresponsales/Rectificaciones/HistorialRectificaciones.tsx
  19. 382
      src/Components/Corresponsales/Rectificaciones/NuevaRectificacion.tsx
  20. 154
      src/Components/Corresponsales/SolicitudReapertura/AutorizarSolicitud.tsx
  21. 119
      src/Components/Corresponsales/SolicitudReapertura/CrearSolicitud.tsx
  22. 25
      src/Components/Corresponsales/Tabulador/Tabulador.tsx
  23. 680
      src/Components/Corresponsales/TraficoCorresponsales.tsx
  24. 26
      src/Components/Dashboard/Dashboard.tsx
  25. 125
      src/Components/Dashboard/DashboardClientes.tsx
  26. 14
      src/Components/Dashboard/DashboardContabilidad.tsx
  27. 36
      src/Components/Dashboard/DashboardCorresponsales.tsx
  28. 63
      src/Components/Dashboard/DashboardFacturacion.tsx
  29. 125
      src/Components/Dashboard/DashboardSistemas.tsx
  30. 517
      src/Components/EstadosCuenta/EstadosCuenta.tsx
  31. 26
      src/Components/Login/login.tsx
  32. 3
      src/Components/Logout/logout.tsx
  33. 195
      src/Components/Reportes/ArchivoElectronico/DialogAE.tsx
  34. 102
      src/Components/Reportes/RptCorresponsalesTraficos.tsx
  35. 2
      src/Components/Reportes/RptCorresponsalesTraficosHst.tsx
  36. 42
      src/Components/Reportes/customCells/ClienteProgressBar.tsx
  37. 41
      src/Components/Reportes/customCells/verDocumentos.tsx
  38. 64
      src/Components/ReportesClientes/Alen/RelacionFacturas.tsx
  39. 71
      src/Components/ReportesClientes/Alen/ReporteFacturasConsolidados.tsx
  40. 210
      src/Components/ReportesClientes/CuentasCerradas.tsx/CuentasCerradas.tsx
  41. 308
      src/Components/ReportesClientes/Facturacion/ReporteGeneral.tsx
  42. 4
      src/Components/ReportesClientes/GC50/ReporteGC50.tsx
  43. 372
      src/Components/ReportesClientes/ReporteArchivoElectronico.tsx
  44. 15
      src/Components/Utils/FileManager/FileManager.tsx
  45. 3
      src/DTO/Corresponsales/DTOFiltrosTraficosClientes.ts
  46. 2
      src/DTO/Corresponsales/DTOPedimentosConsolidados.ts
  47. 13
      src/DTO/Corresponsales/DTORectificacionHistorico.ts
  48. 2
      src/DTO/Corresponsales/DTORptCorresponsalesTraficos.ts
  49. 2
      src/DTO/Corresponsales/DTOTraficoCompleto.ts
  50. 9
      src/DTO/Corresponsales/DTOTraficoSolicitud.ts
  51. 48
      src/DTO/EstadosCuenta/DTOEstadoCuentaAlen.ts
  52. 11
      src/DTO/EstadosCuenta/DTOEstadosCuentaAlenFilters.ts
  53. 29
      src/DTO/Facturacion/DTOReporteGeneral.ts
  54. 21
      src/DTO/Reportes/CuentasCerradas/DTOReporteCuentasCerradas.ts
  55. 2
      src/DTO/Reportes/GC50/DTOReporteGC50.ts
  56. 2
      src/Interfaces/Catalogos/ICatCorresponsales.ts
  57. 4
      src/Interfaces/Catalogos/ICatTiposContenedores.ts
  58. 3
      src/Interfaces/Catalogos/ITabulador.ts
  59. 1
      src/Interfaces/Catalogos/ITabuladorConceptos.ts
  60. 1
      src/Interfaces/Corresponsales/ICorresponsalContenedores.ts
  61. 6
      src/Interfaces/Corresponsales/ICorresponsalFacturas.ts
  62. 5
      src/Interfaces/Corresponsales/ICorresponsalRectificacionHistorico.ts
  63. 4
      src/Interfaces/Corresponsales/ICorresponsalTrafico.ts
  64. 5
      src/Interfaces/Corresponsales/ICorresponsalTraficoContabilidad.ts
  65. 11
      src/Interfaces/Corresponsales/ICorresponsalTraficoSolicitud.ts
  66. 2
      src/Interfaces/ReportesClientes/IReporteOperacionesNewell.ts
  67. 12
      src/Services/Catalogos/ArchivoElectronico.Services.ts
  68. 6
      src/Services/Catalogos/Clientes.Services.ts
  69. 10
      src/Services/Catalogos/TiposContenedores.Service.ts
  70. 7
      src/Services/Contabilidad/Contabilidad.Corresponsalias.Services.ts
  71. 3
      src/Services/Corresponsalias/Corresponsales.Facturas.Services.ts
  72. 4
      src/Services/Corresponsalias/Corresponsales.Tabuladores.Services.ts
  73. 9
      src/Services/Corresponsalias/Corresponsales.Trafico.Services.ts
  74. 19
      src/Services/Corresponsalias/Corresponsales.Trafico.Solicitud.Service.ts
  75. 6
      src/Services/Dashboard/Dashboard.Corresponsales.Services.ts
  76. 3
      src/Services/Dashboard/Dashboard.Facturacion.Service.ts
  77. 41
      src/Services/EstadosCuenta/EstadosCuentaAlen.Service.ts
  78. 8
      src/Services/Reportes/ReporteCuentasCerradas.Service.ts
  79. 13
      src/Services/Reportes/ReportesAlen.Service.ts
  80. 16
      src/Services/Reportes/ReportesFacturacion.Service.ts
  81. 25
      src/Services/Utils/FileManager.Services.ts
  82. 15
      src/css/generic01.css
  83. 18
      src/index.tsx
  84. 2
      src/store/features/CatCorresponsales/CatCorresponsalesSlice.ts
  85. 21
      src/store/features/CatTiposContenedores/CatTiposContenedoresSlice.ts
  86. 4
      src/store/features/Corresponsales/CorresponsalesContenedoresSlice.ts
  87. 18
      src/store/features/Corresponsales/CorresponsalesFacturasSlice.ts
  88. 40
      src/store/features/Corresponsales/CorresponsalesPedimentosRectificacionesSlice.ts
  89. 6
      src/store/features/Corresponsales/CorresponsalesTraficoSlice.ts
  90. 11
      src/store/features/userStatusSlice/userStatusSlice.ts
  91. 6
      src/store/store.ts

@ -1,6 +1,6 @@
{
"name": "corresponsalfrontend",
"version": "1.9.0",
"version": "2.1.0",
"private": true,
"dependencies": {
"@reduxjs/toolkit": "^1.9.5",

@ -19,7 +19,8 @@ function App() {
const dispatch = useDispatch()
let _menu: ItemMenu[] = []
const [mainMenu, setMainMenu] = useState(_menu)
const userLogued = useSelector((state: RootState) => state.userStatus.value)
const userLogued = useSelector((state: RootState) => state.userStatus.isLogged)
const isAlenUser = useSelector((state: RootState) => state.userStatus.isAlenUser)
const [show, setShow] = useState(false)
const [msg, setMsg] = useState('')
const [header, setHeader] = useState('')
@ -71,8 +72,12 @@ function App() {
if(Perfil === 'Corresponsales'){
navigate('/RptCorresponsalesTraficos/proc=1/modo=1')
}else if(Perfil === 'Clientes'){
navigate('/Clientes/Traficos')
if(isAlenUser){
navigate('/')
}else{
navigate('/Clientes/Traficos')
}
} else{
navigate('/')
}
}

@ -14,7 +14,7 @@ export default class CCorresponsalesTrafico implements ICorresponsalTrafico {
kilos?: number
estatus?: number
trafico?: string
aduana?: number
aduana?: string
patente?: number
pedimento?: number
clave?: string
@ -47,7 +47,8 @@ export default class CCorresponsalesTrafico implements ICorresponsalTrafico {
causaRectificacion: string;
totalHonorariosAA: number;
totalGastosTerceros: number;
tieneSolicitud: number;
pedimentoObligatorio: number;
constructor() {
this.id=0
this.folioGemco=''
@ -62,7 +63,7 @@ export default class CCorresponsalesTrafico implements ICorresponsalTrafico {
this.kilos=0
this.estatus=0
this.trafico=''
this.aduana=0
this.aduana='0'
this.patente=0
this.pedimento=0
this.clave=''
@ -95,6 +96,8 @@ export default class CCorresponsalesTrafico implements ICorresponsalTrafico {
this.causaRectificacion = ''
this.totalHonorariosAA = 0
this.totalGastosTerceros = 0
this.tieneSolicitud = 0
this.pedimentoObligatorio = 1
}
public getEmptyObject(): ICorresponsalTrafico {
@ -112,7 +115,7 @@ export default class CCorresponsalesTrafico implements ICorresponsalTrafico {
kilos :0,
estatus :0,
trafico :'',
aduana :0,
aduana :'0',
patente :0,
pedimento :0,
clave :'',
@ -144,7 +147,9 @@ export default class CCorresponsalesTrafico implements ICorresponsalTrafico {
cargoA: 0,
causaRectificacion: '',
totalHonorariosAA: 0,
totalGastosTerceros: 0
totalGastosTerceros: 0,
tieneSolicitud: 0,
pedimentoObligatorio: 1
}
}
@ -195,7 +200,9 @@ export default class CCorresponsalesTrafico implements ICorresponsalTrafico {
cargoA: data.cargoA,
causaRectificacion: data.causaRectificacion,
totalHonorariosAA: data.totalHonorariosAA,
totalGastosTerceros: data.totalGastosTerceros
totalGastosTerceros: data.totalGastosTerceros,
tieneSolicitud: data.tieneSolicitud,
pedimentoObligatorio: data.pedimentoObligatorio
}
}
}

@ -37,7 +37,7 @@ export const CatCorresponsales: FC<IProps> = (props) => {
// const [IDCorresponsal, setIDCorresponsal] = useState(0)
const [Nombre, setNombre] = useState('')
const [Patente, setPatente] = useState(0)
const [Aduana, setAduana] = useState(0)
const [Aduana, setAduana] = useState('0')
const [Correos, setCorreos] = useState('')
useEffect(() => {
@ -113,7 +113,7 @@ export const CatCorresponsales: FC<IProps> = (props) => {
setShowMsg(true)
return false
}
if (Aduana < 99) {
if (Aduana === '' || Aduana === '0' || Aduana === ' ' || Aduana === undefined || Aduana === null || Aduana.length < 3) {
setHeader('Error!')
setMsgColor('danger')
setMsg('La aduana debe tener 3 digitos')
@ -149,7 +149,7 @@ export const CatCorresponsales: FC<IProps> = (props) => {
setId(0)
setNombre('')
setPatente(0)
setAduana(0)
setAduana('')
}
const deleteItem = () => {
@ -279,34 +279,20 @@ export const CatCorresponsales: FC<IProps> = (props) => {
<Form.Label>Aduana</Form.Label>
</Col>
<Col>
<CurrencyFormat
<Form.Control
value={Aduana}
displayType={Depto === 'Corresponsalias' ? 'input' : 'text'}
onValueChange={(values: any) => {
const { formattedValue, value } = values
setAduana(value)
onChange={(e) => {
setAduana(e.target.value)
}}
style={
Depto === 'Corresponsalias'
? {
fontSize: '18px',
backgroundColor: '#F5FFED',
border: '2px solid #25D05B',
width: '60px',
textAlign: 'right',
borderRadius: '10px',
}
: {
style={{
fontSize: '18px',
backgroundColor: '#F5FFED',
border: '2px solid #25D05B',
width: '60px',
textAlign: 'right',
borderRadius: '10px',
paddingRight: '5px',
paddingLeft: '5px',
}
}
padding: '1px 2px'
}}
/>
</Col>
<Col xs={2}></Col>

@ -98,7 +98,7 @@ export const ControlledInput: FC<IProps> = (props) => {
onChange={onChangeEmail}
disabled={false}
onKeyDown={(e) => handleKeyDown(e, 2)}
style={{ width: '650px', textAlign: 'left' }}
style={{ width: '450px', textAlign: 'left' }}
/>
<MsgInformativo
show={show}

@ -17,7 +17,9 @@ import 'react-data-table-component-extensions/dist/index.css'
import { BsPlusSquareFill } from 'react-icons/bs'
import IClientes from '../../../Interfaces/Catalogos/IClientes'
import { FcTimeline } from 'react-icons/fc'
import { FaEraser, FaTimesCircle } from 'react-icons/fa'
import { FaEraser, FaPencilAlt, FaSave, FaTimesCircle } from 'react-icons/fa'
import CorresponsalesServices from '../../../Services/Catalogos/Corresponsales.Services'
import ICatCorresponsales from '../../../Interfaces/Catalogos/ICatCorresponsales'
interface IProps {}
@ -47,57 +49,97 @@ export default function CatTabuladores (props: IProps) {
const [show, setShowMsg] = useState(false)
const [msg, setMsg] = useState('')
const [DialogTabs, setDialogTabs] = useState(false)
const [ConceptoDialogTabs, setConceptoDialogTabs] = useState(false)
const [Corresponsal, setCorresponsal] = useState(0)
const [Corresponsales, setCorresponsales] = useState<ICatCorresponsales[]>([])
const [Tipo, setTipo] = useState(0)
const [Moneda, setMoneda] = useState(0)
const columnsConcepts = [
{
name: 'id',
selector: (row: ITabuladorConceptos) => row.id,
sortable: true,
},
{
name: 'Concepto',
width: '70%',
width: '55%',
selector: (row: ITabuladorConceptos) => row.concepto,
sortable: true,
},
{
name: 'Costo',
name: 'Costo Cliente',
width: '15%',
cell: (row: ITabuladorConceptos) => (
<ControlledInput
id={row.id}
value={row.costo}
postCost={(id, value) => {
postCost(id, value)
postCost(id, value, row.costoCorresponsal, row.idConcepto)
}}
/>
),
},
{
name: 'Costo Corresponsal',
width: '15%',
cell: (row: ITabuladorConceptos) => (
<ControlledInput
id={row.id}
value={row.costoCorresponsal}
postCost={(id, value) => {
postCost(id, row.costo, value, row.idConcepto)
}}
/>
),
},
{
name: 'Elimina',
width: '15%',
cell: (row: ITabuladorConceptos) => (
<div
style={{ textAlign: 'center', cursor: 'pointer' }}
onClick={() => {
setConcepto(row.id)
setConceptoDialogTabs(true)
}}
>
<IconContext.Provider value={{ color: 'red', size: '25px' }}>
<FaTimesCircle />
</IconContext.Provider>
</div>
),
},
]
const columnsTabs = [
{
name: 'id',
selector: (row: ITabulador) => row.id,
name: 'Nombre',
width: '70%',
cell: (row: ITabulador) => (
<div>
{row.nombre}
</div>
),
sortable: true,
},
{
name: 'Nombre',
width: '70%',
name: 'Editar',
width: '15%',
cell: (row: ITabulador) => (
<div
style={{ width: '450px', cursor: 'pointer' }}
style={{ textAlign: 'center', cursor: 'pointer' }}
onClick={() => {
setTabulador(row.id)
setNombreTabulador(row.nombre)
setCorresponsal(row.idCorresponsal!)
setTipo(row.tipo)
setMoneda(row.moneda)
}}
>
{row.nombre}
<IconContext.Provider value={{ color: 'blue', size: '25px' }}>
<FaPencilAlt />
</IconContext.Provider>
</div>
),
sortable: true,
},
{
name: 'Elimina',
width: '15%',
cell: (row: ITabulador) => (
<div
style={{ textAlign: 'center', cursor: 'pointer' }}
@ -115,14 +157,15 @@ export default function CatTabuladores (props: IProps) {
},
]
const postCost = (id: number, Cost: number) => {
const postCost = (id: number, costoCliente: number, costoCorresponsal: number, idConcepto: number) => {
const data: ITabuladorConceptos = {
id: id,
idTabulador: Tabulador,
idConcepto: Concepto,
idConcepto: idConcepto,
concepto: '',
costo: Cost,
costo: costoCliente,
activo: 1,
costoCorresponsal: costoCorresponsal
}
CTabDetDataService.Append(data)
.then((response) => {
@ -130,6 +173,7 @@ export default function CatTabuladores (props: IProps) {
setHeader('Confirmacion')
setMsg('La informacion se guardo corrctamente')
setShowMsg(true)
setConcepto(0)
})
.catch((e: Error) => {
setHeader('Error')
@ -160,6 +204,19 @@ export default function CatTabuladores (props: IProps) {
})
}
const deleteConcepto = () => {
CTabDetDataService.Delete(Concepto)
.then((resp) => {
if(resp.status === 200){
setHeader('Informativo')
setMsg(resp.data.respuesta)
setShowMsg(true)
setConceptoDialogTabs(false)
setDetalleConceptos(DetalleConceptos.filter(concepto => concepto.id != Concepto))
}
})
}
useEffect(() => {
CTabDetDataService.getAllConcepts()
.then((response) => {
@ -181,9 +238,19 @@ export default function CatTabuladores (props: IProps) {
setShowMsg(true)
return
})
CorresponsalesServices.getAll()
.then((response) => {
setCorresponsales(response.data)
})
.catch((e: Error) => {
setHeader('Error')
setMsg('Ocurrio un error: ' + e)
setShowMsg(true)
return
})
}, [])
useEffect(() => {
useEffect(() => {//Consulta los conceptos del tabulador
CTabDetDataService.GetDetailByIdTab(Tabulador)
.then((response) => {
setDetalleConceptos(response.data)
@ -197,12 +264,12 @@ export default function CatTabuladores (props: IProps) {
console.log(Tabulador)
}, [Tabulador])
useEffect(() => {
useEffect(() => {//Consulta los tabuladores de un cliente
if (Cliente > 0) {
setNombreTabulador('')
setTabuladores([])
setDetalleConceptos([])
CTabDataService.GetByCustomer(Cliente)
CTabDataService.GetByCustomer(Cliente, null)
.then((response) => {
setTabuladores(response.data)
})
@ -228,10 +295,14 @@ export default function CatTabuladores (props: IProps) {
}
const saveForm = () => {
if(NombreTabulador){
const data: ITabulador = {
id: Tabulador,
idCliente: Cliente,
nombre: NombreTabulador,
idCorresponsal:Corresponsal,
tipo: Tipo,
moneda: Moneda
}
CTabDataService.Append(data)
.then((response) => {
@ -260,22 +331,36 @@ export default function CatTabuladores (props: IProps) {
setShowMsg(true)
return
})
}else{
setHeader('Error')
setMsg('Favor de capturar el nombre del tabulador')
setShowMsg(true)
setCorresponsal(0)
return
}
}
const addConcept = () => {
const addConcept = (idConcepto: number) => {
if (Tabulador === 0) {
setHeader('Error')
setMsg('Por favor, primero seleccione el tabulador')
setShowMsg(true)
return
}
if (Concepto === 0) {
if (idConcepto === 0) {
setHeader('Error')
setMsg('Por favor, primero seleccione el concepto')
setShowMsg(true)
return
}
postCost(0, 0)
postCost(0, 0, 0, idConcepto)
}
const clearForm = () => {
setTabulador(0)
setNombreTabulador('')
setCorresponsal(0)
setConcepto(0)
}
return (
@ -283,7 +368,6 @@ export default function CatTabuladores (props: IProps) {
<Card>
<Card.Body>
<Card style={{ height: '100%' }}>
<Card.Header as='h4'>Tabuladores</Card.Header>
<Card.Body>
<Container fluid>
<Alert variant='primary'>
@ -314,24 +398,25 @@ export default function CatTabuladores (props: IProps) {
</Form.Control>
</h4>
</Col>
</Row>
</Alert>
<Row>
<Col xs={5}>
<Card style={{}}>
<Card.Header><h5>Tabuladores</h5></Card.Header>
<Card.Body>
<Card.Subtitle className='mb-2 text-muted'>
<Row>
<Col
xs={1}
style={{ textAlign: 'right', paddingTop: '5px', cursor: 'pointer' }}
onClick={() => {
setTabulador(0)
setNombreTabulador('')
}}
onClick={() => {clearForm()}}
>
<IconContext.Provider value={{ color: 'orange', size: '25px' }}>
<FaEraser />
</IconContext.Provider>
</Col>
<Col xs={1} style={{ paddingTop: '5px' }}>
<div>
<h5>Tabulador</h5>
</div>
</Col>
<Col xs={3}>
<Col xs={10}>
<h4>
<Form.Control
type='text'
@ -341,41 +426,15 @@ export default function CatTabuladores (props: IProps) {
onChange={(e) => {
setNombreTabulador(e.target.value)
}}
placeholder='Nombre del tabulador'
placeholder='Ingrese el nombre del tabulador...'
style={{ fontSize: '18px' }}
/>
</h4>
</Col>
<Col>
<Button
variant='primary'
size='sm'
style={{ paddingLeft: '10px', paddingRight: '10px' }}
onClick={() => saveForm()}
>
Guardar
</Button>
</Col>
</Row>
</Alert>
<Row>
<Col xs={6}>
<Card style={{}}>
<Card.Body>
<Card.Subtitle className='mb-2 text-muted'>
<Row>
<Col xs={2} style={{ paddingTop: '8px' }}>
Tabulador
</Col>
<Col xs={10}>
<Form.Control
type='text'
size='sm'
placeholder='Busqueda de tabulador...'
onChange={(e) => {
filtraTabulador(e)
}}
/>
<Col xs={1} style={{ paddingTop: '5px' }}>
<IconContext.Provider value={{ color: 'green', size: '30px' }}>
<FaSave onClick={() => saveForm()} style={{ cursor: 'pointer' }}/>
</IconContext.Provider>
</Col>
</Row>
</Card.Subtitle>
@ -391,20 +450,119 @@ export default function CatTabuladores (props: IProps) {
</Card.Body>
</Card>
</Col>
<Col xs={6}>
<Col xs={7}>
<Card style={{}}>
<Card.Header><h5>Datos del Tabulador: {NombreTabulador}</h5></Card.Header>
<Card.Body>
<Card.Subtitle className='mb-2 text-muted'>
<Row>
<Col xs={3} style={{ paddingTop: '5px' }}>Corresponsal</Col>
<Col xs={8}>
<Form.Control
disabled={Tabulador===0}
as='select'
onChange={(e) => {
setCorresponsal(parseInt(e.target.value))
}}
className='form-select form-select-sm'
style={{ fontSize: '18px' }}
value={Corresponsal}
>
<option value='0'>-SELECCIONE-</option>
{Corresponsales
? Corresponsales.map((c) => {
return (
<option value={c.id} key={c.id}>
{c.nombre} | {c.aduana} | {c.patente}
</option>
)
})
: null}
</Form.Control>
</Col>
<Col style={{ paddingTop: '5px' }}>
<IconContext.Provider value={{ color: 'green', size: '30px' }}>
<FaSave onClick={() => saveForm()} style={{ cursor: 'pointer' }}/>
</IconContext.Provider>
</Col>
</Row>
<Row style={{ paddingTop: '5px' }}>
<Col xs={6}>
<Row>
<Col xs={3}>Tipo: </Col>
<Col xs={9}>
<Form>
<Form.Check
type='radio'
id='radio-Impo'
value={1}
label='Impo'
inline
name='grupo'
onChange={e => setTipo(parseInt(e.target.value))}
checked={Tipo === 1}
disabled={Tabulador===0}
/>
<Form.Check
type='radio'
id='radio-Expo'
value={2}
label='Expo'
inline
name='grupo'
onChange={e => setTipo(parseInt(e.target.value))}
checked={Tipo === 2}
disabled={Tabulador===0}
/>
</Form>
</Col>
</Row>
</Col>
<Col xs={6}>
<Row>
<Col xs={4}>Moneda:</Col>
<Col xs={8}>
<Form>
<Form.Check
type='radio'
id='radio-USD'
value={1}
label='USD'
inline
name='grupo'
onChange={e => setMoneda(parseInt(e.target.value))}
checked={Moneda === 1}
disabled={Tabulador===0}
/>
<Form.Check
type='radio'
id='radio-MXN'
value={2}
label='MXN'
inline
name='grupo'
onChange={e => setMoneda(parseInt(e.target.value))}
checked={Moneda === 2}
disabled={Tabulador===0}
/>
</Form>
</Col>
</Row>
</Col>
</Row>
<hr />
<Row>
<Col xs={2} style={{ paddingTop: '8px' }}>
Conceptos
</Col>
<Col xs={9}>
<Col xs={10}>
<Form.Control
disabled={Tabulador===0}
as='select'
onChange={(e) => setConcepto(parseInt(e.target.value))}
onChange={(e) => addConcept(parseInt(e.target.value))}
className='form-select form-select-sm'
style={{ fontSize: '17px' }}
value={Concepto}
>
<option value='0'>- Seleccione -</option>
{CatConceptos
@ -418,7 +576,7 @@ export default function CatTabuladores (props: IProps) {
: null}
</Form.Control>
</Col>
<Col style={{ paddingTop: '5px' }}>
{/* <Col style={{ paddingTop: '5px' }}>
<Form.Label
onClick={() => {
addConcept()
@ -429,7 +587,7 @@ export default function CatTabuladores (props: IProps) {
<BsPlusSquareFill />
</IconContext.Provider>
</Form.Label>
</Col>
</Col> */}
</Row>
</Card.Subtitle>
<DataTable
@ -487,6 +645,42 @@ export default function CatTabuladores (props: IProps) {
</Row>
</Modal.Footer>
</Modal>
<Modal
show={ConceptoDialogTabs}
onHide={() => {
setConceptoDialogTabs(false)
}}
size='sm'
>
<Modal.Body>
¿Esta seguro de eliminar este concepto?
</Modal.Body>
<Modal.Footer>
<Row>
<Col xs={6} style={{ textAlign: 'left', paddingRight: '100px' }}>
<Button
variant='danger'
onClick={deleteConcepto}
size='sm'
style={{ paddingRight: '20px', paddingLeft: '20px' }}
>
Si
</Button>
</Col>
<Col xs={6} style={{ textAlign: 'right' }}>
<Button
variant='secondary'
onClick={() => {
setConceptoDialogTabs(false)
}}
size='sm'
>
Cerrar
</Button>
</Col>
</Row>
</Modal.Footer>
</Modal>
<MsgInformativo
show={show}
msg={msg}

@ -32,6 +32,7 @@ import ClientesServices from '../../../Services/Catalogos/Clientes.Services'
import reportesServices from '../../../Services/Reportes/reportes.services'
import DTOFiltrosTraficosClientes from '../../../DTO/Corresponsales/DTOFiltrosTraficosClientes'
import TraficoCliente from './TraficoCliente'
import { ClienteProgressBar } from '../../Reportes/customCells/ClienteProgressBar'
/* import '../../css/generic01.css' */
interface IProps {}
@ -74,8 +75,9 @@ export default function RptClientesTraficos(props: IProps) {
//const [Corresponsal, setCorresponsal] = useState(0)
const [Pedimento, setPedimento] = useState(0)
const [Patente, setPatente] = useState(0);
const [Aduana, setAduana] = useState(0);
const [Aduana, setAduana] = useState('0');
const [Referencia, setReferencia] = useState('')
const [Estado, setEstado] = useState(0)
const [Clientes, setClientes] = useState<Array<IClientes>>()
const [filtro, setFiltro] = useState('')
const gridRef = React.useRef<any>(null)
@ -92,7 +94,7 @@ export default function RptClientesTraficos(props: IProps) {
center: true,
sortable: true,
filter: true,
cellRenderer: ProgressBar,
cellRenderer: ClienteProgressBar,
},
{
field: 'folioGemco',
@ -263,7 +265,8 @@ export default function RptClientesTraficos(props: IProps) {
Aduana: Aduana,
Patente: Patente,
Referencia: Referencia,
IdUsuario: UserId
IdUsuario: UserId,
Estado: Estado
}
ClientesServices
.GetTraficos(data)
@ -289,56 +292,33 @@ export default function RptClientesTraficos(props: IProps) {
}
function exportExcel(jsonData: any[], fileName: string): void {
let Heading = [
[
{
title: 'Aduana Seccion Despacho',
style: { font: { sz: '18', bold: true } },
},
'Patente',
'Referencia',
'Pedimento',
'Fecha Pago',
'Fecha Entrada Presentacion',
'Clave Docto',
'Es rectificacion',
'Tipo Cambio',
'Valor Dls',
'Valor Aduana',
'Numero Factura',
'Fecha Factura',
'Proveedor Factura',
'Incrementables Fact',
'Fraccion',
'Subdiv NICO',
'Descripcion',
'Pais Origen',
'Pais Vendedor',
'Tasa DTA',
'Tasa IGI',
'Numero Parte',
'Cantidad Comercial',
'TL Pais',
'Tipo Tasa',
'Unidad Comercial',
'Valor Factura Item',
'Valor Comercial Ped',
'Valor Factura Item MN',
],
]
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 data: DTOFiltrosTraficosClientes = {
Inicio: moment(Inicio).format('YYYY-MM-DD'),
Fin: moment(Fin).format('YYYY-MM-DD'),
TipoOperacion: TipoOperacion,
NoCliente: Cliente,
IdCorresponsal: Corresponsal,
Pedimento: Pedimento,
Aduana: Aduana,
Patente: Patente,
Referencia: Referencia,
IdUsuario: UserId,
Estado: Estado
}
ClientesServices.GetExcel(data)
.then(resp => {
const url = window.URL.createObjectURL(new Blob([resp.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', `Reporte_Operaciones.xlsx`);
document.body.appendChild(link);
link.click();
}).catch(e => {
setHeader('Error')
setMsg('Ocurrio un error al generar el reporte. Por favor, intentelo de nuevo.')
setShowMsg(true)
return
})
}
return (
@ -372,7 +352,7 @@ export default function RptClientesTraficos(props: IProps) {
type='text'
size='sm'
placeholder='Aduana'
onChange={(e) => setAduana(+e.target.value)}
onChange={(e) => setAduana(e.target.value === '' ? '0' : e.target.value)}
/>
</Col>
<Col xs={2}>
@ -453,6 +433,23 @@ export default function RptClientesTraficos(props: IProps) {
</Form.Control>
</Form.Label>
</Col>
<Col lg={2}>
<Form.Label style={{width:'100%', fontSize:'smaller'}}>
Estado
<Form.Control
as='select'
onChange={(e) => {
setEstado(parseInt(e.target.value))
}}
className='form-select form-select-sm'
>
<option value='0'>-SELECCIONE-</option>
<option value='1'>Por Terminar</option>
<option value='2'>Despachado Sin Facturar</option>
<option value='3'>Despachado y Facturado</option>
</Form.Control>
</Form.Label>
</Col>
{(Perfil !== "Corresponsales" && Perfil !== "Clientes")? <>
<Col lg={4}>
<Form.Label style={{width:'100%', fontSize:'smaller'}}>
@ -492,7 +489,6 @@ export default function RptClientesTraficos(props: IProps) {
<BsSearch />
&nbsp; Buscar
</Button>
{(Depto === 'Corresponsalias' || Depto === 'Sistemas') ? (
<Button
size='sm'
variant='success'
@ -504,9 +500,6 @@ export default function RptClientesTraficos(props: IProps) {
<BsFileEarmarkExcel />
&nbsp; Excel
</Button>
) : (
''
)}
</Col>
</Row>
</Card.Body>

@ -80,6 +80,11 @@ import FileManager from "../../Utils/FileManager/FileManager"
import { MFileManager } from "../../Utils/MFileManager/MFileManager"
import { MsgInformativo } from "../../Utils/Toast/msgInformativo"
import DatePicker from 'react-datepicker'
import { populateRectificaciones } from "../../../store/features/Corresponsales/CorresponsalesPedimentosRectificacionesSlice"
import { NuevaRectificacion } from "../../Corresponsales/Rectificaciones/NuevaRectificacion"
import { PedimentosConsolidados } from "../../Corresponsales/PedimentosConsolidados/PedimentosConsolidados"
import { populatePedimentos } from "../../../store/features/Corresponsales/CorresponsalesPedimentosConsolidadosSlice"
import PedimentosConsolidadosService from '../../../Services/Corresponsalias/Corresponsales.Trafico.Pedimento.Consolidados.Service'
interface IProps {
IDTrafico: number
onClose: (val: boolean) => void
@ -138,6 +143,9 @@ export default function TraficoCliente(props:IProps){
(state: RootState) =>
state.CCueCompEstatus.CorresponsalesCuentasComplementariasEstatus
)
const mCPedimentosConsolidados = useSelector(
(state:RootState) => state.CPedimentosConsolidados.PedimentosConsolidados
)
const mCProveedores = useSelector((state:RootState) => state.CatProveedores.CatalogoProveedores)
const [ModalSize, setModalSize] = useState('sm')
@ -164,7 +172,7 @@ export default function TraficoCliente(props:IProps){
const [Kilos, setKilos] = useState<number | undefined>(0)
const [Estatus, setEstatus] = useState<number>(0)
const [Trafico, setTrafico] = useState<string | undefined>('')
const [Aduana, setAduana] = useState<number | undefined>(0)
const [Aduana, setAduana] = useState<string | undefined>('0')
const [Patente, setPatente] = useState<number | undefined>(0)
const [Pedimento, setPedimento] = useState<number | undefined>(0)
const [ClavePedimento, setClavePedimento] = useState<string>('')
@ -207,6 +215,8 @@ export default function TraficoCliente(props:IProps){
'Facturas pagos a terceros'
)
const [LblAnticipos, setLblAnticipos] = useState('Anticipos')
const [LblPedimentos, setLblPedimentos] = useState('Pedimentos Consolidados')
const [LblRectificaciones, setLblRectificaciones] = useState('Ped. Rectificados')
const [StatusTrafico, setStatusTrafico] = useState(1)
const [StatusColor, setStatusColor] = useState('#FFFFFF')
const [PagosaTerceros, setPagosaTerceros] = useState(0)
@ -282,7 +292,7 @@ export default function TraficoCliente(props:IProps){
const [nextStepModalBody, setNextStepModalBody] = useState<string>("");
const [CargoPara, setCargoPara] = useState(0);
const [CausaRectificacion, setCausaRectificacion] = useState('');
const [EncabezadoPedimento1, setEncabezadoPedimento1] = useState("Pedimento");
const [EncabezadoPedimento1, setEncabezadoPedimento1] = useState("Pedimentos");
const [EncabezadoPedimento2, setEncabezadoPedimento2] = useState(".");
const [CentroCostos, setCentroCostos] = useState<string>('');
const [ClaveClienteFacturacion, setClaveClienteFacturacion] = useState(0);
@ -706,7 +716,7 @@ export default function TraficoCliente(props:IProps){
setShowMsg(true)
return
})
CContaDataService.Get(IDTrafico, 0)
CContaDataService.Get(IDTrafico, 1, 2)
.then((response) => {
setRechazosTrafico(response.data)
})
@ -716,7 +726,7 @@ export default function TraficoCliente(props:IProps){
setShowMsg(true)
return
})
CContaDataService.Get(IDTrafico, 2)
CContaDataService.Get(IDTrafico, 2, 1)
.then((response) => {
setRechazosContabilidad(response.data)
})
@ -726,6 +736,10 @@ export default function TraficoCliente(props:IProps){
setShowMsg(true)
return
})
PedimentosConsolidadosService.GetAll(IDTrafico)
.then((resp) => {
dispatch(populatePedimentos(resp.data))
})
loadRectificacionHistorico()
DoesThe2ZipFileExists()
}
@ -733,15 +747,15 @@ export default function TraficoCliente(props:IProps){
const loadRectificacionHistorico = () => {
CTrafDataService.GetRectificacionHistorico(IDTrafico)
.then((response) => {
if (response.data.id > 0) {
setEncabezadoPedimento1("Pedimento Rectificado")
setEncabezadoPedimento2("Pedimento Original")
setAduanaH(response.data.aduana.toString())
setPatenteH(response.data.patente.toString())
setPedimentoH(response.data.pedimento.toString())
setClavePedimentoH(response.data.clave)
setFechaPagoH(response.data.fechaPago)
dispatch(populateRectificaciones(response.data))
if (response.data.length > 0) {
let ultimaRectificacion = response.data[response.data.length-1]
setEncabezadoPedimento1("Pedimento Master Rectificado")
setAduanaH(ultimaRectificacion.aduana.toString())
setPatenteH(ultimaRectificacion.patente.toString())
setPedimentoH(ultimaRectificacion.pedimento.toString())
setClavePedimentoH(ultimaRectificacion.clave)
setFechaPagoH(ultimaRectificacion.fechaPago)
}
})
.catch((e: Error) => {
@ -865,7 +879,7 @@ export default function TraficoCliente(props:IProps){
useEffect(() => {
if (
IDCorresponsal !== 0 &&
Aduana !== 0 &&
Aduana !== '' && Aduana !== '0' && Aduana !== ' ' && Aduana !== undefined && Aduana !== null &&
Patente !== 0 &&
Pedimento !== 0 &&
FechaPago !== '' &&
@ -943,18 +957,6 @@ export default function TraficoCliente(props:IProps){
}*/
useEffect(() => {
if (IDCliente > 0) {
CTabDataService.GetByCustomer(IDCliente)
.then((response) => {
setTabuladores(response.data)
})
.catch((e: Error) => {
setHeader('Error')
setMsg('Ocurrio un error: ' + e)
setShowMsg(true)
return
})
}
if (Clientes) {
let tmpArray: ItemList[] = []
Clientes.forEach((element) => {
@ -1035,6 +1037,12 @@ export default function TraficoCliente(props:IProps){
setValorFacturasDls(total)
}, [mCFacturas, IDTrafico, IDCliente])
useEffect(() => {
let ant = mCPedimentosConsolidados.filter(x => x.id > 0)
let label = `Pedimentos Consolidados (${ant.length})`
setLblPedimentos(label)
}, [mCPedimentosConsolidados])
function calculateDaysBetweenDates(date1: Date, date2: Date) {
var oneDay = 24 * 60 * 60 * 1000
var date1InMillis = date1.getTime()
@ -1077,264 +1085,10 @@ export default function TraficoCliente(props:IProps){
return ''
}
function openSOIA() {
let id: number = Aduana ? Aduana : 0
window.open(
`https://aplicacionesc.mat.sat.gob.mx/SOIA_CR_WEB/oia_consultarapd_cep.aspx?&pa=${Patente}&dn=${Pedimento}&s=0&ap=${getCurrentYear()}&pad=${Aduana}&ad=${getAduana(
id
)}`
)
}
const saveCurrentStep = () => {
if(Depto === 'Corresponsalias') saveCorresponsaliasStep()
else if(Depto === 'Contabilidad') saveContabilidadAndFacturacionSteps()
}
const saveFinalStep = async (data: DTOTraficoCompleto) => {
CTrafDataService.ValidateComplete(data)
.then((response) => {
if (response.status === 200) {
setHeader('Informativo')
setMsg('La informacion se guardo correctamente')
setShowMsg(true)
return
}
})
.catch((e: Error) => {
setHeader('Error')
setMsg('Ocurrio un error: ' + e)
setShowMsg(true)
return
})
}
const saveCorresponsaliasStep = () => {
if(ComentariosRechazo === ''){
let data: DTOTraficoCompleto = {
id: IDTrafico,
idUsuario: UserId,
estatus: TerminaProceso,
comentarios: 'Todo Correcto'
}
saveFinalStep(data)
}else{
let data: ICorresponsalesTraficoContabilidad = {
id: 0,
idUsuario: UserId,
idTrafico: IDTrafico,
statusProceso: 0,
fechaRegistro: '',
razonRechazo: ComentariosRechazo,
tipo: 0
}
rejectCurrentStep(data)
}
}
const saveContabilidadAndFacturacionSteps = async () => {
if(IDRazonRechazo === 0){
setHeader('Informativo')
setMsg('Debe aceptar el tráfico o seleccionar un motivo de rechazo.')
setShowMsg(true)
return
}
let arrStatus = mCCCEstatus.filter((a) => {
if (a.id === IDRazonRechazo) {
return a
}
});
if(IDRazonRechazo === 7){
let data: DTOTraficoCompleto = {
id: IDTrafico,
idUsuario: UserId,
estatus: Proceso === 2 ? 3 : 4,
comentarios: arrStatus[0].estatus
}
await saveFinalStep(data).then(async (r) => {
if(Proceso === 2) await generateFacturacionTxt();
});
}else{
let data: ICorresponsalesTraficoContabilidad = {
id: 0,
idUsuario: UserId,
idTrafico: IDTrafico,
statusProceso: 0,
fechaRegistro: '',
razonRechazo: arrStatus[0].estatus,
tipo: Proceso === 2 ? 2 : 3
}
rejectCurrentStep(data)
}
}
const rejectCurrentStep = (data:ICorresponsalesTraficoContabilidad) => {
CContaDataService.Append(data)
.then( () => {
setHeader('Informativo')
setMsg('Tráfico rechazado con éxito')
setShowMsg(true)
return
})
.catch((e: Error) => {
setHeader('Error')
setMsg('Ocurrio un error: ' + e)
setShowMsg(true)
return
});
}
let handleColor = (time: Date) => {
return time.getHours() > 12 ? 'text-success' : 'text-error'
}
const generaRectificacion = () => {
if (Aduana && Patente && Pedimento && ClavePedimento.length>0 && FechaPago) {
const data : DTORectificacionHistorico = {
IdTrafico: IDTrafico,
IdUsuario: UserId
}
CTrafDataService.AppendRectificacionHistorico(data)
.then((response) => {
console.log(response);
if(response.data) loadRectificacionHistorico()
else{
setHeader('Error')
setMsg('Para poder generar la rectificación asegurese de GUARDAR los datos: Patente, Aduana, Pedimento, Clave, Fecha pago')
setShowMsg(true)
return
}
})
.catch((e: Error) => {
setHeader('Error')
setMsg('Ocurrio un error: ' + e)
setShowMsg(true)
return
})
} else {
setHeader('Error')
setMsg('Parea poder generar este proceso es necesario que los siguientes campos tengan informacion: Patente, Aduana, Pedimento, Clave, Fecha pago')
setShowMsg(true)
return
}
}
const readFile = (event: any) => {
const fileUploaded = event.target.files[0];
if(!fileUploaded) return;
const fileReader = new FileReader();
fileReader.readAsText(fileUploaded);
fileReader.onload = async () => {
let Gcs = fileReader.result?.toString().split("\r\n")
let facturas: Array<Array<string>> = []
Gcs?.forEach(Gc => {
facturas.push(Gc.split("|"))
})
console.log(facturas)
if(hiddenFileInputRef.current !== null ) hiddenFileInputRef.current.value = "";
patchForm(facturas[0])
await saveTxtContenedores(facturas)
await saveFacturasTxt(facturas)
setTimeout(()=> {dispatch(addTxtContenedores(txtContenedores));dispatch(addTxtFacturas(txtFacturas))}, 2000)
};
fileReader.onerror = () => {}
};
const patchForm = (factura: string[]) => {
setPedimento(+factura[6]);
setFechaPago(setDate(factura[7]));
setClavePedimento(factura[8])
setTipoCambio(+factura[15])
setCantidadFracciones(+factura[21])
setDescripcionMercancia(factura[14])
setObservaciones(factura[48])
}
const saveTxtContenedores = async (facturas: string[][]) => {
facturas.forEach(async (factura) => {
await CContDataService.Append(
{id: 0, contenedor: factura[32], idTrafico: IDTrafico , fSemaforo: factura[22], semaforo: factura[45] === 'VERDE' ? 2 : 1,}
)
.then((response) => {
if (response.status === 200) {
txtContenedores.push(response.data)
}
})
.catch((e: Error) => {
return
})
})
}
const saveFacturasTxt = async(facturas: string[][]) => {
facturas.forEach(async (factura) => {
let proveedor = mCProveedores.filter(x => x.nombre === factura[10])[0]
await CFacDataService.Append({
id: 0,
factura: factura[13],
idTrafico: IDTrafico,
valorFacturaDls: +factura[16],
proveedor: proveedor.id,
corresponsal: IDCorresponsal,
pedido: factura[29],
code: 0,
folioGEMCO: ''
}).then((response) => {
if (response.status === 200) {
txtFacturas.push(response.data)
}
})
.catch((e: Error) => {
return
})
});
}
const generateFacturacionTxt = async () => {
let cliente = Clientes?.filter(x => x.sClave === IDCliente)[0];
let tipoMercancia = TiposMercancia.filter(x => x.id === IDTipoMercancia)[0];
let facturas = mCFacturas.filter(factura => factura.id > 0);
let nombreProveedor = "";
let descripcionMercancia = DescripcionMercancia!.replace(/(\r\n|\n|\r)/gm, "");
//
let fileData = `"${FolioTrafico}"|${ClaveClienteFacturacion === IDCliente || ClaveClienteFacturacion === 0? IDCliente : ClaveClienteFacturacion}|${Patente}|${Pedimento}|${TipoCambio}|${FechaPago}|0|0|0|0|0|0|0.00|"${Aduana}"|"${ClavePedimento}"|${TipoOperacion}|`;
//
fileData += `"C"|${ValorFacturasDls}|${ValorFacturasDls! * TipoCambio!}|${ValorAduanaMN}|"${descripcionMercancia}"|${Kilos}|${Kilos! * 2.20462}|${CantidadFracciones}|"${SemafoFiscal === 0 ? "R" : "V"}"|`;
//
if(facturas.length > 0){
nombreProveedor = mCProveedores.filter(p => p.id === facturas[0].proveedor)[0].nombre;
fileData += `${facturas.length}|"${facturas.map(factura => {return factura.factura}).join(",").substring(0, 25)}"|0|"${nombreProveedor}"|"${concatFacturasPedidos(facturas)}"|`;
}else
fileData += `0|""|0|""|""|`;
//
fileData += `${Bultos}|${0}|${0}|${moment(FechaDesaduanamiento).format('MM/DD/YYYY')}|${mCContenedores.length-1}|0|""|${moment(FechaDesaduanamiento).format('MM/DD/YYYY')}|${tipoMercancia?.clave ? tipoMercancia?.clave : '""'}|0|0|""|""|""|""|/ /|F|F|F|F|0|0|F|0.00|F|0|""|""|`;
//
fileData += `${FechaPagoH !== "" ? FechaPagoH : FechaPago}|""|""|0|"${ClaveClienteFacturacion === IDCliente || ClaveClienteFacturacion === 0? cliente!.sRazonSocial.split('|')[0].trim() : NombreClienteFacturacion}"|${ClaveClienteFacturacion === IDCliente || ClaveClienteFacturacion === 0? cliente!.sRFC : RfcClienteFacturacion}|""|""|""|""|""|""|""|"${nombreProveedor}"|`;
//
fileData += `0|""|""|""|""|""|""|""|""|${ValorFacturasDls}|""|""|336|""|/ / : :|${moment().format("MM/DD/YYYY hh:mm:ss")}|${moment().format("MM/DD/YYYY hh:mm:ss")}|`;
//
fileData += `0|""|""|""|0|0|0|F|""|0|""|""|0|0|0|0|""|"${CentroCostos}"`;
//const blob = new Blob([fileData], { type: "text/plain" });
const file = new File([fileData], `${FolioTrafico}_${Date.now()}.txt`, {type: "text/plain"});
let formData = new FormData();
formData.append('file', file);
await axios.post(
URL.get() +
`/FileManager/AppendFileByProcess?IdUsuario=${UserId}&Proceso=${31}&Tags=${IDTrafico}&crud=1`,
formData, {
headers:{
'Authorization': 'Bearer ' + token
}
}
);
/*const url = URL.createObjectURL(blob);
const link = document.createElement("a");
link.download = `${FolioTrafico}_${Date.now()}.txt`;
link.href = url;
link.click();*/
}
const concatFacturasPedidos = (facturas: ICorresponsalFacturas[]) => {
let pedidos = "";
facturas.forEach((factura, index) => {
@ -1376,36 +1130,6 @@ export default function TraficoCliente(props:IProps){
//}
}
const cerrarTrafico = () => {
if(TotalHonorariosAA == 0){
setHeader('Error')
setMsg('Para cerrar la cuenta debe capturar el total de horarios')
setShowMsg(true)
return;
}
saveForm();
FileManagerServices.GetClientesZip(IDTrafico)
.then(response => {
CTrafDataService.ValidateComplete({id: IDTrafico, idUsuario:UserId, estatus: 4, comentarios:'Todo Correcto'})
.then(resp => {
setProceso(4);
setHeader('Informativo')
setMsg('Cuenta cerrada con éxito.')
setShowMsg(true)
}).catch(e => {
setHeader('Error')
setMsg('Ocurrio un error al cerrar la cuenta. Favor de intentarlo nuevamente')
setShowMsg(true)
});
}).catch(error => {
setHeader('Error')
setMsg('No se han encontrado uno o más de los archivos obligatorios para cerrar la cuenta.')
setShowMsg(true)
return
})
}
const GetClientesZip = () => {
FileManagerServices.GetClientesZip(IDTrafico)
.then(response => {
@ -1427,6 +1151,10 @@ export default function TraficoCliente(props:IProps){
link.click();
}
const showHistorialRectificaciones = () => {
setLoadComponent(14);
setShowModal(true);
}
return (
<div style={{height:'100%', overflowY:'scroll'}}>
<Card className="labelSize13px" style={{borderStyle:'none', height:'100%'}}>
@ -1460,10 +1188,7 @@ export default function TraficoCliente(props:IProps){
<Row>
<Col sm={3} md={2} lg={4}>
<Form.Label
onClick={() => {
showModalBox(11)
}}
style={{ cursor: 'pointer', display: 'flex'}}
style={{ display: 'flex'}}
>
<IconContext.Provider
value={{ color: 'blue', size: '15px' }}
@ -1603,34 +1328,6 @@ export default function TraficoCliente(props:IProps){
</Form.Label>
</Col>
<Col sm={6} md={6} lg={8}>
<Form.Label style={{ width:'100%' }}>
<IconContext.Provider value={{ color: 'blue', size: '15px' }}>
<span onClick={() => {showModalBox(10)}}
style={{ cursor: 'pointer' }}>
<FcTimeline />&nbsp;Precuenta
</span>
</IconContext.Provider>
<Form.Control
as="select"
disabled={true}
onChange={(e) => {
setIDTabulador(parseInt(e.target.value))
}}
value={IDTabulador}
className="form-select form-select-sm"
>
<option value="0">-SELECCIONE-</option>
{Tabuladores
? Tabuladores.map((t) => {
return (
<option key={t.id} value={t.id}>
{t.nombre}
</option>
)
})
: null}
</Form.Control>
</Form.Label>
</Col>
</Row>
</Col>
@ -1697,14 +1394,7 @@ export default function TraficoCliente(props:IProps){
<Col sm={12} md={12} lg={6}>
<Row>
<Col sm={4} md={4} lg={4}>
<Form.Label
onClick={() => {
return Depto === 'Corresponsalias'
? showModalBox(1)
: ''
}}
style={{ cursor: 'pointer' }}
>
<Form.Label>
<IconContext.Provider
value={{ color: 'blue', size: '15px' }}
>
@ -1743,22 +1433,6 @@ export default function TraficoCliente(props:IProps){
<Col sm={11} md={11} lg={11}
style={{ visibility: Proceso < 2 ? 'visible' : 'hidden', textAlign: 'end'}}
>
{IDTrafico > 0 && IDCliente === 1896? (
<>
<Form.Control type="file" style={{display:'none'}} onChange={readFile} ref={hiddenFileInputRef}/>
<Button
id="BtnLoadTxt"
variant="success"
size="sm"
style={{ paddingLeft: '20px', paddingRight: '20px' }}
onClick={() => hiddenFileInputRef.current?.click()}
>
Cargar TXT
</Button>
</>
) : (
''
)}
</Col>
<Col sm={1} md={1} lg={1}
style={{ visibility: Proceso < 2 ? 'visible' : 'hidden', textAlign: 'end'}}
@ -1924,6 +1598,14 @@ export default function TraficoCliente(props:IProps){
<fieldset className='border p-2'>
<legend className='w-auto' style={{float:'none', fontSize:'1rem'}}>{EncabezadoPedimento1}</legend>
<Row className='justify-content-between' style={{alignItems:'center'}}>
<Col sm={5} md={5} lg={5}>
<Button variant="success"
onClick={()=>{setLoadComponent(13);setShowModal(true);}}
style={{width:'100%', padding:'6px'}}
>
{LblPedimentos}
</Button>
</Col>
<Col sm={3} md={3} lg={3}>
<Form.Label>
Trafico
@ -1965,14 +1647,11 @@ export default function TraficoCliente(props:IProps){
/>
</Form.Label>
</Col>
</Row>
<Row className='justify-content-between' style={{alignItems:'center'}}>
<Col sm={2} md={2} lg={3}>
<Form.Label>
<span
onClick={() => {
openSOIA()
}}
style={{ cursor: 'pointer' }}
>
<span>
Pedimento
</span>
<CurrencyFormat
@ -1981,10 +1660,6 @@ export default function TraficoCliente(props:IProps){
readOnly= {Depto !== 'Corresponsalias' ? true : false}
format={'### ####'}
mask="_"
onValueChange={(values: any) => {
const { value } = values
setPedimento(value.length === 0 ? 0 : value)
}}
style={{
fontSize: '18px',
backgroundColor: '#FEFDF5',
@ -1996,9 +1671,7 @@ export default function TraficoCliente(props:IProps){
/>
</Form.Label>
</Col>
</Row>
<Row className='justify-content-between' style={{alignItems:'center'}}>
<Col sm={3} md={3} lg={3}>
<Col sm={3} md={3} lg={2}>
<Form.Label>
Clave
<Form.Control
@ -2039,7 +1712,7 @@ export default function TraficoCliente(props:IProps){
/>
</Form.Label>
</Col>
<Col xs={6}>
<Col xs={3}>
<Form.Label style={{width:'100%', visibility: AduanaH === '' ? 'hidden':'visible'}}>
Cargo A
<Form.Control
@ -2081,10 +1754,10 @@ export default function TraficoCliente(props:IProps){
</Col>
<Col sm={12} md={12} lg={6}>
<fieldset className='border p-2' style={{height:'100%'}}>
<legend className='w-auto' style={{float:'none', fontSize:'1rem'}}>{EncabezadoPedimento2}</legend>
<legend className='w-auto' style={{float:'none', fontSize:'1rem'}}>Última Rectificación</legend>
<Row className='justify-content-between' style={{alignItems:'center', paddingTop:'15px'}}>
<Col sm={5} md={4} lg={4} style={{visibility: (IDTrafico>0 && !(AduanaH.length>0 && PatenteH.length>0 && PedimentoH.length>0 && FechaPagoH.length>0)) ? 'visible' : 'hidden' }}>
<Button variant="success" disabled={Depto !== 'Corresponsalias'} onClick={()=>{generaRectificacion()}}>Generar rectificacion</Button>
<Col sm={5} md={4} lg={4}>
<Button variant="success" style={{width:'100%', padding:'6px'}} onClick={() => {showHistorialRectificaciones()}}>{LblRectificaciones}</Button>
</Col>
<Col sm={1} md={1} lg={2}>
<Form.Label>Aduana</Form.Label>
@ -2131,7 +1804,7 @@ export default function TraficoCliente(props:IProps){
</Row>
<Row className='justify-content-between' style={{alignItems:'center', paddingTop:'15px'}}>
<Col sm={2} md={2} lg={2}>
<Form.Label style={{ cursor: 'pointer' }}>
<Form.Label>
Pedimento
</Form.Label>
</Col>
@ -2464,7 +2137,7 @@ export default function TraficoCliente(props:IProps){
</Row>
<Row style={{padding: "5px 0"}}>
<Col sm={12} md={12} lg={4}>
<Row>
<Row className="align-items-center">
<Col sm={5}>
<Form.Label className="labelSize13px">
Fecha de desaduanamiento
@ -2493,14 +2166,14 @@ export default function TraficoCliente(props:IProps){
</Col>
</Row>
</Col>
<Col sm={12} md={12} lg={8}>
<Row>
<Col sm={2}>
<Col sm={12} md={12} lg={4}>
<Row className="align-items-center justify-content-between">
<Col sm={3}>
<Form.Label className="labelSize13px">
Semaf. fiscal
Semaforo fiscal
</Form.Label>
</Col>
<Col sm={4}>
<Col sm={8}>
<Form.Control
as="select"
className="form-select form-select-sm"
@ -2516,12 +2189,30 @@ export default function TraficoCliente(props:IProps){
<option value="1">Verde</option>
</Form.Control>
</Col>
<Col sm={2}>
</Row>
</Col>
<Col xs={12} md={12} lg={4}>
<Row className="align-items-center">
<Col sm={4}>
<Form.Label className="labelSize13px">
Fecha/hora entrega en planta
</Form.Label>
</Col>
<Col sm={8}>
<DatePicker
selected={FHEntregaPlanta}
disabled={Depto !== 'Corresponsalias'}
onChange={(date: any) => setFHEntregaPlanta(date)}
showTimeSelect
timeClassName={handleColor}
dateFormat="MM/dd/yyyy HH:mm:ss"
placeholderText="No definido"
isClearable
/>
</Col>
</Row>
</Col>
</Row>
<Row style={{padding: "5px 0"}}>
<Col sm={12} md={12} lg={6}>
@ -2540,7 +2231,7 @@ export default function TraficoCliente(props:IProps){
canDelete={Depto === 'Corresponsalias'}
FileType={['zip']}
Leyenda={
'Seleccione el archivo, arrastrelo hasta aqui y sueltelo para subirlo al servidor...'
'Aquí se podrá descargar el archivo oficial del tráfico cuando sea cargado'
}
onAppendFM={function (idFile: number): void {
DoesThe2ZipFileExists()
@ -3048,6 +2739,7 @@ export default function TraficoCliente(props:IProps){
{CatTiposDocumento.map((c) => {
return (
<Col key={c.id} xs={4}>
{c.proceso !== 16 ?
<Card
style={{ width: '100%', textAlign: 'center', height:'100%' }}
key={c.id}
@ -3062,7 +2754,8 @@ export default function TraficoCliente(props:IProps){
Leyenda={'Seleccione: ' + c.descripcion}
/>
</Card.Body>
</Card>
</Card> : ''
}
</Col>
)
})}
@ -3376,12 +3069,12 @@ export default function TraficoCliente(props:IProps){
IdFile={IDTrafico}
FileName={''}
canDelete={
Depto === 'Corresponsalias' || Perfil !== 'Corresponsal'
Depto === 'Corresponsalias'
}
FileType={['pdf']}
setBackgroundColor={c.id}
Prefijo={c.descripcion}
Leyenda={`Seleccione el archivo ${c.descripcion}, arrastrelo hasta aqui y sueltelo para subirlo al servidor...`}
Leyenda={`Aquí se podrá descargar el archivo ${c.descripcion} cuando sea cargado`}
onAppendFM={function (
idFile: number
): void {}}
@ -3411,89 +3104,23 @@ export default function TraficoCliente(props:IProps){
</Col>
</Row>
</Tab>
<Tab
eventKey="CuentasComplementarias"
title="Cuentas complementarias"
tabClassName={Perfil === 'Corresponsales' ? 'd-none' : ''}
>
<Row>
<Col xs={12}>
<CuentasComplementarias
IDTrafico={IDTrafico}
UserId={UserId}
/>
</Col>
</Row>
</Tab>
<Tab
eventKey="Rectificaciones"
title="Rectificaciones"
tabClassName={Perfil === 'Corresponsales' ? 'd-none' : ''}
>
{/* <Card>
<Row>
<Col xs={1}>Pedimento</Col>
<Col xs={1}>
<CurrencyFormat
value={PedimentoRectificado}
displayType={Depto === 'Corresponsalias' ? 'input' : 'text'}
format={'### ####'}
mask='_'
onValueChange={(values: any) => {
const { value } = values
setPedimento(value.length === 0 ? 0 : value)
}}
style={
Depto === 'Corresponsalias'
? {
fontSize: '18px',
backgroundColor: '#FEFDF5',
border: '2px solid #837F5D',
width: '100px',
textAlign: 'right',
borderRadius: '10px',
}
: {
fontSize: '16px',
backgroundColor: '#FEFDF5',
border: '2px solid #837F5D',
width: '100px',
textAlign: 'right',
borderRadius: '10px',
}
}
/>
</Col>
<Col xs={1}>Fecha pago</Col>
<Col xs={1}></Col>
<Col xs={1}>Motivo</Col>
<Col xs={7}></Col>
</Row>
</Card> */}
</Tab>
<Tab
eventKey="ComprobantesFacturacion"
title="Comprobantes Facturacion"
tabClassName={Proceso >= 3 ? '' : 'd-none'}
//tabClassName={Proceso >= 3 && Depto === 'Facturacion'? '' : 'd-none'}
>
<Card>
<Card.Body>
<Row>
<Col xs={4}>
<Col xs={6}>
<Form.Label>PDF Cuenta Mexicana</Form.Label>
</Col>
<Col xs={4}>
<Col xs={6}>
<Form.Label>XML Cuenta Mexicana</Form.Label>
</Col>
<Col xs={4}>
<Row>
<Col sm={6}>Total Honorarios A.A</Col>
<Col sm={6}>Total Gastos Terceros</Col>
</Row>
</Col>
</Row>
<Row>
<Col xs={4}>
<Col xs={6}>
<FileManager
IDUser={UserId}
width={'100%'}
@ -3509,7 +3136,7 @@ export default function TraficoCliente(props:IProps){
onAppendFM={function (idFile: number ): void {}}
/>
</Col>
<Col xs={4}>
<Col xs={6}>
<FileManager
IDUser={UserId}
width={'100%'}
@ -3525,68 +3152,17 @@ export default function TraficoCliente(props:IProps){
onAppendFM={function (idFile: number): void {}}
/>
</Col>
<Col xs={4}>
<Row>
<Col sm={6}>
<CurrencyFormat
value={TotalHonorariosAA}
displayType='input'
readOnly={Depto !== 'Facturacion' || Proceso !== 3}
thousandSeparator={true}
onValueChange={(values: any) => {
const { value } = values
setTotalHonorariosAA(value)
}}
style={{
fontSize: '18px',
backgroundColor: '#FEFDF5',
border: '2px solid #837F5D',
width: '100%',
textAlign: 'right',
borderRadius: '10px',
paddingLeft: '20px',
paddingRight: '10px',
}}
/>
</Col>
<Col sm={6}>
<CurrencyFormat
value={TotalGastosTerceros}
thousandSeparator={true}
displayType='input'
readOnly={Depto !== 'Facturacion' || Proceso !== 3}
onValueChange={(values: any) => {
const { value } = values
setTotalGastosTerceros(value)
}}
style={{
fontSize: '18px',
backgroundColor: '#FEFDF5',
border: '2px solid #837F5D',
width: '100%',
textAlign: 'right',
borderRadius: '10px',
paddingLeft: '20px',
paddingRight: '10px',
}}
/>
</Col>
</Row>
</Col>
</Row>
<Row>
<Col xs={4}>
<Form.Label>PDF de Gastos a Terceros</Form.Label>
<Col xs={6}>
<Form.Label>PDF de Notas de Cargos</Form.Label>
</Col>
<Col xs={4}>
<Col xs={6}>
<Form.Label>Archivos Adicionales</Form.Label>
</Col>
<Col xs={4}>
<Form.Label></Form.Label>
</Col>
</Row>
<Row>
<Col xs={4}>
<Col xs={6}>
<FileManager
IDUser={UserId}
width={'100%'}
@ -3604,7 +3180,7 @@ export default function TraficoCliente(props:IProps){
}}
/>
</Col>
<Col xs={4}>
<Col xs={6}>
<FileManager
IDUser={UserId}
width={'100%'}
@ -3623,25 +3199,6 @@ export default function TraficoCliente(props:IProps){
/>
</Col>
</Row>
<Row className='justify-content-end'>
<Col xs={3} style={{display:'flex', justifyContent:'end'}}>
<Button
variant='primary'
onClick={GetClientesZip}
disabled={Proceso < 4}
style={{marginRight:'10px'}}
>
Descargar Zip
</Button>
<Button
variant='primary'
onClick={cerrarTrafico}
disabled={Proceso === 4}
>
Cerrar Cuenta
</Button>
</Col>
</Row>
</Card.Body>
</Card>
</Tab>
@ -3655,7 +3212,7 @@ export default function TraficoCliente(props:IProps){
dialogClassName={
LoadComponent === 1 || LoadComponent === 2 || LoadComponent === 9
? 'modal-90w'
: 'modal-50w'
: LoadComponent === 13 || LoadComponent === 14 ? 'modal-70w' : 'modal-50w'
}
>
<Modal.Body>
@ -3708,6 +3265,7 @@ export default function TraficoCliente(props:IProps){
IDTrafico={IDTrafico}
IDTabulador={IDTabulador}
NombreCliente={NombreCliente}
IDCorresponsal={null}
closeTabulador={function (arg: boolean): void {
setShowModal(arg)
}}
@ -3736,6 +3294,26 @@ export default function TraficoCliente(props:IProps){
/>
</div>
) : null}
{LoadComponent === 13 ? (
<div style={{ height: '600px', overflow: 'auto' }}>
<PedimentosConsolidados IdTrafico={props.IDTrafico} Aduana={Aduana!} Patente={Patente!} ClavesPedimento={ClavesPedimentos} Depto={Depto}/>
</div>
) : null}
{LoadComponent === 14? (
<div style={{ height: '550px', overflow: 'hidden' }}>
<NuevaRectificacion
IdTrafico={props.IDTrafico}
Aduana={Aduana!}
Patente={Patente!}
ClavesPedimento={ClavesPedimentos}
Depto={Depto}
UserId={UserId}
Pedimentos={mCPedimentosConsolidados}
onAppendRectificacion={function (data: DTORectificacionHistorico): void {
throw new Error("Function not implemented.")
} }/>
</div>
) : null}
</Modal.Body>
</Modal>
<MsgInformativo
@ -3747,14 +3325,6 @@ export default function TraficoCliente(props:IProps){
setShowMsg(false)
}}
/>
<Modal show={showNextStepModal} backdrop='static' keyboard={false} size='sm' centered>
<Modal.Header style={{backgroundColor: '#0d6efd', color: '#ffffff'}}>{nextStepModalHeader}</Modal.Header>
<Modal.Body>{nextStepModalBody}</Modal.Body>
<Modal.Footer>
<Button variant='danger' onClick={() => {setShowNexStepModal(false); props.onClose(true)}}>Cancelar</Button>
<Button variant='primary' onClick={() => {saveCurrentStep(); setShowNexStepModal(false); props.onClose(true)}}>Continuar</Button>
</Modal.Footer>
</Modal>
</div>
)
}

@ -105,7 +105,6 @@ export const Anticipos: FC<IProps> = (props) => {
style={{ cursor: 'pointer' }}
/>
</IconContext.Provider>&nbsp;&nbsp;&nbsp;
{ params.data.autoriza === 0 ?
<IconContext.Provider value={{ color: 'red', size: '20px' }}>
<BsTrash
onClick={() => {
@ -116,8 +115,7 @@ export const Anticipos: FC<IProps> = (props) => {
}}
style={{ cursor: 'pointer' }}
/>
</IconContext.Provider> : ""
}
</IconContext.Provider>
</div> :
<div>
<IconContext.Provider value={{ color: 'blue', size: '18px' }}>

@ -87,6 +87,7 @@ export const Contenedores: FC<IProps> = (props) => {
idTrafico: props.IDTrafico,
fSemaforo: '',
semaforo: 0,
idTipoContenedor:0
}
CContDataService.Append(data)
.then((response) => {

@ -37,6 +37,7 @@ export const ControlledInput: FC<IProps> = (props) => {
idTrafico: props.IDTrafico,
fSemaforo: '',
semaforo: 0,
idTipoContenedor:0
}
CContDataService.Append(data)
.then((response) => {

@ -0,0 +1,118 @@
import { Alert, Col, FormControl, Row, Table } from "react-bootstrap"
import { useDispatch, useSelector } from "react-redux"
import { RootState } from "../../../store/store"
import { useEffect, useState } from "react"
import FormCheckInput from "react-bootstrap/esm/FormCheckInput"
import CorresponsalesFacturasServices from "../../../Services/Corresponsalias/Corresponsales.Facturas.Services"
import ICorresponsalFacturas from "../../../Interfaces/Corresponsales/ICorresponsalFacturas"
import { updateCorresponsalesFacturas } from "../../../store/features/Corresponsales/CorresponsalesFacturasSlice"
import { MsgInformativo } from "../../Utils/Toast/msgInformativo"
interface IProps{
IDTrafico: number
IdContenedor: number
Contenedor: string
}
export const FacturasContenedor: React.FC<IProps> = (props) => {
const mCFacturas = useSelector(
(state: RootState) => state.CFData.CorresponsalesFacturas
)
const dispatch = useDispatch()
const [header, setHeader] = useState('')
const [msg, setMsg] = useState('')
const [show, setShowMsg] = useState(false)
const [msgColor, setMsgColor] = useState('primary')
const AppendContenedor = (e: any) => {
var data = mCFacturas.filter(x => x.id === +e.target.value)[0]
var factura: ICorresponsalFacturas = {
id: data.id,
factura: data.factura,
idTrafico: data.idTrafico,
valorFacturaDls: data.valorFacturaDls,
proveedor: data.proveedor,
pedido: data.pedido,
code: data.code,
folioGEMCO: data.folioGEMCO,
corresponsal: data.corresponsal,
activo: data.activo,
fechaFactura: data.fechaFactura,
uuid: data.uuid,
cove: data.cove,
entrega: data.entrega,
transporte: data.transporte,
idContenedor: e.currentTarget.checked ? props.IdContenedor : 0
}
CorresponsalesFacturasServices.Append(factura)
.then((resp:any) => {
dispatch(updateCorresponsalesFacturas(factura));
setHeader('Informativo')
setMsg('Factura asignada correctamente')
setShowMsg(true)
return
})
.catch(() => {
setHeader('Error')
setMsg('Ocurrio un error: ' + e)
setShowMsg(true)
return
})
}
return (
<>
<Alert variant='primary' style={{height:'100%', overflowY: 'hidden'}}>
<Row>
<Col xs={12}>
<b>Agregar facturas al contenedor {props.Contenedor}</b>
</Col>
</Row>
<div className="table-wrapper" style={{width:'100%', maxHeight:'450px'}}>
<Table
className="table table-earnings table-earnings__challenge"
striped
bordered
hover
>
<thead>
<tr><th></th><th>Factura</th></tr>
</thead>
<tbody>
{mCFacturas
? mCFacturas.map((item, index) => {
return item.idTrafico === props.IDTrafico ? (
<tr>
<td>
<FormCheckInput
onChange={(event:any) => {
AppendContenedor(event)
}}
value={item.id}
disabled = {item.idContenedor !== 0 && item.idContenedor !== props.IdContenedor}
defaultChecked = {item.idContenedor === props.IdContenedor}
/>
</td>
<td>
{item.factura}
</td>
</tr>
) : (
''
)
})
: ''}
</tbody>
</Table>
</div>
</Alert>
<MsgInformativo
show={show}
msg={msg}
header={header}
msgColor={msgColor}
closeToast={() => {
setShowMsg(false)
}}
/>
</>
)
}

@ -4,7 +4,7 @@ import { RootState } from '../../../store/store'
import CContDataService from '../../../Services/Corresponsalias/Corresponsales.Contenedores.Services'
import ICorresponsalContenedores from '../../../Interfaces/Corresponsales/ICorresponsalContenedores'
import { IconContext } from 'react-icons'
import { BsFillCalendarCheckFill, BsFillCalendarDayFill, BsFillRecordFill, BsFillXCircleFill } from 'react-icons/bs'
import { BsFillCalendarCheckFill, BsFillCalendarDayFill, BsFillRecordFill, BsFillXCircleFill, BsLink45Deg, BsPencil } from 'react-icons/bs'
import {
deleteCorresponsalesContenedores,
updateCorresponsalesContenedores,
@ -15,6 +15,8 @@ import 'react-datepicker/dist/react-datepicker.css'
//Images
import caret from '../../../images/caret.png';
import clean from '../../../images/Clean.png';
import { FaFile, FaPencilAlt } from 'react-icons/fa'
import { FacturasContenedor } from './FacturasContenedor'
interface IProps {
IDTrafico: number
@ -29,6 +31,7 @@ export const SelectContainer: FC<IProps> = (props) => {
const dispatch = useDispatch()
const [toggleSelect, setToggleSelect] = useState(false)
const mCContenedores = useSelector((state: RootState) => state.CCData.CorresponsalesContenedores)
const mCTiposContenedores = useSelector((state: RootState) => state.CTiposContenedores.CatTiposContenedores)
const [Contenedor, setContenedor] = useState('')
const [IDContenedor, setIDContenedor] = useState(0)
const [Placeholder, setPlaceholder] = useState('')
@ -36,6 +39,8 @@ export const SelectContainer: FC<IProps> = (props) => {
const [DialogAddDate, setDialogAddDate] = useState(false)
const [FSemaforo, setFSemaforo] = useState<Date | null>()
const [Semaforo, setSemaforo] = useState(0)
const [ShowFacturasDialog, setShowFacturasDialog] = useState(false)
const [IdTipoContenedor, setIdTipoContenedor] = useState(0)
useEffect(() => {
setPlaceholder('(' + mCContenedores.filter((item) => item.id > 0).length + ') Contenedores')
@ -59,7 +64,8 @@ export const SelectContainer: FC<IProps> = (props) => {
contenedor: Contenedor,
idTrafico: props.IDTrafico,
fSemaforo: FSemaforo ? adjustTimeZone(FSemaforo.toISOString()) : '',
semaforo: Semaforo,
semaforo: 2,
idTipoContenedor: 0
}
CContDataService.Append(data)
.then((response) => {
@ -90,6 +96,7 @@ export const SelectContainer: FC<IProps> = (props) => {
idTrafico: props.IDTrafico,
fSemaforo: FSemaforo ? adjustTimeZone(FSemaforo.toISOString()) : '',
semaforo: Semaforo,
idTipoContenedor: IdTipoContenedor
}
// console.log(JSON.stringify(data))
CContDataService.Append(data)
@ -208,27 +215,25 @@ export const SelectContainer: FC<IProps> = (props) => {
? mCContenedores
.map((item, index) => {
return item.id > 0 ? (
<li key={item.id} onClick={() => loadInfo(item)}>
<span
onClick={() => {
setDialogTabs(true)
}}
>
<li key={item.id} style={{marginBottom:'3px'}} onClick={() => loadInfo(item)}>
<span style={{display: props.Editable && toggleSelect ? 'inline-block' : 'none',}}>
<IconContext.Provider value={{ color: 'red', size: '15px' }}>
<BsFillXCircleFill />
<BsFillXCircleFill className='pointer' onClick={() => {setDialogTabs(true)}}/>
</IconContext.Provider>
</span>
<span style={{display: props.Editable && toggleSelect ? 'inline-block' : 'none', paddingLeft:'3px'}}>
<IconContext.Provider value={{ color: 'green', size: '15px' }}>
<BsLink45Deg className='pointer' onClick={() => setShowFacturasDialog(true)}/>
</IconContext.Provider>
</span>
{/* <span style={{paddingLeft:'3px'}}>
<IconContext.Provider value={{ color: 'blue', size: '15px' }}>
<BsPencil className='pointer' onClick={() => loadInfo(item)} />
</IconContext.Provider>
</span> */}
<span style={{ paddingLeft: '10px' }}>{item.contenedor}</span>
<span
onClick={() => {
setFSemaforo(StrtoDate(item.fSemaforo))
setSemaforo(item.semaforo)
setDialogAddDate(true)
setToggleSelect(!toggleSelect)
}}
>
&nbsp;| {item.fSemaforo} |{' '}
{item.fSemaforo ? (
<span>
&nbsp;| {item.fSemaforo} |{
item.semaforo === 1 ? (
<IconContext.Provider value={{ color: 'red', size: '20px' }}>
<BsFillRecordFill />
@ -238,17 +243,23 @@ export const SelectContainer: FC<IProps> = (props) => {
<BsFillRecordFill />
</IconContext.Provider>
) : ('')
) : (
''
)}
<span
}
<span>
<IconContext.Provider value={{ color: 'green', size: '20px' }}>
<BsFillCalendarCheckFill
className='pointer'
style={{
paddingLeft: '20px',
paddingLeft: '5px',
visibility: props.Editable && toggleSelect ? 'visible' : 'hidden',
}}
>
<IconContext.Provider value={{ color: 'green', size: '15px' }}>
<BsFillCalendarCheckFill />
onClick={() => {
setFSemaforo(StrtoDate(item.fSemaforo))
setSemaforo(item.semaforo)
setIdTipoContenedor(item.idTipoContenedor)
setDialogAddDate(true)
setToggleSelect(!toggleSelect)
}}
/>
</IconContext.Provider>
</span>
</span>
@ -319,6 +330,24 @@ export const SelectContainer: FC<IProps> = (props) => {
<b>¿Esta seguro de agregar fecha al contenedor: {Contenedor}?</b>
</Col>
</Row>
<Row className='justify-content-end'>
<Col xs={5}>
Tipo de Contenedor
</Col>
<Col xs={7}>
<Form.Control
as='select'
onChange={(e) => {setIdTipoContenedor(+e.target.value)}}
value={IdTipoContenedor}
className='form-select form-select-sm'
>
<option value={0}>-SELECCIONE-</option>
{mCTiposContenedores ? mCTiposContenedores.map((t) => {
return <option value={t.id}>{t.descripcion}</option>
}) : null}
</Form.Control>
</Col>
</Row>
<Row style={{ paddingTop: '10px' }}>
<Col xs={4}></Col>
<Col xs={2}>Fecha</Col>
@ -367,6 +396,8 @@ export const SelectContainer: FC<IProps> = (props) => {
<Button
variant='secondary'
onClick={() => {
setIDContenedor(0)
setContenedor('')
setDialogAddDate(false)
}}
size='sm'
@ -377,6 +408,36 @@ export const SelectContainer: FC<IProps> = (props) => {
</Row>
</Modal.Body>
</Modal>
<Modal
show={ShowFacturasDialog}
onHide={() => setShowFacturasDialog(false)}
centered
dialogClassName='modal-20w'
>
<Modal.Body
style={{
height: 'calc(70vh)',
}}
>
<div style={{height:'100%'}}>
<FacturasContenedor IdContenedor={IDContenedor} Contenedor={Contenedor} IDTrafico={props.IDTrafico}/>
</div>
</Modal.Body>
<Modal.Footer>
<Row>
<Button
variant='secondary'
onClick={() => {
setShowFacturasDialog(false)
}}
size='sm'
>
Cerrar
</Button>
</Row>
</Modal.Footer>
</Modal>
</div>
)
}

@ -298,7 +298,13 @@ export const CuentasComplementarias: FC<IProps> = (props) => {
MFileManagerDataService.getFileContentById(id, proceso)
.then((response: any) => {
if (response.status === 200) {
if (archivo.toLowerCase().endsWith('.pdf')) {
const url = window.URL.createObjectURL(new Blob([response.data]))
const link = document.createElement('a')
link.href = url
link.setAttribute('download', archivo)
document.body.appendChild(link)
link.click()
/* if (archivo.toLowerCase().endsWith('.pdf')) {
console.log(response.data)
const blob = new Blob([response.data], { type: 'application/pdf' })
const url = window.URL.createObjectURL(blob)
@ -308,7 +314,14 @@ export const CuentasComplementarias: FC<IProps> = (props) => {
const blob = new Blob([response.data], { type: 'application/xml' })
const url = window.URL.createObjectURL(blob)
window.open(url)
}
const url = window.URL.createObjectURL(new Blob([response.data]))
const link = document.createElement('a')
link.href = url
link.setAttribute('download', archivo)
document.body.appendChild(link)
link.click()
} */
} else {
setHeader('Error')
setMsg('No existe ningun archivo asignado')

@ -1,8 +1,7 @@
import { Button, Card, Col, Form, FormControl, FormLabel, Row } from "react-bootstrap"
import { Button, Card, Col, Form, FormControl, FormLabel, Modal, Row, Table } from "react-bootstrap"
import CurrencyFormat from "react-currency-format"
import { ICatClavesPedimentos } from "../../../Interfaces/Catalogos/ICatClavesPedimentos"
import { useEffect, useState } from "react"
import CorresponsalesTraficoServices from "../../../Services/Corresponsalias/Corresponsales.Trafico.Services"
import { AgGridReact } from "ag-grid-react"
import { DTOPedimentosConsolidados } from "../../../DTO/Corresponsales/DTOPedimentosConsolidados"
import PedimentosConsolidadosService from "../../../Services/Corresponsalias/Corresponsales.Trafico.Pedimento.Consolidados.Service"
@ -14,10 +13,16 @@ import { RootState } from "../../../store/store"
import { addPedimento, deletePedimento, updatePedimento } from "../../../store/features/Corresponsales/CorresponsalesPedimentosConsolidadosSlice"
import { MsgInformativo } from "../../Utils/Toast/msgInformativo"
import { FaEraser } from "react-icons/fa"
import DTORectificacionHistorico from "../../../DTO/Corresponsales/DTORectificacionHistorico"
import CTrafDataService from "../../../Services/Corresponsalias/Corresponsales.Trafico.Services"
import { addRectificacion } from "../../../store/features/Corresponsales/CorresponsalesPedimentosRectificacionesSlice"
import { HistorialRectificaciones } from "../Rectificaciones/HistorialRectificaciones"
import ICorresponsalRectificacionHistorico from "../../../Interfaces/Corresponsales/ICorresponsalRectificacionHistorico"
import '../../../css/generic01.css'
interface IProps {
IdTrafico: number
Aduana: number
Aduana: string
Patente: number
ClavesPedimento: ICatClavesPedimentos[]
Depto: string
@ -30,67 +35,26 @@ export const PedimentosConsolidados:React.FC<IProps> = (props) => {
const [msg, setMsg] = useState('')
const msgColor = 'primary'
const [showModal, setShowModal] = useState(false)
const [LoadComponent, setLoadComponent] = useState(0)
const [Id, setId] = useState(0)
const [Aduana, setAduana] = useState(props.Aduana)
const [Patente, setPatente] = useState(props.Patente)
const [Pedimento, setPedimento] = useState(0)
const [ClavePedimento, setClavePedimento] = useState('');
const [FechaPago, setFechaPago] = useState('')
const [IdPedimentoH, setIdPedimentoH] = useState(0)
const [AduanaH, setAduanaH] = useState(0)
const [PatenteH, setPatenteH] = useState(0)
const [PedimentoH, setPedimentoH] = useState(0)
const [ClavePedimentoH, setClavePedimentoH] = useState('')
const [FechaPagoH, setFechaPagoH] = useState('')
const [isRectificacion, setIsRectificacion] = useState(false)
const mCPedimentosConsolidados = useSelector((state:RootState) => state.CPedimentosConsolidados.PedimentosConsolidados)
const [columnDefs] = useState([
props.Depto === 'Corresponsalias' ?
{
field: 'id',
headerName: 'Acciones',
width: 120,
sortable: true,
filter: true,
cellRenderer: (params: any) => {
return (
<div>
<IconContext.Provider value={{ color: 'blue', size: '18px' }}>
<BsPencilFill
onClick={() => {
loadRow(params.data)
}}
style={{ cursor: 'pointer' }}
/>
</IconContext.Provider>
&nbsp;&nbsp;&nbsp;
<IconContext.Provider value={{ color: 'red', size: '20px' }}>
<BsTrash
onClick={() => {
Delete(params.data.id)
}}
style={{ cursor: 'pointer' }}
/>
</IconContext.Provider>
</div>
)
}
} : {
field: 'id',
headerName: 'Acciones',
width: 110,
sortable: true,
filter: true,
},
{ field: 'patente', width: 110, sortable: true, filter: true },
{ field: 'aduana', width: 110, sortable: true, filter: true },
{ field: 'pedimento', width: 120, sortable: true, filter: true },
{ field: 'clave', width: 100, sortable: true, filter: true },
{
field: 'fechaPago',
sortable: true,
filter: true,
flex: 1, //Se encarga de llenar el espacio sobrante de las columnas
cellRenderer: (params: any) => {
if (params.value) return params.value.substring(0, 10)
else return ''
},
},
])
const [Data, setData] = useState<DTOPedimentosConsolidados[]>()
const mcRectificaciones = useSelector((state:RootState) => state.CRectificaciones.RectificacionesPedimentos)
const [Rectificaciones, setRectificaciones] = useState<ICorresponsalRectificacionHistorico[]>([]);
const cleanForm = () => {
setId(0)
@ -119,7 +83,7 @@ export const PedimentosConsolidados:React.FC<IProps> = (props) => {
}
const Append = () => {
if(Aduana !== 0 &&
if(Aduana !== '' && Aduana !== '0' && Aduana !== ' ' && Aduana !== undefined && Aduana !== null &&
Patente !== 0 &&
Pedimento !== 0 &&
FechaPago !== '' &&
@ -138,12 +102,13 @@ export const PedimentosConsolidados:React.FC<IProps> = (props) => {
setHeader('Informativo')
setMsg('Datos actualizados correctamente')
setShowMsg(true)
return
}
}else{
dispatch(addPedimento(resp.data))
setHeader('Informativo')
setMsg('Pedimento guardado correctamente')
setShowMsg(true)
}
cleanForm()
return
}).catch((e) => {
setHeader('Error')
@ -181,6 +146,7 @@ export const PedimentosConsolidados:React.FC<IProps> = (props) => {
<Card.Body>
{props.Depto === 'Corresponsalias' ? <>
<Row className="justify-content-end align-items-center">
<Col xs={1}></Col>
<Col
xs={1}
style={{
@ -199,7 +165,7 @@ export const PedimentosConsolidados:React.FC<IProps> = (props) => {
<Col xs={1}>
<FormLabel>
Aduana
<FormControl type='text' size='sm' disabled value={Aduana} onChange={(e) => setAduana(+e.target.value)}></FormControl>
<FormControl type='text' size='sm' disabled value={Aduana} onChange={(e) => setAduana(e.target.value)}></FormControl>
</FormLabel>
</Col>
<Col xs={1}>
@ -219,12 +185,11 @@ export const PedimentosConsolidados:React.FC<IProps> = (props) => {
onValueChange={(values: any) => {
const { value } = values
if(value.length === 7 ){
CorresponsalesTraficoServices.ValidaTraficoDuplicado(Aduana, Patente, value, props.IdTrafico).then( response => {
CTrafDataService.ValidaTraficoDuplicado(Aduana, Patente, value, props.IdTrafico).then( response => {
if(response.data !== ""){
/*setHeader('Informativo')
setHeader('Informativo')
setMsg(`Pedimento Duplicado.\n\rLa referencia ${response.data} ya cuenta con los mismos datos de aduana, patente y pedimento`)
setShowMsg(true)*/
alert('Ya existe un pedimento con los mismos datos en esta referencia')
setShowMsg(true)
return
}
setPedimento(value.length === 0 ? 0 : value)
@ -284,15 +249,52 @@ export const PedimentosConsolidados:React.FC<IProps> = (props) => {
</Col>
</Row>
<hr /></> : ("") }
<div className='ag-theme-alpine' style={{ height: 400, width: '100%'}}>
<AgGridReact
rowData={mCPedimentosConsolidados}
columnDefs={columnDefs}
pagination={true}
paginationAutoPageSize={true}
rowSelection={'multiple'}
rowMultiSelectWithClick={true}
></AgGridReact>
<div className="table-wrapper" style={{width:'100%', maxHeight:'100%'}}>
<Table
hover
size='sm'
>
<thead>
<tr><th>#</th>{props.Depto === 'Corresponsalias' ? <th>Acciones</th> : ''}<th>Aduana</th><th>Patente</th><th>Pedimento</th><th>Clave</th><th>Fecha de Pago</th></tr>
</thead>
<tbody>
{mCPedimentosConsolidados
? mCPedimentosConsolidados.map((item, index) => {
return item.id > 0 ?
<tr>
<td>{index}</td>
{props.Depto === 'Corresponsalias' ?
<td><div>
<IconContext.Provider value={{ color: 'blue', size: '18px' }}>
<BsPencilFill
onClick={() => {
loadRow(item)
}}
style={{ cursor: 'pointer' }}
/>
</IconContext.Provider>
&nbsp;&nbsp;&nbsp;
<IconContext.Provider value={{ color: 'red', size: '20px' }}>
<BsTrash
onClick={() => {
Delete(item.id)
}}
style={{ cursor: 'pointer' }}
/>
</IconContext.Provider>
</div></td> : ''
}
<td>{item.aduana}</td>
<td>{item.patente}</td>
<td><div style={{display:'flex', alignItems:'start'}}>{item.pedimento} {item.id === 0 ? <span style={{fontSize:'8px'}}>{'⭐'}</span> : ''}</div></td>
<td>{item.clave}</td>
<td>{item.fechaPago ? item.fechaPago.substring(0,10) : ''}</td>
</tr>
: ''
})
: ''}
</tbody>
</Table>
</div>
</Card.Body>
</Card>
@ -304,6 +306,7 @@ export const PedimentosConsolidados:React.FC<IProps> = (props) => {
closeToast={() => {
setShowMsg(false)
}}
/></>
/>
</>
)
}

@ -30,6 +30,12 @@ export const ControlledInput: FC<IProps> = (props) => {
const [show, setShowMsg] = useState(false);
const [msg, setMsg] = useState('');
const [ClasificacionProveedor, setClasificacionProveedor] = useState(2);
const [Uuid, setUuid] = useState(props.record.uuid);
const [FechaFactura, setFechaFactura] = useState(props.record.fechaFactura);
const [Cove, setCove] = useState(props.record.cove);
const [Entrega, setEntrega] = useState(props.record.entrega);
const [Transporte, setTransporte] = useState(props.record.transporte);
const [IdContenedor, setIdContenedor] = useState(props.record.idContenedor);
const onChangeFac = (event: any) => {
setValue(event.target.value);
@ -63,6 +69,12 @@ export const ControlledInput: FC<IProps> = (props) => {
pedido: Pedido,
code: 0,
folioGEMCO: '',
uuid: Uuid,
fechaFactura: FechaFactura,
cove: Cove,
entrega: Entrega,
transporte: Transporte,
idContenedor: IdContenedor,
};
CorFacDataService.Append(data)
.then((response) => {
@ -134,6 +146,47 @@ export const ControlledInput: FC<IProps> = (props) => {
})
: null}
</Form.Control>
<input
value={Uuid}
onChange={(e) => setUuid(e.target.value)}
disabled={false}
onKeyDown={(e) => handleKeyDown(e, 2)}
style={{ width: '20%', textAlign: 'right' }}
/>
&nbsp; &nbsp; &nbsp;
<Form.Control
type='date'
id='FechaFactura'
size='sm'
value={FechaFactura}
placeholder='Fecha de la Factura'
onChange={(e) => setFechaFactura(e.target.value)}
/>
&nbsp; &nbsp; &nbsp;
<input
value={Cove}
onChange={(e) => setCove(e.target.value)}
disabled={false}
onKeyDown={(e) => handleKeyDown(e, 2)}
style={{ width: '20%', textAlign: 'right' }}
/>
&nbsp; &nbsp; &nbsp;
<input
value={Entrega}
onChange={(e) => setEntrega(e.target.value)}
disabled={false}
onKeyDown={(e) => handleKeyDown(e, 2)}
style={{ width: '20%', textAlign: 'right' }}
/>
&nbsp; &nbsp; &nbsp;
<input
value={Transporte}
onChange={(e) => setTransporte(e.target.value)}
disabled={false}
onKeyDown={(e) => handleKeyDown(e, 2)}
style={{ width: '20%', textAlign: 'right' }}
/>
&nbsp; &nbsp; &nbsp;
<MsgInformativo
show={show}
msg={msg}

@ -47,7 +47,11 @@ export const ProveedorFactura: FC<IProps> = (props) => {
const MsgTime = 2000;
const msgColor = 'primary';
const ClasificacionProveedor = 2;
const [Uuid, setUuid] = useState<string>('');
const [FechaFactura, setFechaFactura] = useState<string>('');
const [Cove, setCove] = useState<string>('');
const [Entrega, setEntrega] = useState<string>('');
const [Transporte, setTransporte] = useState<string>('');
const TblHeader: React.FC = () => (
<table>
<tr
@ -69,26 +73,98 @@ export const ProveedorFactura: FC<IProps> = (props) => {
<td width='560px' style={{ textAlign: 'center' }}>
Proveedor
</td>
<td width='120px' style={{ textAlign: 'center' }}>
UUID
</td>
<td width='120px' style={{ textAlign: 'center' }}>
Fecha Factura
</td>
<td width='120px' style={{ textAlign: 'center' }}>
COVE
</td>
<td width='120px' style={{ textAlign: 'center' }}>
Entrega
</td>
<td width='120px' style={{ textAlign: 'center' }}>
Transporte
</td>
</tr>
</table>
);
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: <TblHeader />,
width: '75%',
cell: (row: ICorresponsalFacturas) => {
return <ControlledInput record={row} disabled={false} mode={2} />;
},
},
}, */
{
name: 'Elimina',
width: '80px',
cell: (row: ICorresponsalFacturas) => (
<div
style={{
@ -113,6 +189,7 @@ export const ProveedorFactura: FC<IProps> = (props) => {
useEffect(() => {
FacDataService.getAll(props.IDTrafico)
.then((response) => {
console.log(response.data);
dispatch(populateCorresponsalesFacturas(response.data));
})
.catch((e: Error) => {
@ -128,6 +205,12 @@ export const ProveedorFactura: FC<IProps> = (props) => {
setIDFactura(0);
setIDProveedor(0);
setValorFacturaDls(0);
setPedido('')
setUuid('')
setFechaFactura('')
setCove('')
setEntrega('')
setTransporte('')
};
const saveForm = () => {
@ -162,6 +245,12 @@ export const ProveedorFactura: FC<IProps> = (props) => {
pedido: Pedido,
code: 0,
folioGEMCO: '',
uuid: Uuid,
fechaFactura: FechaFactura,
cove: Cove,
entrega: Entrega,
transporte: Transporte,
idContenedor: 0,
};
FacDataService.Append(data)
.then((response) => {
@ -267,7 +356,7 @@ export const ProveedorFactura: FC<IProps> = (props) => {
fontSize: '18px',
backgroundColor: '#F5FFED',
border: '2px solid #25D05B',
width: '100px',
width: '100%',
textAlign: 'right',
borderRadius: '10px',
}}
@ -337,6 +426,58 @@ export const ProveedorFactura: FC<IProps> = (props) => {
</Col>
<Col>&nbsp;</Col>
</Row>
<Row className={props.canDelete ? 'visible justify-content-end' : 'invisible heightZero'} >
<Col xs={3}>
<Form.Control
type='text'
id='UUID'
size='sm'
value={Uuid}
placeholder='UUID'
onChange={(e) => setUuid(e.target.value)}
/>
</Col>
<Col xs={2}>
<Form.Control
type='date'
id='FechaFactura'
size='sm'
value={FechaFactura}
placeholder='Fecha de la Factura'
onChange={(e) => setFechaFactura(e.target.value)}
/>
</Col>
<Col xs={2}>
<Form.Control
type='text'
id='Cove'
size='sm'
value={Cove}
placeholder='COVE'
onChange={(e) => setCove(e.target.value)}
/>
</Col>
<Col xs={2}>
<Form.Control
type='text'
id='Entrega'
size='sm'
value={Entrega}
placeholder='Entrega'
onChange={(e) => setEntrega(e.target.value)}
/>
</Col>
<Col xs={2}>
<Form.Control
type='text'
id='Transporte'
size='sm'
value={Transporte}
placeholder='Transporte'
onChange={(e) => setTransporte(e.target.value)}
/>
</Col>
</Row>
</Card.Subtitle>
<DataTable
/* noHeader */

@ -0,0 +1,85 @@
import { useEffect, useState } from "react"
import { Alert, Card, Col, Row, Table } from "react-bootstrap"
import { useSelector } from "react-redux"
import { RootState } from "../../../store/store"
import { AgGridReact } from "ag-grid-react"
import ICorresponsalRectificacionHistorico from "../../../Interfaces/Corresponsales/ICorresponsalRectificacionHistorico"
interface IProps{
//pedimento: number
IdPedimentoConsolidado: string
}
export const HistorialRectificaciones: React.FC<IProps> = (props) => {
const [columnDefs] = useState([
{ field: 'patente', width: 110, sortable: true, filter: true },
{ field: 'aduana', width: 110, sortable: true, filter: true },
{ field: 'pedimento', width: 120, sortable: true, filter: true },
{ field: 'clave', width: 100, sortable: true, filter: true },
{
field: 'fechaPago',
sortable: true,
filter: true,
cellRenderer: (params: any) => {
if (params.value) return params.value.substring(0, 10)
else return ''
},
},
{
field: 'fhCreacion',
sortable: true,
filter: true,
cellRenderer: (params: any) => {
if (params.value) return params.value
else return ''
},
flex:1
},
])
const mcRectificaciones = useSelector((state:RootState) => state.CRectificaciones.RectificacionesPedimentos)
const [Rectificaciones, setRectificaciones] = useState<ICorresponsalRectificacionHistorico[]>([]);
useEffect(()=>{
if(props.IdPedimentoConsolidado !== '#')
setRectificaciones(mcRectificaciones.filter(x => x.idPedimentoConsolidado === + props.IdPedimentoConsolidado))
else
setRectificaciones(mcRectificaciones)
},[mcRectificaciones, props.IdPedimentoConsolidado])
return(
<div>
<Row>
<Col xs={12}>
<b>Historial de Pedimentos Rectificados</b>
</Col>
</Row>
<br/>
<div className="table-wrapper" style={{width:'100%', maxHeight:'100%'}}>
<Table
className="table table-earnings table-earnings__challenge"
hover
size="sm"
>
<thead>
<tr><th>#</th><th>Aduana</th><th>Patente</th><th>Pedimento</th><th>Clave</th><th>Fecha de Pago</th></tr>
</thead>
<tbody>
{Rectificaciones
? Rectificaciones.map((item, index) => {
return(
<tr>
<td>{index + 1}</td>
<td>{item.aduana}</td>
<td>{item.patente}</td>
<td>{item.pedimento}</td>
<td>{item.clave}</td>
<td>{item.fechaPago ? item.fechaPago.substring(0,10) : ''}</td>
</tr>
)
})
: ''}
</tbody>
</Table>
</div>
</div>
)
}

@ -0,0 +1,382 @@
import { useState } from "react";
import { Button, Card, Col, Form, FormControl, FormLabel, Row } from "react-bootstrap"
import CurrencyFormat from "react-currency-format";
import { IconContext } from "react-icons";
import { FaEraser } from "react-icons/fa";
import CTrafDataService from "../../../Services/Corresponsalias/Corresponsales.Trafico.Services"
import { useDispatch, useSelector } from "react-redux";
import { ICatClavesPedimentos } from "../../../Interfaces/Catalogos/ICatClavesPedimentos";
import { DTOPedimentosConsolidados } from "../../../DTO/Corresponsales/DTOPedimentosConsolidados";
import DTORectificacionHistorico from "../../../DTO/Corresponsales/DTORectificacionHistorico";
import { updatePedimento } from "../../../store/features/Corresponsales/CorresponsalesPedimentosConsolidadosSlice";
import { addRectificacion } from "../../../store/features/Corresponsales/CorresponsalesPedimentosRectificacionesSlice";
import ICorresponsalRectificacionHistorico from "../../../Interfaces/Corresponsales/ICorresponsalRectificacionHistorico";
import { RootState } from "../../../store/store";
import { HistorialRectificaciones } from "./HistorialRectificaciones";
import { MsgInformativo } from "../../Utils/Toast/msgInformativo";
interface IProps {
IdTrafico: number
Aduana: string
Patente: number
ClavesPedimento: ICatClavesPedimentos[]
Pedimentos: DTOPedimentosConsolidados[]
Depto: string
UserId: number
onAppendRectificacion: (data: DTORectificacionHistorico) => void
}
export const NuevaRectificacion:React.FC<IProps> = (props) => {
const dispatch = useDispatch()
const [header, setHeader] = useState('')
const [show, setShowMsg] = useState(false)
const [msg, setMsg] = useState('')
const msgColor = 'primary'
const [showHistorial, setShowHistorial] = useState(false)
const [Id, setId] = useState(0)
const [Aduana, setAduana] = useState(props.Aduana)
const [Patente, setPatente] = useState(props.Patente)
const [Pedimento, setPedimento] = useState(0)
const [ClavePedimento, setClavePedimento] = useState('');
const [FechaPago, setFechaPago] = useState('')
const [IdPedimentoH, setIdPedimentoH] = useState(0)
const [AduanaH, setAduanaH] = useState(props.Aduana)
const [PatenteH, setPatenteH] = useState(props.Patente)
const [PedimentoH, setPedimentoH] = useState(0)
const [ClavePedimentoH, setClavePedimentoH] = useState('')
const [FechaPagoH, setFechaPagoH] = useState('')
const [IdPedimentoConsolidadoSelected, setIdPedimentoConsolidadoSelected] = useState("#")
function setDate(fecha: string | undefined): string {
if (!fecha) return ''
else {
var dd = fecha?.substring(8, 10)
var mm = fecha?.substring(5, 7)
var yyyy = fecha?.substring(0, 4)
return yyyy + '-' + mm + '-' + dd
}
}
const generaRectificacion = () => {
if (Aduana && Patente && Pedimento && ClavePedimento.length>0 && FechaPago) {
const data : DTORectificacionHistorico = {
IdTrafico: props.IdTrafico,
IdUsuario: props.UserId,
IdPedimento: IdPedimentoH,
Aduana: Aduana,//Aduana de la rectificacion
Patente: Patente,//Patente de la rectificacion
Pedimento: Pedimento,//Pedimento de la rectificacion
Clave: ClavePedimento,//Clave del pedimento de la rectificacion
FechaPago: FechaPago,//Fecha de pago del pedimento de la rectificacion
AduanaH: AduanaH,//Aduana del pedimento original
PatenteH: PatenteH,//Patente del pedimento original
PedimentoH: PedimentoH,//Pedimento original
ClaveH: ClavePedimentoH,//Clave del pedimento original
FechaPagoH: FechaPagoH//Fecha de pago del pedimento original
}
CTrafDataService.AppendRectificacionHistorico(data)
.then((response) => {
setHeader('Informativo')
setMsg('La rectificación se creó correctamente')
setShowMsg(true)
dispatch(//Se actualizan los datos del pedimento seleccionado(original) con los datos de la rectificacion recien capturada
updatePedimento({
id: data.IdPedimento,
idTrafico: data.IdTrafico,
aduana: data.Aduana,
patente: data.Patente,
pedimento: data.Pedimento,
clave: data.Clave,
fechaPago: data.FechaPago
})
)
dispatch(//Los datos del pedimento original se guardan para mantener un historial de rectificaciones
addRectificacion({
id: response.data.id,
usuario: response.data.usuario,
idTrafico: response.data.idTrafico,
aduana: response.data.aduana,
patente: response.data.patente,
pedimento: response.data.pedimento,
clave: response.data.clave,
fechaPago: response.data.fechaPago,
fhCreacion: response.data.fhCreacion,
activo: response.data.activo,
idPedimentoConsolidado: response.data.idPedimentoConsolidado
})
)
cleanForm()
props.onAppendRectificacion(data)//Al cerrar se pasan los datos a la vista del trafico para actualizar los campos
return
})
.catch((e: Error) => {
setHeader('Error')
setMsg('Ocurrió un error al crear la rectificación. Favor de actualizar la página e intentarlo nuevamente.')
setShowMsg(true)
return
})
} else {
setHeader('Error')
setMsg('Parea poder generar este proceso es necesario que los siguientes campos tengan informacion: Patente, Aduana, Pedimento, Clave, Fecha pago')
setShowMsg(true)
return
}
}
const PrepareRectificacion = (idPedimentoConsolidado: number) => {
var dto = props.Pedimentos.filter(x => x.id === idPedimentoConsolidado)[0]
if(!dto.aduana){
setHeader('Error')
setMsg('Asegurese de capturar la aduana del pedimento')
setShowMsg(true)
setIdPedimentoConsolidadoSelected('#')
return
}
if(dto.patente === 0){
setHeader('Error')
setMsg('Asegurese de capturar la patente del pedimento')
setShowMsg(true)
setIdPedimentoConsolidadoSelected('#')
return
}
if(!dto.pedimento){
setHeader('Error')
setMsg('Asegurese de capturar el numero de pedimento')
setShowMsg(true)
setIdPedimentoConsolidadoSelected('#')
return
}
if(!dto.clave){
setHeader('Error')
setMsg('Asegurese de capturar la clave del pedimento')
setShowMsg(true)
setIdPedimentoConsolidadoSelected('#')
return
}
if(!dto.fechaPago){
setHeader('Error')
setMsg('Asegurese de capturar la fecha de pago del pedimento')
setShowMsg(true)
setIdPedimentoConsolidadoSelected('#')
return
}
setIdPedimentoH(dto.id)
setAduanaH(dto.aduana)
setPatenteH(dto.patente)
setPedimentoH(dto.pedimento)
setClavePedimentoH(dto.clave)
setFechaPagoH(dto.fechaPago)
setShowHistorial(true)
}
const CancelIsRectificacion = () => {
setAduanaH('0')
setPatenteH(0)
setPedimentoH(0)
setClavePedimentoH('')
setFechaPagoH('')
setIdPedimentoH(0)
}
const cleanForm = () => {
setIdPedimentoConsolidadoSelected("#")
setIdPedimentoH(0)
setPedimentoH(0)
setClavePedimentoH('')
setFechaPagoH('')
setId(0)
setPedimento(0)
setClavePedimento('')
setFechaPago('')
}
return (
<Card style={{height:'100%'}}>
<Card.Body style={{overflowY:'scroll'}}>
{ props.Depto === 'Corresponsalias' ? <>
<Row className="justify-content-end align-items-center">
<Col xs={1}><span>Original</span></Col>
<Col xs={1}>
</Col>
<Col xs={1}>
<FormLabel>
Aduana
<FormControl type='text' size='sm' disabled value={AduanaH}></FormControl>
</FormLabel>
</Col>
<Col xs={1}>
<FormLabel>
Patente
<FormControl type='text' size='sm' disabled value={PatenteH}></FormControl>
</FormLabel>
</Col>
<Col xs={2}>
<FormLabel>
Pedimento
<Form.Control
as="select"
id="CmbCliente"
onChange={(e) => {
setIdPedimentoConsolidadoSelected(e.target.value)
PrepareRectificacion(+e.target.value)
}}
value={IdPedimentoConsolidadoSelected}
className="form-select form-select-sm"
>
<option value="#">-SELECCIONE-</option>
{props.Pedimentos
? props.Pedimentos.map((p) => {
return (
<option key={p.id} value={p.id}>
{p.pedimento}
</option>
)
})
: null}
</Form.Control>
</FormLabel>
</Col>
<Col xs={2}>
<Form.Label>
Clave
<FormControl type='text' size='sm' disabled value={ClavePedimentoH}></FormControl>
</Form.Label>
</Col>
<Col xs={2}>
<Form.Label>
Fec. Pago
<Form.Control
type="date"
id="FechaPago"
size="sm"
value={setDate(FechaPagoH)}
readOnly={true}
disabled={true}
/>
</Form.Label>
</Col>
<Col xs={2}>
<Button onClick={() => generaRectificacion()}>Agregar</Button>
</Col>
</Row>
<Row className="justify-content-end align-items-center">
<Col xs={1}><span style={{wordWrap:'normal'}}>Rectificación</span></Col>
<Col
xs={1}
style={{
textAlign: 'right',
paddingTop: '5px',
cursor: 'pointer',
}}
onClick={() => {
cleanForm();
}}
>
<IconContext.Provider value={{ color: 'orange', size: '25px' }}>
<FaEraser />
</IconContext.Provider>
</Col>
<Col xs={1}>
<FormLabel>
Aduana
<FormControl type='text' size='sm' disabled value={Aduana} onChange={(e) => setAduana(e.target.value)}></FormControl>
</FormLabel>
</Col>
<Col xs={1}>
<FormLabel>
Patente
<FormControl type='text' size='sm' disabled value={Patente} onChange={(e) => setPatente(+e.target.value)}></FormControl>
</FormLabel>
</Col>
<Col xs={2}>
<FormLabel>
Pedimento
<CurrencyFormat
value={Pedimento}
displayType='input'
format={'### ####'}
mask="_"
onValueChange={(values: any) => {
const { value } = values
if(value.length === 7 ){
CTrafDataService.ValidaTraficoDuplicado(Aduana, Patente, value, props.IdTrafico).then( response => {
if(response.data !== ""){
setHeader('Informativo')
setMsg(`Pedimento Duplicado.\n\rLa referencia ${response.data} ya cuenta con los mismos datos de aduana, patente y pedimento`)
setShowMsg(true)
return
}
setPedimento(value.length === 0 ? 0 : value)
})
}
}}
style={{
fontSize: '18px',
backgroundColor: '#FEFDF5',
border: '2px solid #837F5D',
width: '100%',
textAlign: 'right',
borderRadius: '10px'
}}
/>
</FormLabel>
</Col>
<Col xs={2}>
<Form.Label>
Clave
<Form.Control
as="select"
id="CmbClavePedimento"
onChange={(e) => {
setClavePedimento(e.target.value)
}}
className="form-select form-select-sm"
value={ClavePedimento}
>
<option value="-Seleccione-">-Seleccione-</option>
{props.ClavesPedimento
? props.ClavesPedimento.map((item, index) => {
return (
<option key={item.id} value={item.clave}>
{item.clave}
</option>
)
})
: ''}
</Form.Control>
</Form.Label>
</Col>
<Col xs={2}>
<Form.Label>
Fec. Pago
<Form.Control
type="date"
id="FechaPago"
size="sm"
value={FechaPago}
onChange={(e) => setFechaPago(e.target.value)}
/>
</Form.Label>
</Col>
<Col xs={2}></Col>
</Row>
<hr/> </>: '' }
<HistorialRectificaciones IdPedimentoConsolidado={IdPedimentoConsolidadoSelected} ></HistorialRectificaciones>
<MsgInformativo
show={show}
msg={msg}
header={header}
msgColor={msgColor}
closeToast={() => {
setShowMsg(false)
}}
/>
</Card.Body>
</Card>
)
}

@ -0,0 +1,154 @@
import { Button, Col, Form, FormLabel, Row } from "react-bootstrap";
import { CiWarning } from "react-icons/ci";
import { MsgInformativo } from "../../Utils/Toast/msgInformativo";
import '../../../css/generic01.css'
import { ICorresponsalTraficoSolicitud } from "../../../Interfaces/Corresponsales/ICorresponsalTraficoSolicitud";
import { DTOTraficoSolicitud } from "../../../DTO/Corresponsales/DTOTraficoSolicitud";
import CTrafDataService from "../../../Services/Corresponsalias/Corresponsales.Trafico.Services"
import { useState } from "react";
import CorresponsalesTraficoSolicitudService from "../../../Services/Corresponsalias/Corresponsales.Trafico.Solicitud.Service";
interface IProps {
solicitud: DTOTraficoSolicitud;
userId: number;
close: (estado: number) => void
title: string;
mensaje: string;
}
export const AutorizarSolicitud:React.FC<IProps> = (props) => {
const [Motivo, setMotivo] = useState('')
const [showMsg, setShowMsg] = useState(false)
const [msg, setMsg] = useState('')
const [header, setHeader] = useState('')
const [SelectedOption, setSelectedOption] = useState(2)
const [Depto, setDepto] = useState(() => {
const stickyValue = window.localStorage.getItem('Departamento')
return stickyValue !== null ? JSON.parse(stickyValue) : ''
})
const [Perfil, setPerfil] = useState(() => {
const stickyValue = window.localStorage.getItem('Perfil')
return stickyValue !== null ? JSON.parse(stickyValue) : ''
})
const AppendSolicitud = () =>{
if(SelectedOption === 0 && !Motivo){
setHeader('Error');
setMsg('Favor de capturar una razon válida.')
setShowMsg(true)
return;
}
if(SelectedOption === 0 && Motivo.length < 30){
setHeader('Error');
setMsg('La razón del rechazo debe contener al menos 30 caracteres')
setShowMsg(true)
return;
}
var solicitud: ICorresponsalTraficoSolicitud = {
id: props.solicitud.id,
idTrafico: props.solicitud.idTrafico,
idUsuarioSolicita: props.solicitud.idUsuarioSolicita,
fechaSolicita: props.solicitud.fechaSolicita,
motivoSolicita: props.solicitud.motivoSolicita,
idUsuarioAutoriza: props.userId,
fechaAutoriza: undefined,
motivoRechazo: Motivo,
estado: SelectedOption
}
if(Depto === 'Facturacion'){
AppendSolicitudReapertura(solicitud)
}
if(Depto === 'Corresponsalias'){
AppendSolicitudEliminarReferencia(solicitud)
}
}
const AppendSolicitudReapertura = (solicitud: ICorresponsalTraficoSolicitud) => {
CorresponsalesTraficoSolicitudService.AppendSolicitudReapertura(solicitud)
.then((resp) => {
if(resp.data.id > 0){
props.close(SelectedOption)
}
})
.catch(() => {
setHeader('Error');
setMsg('Ocurrió un error. Favor de intentar nuevamente')
setShowMsg(true)
return;
})
}
const AppendSolicitudEliminarReferencia = (solicitud: ICorresponsalTraficoSolicitud) => {
CorresponsalesTraficoSolicitudService.AppendSolicitudEliminarReferencia(solicitud)
.then((resp) => {
if(resp.data.id > 0){
props.close(SelectedOption)
}
})
.catch(() => {
setHeader('Error');
setMsg('Ocurrió un error. Favor de intentar nuevamente')
setShowMsg(true)
return;
})
}
return(
<>
<h3>{props.title}</h3>
<hr/>
<Row>
<CiWarning style={{fontSize:'150px', color:'#ff3100'}} />
</Row>
<Row>
<Col xs={12}>
<p style={{textAlign:'center'}}>
{props.solicitud.usuarioSolicita} {props.mensaje}
</p>
<p style={{textAlign:'center'}}>{props.solicitud.motivoSolicita}</p>
</Col>
</Row>
<Row className='justify-content-center'>
<Col xs={4}>
<Form.Control
as='select'
className="form-select form-select-sm"
value={SelectedOption}
style={{width:'100%', marginBottom:'10px'}}
onChange={(e) => setSelectedOption(+e.target.value)}
>
<option value={2}>Autorizar</option>
<option value={0}>Rechazar</option>
</Form.Control>
</Col>
</Row>
<Row style={{visibility: SelectedOption === 0 ? 'visible' : 'hidden'}}>
<Col xs={12}>
<FormLabel style={{width:'100%'}}>
<Form.Control
as="textarea"
rows={3}
onChange={(e) => setMotivo(e.target?.value)}
placeholder='ingrese el motivo del rechazo de la solicitud'
/>
</FormLabel>
</Col>
</Row>
<Row className='justify-content-end'>
<Col xs={4} style={{textAlign:'end'}}>
<Button variant='primary' onClick={() => {AppendSolicitud()}}>
Guardar
</Button>
</Col>
</Row>
<MsgInformativo
show={showMsg}
msg={msg}
header={header}
msgColor={'primary'}
closeToast={() => {
setShowMsg(false)
}}
/>
</>
)
}

@ -0,0 +1,119 @@
import React, { useState } from "react"
import { Button, Col, Form, FormLabel, Row } from "react-bootstrap"
import CTrafDataService from "../../../Services/Corresponsalias/Corresponsales.Trafico.Services"
import { MsgInformativo } from "../../Utils/Toast/msgInformativo"
import { ICorresponsalTraficoSolicitud } from "../../../Interfaces/Corresponsales/ICorresponsalTraficoSolicitud"
import CorresponsalesTraficoSolicitudService from "../../../Services/Corresponsalias/Corresponsales.Trafico.Solicitud.Service"
interface IProps{
idTrafico: number,
idUsuario: number,
close: () => void,
title: string,
}
export const CrearSolicitud:React.FC<IProps> = (props) => {
const [Motivo, setMotivo] = useState('')
const [showMsg, setShowMsg] = useState(false)
const [msg, setMsg] = useState('')
const [header, setHeader] = useState('')
const [Depto, setDepto] = useState(() => {
const stickyValue = window.localStorage.getItem('Departamento')
return stickyValue !== null ? JSON.parse(stickyValue) : ''
})
const [Perfil, setPerfil] = useState(() => {
const stickyValue = window.localStorage.getItem('Perfil')
return stickyValue !== null ? JSON.parse(stickyValue) : ''
})
const AppendSolicitud = () => {
if(!Motivo){
setHeader('Error');
setMsg('Favor de capturar una razon válida.')
setShowMsg(true)
return;
}
if(Motivo.length < 30){
setHeader('Error');
setMsg('La razón de su solicitud debe contener al menos 30 caracteres')
setShowMsg(true)
return;
}
var solicitud: ICorresponsalTraficoSolicitud = {
id: 0,
idTrafico: props.idTrafico,
idUsuarioSolicita: props.idUsuario,
fechaSolicita: undefined,
motivoSolicita: Motivo,
idUsuarioAutoriza: Perfil.includes('Sup') ? props.idUsuario : 0, //Si es un supervisor se asigna su id al usuario que autoriza ya que la solicitud no requiere ser autorizada por otro usuario
fechaAutoriza: undefined,
motivoRechazo: "",
estado: Perfil.includes('Sup') ? 2 : 1 //Si es un supervisor se asigna el estado de la solicitud como autorizada desde que se crea
}
if(Depto === 'Facturacion'){
AppendSolicitudReapertura(solicitud)
}
if(Depto === 'Corresponsalias'){
AppendSolicitudEliminarReferencia(solicitud)
}
}
const AppendSolicitudReapertura = (solicitud: ICorresponsalTraficoSolicitud) => {
CorresponsalesTraficoSolicitudService.AppendSolicitudReapertura(solicitud)
.then((resp) => {
props.close()
})
.catch(() => {
setHeader('Error');
setMsg('Ocurrió un error. Favor de intentar nuevamente')
setShowMsg(true)
return;
})
}
const AppendSolicitudEliminarReferencia = (solicitud: ICorresponsalTraficoSolicitud) => {
CorresponsalesTraficoSolicitudService.AppendSolicitudEliminarReferencia(solicitud)
.then((resp) => {
props.close()
})
.catch(() => {
setHeader('Error');
setMsg('Ocurrió un error. Favor de intentar nuevamente')
setShowMsg(true)
return;
})
}
return(
<>
<h3>{props.title}</h3>
<hr/>
<Row>
<Col xs={12}>
<FormLabel style={{width:'100%'}}>
<Form.Control
as="textarea"
rows={5}
onChange={(e) => setMotivo(e.target?.value)}
placeholder='ingrese el motivo de la solicitud'
/>
</FormLabel>
</Col>
</Row>
<Row className='justify-content-end'>
<Col xs={2} style={{textAlign:'end'}}>
<Button variant='primary' onClick={() => AppendSolicitud()}>
Guardar
</Button>
</Col>
</Row>
<MsgInformativo
show={showMsg}
msg={msg}
header={header}
msgColor={'primary'}
closeToast={() => {
setShowMsg(false)
}}
/>
</>
)
}

@ -15,6 +15,7 @@ interface IProps {
IDCliente: number
IDTabulador: number
IDTrafico: number
IDCorresponsal: number | null
NombreCliente: string
closeTabulador: (arg: boolean) => void
cambiaPrecuenta: (IDPrecuenta: number) => void
@ -41,20 +42,14 @@ export const Tabulador: FC<IProps> = (props) => {
const [msg, setMsg] = useState('')
const columnsConcepts = [
{
name: 'id',
width: '10%',
selector: (row: ITabuladorConceptos) => row.id,
sortable: true,
},
{
name: 'Concepto',
width: '65%',
width: '60%',
selector: (row: ITabuladorConceptos) => row.concepto,
sortable: true,
},
{
name: 'Costo',
name: 'Costo Cte',
width: '15%',
cell: (row: ITabuladorConceptos) => {
return <ControlledInput id={row.id} value={row.costo.toFixed(2)} disabled={true} postCost={(id, value) => {}} />
@ -65,6 +60,18 @@ export const Tabulador: FC<IProps> = (props) => {
)*/
},
},
{
name: 'Costo Corresp',
width: '15%',
cell: (row: ITabuladorConceptos) => {
return <ControlledInput id={row.id} value={row.costoCorresponsal.toFixed(2)} disabled={true} postCost={(id, value) => {}} />
/*return row.activo === 1 ? (
<ControlledInput id={row.id} value={row.costo} disabled={true} postCost={(id, value) => {}} />
) : (
<ControlledInput id={row.id} value={0} disabled={true} postCost={(id, value) => {}} />
)*/
},
},
{
name: 'Activo',
width: '10%',
@ -134,7 +141,7 @@ export const Tabulador: FC<IProps> = (props) => {
// const postCost = (id: number, Cost: number) => {}
const GetAllTabs = () => {
CTabDataService.GetByCustomer(props.IDCliente)
CTabDataService.GetByCustomer(props.IDCliente, props.IDCorresponsal)
.then((response) => {
setTabuladores(response.data)
})

File diff suppressed because it is too large Load Diff

@ -3,10 +3,15 @@ import DashboardCorresponsales from './DashboardCorresponsales'
import { DashboardContabilidad } from './DashboardContabilidad'
import { Col, Container, Row } from 'react-bootstrap'
import { DashboardFacturacion } from './DashboardFacturacion'
import DashboardClientes from './DashboardClientes'
import { useSelector } from 'react-redux'
import { RootState } from '../../store/store'
import { DashboardSistemas } from './DashboardSistemas'
interface IProps {}
export default function Dashboard(props: IProps) {
const isAlenUser = useSelector((state: RootState) => state.userStatus.isAlenUser)
const [Depto, setDepto] = useState(() => {
const stickyValue = window.localStorage.getItem('Departamento')
return stickyValue !== null ? JSON.parse(stickyValue) : 0
@ -15,23 +20,36 @@ export default function Dashboard(props: IProps) {
const stickyValue = window.localStorage.getItem('User')
return stickyValue !== null ? JSON.parse(stickyValue) : 0
})
const [Perfil, setPerfil] = useState(() => {
const stickyValue = window.localStorage.getItem('Perfil')
return stickyValue !== null ? JSON.parse(stickyValue) : ''
})
return (
<div>
<br />
<Container>
<Row xs={1} md={3} className='g-4'>
{[['Direccion', 'Sistemas', 'Corresponsalias'].includes(Depto) ? <DashboardCorresponsales /> : ''].map(
{[Depto === 'Sistemas' ? <DashboardSistemas /> : ''].map(
(item) => {
return <React.Fragment>{item}</React.Fragment>
}
)}
{[['Direccion', 'Sistemas', 'Corresponsalias'].includes(Depto) ? <DashboardCorresponsales Perfil={Perfil} /> : ''].map(
(item) => {
return <React.Fragment>{item}</React.Fragment>
}
)}
{[['Direccion', 'Sistemas', 'Contabilidad'].includes(Depto) ? <DashboardContabilidad Depto={Depto} /> : ''].map((item) => {
{[['Direccion', 'Sistemas', 'Contabilidad'].includes(Depto) ? <DashboardContabilidad Depto={Depto} Perfil={Perfil}/> : ''].map((item) => {
return <React.Fragment>{item}</React.Fragment>
})}
{[['Direccion', 'Sistemas', 'Facturacion'].includes(Depto) ? <DashboardFacturacion Depto={Depto}/> : ''].map((item) => {
{[['Direccion', 'Sistemas', 'Facturacion'].includes(Depto) ? <DashboardFacturacion Depto={Depto} Perfil={Perfil}/> : ''].map((item) => {
return <React.Fragment>{item}</React.Fragment>
})}
{[isAlenUser ? <DashboardClientes /> : ''].map(
(item) => {
return <React.Fragment>{item}</React.Fragment>
}
)}
</Row>
</Container>
</div>

@ -0,0 +1,125 @@
import { FC, useEffect, useState } from 'react';
import { Card, Col, Row } from 'react-bootstrap';
import { Link } from 'react-router-dom';
import { IconContext } from 'react-icons';
import { FcSurvey } from 'react-icons/fc';
import { FaCcMastercard } from 'react-icons/fa';
import ClientesServices from '../../Services/Catalogos/Clientes.Services';
import { AxiosError } from 'axios';
import IClientes from '../../Interfaces/Catalogos/IClientes';
import { MsgInformativo } from '../Utils/Toast/msgInformativo';
export default function DashboardClientes() {
const [UserId, setUserId] = useState(() => {
const stickyValue = window.localStorage.getItem('UserId')
return stickyValue !== null ? JSON.parse(stickyValue) : 0
})
//const [ShowEstadosCuenta, setShowEstadosCuenta] = useState(false)
const [show, setShow] = useState(false)
const [msg, setMsg] = useState('')
const [header, setHeader] = useState('')
const [msgColor, setMsgColor] = useState('primary')
//
const [clientes, setClientes] = useState<IClientes[]>([])
/* useEffect(() => {
ClientesServices.getUsuariosAsignados(UserId)
.then(resp => {
setClientes(resp.data)
let cliente = resp.data.filter((x) => x.sClave===1896 && x.agrupado===1)
if(cliente.length > 0){
setShowEstadosCuenta(true)
}
})
.catch((err: AxiosError)=>{
setShow(true)
setMsg(err.request.responseText)
setHeader('Error')
return
})
}, []) */
return (
<>
<Col>
<Card style={{ width: '18rem' }} className='dashboardComponentFont'>
<Card.Header style={{fontSize:'15.9px'}}>
Clientes
</Card.Header>
<Card.Body style={{ paddingBottom: '50px' }}>
<Card.Title>
Traficos
<br />
<br />
</Card.Title>
<Card.Img variant='top' src='' onClick={() => {}} />
<div style={{ fontSize: '6em' }} className='text-center'>
<FcSurvey />
</div>
</Card.Body>
<Card.Footer>
<Row>
<Col xs={6} style={{ paddingRight: '5px' }}>
{/* <Link
to={`../RptCorresponsalesTraficosHst?proc=0&status=0`}
style={{ textDecoration: 'none', float: 'right', paddingRight: '10px' }}
>
Buscar
</Link> */}
{/* <span style={{ fontWeight: 'bold' }}>Tipo cambio: ${TipoCambio}</span> */}
</Col>
{/* <Col xs={3}></Col> */}
<Col xs={6} style={{ paddingRight: '5px' }}>
<Link
to={`../Clientes/Traficos`}
style={{
textDecoration: 'none',
float: 'right',
paddingRight: '10px',
}}
>
Ver mas...
</Link>
</Col>
</Row>
</Card.Footer>
</Card>
</Col>
<Col>
<Card style={{ width: '18rem' }} className='dashboardComponentFont'>
<Card.Header>Clientes</Card.Header>
<Card.Body style={{ paddingBottom: '50px' }}>
<Card.Title>
Estados de cuenta
<br />
<br />
</Card.Title>
<Card.Img variant='top' src='' onClick={() => {}} />
<div style={{ fontSize: '6em' }} className='text-center'>
<IconContext.Provider value={{ color: 'orange' }}>
<FaCcMastercard />
</IconContext.Provider>
</div>
</Card.Body>
<Card.Footer style={{ paddingRight: '5px' }}>
<Link
to='../Clientes/EstadosCuenta'
style={{ textDecoration: 'none', float: 'right', paddingRight: '10px' }}
>
Ver mas...
</Link>
</Card.Footer>
</Card>
</Col>
<MsgInformativo
show={show}
msg={msg}
header={header}
msgColor={msgColor}
closeToast={function (arg: boolean): void {
setShow(false)
}}
/>
</>
);
};

@ -8,6 +8,7 @@ import DashboardDataService from '../../Services/Dashboard/Dashboard.Contabilida
import DashboardCorresponsales from './DashboardCorresponsales'
interface IProps {
Depto: string;
Perfil:string;
}
export const DashboardContabilidad: FC<IProps> = (props) => {
@ -55,7 +56,7 @@ export const DashboardContabilidad: FC<IProps> = (props) => {
return (
<>
{
props.Depto === 'Contabilidad' ? <DashboardCorresponsales/> : ""
props.Depto === 'Contabilidad' ? <DashboardCorresponsales Perfil={props.Perfil}/> : ""
}
<Col>
<Card style={{ width: '18rem' }} className='dashboardComponentFont'>
@ -153,18 +154,17 @@ export const DashboardContabilidad: FC<IProps> = (props) => {
</Card>
</Col>
<Col>
<Card style={{ width: '18rem' }} className='dashboardComponentFont'>
<Card style={{ width: '18rem', maxHeight:'100%', height:'100%' }} className='dashboardComponentFont'>
<Card.Header>Contabilidad </Card.Header>
<Card.Body style={{ paddingBottom: '50px' }}>
<Card.Title>&nbsp;Traficos Con Cargos de Dlls<br/><br/></Card.Title>
<Card.Img variant='top' src='' onClick={() => {}} />
<Card.Body style={{ paddingBottom: '0px' }}>
<Card.Title>&nbsp;Traficos Con Cargos de Dlls<br/></Card.Title>
<div style={{ fontSize: '6em' }} className='text-center'>
<IconContext.Provider value={{ color: '#428d00' }}>
<FcSurvey style={{fontSize:'larger'}}/>
<FaMoneyBillAlt style={{fontSize:'60px', margin:'0 0 0 -4rem', position:"absolute", bottom: '6rem'}}/>
<FaMoneyBillAlt style={{fontSize:'80px', margin:'0 0 0 -3rem', position:"absolute", bottom: '9rem'}}/>
</IconContext.Provider>
{TraficosConCargos}
</div>
<div style={{fontSize:'60px', textAlign:'center'}}>{TraficosConCargos}</div>
</Card.Body>
<Card.Footer style={{ paddingRight: '5px' }}>
<Link

@ -5,14 +5,20 @@ import DashboardDataService from '../../Services/Dashboard/Dashboard.Corresponsa
import { useNavigate } from 'react-router-dom';
import ReactApexChart from 'react-apexcharts';
import { ApexOptions } from 'apexcharts';
import { IconContext } from 'react-icons';
import { FcSurvey } from 'react-icons/fc';
import { MdTimer } from 'react-icons/md';
interface IProps {}
interface IProps {
Perfil:string
}
export default function DashboardCorresponsales(props: IProps) {
let navigate = useNavigate();
const [TotalCorresponsales, setTotalCorresponsales] = useState(0);
const [labels, setlabels] = useState<string[]>([]);
const [series, setseries] = useState<number[]>([]);
const [Solicitudes, setSolicitudes] = useState(0);
//const [TipoCambio, setTipoCambio] = useState(0)
const [CircleOptions, setCirleOpcions] = useState<ApexOptions>({
labels: [
@ -32,6 +38,9 @@ export default function DashboardCorresponsales(props: IProps) {
});
useEffect(() => {
DashboardDataService.getSolicitudesEliminarCuenta().then((response) => {
setSolicitudes(response.data.total)
}).catch((e: Error) => {return;})
DashboardDataService.getCorresponsales()
.then((response) => {
console.log(response.data);
@ -144,6 +153,31 @@ export default function DashboardCorresponsales(props: IProps) {
</Card.Footer>
</Card>
</Col>
{props.Perfil === 'Sup. Corresponsalias' ?
<Col>
<Card style={{ width: '18rem' }} className='dashboardComponentFont'>
<Card.Header>Facturación </Card.Header>
<Card.Body style={{ paddingBottom: '50px' }}>
<Card.Title>Solicitudes para eliminar cuenta<br/><br/></Card.Title>
<div style={{ fontSize: '6em' }} className='text-center'>
<IconContext.Provider value={{ color: '#ff671b' }}>
<FcSurvey style={{fontSize:'larger'}}/>
<MdTimer style={{fontSize:'70px', margin:'0 0 0 -4rem', position:"absolute", bottom: '6rem'}}/>
</IconContext.Provider>
{Solicitudes}
</div>
</Card.Body>
<Card.Footer style={{ paddingRight: '5px' }}>
<Link
to='../RptCorresponsalesTraficos/proc=1/modo=2'
style={{ textDecoration: 'none', float: 'right', paddingRight: '10px' }}
>
Ver mas...
</Link>
</Card.Footer>
</Card>
</Col> : ""
}
</>
);
};

@ -7,18 +7,21 @@ import DashboardFacturacionDataService from '../../Services/Dashboard/Dashboard.
import DashboardContaDataService from '../../Services/Dashboard/Dashboard.Contabilidad.Service'
import { ApexOptions } from 'apexcharts'
import ReactApexChart from 'react-apexcharts'
import { FaReply } from 'react-icons/fa'
import { FaCcMastercard, FaReply } from 'react-icons/fa'
import { FcSurvey } from 'react-icons/fc'
import DashboardCorresponsales from './DashboardCorresponsales'
import { MdTimer } from 'react-icons/md'
interface IProps {
Depto: string;
Perfil: string;
}
export const DashboardFacturacion: FC<IProps> = (props) => {
const [labels, setlabels] = useState<string[]>([]);
const [series, setseries] = useState<number[]>([]);
const [RechazosContabilidad, setRechazosContabilidad] = useState(0);
const [SolicitudesReapertura, setSolicitudesReapertura] = useState(0);
const navigate = useNavigate();
const [ChartOptions, setChartOptions] = useState<ApexOptions>({
labels: [
@ -43,6 +46,9 @@ export const DashboardFacturacion: FC<IProps> = (props) => {
}).catch((e: Error) => {
return;
})
DashboardFacturacionDataService.getSolicitudesReapertura().then((response) => {
setSolicitudesReapertura(response.data.total)
}).catch((e: Error) => {return;})
DashboardFacturacionDataService.getFacturacion()
.then((response) => {
console.log(response.data);
@ -105,7 +111,7 @@ export const DashboardFacturacion: FC<IProps> = (props) => {
return (
<>
{
props.Depto === 'Facturacion' ? <DashboardCorresponsales/> : ""
props.Depto === 'Facturacion' ? <DashboardCorresponsales Perfil={props.Perfil}/> : ""
}
<Col>
<Card style={{ width: '18rem' }} className='dashboardComponentFont'>
@ -158,6 +164,59 @@ export const DashboardFacturacion: FC<IProps> = (props) => {
</Card>
</Col> : ""
}
{props.Perfil === 'Sup. Facturacion' || props.Perfil === 'Administrador'?
<>
<Col>
<Card style={{ width: '18rem' }} className='dashboardComponentFont'>
<Card.Header>Facturación </Card.Header>
<Card.Body style={{ paddingBottom: '50px' }}>
<Card.Title>Solicitudes de reapertura de cuenta<br/><br/></Card.Title>
<div style={{ fontSize: '6em' }} className='text-center'>
<IconContext.Provider value={{ color: '#ff671b' }}>
<FcSurvey style={{fontSize:'larger'}}/>
<MdTimer style={{fontSize:'70px', margin:'0 0 0 -4rem', position:"absolute", bottom: '6rem'}}/>
</IconContext.Provider>
{SolicitudesReapertura}
</div>
</Card.Body>
<Card.Footer style={{ paddingRight: '5px' }}>
<Link
to='../RptCorresponsalesTraficos/proc=3/modo=4'
style={{ textDecoration: 'none', float: 'right', paddingRight: '10px' }}
>
Ver mas...
</Link>
</Card.Footer>
</Card>
</Col>
<Col>
<Card style={{ width: '18rem' }} className='dashboardComponentFont'>
<Card.Header>Alen</Card.Header>
<Card.Body style={{ paddingBottom: '50px' }}>
<Card.Title>
Estados de cuenta
<br />
<br />
</Card.Title>
<Card.Img variant='top' src='' onClick={() => {}} />
<div style={{ fontSize: '6em' }} className='text-center'>
<IconContext.Provider value={{ color: 'orange' }}>
<FaCcMastercard />
</IconContext.Provider>
</div>
</Card.Body>
<Card.Footer style={{ paddingRight: '5px' }}>
<Link
to='../Clientes/EstadosCuenta'
style={{ textDecoration: 'none', float: 'right', paddingRight: '10px' }}
>
Ver mas...
</Link>
</Card.Footer>
</Card>
</Col>
</> : ""
}
</>
)
}

@ -0,0 +1,125 @@
import { ApexOptions } from "apexcharts";
import { useEffect, useState } from "react";
import ReactApexChart from "react-apexcharts"
import { Card, Col, Row } from "react-bootstrap"
import { Link } from "react-router-dom"
import DashboardDataService from '../../Services/Dashboard/Dashboard.Corresponsales.Services';
export const DashboardSistemas:React.FC = () => {
const [TotalCorresponsales, setTotalCorresponsales] = useState(0);
const [series, setseries] = useState<number[]>([]);
const [Label, setLabel] = useState('');
const [CircleOptions, setCirleOpcions] = useState<ApexOptions>({
labels: [],
colors: ['#EB984E',],
legend: { position: 'bottom' },
plotOptions: {
pie: {
donut: {
size: '55%',
},
},
},
});
useEffect(() => {
DashboardDataService.getDisk()
.then((response) => {
console.log(response.data);
setLabel(response.data.descripcion)
setseries([response.data.total]);
setCirleOpcions({
labels: [response.data.descripcion],
colors: ['#ABEB4E'],
legend: { position: 'bottom' },
plotOptions: {
radialBar: {
startAngle: -135,
endAngle: 135,
track: {
background: "#e7e7e7",
strokeWidth: '100%',
margin: 5, // margin is in pixels
dropShadow: {
enabled: false,
top: 2,
left: 0,
color: '#999',
opacity: 1,
blur: 2
}
},
dataLabels: {
name:{
show:false
},
value: {
show: true,
fontSize: '43px',
fontWeight: 'bold',
},
}
}
},
grid: {
padding: {
top: -10
}
},
});
})
.catch((e: Error) => {
return;
});
//getTipoCambio(currentDate())
}, []);
return (
<Col>
<Card style={{ width: '18rem' }} className='dashboardComponentFont'>
<Card.Header style={{fontSize:'15.9px'}}>
<b>Sistemas </b>
</Card.Header>
<Card.Body style={{ paddingBottom: '0px'}}>
<Card.Title>Almacenamiento interno</Card.Title>
<ReactApexChart
type='radialBar'
options={CircleOptions}
series={series}
width={250}
height={310}
/>
<div style={{textAlign:"center"}}>{Label}</div>
</Card.Body>
<Card.Footer>
<Row>
<Col xs={6} style={{ paddingRight: '5px' }}>
{/* <Link
to={`../RptCorresponsalesTraficosHst?proc=0&status=0`}
style={{ textDecoration: 'none', float: 'right', paddingRight: '10px' }}
>
Buscar
</Link> */}
{/* <span style={{ fontWeight: 'bold' }}>Tipo cambio: ${TipoCambio}</span> */}
</Col>
{/* <Col xs={3}></Col> */}
<Col xs={6} style={{ paddingRight: '5px' }}>
<Link
to={``}
style={{
visibility: 'hidden',
textDecoration: 'none',
float: 'right',
paddingRight: '10px',
}}
>
Ver mas...
</Link>
</Col>
</Row>
</Card.Footer>
</Card>
</Col>
)
}

@ -0,0 +1,517 @@
import { useEffect, useRef, useState } from "react"
import { Button, Card, Col, Row, Form } from "react-bootstrap"
import ClientesServices from "../../Services/Catalogos/Clientes.Services"
import IClientes from "../../Interfaces/Catalogos/IClientes"
import { AxiosError } from "axios"
import { MsgInformativo } from "../Utils/Toast/msgInformativo"
import { AgGridReact } from "ag-grid-react"
import EstadosCuentaAlenService from "../../Services/EstadosCuenta/EstadosCuentaAlen.Service"
import { DTOEstadoCuentaAlen } from "../../DTO/EstadosCuenta/DTOEstadoCuentaAlen"
import { ColDef, ILargeTextEditorParams } from "ag-grid-community"
import { BsFileEarmarkExcelFill } from "react-icons/bs"
import { DTOEstadoCuentaAlenFilters } from "../../DTO/EstadosCuenta/DTOEstadosCuentaAlenFilters"
import { FaDownload } from "react-icons/fa"
import { IconContext } from "react-icons"
import FileManagerServices from "../../Services/Utils/FileManager.Services"
export const EstadosCuenta:React.FC = () => {
const [Perfil, setPerfil] = useState(() => {
const stickyValue = window.localStorage.getItem('Perfil')
return stickyValue !== null ? JSON.parse(stickyValue) : ''
})
const [Cuentas, setCuentas] = useState<DTOEstadoCuentaAlen[]> ([])
const [show, setShow] = useState(false)
const [msg, setMsg] = useState('')
const [header, setHeader] = useState('')
const [msgColor, setMsgColor] = useState('primary')
const hiddenFileInputRef = useRef<HTMLInputElement>(null);
const [showSpinner, setShowSpinner] = useState(false)
const [File, setFile] = useState<File | null>();
//Estados de los filtros
const [Remitentes, setRemitentes] = useState<string[]>([])
const [Trafico, setTrafico] = useState('')
const [Aduana, setAduana] = useState('')
const [Patente, setPatente] = useState('')
const [Pedimento, setPedimento] = useState('')
const [TipoOperacion, setTipoOperacion] = useState('')
const [Inicio, setInicio] = useState('')
const [Fin, setFin] = useState('')
const [Remitente, setRemitente] = useState('')
const [Programado, setProgramado] = useState(0)
//
const [columnDefs] = useState<ColDef[]>([
{
field:'serie', headerName:'Serie',
valueGetter: ({data}:any) => {return data.serie + data.noMovimiento},
width:100,
filter: true
},/* {
field:'noMovimiento', headerName:'Movimiento'
}, */{
field:'fecha', filter: true
},{
field:'trafico', width:150, sortable: true, filter: true
},{
field:'aduana', width:100, filter: true
},{
field:'patente', width:100, filter: true
},{
field:'pedimento', width:120, filter: true
},{
field:'clave', headerName:'Cve. Pedim', width:120, filter: true
},{
field:'impexp', headerName: 'Impo/Expo', width:120, filter: true
},{
field:'noCliente', headerName: 'No. Cte.', width:100, filter: true
},{
field:'nombre', headerName: 'Nombre Cliente', width:300, filter: true
},{
field:'cargos', width:100, filter: true
},{
field:'abonos', width:100, filter: true
},{
field:'saldoFinal', width:120, filter: true
},{
field:'ivaAl', headerName: '% IVA', width:100, filter: true
},{
field:'descripcion', width:300, wrapText:true, autoHeight: true, filter: true
},{
field:'remitente', width:300, wrapText:true, autoHeight: true, filter: true
},{
field:'pedido', width:300, wrapText:true, autoHeight: true, filter: true
},{
field:'ordenCompra', editable: true, filter: true, wrapText: true, autoHeight:true
}
,{
field:'tipoMercancia', headerName: 'Tipo Mcia', filter: true
},
{
field:'idPdf', headerName: 'PDF',
cellRenderer: ({data}:any)=>{
return (
<IconContext.Provider value={{color: 'blue', size:'20px'}}>
<FaDownload style={{cursor:'pointer'}} onClick={() => {
if(data.trafico[data.trafico.length-1].toUpperCase() === 'C')
getCorresponsaliasFile(data.idPdf, 37, data.pdf)
else
getAEO(data.serie, data.noMovimiento, 'pdf', data.trafico);
}
}/>
</IconContext.Provider>
)
}
},
{
field:'idXml', headerName: 'XML',
cellRenderer: ({data}:any)=>{
return (
<IconContext.Provider value={{color: 'blue', size:'20px'}}>
<FaDownload style={{cursor:'pointer'}} onClick={() => {
if(data.trafico[data.trafico.length-1].toUpperCase() === 'C')
getCorresponsaliasFile(data.idXml, 38, data.xml)
else
getAEO(data.serie, data.noMovimiento, 'xml', data.trafico);
}
}/>
</IconContext.Provider>
)
}
},
{
field: "observaciones",
editable:true,
filter: true,
wrapText: true,
cellEditor: "agLargeTextCellEditor",
cellEditorPopup: true,
cellEditorParams: {
rows: 5,
maxLength: 1000
} as ILargeTextEditorParams,
autoHeight:true
},
/* {
field:'idNotasCargo', headerName: 'Notas de Cargo',
cellRenderer: ({data}:any)=>{
return (
data.idNotasCargo !== 0 ?
<IconContext.Provider value={{color: 'blue', size:'20px'}}>
<FaDownload style={{cursor:'pointer'}} onClick={() => {
if(data.trafico[data.trafico.length-1].toUpperCase() === 'C')
getCorresponsaliasFile(data.idNotasCargo, 41, data.notasCargo)
/* else
getAEO(data.serie, data.noMovimiento);
}
}/>
</IconContext.Provider> : ''
)
}
}, */
])
useEffect(() => {
getCuentas();
},[])
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 uploadFile = (file: File) => {
setShowSpinner(true)
const formData = new FormData()
formData.append('name', file.name)
formData.append('file', file)
if(Perfil === 'Administrador'){
EstadosCuentaAlenService.Append(formData)
.then((res) => {
hiddenFileInputRef.current!.value = ''
setCuentas(res.data)
setShowSpinner(false)
})
.catch((err: AxiosError) => {
setShowSpinner(false)
hiddenFileInputRef.current!.value = ''
setShow(true)
setMsg(err.request.responseText)
setHeader('Error')
return
})
}
if(['Facturacion', 'Sup. Facturacion'].includes(Perfil)){
EstadosCuentaAlenService.AppendProgramacionesPago(formData)
.then((res) => {
hiddenFileInputRef.current!.value = ''
setCuentas(res.data)
setShowSpinner(false)
})
.catch((err: AxiosError) => {
setShowSpinner(false)
hiddenFileInputRef.current!.value = ''
setShow(true)
setMsg(err.request.responseText)
setHeader('Error')
return
})
}
}
const getCuentas = () => {
var filters: DTOEstadoCuentaAlenFilters = {
Trafico: Trafico,
Impexp: TipoOperacion,
Aduana: Aduana,
Patente: Patente,
Pedimento: Pedimento,
Inicio: Inicio,
Fin: Fin,
Remitente: Remitente,
Programado: Programado
}
EstadosCuentaAlenService.GetAll(filters)
.then(resp => {
setCuentas(resp.data)
if(resp.data.length === 0){
setShow(true)
setMsg("No se encontraron registros")
setHeader('Informativo')
return;
}
if(Remitentes.length === 0){
let remitentes = resp.data.map((x:any) => {
if(x.remitente==='' || x.remitente===null) x.remitente = 'SIN REMITENTE'
return x.remitente
})
setRemitentes(remitentes.filter(function(elem, index, self) {
return index === self.indexOf(elem);
}).sort((a,b) => (a < b ? -1 : 1)))
}
})
.catch((err: AxiosError) => {
setShowSpinner(false)
setShow(true)
setMsg(err.request.responseText)
setHeader('Error')
return
})
}
const selectFile = () => {
hiddenFileInputRef.current?.click()
}
const downloadEstadosCuenta = () => {
EstadosCuentaAlenService.ExportEstadosCuenta(Cuentas)
.then((resp:any) => {
const url = window.URL.createObjectURL(new Blob([resp.data]))
const link = document.createElement('a')
link.href = url
link.setAttribute('download', "EstadosDeCuenta.xlsx")
document.body.appendChild(link)
link.click()
}).catch((err:AxiosError) => {
setShow(true)
setMsg(err.request.responseText)
setHeader('Error')
return;
})
}
const getRowStyle = (params: any) => {
var styles = {
backgroundColor:'',
border: '0.5px solid #aaaaaa',
}
/* if (params.data.programado === 1) {
styles.backgroundColor = 'rgb(98, 190, 255, 0.5)';
} */
if(params.data.programado === true){
styles.backgroundColor = "rgb(255, 193, 7, 0.5)";
}
return styles;
};
const getCorresponsaliasFile = (id:number, proceso: number, fileName: string) => {
FileManagerServices.getFileContent(id, proceso)
.then((resp: any) => {
const url = window.URL.createObjectURL(new Blob([resp.data]))
const link = document.createElement('a')
link.href = url
link.setAttribute('download', fileName)
document.body.appendChild(link)
link.click()
}).catch((err:AxiosError) => {
setShow(true)
setMsg("No se encontró el archivo solicitado")
setHeader('Error')
return;
})
}
const getAEO = (serie: string, noMovimiento: string, mime: string, trafico: string) => {
FileManagerServices.getAEO(serie, noMovimiento, mime, trafico)
.then((resp: any) => {
const url = window.URL.createObjectURL(new Blob([resp.data]))
const link = document.createElement('a')
link.href = url
link.setAttribute('download', `EstadoCuenta_${serie}${noMovimiento}.${mime}`)
document.body.appendChild(link)
link.click()
}).catch((err:AxiosError) => {
setShow(true)
setMsg("No se encontró el archivo solicitado")
setHeader('Error')
return;
})
}
const onCellValueChanged = (event: any) => {
var data: DTOEstadoCuentaAlen = event.data;
let ColDef = event.colDef;
if(ColDef.field === 'ordenCompra'){
EstadosCuentaAlenService.AppendOrdenCompra(data)
.then(() => getCuentas())
.catch((err:AxiosError) => {
setShow(true)
setMsg(err.request.responseText)
setHeader('Error')
return;
})
}
if(ColDef.field === 'observaciones'){
EstadosCuentaAlenService.AppendObservaciones(data)
.then(() => getCuentas())
.catch((err:AxiosError) => {
setShow(true)
setMsg(err.request.responseText)
setHeader('Error')
return;
})
}
}
return (
<div>
<Card>
<Card.Body>
<Row>
<Col xs={2}>
<Form.Label style={{width:'100%'}}>
Trafico
<Form.Control
size="sm"
type="text"
value={Trafico}
onChange={(e) => setTrafico(e.target.value)}
>
</Form.Control>
</Form.Label>
</Col>
<Col xs={1}>
<Form.Label style={{width:'100%'}}>
Aduana
<Form.Control
size="sm"
type="text"
value={Aduana}
onChange={(e) => setAduana(e.target.value)}
>
</Form.Control>
</Form.Label>
</Col>
<Col xs={1}>
<Form.Label style={{width:'100%'}}>
Patente
<Form.Control
size="sm"
type="text"
value={Patente}
onChange={(e) => setPatente(e.target.value)}
>
</Form.Control>
</Form.Label>
</Col>
<Col xs={2}>
<Form.Label style={{width:'100%'}}>
Pedimento
<Form.Control
size="sm"
type="text"
value={Pedimento}
onChange={(e) => setPedimento(e.target.value)}
>
</Form.Control>
</Form.Label>
</Col>
<Col xs={2}>
<Form.Label style={{width:'100%'}}>
Inicio
<Form.Control
defaultValue={Inicio}
type='date'
name='Fecha'
placeholder='Fecha'
title='Fecha'
alt='Fecha'
onChange={(e) => setInicio(e.target.value)}
size='sm'
/>
</Form.Label>
</Col>
<Col xs={2}>
<Form.Label style={{width:'100%'}}>
Fin
<Form.Control
defaultValue={Fin}
type='date'
name='Fecha'
placeholder='Fecha'
title='Fecha'
alt='Fecha'
onChange={(e) => setFin(e.target.value)}
size='sm'
/>
</Form.Label>
</Col>
<Col xs={2}>
<Form.Label style={{width:'100%'}}>
Remitente
<Form.Control
as='select'
value={Remitente!}
onChange={(e) => {
setRemitente(e.target.value)
}}
className='form-select form-select-sm'
>
<option value={''}>- SELECCIONE -</option>
{Remitentes.map((r) => {
return (
<option key={r} value={r}>{r}</option>
)
})}
</Form.Control>
</Form.Label>
</Col>
</Row>
<Row className="justify-content-between justify-items-end">
<Col xs={2}>
<Form.Label style={{width:'100%'}}>
Tipo Operacion
<Form.Control
as='select'
value={TipoOperacion!}
onChange={(e) => {
setTipoOperacion(e.target.value)
}}
className='form-select form-select-sm'
>
<option value={''} key={'0'}>- SELECCIONE -</option>
<option value={'I'} key={'I'}>IMPORTACION</option>
<option value={'E'} key={'E'}>EXPORTACION</option>
</Form.Control>
</Form.Label>
</Col>
<Col xs={2}>
<Form.Label style={{width:'100%'}}>
Estado
<Form.Control
as='select'
value={Programado!}
onChange={(e) => {
setProgramado(+e.target.value)
}}
className='form-select form-select-sm'
>
<option value={0} key={0}>- SELECCIONE -</option>
<option value={1} key={1}>EN PLATAFORMA</option>
<option value={2} key={2}>NO EN PLATAFORMA</option>
</Form.Control>
</Form.Label>
</Col>
<Col xs={8} className="d-flex align-items-end">
<div style={{textAlign:'end', width:'100%'}}>
<Button variant='primary' onClick={() => getCuentas()} style={{marginRight:'10px'}}>Buscar</Button>
{['Administrador', 'Facturacion', 'Sup. Facturacion'].includes(Perfil) ? <Button variant='primary' onClick={() => {selectFile()}} style={{marginRight:'10px'}}>Cargar Estados</Button> : ''}
<Button variant='success' onClick={() => {downloadEstadosCuenta()}} style={{marginRight:'10px'}}><BsFileEarmarkExcelFill/> Excel</Button>
<input type="file" ref={hiddenFileInputRef} style={{display:'none'}}
onChange={(e:any) => {
uploadFile(e.target.files[0]);
setFile(e.target.files[0]);
}}
/>
</div>
</Col>
</Row>
</Card.Body>
</Card>
<br />
<div className='ag-theme-alpine' style={{ height: 500, width: '100%' }}>
<AgGridReact
rowData={Cuentas}
columnDefs={columnDefs}
pagination={true}
paginationAutoPageSize={true}
//ref={gridRef}
/* rowSelection={'multiple'}
rowMultiSelectWithClick={true} */
getRowStyle={getRowStyle}
onCellValueChanged={onCellValueChanged}
></AgGridReact>
</div>
<MsgInformativo
show={show}
msg={msg}
header={header}
msgColor={msgColor}
closeToast={function (arg: boolean): void {
setShow(false)
}}
/>
</div>
)
}

@ -1,7 +1,7 @@
import * as React from 'react'
import { useNavigate } from 'react-router-dom'
import { useSelector, useDispatch } from 'react-redux'
import { logued } from '../../store/features/userStatusSlice/userStatusSlice'
import { IsAlenUser, logued } from '../../store/features/userStatusSlice/userStatusSlice'
import ILogin from '../../Interfaces/Ilogin'
import ItemMenu from '../../Interfaces/Catalogos/IItemMenu'
import '../../css/login.css'
@ -17,13 +17,14 @@ import AuthDS from '../../Services/Auth/Auth.Service'
import UserDS from '../../Services/Catalogos/Usuarios.Services'
import { useEffect } from 'react'
import Info from '../../../package.json'
import ClientesServices from '../../Services/Catalogos/Clientes.Services'
export const Login: React.FC<{}> = () => {
const dispatch = useDispatch()
const navigate = useNavigate()
let _menu: ItemMenu[] = []
const [mainMenu, setMainMenu] = React.useState(_menu)
const userLogued = useSelector((state: RootState) => state.userStatus.value)
const userLogued = useSelector((state: RootState) => state.userStatus.isLogged)
const [show, setShow] = React.useState(false)
const [Usuario, setUsuario] = React.useState('')
const [Contrasenia, setContrasenia] = React.useState('')
@ -59,7 +60,7 @@ export const Login: React.FC<{}> = () => {
if(values.Perfil === 'Corresponsales'){
navigate('/RptCorresponsalesTraficos/proc=1/modo=1')
}else if(values.Perfil === 'Clientes'){
navigate('/Clientes/Traficos')
checkForAlenUser(values.UserId)
}else{
navigate('/')
}
@ -105,6 +106,25 @@ export const Login: React.FC<{}> = () => {
})
}, [dispatch, navigate])
const checkForAlenUser = (UserId: number) => {
ClientesServices.getUsuariosAsignados(UserId)
.then(resp => {
let cliente = resp.data.filter((x) => x.sClave===1896 && x.agrupado===1)
if(cliente.length > 0){
dispatch(IsAlenUser(true))
navigate('/')
}else{
navigate('/Clientes/Traficos')
}
})
.catch((err: AxiosError)=>{
setShow(true)
setMsg(err.request.responseText)
setHeader('Error')
return
})
}
return (
<div>
{!userLogued ? (

@ -1,7 +1,7 @@
import { FC, useEffect } from 'react'
import { useNavigate } from 'react-router-dom'
import { useDispatch } from 'react-redux'
import { logued } from '../../store/features/userStatusSlice/userStatusSlice'
import { IsAlenUser, logued } from '../../store/features/userStatusSlice/userStatusSlice'
interface IProps {}
@ -12,6 +12,7 @@ const Logout: FC<IProps> = (props) => {
useEffect(() => {
window.localStorage.clear()
dispatch(logued(false))
dispatch(IsAlenUser(false))
navigate('/')
})

@ -0,0 +1,195 @@
import React, { FC, useEffect, useState } from 'react'
// Bootstrap
import { Button, Col, Container, Modal, Row } from 'react-bootstrap'
import { BsCloudDownload } from 'react-icons/bs'
// Interfaces
import IArchivoElectronico from '../../../Interfaces/IArchivoElectronico'
// DTOs
import DTOgetArchivosPorReferencia from '../../../DTO/DTOgetArchivosPorReferencia'
// Redux
import { RootState } from '../../../store/store'
import { useSelector } from 'react-redux'
// Servicios
import AEOServices from '../../../Services/Catalogos/ArchivoElectronico.Services'
import ArchivoElectronicoDataServices from '../../../Services/Catalogos/ArchivoElectronico.Services'
// Otros
import { AgGridReact } from 'ag-grid-react'
import { MsgInformativo } from '../../Utils/Toast/msgInformativo'
import { TargetURL } from '../../../Constants/TargetURL'
import IFileManager from '../../../Interfaces/Utils/IFileManager'
import FileManagerServices from '../../../Services/Utils/FileManager.Services'
import { IconContext } from 'react-icons'
import { FaDownload } from 'react-icons/fa'
interface IProps {
showDialog: boolean
header: string
closeDialog: (arg: boolean) => void
archivos: IFileManager[]
}
interface ListaArchivos {
archivo: string
}
const URL = new TargetURL()
export const DialogAE: FC<IProps> = (props) => {
const [curURL, setCurURL] = useState(URL.get())
const Referencia = useSelector((state: RootState) => state.ArchivoElectronico.Referencia)
const Pedimento = useSelector((state: RootState) => state.ArchivoElectronico.Pedimento)
const NoCliente = useSelector((state: RootState) => state.ArchivoElectronico.NoCliente)
const [filteredData, setFilteredData] = useState<IFileManager[]>([])
const [columnDefs] = useState([
{
field: 'nombreArchivo',
cellRender: (params:any) => {return params.data.nombreArchivo},
width: 430,
headerCheckboxSelection: false,
headerCheckboxSelectionFilteredOnly: false,
checkboxSelection: false,
sortable: true,
filter: true,
},{
field: 'Descargar',
width: 100,
cellRenderer: (params:any) => {
return (
<div style={{textAlign:'center'}}>
<IconContext.Provider value={{ color: 'blue', size: '25px' }}>
<FaDownload onClick={() => {getFile(params.data)}} style={{cursor:'pointer'}}/>
</IconContext.Provider>
</div>
)
//return <Button variant='warning' onClick={() => {getFile(params.data)}}></Button>
},
}
])
const gridRef = React.useRef<any>(null)
const [msgColor, setMsgColor] = React.useState('primary')
const [show, setShowMsg] = useState(false)
const [header, setHeader] = useState('')
const [msg, setMsg] = useState('')
const viewFileContent = (fileName: string) => {
window.open(
`${curURL}/ArchivoElectronico/getFileContent?Referencia=${Referencia}&PedimentoLargo=dummy&NoCliente=${NoCliente}&IdUsuario=0&Archivo=${fileName}`
)
}
useEffect(() => {
setFilteredData(props.archivos)
}, [props.archivos])
const getFile = (file: IFileManager) => {
FileManagerServices.getFileContent(parseInt(file.tags), file.proceso).then((resp: any) => {
const url = window.URL.createObjectURL(new Blob([resp.data]))
const link = document.createElement('a')
link.href = url
link.setAttribute('download', file.nombreArchivo)
document.body.appendChild(link)
link.click()
}).catch(() => {
setHeader('Error')
setMsg('Ocurrio un error durante la descarga, favor de intentar nuevamente')
setShowMsg(true)
return
})
}
const getFilesByReference = () => {
let selectedNodes = gridRef.current.api.getSelectedNodes()
let selectedData = selectedNodes.map((node: any) => node.data)
const Archivos = selectedData.map((item: ListaArchivos) => item.archivo)
const data: DTOgetArchivosPorReferencia = {
Referencia: Referencia,
PedimentoLargo: Pedimento,
NoCliente: NoCliente,
IdUsuario: 0,
Archivo: 'dummy',
Archivos: Archivos,
}
/* AEOServices.getTheseFilesByReferences(data)
.then((response: any) => {
const url = window.URL.createObjectURL(new Blob([response.data]))
const link = document.createElement('a')
link.href = url
link.setAttribute('download', Referencia + '.zip')
document.body.appendChild(link)
link.click()
})
.catch((e: Error) => {
setHeader('Error')
setMsg('Ocurrio un error: ' + e)
setShowMsg(true)
return
}) */
props.closeDialog(false)
}
return (
<div>
{' '}
<Modal
dialogClassName='modal-50w'
show={props.showDialog}
onHide={() => {
props.closeDialog(false)
}}
centered
>
<Modal.Header closeButton>
<Modal.Title>Referencia: {Referencia}</Modal.Title>
</Modal.Header>
<Modal.Body>
{filteredData ? (
<div style={{ height: '350px', width: '100%' }} className='ag-theme-alpine'>
<AgGridReact
rowData={filteredData}
columnDefs={columnDefs}
pagination={true}
paginationPageSize={50}
ref={gridRef}
/* rowSelection={'multiple'}
rowMultiSelectWithClick={true} */
></AgGridReact>
</div>
) : (
'Sin archivos que mostrar'
)}
<MsgInformativo show={show} msg={msg} header={header} msgColor={msgColor} closeToast={() => setShowMsg(false)} />
</Modal.Body>
{/* <Modal.Footer>
<Container>
<Row>
<Col md={2}></Col>
<Col md={4}>
<Button
variant='warning'
size='sm'
onClick={() => {
getFilesByReference()
}}
>
<BsCloudDownload /> Descargar
</Button>
</Col>
<Col md={3}></Col>
<Col md={3}>
<Button
variant='primary'
size='sm'
onClick={() => {
props.closeDialog(false)
}}
>
Cerrar
</Button>
</Col>
</Row>
</Container>
</Modal.Footer> */}
</Modal>
</div>
)
}

@ -41,8 +41,9 @@ import { InitCorresponsalesContenedores, addCorresponsalesContenedores } from '.
import ICorresponsalContenedores from '../../Interfaces/Corresponsales/ICorresponsalContenedores'
import ICorresponsalFacturas from '../../Interfaces/Corresponsales/ICorresponsalFacturas'
import ICatProveedores from '../../Interfaces/Catalogos/ICatProveedores'
import { FaCrow } from 'react-icons/fa'
/* import '../../css/generic01.css' */
import { FaCrow, FaTrash } from 'react-icons/fa'
import { CrearSolicitud } from '../Corresponsales/SolicitudReapertura/CrearSolicitud'
import '../../css/generic01.css'
interface IProps {}
@ -71,6 +72,7 @@ export default function RptCorresponsalesTraficos(props: IProps) {
const [filteredData, setFilteredData] = useState<ICorresponsalTrafico[]>([])
const [show, setShowMsg] = useState(false)
const [ShowModal, setShowModal] = useState(false)
const [ShowModalSolicitud, setShowModalSolicitud] = useState(false)
const [header, setHeader] = useState('')
const [msg, setMsg] = useState('')
const [Inicio, setInicio] = useState(currentDate(-365))
@ -84,7 +86,7 @@ export default function RptCorresponsalesTraficos(props: IProps) {
//const [Corresponsal, setCorresponsal] = useState(0)
const [Pedimento, setPedimento] = useState(0)
const [Patente, setPatente] = useState(0);
const [Aduana, setAduana] = useState(0);
const [Aduana, setAduana] = useState('0');
const [Referencia, setReferencia] = useState('')
const [Clientes, setClientes] = useState<Array<IClientes>>()
const [filtro, setFiltro] = useState('')
@ -93,7 +95,22 @@ export default function RptCorresponsalesTraficos(props: IProps) {
ICatCorresponsales[]
>([])
const hiddenFileInputRef = useRef<HTMLInputElement>(null);
const [Deleting, setDeleting] = useState(false);
const [columnDefs] = useState([
{
field: 'acciones',
headerName: '',
width: 50,
hide: !Perfil.includes('Corresponsalias'),
cellRenderer: (params: any) => {
return (
<span style={{visibility: params.data.tieneSolicitud ? 'hidden' : 'visible'}}>
<FaTrash color='red' cursor='pointer' onClick={(e) => {setDeleting(true)}}/>
</span>
)
},
},
{ field: 'id', headerName: 'id', width: 70, sortable: true, filter: true },
{
field: 'proceso',
@ -275,8 +292,20 @@ export default function RptCorresponsalesTraficos(props: IProps) {
}, [])
function getParams(e: RowClickedEvent) {
if(Deleting){
if(e.data.pedimento > 0){
setHeader('Error')
setMsg('Favor de borrar el pedimento para poder eliminar la referencia.')
setShowMsg(true)
setDeleting(false)
return;
}
setIDTrafico(e.data.id)
setShowModalSolicitud(true)
}else{
AbreTrafico(e.data.id)
}
}
function AbreTrafico(id: number) {
dispatch(InitCorresponsalesFacturas(IDTrafico))
@ -297,7 +326,7 @@ export default function RptCorresponsalesTraficos(props: IProps) {
Pedimento: Pedimento,
Aduana: Aduana,
Patente: Patente,
Proceso: Referencia !== '' || Pedimento !== 0 || Aduana !== 0 || Patente !== 0 ? 0 : parseInt(proc.replace('proc=', '')),
Proceso: Referencia !== '' || Pedimento !== 0 || Aduana !== '0' || Patente !== 0 ? 0 : parseInt(proc.replace('proc=', '')),
Modo: modo ? parseInt(modo.replace('modo=', '')) : 0,
Referencia: Referencia
}
@ -326,7 +355,7 @@ export default function RptCorresponsalesTraficos(props: IProps) {
}
function exportExcel(jsonData: any[], fileName: string): void {
let Heading = [
/* let Heading = [
[
{
title: 'Aduana Seccion Despacho',
@ -362,20 +391,20 @@ export default function RptCorresponsalesTraficos(props: IProps) {
'Valor Comercial Ped',
'Valor Factura Item MN',
],
]
] */
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.sheet_add_aoa(ws, Heading)
XLSX.utils.sheet_add_json(ws, jsonData, { origin: 'A1', skipHeader: false })
XLSX.utils.book_append_sheet(wb, ws, 'Sheet1')
XLSX.writeFile(wb, fileName + '.xlsx')
var range = XLSX.utils.decode_range(ws['!ref?'])
/* 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 readFile = (event: any) => {
@ -421,10 +450,10 @@ export default function RptCorresponsalesTraficos(props: IProps) {
contenedor.semaforo = +element[23] === 1 ? 2 : 1
await saveTxtContenedores(contenedor);
}else{
await saveTxtContenedores({id: 0, contenedor: element[32], idTrafico: model.id , fSemaforo: element[22], semaforo: +element[23] === 1 ? 2 : 1});
await saveTxtContenedores({id: 0, contenedor: element[32], idTrafico: model.id , fSemaforo: element[22], semaforo: +element[23] === 1 ? 2 : 1,idTipoContenedor:0});
}
}else{
await saveTxtContenedores({id: 0, contenedor: element[32], idTrafico: model.id , fSemaforo: element[22], semaforo: +element[23] === 1 ? 2 : 1});
await saveTxtContenedores({id: 0, contenedor: element[32], idTrafico: model.id , fSemaforo: element[22], semaforo: +element[23] === 1 ? 2 : 1, idTipoContenedor:0});
}
})
.catch((e: Error) => {
@ -460,7 +489,13 @@ export default function RptCorresponsalesTraficos(props: IProps) {
corresponsal: model.idCorresponsal,
pedido: element[29],
code: 0,
folioGEMCO: ''
folioGEMCO: '',
uuid: '',
fechaFactura: '',
cove: '',
entrega: '',
transporte: '',
idContenedor: 0,
}).catch((e: Error) => {
setHeader('Error')
setMsg('Ocurrio un error al guardar la factura: ' + element[13])
@ -529,6 +564,10 @@ export default function RptCorresponsalesTraficos(props: IProps) {
})
}
const handleClose = () => {
setShowModalSolicitud(false)
setDeleting(false)
}
return (
<div>
<Card>
@ -560,7 +599,7 @@ export default function RptCorresponsalesTraficos(props: IProps) {
type='text'
size='sm'
placeholder='Aduana'
onChange={(e) => setAduana(+e.target.value)}
onChange={(e) => setAduana(e.target.value === '' ? '0' : e.target.value)}
/>
</Col>
<Col xs={2}>
@ -762,11 +801,46 @@ export default function RptCorresponsalesTraficos(props: IProps) {
IDTrafico={IDTrafico}
onClose={function (val: boolean): void {
setShowModal(false)
generaReporte()
}}
/>
</div>
</Modal.Body>
</Modal>
<Modal
show={ShowModalSolicitud}
dialogClassName='modal-50w'
style={{backdropFilter:'brightness(0.5)'}}
centered
onHide={handleClose}
>
<Modal.Body>
<div style={{ height: '250px', overflowX: 'hidden' }}>
<CrearSolicitud
idTrafico={IDTrafico}
idUsuario={UserId}
title='Solicitud Para Eliminar Referencia'
close={()=>{
setShowModalSolicitud(false)
setDeleting(false)
generaReporte()
if(Perfil === 'Sup. Corresponsalias'){
setHeader('Informativo');
setMsg('Referencia eliminada correctamente.')
setShowMsg(true)
return;
}
else{
setHeader('Informativo');
setMsg('Solicitud creada correctamente.')
setShowMsg(true)
return;
}
}
}/>
</div>
</Modal.Body>
</Modal>
</div>
)
}

@ -58,7 +58,7 @@ export default function RptCorresponsalesTraficosHst (props: IProps) {
const [DataCorresponsales, setDataCorresponsales] = useState<ICatCorresponsales[]>([])
const [Pedimento, setPedimento] = useState(0)
const [Patente, setPatente] = useState(0);
const [Aduana, setAduana] = useState(0);
const [Aduana, setAduana] = useState('');
const [columnDefs] = useState([
{ field: 'id', headerName: 'id', width: 70, sortable: true, filter: true },
{

@ -0,0 +1,42 @@
import { ICellRendererParams } from "ag-grid-community";
import { FC, useState, useEffect } from "react";
export const ClienteProgressBar: FC<ICellRendererParams> = (props: ICellRendererParams) => {
const [Color, setColor] = useState('progress-bar bg-CORRESPONSAL_NORMAL')
useEffect(() => {
if (props.data.proceso === 1) setColor('progress-bar bg-RECHAZOS_PARA_CORRESPONSAL')
if (props.data.proceso === 2 || props.data.proceso === 3) {
setColor('progress-bar bg-FACTURACION_LISTOS_PARA_FACTURAR')
}
if (props.data.proceso === 4) setColor('progress-bar bg-CORRESPONSAL_NORMAL')
}, [props])
const getTooltipTitle = () => {
let proceso = props.data.proceso;
switch(proceso){
case 1:
return "Por Terminar"
break;
case 2:
return "Despachado Sin Facturar"
break;
case 3:
return "Despachado Sin Facturar"
break;
case 4:
return "Despachado y Facturado"
break;
}
}
return (
<div>
<div style={{ paddingTop: '20%' }}>
<div className='progress' style={{ maxWidth: '80%' }}>
<div className={Color} style={{ width: '100%' }} data-toggle="tooltip" data-placement="bottom" title={getTooltipTitle()}></div>
</div>
</div>
</div>
)
}

@ -0,0 +1,41 @@
import React, { FC, useState } from 'react'
import { Button } from 'react-bootstrap'
import { DialogAE } from '../ArchivoElectronico/DialogAE'
import ArchivoElectronicoDataServices from '../../../Services/Catalogos/ArchivoElectronico.Services'
import IFileManager from '../../../Interfaces/Utils/IFileManager';
import FileManagerServices from '../../../Services/Utils/FileManager.Services';
interface IProps {
referencia: string;
}
export const VerDocumentos: FC<IProps> = (props) => {
const [showDialog, setShowDialog] = useState(false)
const [Archivos, setArchivos] = useState<IFileManager[]>([]);
const showDocumentos = () => {
FileManagerServices.getFileListByreferencia(props.referencia)
.then((response) => {
const filteredFileList = response.data.filter(x=> [2,10,11,12,13,14,15,19,17,18,37,38,39,41].includes(x.proceso))
setArchivos(filteredFileList)
})
.catch((e: Error) => {
console.log(e)
return
})
setShowDialog(true)
}
const closeDialog = () => {
setShowDialog(false)
}
return (
<div>
<span>
<Button onClick={() => showDocumentos()} variant='secondary'>
ver Documentos
</Button>
</span>
<DialogAE showDialog={showDialog} header={''} closeDialog={closeDialog} archivos={Archivos}/>
</div>
)
}

@ -0,0 +1,64 @@
import { useState } from "react";
import { Button, Card, Col, Form, Row } from "react-bootstrap";
import ReportesAlenService from "../../../Services/Reportes/ReportesAlen.Service";
import { MsgInformativo } from "../../Utils/Toast/msgInformativo";
export const RelacionFacturas: React.FC<{}> = () => {
const [Referencia, setReferencia] = useState('')
const [show, setShowMsg] = useState(false)
const [header, setHeader] = useState('')
const [msg, setMsg] = useState('')
const [msgColor, setMsgColor] = useState('primary')
const GetExcel = () => {
ReportesAlenService.getRelacionFacturas(Referencia)
.then(resp => {
const url = window.URL.createObjectURL(new Blob([resp.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', `RelacionFacturas_${Referencia}.xlsx`);
document.body.appendChild(link);
link.click();
}).catch(e => {
setHeader('Error')
setMsg('Ocurrio un error al generar el reporte. Por favor, intentelo de nuevo.')
setShowMsg(true)
return
})
}
return(
<>
<Row style={{height:'90vh'}} className="align-items-center justify-content-center">
<Col xs={3}>
<Card style={{width:'100%'}}>
<Card.Header><h4>Relación de Facturas</h4></Card.Header>
<Card.Body>
<Row style={{padding:'0px 20px 0px 20px'}} className="align-items-center justify-content-center">
<Form.Control
type="text"
placeholder="Referencia"
onChange={e => setReferencia(e.target.value)}
/>
</Row>
</Card.Body>
<Card.Footer style={{textAlign:'end'}}>
<Button variant="primary" title="Quitar archivo cargado" style={{marginRight:'10px'}} onClick={GetExcel}>
Generar Excel
</Button>
</Card.Footer>
</Card>
</Col>
</Row>
<MsgInformativo
show={show}
msg={msg}
header={header}
msgColor={msgColor}
closeToast={() => {
setShowMsg(false)
}}
/>
</>
)
}

@ -0,0 +1,71 @@
import { useState } from "react"
import { Button, Card, Col, Form, Row } from "react-bootstrap"
import ReportesAlenService from "../../../Services/Reportes/ReportesAlen.Service"
import { MsgInformativo } from "../../Utils/Toast/msgInformativo"
export const ReporteFacturasConsolidados:React.FC = () => {
const [Referencia, setReferencia] = useState('')
const [show, setShowMsg] = useState(false)
const [header, setHeader] = useState('')
const [msg, setMsg] = useState('')
const [msgColor, setMsgColor] = useState('primary')
const GetExcel = () => {
if(Referencia !== ''){
ReportesAlenService.getFacturasConsolidados(Referencia)
.then(resp => {
const url = window.URL.createObjectURL(new Blob([resp.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', `${Referencia}.xlsx`);
document.body.appendChild(link);
link.click();
}).catch(e => {
setHeader('Error')
setMsg('Ocurrio un error al generar el reporte. Por favor, intentelo de nuevo.')
setShowMsg(true)
return
})
}else{
setHeader('Error')
setMsg('Favor de capturar la referencia para generar el reporte.')
setShowMsg(true)
return
}
}
return(
<>
<Row style={{height:'90vh'}} className="align-items-center justify-content-center">
<Col xs={3}>
<Card style={{width:'100%'}}>
<Card.Header><h4>Reporte de Facturas</h4></Card.Header>
<Card.Body>
<Row style={{padding:'0px 20px 0px 20px'}} className="align-items-center justify-content-center">
<Form.Control
type="text"
placeholder="Referencia"
onChange={e => setReferencia(e.target.value)}
/>
</Row>
</Card.Body>
<Card.Footer style={{textAlign:'end'}}>
<Button variant="primary" title="Quitar archivo cargado" style={{marginRight:'10px'}} onClick={GetExcel}>
Generar Excel
</Button>
</Card.Footer>
</Card>
</Col>
</Row>
<MsgInformativo
show={show}
msg={msg}
header={header}
msgColor={msgColor}
closeToast={() => {
setShowMsg(false)
}}
/>
</>
)
}

@ -0,0 +1,210 @@
import { useEffect, useState } from "react";
import { Button, Card, Col, Form, Row } from "react-bootstrap";
import ReportesAlenService from "../../../Services/Reportes/ReportesAlen.Service";
import { MsgInformativo } from "../../Utils/Toast/msgInformativo";
import ClientesServices from "../../../Services/Catalogos/Clientes.Services";
import IClientes from "../../../Interfaces/Catalogos/IClientes";
import { useSelector } from "react-redux";
import { RootState } from "../../../store/store";
import ICatCorresponsales from "../../../Interfaces/Catalogos/ICatCorresponsales";
import CorresponsalesServices from "../../../Services/Catalogos/Corresponsales.Services";
import ReporteCuentasCerradasService from "../../../Services/Reportes/ReporteCuentasCerradas.Service";
export const CuentasCerradas: React.FC<{}> = () => {
const [Inicio, setInicio] = useState(currentDate(-7))
const [Fin, setFin] = useState(currentDate(0))
const [show, setShowMsg] = useState(false)
const [header, setHeader] = useState('')
const [msg, setMsg] = useState('')
const [msgColor, setMsgColor] = useState('primary')
const [TipoOperacion, setTipoOperacion] = useState(0)
const [IDCliente, setIDCliente] = useState(0)
const [Clientes, setClientes] = useState<Array<IClientes>>()
const [IDCorresponsal, setIDCorresponsal] = useState(0)
const [Corresponsales, setCorresponsales] = useState<Array<ICatCorresponsales>>()
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
}
useEffect(() => {
ClientesServices.getAllClientes(0)
.then((response) => {
//clientes = response.data;
setClientes(response.data)
})
.catch((e: Error) => {
setHeader('Error')
setMsg('Ocurrio un error: ' + e)
setShowMsg(true)
return
})
CorresponsalesServices.getAll()
.then((response) => {
setCorresponsales(response.data)
})
.catch((e: Error) => {
setHeader('Error')
setMsg('Ocurrio un error: ' + e)
setShowMsg(true)
return
})
}, [])
const GetExcel = () => {
if(IDCliente === 0 && IDCorresponsal === 0){
setHeader('Error')
setMsg('Debe seleccionar un cliente o un corresponsal')
setShowMsg(true)
return
}
ReporteCuentasCerradasService.DownloadExcel(Inicio, Fin, TipoOperacion, IDCliente, IDCorresponsal)
.then(resp => {
const url = window.URL.createObjectURL(new Blob([resp.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', `Cuentas Cerradas ${Inicio} - ${Fin}.xlsx`);
document.body.appendChild(link);
link.click();
}).catch(e => {
setHeader('Error')
setMsg('Ocurrio un error al generar el reporte. Por favor, intentelo de nuevo.')
setShowMsg(true)
return
})
}
return(
<>
<Row style={{height:'90vh'}} className="align-items-center justify-content-center">
<Col xs={6}>
<Card style={{width:'100%'}}>
<Card.Header><h4>Reporte de Cuentas Cerradas</h4></Card.Header>
<Card.Body>
<Row>
<Col xs={3}>
<Form.Label style={{width:'100%'}}>
Inicio
<Form.Control
defaultValue={Inicio}
type='date'
name='Inicio'
placeholder='Inicio'
title='Inicio'
alt='Inicio'
data-date-format='YYYY-mm-dd'
onChange={(e) => setInicio(e.target.value)}
size='sm'
/>
</Form.Label>
</Col>
<Col xs={3}>
<Form.Label style={{width:'100%'}}>
Fin
<Form.Control
defaultValue={Fin}
type='date'
name='Fin'
placeholder='Fin'
title='Fin'
alt='Fin'
onChange={(e) => setFin(e.target.value)}
size='sm'
/>
</Form.Label>
</Col>
<Col xs={3}>
<Form.Label style={{width:'100%'}}>
Tipo de Operación
<Form.Control
as="select"
onChange={(e) =>
setTipoOperacion(parseInt(e.target.value))
}
value={TipoOperacion}
className="form-select form-select-sm"
>
<option value="0">--Seleccione--</option>
<option value="1">Importacion</option>
<option value="2">Exportacion</option>
</Form.Control>
</Form.Label>
</Col>
</Row>
<Row>
<Col xs={6}>
<Form.Label>
Cliente
<Form.Control
as="select"
id="CmbCliente"
onChange={(e) => {
setIDCliente(parseInt(e.target.value))
}}
value={IDCliente}
className="form-select form-select-sm"
>
<option value="0">-SELECCIONE-</option>
{Clientes
? Clientes.map((c) => {
return (
<option key={c.sClave} value={c.sClave}>
{c.sRazonSocial}
</option>
)
})
: null}
</Form.Control>
</Form.Label>
</Col>
<Col xs={6}>
<Form.Label>
Corresponsal
<Form.Control
as="select"
id="CmbIDCorresponsal"
onChange={(e) => {
setIDCorresponsal(parseInt(e.target.value))
}}
className="form-select form-select-sm"
value={IDCorresponsal}
>
<option value="0">-SELECCIONE-</option>
{Corresponsales
? Corresponsales.map((item, index) => {
return (
<option key={item.id} value={item.id}>
{item.nombre} | {item.patente} | {item.aduana}
</option>
)
})
: ''}
</Form.Control>
</Form.Label>
</Col>
</Row>
</Card.Body>
<Card.Footer style={{textAlign:'end'}}>
<Button variant="primary" title="Quitar archivo cargado" style={{marginRight:'10px'}} onClick={GetExcel}>
Generar Excel
</Button>
</Card.Footer>
</Card>
</Col>
</Row>
<MsgInformativo
show={show}
msg={msg}
header={header}
msgColor={msgColor}
closeToast={() => {
setShowMsg(false)
}}
/>
</>
)
}

@ -0,0 +1,308 @@
import moment from "moment"
import React, { useEffect } from "react"
import { useState } from "react"
import { Button, Card, Col, Form, ProgressBar, Row } from "react-bootstrap"
import { BsFileEarmarkExcel, BsSearch } from "react-icons/bs"
import DTORptCorresponsalesTraficos from "../../../DTO/Corresponsales/DTORptCorresponsalesTraficos"
import ICatCorresponsales from "../../../Interfaces/Catalogos/ICatCorresponsales"
import IClientes from "../../../Interfaces/Catalogos/IClientes"
import CorresponsalesDataService from '../../../Services/Catalogos/Corresponsales.Services'
import { AgGridReact } from "ag-grid-react"
import { DTOReporteGeneral } from "../../../DTO/Facturacion/DTOReporteGeneral"
import ReportesFacturacionService from "../../../Services/Reportes/ReportesFacturacion.Service"
import ClientesServices from "../../../Services/Catalogos/Clientes.Services"
export const ReporteGeneralFacturacion: React.FC = () => {
const [UserId, setUserId] = useState(() => {
const stickyValue = window.localStorage.getItem('UserId')
return stickyValue !== null ? JSON.parse(stickyValue) : 0
})
const [Data, setData] = useState<DTOReporteGeneral[]>([])
const [filteredData, setFilteredData] = useState<DTOReporteGeneral[]>([])
const [Inicio, setInicio] = useState(currentDate(-365))
const [Fin, setFin] = useState(currentDate(0))
const [Corresponsal, setCorresponsal] = useState(() => {
const stickyValue = window.localStorage.getItem('IdCorresponsal')
return stickyValue !== null ? JSON.parse(stickyValue) : 0
})
const [Clientes, setClientes] = useState<Array<IClientes>>()
const [Cliente, setCliente] = useState(0)
const [header, setHeader] = useState('')
const [msg, setMsg] = useState('')
const [show, setShowMsg] = useState(false)
const gridRef = React.useRef<any>(null)
const [DataCorresponsales, setDataCorresponsales] = useState<ICatCorresponsales[]>([])
// const [Estado, setEstado] = useState(0)
const [columnDefs] = useState([
{ field: 'trafico', headerName: 'Trafico', minWidth: 70, sortable: true, resizable: true},
{ field: 'corresponsal', headerName: 'Corresponsal', minWidth: 70, sortable: true, resizable: true},
{ field: 'aduana', headerName: 'Aduana', minWidth: 70, sortable: true, resizable: true},
{ field: 'patente', headerName: 'Patente', minWidth: 70, sortable: true, resizable: true},
{ field: 'pedimentoCorresponsal', headerName: 'Pedimento Corresponsal', minWidth: 70, sortable: true, resizable: true},
{ field: 'pedimentoCorresponsalR1', headerName: 'Pedimento Corresponsal R1', minWidth: 70, sortable: true, resizable: true},
{ field: 'fechaPago', headerName: 'Fecha Pago', minWidth: 70, sortable: true, resizable: true},
{ field: 'fechaAnticipo', headerName: 'Fecha Anticipo', minWidth: 70, sortable: true, resizable: true},
{ field: 'sumaAnticipoCorresponsalFinanciado', headerName: 'Suma Anticipo Corresponsal Financiado', minWidth: 70, maxWidth:350, sortable: true, resizable: true},
{ field: 'fechaAlta', headerName: 'Fecha Alta', minWidth: 70, sortable: true, resizable: true},
{ field: 'usuarioAlta', headerName: 'Usuario Alta', minWidth: 70, sortable: true, resizable: true},
{ field: 'cliente', headerName: 'Cliente', minWidth: 70, sortable: true, resizable: true},
{ field: 'nombreCliente', headerName: 'Nombre Cliente', minWidth: 70, sortable: true, resizable: true},
{ field: 'cuenta', headerName: 'Cuenta', minWidth: 70, sortable: true, resizable: true},
{ field: 'tipoOperacion', headerName: 'Tipo Operacion', minWidth: 70, sortable: true, resizable: true},
{ field: 'terminado', headerName: 'Terminado', minWidth: 70, sortable: true, resizable: true},
{ field: 'fechaTerminado', headerName: 'Fecha Terminado', minWidth: 70, sortable: true, resizable: true},
{ field: 'fechaRegistroContabilizar', headerName: 'Fecha Registro Contabilizar', minWidth: 70, sortable: true, resizable: true},
{ field: 'fechaContabilizado', headerName: 'Fecha Contabilizado', minWidth: 70, sortable: true, resizable: true},
{ field: 'fechaFacturaCorresponsal', headerName: 'Fecha Factura Corresponsal', minWidth: 70, sortable: true, resizable: true},
{ field: 'motivoCuentaRechazada', headerName: 'Motivo Cuenta Rechazada', minWidth: 70, sortable: true, resizable: true},
{ field: 'estatusOperacion', headerName: 'Estatus Operacion', minWidth: 70, sortable: true, resizable: true},
{ field: 'cargoShipper', headerName: 'Cargo Shipper', minWidth: 70, sortable: true, resizable: true}
])
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
}
useEffect(() => {
ClientesServices.getAllClientes(0)
.then((response) => {
setClientes(response.data)
})
.catch((e: Error) => {
setHeader('Error')
setMsg('Ocurrio un error: ' + e)
setShowMsg(true)
return
})
CorresponsalesDataService.getAll()
.then((response) => {
setDataCorresponsales(response.data)
})
.catch((e: Error) => {
setHeader('Error')
setMsg('Ocurrio un error: ' + e)
setShowMsg(true)
})
generaReporte()
}, [])
const generaReporte = () => {
const data: DTORptCorresponsalesTraficos = {
Inicio: moment(Inicio).format('YYYY-MM-DD'),
Fin: moment(Fin).format('YYYY-MM-DD'),
TipoOperacion: 0,
NoCliente: Cliente,
IdCorresponsal: Corresponsal,
Pedimento: 0,
Aduana: '0',
Patente: 0,
Proceso: 0,
Modo: 0,
Referencia: ''
}
ReportesFacturacionService
.GetReporteGeneral(data)
.then((response) => {
setData(response.data)
setFilteredData(response.data)
})
.catch((e: Error) => {
return
})
}
const filtraReporte = (e: any) => {
gridRef.current.api.setQuickFilter(e.target.value)
}
const downloadExcel = () => {
const data: DTORptCorresponsalesTraficos = {
Inicio: moment(Inicio).format('YYYY-MM-DD'),
Fin: moment(Fin).format('YYYY-MM-DD'),
TipoOperacion: 0,
NoCliente: 0,
IdCorresponsal: Corresponsal,
Pedimento: 0,
Aduana: '0',
Patente: 0,
Proceso: 0,
Modo: 0,
Referencia: ''
}
ReportesFacturacionService.DownloadExcel(data)
.then(resp => {
const url = window.URL.createObjectURL(new Blob([resp.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', `ReporteFacturacion.xlsx`);
document.body.appendChild(link);
link.click();
})
}
return (
<div>
<Card>
<Card.Body>
<Row>
<Col xs={2}>
<Form.Label style={{width:'100%', fontSize:'smaller'}}>
Buscar
<Form.Control
type='text'
size='sm'
placeholder='Search...'
onChange={(e) => {
filtraReporte(e)
}}
/>
</Form.Label>
</Col>
<Col xs={2}>
<Form.Label style={{width:'100%', fontSize:'smaller'}}>
Inicio
<Form.Control
defaultValue={Inicio}
type='date'
name='Inicio'
placeholder='Inicio'
title='Inicio'
alt='Inicio'
data-date-format='YYYY-mm-dd'
onChange={(e) => setInicio(e.target.value)}
size='sm'
/>
</Form.Label>
</Col>
<Col xs={2}>
<Form.Label style={{width:'100%', fontSize:'smaller'}}>
Fin
<Form.Control
defaultValue={Fin}
type='date'
name='Fin'
placeholder='Fin'
title='Fin'
alt='Fin'
onChange={(e) => setFin(e.target.value)}
size='sm'
/>
</Form.Label>
</Col>
<Col lg={3}>
<Form.Label style={{width:'100%', fontSize:'smaller'}}>
Corresponsal
<Form.Control
as='select'
onChange={(e) => {
setCorresponsal(parseInt(e.target.value))
}}
className='form-select form-select-sm'
value={Corresponsal}
>
<option value='0'>-SELECCIONE-</option>
{DataCorresponsales
? DataCorresponsales.map((c) => {
return (
<option value={c.id} key={c.id}>
{c.nombre}
</option>
)
})
: null}
</Form.Control>
</Form.Label>
</Col>
<Col lg={3}>
<Form.Label style={{width:'100%', fontSize:'smaller'}}>
Cliente
<Form.Control
as='select'
onChange={(e) => {
setCliente(parseInt(e.target.value))
}}
className='form-select form-select-sm'
value={Cliente}
>
<option value='0'>-SELECCIONE-</option>
{Clientes
? Clientes.map((c) => {
return (
<option value={c.sClave} key={c.sClave}>
{c.sRazonSocial}
</option>
)
})
: null}
</Form.Control>
</Form.Label>
</Col>
</Row>
{/* <Row>
<Col lg={2}>
<Form.Label style={{width:'100%', fontSize:'smaller'}}>
Estado
<Form.Control
as='select'
onChange={(e) => {
setEstado(parseInt(e.target.value))
}}
className='form-select form-select-sm'
value={Estado}
>
<option value='0'>-SELECCIONE-</option>
<option value='3'>NO FACTURADO</option>
<option value='4'>FACTURADO</option>
</Form.Control>
</Form.Label>
</Col>
</Row> */}
<Row style={{paddingTop:'10px'}}>
<Col lg={12} style={{textAlign:'end'}}>
<Button
variant='primary'
size='sm'
onClick={() => {
generaReporte()
}}
style={{marginRight:'5px'}}
>
<BsSearch />
&nbsp; Buscar
</Button>
<Button
size='sm'
variant='success'
onClick={() => {
downloadExcel();
}}
style={{marginRight:'5px'}}
>
<BsFileEarmarkExcel />
&nbsp; Excel
</Button>
</Col>
</Row>
</Card.Body>
</Card>
<br />
<div className='ag-theme-alpine' style={{ height: 500, width: '100%' }}>
<AgGridReact
rowData={filteredData}
columnDefs={columnDefs}
pagination={true}
paginationAutoPageSize={true}
ref={gridRef}
rowSelection={'multiple'}
rowMultiSelectWithClick={true}
></AgGridReact>
</div>
</div>
)
}

@ -85,7 +85,7 @@ export const ReporteGC50: React.FC = () => {
NoCliente: 0,
IdCorresponsal: Corresponsal,
Pedimento: 0,
Aduana: 0,
Aduana: '0',
Patente: 0,
Proceso: 0,
Modo: 0,
@ -114,7 +114,7 @@ export const ReporteGC50: React.FC = () => {
NoCliente: 0,
IdCorresponsal: Corresponsal,
Pedimento: 0,
Aduana: 0,
Aduana: '0',
Patente: 0,
Proceso: 0,
Modo: 0,

@ -0,0 +1,372 @@
import React, { useEffect, useState } from "react"
import { Button, Card, Col, Form, Modal, Row } from "react-bootstrap"
import IClientes from "../../Interfaces/Catalogos/IClientes"
import IRpArchivoElectronicoOficial from "../../Interfaces/Reportes/IRptArchivoElectronicoOficial"
import { VerDocumentos } from "../Reportes/customCells/verDocumentos"
import { MsgInformativo } from "../Utils/Toast/msgInformativo"
import { AgGridReact } from "ag-grid-react"
import { BsSearch, BsFileEarmarkExcel, BsCloudDownload } from "react-icons/bs"
import { RowClickedEvent } from "ag-grid-community"
import IArchivoElectronico from "../../Interfaces/IArchivoElectronico"
import * as XLSX from 'xlsx'
import DTOAEPeriodo from "../../DTO/DTOAEPeriodo"
import ClientesServices from "../../Services/Catalogos/Clientes.Services"
import reportesServices from "../../Services/Reportes/reportes.services"
import loadingImg from '../../images/ajaxloader.gif'
import ArchivoElectronicoServices from "../../Services/Catalogos/ArchivoElectronico.Services"
export const ReporteArchivoElectronico:React.FC = () => {
//const dispatch = useDispatch()
const [UserId, setUserId] = useState(() => {
const stickyValue = window.localStorage.getItem('UserId')
return stickyValue !== null ? JSON.parse(stickyValue) : 0
})
const [Years, setYears] = useState(generateArrayOfYears())
const [Months, setMonths] = useState([
'Enero',
'Febrero',
'Marzo',
'Abril',
'Mayo',
'Junio',
'Julio',
'Agosto',
'Septiembre',
'Octubre',
'Noviembre',
'Diciembre',
])
const [Anio, setAnio] = useState(currentDate(1))
const [Mes, setMes] = useState(currentDate(2))
const [Clientes, setClientes] = useState<Array<IClientes>>()
const [Data, setData] = useState<Array<IRpArchivoElectronicoOficial>>([])
const [filteredData, setFilteredData] = useState<Array<IRpArchivoElectronicoOficial>>([])
const [TipoOperacion, setTipoOperacion] = useState(0)
const [Cliente, setCliente] = useState(0)
const [msgColor, setMsgColor] = React.useState('primary')
const [show, setShowMsg] = useState(false)
const [header, setHeader] = useState('')
const [msg, setMsg] = useState('')
const [filtro, setFiltro] = useState('')
const [showDialog, setShowDialog] = useState(false)
const gridRef = React.useRef<any>(null)
const [columnDefs] = useState([
{
field: 'referencia',
headerCheckboxSelection: true,
headerCheckboxSelectionFilteredOnly: true,
checkboxSelection: true,
sortable: true,
filter: true,
},
{ field: 'ver documentos', sortable: true, cellRenderer: (params: any) => {return <VerDocumentos referencia={params.data.referencia}/>} },
{ field: 'aduana', sortable: true, filter: true },
{ field: 'patente', sortable: true, filter: true },
{ field: 'pedimento', sortable: true, filter: true },
{ field: 'fechaPago', sortable: true, filter: true },
])
const handleClose = () => setShowDialog(false)
function generateArrayOfYears() {
var max = new Date().getFullYear()
var min = 2020
var years = []
for (var i = max; i >= min; i--) {
years.push(i)
}
return years
}
function currentDate(mode: number): number {
var today = new Date()
var mm = String(today.getMonth() + 1).padStart(2, '0') //January is 0!
var yyyy = today.getFullYear()
return mode === 1 ? yyyy : parseInt(mm)
}
const generaReporte = () => {
if(Anio === 0){
setHeader('Error')
setMsg('Especifique el año de búsqueda.')
setShowMsg(true)
return;
}
if(Mes === 0){
setHeader('Error')
setMsg('Especifique el mes de búsqueda.')
setShowMsg(true)
return;
}
if(Cliente===0 && Clientes!.length > 1){
setHeader('Error')
setMsg('Seleccione una razón social')
setShowMsg(true)
return;
}
const data: DTOAEPeriodo = {
Anio: Anio,
Mes: Mes,
TipoOperacion: TipoOperacion,
NoCliente: Cliente,
}
console.log(JSON.stringify(data))
reportesServices
.getRptArchivoElectronicoOficial(data)
.then((response) => {
setData(response.data)
setFilteredData(response.data)
console.log(response.data)
setHeader('Informativo')
setMsg('Se encontro la siguiente informacion...')
setShowMsg(true)
})
.catch((e: Error) => {
setHeader('Error')
setMsg('Ocurrio un error: ' + e)
setShowMsg(true)
return
})
}
const downloadExcel = () => {
exportExcel(Data, 'Reporte archivo electronico oficial')
}
function exportExcel(jsonData: any[], fileName: string): void {
let Heading = [['Referencia', 'Aduana', 'Patente', 'Pedimento', 'Fecha pago']]
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 filtraReporte = (e: any) => {
setFiltro(e.target.value)
gridRef.current.api.setQuickFilter(e.target.value)
}
useEffect(() => {
ClientesServices.getAllClientes(parseInt(UserId))
.then((response) => {
setClientes(response.data)
if(response.data.length === 1)
setCliente(response.data[0].sClave)
})
.catch((e: Error) => {
console.log(e)
setHeader('Error')
setMsg('Ocurrio un error: ' + e)
setShowMsg(true)
return
})
}, [])
/* function getParams(e: RowClickedEvent) {
const data: IArchivoElectronico = {
Referencia: e.data.referencia,
PedimentoLargo:
Anio.toString().substring(2, 2) +
' ' +
e.data.aduana.toString().substring(0, 2) +
' ' +
e.data.patente.toString() +
' ' +
e.data.pedimento.toString(),
NoCliente: Cliente,
IdUsuario: 0,
Archivo: '',
}
console.log('.......................................................' + data)
//dispatch(setArchivoElectronico(data))
} */
const downloadReferences = () => {
setShowDialog(true)
if (Cliente === 0) {
setMsg('Seleccione el cliente')
setHeader('Para poder continuar, favor de: ')
setShowMsg(true)
}
let selectedNodes = gridRef.current.api.getSelectedNodes()
let selectedData = selectedNodes.map((node: any) => node.data)
const Referencias = selectedData.map((item: IRpArchivoElectronicoOficial) => item.referencia)
const data = {
Anio: Anio,
Mes: Mes,
NoCliente: Cliente,
TipoOperacion: TipoOperacion,
Referencias: Referencias,
}
console.log(data)
ArchivoElectronicoServices.getZippedReferences(data)
.then((response: any) => {
const url = window.URL.createObjectURL(response.data)
const link = document.createElement('a')
link.href = url
link.setAttribute('download', 'Archivo Electronico Oficial.zip')
document.body.appendChild(link)
link.click()
setShowDialog(false)
})
.catch((e: Error) => {
console.log(e)
setHeader('Error')
setMsg('Ocurrio un error: ' + e)
setShowMsg(true)
return
})
}
return (
<div>
<Card>
<Card.Body>
<div className='row'>
<div className='col-md-1'></div>
<div className='col-md-1'>
<Form.Select
aria-label='Año'
onChange={(e) => setAnio(parseInt(e.target.value))}
size='sm'
defaultValue={Anio}
>
{Years.map((x, i) => (
<option value={x}>{x}</option>
))}
</Form.Select>
</div>
<div className='col-md-1'>
<Form.Select
aria-label='Mes'
onChange={(e) => setMes(parseInt(e.target.value))}
size='sm'
defaultValue={Mes}
>
<option value='0'>Mes</option>
{Months.map((x, i) => (
<option value={i + 1}>{x}</option>
))}
</Form.Select>
</div>
<div className='col-md-1 right-label'>
<Form.Label>Tipo oper</Form.Label>
</div>
<div className='col-md-1'>
<Form.Control
as='select'
onChange={(e) => setTipoOperacion(parseInt(e.target.value))}
className='form-select form-select-sm'
>
<option value='0'>- Seleccione -</option>
<option value='1'>Importacion</option>
<option value='2'>Exportacion</option>
</Form.Control>
</div>
<div className='col-md-1 right-label'>
<Form.Label>Cliente</Form.Label>
</div>
<div className='col-md-4 form-group'>
<Form.Control
as='select'
onChange={(e) => {
setCliente(parseInt(e.target.value))
}}
className='form-select form-select-sm'
value={Cliente}
>
<option value='0'>-SELECCIONE-</option>
{Clientes
? Clientes.map((c) => {
return c.agrupado === 1 ? <option value={c.sClave}>{c.sRazonSocial}</option> : ''
})
: null}
</Form.Control>
</div>
<div className='col-md-1 right-label'>
<Button
variant='primary'
size='sm'
onClick={() => {
generaReporte()
}}
>
<BsSearch />
Buscar
</Button>
</div>
</div>
<div className='row' style={{ paddingTop: 5 }}>
<div className='col'>&nbsp;</div>
<div className='col-4'>
<Form.Control
type='text'
placeholder='Search...'
size='sm'
onChange={(e) => {
filtraReporte(e)
}}
/>
</div>
<div className='col'>
<Button
size='sm'
variant='success'
onClick={() => {
downloadExcel()
}}
>
<BsFileEarmarkExcel />
&nbsp;Excel
</Button>
&nbsp; &nbsp;
<Button
variant='danger'
size='sm'
onClick={() => {
downloadReferences()
}}
>
<BsCloudDownload />
&nbsp;Descarga
</Button>
</div>
</div>
</Card.Body>
</Card>
<br />
<div className='ag-theme-alpine' style={{ height: 500, width: '100%' }}>
<AgGridReact
rowData={filteredData}
columnDefs={columnDefs}
pagination={true}
paginationAutoPageSize={true}
ref={gridRef}
rowSelection={'multiple'}
rowMultiSelectWithClick={true}
onRowClicked={(e) => {/* getParams(e) */}}
></AgGridReact>
</div>
<MsgInformativo show={show} msg={msg} header={header} msgColor={msgColor} closeToast={() => setShowMsg(false)} />
<Modal show={showDialog} onHide={handleClose} backdrop='static' keyboard={false} size='sm' centered>
<Modal.Header closeButton>
<Modal.Title></Modal.Title>
</Modal.Header>
<Modal.Body>
<img src={loadingImg} style={{ width: '50%', height: '50%' }} alt='proccessing' />
Espere, por favor...
</Modal.Body>
<Modal.Footer></Modal.Footer>
</Modal>
</div>
)
}

@ -63,16 +63,7 @@ export const FileManager: FC<IProps> = (props) => {
const formData = new FormData()
formData.append('name', file.name)
formData.append('file', file)
axios
.post(
URL.get() +
`/FileManager/AppendFileByProcess?IdUsuario=${props.IDUser}&Proceso=${props.IDProcess}&Tags=${props.IdFile}&crud=1`,
formData, {
headers:{
'Authorization': 'Bearer ' + token
}
}
)
FileManagerDataService.AppendFile(formData, props.IDUser, props.IDProcess, props.IdFile)
.then((res) => {
if (res.data.id > 0) {
setArchivo(res.data)
@ -194,7 +185,9 @@ export const FileManager: FC<IProps> = (props) => {
<>
<div>
<div
{...getRootProps()}
{...getRootProps({
onClick: event => !props.canDelete ? event.stopPropagation() : ''
})}
className={Archivo?.nombreArchivo ? 'hideDiv' : 'dropzoneFileManager'}
style={{
width: props.width,

@ -5,8 +5,9 @@ export default interface DTOFiltrosTraficosClientes {
NoCliente: number;
IdCorresponsal: number;
Pedimento: number;
Aduana: number;
Aduana: string;
Patente: number;
Referencia: string;
IdUsuario: number;
Estado: number;
}

@ -1,7 +1,7 @@
export interface DTOPedimentosConsolidados{
id:number
idTrafico: number
aduana: number
aduana: string
patente: number
pedimento: number
clave: string

@ -1,4 +1,15 @@
export default interface DTORectificacionHistorico {
IdTrafico: number,
IdUsuario: number
IdUsuario: number,
IdPedimento: number,
Aduana: string,
Patente:number,
Pedimento: number,
Clave: string,
FechaPago: string,
AduanaH: string,
PatenteH: number,
PedimentoH: number,
ClaveH: string,
FechaPagoH: string
}

@ -5,7 +5,7 @@ export default interface DTORptCorresponsalesTraficos {
NoCliente: number;
IdCorresponsal: number;
Pedimento: number;
Aduana: number;
Aduana: string;
Patente: number;
Proceso: number;
Modo: number;

@ -1,6 +1,6 @@
export default interface DTOTraficoCompleto {
id: number,
idUsuario: number,
estatus: number,
pedimentoObligatorio: number,
comentarios: string
}

@ -0,0 +1,9 @@
export interface DTOTraficoSolicitud{
id: number,
idTrafico: number,
idUsuarioSolicita: number,
usuarioSolicita: string,
motivoSolicita: string,
fechaSolicita: string,
estado: number
}

@ -0,0 +1,48 @@
export interface DTOEstadoCuentaAlen{
id: number,
tipoMovimiento: string
noSerie: string
noMovimiento: string
trafico: string
impexp: string
aduana: string
patente: string
pedimento: string
clave: string
noCliente: string
noCentro: string
subCentro: string
nombre: string
subCtaNombre: string
tipoRangos: string
cargos: string
abonos: string
fecha: string
fechaPedimento: string
fechaRev: string
diasPedimCta: string
diasCtaRev: string
diasRev: string
ivaAl: string
totalFacturado: string
saldoFinal: string
anticipo: string
uuid: string
descripcion: string
remitente: string
pedido: string
tipoMercancia: string
campoAdicional5: string
idPdf:number
pdf: string
idXml:number
xml: number
idNotasCargo: number
notasCargo: string
programado: boolean
serie: string
idOrdenCompra: number
ordenCompra: string
idObservaciones: number
observaciones: string
}

@ -0,0 +1,11 @@
export interface DTOEstadoCuentaAlenFilters{
Trafico: string,
Impexp: string,
Aduana: string,
Patente: string,
Pedimento: string,
Inicio: string,
Fin: string,
Remitente: string,
Programado: number
}

@ -0,0 +1,29 @@
export interface DTOReporteGeneral{
trafico: string;
corresponsal: string;
aduana: string;
patente: number;
pedimentoCorreponsal: string;
pedimentoCorresponsalR1: string;
fechaPago: string;
fechaAnticipo: string;
sumaanticipoCorresponsalFinanciado: number;
fechaAlta: string;
usuarioAlta: string;
cliente: number;
nombrecliente:number;
cuenta: string;
tipoOperacion: string;
terminado: string;
fechaRegistroContabilizar: string;
fechaContabilizado: string;
fechaFacturado: string;
fechaFacturaCorresponsal: string;
fechaCruce: string;
motivoCuentaRechazadaContabilidad: string;
motivoCuentaRechazadaFacturacion: string;
motivoSolicitaReapertura: string;
solicitudReaperturaAutorizada: string;
estatusOperacion: string;
cargoShipper: string;
}

@ -0,0 +1,21 @@
export interface DTOReporteCuentasCerradas{
Trafico: string,
TipoOperacion: string,
Cliente: string,
Proveedor: string,
Corresponsal: string,
Aduana: string,
Patente: string,
Pedimento: string,
FechaPago: string,
Facturas: string,
Descripcion: string,
FechaAlta: string,
Clave: string,
ValorMn: string,
ValorDls: string,
TipoCambio: string,
ValorComercial: string,
Fracciones: string,
Caja: string
}

@ -1,7 +1,7 @@
export interface DTOReporteGC50{
trafico: string;
corresponsal: string;
aduana: number;
aduana: string;
patente: number;
pedimentoCorreponsal: string;
pedimentoCorresponsalR1: string;

@ -2,6 +2,6 @@ export default interface ICatCorresponsales {
id: number;
nombre: string;
patente: number,
aduana: number;
aduana: string;
correos: string
}

@ -0,0 +1,4 @@
export interface ICatTiposContenedores{
id: number;
descripcion: number;
}

@ -2,4 +2,7 @@ export default interface ITabulador {
id: number,
idCliente: number
nombre: string
idCorresponsal?: number
tipo: number
moneda: number
}

@ -5,4 +5,5 @@ export default interface ITabuladorConceptos {
concepto: string,
costo: number,
activo: number
costoCorresponsal:number
}

@ -4,5 +4,6 @@ export default interface ICorresponsalContenedores {
idTrafico: number,
fSemaforo: string,
semaforo: number,
idTipoContenedor: number,
activo?: boolean
}

@ -9,4 +9,10 @@ export default interface ICorresponsalFacturas {
activo?: boolean;
code: number;
folioGEMCO: string;
fechaFactura?: string;
uuid?: string;
cove?: string;
entrega?: string;
transporte?: string;
idContenedor?: number;
}

@ -2,11 +2,12 @@ export default interface ICorresponsalRectificacionHistorico {
id: number
usuario: number
idTrafico: number
aduana: number
aduana: string
patente: number
pedimento: number
clave: string
fechaPago: string
fhCreacion: string
activo: number
activo: number,
idPedimentoConsolidado: number
}

@ -12,7 +12,7 @@ export default interface ICorresponsalTrafico {
kilos?: number
estatus?: number
trafico?: string
aduana?: number
aduana?: string
patente?: number
pedimento?: number
clave?: string
@ -45,4 +45,6 @@ export default interface ICorresponsalTrafico {
causaRectificacion: string,
totalHonorariosAA: number;
totalGastosTerceros: number;
tieneSolicitud: number;
pedimentoObligatorio: number;
}

@ -4,6 +4,7 @@ export default interface ICorresponsalesTraficoContabilidad {
idTrafico: number,
statusProceso: number,
fechaRegistro: string,
razonRechazo: string
tipo: number
razonRechazo: string,
NuevoProceso: number,
ProcesoAnterior: number
}

@ -0,0 +1,11 @@
export interface ICorresponsalTraficoSolicitud{
id:number,
idTrafico: number,
idUsuarioSolicita: number,
fechaSolicita?: string,
motivoSolicita: string,
idUsuarioAutoriza: number,
fechaAutoriza?: string,
motivoRechazo: string,
estado: number
}

@ -1,5 +1,5 @@
export default interface IReporteOperacionesNewell{
aduana: number; patente: number; pedimento: number; fechaDeEntrada: string|Date; fechaDePago: string|Date;
aduana: string; patente: number; pedimento: number; fechaDeEntrada: string|Date; fechaDePago: string|Date;
valorComercialMxn: number; valorComercialDlls: number; valorAduana: number; clave: string; iva: number;
dta: number; prv: number; lgi: number; factura: string; tc: number; proveedor: string; taxId: number; producto: string;
gc:number; contenedor: string; cuentaDeGastos: string; razon: string; maniobras: number;

@ -8,7 +8,7 @@ import http from "../common/http-common";
class ArchivoElectronicoDataService {
getFile(data: IArchivoElectronico) {
/* getFile(data: IArchivoElectronico) {
return http.get<Blob>(`/ArchivoElectronico/getFile`, { params: data })
}
getFileList(data: IArchivoElectronico) {
@ -55,6 +55,16 @@ class ArchivoElectronicoDataService {
.catch(function (error) {
console.log(error)
})
} */
getZippedReferences(data : DTOAEPeriodo) {
return http.post<Blob>("/ArchivoElectronico/DownloadZippedArchivosOficiales", data, {responseType: 'blob'})
.then(function (response) {
return response
})
.catch(function (error) {
console.log(error)
})
}
}
export default new ArchivoElectronicoDataService();

@ -35,7 +35,11 @@ class ClientesDataService {
}
GetTraficos(data: DTOFiltrosTraficosClientes){
return http.get<ICorresponsalTrafico[]>(`/Clientes/Traficos?Inicio=${data.Inicio}&Fin=${data.Fin}&TipoOperacion=${data.TipoOperacion}&NoCliente=${data.NoCliente}&IdCorresponsal=${data.IdCorresponsal}&Pedimento=${data.Pedimento}&Aduana=${data.Aduana}&Patente=${data.Patente}&Referencia=${data.Referencia}&IdUsuario=${data.IdUsuario}`)
return http.get<ICorresponsalTrafico[]>(`/Clientes/Traficos?Inicio=${data.Inicio}&Fin=${data.Fin}&TipoOperacion=${data.TipoOperacion}&NoCliente=${data.NoCliente}&IdCorresponsal=${data.IdCorresponsal}&Pedimento=${data.Pedimento}&Aduana=${data.Aduana}&Patente=${data.Patente}&Referencia=${data.Referencia}&IdUsuario=${data.IdUsuario}&Estado=${data.Estado}`)
}
GetExcel(data: DTOFiltrosTraficosClientes){
return http.get(`/Clientes/Excel?Inicio=${data.Inicio}&Fin=${data.Fin}&TipoOperacion=${data.TipoOperacion}&NoCliente=${data.NoCliente}&IdCorresponsal=${data.IdCorresponsal}&Pedimento=${data.Pedimento}&Aduana=${data.Aduana}&Patente=${data.Patente}&Referencia=${data.Referencia}&IdUsuario=${data.IdUsuario}&Estado=${data.Estado}`,{responseType: 'blob'})
}
}
export default new ClientesDataService();

@ -0,0 +1,10 @@
import http from "../common/http-common";
import { ICatTiposContenedores } from "../../Interfaces/Catalogos/ICatTiposContenedores";
class CatTiposContenedoresService{
getAll(){
return http.get<ICatTiposContenedores[]>('/Catalogos/CatTiposContenedores/');
}
}
export default new CatTiposContenedoresService();

@ -3,9 +3,9 @@ import ICorresponsalesTraficoContabilidad from '../../Interfaces/Corresponsales/
import ICorresponsalRazonRechazo from '../../Interfaces/Corresponsales/ICorresponsalRazonesRechazo'
class Contabilidad_Corresponsales_DataService {
Get(idTrafico: number, tipo: number) {
Get(idTrafico: number, nuevoProceso: number, procesoAnterior: number) {
return http.get<ICorresponsalRazonRechazo[]>(
`/Contabilidad/Corresponsales/ContabilidadTrafico/Get?idTrafico=${idTrafico}&tipo=${tipo}`
`/Contabilidad/Corresponsales/ContabilidadTrafico/Get?idTrafico=${idTrafico}&nuevoProceso=${nuevoProceso}&procesoAnterior=${procesoAnterior}`
)
}
Append(data: ICorresponsalesTraficoContabilidad) {
@ -14,5 +14,8 @@ class Contabilidad_Corresponsales_DataService {
data
)
}
GetHistorial(idTrafico: number){
return http.get<ICorresponsalRazonRechazo[]>(`/Contabilidad/Corresponsales/ContabilidadTrafico/Historial?idTrafico=${idTrafico}`);
}
}
export default new Contabilidad_Corresponsales_DataService()

@ -15,5 +15,8 @@ class Corresponsales_Facturas_DataService {
GetExcel(idTrafico: number){
return http.get(`/Corresponsalias/Facturas/GetExcel?idTrafico=${idTrafico}`, {responseType:'blob'})
}
AppendContenedor(idFactura: number, idContenedor: number){
return http.post(`/Corresponsalias/Facturas/AppendContenedor`, {IdFactura: idFactura, IdContenedor: idContenedor})
}
}
export default new Corresponsales_Facturas_DataService();

@ -10,8 +10,8 @@ class Corresponsales_Tabuladores_DataService {
GetAll() {
return http.get<ITabulador[]>(`/Catalogos/Tabulador/getAll?id=0&IdCliente=0`);
}
GetByCustomer(IdCliente: number) {
return http.get<ITabulador[]>(`/Catalogos/Tabulador/getAll?IdCliente=${IdCliente}`);
GetByCustomer(IdCliente: number, IdCorresponsal: number | null) {
return http.get<ITabulador[]>(`/Catalogos/Tabulador/getAll?IdCliente=${IdCliente}&IdCorresponsal=${IdCorresponsal}`);
}
Append(data: ITabulador) {
return http.post<ITabulador>("/Catalogos/Tabulador/Append", data);

@ -33,14 +33,17 @@ class Corresponsales_Trafico_DataService {
return http.put<IRespuesta>(`/Corresponsalias/Traficos/ValidateComplete/${data.id}`,data);
}
AppendRectificacionHistorico(data: DTORectificacionHistorico) {
return http.post<Boolean>(`Corresponsalias/Traficos/Rectificacion/Historico/Append`,data);
return http.post<ICorresponsalRectificacionHistorico>(`Corresponsalias/Traficos/Rectificacion/Historico/Append`,data);
}
GetRectificacionHistorico(IdTrafico: number) {
return http.get<ICorresponsalRectificacionHistorico>(`Corresponsalias/Traficos/Rectificacion/Historico/Get?IdTrafico=${IdTrafico}`);
return http.get<ICorresponsalRectificacionHistorico[]>(`Corresponsalias/Traficos/Rectificacion/Historico/Get?IdTrafico=${IdTrafico}`);
}
ValidaTraficoDuplicado(aduana: number | undefined, patente: number | undefined, pedimento:number | undefined, IdTrafico: number | undefined){
ValidaTraficoDuplicado(aduana: string | undefined, patente: number | undefined, pedimento:number | undefined, IdTrafico: number | undefined){
return http.get<String>(`Corresponsalias/Traficos/Duplicado?aduana=${aduana}&patente=${patente}&pedimento=${pedimento}&idTrafico=${IdTrafico}`)
}
AppendFacturasContenedoresAlen(idTrafico:number, fileId:number){
return http.post(`/Corresponsalias/Traficos/Append/LayoutAlen?idTrafico=${idTrafico}&fileId=${fileId}`);
}
}
export default new Corresponsales_Trafico_DataService();

@ -0,0 +1,19 @@
import { DTOTraficoSolicitud } from "../../DTO/Corresponsales/DTOTraficoSolicitud"
import { ICorresponsalTraficoSolicitud } from "../../Interfaces/Corresponsales/ICorresponsalTraficoSolicitud"
import http from "../common/http-common";
class TraficoSolicitudServices {
AppendSolicitudReapertura(solicitud: ICorresponsalTraficoSolicitud){
return http.post<ICorresponsalTraficoSolicitud>(`/Corresponsalias/Solicitudes/Reapertura/Append`, solicitud)
}
AppendSolicitudEliminarReferencia(solicitud: ICorresponsalTraficoSolicitud){
return http.post<ICorresponsalTraficoSolicitud>(`/Corresponsalias/Solicitudes/EliminarCuenta/Append`, solicitud)
}
GetSolicitudReapertura(idTrafico: number){
return http.get<DTOTraficoSolicitud>(`/Corresponsalias/Solicitudes/Reapertura/Get?idTrafico=${idTrafico}`)
}
GetSolicitudEliminarReferencia(idTrafico: number){
return http.get<DTOTraficoSolicitud>(`/Corresponsalias/Solicitudes/EliminarCuenta/Get?idTrafico=${idTrafico}`)
}
}
export default new TraficoSolicitudServices()

@ -2,11 +2,17 @@ import http from "../common/http-common";
import DashboardCorresponsales from "../../Interfaces/Dashboard/DashboardCorresponsales";
class Dashboard_Corresponsales_DataService {
getDisk() {
return http.get<DashboardCorresponsales>(`/Dashboard/Corresponsales/GetDiskUsage`);
}
getCorresponsales() {
return http.get<DashboardCorresponsales[]>(`/Dashboard/Corresponsales/Get`);
}
getTipoCambio(Fecha: string) {
return http.get<number>(`/Dashboard/Corresponsales/GetTipoCambio?Fecha=${Fecha}`);
}
getSolicitudesEliminarCuenta(){
return http.get<DashboardCorresponsales>(`/Dashboard/Corresponsales/SolicitudesEliminarCuenta`);
}
}
export default new Dashboard_Corresponsales_DataService();

@ -5,5 +5,8 @@ class Dashboard_Facturacion_DataService {
getFacturacion(){
return http.get<DashboardCorresponsales[]>(`/Dashboard/Corresponsales/GetFacturacionDashboard`);
}
getSolicitudesReapertura(){
return http.get<DashboardCorresponsales>(`/Dashboard/Corresponsales/SolicitudesReapertura`);
}
}
export default new Dashboard_Facturacion_DataService();

@ -0,0 +1,41 @@
import { DTOEstadoCuentaAlen } from "../../DTO/EstadosCuenta/DTOEstadoCuentaAlen";
import { DTOEstadoCuentaAlenFilters } from "../../DTO/EstadosCuenta/DTOEstadosCuentaAlenFilters";
import http from "../common/http-common";
class EstadosCuentaAlenService {
Append(formData: FormData){
return http.post<DTOEstadoCuentaAlen[]>(`ReporteEstadosCuentaAlen/Append`,formData,{
headers:{
"Content-Type":'multipart/form-data'
}
})
}
AppendOrdenCompra(data:DTOEstadoCuentaAlen){
return http.post<DTOEstadoCuentaAlen[]>(`ReporteEstadosCuentaAlen/AppendOrdenCompra`,data)
}
AppendObservaciones(data:DTOEstadoCuentaAlen){
return http.post<DTOEstadoCuentaAlen[]>(`ReporteEstadosCuentaAlen/AppendObservaciones`,data)
}
AppendProgramacionesPago(formData: FormData){
return http.post<DTOEstadoCuentaAlen[]>(`ReporteEstadosCuentaAlen/AppendProgramacionesPago`,formData,{
headers:{
"Content-Type":'multipart/form-data'
}
})
}
GetAll(filters: DTOEstadoCuentaAlenFilters){
return http.get<DTOEstadoCuentaAlen[]>(`ReporteEstadosCuentaAlen/GetAll`, {
params:filters
})
}
ExportEstadosCuenta(cuentas: DTOEstadoCuentaAlen[]){
return http.post(`ReporteEstadosCuentaAlen/Export`, cuentas, {responseType: 'arraybuffer'})
}
}
export default new EstadosCuentaAlenService();

@ -0,0 +1,8 @@
import http from "../common/http-common";
class ReporteGC50Service{
DownloadExcel(Inicio: string, Fin: string, TipoOperacion: number, NoCliente: number, IdCorresponsal: number){
return http.get(`ReporteCuentasCerradas/GetExcel?Inicio=${Inicio}&Fin=${Fin}&TipoOperacion=${TipoOperacion}&NoCliente=${NoCliente}&IdCorresponsal=${IdCorresponsal}`, {responseType: 'blob'});
}
}
export default new ReporteGC50Service();

@ -0,0 +1,13 @@
import http from '../common/http-common';
class ReportesAlenService{
getRelacionFacturas(referencia: string){
return http.get(`ReportesAlen/RelacionFacturas?referencia=${referencia}`, {responseType: 'blob'});
}
getFacturasConsolidados(referencia: string){
return http.get(`ReportesAlen/FacturasConsolidados?referencia=${referencia}`, {responseType: 'blob'});
}
}
export default new ReportesAlenService();

@ -0,0 +1,16 @@
import http from "../common/http-common";
import DTORptCorresponsalesTraficos from "../../DTO/Corresponsales/DTORptCorresponsalesTraficos";
import { DTOReporteGeneral } from "../../DTO/Facturacion/DTOReporteGeneral";
class ReportesFacturacionService{
GetReporteGeneral(data: DTORptCorresponsalesTraficos){
return http.get<DTOReporteGeneral[]>(`ReportesFacturacion/CuentasFacturadas?Inicio=${data.Inicio}&Fin=${data.Fin}&TipoOperacion=${data.TipoOperacion}&NoCliente=${data.NoCliente}&IdCorresponsal=${data.IdCorresponsal}&Pedimento=${data.Pedimento}&Aduana=${data.Aduana}&Patente=${data.Patente}&Proceso=${data.Proceso}&Modo=${data.Modo}`)
}
DownloadExcel(data: DTORptCorresponsalesTraficos){
return http.get(`ReportesFacturacion/FacturacionExcel?Inicio=${data.Inicio}&Fin=${data.Fin}&TipoOperacion=${data.TipoOperacion}&NoCliente=${data.NoCliente}&IdCorresponsal=${data.IdCorresponsal}&Pedimento=${data.Pedimento}&Aduana=${data.Aduana}&Patente=${data.Patente}&Proceso=${data.Proceso}&Modo=${data.Modo}`, {responseType: 'blob'});
}
}
export default new ReportesFacturacionService()

@ -3,9 +3,20 @@ import IRespuesta from "../../Interfaces/IRespuesta";
import IFileManager from "../../Interfaces/Utils/IFileManager";
class FileManagerDataService {
AppendFile(formData: FormData, IDUser: number, IDProcess: number, IdFile: number){
return http.post(`/FileManager/AppendFileByProcess?IdUsuario=${IDUser}&Proceso=${IDProcess}&Tags=${IdFile}&crud=1`, formData,
{
headers:{
"Content-Type":'multipart/form-data'
},
maxContentLength: Infinity,
maxBodyLength: Infinity
}
)
}
getFileContent(id: number, Proceso: number) {
return http.get<ArrayBuffer>(`/FileManager/getFile?id=${id}&proceso=${Proceso}`, {responseType: 'arraybuffer'})
return http.get(`/FileManager/getFile?id=${id}&proceso=${Proceso}`, {responseType: 'arraybuffer'})
.then(function (response) {
return response
})
@ -40,6 +51,18 @@ class FileManagerDataService {
console.log(error)
})
}
getFileListByreferencia(referencia: string) {
return http.get<IFileManager[]>(`/FileManager/FileListByReferencia?Referencia=${referencia}`)
}
getAEO(serie: string, noMovimiento: string, mime: string, trafico: string) {
return http.get(`/FileManager/GetAEO?serie=${serie}&noMovimiento=${noMovimiento}&fileMime=${mime}&trafico=${trafico}`, {responseType: 'arraybuffer'})
.then(function (response) {
return response
})
.catch(function (error) {
console.log(error)
})
}
}
export default new FileManagerDataService();

@ -9,6 +9,11 @@
padding: 5px 5px 5px 5px;
}
.modal-30w {
width: 31%;
max-width: none !important;
}
.modal-50w {
width: 50%;
max-width: none !important;
@ -19,6 +24,11 @@
max-width: none !important;
}
.modal-85w {
width: 85%;
max-width: none !important;
}
.modal-90w {
width: 90%;
max-width: none !important;
@ -162,7 +172,10 @@
padding-left: 10px;
font-family: Verdana, Geneva, Tahoma, sans-serif;
font-size: 12px;
cursor: pointer;
}
.pointer{
cursor:pointer
}
/* li:hover {

@ -27,6 +27,12 @@ import { ReportesEmbarques } from './Components/ReportesClientes/Embarques/Repor
import { ClientesExternos } from './Components/Clientes/Clientes'
import { ReporteGC50 } from './Components/ReportesClientes/GC50/ReporteGC50'
import RptClientesTraficos from './Components/Clientes/Traficos/RptClientesTraficos'
import { RelacionFacturas } from './Components/ReportesClientes/Alen/RelacionFacturas'
import { ReporteFacturasConsolidados } from './Components/ReportesClientes/Alen/ReporteFacturasConsolidados'
import { CuentasCerradas } from './Components/ReportesClientes/CuentasCerradas.tsx/CuentasCerradas'
import { ReporteArchivoElectronico } from './Components/ReportesClientes/ReporteArchivoElectronico'
import { EstadosCuenta } from './Components/EstadosCuenta/EstadosCuenta'
import { ReporteGeneralFacturacion } from './Components/ReportesClientes/Facturacion/ReporteGeneral'
require (`./css/${process.env.REACT_APP_ENVIRONMENT}-home.css`)
function PageNotFound() {
@ -63,10 +69,10 @@ root.render(
/>
}
/>
<Route
{/* <Route
path="/DashboardCorresponsales"
element={<DashboardCorresponsales />}
/>
/> */}
<Route path="/Dashboard" element={<Dashboard />} />
<Route
path="/RptCorresponsalesTraficos/:proc/:modo"
@ -84,6 +90,13 @@ root.render(
<Route path='/Reportes/Newell/Semanal' element={<ReporteSemanalNewell/>}/>
<Route path='/Reportes/Newell/Mensual' element={<ReporteMensualNewell/>}/>
<Route path='/Reportes/GC50' element={<ReporteGC50/>}/>
<Route path='/Reportes/CuentasCerradas' element={<CuentasCerradas/>}/>
<Route path='/Reportes/Alen' element={<Outlet/>}>
<Route path='/Reportes/Alen/RelacionFacturas' element={<RelacionFacturas/>}/>
<Route path='/Reportes/Alen/FacturasConsolidados' element={<ReporteFacturasConsolidados/>}/>
</Route>
<Route path='/Reportes/ArchivoElectronico/' element={<ReporteArchivoElectronico/>}/>
<Route path='/Reportes/Facturacion/ReporteGeneral/' element={<ReporteGeneralFacturacion/>}/>
</Route>
<Route path="Clientes" element={<Outlet/>}>{/*Aqui van todas las rutas relacionadas a los clientes */}
<Route path='/Clientes/Reportes/' element={<ClientesExternos/>}>{/*Aqui van todas las rutas relacionadas a los reportes de los clientes*/}
@ -92,6 +105,7 @@ root.render(
</Route>
</Route>
<Route path='/Clientes/Traficos/' element={<RptClientesTraficos/>}/>
<Route path='/Clientes/EstadosCuenta/' element={<EstadosCuenta/>}/>
</Route>
</Route>
</Routes>

@ -1,6 +1,6 @@
import { createSlice, PayloadAction } from '@reduxjs/toolkit'
import ICatCorresponsales from '../../../Interfaces/Catalogos/ICatCorresponsales';
const CatCorresponsales: ICatCorresponsales[] = [{id:0, nombre:'-Seleccione-', patente:0, aduana:0, correos:''}]
const CatCorresponsales: ICatCorresponsales[] = [{id:0, nombre:'-Seleccione-', patente:0, aduana:'0', correos:''}]
const initialState = { CatCorresponsales }
export const CatCorresponsalesSlice = createSlice({

@ -0,0 +1,21 @@
import { createSlice, PayloadAction } from '@reduxjs/toolkit'
import { ICatTiposContenedores } from '../../../Interfaces/Catalogos/ICatTiposContenedores'
const CatTiposContenedores: ICatTiposContenedores[] = []
const initialState = {CatTiposContenedores}
export const CatTiposContenedoresSlice = createSlice({
name: 'CatTiposContenedores',
initialState: initialState,
reducers: {
populateCatTiposContenedores : (state, action: PayloadAction<ICatTiposContenedores[]>) => {
state.CatTiposContenedores = []
state.CatTiposContenedores.push(... action.payload)
},
}
})
export const {
populateCatTiposContenedores,
} = CatTiposContenedoresSlice.actions;
export default CatTiposContenedoresSlice.reducer;

@ -1,6 +1,6 @@
import { createSlice, PayloadAction } from '@reduxjs/toolkit'
import ICorresponsalContenedores from '../../../Interfaces/Corresponsales/ICorresponsalContenedores';
const CorresponsalesContenedores: ICorresponsalContenedores[] = [{id:0, contenedor:'-Seleccione-', idTrafico:0, fSemaforo:'', semaforo:0}]
const CorresponsalesContenedores: ICorresponsalContenedores[] = [{id:0, contenedor:'-Seleccione-', idTrafico:0, fSemaforo:'', semaforo:0, idTipoContenedor:0}]
const initialState = { CorresponsalesContenedores }
export const CorresponsalesContenedoresSlice = createSlice({
@ -26,7 +26,7 @@ export const CorresponsalesContenedoresSlice = createSlice({
},
InitCorresponsalesContenedores : (state, action: PayloadAction<number>) => {
//state.CorresponsalesContenedores.splice(0,state.CorresponsalesContenedores.length-1)
state.CorresponsalesContenedores=[{id:0, contenedor:'-Seleccione-', idTrafico:0, fSemaforo:'', semaforo:0}]
state.CorresponsalesContenedores=[{id:0, contenedor:'-Seleccione-', idTrafico:0, fSemaforo:'', semaforo:0, idTipoContenedor:0}]
},
addTxtContenedores: (state, action: PayloadAction<ICorresponsalContenedores[]>) => {
const newArr = [...state.CorresponsalesContenedores, ...action.payload]

@ -10,6 +10,12 @@ const CorresponsalesFacturas: ICorresponsalFacturas[] = [
pedido: '',
code: 0,
folioGEMCO: '',
uuid: '',
fechaFactura: '',
cove: '',
entrega: '',
transporte: '',
idContenedor: 0,
},
];
const initialState = { CorresponsalesFacturas };
@ -32,6 +38,12 @@ export const CorresponsalesFacturasSlice = createSlice({
pedido: '',
code: 0,
folioGEMCO: '',
uuid: '',
fechaFactura: '',
cove: '',
entrega: '',
transporte: '',
idContenedor: 0,
},
];
state.CorresponsalesFacturas.push(...action.payload);
@ -73,6 +85,12 @@ export const CorresponsalesFacturasSlice = createSlice({
pedido: '',
code: 0,
folioGEMCO: '',
uuid: '',
fechaFactura: '',
cove: '',
entrega: '',
transporte: '',
idContenedor: 0,
},
];
},

@ -0,0 +1,40 @@
import ICorresponsalRectificacionHistorico from "../../../Interfaces/Corresponsales/ICorresponsalRectificacionHistorico";
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
const RectificacionesPedimentos: ICorresponsalRectificacionHistorico[] = []
const initialState = {RectificacionesPedimentos};
export const RectificacionesPedimentosSlice = createSlice({
name: 'RectificacionesPedimentos',
initialState: initialState,
reducers: {
populateRectificaciones : (state, action: PayloadAction<ICorresponsalRectificacionHistorico[]>) => {
state.RectificacionesPedimentos = []
state.RectificacionesPedimentos.push(... action.payload)
},
addRectificacion : (state, action: PayloadAction<ICorresponsalRectificacionHistorico>) => {
var Existe = state.RectificacionesPedimentos.find(function(item) {
return item.id === action.payload.id;
});
if (!Existe) state.RectificacionesPedimentos.push(action.payload)
},
updateRectificacion : (state, action: PayloadAction<ICorresponsalRectificacionHistorico>) => {
const i = state.RectificacionesPedimentos.findIndex(_element => _element.id === action.payload.id);
if (i > -1) state.RectificacionesPedimentos[i] = action.payload;
else state.RectificacionesPedimentos.push(action.payload);
},
deleteRectificacion : (state, action: PayloadAction<number>) => {
const newArr = state.RectificacionesPedimentos.filter(data => data.id != action.payload);
state.RectificacionesPedimentos=newArr
},
}
})
export const { populateRectificaciones,
addRectificacion,
updateRectificacion,
deleteRectificacion,
} = RectificacionesPedimentosSlice.actions;
export default RectificacionesPedimentosSlice.reducer;

@ -14,7 +14,7 @@ const CorresponsalesTrafico: ICorresponsalTrafico[] = [{
kilos: 0,
estatus: 0,
trafico: '',
aduana: 0,
aduana: '0',
patente: 0,
pedimento: 0,
clave: '',
@ -46,7 +46,9 @@ const CorresponsalesTrafico: ICorresponsalTrafico[] = [{
cargoA: 0,
causaRectificacion: '',
totalHonorariosAA: 0,
totalGastosTerceros: 0
totalGastosTerceros: 0,
tieneSolicitud: 0,
pedimentoObligatorio: 1
}]
const initialState = { CorresponsalesTrafico }

@ -2,7 +2,8 @@ import { createSlice, PayloadAction } from '@reduxjs/toolkit'
import type { RootState } from '../../store'
const initialState = {
value: false
isLogged: false,
isAlenUser: false,
}
export const userStatusSlice = createSlice({
@ -10,11 +11,15 @@ export const userStatusSlice = createSlice({
initialState,
reducers: {
logued: (state, action: PayloadAction<boolean>) => {
state.value = action.payload;
state.isLogged = action.payload;
},
IsAlenUser: (state, action: PayloadAction<boolean>) => {
state.isAlenUser = action.payload;
}
},
})
export const { logued } = userStatusSlice.actions;
export const selectuserStatus = (state: RootState) => state.userStatus.value
export const { IsAlenUser } = userStatusSlice.actions;
//export const selectuserStatus = (state: RootState) => state.userStatus.value
export default userStatusSlice.reducer;

@ -11,6 +11,8 @@ import CorresponsalesGuiasSlice from './features/Corresponsales/CorresponsalesGu
import CorresponsalesPartidasSlice from './features/Corresponsales/CorresponsalesPartidasSlice'
import CorresponsalesCuentasComplementariasEstatusSlice from './features/Corresponsales/CorresponsalesCuentasComplementariasEstatusSlice'
import PedimentosConsolidadosSlice from './features/Corresponsales/CorresponsalesPedimentosConsolidadosSlice'
import RectificacionesPedimentosSlice from './features/Corresponsales/CorresponsalesPedimentosRectificacionesSlice'
import CatTiposContenedoresSlice from './features/CatTiposContenedores/CatTiposContenedoresSlice'
export const store = configureStore({
@ -26,7 +28,9 @@ export const store = configureStore({
CGuias: CorresponsalesGuiasSlice,
CPartidas: CorresponsalesPartidasSlice,
CCueCompEstatus : CorresponsalesCuentasComplementariasEstatusSlice,
CPedimentosConsolidados: PedimentosConsolidadosSlice
CPedimentosConsolidados: PedimentosConsolidadosSlice,
CRectificaciones: RectificacionesPedimentosSlice,
CTiposContenedores : CatTiposContenedoresSlice
}
})

Loading…
Cancel
Save