From ac6a8d1ae673f767ca59427d46c11be7a597ecdc Mon Sep 17 00:00:00 2001 From: Felix Morales Date: Fri, 28 Jun 2024 13:22:51 -0500 Subject: [PATCH] =?UTF-8?q?A=20component=20is=20created=20for=20querying?= =?UTF-8?q?=20Alen=E2=80=99s=20account=20statements.=20An=20indicator=20is?= =?UTF-8?q?=20added=20to=20the=20billing=20department=20dashboard=20to=20a?= =?UTF-8?q?ccess=20the=20Alen=20account=20statements=20component.=20The=20?= =?UTF-8?q?styling=20issue=20with=20the=20indicator=20of=20operations=20wi?= =?UTF-8?q?th=20charges=20in=20dollars=20in=20the=20accounting=20departmen?= =?UTF-8?q?t=20dashboard=20is=20fixed.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.tsx | 11 +- src/Components/Dashboard/Dashboard.tsx | 9 + .../Dashboard/DashboardClientes.tsx | 125 +++++ .../Dashboard/DashboardContabilidad.tsx | 11 +- .../Dashboard/DashboardFacturacion.tsx | 34 +- .../EstadosCuenta/EstadosCuenta.tsx | 500 ++++++++++++++++++ src/Components/Login/login.tsx | 26 +- src/Components/Logout/logout.tsx | 3 +- src/DTO/EstadosCuenta/DTOEstadoCuentaAlen.ts | 48 ++ .../DTOEstadosCuentaAlenFilters.ts | 10 + .../EstadosCuentaAlen.Service.ts | 41 ++ src/Services/Utils/FileManager.Services.ts | 10 + src/index.tsx | 2 + .../userStatusSlice/userStatusSlice.ts | 11 +- 14 files changed, 822 insertions(+), 19 deletions(-) create mode 100644 src/Components/Dashboard/DashboardClientes.tsx create mode 100644 src/Components/EstadosCuenta/EstadosCuenta.tsx create mode 100644 src/DTO/EstadosCuenta/DTOEstadoCuentaAlen.ts create mode 100644 src/DTO/EstadosCuenta/DTOEstadosCuentaAlenFilters.ts create mode 100644 src/Services/EstadosCuenta/EstadosCuentaAlen.Service.ts diff --git a/src/App.tsx b/src/App.tsx index 4d831f1..2a02015 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -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') - }else{ + if(isAlenUser){ + navigate('/') + }else{ + navigate('/Clientes/Traficos') + } + } else{ navigate('/') } } diff --git a/src/Components/Dashboard/Dashboard.tsx b/src/Components/Dashboard/Dashboard.tsx index 28bff0d..53b7f5c 100644 --- a/src/Components/Dashboard/Dashboard.tsx +++ b/src/Components/Dashboard/Dashboard.tsx @@ -3,10 +3,14 @@ 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' 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 @@ -35,6 +39,11 @@ export default function Dashboard(props: IProps) { {[['Direccion', 'Sistemas', 'Facturacion'].includes(Depto) ? : ''].map((item) => { return {item} })} + {[isAlenUser ? : ''].map( + (item) => { + return {item} + } + )} diff --git a/src/Components/Dashboard/DashboardClientes.tsx b/src/Components/Dashboard/DashboardClientes.tsx new file mode 100644 index 0000000..604b1ca --- /dev/null +++ b/src/Components/Dashboard/DashboardClientes.tsx @@ -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([]) + + /* 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 ( + <> + + + + Clientes + + + + Traficos +
+
+
+ {}} /> +
+ +
+
+ + + + {/* + Buscar + */} + {/* Tipo cambio: ${TipoCambio} */} + + {/* */} + + + Ver mas... + + + + +
+ + + + Clientes + + + Estados de cuenta +
+
+
+ {}} /> +
+ + + +
+
+ + + Ver mas... + + +
+ + + + ); +}; diff --git a/src/Components/Dashboard/DashboardContabilidad.tsx b/src/Components/Dashboard/DashboardContabilidad.tsx index 42e93cb..2c6eeab 100644 --- a/src/Components/Dashboard/DashboardContabilidad.tsx +++ b/src/Components/Dashboard/DashboardContabilidad.tsx @@ -154,18 +154,17 @@ export const DashboardContabilidad: FC = (props) => { - + Contabilidad - -  Traficos Con Cargos de Dlls

- {}} /> + +  Traficos Con Cargos de Dlls
- + - {TraficosConCargos}
+
{TraficosConCargos}
= (props) => {
: "" } - {props.Perfil === 'Sup. Facturacion' ? + {props.Perfil === 'Sup. Facturacion' || props.Perfil === 'Administrador'? + <> Facturación @@ -187,7 +188,34 @@ export const DashboardFacturacion: FC = (props) => { - : "" + + + + Alen + + + Estados de cuenta +
+
+
+ {}} /> +
+ + + +
+
+ + + Ver mas... + + +
+ + : "" } ) diff --git a/src/Components/EstadosCuenta/EstadosCuenta.tsx b/src/Components/EstadosCuenta/EstadosCuenta.tsx new file mode 100644 index 0000000..8c5a639 --- /dev/null +++ b/src/Components/EstadosCuenta/EstadosCuenta.tsx @@ -0,0 +1,500 @@ +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 ([]) + const [show, setShow] = useState(false) + const [msg, setMsg] = useState('') + const [header, setHeader] = useState('') + const [msgColor, setMsgColor] = useState('primary') + const hiddenFileInputRef = useRef(null); + const [showSpinner, setShowSpinner] = useState(false) + const [File, setFile] = useState(); + //Estados de los filtros + const [Remitentes, setRemitentes] = useState([]) + const [Trafico, setTrafico] = useState('') + const [Aduana, setAduana] = useState('') + const [Patente, setPatente] = useState('') + const [Pedimento, setPedimento] = useState('') + const [TipoOperacion, setTipoOperacion] = useState('') + const [Fecha, setFecha] = useState('') + const [Remitente, setRemitente] = useState('') + const [Programado, setProgramado] = useState(0) + // + const [columnDefs] = useState([ + { + 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 ( + + { + if(data.trafico[data.trafico.length-1].toUpperCase() === 'C') + getCorresponsaliasFile(data.idPdf, 37, data.pdf) + else + getAEO(data.serie, data.noMovimiento, 'pdf', data.trafico); + } + }/> + + ) + } + }, + { + field:'idXml', headerName: 'XML', + cellRenderer: ({data}:any)=>{ + return ( + + { + if(data.trafico[data.trafico.length-1].toUpperCase() === 'C') + getCorresponsaliasFile(data.idXml, 38, data.xml) + else + getAEO(data.serie, data.noMovimiento, 'xml', data.trafico); + } + }/> + + ) + } + }, + { + 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 ? + + { + if(data.trafico[data.trafico.length-1].toUpperCase() === 'C') + getCorresponsaliasFile(data.idNotasCargo, 41, data.notasCargo) + /* else + getAEO(data.serie, data.noMovimiento); + } + }/> + : '' + ) + } + }, */ + ]) + 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, + Fecha: Fecha, + 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 ( +
+ + + + + + Trafico + setTrafico(e.target.value)} + > + + + + + + Aduana + setAduana(e.target.value)} + > + + + + + + Patente + setPatente(e.target.value)} + > + + + + + + Pedimento + setPedimento(e.target.value)} + > + + + + + + Fecha + setFecha(e.target.value)} + size='sm' + /> + + + + + Remitente + { + setRemitente(e.target.value) + }} + className='form-select form-select-sm' + > + + {Remitentes.map((r) => { + return ( + + ) + })} + + + + + + Tipo Operacion + { + setTipoOperacion(e.target.value) + }} + className='form-select form-select-sm' + > + + + + + + + + + + + Estado + { + setProgramado(+e.target.value) + }} + className='form-select form-select-sm' + > + + + + + + + +
+ + {['Administrador', 'Facturacion', 'Sup. Facturacion'].includes(Perfil) ? : ''} + + { + uploadFile(e.target.files[0]); + setFile(e.target.files[0]); + }} + /> +
+ +
+
+
+
+
+ +
+ +
+ ) +} \ No newline at end of file diff --git a/src/Components/Login/login.tsx b/src/Components/Login/login.tsx index aa5ff90..b017ab4 100644 --- a/src/Components/Login/login.tsx +++ b/src/Components/Login/login.tsx @@ -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 (
{!userLogued ? ( diff --git a/src/Components/Logout/logout.tsx b/src/Components/Logout/logout.tsx index bba6e24..994d678 100644 --- a/src/Components/Logout/logout.tsx +++ b/src/Components/Logout/logout.tsx @@ -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 = (props) => { useEffect(() => { window.localStorage.clear() dispatch(logued(false)) + dispatch(IsAlenUser(false)) navigate('/') }) diff --git a/src/DTO/EstadosCuenta/DTOEstadoCuentaAlen.ts b/src/DTO/EstadosCuenta/DTOEstadoCuentaAlen.ts new file mode 100644 index 0000000..f996989 --- /dev/null +++ b/src/DTO/EstadosCuenta/DTOEstadoCuentaAlen.ts @@ -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 +} \ No newline at end of file diff --git a/src/DTO/EstadosCuenta/DTOEstadosCuentaAlenFilters.ts b/src/DTO/EstadosCuenta/DTOEstadosCuentaAlenFilters.ts new file mode 100644 index 0000000..47b8bcf --- /dev/null +++ b/src/DTO/EstadosCuenta/DTOEstadosCuentaAlenFilters.ts @@ -0,0 +1,10 @@ +export interface DTOEstadoCuentaAlenFilters{ + Trafico: string, + Impexp: string, + Aduana: string, + Patente: string, + Pedimento: string, + Fecha: string, + Remitente: string, + Programado: number +} \ No newline at end of file diff --git a/src/Services/EstadosCuenta/EstadosCuentaAlen.Service.ts b/src/Services/EstadosCuenta/EstadosCuentaAlen.Service.ts new file mode 100644 index 0000000..81e4b64 --- /dev/null +++ b/src/Services/EstadosCuenta/EstadosCuentaAlen.Service.ts @@ -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(`ReporteEstadosCuentaAlen/Append`,formData,{ + headers:{ + "Content-Type":'multipart/form-data' + } + }) + } + + AppendOrdenCompra(data:DTOEstadoCuentaAlen){ + return http.post(`ReporteEstadosCuentaAlen/AppendOrdenCompra`,data) + } + + AppendObservaciones(data:DTOEstadoCuentaAlen){ + return http.post(`ReporteEstadosCuentaAlen/AppendObservaciones`,data) + } + + AppendProgramacionesPago(formData: FormData){ + return http.post(`ReporteEstadosCuentaAlen/AppendProgramacionesPago`,formData,{ + headers:{ + "Content-Type":'multipart/form-data' + } + }) + } + + GetAll(filters: DTOEstadoCuentaAlenFilters){ + return http.get(`ReporteEstadosCuentaAlen/GetAll`, { + params:filters + }) + } + + ExportEstadosCuenta(cuentas: DTOEstadoCuentaAlen[]){ + return http.post(`ReporteEstadosCuentaAlen/Export`, cuentas, {responseType: 'arraybuffer'}) + } +} + +export default new EstadosCuentaAlenService(); \ No newline at end of file diff --git a/src/Services/Utils/FileManager.Services.ts b/src/Services/Utils/FileManager.Services.ts index d21736a..348900c 100644 --- a/src/Services/Utils/FileManager.Services.ts +++ b/src/Services/Utils/FileManager.Services.ts @@ -43,5 +43,15 @@ class FileManagerDataService { getFileListByreferencia(referencia: string) { return http.get(`/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(); \ No newline at end of file diff --git a/src/index.tsx b/src/index.tsx index a0757a5..1c6efa1 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -31,6 +31,7 @@ import { RelacionFacturas } from './Components/ReportesClientes/Alen/RelacionFac 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' require (`./css/${process.env.REACT_APP_ENVIRONMENT}-home.css`) function PageNotFound() { @@ -102,6 +103,7 @@ root.render( }/> + }/> diff --git a/src/store/features/userStatusSlice/userStatusSlice.ts b/src/store/features/userStatusSlice/userStatusSlice.ts index 60c6223..6e26df1 100644 --- a/src/store/features/userStatusSlice/userStatusSlice.ts +++ b/src/store/features/userStatusSlice/userStatusSlice.ts @@ -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) => { - state.value = action.payload; + state.isLogged = action.payload; + }, + IsAlenUser: (state, action: PayloadAction) => { + 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;