Compare commits

..

No commits in common. 'main' and 'NewRptFront' have entirely different histories.

  1. 3
      .vscode/settings.json
  2. BIN
      GEMCO_20230719.bak
  3. 4
      package.json
  4. 575
      src/Components/Catalogos/CatFraccionesVulnerables/CatFraccionesVulnerables.tsx
  5. 501
      src/Components/Clientes/Amazon/Catalogos/CatConceptosConsulta.tsx
  6. 5
      src/Components/Clientes/Amazon/Components/ComboSelect/ComboDescripcion.tsx
  7. 88
      src/Components/Clientes/Amazon/Components/ComboSelect/ComboFraccion.tsx
  8. 1
      src/Components/Clientes/Amazon/DTO/DTO2096FraccionDescripcion.ts
  9. 9
      src/Components/Clientes/Amazon/DTO/DTO2096InvoiceStatus.ts
  10. 4
      src/Components/Clientes/Amazon/DTO/DTO2096RptFacturasPagadas.ts
  11. 10
      src/Components/Clientes/Amazon/DTO/DTOAmazonSegragacion.ts
  12. 8
      src/Components/Clientes/Amazon/Interfaces/I2096CatConceptosConsulta.ts
  13. 1
      src/Components/Clientes/Amazon/Interfaces/I2096Detail.ts
  14. 200
      src/Components/Clientes/Amazon/Reportes/AmazonNoPartes.tsx
  15. 15
      src/Components/Clientes/Amazon/Reportes/Clasification/Finished/RptAmazonFinishedClasificationInvoices.tsx
  16. 126
      src/Components/Clientes/Amazon/Reportes/Clasification/Pending/RptAmazonPendingClasificationInvoices.tsx
  17. 44
      src/Components/Clientes/Amazon/Reportes/Clasification/Pending/RptAmazonPendingClasificationInvoicesDetail.tsx
  18. 176
      src/Components/Clientes/Amazon/Reportes/Clasification/WaitingAnswerFromAmazon/RptPendingAnswerFromAmazon.tsx
  19. 105
      src/Components/Clientes/Amazon/Reportes/Clasification/WaitingAnswerFromAmazon/RptPendingAnswerFromAmazonDetail.tsx
  20. 15
      src/Components/Clientes/Amazon/Reportes/ConsultaTrafico/RptConsultaTrafico.tsx
  21. 1107
      src/Components/Clientes/Amazon/Reportes/Estatus/RtpAmazonInvoiceStatus.tsx
  22. 85
      src/Components/Clientes/Amazon/Reportes/FacturasPagadas/RptAmazonFacturasPagadas.tsx
  23. 112
      src/Components/Clientes/Amazon/Reportes/Segregacion/RptSegregacion.tsx
  24. 40
      src/Components/Clientes/Amazon/Services/Amazon.Services.ts
  25. 12
      src/Components/Dashboard/Dashboard.tsx
  26. 125
      src/Components/GEMCO/Facturacion/Anexo/RptConsolidadosSinFirmaBanco.tsx
  27. 2
      src/Components/Login/login.tsx
  28. 22
      src/Components/Register/UserList/UserList.tsx
  29. 67
      src/Components/Register/register.tsx
  30. 401
      src/Components/Reportes/RptArcosa.tsx
  31. 308
      src/Components/Reportes/RptContsFacturasFraccion.tsx
  32. 322
      src/Components/Reportes/RptFacturasPedimentosPagados.tsx
  33. 409
      src/Components/Reportes/RptOperacionesPagadasMisionFood.tsx
  34. 744
      src/Components/Reportes/RptPedimentosPagadosFacturasCruzadas.tsx
  35. 4
      src/Components/Utils/Toast/msgInformativo.tsx
  36. 6
      src/Interfaces/Catalogos/ICatFraccionesVulnerables.ts
  37. 7
      src/Interfaces/Facturacion/Anexo/IConsolidadosSinFirmaBanco.ts
  38. 61
      src/Interfaces/IRegister.tsx
  39. 18
      src/Interfaces/Reportes/IRptArcosa.ts
  40. 16
      src/Interfaces/Reportes/IRptContsFacturasFraccion.ts
  41. 10
      src/Interfaces/Reportes/IRptFacturasPedimentosPagados.ts
  42. 24
      src/Interfaces/Reportes/IRptOperacionesPagadasMisionFood.ts
  43. 27
      src/Services/Catalogos/FraccionesVulnerables.ts
  44. 17
      src/Services/Operaciones/Operaciones.Services.ts
  45. 33
      src/Services/Reportes/reportes.services.ts
  46. 51
      src/index.tsx
  47. 42
      src/store/features/CatFraccionesVulnerables/CatFraccionesVulnerablesSlice.ts
  48. 50
      src/store/features/Clientes/2096/AmazonCatConceptosConsulta.ts
  49. 7
      src/store/store.ts

@ -1,3 +0,0 @@
{
"workbench.colorTheme": "Infinity Dark Theme Eye Friendly Colors"
}

Binary file not shown.

@ -1,6 +1,6 @@
{
"name": "gemco",
"version": "3.2.0",
"version": "0.1.0",
"homepage": ".",
"private": true,
"dependencies": {
@ -69,7 +69,7 @@
"start-dev": "env-cmd -f .env.development react-scripts start",
"start-qa": "env-cmd -f .env.qa react-scripts start",
"start-prod": "env-cmd -f .env.production react-scripts start",
"build-qa": "env-cmd -f .env.qa react-scripts build version --patch",
"build-qa": "env-cmd -f .env.qa react-scripts build",
"build-prod": "env-cmd -f .env.production react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"

@ -1,575 +0,0 @@
import React, { FC, useEffect, useState } from 'react'
import { Alert, Button, Card, Col, Form, Modal, Row } from 'react-bootstrap'
import { IconContext } from 'react-icons'
import ICatFraccionesVulnerables from '../../../Interfaces/Catalogos/ICatFraccionesVulnerables'
import FraccionesVulnerables from '../../../Services/Catalogos/FraccionesVulnerables'
import { useDispatch, useSelector } from 'react-redux'
import { BsFileEarmarkExcel, BsFillPencilFill, BsSearch } from 'react-icons/bs'
import DataTable from 'react-data-table-component'
import * as XLSX from 'xlsx'
import { FaEraser } from 'react-icons/fa'
import { FormControl } from 'react-bootstrap'
import { AiFillCloseCircle } from 'react-icons/ai'
import { AiOutlineSave } from 'react-icons/ai'
import { MsgInformativo } from '../../Utils/Toast/msgInformativo'
// import { kMaxLength } from 'buffer'
// import { isNull, set } from 'cypress/types/lodash'
// import { number } from 'yup'
// import { parse } from 'path'
// Define types for the component props and table row data
interface IProps {}
export default function CatFraccionesVulnerables(props: IProps) {
const [UserType, setUserType] = useState(() => {
const stickyValue = window.localStorage.getItem('UserType')
return stickyValue !== null ? JSON.parse(stickyValue) : ''
})
const dispatch = useDispatch()
const [Data, setData] = useState<ICatFraccionesVulnerables[]>([])
const [tipoReporte, setTipoReporte] = useState(0)
// const [filtro, setFiltro] = useState('')
const [DataOriginal, setDataOriginal] = useState<ICatFraccionesVulnerables[]>(
[]
)
// const mFraccionesVulnerables = useSelector((state: RootState) => state.CatFraccionesVulnerables.CatFraccionesVulnerables);
const [header, setHeader] = useState<string>('') // Specify the type of 'header'
// const [msgColor, setMsgColor] = useState<string>('primary'); // Specify the type of 'msgColor'
const [show, setShowMsg] = useState(false) // Specify the type of 'show'
const [msg, setMsg] = useState<string>('') // Specify the type of 'msg'
const [id, setId] = useState<number>(0) // Specify the type of 'id'
const [Fraccion, setFraccion] = useState<number>(0) // Specify the type of 'Fraccion'
const [Nico, setNico] = useState<string>('0') // Specify the type of 'Nico'
const [Activo, setActivo] = useState<number>(0) // Specify the type of 'Activo'
const [showModal, setShowModal] = useState<boolean>(false)
const [editMode, setEditMode] = useState(false) // Nuevo estado para controlar el modo de edición
const [selectedRow, setSelectedRow] =
useState<ICatFraccionesVulnerables | null>(null) // Nuevo estado para almacenar la fila seleccionada
// const [fraccionesVulnerables, setFraccionesVulnerables] = useState([]);
const [modalFileManager, setModalFileManager] = useState(false)
const msgColor = 'primary'
const columnsFraccionesVulnerables = [
{
name: 'Id',
width: '14%',
selector: (row: ICatFraccionesVulnerables) => row.id,
sortable: true
},
{
name: 'Fraccion',
width: '20%',
selector: (row: ICatFraccionesVulnerables) => row.fraccion,
sortable: true
},
{
name: 'Nico',
width: '15%',
selector: (row: ICatFraccionesVulnerables) => row.nico,
sortable: true
},
{
name: 'Activo',
width: '15%',
selector: (row: ICatFraccionesVulnerables) =>
row.activo === 1 ? 'Sí' : 'No',
sortable: true
},
{
name: 'Edita',
width: '15%',
cell: (row: ICatFraccionesVulnerables) => (
<Button
size="sm"
variant="light"
style={{
textAlign: 'right',
visibility: UserType === '4' ? 'hidden' : 'visible'
}}
onClick={() => loadRow(row)} // Cambia esta línea para pasar el objeto 'row' a la función 'loadRow'
>
<IconContext.Provider value={{ color: 'blue', size: '20px' }}>
<BsFillPencilFill />
</IconContext.Provider>{' '}
</Button>
)
},
{
name: 'Elimina',
width: '15%',
cell: (row: ICatFraccionesVulnerables) => (
<Button
size="sm"
variant="light"
style={{
textAlign: 'right',
visibility: UserType === '4' ? 'hidden' : 'visible'
}}
onClick={() => deleteRow(row.id)} // Llama a la función deleteRow pasando el ID de la fila
>
<IconContext.Provider value={{ color: 'red', size: '20px' }}>
<AiFillCloseCircle />
</IconContext.Provider>{' '}
</Button>
)
}
]
const loadRow = (data: ICatFraccionesVulnerables): void => {
setSelectedRow(data) // Al hacer clic en el botón de edición, establecemos la fila seleccionada en el estado
setEditMode(true) // Cambiamos a modo de edición
setId(data.id) // Establecemos el id de la fila seleccionada
setFraccion(data.fraccion) // Cargamos los valores de fracción y nico para edición
setNico(data.nico)
}
// const truncatedValue = inputValue.substring(0, 8)
// setFraccion(truncatedValue)
const generaReporte = () => {
setTipoReporte(0)
FraccionesVulnerables.getAll()
.then((response) => {
setData(response.data)
setDataOriginal(response.data)
// uploadAllRows(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 uploadAllRows = (data: ICatFraccionesVulnerables[]) => {
// Iteramos sobre los datos y realizamos la petición para cada fila
data.forEach((row) => {
uploadFile(row)
})
}
useEffect(() => {
// console.log(id) // Esto imprimirá el valor actualizado de id después de que cambie
}, [id])
const handleCreateNewRecord = () => {
// console.log('se han borrod los texbox ')
setSelectedRow(null)
setFraccion(0)
setNico('0')
setActivo(0) // Establecer a 0 (No)
setEditMode(true)
setId(0)
setShowModal(false)
}
function deleteRow(id: number): void {
FraccionesVulnerables.Delete(id)
.then((response) => {
setData((prevData) =>
prevData.map((item) =>
item.id === id ? { ...item, activo: 0 } : item
)
)
console.log(response.data)
})
.catch((e: Error) => {
setHeader('Error')
setMsg('Ocurrió un error: ' + e)
return
})
}
const uploadFile = (data: ICatFraccionesVulnerables): Promise<any> => {
return new Promise((resolve, reject) => {
FraccionesVulnerables.Append(data)
.then((response) => {
// console.log(response.data) // Mensaje de éxito
resolve(response.data)
})
.catch((e: Error) => {
console.error('Error durante la inserción:', e) // Mensaje de error
reject(e)
})
})
}
//Aqui agregamos la validacion de los digitos de las fracciones -------------------------------------------------------
const handleFraccionKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {
const fraccionAsString = Fraccion.toString()
if (e.key.length === 1 && fraccionAsString.length >= 8) {
e.preventDefault() // Evitar agregar más caracteres si ya hay 8
}
}
const handleFraccionBlur = (e: React.FocusEvent<HTMLInputElement>) => {
const fraccionAsString = Fraccion.toString()
if (fraccionAsString.length !== 8) {
console.log('La fracción debe tener 8 dígitos.')
e.currentTarget.focus() // Mantener el foco en el campo
}
}
// aqui agregamos las validaciones de los digitos del nico---------------------------------------------------------
const handleNicoChange = (e: React.ChangeEvent<HTMLInputElement>) => {
const value = e.target.value
if (value.length <= 2) {
setNico(value)
}
}
const handleNicoKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {
if (e.key.length === 1 && Nico.length >= 2) {
e.preventDefault() // Evitar agregar más caracteres si ya hay 2
}
}
const handleNicoBlur = (e: React.FocusEvent<HTMLInputElement>) => {
if (Nico.length !== 2) {
console.log('El Nico debe tener 2 dígitos.')
e.currentTarget.focus() // Mantener el foco en el campo
}
}
// Guardar --------------------------------------------------------------
const handleSaveChanges = async () => {
if (id === 0) {
const fraccionAsString = Fraccion.toString()
if (fraccionAsString.length !== 8 || Nico.length !== 2) {
setHeader('Error')
if (fraccionAsString.length !== 8 && Nico.length !== 2) {
setMsg(
'La fraccion debe tener 8 dígitos y el nico debe tener 2 dígitos.'
)
} else if (fraccionAsString.length !== 8) {
setMsg('La fracción debe tener 8 dígitos.')
} else {
setMsg('El nico debe tener 2 dígitos.')
}
setShowMsg(true)
return // Esto podría ser necesario para evitar una ejecución adicional
}
const newRecord = {
id: id,
fraccion: Fraccion,
nico: Nico,
activo: Activo
}
try {
const response = await uploadFile(newRecord)
const newId = response.id
// Actualizar el estado local con el nuevo registro que incluye el nuevo ID
const updatedRecord = { ...newRecord, id: newId }
setData((prevData) => [...prevData, updatedRecord])
// console.log('este el newId' + newId)
// console.log('este el id normal ' + id)
// Restablecer valores de los campos
handleCreateNewRecord()
} catch (error) {
console.error('Error durante la inserción:', error)
}
} else {
// Aquí actualizamos el registro existente
const fraccionAsString = Fraccion.toString()
if (fraccionAsString.length !== 8) {
setHeader('Error')
setMsg('La fraccion debe tener 8 digitos.')
setShowMsg(true)
return
}
if (Nico.length !== 2) {
setHeader('Error')
setMsg('El Nico debe tener 2 digitos.')
setShowMsg(true)
return
}
const updatedData = Data.map((row) =>
row.id === selectedRow?.id
? { ...row, fraccion: Fraccion, nico: Nico, activo: Activo }
: row
)
setData(updatedData)
const updatedRow = updatedData.find((row) => row.id === selectedRow?.id)
if (updatedRow) {
uploadFile(updatedRow) // Llamada a uploadFile para actualizar el registro
}
setEditMode(false)
setShowModal(false)
}
}
const downloadExcel = () => {
exportExcel(Data, 'Fracciones Vulnerables')
}
function exportExcel(
jsonData: ICatFraccionesVulnerables[],
fileName: string
): void {
let Heading = [['Id', 'Fraccion', 'Nico', 'Activo']]
const wb = XLSX.utils.book_new()
const ws: XLSX.WorkSheet = XLSX.utils.json_to_sheet([])
XLSX.utils.sheet_add_aoa(ws, Heading)
// Transformar los valores de 'activo' en 'Si' o 'No' antes de agregarlos a la hoja de cálculo
const transformedData = jsonData.map((row) => ({
...row,
activo: row.activo === 1 ? 'Si' : 'No'
}))
XLSX.utils.sheet_add_json(ws, transformedData, {
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'
if (!ws[address]) continue
ws[address].v = ws[address].v.toUpperCase()
}
}
const handleFraccionChange = (e: React.ChangeEvent<HTMLInputElement>) => {
const value = parseFloat(e.target.value)
setFraccion(isNaN(value) ? 0 : value)
}
// Función para manejar el cambio en el campo de entrada de la fracción
return (
<div className="mt-2">
<Card>
<Card.Body>
<div className="container">
<div
className="row mb-4 "
style={{
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
minHeight: '1vh'
}}
>
<Card
style={{
paddingTop: '10px',
paddingBottom: '5px',
width: '900px',
height: '50px'
}}
>
<Row>
<Col xs={12}></Col>
<Col xs={12}>
<Row className="align-items-center">
<Col xs={1}>
<Form.Label className="mb-0">Fracción</Form.Label>
</Col>
<Col xs={1}>
<FormControl
type="text"
value={Fraccion}
onChange={handleFraccionChange}
onKeyDown={handleFraccionKeyDown}
onBlur={handleFraccionBlur}
inputMode="numeric"
className="orm-select mx-2"
maxLength={8}
minLength={8}
style={{
backgroundColor: 'white',
color: 'black',
padding: '4px',
width: '80px',
height: '30px'
}}
/>
</Col>
<Col
xs={1}
style={{ textAlign: 'right', width: '100px' }}
>
<Form.Label className="mb-0 ">Nico</Form.Label>
</Col>
<Col xs={1}>
<FormControl
type="text"
value={Nico}
// onChange={(e) => setNico(e.target.value)}
onChange={handleNicoChange}
onKeyDown={handleNicoKeyDown}
onBlur={handleNicoBlur}
// inputMode="numeric"
className="orm-select mx-2"
maxLength={2}
minLength={2}
style={{
backgroundColor: 'white',
color: 'black',
padding: '4px',
width: '30px',
height: '30px'
}}
/>
</Col>
<Col xs={2} style={{ textAlign: 'right', width: '50px' }}>
<Form.Label className="mb-0">Activo</Form.Label>
</Col>
<Col xs={2}>
<Form.Select
value={Activo}
onChange={(e) => setActivo(Number(e.target.value))}
className="form-select mx-2"
style={{
backgroundColor: 'white',
color: 'black',
padding: '4px',
width: '60px',
height: '30px'
}}
>
<option value={1}>Si</option>
<option value={0}>No</option>
</Form.Select>
</Col>
<Col xs={0} style={{ width: '100px' }}>
<Button
size="sm"
variant="light"
onClick={handleCreateNewRecord}
style={{
backgroundColor: 'orange',
color: 'white',
padding: '4px',
width: '50px',
height: '32px'
}}
>
<FaEraser />
</Button>
</Col>
<Col xs={0} style={{ width: '110px' }}>
<Button
style={{
backgroundColor: 'blue',
color: 'white',
padding: '2px',
width: '55px',
height: '30px'
}}
variant="primary"
size="sm"
onClick={() => {
generaReporte()
}}
>
<BsSearch />
</Button>
</Col>
<Col xs={0} style={{ width: '110px' }}>
<Button
style={{
backgroundColor: 'blue',
color: 'white',
padding: '0px',
width: '55px',
height: '30px'
}}
variant="primary"
onClick={handleSaveChanges}
>
<AiOutlineSave />
</Button>
</Col>
<Col xs={0} style={{ width: '110px' }}>
<Button
size="sm"
variant="success"
onClick={() => {
downloadExcel()
}}
style={{
backgroundColor: 'green',
color: 'white',
padding: '1px',
width: '55px',
height: '30px'
}}
>
<BsFileEarmarkExcel />
</Button>
</Col>
</Row>
</Col>
<Col xs={1}></Col>
</Row>
</Card>
</div>
<Row>
<Col xs={3}></Col>
<Col xs={6}>
<Card>
<DataTable
noHeader
defaultSortFieldId={'id'}
defaultSortAsc={true}
striped={true}
dense={true}
paginationPerPage={10}
pagination
highlightOnHover
columns={columnsFraccionesVulnerables}
data={Data}
pointerOnHover
/>
</Card>
</Col>
<Col xs={1}></Col>
</Row>
</div>
</Card.Body>
</Card>
<MsgInformativo
show={show}
msg={msg}
header={header}
msgColor={msgColor}
closeToast={() => {
setShowMsg(false)
}}
/>
</div>
)
}

@ -1,501 +0,0 @@
import React, { FC, useEffect, useState } from 'react'
import ITabulador from '../../../../Interfaces/Catalogos/ITabulador'
import ITabuladorConceptos from '../../../../Interfaces/Catalogos/ITabuladorConceptos'
import DTOConceptos from '../../../../DTO/Utils/DTOConceptos'
import CTabDataService from '../../../../Services/Corresponsalias/Corresponsales.Tabuladores.Services'
//import CTabDetDataService from '../../../../Services/Corresponsalias/Corresponsales.Tabuladores.Detalle.Sevices'
import AmazonSrvDataService from '../Services/Amazon.Services'
import ClientesDataService from '../../../../Services/Catalogos/Clientes.Services'
import { MsgInformativo } from '../../../Utils/Toast/msgInformativo'
import { ControlledInput } from '../../../Utils/ControlledInput/ControlledInput'
import DataTable from 'react-data-table-component'
import {
Alert,
Button,
Card,
Col,
Container,
FloatingLabel,
Form,
Modal,
Row
} from 'react-bootstrap'
import { IconContext } from 'react-icons'
import 'react-data-table-component-extensions/dist/index.css'
import {
BsCheckCircleFill,
BsPlusSquareFill,
BsXCircleFill
} from 'react-icons/bs'
import IClientes from '../../../../Interfaces/Catalogos/IClientes'
import { FcTimeline } from 'react-icons/fc'
import { FaEraser, FaTimesCircle } from 'react-icons/fa'
import ICat2096CatConceptosConsulta from '../Interfaces/I2096CatConceptosConsulta'
import { populateCatConcetosConsultas, updateCatConcetosConsulta } from '../../../../store/features/Clientes/2096/AmazonCatConceptosConsulta'
import { useDispatch } from 'react-redux'
export interface ICatConceptosConsultaProps {}
export default function CatConceptosConsulta(
props: ICatConceptosConsultaProps
) {
const [UserId, setUserId] = useState(() => {
const stickyValue = window.localStorage.getItem('UserId')
return stickyValue !== null ? JSON.parse(stickyValue) : 0
})
const dispatch = useDispatch()
const [Tabulador, setTabulador] = useState(0)
const [Id, setId] = useState(0)
const [Concepto, setConcepto] = useState(0)
const [Cliente, setCliente] = useState(0)
const [Activo, setActivo] = useState(0)
const [Clientes, setClientes] = useState<Array<IClientes>>()
const [Siglas, setSiglas] = useState('')
const [ShortDescription, setShortDescription] = useState('')
const [SpanishDescription, setSpanishDescription] = useState('')
const [SpanishDescriptionWide, setSpanishDescriptionWide] = useState('')
const [DetalleConceptos, setDetalleConceptos] = useState<
ITabuladorConceptos[]
>([])
const [CatConceptos, setCatConceptos] = useState<
ICat2096CatConceptosConsulta[]
>([])
const [Tabuladores, setTabuladores] = useState<ITabulador[]>([])
const [AllTabuladores, setAllTabuladores] = useState<ITabulador[]>([])
const [Costo, setCosto] = useState('')
const [header, setHeader] = useState('')
const [msgColor, setMsgColor] = React.useState('primary')
const [show, setShowMsg] = useState(false)
const [msg, setMsg] = useState('')
const [DialogTabs, setDialogTabs] = useState(false)
const colConcepts = [
{
name: 'Activo',
width: '80px',
cell: (row: ICat2096CatConceptosConsulta) => (
<div
onClick={() => {
loadData(row)
}}
>
<IconContext.Provider
value={{ color: row.activo ? 'green' : 'red', size: '20px' }}
>
{row.activo ? <BsCheckCircleFill /> : <BsXCircleFill />}
</IconContext.Provider>
</div>
)
},
{
name: 'Siglas',
width: '80px',
selector: (row: ICat2096CatConceptosConsulta) => row.siglas,
sortable: true
},
{
name: 'Descripcion corta',
width: '300px',
selector: (row: ICat2096CatConceptosConsulta) => row.shortDescription,
wrap: true,
sortable: true
},
{
name: 'Descripcion español',
width: '450px',
selector: (row: ICat2096CatConceptosConsulta) => row.spanishDescription,
wrap: true,
sortable: true
},
{
name: 'Descripcion amplia',
width: '450px',
selector: (row: ICat2096CatConceptosConsulta) =>
row.spanishDescriptionWide,
wrap: true,
sortable: true
}
]
const loadData = (data: ICat2096CatConceptosConsulta) => {
setId(data.id)
setSiglas(data.siglas)
setShortDescription(data.shortDescription)
setSpanishDescription(data.spanishDescription)
setSpanishDescriptionWide(data.spanishDescriptionWide)
setActivo(data.activo ? 1 : 0)
}
const deleteTabulador = () => {
CTabDataService.Delete(Tabulador)
.then((response) => {
if (response.status === 200) {
setHeader('Informativo')
setMsg(response.data.respuesta)
setShowMsg(true)
setDialogTabs(false)
setTabuladores(Tabuladores.filter((data) => data.id != Tabulador))
setAllTabuladores(Tabuladores)
return
}
})
.catch((e: Error) => {
setHeader('Error')
setMsg('Ocurrio un error: ' + e)
setShowMsg(true)
return
})
}
const loadCatalog = () => {
AmazonSrvDataService.CatConceptosConsultaGET()
.then((response) => {
dispatch(populateCatConcetosConsultas(response.data))
setCatConceptos(response.data)
})
.catch((e: Error) => {
setHeader('Error')
setMsg('Ocurrio un error: ' + e)
setShowMsg(true)
return
})
}
useEffect(() => {
loadCatalog()
}, [])
useEffect(() => {
if (Cliente > 0) {
setSiglas('')
setTabuladores([])
setDetalleConceptos([])
CTabDataService.GetByCustomer(Cliente)
.then((response) => {
setTabuladores(response.data)
})
.catch((e: Error) => {
setHeader('Error')
setMsg('Ocurrio un error: ' + e)
setShowMsg(true)
return
})
}
}, [Cliente])
const filtraTabulador = (e: any) => {
if (e.target.value !== '') {
setTabuladores(
AllTabuladores.filter(function (el) {
return el.nombre
.toLocaleLowerCase()
.includes(e.target.value.toLocaleLowerCase())
})
)
} else {
setTabuladores(AllTabuladores)
}
}
const save = () => {
const data: ICat2096CatConceptosConsulta = {
id: Id,
siglas: Siglas,
shortDescription: ShortDescription,
spanishDescription: SpanishDescription,
spanishDescriptionWide: SpanishDescriptionWide,
activo: Activo==1
}
AmazonSrvDataService.CatConceptosConsultaAppend(data)
.then((response) => {
if (response.status === 200) {
loadCatalog()
setHeader('Informativo')
setMsg('La informacion se guardo correctamente')
setShowMsg(true)
return
}
})
.catch((e: Error) => {
setHeader('Error')
setMsg('Ocurrio un error: ' + e)
setShowMsg(true)
return
})
}
return (
<div>
<Card>
<Card.Body>
<Card style={{ height: '100%' }}>
<Card.Header as="h4">Catalogo de consultas para Amazon</Card.Header>
<Card.Body>
<Container fluid>
<Alert variant="primary">
<Row>
<Col xs={1}>
<FloatingLabel
controlId="floatingInput"
label="Siglas"
className="mb-3"
>
<Form.Control
type="text"
placeholder=""
value={Siglas}
maxLength={4}
onChange={(e) => {
setSiglas(e.target.value)
}}
/>
</FloatingLabel>
</Col>
<Col xs={8}>
<FloatingLabel
controlId="floatingInput"
label="Descripcion corta"
className="mb-3"
>
<Form.Control
type="text"
placeholder="Descripcion corta"
value={ShortDescription}
onChange={(e) => {
setShortDescription(e.target.value)
}}
/>
</FloatingLabel>
</Col>
<Col
xs={1}
style={{
textAlign: 'left',
paddingTop: '5px',
cursor: 'pointer',
paddingLeft: '0px'
}}
onClick={() => {
setTabulador(0)
setSiglas('')
}}
>
<IconContext.Provider
value={{ color: 'orange', size: '25px' }}
>
<FaEraser />
</IconContext.Provider>
</Col>
<Col></Col>
<Col style={{ paddingTop: '20px' }}>
<Button
variant="primary"
size="sm"
style={{ paddingLeft: '10px', paddingRight: '10px' }}
onClick={() => save()}
>
Guardar
</Button>
</Col>
</Row>
<Row>
<Col xs={5}>
<FloatingLabel
controlId="floatingInput"
label="Descripcion en español"
className="mb-3"
>
<Form.Control
as="textarea"
placeholder=""
style={{ height: '100px' }}
value={SpanishDescription}
onChange={(e) => {
setSpanishDescription(e.target.value)
}}
/>
</FloatingLabel>
</Col>
<Col xs={5}>
<FloatingLabel
controlId="floatingInput"
label="Descripcion amplia"
className="mb-3"
>
<Form.Control
as="textarea"
placeholder="Descripcion amplia"
style={{ height: '100px' }}
value={SpanishDescriptionWide}
onChange={(e) => {
setSpanishDescriptionWide(e.target.value)
}}
/>
</FloatingLabel>
</Col>
<Col style={{ paddingTop: '20px' }}>
<FloatingLabel controlId="floatingSelect" label="Activo">
<Form.Select
aria-label="Activo"
value={Activo}
onChange={(e) => {
setActivo(parseInt(e.target.value))
}}
>
<option value="1">Si</option>
<option value="0">No</option>
</Form.Select>
</FloatingLabel>
</Col>
<Col></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>
</Row>
</Card.Subtitle>
</Card.Body>
</Card>
</Col> */}
<Col xs={12}>
<Card style={{}}>
<Card.Body>
<Card.Subtitle className="mb-2 text-muted">
<Row>
<Col xs={12} style={{ paddingTop: '8px' }}>
<DataTable
noHeader
defaultSortFieldId={'id'}
defaultSortAsc={true}
pagination
highlightOnHover
columns={colConcepts}
data={CatConceptos}
/>
</Col>
<Col xs={9}>
{/* <Form.Control
as="select"
onChange={(e) =>
setConcepto(parseInt(e.target.value))
}
className="form-select form-select-sm"
style={{ fontSize: '17px' }}
>
<option value="0">- Seleccione -</option>
{CatConceptos
? CatConceptos.map((c) => {
return (
<option value={c.id} key={c.id}>
{c.concepto}
</option>
)
})
: null}
</Form.Control> */}
</Col>
<Col style={{ paddingTop: '5px' }}>
{/* <Form.Label
onClick={() => {
addConcept()
}}
style={{ cursor: 'pointer' }}
>
<IconContext.Provider
value={{ color: 'green', size: '30px' }}
>
<BsPlusSquareFill />
</IconContext.Provider>
</Form.Label> */}
</Col>
</Row>
</Card.Subtitle>
{/* <DataTable
noHeader
defaultSortFieldId={'id'}
defaultSortAsc={true}
pagination
highlightOnHover
columns={columnsConcepts}
data={DetalleConceptos}
/> */}
</Card.Body>
</Card>
</Col>
</Row>
</Container>
</Card.Body>
</Card>
</Card.Body>
</Card>
<Modal
show={DialogTabs}
onHide={() => {
setDialogTabs(false)
}}
size="sm"
>
<Modal.Body>
¿Esta seguro de eliminar:
<br /> {Siglas}?
</Modal.Body>
<Modal.Footer>
<Row>
<Col xs={6} style={{ textAlign: 'left', paddingRight: '100px' }}>
<Button
variant="danger"
onClick={deleteTabulador}
size="sm"
style={{ paddingRight: '20px', paddingLeft: '20px' }}
>
Si
</Button>
</Col>
<Col xs={6} style={{ textAlign: 'right' }}>
<Button
variant="secondary"
onClick={() => {
setDialogTabs(false)
}}
size="sm"
>
Cerrar
</Button>
</Col>
</Row>
</Modal.Footer>
</Modal>
<MsgInformativo
show={show}
msg={msg}
header={header}
msgColor={msgColor}
closeToast={() => {
setShowMsg(false)
}}
/>
</div>
)
}

@ -177,11 +177,6 @@ export function ComboDescripcion(props: IComboDescripcionProps) {
) : (
''
)}
{props.Detail.validaFraccionOriginal === 5 ? (
<option value="5">BOT</option>
) : (
''
)}
</Form.Control>
<Modal
show={showModal}

@ -1,5 +1,5 @@
import { useCallback, useEffect, useState } from 'react'
import { Badge, Button, Col, Form, Modal, Row } from 'react-bootstrap'
import { Button, Col, Form, Modal, Row } from 'react-bootstrap'
import * as CurrencyFormat from 'react-currency-format'
import { MsgInformativo } from '../../../../Utils/Toast/msgInformativo'
import { RootState } from '../../../../../store/store'
@ -31,9 +31,6 @@ export function ComboFraccion(props: IComboFraccionProps) {
const mInvoices = useSelector(
(state: RootState) => state.AmazonInvoices.Invoice
)
const mCatTipoConsultas = useSelector(
(state: RootState) => state.AmazonCatConceptosConsulta.CatConcetosConsulta
)
const [Validacion, setValidacion] = useState(props.ConfirmaFraccion)
const [UserChanged, setUserChanged] = useState(false)
const [showModal, setShowModal] = useState(false)
@ -52,10 +49,8 @@ export function ComboFraccion(props: IComboFraccionProps) {
const [Comentarios, setComentarios] = useState(
props.Detail.comentarios
? props.Detail.comentarios
: ''
: 'Clasificacion Incorrecta'
)
const [TipoConsulta, setTipoConsulta] = useState(0)
const [TipoConsultaTxt, setTipoConsultaTxt] = useState('')
const msgColor = 'primary'
const refreshStore = (Invoice: I2096Headers, Detail: I2096Detail[]) => {
@ -113,10 +108,13 @@ export function ComboFraccion(props: IComboFraccionProps) {
cumplimientoNormativo: newData.cumplimientoNormativo,
comentarios: newData.comentarios,
confirmaFraccion: newData.confirmaFraccion
/*,
checked: true*/
}
}
return el
})
//console.log('newDetail '+JSON.stringify(newDetail))
refreshStore(Invoice[0], newDetail)
}
@ -136,13 +134,6 @@ export function ComboFraccion(props: IComboFraccionProps) {
}
}, [Validacion, UserChanged])
useEffect(() => {
let selected = mCatTipoConsultas.filter((a)=>{if(a.id==TipoConsulta){return a}})
if (selected.length) {
setTipoConsultaTxt(selected[0].shortDescription+' '+selected[0].spanishDescription)
}
}, [TipoConsulta])
const saveFraccion = (Fracc: string) => {
Fracc = Fracc.replaceAll('.', '').replaceAll(' ', '')
if (Validacion === 2) {
@ -174,7 +165,6 @@ export function ComboFraccion(props: IComboFraccionProps) {
const data: DTO2096FraccionDescripcion = {
id: props.IDDetail,
fraccion: Fracc,
tipoConsulta: TipoConsulta,
cumplimientoNormativo: CumplimientoNormativo,
comentarios: Comentarios,
descripcionGEMCO: DescripcionGEMCO
@ -219,7 +209,6 @@ export function ComboFraccion(props: IComboFraccionProps) {
<option value="0"> </option>
<option value="1"> = </option>
<option value="2"> != </option>
{/* <option value="5">BOT</option> */}
</>
) : (
''
@ -233,6 +222,7 @@ export function ComboFraccion(props: IComboFraccionProps) {
) : (
''
)}
{/* <option value="2"> != </option> */}
{props.Detail.validaFraccionOriginal === 3 ? (
<option value="3"> Ok </option>
) : (
@ -258,11 +248,7 @@ export function ComboFraccion(props: IComboFraccionProps) {
>
<Modal.Body>
<Row>
<Col xs={3}>
<Badge bg="primary">
<h6>Fraccion GEMCO</h6>
</Badge>
</Col>
<Col xs={3}>Fraccion GEMCO</Col>
<Col xs={3}>
<CurrencyFormat
onValueChange={(values: any) => {
@ -286,45 +272,8 @@ export function ComboFraccion(props: IComboFraccionProps) {
<Col xs={6}></Col>
</Row>
<Row style={{ paddingTop: '15px' }}>
<Col xs={1}>
<Badge bg="primary">
<h6>Tipo</h6>
</Badge>
</Col>
<Col xs={2}>
<Form.Control
as="select"
className="form-select form-select-sm"
onChange={(e) => setTipoConsulta(parseInt(e.target.value))}
value={TipoConsulta}
> <option value='0'> ??? </option>
{mCatTipoConsultas.map((tipo) => {
return <option value={tipo.id}>{tipo.siglas}</option>
})}
</Form.Control>
</Col>
<Col xs={9}>
<Form.Control
as="textarea"
id="TipoConsultaTxt"
size="sm"
disabled={true}
value={TipoConsultaTxt}
style={{height:'100px', fontSize:'13px'}}
/>
</Col>
</Row>
<Row style={{ paddingTop: '15px' }}>
<Col xs={3}>
<Badge bg="primary">
<h6>
Cumplimiento&nbsp;&nbsp;&nbsp;&nbsp;
<br />
normativo
</h6>
</Badge>
</Col>
<Col xs={9}>
<Col xs={3}>Cumplimiento normativo</Col>
<Col xs={8}>
<Form.Control
as="textarea"
id="CumplimientoNormativo"
@ -336,19 +285,15 @@ export function ComboFraccion(props: IComboFraccionProps) {
<Col>&nbsp;</Col>
</Row>
<Row style={{ paddingTop: '15px' }}>
<Col xs={3}>
<Badge bg="primary">
<h6>Comentarios&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</h6>
</Badge>
</Col>
<Col xs={9}>
<Col xs={3}>Comentarios</Col>
<Col xs={8}>
{' '}
<Form.Control
as="textarea"
id="Comentarios"
size="sm"
value={
Comentarios.length ? Comentarios : ''
Comentarios.length ? Comentarios : 'Clasificacion incorrecta.'
}
onChange={(e) => setComentarios(e.target.value)}
/>
@ -356,12 +301,8 @@ export function ComboFraccion(props: IComboFraccionProps) {
<Col>&nbsp;</Col>
</Row>
<Row style={{ paddingTop: '15px' }}>
<Col xs={3}>
<Badge bg="primary">
<h6>Descripcion GEMCO</h6>
</Badge>
</Col>
<Col xs={9}>
<Col xs={3}>Descripcion GEMCO</Col>
<Col xs={8}>
<Form.Control
as="textarea"
id="PedimentoDescripcion"
@ -374,7 +315,6 @@ export function ComboFraccion(props: IComboFraccionProps) {
<Col XS={9}></Col>
<Col xs={3}>
<Button
style={{visibility: (Comentarios.length && TipoConsulta>0) ? 'visible' : 'hidden'}}
onClick={() => {
saveFraccion(Fraccion)
}}

@ -1,7 +1,6 @@
export default interface DTO2096FraccionDescripcion {
id: number
fraccion: string
tipoConsulta: number,
cumplimientoNormativo: string
comentarios: string
descripcionGEMCO: string

@ -1,5 +1,3 @@
import { number } from "yup"
export default interface DTO2096InvoiceStatus {
id: number
referencia: string
@ -27,10 +25,5 @@ export default interface DTO2096InvoiceStatus {
estatus: string,
idArchivoACK: number,
archivoACK: string,
fhArchivoACK: string
clasificador: string
fechaRecepcion: string
cantidadASIN: number
fhArchivoACK: string
}

@ -1,5 +1,4 @@
export default interface DTO2096RptFacturasPagadas {
factura: string,
pedimento: string,
fechaPago: string,
@ -8,6 +7,5 @@ export default interface DTO2096RptFacturasPagadas {
valorDolares: string,
valorAduana: string,
razonSocial: string,
aduana: string,
piezas: string
aduana: string
}

@ -1,10 +0,0 @@
export default interface DTOAmazonSegragacion {
vrid: string,
asin: string,
quantity: number,
descripcion: string,
motivo: string,
fSegregacion: string,
valorMercancia: string,
}

@ -1,8 +0,0 @@
export default interface ICat2096CatConceptosConsulta {
id: number,
siglas: string,
shortDescription: string,
spanishDescription: string,
spanishDescriptionWide: string,
activo: boolean
}

@ -37,7 +37,6 @@ export default interface I2096Detail {
fCreacion: string
estatus: number
autorizado: boolean
tipoConsulta: number
cumplimientoNormativo: string
comentarios: string
sightLine: boolean

@ -4,7 +4,6 @@ import DataTable from 'react-data-table-component'
import I2096NoParte from '../Interfaces/I2096NoParte'
import AmazonDS from '../Services/Amazon.Services'
import {
deleteNoPartes,
populateNoPartes,
updateNoPartes
} from '../../../../store/features/Clientes/2096/AmazonNoPartes'
@ -13,7 +12,7 @@ import { useDispatch, useSelector } from 'react-redux'
import { useEffect, useState } from 'react'
import { MsgInformativo } from '../../../Utils/Toast/msgInformativo'
import { IconContext } from 'react-icons'
import { BsFillPencilFill, BsFillXCircleFill } from 'react-icons/bs'
import { BsFillPencilFill } from 'react-icons/bs'
import I2096PaisClave from '../Interfaces/I2096PaisClave'
import DTO2096PerfilesParecidos from '../DTO/DTO2096PerfilesParecidos'
@ -36,14 +35,10 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) {
const [NoParteLOG, setNoParteLOG] = useState<I2096NoParteLog[]>([])
const [PaisClaves, setPaisClaves] = useState<I2096PaisClave[]>([])
const [Data, setData] = useState<DTO2096PerfilesParecidos[]>([])
const [DataNoParteVerificacion, setDataNoParteVeriifcacion] = useState<
DTO2096NoParteVerificacion[]
>([])
const [DataNoParteVerificacion, setDataNoParteVeriifcacion] = useState<DTO2096NoParteVerificacion[]>([])
const [ShowModal, setShowModal] = useState(false)
const [ShowModalLog, setShowModalLog] = useState(false)
const [ShowModalNoParteVerificacion, setShowModalNoParteVerificacion] =
useState(false)
const [ShowModalDelete, setShowModalDelete] = useState(false)
const [ShowModalNoParteVerificacion, setShowModalNoParteVerificacion] = useState(false)
const [header, setHeader] = useState('')
const [msgColor, setMsgColor] = useState('primary')
const [show, setShowMsg] = useState(false)
@ -86,35 +81,12 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) {
<Col>
<div
style={{
cursor: 'pointer'
}}
onClick={() => {
setIDParte(row.id)
setShowModalDelete(true)
}}
>
<IconContext.Provider value={{ color: 'red', size: '25px' }}>
<BsFillXCircleFill />
</IconContext.Provider>
</div>
</Col>
</Row>
),
sortable: true
},
{
name: '',
width: '60px',
cell: (row: I2096NoParte) => (
<Row>
<Col>
<div
style={{
cursor: 'pointer'
cursor: 'pointer',
}}
onClick={() => {
loadDataNoParteVerificacion(row)
setShowModalNoParteVerificacion(true)
}}
>
<IconContext.Provider value={{ color: '#60DD0E', size: '30px' }}>
@ -194,15 +166,13 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) {
{
name: 'UMF',
width: '80px',
selector: (row: I2096NoParte) =>
row.unidadMedidaFactura ? row.unidadMedidaFactura : '',
selector: (row: I2096NoParte) => row.unidadMedidaFactura ? row.unidadMedidaFactura : '',
sortable: true
},
{
name: 'UMC',
width: '80px',
selector: (row: I2096NoParte) =>
row.unidadMedidaCOVE ? row.unidadMedidaCOVE : '',
selector: (row: I2096NoParte) => row.unidadMedidaCOVE ? row.unidadMedidaCOVE : '',
sortable: true
},
{
@ -245,8 +215,7 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) {
{
name: 'Fracc Original',
width: '130px',
cell: (row: I2096NoParteLog) =>
row.fraccionOriginal ? row.fraccionOriginal : '',
cell: (row: I2096NoParteLog) => row.fraccionOriginal ? row.fraccionOriginal : '',
sortable: true
},
{
@ -259,8 +228,7 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) {
{
name: 'NICO Original',
width: '130px',
cell: (row: I2096NoParteLog) =>
row.subdivisionOriginal ? row.subdivisionOriginal : '',
cell: (row: I2096NoParteLog) => row.subdivisionOriginal ? row.subdivisionOriginal : '',
sortable: true,
center: true
},
@ -269,7 +237,7 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) {
width: '250px',
cell: (row: I2096NoParteLog) => row.descripcionAgenteAduanal,
wrap: true,
sortable: true
sortable: true,
},
{
name: 'Desc Original',
@ -278,7 +246,7 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) {
wrap: true,
sorteable: true
},
{
name: 'Fecha / Hora',
width: '200px',
@ -288,7 +256,7 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) {
{
name: 'Usuario',
width: '300px',
cell: (row: I2096NoParteLog) => (row.sUsuario ? row.sUsuario : ''),
cell: (row: I2096NoParteLog) => row.sUsuario ? row.sUsuario : '',
wrap: true,
sortable: true
}
@ -326,7 +294,7 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) {
width: '100px',
cell: (row: DTO2096NoParteVerificacion) => row.aduana,
wrap: true,
sortable: true
sortable: true,
},
{
name: 'Pedimento',
@ -337,6 +305,7 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) {
}
]
const openLink = (item: string) => {
window.open('https://www.amazon.com/dp/' + item)
}
@ -346,7 +315,7 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) {
if (Id === 0) return NoAsignado
else if (Data.length) {
const Usuario = Data.filter((item) => item.idUsuario === Id)
return Usuario.length ? Usuario[0].nombre : NoAsignado
return Usuario ? Usuario[0].nombre : NoAsignado
}
return NoAsignado
}
@ -427,7 +396,6 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) {
}
AmazonDS.NoPartesGet(Search)
.then((response) => {
console.log(response.data)
dispatch(populateNoPartes(response.data))
})
.catch((e: Error) => {
@ -449,36 +417,11 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) {
AmazonDS.NoPartesUpdate(data)
.then((response) => {
dispatch(updateNoPartes(response.data))
setHeader('Informativo')
setMsg('La informacion se guardo correctamente')
setShowMsg(true)
})
.catch(function (error) {
console.log(error.toJSON())
if (error.message == 'Request failed with status code 400') {
setHeader('Error')
setMsg('Fraccion no valida!')
setShowMsg(true)
}
return
})
}
const deleteNoParte = () => {
AmazonDS.DeleteNoParte(IDParte)
.then((response) => {
dispatch(deleteNoPartes(IDParte))
setHeader('Informativo')
setMsg('La informacion se guardo correctamente')
.catch((e: Error) => {
setHeader('Error')
setMsg('Ocurrio un error: ' + e)
setShowMsg(true)
})
.catch(function (error) {
console.log(error.toJSON())
if (error.message == 'Request failed with status code 400') {
setHeader('Error')
setMsg('Fraccion no valida!')
setShowMsg(true)
}
return
})
}
@ -673,26 +616,26 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) {
<Modal.Title>No Parte: {Parte}</Modal.Title>
</Modal.Header>
<Modal.Body>
{/* <div style={{ height: '400px', overflow: 'scroll' }}> */}
<Row style={{ paddingTop: '15px' }}>
<Col xs={12}>
<DataTable
noHeader
fixedHeaderScrollHeight="400px"
defaultSortFieldId={'id'}
defaultSortAsc={true}
pagination
highlightOnHover
striped={true}
dense={true}
columns={colsNoPartesLOG}
data={NoParteLOG.filter(function (el) {
return el.id > 0
})}
/>
</Col>
</Row>
{/* </div> */}
{/* <div style={{ height: '400px', overflow: 'scroll' }}> */}
<Row style={{ paddingTop: '15px' }}>
<Col xs={12}>
<DataTable
noHeader
fixedHeaderScrollHeight="400px"
defaultSortFieldId={'id'}
defaultSortAsc={true}
pagination
highlightOnHover
striped={true}
dense={true}
columns={colsNoPartesLOG}
data={NoParteLOG.filter(function (el) {
return el.id > 0
})}
/>
</Col>
</Row>
{/* </div> */}
</Modal.Body>
</Modal>
@ -708,62 +651,27 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) {
<Modal.Title>No Parte: {Search}</Modal.Title>
</Modal.Header>
<Modal.Body>
<Row style={{ paddingTop: '15px' }}>
<Col xs={12}>
<DataTable
noHeader
fixedHeaderScrollHeight="400px"
defaultSortFieldId={'id'}
defaultSortAsc={true}
pagination
highlightOnHover
striped={true}
dense={true}
columns={colsNoPartesVerificacion}
data={DataNoParteVerificacion.filter(function (el) {
return el
})}
/>
</Col>
</Row>
{/* </div> */}
</Modal.Body>
</Modal>
<Modal
show={ShowModalDelete}
onHide={() => {
setShowModalDelete(false)
}}
size={'sm'}
dialogClassName={'modal-50w'}
>
<Modal.Header>
<Modal.Title>
<Row>
<Row style={{ paddingTop: '15px' }}>
<Col xs={12}>
<Alert variant="warning">
<h3>¿Esta seguro de eliminar el no parte: {Parte}</h3>
</Alert>
<DataTable
noHeader
fixedHeaderScrollHeight="400px"
defaultSortFieldId={'id'}
defaultSortAsc={true}
pagination
highlightOnHover
striped={true}
dense={true}
columns={colsNoPartesVerificacion}
data={DataNoParteVerificacion.filter(function (el) {
return el
})}
/>
</Col>
</Row>
</Modal.Title>
</Modal.Header>
<Modal.Body>
<Row style={{ paddingTop: '15px' }}>
<Col></Col>
<Col xs={5}>
<Button variant={'danger'} onClick={()=>{deleteNoParte()}}>Elimina</Button>
</Col>
<Col xs={5}>
<Button variant={'secondary'} onClick={()=>{setShowModalDelete(false)}}>Salir</Button>
</Col>
<Col></Col>
</Row>
{/* </div> */}
{/* </div> */}
</Modal.Body>
</Modal>
<MsgInformativo
show={show}
msg={msg}

@ -161,13 +161,6 @@ export default function RptAmazonFinishedClasificationInvoices(
})
}
function getReceiver(Cadena: string, char1: string[1], char2: string[1]) {
return Cadena.slice(
Cadena.indexOf(char1) + 1,
Cadena.lastIndexOf(char2),
);
}
return (
<div>
<Card>
@ -202,7 +195,6 @@ export default function RptAmazonFinishedClasificationInvoices(
<th style={{ width: '50px' }}></th>
<th style={{ width: '80px' }}>Commercial Invoice Date</th>
<th style={{ width: '300px' }}>Invoice Number</th>
<th style={{ width: '80px' }}>Receiver</th>
<th style={{ width: '100px' }}>Incoterms</th>
<th style={{ textAlign: 'center' }}>HAWB</th>
<th>Qty Unit of measure</th>
@ -308,13 +300,6 @@ export default function RptAmazonFinishedClasificationInvoices(
<td style={{ width: '300px' }}>
{MasterData.invoiceNumber}
</td>
<td style={{ width: '80px', textAlign:'center' }}>
{mInvoices
.filter((value) => value.id === MasterData.id)
.map((row) => {
return getReceiver(row.detail[0].amazonShipmentReferenceId,'_','_')
})}
</td>
<td style={{ width: '100px', textAlign: 'center' }}>
{MasterData.incoterms}
</td>

@ -4,7 +4,6 @@ import {
Button,
Card,
Col,
Form,
FormCheck,
Modal,
Row,
@ -36,8 +35,6 @@ import { MFileManager } from '../../../../../Utils/MFileManager/MFileManager'
import { AiFillWarning } from 'react-icons/ai'
import { PrioritySelector } from '../PrioritySelector/PrioritySelector'
import IFileManager from '../../../../../../Interfaces/Utils/IFileManager'
import { VscHubot } from 'react-icons/vsc'
import { populateCatConcetosConsultas } from '../../../../../../store/features/Clientes/2096/AmazonCatConceptosConsulta'
export interface IRtpAmazonPendingInvoicesProps {}
@ -67,7 +64,6 @@ export default function RtpAmazonPendingInvoices(
const [WaitingMessage, setWaitingMessage] = useState('Generado...')
const [ShowModal, setShowModal] = useState(false)
const [ShowModalW, setShowModalW] = useState(false)
const [BOTEnabled, setBOTEnabled] = useState(false)
const [msg, setMsg] = useState('')
const msgColor = 'primary'
@ -82,19 +78,8 @@ export default function RtpAmazonPendingInvoices(
})
}
const loadCatalogoTipoConsultas = async () => {
DSAmazon.CatConceptosConsultaGET()
.then((response) => {
dispatch(populateCatConcetosConsultas(response.data))
})
.catch((e: Error) => {
alert('Ocurrio un error' + e.message.toString())
})
}
useEffect(() => {
loadReport()
loadCatalogoTipoConsultas()
}, [])
const check4Updates = (IDInvoice: number) => {
@ -136,10 +121,16 @@ export default function RtpAmazonPendingInvoices(
const descargaArchivoExcepciones = () => {
setShowModalW(false)
setWaitingMessage('Archivo de excepciones')
/* setWaitingDialog(true)*/
/* DSAmazon.ExceptionsFileAmazonGET(IDFactura)
setWaitingDialog(true)
DSAmazon.ExceptionsFileAmazonGET(IDFactura)
.then((response: any) => {
if (response.status === 200) {*/
if (response.status === 200) {
/* const url = window.URL.createObjectURL(new Blob([response.data]))
const link = document.createElement('a')
link.href = url
link.setAttribute('download', 'Excepciones ' + Factura + '.xlsx')
document.body.appendChild(link)
link.click() */
DSAmazon.EnviaEsperaRespuestaAmazon(IDFactura)
.then((response) => {
loadReport()
@ -154,14 +145,14 @@ export default function RtpAmazonPendingInvoices(
setShowMsg(true)
return
})
// }
/* })
}
})
.catch((e: Error) => {
setHeader('Error')
setMsg('Ocurrio un error')
setShowMsg(true)
return
}) */
})
}
const descargaPantillaPartes = () => {
@ -312,37 +303,7 @@ export default function RtpAmazonPendingInvoices(
return
})
}
const RunBOT = (row: I2096Headers) => {
if (!BOTEnabled || row.max) {
toggleExpandRow(row)
return false
}
if (BOTEnabled) {
setWaitingMessage('BOT trabajando...')
setWaitingDialog(true)
DSAmazon.ClasificacionBOT(row.id)
.then((response) => {
if (response.data) {
setIDFactura(0)
setFactura('')
setShowModalInvoiceFile(false)
setWaitingDialog(false)
//loadReport()
toggleExpandRow(row)
return
}
})
.catch((e: Error) => {
setHeader('Error')
setMsg('Ocurrio un error')
setShowModalDeleteInvoice(false)
setWaitingDialog(false)
return
})
}
}
return (
<div>
<Card>
@ -356,30 +317,7 @@ export default function RtpAmazonPendingInvoices(
CLASIFICACION : facturas pendientes
</Card.Title>
</Col>
<Col xs={3}></Col>
<Col xs={2}>
{/* <Row>
<Col xs={4} style={{ textAlign: 'right' }}>
<IconContext.Provider
value={{ color: 'green', size: '65px' }}
>
<VscHubot />
</IconContext.Provider>
</Col>
<Col xs={8} style={{ textAlign: 'left', paddingTop: '25px' }}>
<Form.Check
type="switch"
id="custom-switch"
label="¿Aplica BOT?"
checked={BOTEnabled}
onChange={() => {
setBOTEnabled(!BOTEnabled)
}}
/>
</Col>
</Row> */}
<Form></Form>
</Col>
<Col xs={5}></Col>
<Col xs={2}>
<Alert
variant="primary"
@ -441,7 +379,7 @@ export default function RtpAmazonPendingInvoices(
<tr>
<th style={{ width: '50px' }}></th>
<th style={{ width: '50px' }}>id</th>
<th style={{ width: '50px', paddingRight: '20px' }}>
<th style={{ width: '50px', paddingRight:'20px' }}>
<IconContext.Provider
value={{ color: 'yellow', size: '20px' }}
>
@ -451,7 +389,7 @@ export default function RtpAmazonPendingInvoices(
<th style={{ width: '50px' }}></th>
<th style={{ width: '80px' }}>Commercial Invoice Date</th>
<th style={{ width: '300px' }}>Invoice Number</th>
<th style={{ width: '50px' }}>Receiver</th>
<th style={{ width: '50px' }}>Name</th>
<th style={{ width: '100px' }}>Incoterms</th>
<th style={{ width: '100px' }}>Qty Unit of measure</th>
<th style={{ width: '100px' }}>Tot Qty</th>
@ -503,8 +441,7 @@ export default function RtpAmazonPendingInvoices(
}
key={MasterData.id}
onClick={() => {
//toggleExpandRow(MasterData)
RunBOT(MasterData)
toggleExpandRow(MasterData)
}}
>
{MasterData.max === true ? (
@ -522,15 +459,10 @@ export default function RtpAmazonPendingInvoices(
)}
</td>
<td>{MasterData.id}</td>
<td style={{ textAlign: 'left' }}>
<PrioritySelector
IDInvoice={MasterData.id}
Priority={MasterData.urgente}
canChange={[
'Clasificador lider',
'Administrador'
].includes(Perfil)}
/>
<td style={{textAlign:'left'}}>
<PrioritySelector IDInvoice={MasterData.id} Priority={MasterData.urgente} canChange={['Clasificador lider', 'Administrador'].includes(
Perfil
)}/>
</td>
<td>
<FormCheck
@ -868,9 +800,7 @@ export default function RtpAmazonPendingInvoices(
return (
<RtpAmazonPendingClasificationInvoicesDetail
IDMaster={MasterData.id}
Prioridad={
MasterData.urgente
}
Prioridad={MasterData.urgente}
detail={detail}
Deshabilitado={
detail.destinationHTSCode
@ -1007,13 +937,6 @@ export default function RtpAmazonPendingInvoices(
</Modal.Header>
<Modal.Body>
<img src={loadingImg} style={{ height: '150px' }} alt="proccessing" />
{WaitingMessage.includes('BOT') ? (
<IconContext.Provider value={{ color: 'green', size: '65px' }}>
<VscHubot />
</IconContext.Provider>
) : (
''
)}
{WaitingMessage}
</Modal.Body>
<Modal.Footer></Modal.Footer>
@ -1094,9 +1017,8 @@ export default function RtpAmazonPendingInvoices(
Proceso={IDProcess}
showPreview={0}
canEdit={true}
Leyenda="Seleccione las facturas de Amazon"
onAppendMFM={function (Files: IFileManager[]): void {}}
/>
Leyenda="Seleccione las facturas de Amazon" onAppendMFM={function (Files: IFileManager[]): void {
} } />
</Col>
<Col></Col>
</Row>

@ -186,7 +186,7 @@ export default function RtpAmazonPendingInvoivesDetail(
style={{
textAlign: 'center',
cursor: 'pointer',
backgroundColor: props.detail.checked ? props.detail.confirmaFraccion==5 ? '#F7E2D2' : '#E6EEF5' : '#ffffff'
backgroundColor: props.detail.checked ? '#E6EEF5' : '#ffffff'
}}
className="DetailData"
onClick={() => openLink(props.detail.itemId)}
@ -196,7 +196,7 @@ export default function RtpAmazonPendingInvoivesDetail(
<td
style={{
textAlign: 'right',
backgroundColor: props.detail.checked ? props.detail.confirmaFraccion==5 ? '#F7E2D2' : '#E6EEF5' : '#ffffff'
backgroundColor: props.detail.checked ? '#E6EEF5' : '#ffffff'
}}
className="DetailData"
>
@ -205,7 +205,7 @@ export default function RtpAmazonPendingInvoivesDetail(
<td
style={{
textAlign: 'right',
backgroundColor: props.detail.checked ? props.detail.confirmaFraccion==5 ? '#F7E2D2' : '#E6EEF5' : '#ffffff'
backgroundColor: props.detail.checked ? '#E6EEF5' : '#ffffff'
}}
>
{props.detail.pedimentoDescription}
@ -214,7 +214,7 @@ export default function RtpAmazonPendingInvoivesDetail(
style={{
textAlign: 'center',
fontSize: '18px',
backgroundColor: props.detail.checked ? props.detail.confirmaFraccion==5 ? '#F7E2D2' : '#E6EEF5' : '#ffffff'
backgroundColor: props.detail.checked ? '#E6EEF5' : '#ffffff'
}}
>
&nbsp;&nbsp;{props.detail.destinationHTSCode}
@ -222,7 +222,7 @@ export default function RtpAmazonPendingInvoivesDetail(
<td
style={{
textAlign: 'center',
backgroundColor: props.detail.checked ? props.detail.confirmaFraccion==5 ? '#F7E2D2' : '#E6EEF5' : '#ffffff'
backgroundColor: props.detail.checked ? '#E6EEF5' : '#ffffff'
}}
className="DetailData"
>
@ -230,7 +230,7 @@ export default function RtpAmazonPendingInvoivesDetail(
<td
style={{
textAlign: 'center',
backgroundColor: props.detail.checked ? props.detail.confirmaFraccion==5 ? '#F7E2D2' : '#E6EEF5' : '#ffffff'
backgroundColor: props.detail.checked ? '#E6EEF5' : '#ffffff'
}}
className="DetailData"
>
@ -247,7 +247,7 @@ export default function RtpAmazonPendingInvoivesDetail(
<td
style={{
textAlign: 'center',
backgroundColor: props.detail.checked ? props.detail.confirmaFraccion==5 ? '#F7E2D2' : '#E6EEF5' : '#ffffff'
backgroundColor: props.detail.checked ? '#E6EEF5' : '#ffffff'
}}
className="DetailData"
>
@ -270,7 +270,7 @@ export default function RtpAmazonPendingInvoivesDetail(
<td
style={{
textAlign: 'center',
backgroundColor: props.detail.checked ? props.detail.confirmaFraccion==5 ? '#F7E2D2' : '#E6EEF5' : '#ffffff'
backgroundColor: props.detail.checked ? '#E6EEF5' : '#ffffff'
}}
className="DetailData"
>
@ -287,7 +287,7 @@ export default function RtpAmazonPendingInvoivesDetail(
<td
style={{
textAlign: 'center',
backgroundColor: props.detail.checked ? props.detail.confirmaFraccion==5 ? '#F7E2D2' : '#E6EEF5' : '#ffffff'
backgroundColor: props.detail.checked ? '#E6EEF5' : '#ffffff'
}}
className="DetailData"
>
@ -296,7 +296,7 @@ export default function RtpAmazonPendingInvoivesDetail(
<td
style={{
textAlign: 'center',
backgroundColor: props.detail.checked ? props.detail.confirmaFraccion==5 ? '#F7E2D2' : '#E6EEF5' : '#ffffff'
backgroundColor: props.detail.checked ? '#E6EEF5' : '#ffffff'
}}
className="DetailData"
>
@ -305,7 +305,7 @@ export default function RtpAmazonPendingInvoivesDetail(
<td
style={{
textAlign: 'right',
backgroundColor: props.detail.checked ? props.detail.confirmaFraccion==5 ? '#F7E2D2' : '#E6EEF5' : '#ffffff'
backgroundColor: props.detail.checked ? '#E6EEF5' : '#ffffff'
}}
className="DetailData"
>
@ -314,7 +314,7 @@ export default function RtpAmazonPendingInvoivesDetail(
<td
style={{
textAlign: 'right',
backgroundColor: props.detail.checked ? props.detail.confirmaFraccion==5 ? '#F7E2D2' : '#E6EEF5' : '#ffffff'
backgroundColor: props.detail.checked ? '#E6EEF5' : '#ffffff'
}}
className="DetailData"
>
@ -323,7 +323,7 @@ export default function RtpAmazonPendingInvoivesDetail(
<td
style={{
textAlign: 'right',
backgroundColor: props.detail.checked ? props.detail.confirmaFraccion==5 ? '#F7E2D2' : '#E6EEF5' : '#ffffff'
backgroundColor: props.detail.checked ? '#E6EEF5' : '#ffffff'
}}
className="DetailData"
>
@ -332,7 +332,7 @@ export default function RtpAmazonPendingInvoivesDetail(
<td
style={{
textAlign: 'center',
backgroundColor: props.detail.checked ? props.detail.confirmaFraccion==5 ? '#F7E2D2' : '#E6EEF5' : '#ffffff'
backgroundColor: props.detail.checked ? '#E6EEF5' : '#ffffff'
}}
className="DetailData"
>
@ -341,7 +341,7 @@ export default function RtpAmazonPendingInvoivesDetail(
<td
style={{
textAlign: 'center',
backgroundColor: props.detail.checked ? props.detail.confirmaFraccion==5 ? '#F7E2D2' : '#E6EEF5' : '#ffffff'
backgroundColor: props.detail.checked ? '#E6EEF5' : '#ffffff'
}}
className="DetailData"
>
@ -350,7 +350,7 @@ export default function RtpAmazonPendingInvoivesDetail(
<td
style={{
textAlign: 'center',
backgroundColor: props.detail.checked ? props.detail.confirmaFraccion==5 ? '#F7E2D2' : '#E6EEF5' : '#ffffff'
backgroundColor: props.detail.checked ? '#E6EEF5' : '#ffffff'
}}
className="DetailData"
>
@ -359,7 +359,7 @@ export default function RtpAmazonPendingInvoivesDetail(
<td
style={{
textAlign: 'center',
backgroundColor: props.detail.checked ? props.detail.confirmaFraccion==5 ? '#F7E2D2' : '#E6EEF5' : '#ffffff'
backgroundColor: props.detail.checked ? '#E6EEF5' : '#ffffff'
}}
className="DetailData"
>
@ -369,7 +369,7 @@ export default function RtpAmazonPendingInvoivesDetail(
<td
style={{
textAlign: 'center',
backgroundColor: props.detail.checked ? props.detail.confirmaFraccion==5 ? '#F7E2D2' : '#E6EEF5' : '#ffffff'
backgroundColor: props.detail.checked ? '#E6EEF5' : '#ffffff'
}}
className="DetailData"
>
@ -378,7 +378,7 @@ export default function RtpAmazonPendingInvoivesDetail(
<td
style={{
textAlign: 'center',
backgroundColor: props.detail.checked ? props.detail.confirmaFraccion==5 ? '#F7E2D2' : '#E6EEF5' : '#ffffff'
backgroundColor: props.detail.checked ? '#E6EEF5' : '#ffffff'
}}
className="DetailData"
>
@ -386,7 +386,7 @@ export default function RtpAmazonPendingInvoivesDetail(
</td>
<td
style={{
backgroundColor: props.detail.checked ? props.detail.confirmaFraccion==5 ? '#F7E2D2' : '#E6EEF5' : '#ffffff'
backgroundColor: props.detail.checked ? '#E6EEF5' : '#ffffff'
}}
>
<OverlayTrigger
@ -423,7 +423,7 @@ export default function RtpAmazonPendingInvoivesDetail(
</td>
<td
style={{
backgroundColor: props.detail.checked ? props.detail.confirmaFraccion==5 ? '#F7E2D2' : '#E6EEF5' : '#ffffff'
backgroundColor: props.detail.checked ? '#E6EEF5' : '#ffffff'
}}
>
<OverlayTrigger
@ -455,7 +455,7 @@ export default function RtpAmazonPendingInvoivesDetail(
<td
style={{
textAlign: 'center',
backgroundColor: props.detail.checked ? props.detail.confirmaFraccion==5 ? '#F7E2D2' : '#E6EEF5' : '#ffffff'
backgroundColor: props.detail.checked ? '#E6EEF5' : '#ffffff'
}}
>
<Form>

@ -2,7 +2,6 @@ import * as React from 'react'
import { useEffect, useState } from 'react'
import {
Alert,
Badge,
Button,
Card,
Col,
@ -34,15 +33,11 @@ import { MFileManager } from '../../../../../Utils/MFileManager/MFileManager'
import { setEmitFlags } from 'typescript'
import DTO2096RELParteFactura from '../../../DTO/DTO2096RELParteFactura'
import IFileManager from '../../../../../../Interfaces/Utils/IFileManager'
import { populateCatConcetosConsultas } from '../../../../../../store/features/Clientes/2096/AmazonCatConceptosConsulta'
export interface IRptPendingAnswerFromAmazonProps {}
export default function RptPendingAnswerFromAmazon(
props: IRptPendingAnswerFromAmazonProps
) {
const mExceptionCode = useSelector(
(state: RootState) => state.AmazonCatConceptosConsulta.CatConcetosConsulta
)
const [Usuario, setUsuario] = useState(() => {
const stickyValue = window.localStorage.getItem('UserId')
return stickyValue !== null ? JSON.parse(stickyValue) : ''
@ -62,9 +57,6 @@ export default function RptPendingAnswerFromAmazon(
const [Data, setData] = useState<DTO2096PerfilesParecidos[]>([])
const [ResumeData, setResumeData] = useState<DTO2096RELParteFactura[]>([])
const [AmazonAnswerFile, setAmazonAnswerFile] = useState<IFileManager[]>([])
const [DistinctExceptionCode, setDistinctExceptionCode] = useState<number[]>(
[]
)
const [header, setHeader] = useState('')
const [IDFactura, setIDFactura] = useState(0)
const [Factura, setFactura] = useState('')
@ -99,39 +91,6 @@ export default function RptPendingAnswerFromAmazon(
})
}
const loadDistinctExceptionCode = (id: number) => {
DSAmazon.InvoiceDistinctExceptionCodeGet(id)
.then((response) => {
setDistinctExceptionCode(response.data)
})
.catch((e: Error) => {
alert('Ocurrio un error' + e.message.toString())
})
}
const getExceptionCode = (id: number) => {
// console.log(mExceptionCode)
let code = mExceptionCode.filter((a) => {
if (a.id == id) {
return a
}
})
return code.length ? code[0].siglas : ''
}
const loadExceptionCodeCatalog = () => {
DSAmazon.CatConceptosConsultaGET()
.then((response) => {
dispatch(populateCatConcetosConsultas(response.data))
})
.catch((e: Error) => {
setHeader('Error')
setMsg('Ocurrio un error: ' + e)
setShowMsg(true)
return
})
}
const generateResume = (id: number) => {
DSAmazon.RELParteFacturasGET(id)
.then((response) => {
@ -145,29 +104,17 @@ export default function RptPendingAnswerFromAmazon(
})
}
const downloadExceptionsFile = (
id: number,
Factura: string,
ExceptionCode: number
) => {
//setWaitingDialog(true)
/* loadDistinctExceptionCode(id)
generateResume(id) */
//setFactura(Factura)
DSAmazon.ExceptionsFileAmazonGET(id, ExceptionCode)
const downloadExceptionsFile = (id: number, Factura: string) => {
setWaitingDialog(true)
generateResume(id)
setFactura(Factura)
DSAmazon.ExceptionsFileAmazonGET(id)
.then((response: any) => {
if (response.status === 200) {
const url = window.URL.createObjectURL(new Blob([response.data]))
const link = document.createElement('a')
link.href = url
link.setAttribute(
'download',
'Excepciones ' +
Factura +
'_' +
getExceptionCode(ExceptionCode) +
'.xlsx'
)
link.setAttribute('download', 'Excepciones ' + Factura + '.xlsx')
document.body.appendChild(link)
link.click()
}
@ -181,22 +128,15 @@ export default function RptPendingAnswerFromAmazon(
})
}
const loadInvoiceData = (id: number) => {
setWaitingDialog(true)
loadDistinctExceptionCode(id)
generateResume(id)
}
useEffect(() => {
loadReport()
loadProfiles()
loadExceptionCodeCatalog()
}, [])
const check4Updates = (IDInvoice: number) => {
DSAmazon.SETInvoiceDetailRevalidateParts(IDInvoice)
.then((response) => {
DSAmazon.AmazonInvoiceGET(IDInvoice)
DSAmazon.AmazonInvoiceGET(IDInvoice)
.then((response) => {
//console.log(JSON.stringify(response.data))
dispatch(updateInvoice(response.data[0]))
@ -248,10 +188,9 @@ export default function RptPendingAnswerFromAmazon(
.map((element) => {
let newElt = Object.assign({}, element) // copies element
return newElt.detail.filter(
(child) => child.idHeader === IDMaster && child.autorizado
(child) => child.idHeader === IDMaster && !child.autorizado
)
})
return Exceptions.length ? Exceptions[0].length : 0
}
@ -301,25 +240,25 @@ export default function RptPendingAnswerFromAmazon(
})
}
const ApplyAnswerFiles2Invoice = () => {
const ApplyAnswerFiles2Invoice = () => {
setWaitingMessage('Generando...')
const Filenames = AmazonAnswerFile.map((element) => element.nombreArchivo)
const Filenames = AmazonAnswerFile.map(element => element.nombreArchivo);
setWaitingDialog(true)
DSAmazon.ApplyAnswerFile2Invoice(Filenames)
.then((response) => {
loadReport()
setAmazonAnswerFile([])
setWaitingDialog(false)
setShowModal(false)
})
.catch((e: Error) => {
setAmazonAnswerFile([])
setIDFactura(0)
setHeader('Error')
setMsg('Ocurrio un error ' + e.toString())
setShowMsg(true)
return
})
.then((response) => {
loadReport()
setAmazonAnswerFile([])
setWaitingDialog(false)
setShowModal(false)
})
.catch((e: Error) => {
setAmazonAnswerFile([])
setIDFactura(0)
setHeader('Error')
setMsg('Ocurrio un error ' + e.toString())
setShowMsg(true)
return
})
}
return (
@ -366,7 +305,7 @@ export default function RptPendingAnswerFromAmazon(
<th style={{ width: '50px' }}></th>
<th style={{ width: '80px' }}>Commercial Invoice Date</th>
<th style={{ width: '300px' }}>Invoice Number</th>
<th style={{ width: '50px' }}>Receiver</th>
<th style={{ width: '50px' }}>Name</th>
<th style={{ width: '100px' }}>Incoterms</th>
<th style={{ width: '100px' }}>Qty Unit of measure</th>
<th style={{ width: '100px' }}>Tot Qty</th>
@ -439,16 +378,12 @@ export default function RptPendingAnswerFromAmazon(
<td>
{existsExeptions(MasterData.id) > 0 ? (
<div
onClick={() => {
/* downloadExceptionsFile(
onClick={() =>
downloadExceptionsFile(
MasterData.id,
MasterData.invoiceNumber
) */
setIDFactura(MasterData.id)
setFactura(MasterData.invoiceNumber)
loadInvoiceData(MasterData.id)
//setWaitingDialog(true)
}}
)
}
title="Archivo de excepciones"
>
<IconContext.Provider
@ -875,12 +810,10 @@ export default function RptPendingAnswerFromAmazon(
Proceso={IDProcess}
showPreview={3}
canEdit={true}
Leyenda="Sube archivos de respuesta de Amazon"
onAppendMFM={function (Files: IFileManager[]): void {
Leyenda="Sube archivos de respuesta de Amazon" onAppendMFM={function (Files: IFileManager[]): void {
setAmazonAnswerFile(Files)
setConfirmApplyAnswerFile(true)
}}
/>
}}/>
</Col>
<Col></Col>
</Row>
@ -905,18 +838,17 @@ export default function RptPendingAnswerFromAmazon(
variant={'danger'}
style={{ textAlign: 'center' }}
>
<h4>Desea aplicar el archivo de respuesta de Amazon?</h4>
<h4>Desea aplicar el archivo de respuesta de Amazon?</h4>
</Alert>
</Col>
</Row>
<Row style={{ paddingTop: '30px' }}>
<Row style={{paddingTop:'30px'}}>
<Col xs={12}>&nbsp;</Col>
</Row>
<Row style={{ paddingTop: '15px' }}>
<Col xs={6} style={{ textAlign: 'center' }}>
<Button
variant="secondary"
size="lg"
<Button
variant="secondary" size="lg"
onClick={() => {
setShowModalAnswerFile(false)
setConfirmApplyAnswerFile(false)
@ -926,13 +858,12 @@ export default function RptPendingAnswerFromAmazon(
</Button>
</Col>
<Col xs={6} style={{ textAlign: 'center' }}>
<Button
variant="danger"
size="lg"
<Button
variant="danger" size="lg"
onClick={() => {
setShowModalAnswerFile(false)
ApplyAnswerFiles2Invoice()
setConfirmApplyAnswerFile(false)
setConfirmApplyAnswerFile(false)
}}
>
&nbsp;&nbsp;&nbsp;Si&nbsp;&nbsp;&nbsp;
@ -958,7 +889,7 @@ export default function RptPendingAnswerFromAmazon(
<Modal.Title></Modal.Title>
</Modal.Header>
<Modal.Body>
{/* <img
<img
src={loadingImg}
style={{
height: WaitingMessage === 'Generando...' ? '150px' : '0px',
@ -966,31 +897,8 @@ export default function RptPendingAnswerFromAmazon(
}}
alt="proccessing"
/>
{WaitingMessage} */}
<div>
<Row>
{DistinctExceptionCode
? DistinctExceptionCode.map((code) => {
return (
<Col style={{ textAlign: 'center' }}>
<Badge
bg="primary"
style={{ cursor: 'pointer' }}
onClick={() => {
downloadExceptionsFile(IDFactura, Factura, code)
}}
>
<h6>{getExceptionCode(code)}</h6>
</Badge>
</Col>
)
})
: ''}
</Row>
</div>
<div
style={{ overflow: 'auto', height: '500px', paddingTop: '15px' }}
>
{WaitingMessage}
<div style={{ overflow: 'auto' }}>
<table>
<tr>
<td style={{ backgroundColor: '#6095BF', color: '#FFFFFF' }}>
@ -1017,7 +925,7 @@ export default function RptPendingAnswerFromAmazon(
</Modal.Body>
<Modal.Footer></Modal.Footer>
</Modal>
<MsgInformativo
show={show}
msg={msg}

@ -1,3 +1,4 @@
import * as React from 'react'
import { useEffect, useState } from 'react'
import {
Alert,
@ -7,10 +8,13 @@ import {
FormCheck,
Modal,
OverlayTrigger,
Popover,
Row,
Tooltip
} from 'react-bootstrap'
import { IconContext } from 'react-icons'
import { FaCheckCircle, FaQuestionCircle } from 'react-icons/fa'
import { ImCross } from 'react-icons/im'
import { MsgInformativo } from '../../../../../Utils/Toast/msgInformativo'
import { ComboDescripcion } from '../../../Components/ComboSelect/ComboDescripcion'
import { ComboFraccion } from '../../../Components/ComboSelect/ComboFraccion'
@ -42,14 +46,13 @@ export default function RptPendingAnswerFromAmazonDetail(
const [ShowModal, setShowModal] = useState(false)
const [EstatusSwith, setEstatusSwitch] = useState(props.detail.autorizado)
const [Fraccion, setFraccion] = useState(props.detail.fraccionGEMCO)
const [TipoConsulta, setTipoConsulta] = useState(props.detail.tipoConsulta)
const [UserChanged, setUserChanged] = useState(false)
const [DescripcionGEMCO, setDescripcionGEMCO] = useState(
props.detail.descripcionGEMCO
)
const [header, setHeader] = useState('')
const [show, setShowMsg] = useState(false)
//const [Show, setShow] = useState(false)
const [Show, setShow] = useState(false)
const [msg, setMsg] = useState('')
const [CumplimientoNormativo, setCumplimientoNormativo] = useState(
props.detail.cumplimientoNormativo ? props.detail.cumplimientoNormativo : ''
@ -139,36 +142,41 @@ export default function RptPendingAnswerFromAmazonDetail(
return
}
DSAmazon.ValidaFraccionGET(Fraccion)
.then((response) => {
if (response.data.respuesta === 'Si') {
const data: DTO2096FraccionDescripcion = {
id: id,
fraccion: Fraccion,
tipoConsulta: TipoConsulta,
cumplimientoNormativo: CumplimientoNormativo,
comentarios: Comentarios,
descripcionGEMCO: DescripcionGEMCO
}
DSAmazon.AutorizaItemFacturaAmazon(data)
.then((response) => {
editArray(id, !props.detail.autorizado)
setShowModal(false)
})
.catch((e: Error) => {})
} else {
alert(
'Esa fraccion no existe, favor de verificarla antes de guardarla'
)
return
.then((response) => {
if (response.data.respuesta === 'Si') {
const data: DTO2096FraccionDescripcion = {
id: id,
fraccion: Fraccion,
cumplimientoNormativo: CumplimientoNormativo,
comentarios: Comentarios,
descripcionGEMCO: DescripcionGEMCO
}
})
.catch((e: Error) => {
setHeader('Error')
setMsg('Ocurrio un error' + e.message.toString())
setShowMsg(true)
DSAmazon.AutorizaItemFacturaAmazon(data)
.then((response) => {
editArray(id, !props.detail.autorizado)
setShowModal(false)
})
.catch((e: Error) => {})
} else {
alert(
'Esa fraccion no existe, favor de verificarla antes de guardarla'
)
return
})
}
})
.catch((e: Error) => {
setHeader('Error')
setMsg(
'Ocurrio un error' + e.message.toString()
)
setShowMsg(true)
return
})
}
}
useEffect(() => {
@ -176,7 +184,7 @@ export default function RptPendingAnswerFromAmazonDetail(
autoriceItem(props.detail.id)
}, [EstatusSwith, UserChanged])
/* const ColorSET = (value: number, mode: number) => {
const ColorSET = (value: number, mode: number) => {
switch (mode) {
case 1: {
// Background color
@ -200,7 +208,7 @@ export default function RptPendingAnswerFromAmazonDetail(
break
}
}
} */
}
return (
<>
@ -255,7 +263,8 @@ export default function RptPendingAnswerFromAmazonDetail(
textAlign: 'center'
}}
className="DetailData"
></td>
>
</td>
<td
style={{
textAlign: 'center'
@ -290,6 +299,14 @@ export default function RptPendingAnswerFromAmazonDetail(
props.detail.validaFraccionOriginal === 0
? '#FFFAF2 '
: '#E5F7B6',
/* border:
props.detail.validaFraccionOriginal === 0
? '2px solid #F9A721'
: '2px solid green',
color:
props.detail.validaFraccionOriginal === 0
? '#5923F6'
: '#000000', */
border: '2px solid #000000',
color: '@000000',
width: '135px',
@ -393,11 +410,19 @@ export default function RptPendingAnswerFromAmazonDetail(
>
{props.detail.actualUnitCostMonetaryAmount}
</td>
<td className="DetailData">
<td
/* style={{visibility: EstatusSwith ? 'hidden' : 'visible'}} */
className="DetailData"
>
<FormCheck
className="form-check form-switch form-control-lg"
id="switchEnabled"
type="switch"
/* disabled={
props.detail.fraccionGEMCO ===
props.detail.destinationHTSCode.replaceAll('.', '')
} */
/* disabled={EstatusSwith} */
disabled={false}
checked={EstatusSwith && props.detail.autorizado}
onChange={() => {
@ -408,7 +433,12 @@ export default function RptPendingAnswerFromAmazonDetail(
label=""
/>
</td>
<td>
<td
/* style={{
visibility:
CumplimientoNormativo.length === 0 ? 'hidden' : 'visible'
}} */
>
<OverlayTrigger
placement="bottom"
overlay={
@ -430,7 +460,12 @@ export default function RptPendingAnswerFromAmazonDetail(
)}
</OverlayTrigger>
</td>
<td>
<td
/* style={{
visibility:
CumplimientoNormativo.length === 0 ? 'hidden' : 'visible'
}} */
>
<OverlayTrigger
placement="bottom"
overlay={<Tooltip id="button-tooltip-2">{Comentarios}</Tooltip>}

@ -144,6 +144,18 @@ export default function RptConsultaTrafico(props: IRptConsultaTraficoProps) {
if (Obj.max) */ check4Updates(IDInvoice)
}
/* const toggleInvoice = (id: number) => {
if (!Invoices.includes(id)) {
Invoices.push(id)
} else {
setInvoices(
Invoices.filter(function (el) {
return el != id
})
)
}
}*/
function getReceiver(Cadena: string, char1: string[1], char2: string[1]) {
return Cadena.slice(Cadena.indexOf(char1) + 1, Cadena.lastIndexOf(char2))
}
@ -179,6 +191,9 @@ export default function RptConsultaTrafico(props: IRptConsultaTraficoProps) {
<th></th>
<th style={{ width: '50px' }}>id</th>
<th style={{ width: '50px' }}></th>
{/*<th style={{ width: '50px' }}>PDF</th>
<th style={{ width: '50px' }}>Facturas</th>
<th style={{ width: '50px' }}>Partidas</th> */}
<th style={{ width: '100px' }}>Referencia</th>
<th style={{ width: '80px' }}>Commercial Invoice Date</th>
<th style={{ width: '250px' }}>Invoice Number</th>

@ -23,7 +23,6 @@ import {
import { MsgInformativo } from '../../../../Utils/Toast/msgInformativo'
import { AiFillFileExcel } from 'react-icons/ai'
import { IconContext } from 'react-icons'
import { BsSearch, BsFileEarmarkExcel } from 'react-icons/bs'
import { BsChevronDown, BsChevronRight, BsFilePdfFill } from 'react-icons/bs'
import { FaAmazon } from 'react-icons/fa'
import loadingImg from '../../../../../images/ajaxloader.gif'
@ -61,75 +60,58 @@ export default function RptAmazonFacturasPagadas(
const msgColor = 'primary'
const columnsConcepts = [
{
name: <div style={{ textAlign: 'center' }}>Factura</div>,
width: '300px',
name: 'Factura',
width: '350px',
selector: (row: DTO2096RptFacturasPagadas) => row.factura,
sortable: true
},
{
name: <div style={{ textAlign: 'center' }}>Pedimento</div>,
name: 'Pedimento',
width: '120px',
selector: (row: DTO2096RptFacturasPagadas) => row.pedimento,
sortable: true
},
{
name: <div style={{ textAlign: 'center' }}>Fecha Pago</div>,
name: 'Fecha pago',
width: '120px',
selector: (row: DTO2096RptFacturasPagadas) =>
row.fechaPago.substring(0, 10),
selector: (row: DTO2096RptFacturasPagadas) => row.fechaPago.substring(0,10),
sortable: true
},
{
name: <div style={{ textAlign: 'center' }}>Clave</div>,
name: 'Clave',
width: '80px',
selector: (row: DTO2096RptFacturasPagadas) => row.clave,
sortable: true
},
{
name: <div style={{ textAlign: 'center' }}>Tipo Operacion</div>,
name: 'Tipo Op',
width: '120px',
selector: (row: DTO2096RptFacturasPagadas) => row.tipoOp,
sortable: true
},
{
name: <div style={{ textAlign: 'center' }}>Valor Dolares</div>,
name: 'Valor Dolares',
width: '130px',
selector: (row: DTO2096RptFacturasPagadas) => row.valorDolares,
sortable: true
},
{
name: <div style={{ textAlign: 'center' }}>Valor Aduana </div>,
name: 'Valor Aduana',
width: '130px',
selector: (row: DTO2096RptFacturasPagadas) => row.valorAduana,
sortable: true
},
{
name: <div style={{ textAlign: 'center' }}>Razon Social</div>,
name: 'Razon Social',
width: '350px',
selector: (row: DTO2096RptFacturasPagadas) => row.razonSocial,
sortable: true
},
{
name: <div style={{ textAlign: 'center' }}>Aduana</div>,
width: '100px',
name: 'Aduana',
width: '550px',
selector: (row: DTO2096RptFacturasPagadas) => row.aduana,
sortable: false
},
{
name: <div style={{ textAlign: 'center' }}>Piezas</div>,
width: '100px',
selector: (row: DTO2096RptFacturasPagadas) => row.piezas,
sortable: false
}
]
@ -155,10 +137,7 @@ export default function RptAmazonFacturasPagadas(
exportExcel(Data, 'Reporte de facturas pagadas de Amazon')
}
function exportExcel(
jsonData: DTO2096RptFacturasPagadas[],
fileName: string
): void {
function exportExcel(jsonData: DTO2096RptFacturasPagadas[], fileName: string): void {
let Heading = [
[
'Factura',
@ -169,8 +148,7 @@ export default function RptAmazonFacturasPagadas(
'Valor Dolares',
'Valor Aduana',
'Razon Social',
'Aduana',
'Piezas'
'Aduana'
]
]
const dataOnly = jsonData.map(
@ -183,8 +161,7 @@ export default function RptAmazonFacturasPagadas(
valorDolares,
valorAduana,
razonSocial,
aduana,
piezas
aduana
}) => {
return {
factura,
@ -195,8 +172,7 @@ export default function RptAmazonFacturasPagadas(
valorDolares,
valorAduana,
razonSocial,
aduana,
piezas
aduana
}
}
)
@ -210,8 +186,7 @@ export default function RptAmazonFacturasPagadas(
valorDolares,
valorAduana,
razonSocial,
aduana,
piezas
aduana
}) => {
return {
factura,
@ -222,8 +197,7 @@ export default function RptAmazonFacturasPagadas(
valorDolares,
valorAduana,
razonSocial,
aduana,
piezas
aduana
}
}
)
@ -241,6 +215,7 @@ export default function RptAmazonFacturasPagadas(
}
}
useEffect(() => {
loadReport()
}, [])
@ -258,20 +233,7 @@ export default function RptAmazonFacturasPagadas(
Facturas Pagadas
</Card.Title>
</Col>
<Col>
<Col style={{ textAlign: 'center' }}>
<Button
variant="success"
onClick={() => {
downloadExcel()
}}
>
<BsFileEarmarkExcel />
Excel
</Button>
</Col>
</Col>
<Col><Button variant="success" onClick={()=>{downloadExcel()}}>Excel</Button></Col>
<Col style={{ textAlign: 'right' }}>Desde</Col>
<Col xs={1}>
<Form.Control
@ -305,12 +267,7 @@ export default function RptAmazonFacturasPagadas(
loadReport()
}}
>
{/* <div className="col-md-3 d-flex aling-items-center"> */}
<Button variant="primary">
Buscar <BsSearch />
</Button>
{/* </div> */}
<Button variant="primary">Buscar</Button>
</Col>
</Row>
</Card.Body>

@ -25,7 +25,6 @@ import { AiFillFileExcel } from 'react-icons/ai'
import { IconContext } from 'react-icons'
import { BsChevronDown, BsChevronRight, BsFilePdfFill } from 'react-icons/bs'
import { FaAmazon } from 'react-icons/fa'
import { BsSearch, BsFileEarmarkExcel } from 'react-icons/bs'
import loadingImg from '../../../../../images/ajaxloader.gif'
import { MFileManager } from '../../../../Utils/MFileManager/MFileManager'
import DTO2096RptPayedOperations from '../../DTO/DTO2096RptPayedOperations'
@ -34,7 +33,6 @@ import IFileManager from '../../../../../Interfaces/Utils/IFileManager'
import DTO2096RptFacturasPagadas from '../../DTO/DTO2096RptFacturasPagadas'
import DataTable from 'react-data-table-component'
import * as XLSX from 'xlsx'
import DTOAmazonSegragacion from '../../DTO/DTOAmazonSegragacion'
export interface IRptSegregacionProps {}
@ -47,7 +45,7 @@ export default function RptSegregacion(props: IRptSegregacionProps) {
const [Referencia, setReferencia] = useState('')
const [Inicio, setInicio] = useState(currentDate())
const [Fin, setFin] = useState(currentDate())
const [Data, setData] = useState<DTOAmazonSegragacion[]>([])
const [Data, setData] = useState<DTO2096RptFacturasPagadas[]>([])
const [show, setShowMsg] = useState(false)
const [ShowModal, setShowModal] = useState(false)
const [WaitingDialog, setWaitingDialog] = useState(false)
@ -58,50 +56,61 @@ export default function RptSegregacion(props: IRptSegregacionProps) {
const [IDFactura, setIDFactura] = useState(0)
const [Invoices, setInvoices] = useState<number[]>([])
const msgColor = 'primary'
const columnsConcepts = [
{
name: 'VRID',
width: '150px',
selector: (row: DTOAmazonSegragacion) => row.vrid,
name: 'Factura',
width: '350px',
selector: (row: DTO2096RptFacturasPagadas) => row.factura,
sortable: true
},
{
name: 'ASIN',
width: '150px',
selector: (row: DTOAmazonSegragacion) => row.asin,
name: 'Pedimento',
width: '120px',
selector: (row: DTO2096RptFacturasPagadas) => row.pedimento,
sortable: true
},
{
name: 'Quantyty',
width: '100px',
selector: (row: DTOAmazonSegragacion) => row.quantity,
name: 'Fecha pago',
width: '120px',
selector: (row: DTO2096RptFacturasPagadas) =>
row.fechaPago.substring(0, 10),
sortable: true
},
{
name: 'Descripcion',
width: '250px',
selector: (row: DTOAmazonSegragacion) => row.descripcion,
name: 'Clave',
width: '80px',
selector: (row: DTO2096RptFacturasPagadas) => row.clave,
sortable: true
},
{
name: 'Motivo',
width: '2100px',
selector: (row: DTOAmazonSegragacion) => row.motivo,
name: 'Tipo Op',
width: '120px',
selector: (row: DTO2096RptFacturasPagadas) => row.tipoOp,
sortable: true
},
{
name: 'Valor Dolares',
width: '130px',
selector: (row: DTO2096RptFacturasPagadas) => row.valorDolares,
sortable: true
},
{
name: 'FSegregacion',
width: '160px',
selector: (row: DTOAmazonSegragacion) => row.fSegregacion,
name: 'Valor Aduana',
width: '130px',
selector: (row: DTO2096RptFacturasPagadas) => row.valorAduana,
sortable: true
},
{
name: 'ValorMercancia',
width: '160px',
selector: (row: DTOAmazonSegragacion) => row.valorMercancia,
name: 'Razon Social',
width: '350px',
selector: (row: DTO2096RptFacturasPagadas) => row.razonSocial,
sortable: true
},
{
name: 'Aduana',
width: '550px',
selector: (row: DTO2096RptFacturasPagadas) => row.aduana,
sortable: false
}
]
@ -133,16 +142,6 @@ export default function RptSegregacion(props: IRptSegregacionProps) {
})
}
const loadReport = () => {
DSAmazon.GETReportesSegregadoss(Inicio, Fin)
.then((response) => {
setData(response.data)
})
.catch((e: Error) => {
alert('Ocurrio un error' + e.message.toString())
})
}
return (
<div>
<Card>
@ -190,47 +189,8 @@ export default function RptSegregacion(props: IRptSegregacionProps) {
downloadReport()
}}
>
<Button variant="primary">
<BsFileEarmarkExcel />
Descargar
</Button>
<Button variant="primary">Descargar</Button>
</Col>
<Col
style={{ textAlign: 'center' }}
onClick={() => {
loadReport()
}}
>
<Button variant="primary">
{' '}
<BsSearch />
Buscar
</Button>
</Col>
<Card>
<Card.Body>
<div
className="ag-theme-alpine"
style={{ height: 500, width: '100%' }}
>
<DataTable
noHeader
defaultSortFieldId={''}
defaultSortAsc={true}
striped={true}
dense={true}
paginationPerPage={10}
pagination
highlightOnHover
columns={columnsConcepts}
data={Data}
pointerOnHover
/>
</div>
</Card.Body>
</Card>
</Row>
</Card.Body>
</Card>

@ -25,8 +25,6 @@ import DTO2096TraficoConsultaAmazonDetail from '../DTO/DTO2096TraficoConsultaAma
import DTO2096TraficoConsultaAmazonHeader from '../DTO/DTO2096TraficoConsultaAmazonHeader'
import DTO2096DataTraficoConsulta from '../DTO/DTO2096DataTraficoConsulta'
import I2096CatGrupoRegulatorio from '../Interfaces/I2096CatGrupoRegulatorio'
import DTOAmazonSegragacion from '../DTO/DTOAmazonSegragacion'
import ICat2096CatConceptosConsulta from '../Interfaces/I2096CatConceptosConsulta'
class AmazonDataService {
AmazonPendingClasificationInvoiceGET() {
@ -87,8 +85,8 @@ class AmazonDataService {
AmazonFacturasPagadasGET(Inicio: string, Fin: string) {
return http.get<DTO2096RptFacturasPagadas[]>(`/AmazonInvoice/AmazonFacturasPagadasGET?Inicio=${Inicio}&Fin=${Fin}`)
}
AmazonInvoiceStatusGET(Invoice: string , Inicio: string, Fin: string) {
return http.get<DTO2096InvoiceStatus[]>(`/AmazonInvoice/AmazonInvoiceStatusGET?Invoice=${Invoice}&Inicio=${Inicio}&Fin=${Fin}`)
AmazonInvoiceStatusGET(Invoice: string) {
return http.get<DTO2096InvoiceStatus[]>(`/AmazonInvoice/AmazonInvoiceStatusGET?Invoice=${Invoice}`)
}
AmazonInvoicePrioritySET(Id: number, Prioridad: boolean) {
return http.get<I2096Headers[]>(`/AmazonInvoice/AmazonInvoicePrioritySET?id=${Id}&prioridad=${Prioridad}`)
@ -143,8 +141,8 @@ class AmazonDataService {
console.log(error)
})
}
ExceptionsFileAmazonGET(id: number, code: number) {
return http.get<ArrayBuffer>(`/AmazonInvoice/ExceptionsFileAmazonGET?id=${id}&code=${code}`, {responseType: 'arraybuffer'})
ExceptionsFileAmazonGET(id: number) {
return http.get<ArrayBuffer>(`/AmazonInvoice/ExceptionsFileAmazonGET?id=${id}`, {responseType: 'arraybuffer'})
.then(function (response) {
return response
})
@ -199,21 +197,6 @@ class AmazonDataService {
return error
})
}
GETReportesSegregadoss(Inicio: string, Fin: string){
return http.get<DTOAmazonSegragacion[]>(`/AmazonInvoice/GETAmazonReportesSegregadoss?Inicio=${Inicio}&Fin=${Fin}`)
}
TraficoConsultasAmazonGenerateExcel(id: number) {
return http.get<ArrayBuffer>(`/AmazonInvoice/TraficoConsultaAmazonGenerateExcel?id=${id}`, {responseType: 'arraybuffer'})
.then(function (response) {
@ -281,20 +264,5 @@ class AmazonDataService {
TraficoConsultasAmazonById(id: number) {
return http.get<DTO2096TraficoConsultaAmazonHeader>(`/AmazonInvoice/TraficoConsultasAmazonById?id=${id}`)
}
ClasificacionBOT(id: number) {
return http.get<DTO2096TraficoConsultaAmazonHeader>(`/AmazonInvoice/Bot/Clasificacion?id=${id}`)
}
DeleteNoParte(id: number) {
return http.delete<Boolean>(`/AmazonInvoice/DeleteNoParte?id=${id}`)
}
CatConceptosConsultaGET() {
return http.get<ICat2096CatConceptosConsulta[]>(`/AmazonInvoice/Catalogos/CatConceptosConsultaGET`)
}
CatConceptosConsultaAppend(data: ICat2096CatConceptosConsulta) {
return http.post<ICat2096CatConceptosConsulta>(`/AmazonInvoice/Catalogos/CatConceptosConsultaAppend`, data)
}
InvoiceDistinctExceptionCodeGet(id: number) {
return http.get<number[]>(`/AmazonInvoice/Invoice/DistinctExceptionCodeGet?id=${id}`)
}
}
export default new AmazonDataService()

@ -25,20 +25,20 @@ export default function Dashboard(props: IProps) {
<br />
<Container>
<Row xs={1} md={3} className='g-4'>
{/* {[['Direcccion', 'Sistemas', 'Corresponsalias'].includes(Depto) ? <DashboardCorresponsales /> : ''].map(
{[['Direcccion', 'Sistemas', 'Corresponsalias'].includes(Depto) ? <DashboardCorresponsales /> : ''].map(
(item) => {
return <React.Fragment>{item}</React.Fragment>
}
)} */}
{/* {[['Direcccion', 'Sistemas', 'Contabilidad'].includes(Depto) ? <DashboardContabilidad /> : ''].map((item) => {
)}
{[['Direcccion', 'Sistemas', 'Contabilidad'].includes(Depto) ? <DashboardContabilidad /> : ''].map((item) => {
return <React.Fragment>{item}</React.Fragment>
})} */}
{/* {[['Heineken1'].includes(User) ? <Heineken1 /> : ''].map((item) => {
})}
{[['Heineken1'].includes(User) ? <Heineken1 /> : ''].map((item) => {
return <React.Fragment>{item}</React.Fragment>
})}
{[['Direcccion', 'Sistemas', 'Facturacion'].includes(Depto) ? <DashboardFacturacion /> : ''].map((item) => {
return <React.Fragment>{item}</React.Fragment>
})} */}
})}
{[['Direcccion', 'Sistemas', 'Operaciones', 'Clasificacion'].includes(Depto) ? <DashboardClasificacion /> : ''].map((item) => {
return <React.Fragment>{item}</React.Fragment>
})}

@ -1,125 +0,0 @@
import { useEffect, useState } from 'react'
import { Button, Card, Col, Row } from 'react-bootstrap'
import DataTable from 'react-data-table-component'
import IConsolidadosSinFirmaBanco from '../../../../Interfaces/Facturacion/Anexo/IConsolidadosSinFirmaBanco'
import DSOperaciones from '../../../../Services/Operaciones/Operaciones.Services'
import * as XLSX from 'xlsx'
import { BsFileEarmarkExcel } from 'react-icons/bs'
export interface IRtpConsolidadosSinFirmaBancoProps {}
export default function RtpConsolidadosSinFirmaBanco(
props: IRtpConsolidadosSinFirmaBancoProps
) {
const [Data, setData] = useState<IConsolidadosSinFirmaBanco[]>([])
const [Total, setTotal] = useState(0)
const columnsConcepts = [
{
name: 'Referencia',
width: '150px',
cell: (row: IConsolidadosSinFirmaBanco) => row.referencia,
sortable: true
},
{
name: 'Fecha Pago',
width: '250px',
cell: (row: IConsolidadosSinFirmaBanco) => row.fechaPago,
sortable: true
},
{
name: 'Fecha Validacion',
width: '250px',
cell: (row: IConsolidadosSinFirmaBanco) => row.firmaValidacion,
sortable: true
},
{
name: 'Firma Banco',
with: '250px',
cell: (row: IConsolidadosSinFirmaBanco) => row.firmaBanco,
sortable: true
}
]
const downloadExcel = () => {
exportExcel(Data, 'Consolidados sin firma de banco')
}
function exportExcel(jsonData: any[], fileName: string): void {
let Heading = [
['Referencia', 'FechaPago', 'Fecha Validacion', 'Firma Banco']
]
const wb = XLSX.utils.book_new()
const ws: XLSX.WorkSheet = XLSX.utils.json_to_sheet([])
XLSX.utils.sheet_add_aoa(ws, Heading)
XLSX.utils.sheet_add_json(ws, jsonData, { origin: 'A2', skipHeader: true })
XLSX.utils.book_append_sheet(wb, ws, 'Sheet1')
XLSX.writeFile(wb, fileName + '.xlsx')
var range = XLSX.utils.decode_range(ws['!ref?'])
for (var C = range.s.c; C <= range.e.c; ++C) {
var address = XLSX.utils.encode_col(C) + '1' // <-- first row, column number C
if (!ws[address]) continue
ws[address].v = ws[address].v.toUpperCase()
}
}
const generaReporte = () => {
DSOperaciones.OperacionesSinFirmaBancoGet()
.then((response) => {
setData(response.data)
setTotal(response.data.length)
})
.catch((e: Error) => {
console.log(e)
})
}
useEffect(() => {
generaReporte()
}, [])
return (
<div>
<Card>
<Card.Body>
<Card.Title>
<Row>
<Col xs={3}>Consolidados sin firma banco : {Total} registros</Col>
<Col xs={8}></Col>
<Col xs={1} className="colAlignRight">
<Button
size="sm"
variant="success"
onClick={() => {
downloadExcel()
}}
>
<BsFileEarmarkExcel />
&nbsp;Excel
</Button>
</Col>
</Row>
</Card.Title>
<Row>
<Col xs={12}>
<DataTable
dense
noHeader
defaultSortFieldId={'cliente'}
defaultSortAsc={true}
fixedHeaderScrollHeight="550px"
striped={true}
fixedHeader
/* paginationPerPage={10}
pagination */
highlightOnHover
columns={columnsConcepts}
data={Data}
pointerOnHover
/>
</Col>
</Row>
</Card.Body>
</Card>
</div>
)
}

@ -14,7 +14,6 @@ import { MsgInformativo } from '../Utils/Toast/msgInformativo'
import logo from '../../images/GEMCO_mini.png'
import Dashboard from '../Dashboard/Dashboard'
import { Nav } from 'react-bootstrap'
import Info from '../../../package.json'
export const Login: React.FC<{}> = () => {
const dispatch = useDispatch()
@ -133,7 +132,6 @@ export const Login: React.FC<{}> = () => {
login
</button>
</div>
<div style={{textAlign:'right'}}>v{Info.version}</div>
</Form>
</Formik>
</div>

@ -117,27 +117,12 @@ export const UserList: React.FC<IProps> = (props) => {
),
sortable: true
},
{
name: 'Departamento',
width: '250px',
cell: (row: IRegister) => (
<div
style={{ width: '100%' }}
onClick={() => {
props.GetUserInfo(row)
}}
>
{row.departamento}
</div>
),
sortable: true
},
{
name: 'Estatus',
width: '90px',
cell: (row: IRegister) => (
<div
style={{ width: '100%', textAlign: 'center' }}
style={{ width: '100%', textAlign:'center' }}
onClick={() => {
props.GetUserInfo(row)
}}
@ -167,10 +152,6 @@ export const UserList: React.FC<IProps> = (props) => {
return NoAsignado
}
// getDepartamento = (Id: Number) => {
// }
useEffect(() => {
usuariosServices
.getAllUsuarios()
@ -185,7 +166,6 @@ export const UserList: React.FC<IProps> = (props) => {
.then((response) => {
setDataPerfiles(response.data)
})
.catch((e: Error) => {
console.log(e)
})

@ -18,8 +18,6 @@ import {
import { useEffect, useState } from 'react'
import IPerfilesMenu from '../../Interfaces/IPerfilesMenu'
import { IPerfil } from '../../Interfaces/Catalogos/IPerfiles'
// import { IDepartamento } from '../../Interfaces/Catalogos/IDepartamento'
import PerfilesMenuServices from '../../Services/Catalogos/PerfilesMenu.Services'
import ClientesServices from '../../Services/Catalogos/Clientes.Services'
import usuariosServices from '../../Services/Catalogos/Usuarios.Services'
@ -36,7 +34,6 @@ import DTOUsuariosShort from '../../DTO/DTOUsuariosShort'
import DTOClonarUsuario from '../../DTO/DTOClonarUsuario'
import { AdmonPerfiles } from './admonPerfiles/AdmonPerfiles'
import { Form as FormCtrl } from 'react-bootstrap'
import { Console } from 'console'
interface IProps {}
@ -55,7 +52,7 @@ const SignupSchema = Yup.object().shape({
correo: Yup.string().email('Correo invalido').required('Requirido')
})
export default function Register(props: IProps) {
export default function Register(props:IProps) {
const [UserId, setUserId] = useState(() => {
const stickyValue = window.localStorage.getItem('UserId')
return stickyValue !== null ? JSON.parse(stickyValue) : 0
@ -95,7 +92,6 @@ export default function Register(props: IProps) {
const [TokenAccesoM, setTokenAccesoM] = useState('')
const [DeviceToken, setDeviceToken] = useState('')
const [IdPerfil, setIdPerfil] = useState(0)
const [Departamento, setDepartamento] = useState('')
const [user2Clone, setUser2Clone] = React.useState(0)
const [perfiles, setPerfiles] = useState<IPerfil[]>([
{
@ -144,8 +140,7 @@ export default function Register(props: IProps) {
codigoAccesoM: CodigoAccesoM,
tokenAccesoM: TokenAccesoM,
deviceToken: DeviceToken,
idPerfil: IdPerfil,
departamento: Departamento
idPerfil: IdPerfil
}
const initialValuesPerfiles: IPerfil = {
@ -153,11 +148,6 @@ export default function Register(props: IProps) {
perfil: ''
}
// const initialValuesDepartamento: IDepartamento = {
// id: Dept,
// descripcion: ''
// }
function getUsuario() {
const item = localStorage.getItem('tokenInfo')
let Usr = ''
@ -377,13 +367,13 @@ export default function Register(props: IProps) {
}
const CloseModalPerfiles = (show: boolean): void => {
setmodalAdmonPerfiles(false)
//setmodalAdmonPerfiles(false);
}
function loadAllUserInfo(id: number) {}
const GetUserInfo = (data: IRegister): void => {
console.log('data from get usuario ' + JSON.stringify(data))
console.log('data from get usuario '+JSON.stringify(data))
setIdUsuario(data.id)
setUsuario(data.usuario)
setNombre(data.nombre)
@ -391,20 +381,16 @@ export default function Register(props: IProps) {
setCorreo(data.correo)
setIdPerfil(data.idPerfil)
loadAllUserInfo(data.id)
setTipoUsuario(data.tipoUsuario)
setDepartamento(data.departamento)
setDept(data.dept)
}
const clonaInformacion = (): void => {
// alert(IdPerfil)
// alert(IdPerfil)
if (IdPerfil == 0) {
setToastPerfil(true)
setmsgDialog('')
return
} else setShowConfirmation(true)
} else
setShowConfirmation(true)
}
const ChangeUser2Clone = (e: any): void => {
@ -556,7 +542,6 @@ export default function Register(props: IProps) {
name="nombre"
className="form-control"
placeholder="nombre"
// onChange={(e) => setNombre(e.target.value)}
/>
{errors.nombre && touched.nombre ? (
<div>
@ -698,40 +683,24 @@ export default function Register(props: IProps) {
</Field>
</div>
</div>
<div className="col">
<div className="form-group">
<label
className="text-info"
htmlFor="Departamento"
htmlFor="fechaModifico"
>
Departamento
Fecha modifico
</label>
<FormCtrl.Control
as="select"
value={Dept}
onChange={
(e) => setDept(parseInt(e.target.value))
// setDepartamento(e.target.value)
}
className="form-select form-select-sm"
// style={{ width: '270px', height: '37px' }}
>
<option value="0">No Asignado</option>
<option value="1">Corresponsalias</option>
<option value="2">Contabilidad</option>
<option value="3">Sistemas</option>
<option value="4">Direccion</option>
<option value="5">Administracion</option>
<option value="6">Facturacion</option>
<option value="7">Clasificacion</option>
<option value="8">Trafico</option>
<option value="9">Operaciones</option>
</FormCtrl.Control>
<Field
id="fechaModifico"
name="fechaModifico"
readOnly="readOnly"
className="form-control"
placeholder="Fecha modifico"
defaultValue={currentDate()}
/>
</div>
</div>
{/* aquo termina el div */}
</div>
</Accordion.Body>
</Accordion.Item>
@ -801,8 +770,6 @@ export default function Register(props: IProps) {
name="dept"
className="form-control"
placeholder="departamento"
// IsReadOnly="True"
disabled="diabled"
/>
</div>
</div>

@ -1,401 +0,0 @@
import React, { FC, useEffect, useState } from 'react'
// Bootstrap components
import { Button, Card, Form } from 'react-bootstrap'
import { BsSearch, BsFileEarmarkExcel } from 'react-icons/bs'
// Interfaces
import IClientes from '../../Interfaces/Catalogos/IClientes'
import IArchivoElectronico from '../../Interfaces/IArchivoElectronico'
// DTOs
import DTOReporte from '../../DTO/DTOReporte'
// Services
import reportsDataService from '../../Services/Reportes/reportes.services'
import ClientesDataService from '../../Services/Catalogos/Clientes.Services'
import { useDispatch } from 'react-redux'
import { setArchivoElectronico } from '../../store/features/Reportes/ArchivoElectronico'
// GUI components
import { MsgInformativo } from '../Utils/Toast/msgInformativo'
import { AgGridReact } from 'ag-grid-react'
import { RowClickedEvent } from 'ag-grid-community'
import { TargetURL } from '../../Constants/TargetURL'
//Other
import moment from 'moment'
import * as XLSX from 'xlsx'
import IRptArcosa from '../../Interfaces/Reportes/IRptArcosa'
interface IProps {}
const RptArcosa: FC<IProps> = (props) => {
const [UserId, setUserId] = useState(() => {
const stickyValue = window.localStorage.getItem('UserId')
return stickyValue !== null ? JSON.parse(stickyValue) : 0
})
const [Data, setData] = useState<Array<IRptArcosa>>([])
const [filteredData, setFilteredData] = useState<Array<IRptArcosa>>([])
const [Inicio, setInicio] = useState(currentDate())
const [Fin, setFin] = useState(currentDate())
const [TipoOperacion, setTipoOperacion] = useState(1)
const [Cliente, setCliente] = useState(0)
const [Clientes, setClientes] = useState<Array<IClientes>>()
const [msgColor, setMsgColor] = React.useState('primary')
const [show, setShowMsg] = useState(false)
const [header, setHeader] = useState('')
const [msg, setMsg] = useState('')
const [filtro, setFiltro] = useState('')
const gridRef = React.useRef<any>(null)
const [columnaVerPDF, setcolumnaVerPDF] = useState(false)
const dispatch = useDispatch()
const [columnDefs] = useState([
{
field: 'patente',
headerName: 'Patente',
sortable: true,
filter: true,
width: 150
},
{
field: 'pedimento',
headerName: 'Pedimento',
sortable: true,
filter: true,
width: 150
},
{
field: 'pagoPedimento',
headerName: 'PagoPedimento',
sortable: true,
filter: true,
width: 200
},
{
field: 'regimen',
headerName: 'Regimen',
sortable: true,
filter: true,
width: 150
},
{
field: 'valorDls',
headerName: 'ValorDls',
sortable: true,
filter: true,
width: 150
},
{
field: 'valorAduana',
headerName: 'ValorAduana',
sortable: true,
filter: true,
width: 150
},
{
field: 'aduana',
headerName: 'Aduana',
sortable: true,
filter: true,
width: 150
},
{
field: 'planta',
headerName: 'Planta',
sortable: true,
filter: true,
width: 150
},
{
field: 'dta',
headerName: 'DTA',
sortable: true,
filter: true,
width: 150
},
{
field: 'prev',
headerName: 'PREV',
sortable: true,
filter: true,
width: 150
},
{
field: 'iva',
headerName: 'IVA',
sortable: true,
filter: true,
width: 150
},
{
field: 'ivaprev',
headerName: 'IVAPREV',
sortable: true,
filter: true,
width: 150
},
{
field: 'igi',
headerName: 'IGI',
sortable: true,
filter: true,
width: 150
},
{
field: 'cc',
headerName: 'CC',
sortable: true,
filter: true,
width: 150
},
{
field: 'total',
headerName: 'Total',
sortable: true,
filter: true,
width: 150
}
])
function currentDate(): string {
var today = new Date()
var dd = String(today.getDate()).padStart(2, '0')
var mm = String(today.getMonth() + 1).padStart(2, '0') //January is 0!
var yyyy = today.getFullYear()
return yyyy + '-' + mm + '-' + dd
}
const closeToast = (show: boolean): void => {
setShowMsg(false)
}
const generaReporte = () => {
if (Cliente === 0) {
setHeader('Error')
setMsg('Seleccion el cliente')
setShowMsg(true)
return
}
const data: DTOReporte = {
Inicio: moment(Inicio).format('YYYY-MM-DD'),
Fin: moment(Fin).format('YYYY-MM-DD'),
TipoOperacion: TipoOperacion,
NoCliente: Cliente,
IdUsuario: UserId
}
reportsDataService
.getRptArcosa(data)
.then((response) => {
setData(response.data)
setFilteredData(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
})
}
useEffect(() => {
ClientesDataService.getAllClientes(parseInt(UserId))
.then((response) => {
setClientes(response.data)
})
.catch((e: Error) => {
setHeader('Error')
setMsg('Ocurrio un error: ' + e)
setShowMsg(true)
return
})
}, [])
const downloadExcel = () => {
exportExcel(Data, 'Reporte Mensual Arcosa')
}
function exportExcel(jsonData: any[], fileName: string): void {
let Heading = [
[
'Patente',
'Pedimento',
'PagoPedimento',
'Regimen',
'ValorDls',
'ValorAduana',
'Aduana',
'Planta',
'DTA',
'PREV',
'IVA',
'IVAPREV',
'IGI',
'CC',
'Total'
]
]
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)
}
async function getAE(e: any) {
if (e.column.colId === 'ver pedimento') {
setcolumnaVerPDF(true)
} else {
setcolumnaVerPDF(false)
}
}
const formatNumber = (number: string, digits: number) => {
number = parseFloat(number).toFixed(digits)
let value = Number(number).toLocaleString('en')
if (!value.indexOf('NaN')) return '0.00'
return value
}
return (
<div>
<Card>
<Card.Body>
<div className="row">
<div className="col-md-2">
<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"
/>
</div>
<div className="col-md-2">
<Form.Control
defaultValue={Fin}
type="date"
name="Fin"
placeholder="Fin"
title="Fin"
alt="Fin"
onChange={(e) => setFin(e.target.value)}
size="sm"
/>
</div>
<div className="col-md-1 right-label">
<Form.Label size="sm">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="1">Importacion</option>
<option value="2">Exportacion</option>
</Form.Control>
</div>
<div className="col-md-1 right-label">
<Form.Label size="sm">Cliente</Form.Label>
</div>
<div className="col-md-4">
<Form.Control
as="select"
onChange={(e) => {
setCliente(parseInt(e.target.value))
}}
className="form-select form-select-sm"
>
<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 />
&nbsp;Buscar
</Button>
</div>
</div>
<div className="row" style={{ paddingTop: 5 }}>
<div className="col">&nbsp;</div>
<div className="col-4">
<Form.Control
type="text"
size="sm"
placeholder="Search..."
onChange={(e) => {
filtraReporte(e)
}}
/>
</div>
<div className="col">
<Button
size="sm"
variant="success"
onClick={() => {
downloadExcel()
}}
>
<BsFileEarmarkExcel />
&nbsp;Excel
</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}
onCellClicked={(e) => getAE(e)}
></AgGridReact>
</div>
<MsgInformativo
show={show}
msg={msg}
header={header}
msgColor={msgColor}
closeToast={closeToast}
/>
</div>
)
}
export default RptArcosa

@ -1,308 +0,0 @@
import React, { useEffect, useState } from 'react'
//boostrap componentes
import { Button, Card, Form } from 'react-bootstrap'
import { BsSearch, BsFileEarmarkExcel } from 'react-icons/bs'
//interfaces
import { IRptFacturasFraccion } from '../../Interfaces/Reportes/IRptContsFacturasFraccion'
import reportsDataService from '../../Services/Reportes/reportes.services'
import { useDispatch } from 'react-redux'
// Gui Components
import { MsgInformativo } from '../Utils/Toast/msgInformativo'
import { TargetURL } from '../../Constants/TargetURL'
// import DataTable from 'react-data-table-component'
import DataTable, { TableColumn } from 'react-data-table-component'
//Other
import moment from 'moment'
import * as XLSX from 'xlsx'
import { string } from 'yup'
const URL = new TargetURL()
export default function RptPFacturasFraccion() {
const [curURL, setCurURL] = useState(URL.get())
const [UserId, setUserId] = useState(() => {
const stickyValue = window.localStorage.getItem('UserId')
return stickyValue !== null ? JSON.parse(stickyValue) : 0
})
const [Data, setData] = useState<Array<IRptFacturasFraccion>>([])
const [filteredData, setFilteredData] = useState<Array<IRptFacturasFraccion>>(
[]
)
const [msgColor, setMsgColor] = React.useState('primary')
const [show, setShowMsg] = useState(false)
const [header, setHeader] = useState('')
const [msg, setMsg] = useState('')
const [filtro, setFiltro] = useState('')
// const gridRef = React.useRef<any>(null)
const [referencia, setReferencia] = useState('')
const columnDefs = [
{
name: <div style={{ textAlign: 'center' }}>Factura</div>,
width: '220px',
selector: (row: IRptFacturasFraccion) => row.factura,
sortable: true,
filter: true,
center: true
},
{
name: <div style={{ textAlign: 'center' }}>Almacen</div>,
width: '100px',
selector: (row: IRptFacturasFraccion) => row.almacen,
sortable: true,
filter: true,
center: true
},
{
name: <div style={{ textAlign: 'center' }}>Orden</div>,
width: '100px',
selector: (row: IRptFacturasFraccion) => row.orden,
sortable: true,
filter: true,
center: true,
texAlign: 'center'
},
{
name: <div style={{ textAlign: 'center' }}>Parte</div>,
width: '150px',
selector: (row: IRptFacturasFraccion) => row.parte,
sortable: true,
filter: true,
center: true
},
{
name: <div style={{ textAlign: 'center' }}>Pais</div>,
width: '120px',
selector: (row: IRptFacturasFraccion) => row.pais,
sortable: true,
filter: true,
center: true
},
{
name: <div style={{ textAlign: 'center' }}>Fraccion Factura XML</div>,
width: '200px',
selector: (row: IRptFacturasFraccion) => row.fraccionFacturaXML,
sortable: true,
filter: true,
center: true
},
{
name: <div style={{ textAlign: 'center' }}>Fraccion GEMCO</div>,
width: '150px',
selector: (row: IRptFacturasFraccion) => row.fraccionGEMCO,
sortable: true,
filter: true,
center: true
},
{
name: <div style={{ textAlign: 'center' }}>Nico GEMCO</div>,
width: '120px',
selector: (row: IRptFacturasFraccion) => row.nicoGEMCO,
sortable: true,
filter: true,
center: true
}
]
function currentDate(): string {
var today = new Date()
var dd = String(today.getDate()).padStart(2, '0')
var mm = String(today.getMonth() + 1).padStart(2, '0') //January is 0!
var yyyy = today.getFullYear()
return yyyy + '-' + mm + '-' + dd
}
const closeToast = (show: boolean): void => {
setShowMsg(false)
}
const generaReporte = () => {
if (!referencia) {
setHeader('Error')
setMsg('La referencia no puede estar vacía')
setShowMsg(true)
return
}
reportsDataService
.getRptContsFacturasFraccion(referencia) // Usa la variable 'referencia' en lugar de 'Referencia'
.then((response) => {
setData(response.data)
setFilteredData(response.data)
setHeader('Informativo')
setMsg('Se encontró la siguiente información...')
setShowMsg(true)
})
.catch((e: Error) => {
setHeader('Error')
setMsg('Ocurrió un error: ' + e.message)
setShowMsg(true)
return
})
}
const downloadExcel = () => {
console.log(Data)
exportExcel(Data, 'Facturas Fraccion')
}
function exportExcel(
jsonData: IRptFacturasFraccion[],
fileName: string
): void {
let Heading = [
[
'Factura',
'Almacen',
'Orden',
'Parte',
'Pais',
'Fraccion Factura XML',
'Fraccion GEMCO',
'Nico GEMCO'
]
]
/* jsonData.forEach(function (v) {
delete v.tipodeCambiodePedimento
}) */
/* jsonData.map(function (item) {
delete item.tipodeCambiodePedimento
return item
}) */
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) => {
const searchText = e.target.value.toLowerCase()
setFiltro(searchText)
const filtered = Data.filter((item) => {
return (
(item.factura && item.factura.toLowerCase().includes(searchText)) ||
(item.almacen && item.almacen.toLowerCase().includes(searchText)) ||
(item.orden && item.orden.toString().includes(searchText)) ||
(item.parte && item.parte.toLowerCase().includes(searchText)) ||
(item.pais && item.pais.toLowerCase().includes(searchText)) ||
(item.fraccionFacturaXML &&
item.fraccionFacturaXML.toLowerCase().includes(searchText)) ||
(item.fraccionGEMCO &&
item.fraccionGEMCO.toLowerCase().includes(searchText)) ||
(item.nicoGEMCO && String(item.nicoGEMCO).includes(searchText))
)
})
// console.log('Filtered Data:', filtered)
setFilteredData(filtered)
}
return (
<div>
<Card>
<Card.Body>
<div className="row">
<div className="col-md-1" style={{ textAlign: 'right' }}>
<Form.Label size="sm">Referencia</Form.Label>
</div>
<div className="col-md-1" style={{ width: '130px' }}>
<Form.Control
type="text"
size="sm"
value={referencia}
onChange={(e) => setReferencia(e.target.value)}
/>
</div>
<div className="col-md-1" style={{ width: '5px' }}></div>
<div className="col-md-4" style={{ width: '150px ' }}>
<Button
variant="primary"
size="sm"
onClick={() => {
generaReporte()
}}
>
Buscar <BsSearch />
</Button>
</div>
<div className="col-md-1" style={{ width: '50px' }}></div>
<div className="col-md-4">
<Form.Control
type="text"
size="sm"
placeholder="Search..."
onChange={(e) => {
filtraReporte(e)
}}
/>
</div>
<div className="col-md-1" style={{ width: '260px' }}></div>
<div className="col-md-1">
<Button
size="sm"
variant="success"
onClick={() => {
downloadExcel()
}}
>
Excel <BsFileEarmarkExcel />
</Button>
</div>
</div>
</Card.Body>
</Card>
<Card>
<Card.Body>
<div
className="ag-theme-alpine"
style={{ height: 400, width: '100%', textAlign: 'center' }}
>
<DataTable
columns={columnDefs}
data={filteredData}
defaultSortAsc={true}
striped={true}
dense={true}
paginationPerPage={10}
pagination
highlightOnHover
pointerOnHover
style={{ height: 300, width: '100%', textAlign: 'center' }}
noHeader // Para evitar que se muestre el encabezado del DataTable
onRowClicked={(row) => {
// Aquí puedes manejar el clic en una fila si es necesario
}}
/>
</div>
</Card.Body>
</Card>
<MsgInformativo
show={show}
msg={msg}
header={header}
msgColor={msgColor}
closeToast={closeToast}
/>
</div>
)
}

@ -1,322 +0,0 @@
import React, { FC, useEffect, useState } from 'react'
// Bootstrap components
import { Button, Card, Form } from 'react-bootstrap'
import { BsSearch, BsFileEarmarkExcel } from 'react-icons/bs'
// Interfaces
import IClientes from '../../Interfaces/Catalogos/IClientes'
import IArchivoElectronico from '../../Interfaces/IArchivoElectronico'
// DTOs
import DTOReporte from '../../DTO/DTOReporte'
// Services
import reportsDataService from '../../Services/Reportes/reportes.services'
import ClientesDataService from '../../Services/Catalogos/Clientes.Services'
import { useDispatch } from 'react-redux'
import { setArchivoElectronico } from '../../store/features/Reportes/ArchivoElectronico'
// GUI components
import { MsgInformativo } from '../Utils/Toast/msgInformativo'
import { AgGridReact } from 'ag-grid-react'
import { RowClickedEvent } from 'ag-grid-community'
import { TargetURL } from '../../Constants/TargetURL'
//Other
import moment from 'moment'
import * as XLSX from 'xlsx'
import IRptFacturasPedimentosPagados from '../../Interfaces/Reportes/IRptFacturasPedimentosPagados'
interface IProps {}
const RptFacturasPedimentosPagados: FC<IProps> = (props) => {
const [UserId, setUserId] = useState(() => {
const stickyValue = window.localStorage.getItem('UserId')
return stickyValue !== null ? JSON.parse(stickyValue) : 0
})
const [Data, setData] = useState<Array<IRptFacturasPedimentosPagados>>([])
const [filteredData, setFilteredData] = useState<
Array<IRptFacturasPedimentosPagados>
>([])
const [Inicio, setInicio] = useState(currentDate())
const [Fin, setFin] = useState(currentDate())
const [TipoOperacion, setTipoOperacion] = useState(1)
const [Cliente, setCliente] = useState(0)
const [Clientes, setClientes] = useState<Array<IClientes>>()
const [msgColor, setMsgColor] = React.useState('primary')
const [show, setShowMsg] = useState(false)
const [header, setHeader] = useState('')
const [msg, setMsg] = useState('')
const [filtro, setFiltro] = useState('')
const gridRef = React.useRef<any>(null)
const [columnaVerPDF, setcolumnaVerPDF] = useState(false)
const dispatch = useDispatch()
const [columnDefs] = useState([
{
field: 'referencia',
headerName: 'Referencia',
sortable: true,
filter: true,
width: 300
},
{
field: 'pedido',
headerName: 'Pedido',
sortable: true,
filter: true,
width: 300
},
{
field: 'factura',
headerName: 'Factura',
sortable: true,
filter: true,
width: 400
},
{
field: 'uuid',
headerName: 'UUID',
sortable: true,
filter: true,
width: 350
},
{
field: 'fecha',
headerName: 'Fecha',
sortable: true,
filter: true,
width: 300
},
{
field: 'razonSocial',
headerName: 'RazonSocial',
sortable: true,
filter: true,
width: 300
}
])
function currentDate(): string {
var today = new Date()
var dd = String(today.getDate()).padStart(2, '0')
var mm = String(today.getMonth() + 1).padStart(2, '0') //January is 0!
var yyyy = today.getFullYear()
return yyyy + '-' + mm + '-' + dd
}
const closeToast = (show: boolean): void => {
setShowMsg(false)
}
const generaReporte = () => {
if (Cliente === 0) {
setHeader('Error')
setMsg('Seleccion el cliente')
setShowMsg(true)
return
}
const data: DTOReporte = {
Inicio: moment(Inicio).format('YYYY-MM-DD'),
Fin: moment(Fin).format('YYYY-MM-DD'),
TipoOperacion: TipoOperacion,
NoCliente: Cliente,
IdUsuario: UserId
}
reportsDataService
.getRptFacturasPedimentosPagados(data)
.then((response) => {
setData(response.data)
setFilteredData(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
})
}
useEffect(() => {
ClientesDataService.getAllClientes(parseInt(UserId))
.then((response) => {
setClientes(response.data)
})
.catch((e: Error) => {
setHeader('Error')
setMsg('Ocurrio un error: ' + e)
setShowMsg(true)
return
})
}, [])
const downloadExcel = () => {
exportExcel(Data, 'FacturasEnPedimentos')
}
function exportExcel(jsonData: any[], fileName: string): void {
let Heading = [
['Referencia', 'Pedido', 'Factura', 'UUID', 'Fecha', 'RazonSocial']
]
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)
}
async function getAE(e: any) {
if (e.column.colId === 'ver pedimento') {
setcolumnaVerPDF(true)
} else {
setcolumnaVerPDF(false)
}
}
const formatNumber = (number: string, digits: number) => {
number = parseFloat(number).toFixed(digits)
let value = Number(number).toLocaleString('en')
if (!value.indexOf('NaN')) return '0.00'
return value
}
return (
<div>
<Card>
<Card.Body>
<div className="row">
<div className="col-md-2">
<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"
/>
</div>
<div className="col-md-2">
<Form.Control
defaultValue={Fin}
type="date"
name="Fin"
placeholder="Fin"
title="Fin"
alt="Fin"
onChange={(e) => setFin(e.target.value)}
size="sm"
/>
</div>
<div className="col-md-1 right-label">
<Form.Label size="sm">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="1">Importacion</option>
<option value="2">Exportacion</option>
</Form.Control>
</div>
<div className="col-md-1 right-label">
<Form.Label size="sm">Cliente</Form.Label>
</div>
<div className="col-md-4">
<Form.Control
as="select"
onChange={(e) => {
setCliente(parseInt(e.target.value))
}}
className="form-select form-select-sm"
>
<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 />
&nbsp;Buscar
</Button>
</div>
</div>
<div className="row" style={{ paddingTop: 5 }}>
<div className="col">&nbsp;</div>
<div className="col-4">
<Form.Control
type="text"
size="sm"
placeholder="Search..."
onChange={(e) => {
filtraReporte(e)
}}
/>
</div>
<div className="col">
<Button
size="sm"
variant="success"
onClick={() => {
downloadExcel()
}}
>
<BsFileEarmarkExcel />
&nbsp;Excel
</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}
onCellClicked={(e) => getAE(e)}
></AgGridReact>
</div>
<MsgInformativo
show={show}
msg={msg}
header={header}
msgColor={msgColor}
closeToast={closeToast}
/>
</div>
)
}
export default RptFacturasPedimentosPagados

@ -1,409 +0,0 @@
import React, { FC, useEffect, useState } from 'react'
// Bootstrap components
import { Button, Card, Form } from 'react-bootstrap'
import { BsSearch, BsFileEarmarkExcel } from 'react-icons/bs'
// Interfaces
import IClientes from '../../Interfaces/Catalogos/IClientes'
import IArchivoElectronico from '../../Interfaces/IArchivoElectronico'
// DTOs
import DTOReporte from '../../DTO/DTOReporte'
// Services
import reportsDataService from '../../Services/Reportes/reportes.services'
import ClientesDataService from '../../Services/Catalogos/Clientes.Services'
// Redux
import { useDispatch } from 'react-redux'
import { setArchivoElectronico } from '../../store/features/Reportes/ArchivoElectronico'
// GUI components
import { MsgInformativo } from '../Utils/Toast/msgInformativo'
import { AgGridReact } from 'ag-grid-react'
import { RowClickedEvent } from 'ag-grid-community'
import { TargetURL } from '../../Constants/TargetURL'
//Other
import moment from 'moment'
import * as XLSX from 'xlsx'
import IRptOperacionesPagadasMisionFood from '../../Interfaces/Reportes/IRptOperacionesPagadasMisionFood'
interface IProps {}
const RptOperacionesPagadasMisionFood: FC<IProps> = (props) => {
const [UserId, setUserId] = useState(() => {
const stickyValue = window.localStorage.getItem('UserId')
return stickyValue !== null ? JSON.parse(stickyValue) : 0
})
const [Data, setData] = useState<Array<IRptOperacionesPagadasMisionFood>>([])
const [filteredData, setFilteredData] = useState<
Array<IRptOperacionesPagadasMisionFood>
>([])
const [Inicio, setInicio] = useState(currentDate())
const [Fin, setFin] = useState(currentDate())
const [TipoOperacion, setTipoOperacion] = useState(1)
const [Cliente, setCliente] = useState(0)
const [Clientes, setClientes] = useState<Array<IClientes>>()
const [msgColor, setMsgColor] = React.useState('primary')
const [show, setShowMsg] = useState(false)
const [header, setHeader] = useState('')
const [msg, setMsg] = useState('')
const [filtro, setFiltro] = useState('')
const gridRef = React.useRef<any>(null)
const [columnaVerPDF, setcolumnaVerPDF] = useState(false)
const dispatch = useDispatch()
const [columnDefs] = useState([
{
field: 'tipoOperacion',
headerName: 'TipoOperacion',
sortable: true,
filter: true
},
{
field: 'sPedimento',
headerName: 'Pedimento',
sortable: true,
filter: true
},
{
field: 'uuid',
headerName: 'UUID',
sortable: true,
filter: true,
width: 400
},
{
field: 'folioFactura',
headerName: 'FolioFactura',
sortable: true,
filter: true,
width: 500
},
{
field: 'dFechaFirmaBanco',
headerName: 'FechaFirmaBanco',
sortable: true,
filter: true
},
{
field: 'sRazonSocial',
headerName: 'RazonSocial',
sortable: true,
filter: true
},
{ field: 'sRFC', headerName: 'RFC', sortable: true, filter: true },
{
field: 'sReferencia',
headerName: 'Referencia',
sortable: true,
filter: true
},
{
field: 'sEDocument',
headerName: 'EDocument',
sortable: true,
filter: true
},
{
field: 'sHRazonSocial',
headerName: 'SHRazonSocial',
sortable: true,
filter: true,
width: 300
},
{
field: 'sHidentificadorProv',
headerName: 'HidentificadorProv',
sortable: true,
filter: true,
width: 300
},
{
field: 'aa',
headerName: 'AA',
sortable: true,
filter: true
},
{
field: 'rfcaa',
headerName: 'RFCAA',
sortable: true,
filter: true
},
{
field: 'incoterm',
headerName: 'Incoterm',
sortable: true,
filter: true
},
{
field: 'caja',
headerName: 'Caja',
sortable: true,
filter: true
},
{
field: 'acuceDoda',
headerName: 'AcuceDoda',
sortable: true,
filter: true
},
{
field: 'transportista',
headerName: 'Transportista',
sortable: true,
filter: true,
width: 300
},
{
field: 'edocument',
headerName: 'Edocument',
sortable: true,
filter: true,
width: 1000
}
])
function currentDate(): string {
var today = new Date()
var dd = String(today.getDate()).padStart(2, '0')
var mm = String(today.getMonth() + 1).padStart(2, '0') //January is 0!
var yyyy = today.getFullYear()
return yyyy + '-' + mm + '-' + dd
}
const closeToast = (show: boolean): void => {
setShowMsg(false)
}
const generaReporte = () => {
if (Cliente === 0) {
setHeader('Error')
setMsg('Seleccion el cliente')
setShowMsg(true)
return
}
const data: DTOReporte = {
Inicio: moment(Inicio).format('YYYY-MM-DD'),
Fin: moment(Fin).format('YYYY-MM-DD'),
TipoOperacion: TipoOperacion,
NoCliente: Cliente,
IdUsuario: UserId
}
reportsDataService
.getRptOPeracionesPagadasMisionFood(data)
.then((response) => {
setData(response.data)
setFilteredData(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
})
}
useEffect(() => {
ClientesDataService.getAllClientes(parseInt(UserId))
.then((response) => {
setClientes(response.data)
})
.catch((e: Error) => {
setHeader('Error')
setMsg('Ocurrio un error: ' + e)
setShowMsg(true)
return
})
}, [])
const downloadExcel = () => {
exportExcel(Data, 'OperacionesPagadasMissionFood')
}
function exportExcel(jsonData: any[], fileName: string): void {
let Heading = [
[
'TipoOperacion',
'Pedimento',
'UUID',
'FolioFactura',
'FechaFirmaBanco',
'RazonSocial',
'RFC',
'Referencia',
'EDocument',
'HRazonSocial',
'HidentificadorProv',
'AA',
'RFCAA',
'Incoterm',
'Caja',
'AcuceDoda',
'Transportista',
'Edocument'
]
]
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)
}
async function getAE(e: any) {
if (e.column.colId === 'ver pedimento') {
setcolumnaVerPDF(true)
} else {
setcolumnaVerPDF(false)
}
}
const formatNumber = (number: string, digits: number) => {
number = parseFloat(number).toFixed(digits)
let value = Number(number).toLocaleString('en')
if (!value.indexOf('NaN')) return '0.00'
return value
}
return (
<div>
<Card>
<Card.Body>
<div className="row">
<div className="col-md-2">
<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"
/>
</div>
<div className="col-md-2">
<Form.Control
defaultValue={Fin}
type="date"
name="Fin"
placeholder="Fin"
title="Fin"
alt="Fin"
onChange={(e) => setFin(e.target.value)}
size="sm"
/>
</div>
<div className="col-md-1 right-label">
<Form.Label size="sm">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="1">Importacion</option>
<option value="2">Exportacion</option>
</Form.Control>
</div>
<div className="col-md-1 right-label">
<Form.Label size="sm">Cliente</Form.Label>
</div>
<div className="col-md-4">
<Form.Control
as="select"
onChange={(e) => {
setCliente(parseInt(e.target.value))
}}
className="form-select form-select-sm"
>
<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 />
&nbsp;Buscar
</Button>
</div>
</div>
<div className="row" style={{ paddingTop: 5 }}>
<div className="col">&nbsp;</div>
<div className="col-4">
<Form.Control
type="text"
size="sm"
placeholder="Search..."
onChange={(e) => {
filtraReporte(e)
}}
/>
</div>
<div className="col">
<Button
size="sm"
variant="success"
onClick={() => {
downloadExcel()
}}
>
<BsFileEarmarkExcel />
&nbsp;Excel
</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}
onCellClicked={(e) => getAE(e)}
></AgGridReact>
</div>
<MsgInformativo
show={show}
msg={msg}
header={header}
msgColor={msgColor}
closeToast={closeToast}
/>
</div>
)
}
export default RptOperacionesPagadasMisionFood

@ -1,15 +1,15 @@
import React, { useEffect, useState } from 'react'
//boostrap componentes
//boostrap componentes
import { Button, Card, Form } from 'react-bootstrap'
import { BsCloudDownload, BsSearch, BsFileEarmarkExcel } from 'react-icons/bs'
//interfaces
import IClientes from '../../Interfaces/Catalogos/IClientes'
import IArchivoElectronico from '../../Interfaces/IArchivoElectronico'
import { IRptPedimentosPagadosFacturasCruzadas } from '../../Interfaces/Reportes/IRptPedimentosPagadosFacturasCruzadas'
//dtos
import DTOgetThesePedimentos from '../../DTO/DTOgetThesePedimentos'
import DTOReporte from '../../DTO/DTOReporte'
//Services
//interfaces
import IClientes from "../../Interfaces/Catalogos/IClientes";
import IArchivoElectronico from "../../Interfaces/IArchivoElectronico";
import { IRptPedimentosPagadosFacturasCruzadas } from "../../Interfaces/Reportes/IRptPedimentosPagadosFacturasCruzadas";
//dtos
import DTOgetThesePedimentos from "../../DTO/DTOgetThesePedimentos";
import DTOReporte from "../../DTO/DTOReporte";
//Services
import reportsDataService from '../../Services/Reportes/reportes.services'
import ClientesDataService from '../../Services/Catalogos/Clientes.Services'
import AEOServices from '../../Services/Catalogos/ArchivoElectronico.Services'
@ -26,392 +26,380 @@ import moment from 'moment'
import * as XLSX from 'xlsx'
const URL = new TargetURL()
export default function RptPedimentosPagadosFacturasCruzadas() {
const [curURL, setCurURL] = useState(URL.get())
const [UserId, setUserId] = useState(() => {
const stickyValue = window.localStorage.getItem('UserId')
return stickyValue !== null ? JSON.parse(stickyValue) : 0
})
const [Data, setData] = useState<
Array<IRptPedimentosPagadosFacturasCruzadas>
>([])
const [filteredData, setFilteredData] = useState<
Array<IRptPedimentosPagadosFacturasCruzadas>
>([])
const [Inicio, setInicio] = useState(currentDate())
const [Fin, setFin] = useState(currentDate())
const [TipoOperacion, setTipoOperacion] = useState(1)
const [Cliente, setCliente] = useState(0)
const [Clientes, setClientes] = useState<Array<IClientes>>()
const [msgColor, setMsgColor] = React.useState('primary')
const [show, setShowMsg] = useState(false)
const [header, setHeader] = useState('')
const [msg, setMsg] = useState('')
const [filtro, setFiltro] = useState('')
const gridRef = React.useRef<any>(null)
const [columnaVerPDF, setcolumnaVerPDF] = useState(false)
const dispatch = useDispatch()
const [columnDefs] = useState([
{ field: 'referencia', sortable: true, filter: true },
{ field: 'pedimento', sortable: true, filter: true },
{ field: 'clave', sortable: true, filter: true },
{ field: 'fechaFirmaBanco', sortable: true, filter: true },
{ field: 'tipoCambio', sortable: true, filter: true },
{ field: 'pesoBruto', sortable: true, filter: true },
{ field: 'paisVendedor', sortable: true, filter: true },
{ field: 'paisOrigen', sortable: true, filter: true },
{ field: 'numFacturas', sortable: true, filter: true },
{ field: 'factura', sortable: true, filter: true },
{ field: 'valorFactura', sortable: true, filter: true },
{ field: 'fraccion', sortable: true, filter: true },
{ field: 'descripcion', sortable: true, filter: true },
{ field: 'nClave', sortable: true, filter: true },
{ field: 'cantFacturas', sortable: true, filter: true },
{
field: 'valorAduana',
sortable: true,
filter: true,
cellRenderer: (params: any) => {
return params.value
}
},
{ field: 'incrementables', sortable: true, filter: true },
{ field: 'adValorem', sortable: true, filter: true },
{ field: 'dta', sortable: true, filter: true },
{ field: 'iva', sortable: true, filter: true },
{ field: 'efectivo', sortable: true, filter: true },
{ field: 'total', sortable: true, filter: true },
{ field: 'destino', sortable: true, filter: true },
{ field: 'cruce', sortable: true, filter: true },
{ field: 'remite', sortable: true, filter: true },
{ field: 'caja', sortable: true, filter: true },
{ field: 'valorComercial', sortable: true, filter: true },
{ field: 'incoterm', sortable: true, filter: true }
])
function currentDate(): string {
var today = new Date()
var dd = String(today.getDate()).padStart(2, '0')
var mm = String(today.getMonth() + 1).padStart(2, '0') //January is 0!
var yyyy = today.getFullYear()
return yyyy + '-' + mm + '-' + dd
}
const closeToast = (show: boolean): void => {
setShowMsg(false)
}
const generaReporte = () => {
if (Cliente === 0) {
setHeader('Error')
setMsg('Seleccion el cliente')
setShowMsg(true)
return
export default function RptPedimentosPagadosFacturasCruzadas(){
const [curURL, setCurURL] = useState(URL.get())
const [UserId, setUserId] = useState(() => {
const stickyValue = window.localStorage.getItem('UserId')
return stickyValue !== null ? JSON.parse(stickyValue) : 0
})
const [Data, setData] = useState<Array<IRptPedimentosPagadosFacturasCruzadas>>([])
const [filteredData, setFilteredData] = useState<Array<IRptPedimentosPagadosFacturasCruzadas>>([])
const [Inicio, setInicio] = useState(currentDate())
const [Fin, setFin] = useState(currentDate())
const [TipoOperacion, setTipoOperacion] = useState(1)
const [Cliente, setCliente] = useState(0)
const [Clientes, setClientes] = useState<Array<IClientes>>()
const [msgColor, setMsgColor] = React.useState('primary')
const [show, setShowMsg] = useState(false)
const [header, setHeader] = useState('')
const [msg, setMsg] = useState('')
const [filtro, setFiltro] = useState('')
const gridRef = React.useRef<any>(null)
const [columnaVerPDF, setcolumnaVerPDF] = useState(false)
const dispatch = useDispatch()
const [columnDefs] = useState([
{ field: 'referencia', sortable: true, filter: true },
{ field: 'pedimento', sortable: true, filter: true
},
{ field: 'clave', sortable: true, filter: true },
{ field: 'fechaFirmaBanco', sortable: true, filter: true },
{ field: 'tipoCambio', sortable: true, filter: true },
{ field: 'pesoBruto', sortable: true, filter: true },
{ field: 'paisVendedor', sortable: true, filter: true },
{ field: 'paisOrigen', sortable: true, filter: true },
{ field: 'numFacturas', sortable:true, filter: true },
{ field: 'factura', sortable:true, filter: true },
{ field: 'valorFactura', sortable:true, filter: true },
{ field: 'fraccion', sortable:true, filter: true },
{ field: 'descripcion', sortable:true, filter: true },
{ field: 'nClave', sortable:true, filter: true },
{ field: 'cantFacturas', sortable:true, filter: true },
{
field: 'valorAduana',
sortable: true,
filter: true,
cellRenderer: (params: any) => {
return params.value
},
},
{ field: 'incrementables', sortable:true, filter: true },
{ field: 'adValorem', sortable:true, filter: true },
{ field: 'dta', sortable:true, filter: true },
{ field: 'iva', sortable:true, filter: true },
{ field: 'efectivo', sortable:true, filter: true },
{ field: 'total', sortable:true, filter: true },
{ field: 'destino', sortable:true, filter: true },
{ field: 'cruce', sortable:true, filter: true },
{ field: 'remite', sortable:true, filter: true },
{ field: 'caja', sortable:true, filter: true },
{ field: 'valorComercial', sortable:true, filter: true },
{ field: 'incoterm', sortable:true, filter: true },
])
function currentDate(): string {
var today = new Date()
var dd = String(today.getDate()).padStart(2, '0')
var mm = String(today.getMonth() + 1).padStart(2, '0') //January is 0!
var yyyy = today.getFullYear()
return yyyy + '-' + mm + '-' + dd
}
const data: DTOReporte = {
Inicio: moment(Inicio).format('YYYY-MM-DD'),
Fin: moment(Fin).format('YYYY-MM-DD'),
TipoOperacion: TipoOperacion,
NoCliente: Cliente,
IdUsuario: UserId
const closeToast = (show: boolean): void => {
setShowMsg(false)
}
reportsDataService
.getRptPedimentosPagadosFacturasCruzadas(data)
.then((response) => {
setData(response.data)
setFilteredData(response.data)
setHeader('Informativo')
setMsg('Se encontro la siguiente informacion...')
setShowMsg(true)
})
.catch((e: Error) => {
const generaReporte = () => {
if (Cliente === 0) {
setHeader('Error')
setMsg('Ocurrio un error: ' + e)
setMsg('Seleccion el cliente')
setShowMsg(true)
return
})
}
useEffect(() => {
ClientesDataService.getAllClientes(parseInt(UserId))
.then((response) => {
setClientes(response.data)
})
.catch((e: Error) => {
setHeader('Error')
setMsg('Ocurrio un error: ' + e)
setShowMsg(true)
return
})
}, [])
const downloadExcel = () => {
console.log(Data)
exportExcel(Data, 'Pedimentos Pagados')
}
function exportExcel(
jsonData: IRptPedimentosPagadosFacturasCruzadas[],
fileName: string
): void {
let Heading = [
[
'Referencia',
'Pedimento',
'Clave',
'FechaFirmaBanco',
'TipoCambio',
'PesoBruto',
'PaisVendedor',
'PaisOrigen',
'NumFacturas',
'Factura',
'ValorFactura',
'Fraccion',
'Descripcion',
'nClaves',
'cantFacturas',
'ValorAduana',
'Incrementables',
'Advalorem',
'Dta',
'Iva',
'Efectivo',
'Total',
'Destino',
'Cruce',
'Remite',
'Caja',
'ValorComercial',
'Inconterm'
}
const data: DTOReporte = {
Inicio: moment(Inicio).format('YYYY-MM-DD'),
Fin: moment(Fin).format('YYYY-MM-DD'),
TipoOperacion: TipoOperacion,
NoCliente: Cliente,
IdUsuario: UserId,
}
reportsDataService
.getRptPedimentosPagadosFacturasCruzadas(data)
.then((response) => {
setData(response.data)
setFilteredData(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
})
}
useEffect(() => {
ClientesDataService.getAllClientes(parseInt(UserId))
.then((response) => {
setClientes(response.data)
})
.catch((e: Error) => {
setHeader('Error')
setMsg('Ocurrio un error: ' + e)
setShowMsg(true)
return
})
}, [])
const downloadExcel = () => {
console.log(Data)
exportExcel(Data, 'Pedimentos Pagados')
}
function exportExcel(jsonData: IRptPedimentosPagadosFacturasCruzadas[], fileName: string): void {
let Heading = [
[
'Referencia',
'Pedimento',
'Clave',
'FechaFirmaBanco',
'TipoCambio',
'PesoBruto',
'PaisVendedor',
'PaisOrigen',
'NumFacturas',
'Factura',
'ValorFactura',
'Fraccion',
'Descripcion',
'nClaves',
'cantFacturas',
'ValorAduana',
'Incrementables',
'Advalorem',
'Dta',
'Iva',
'Efectivo',
'Total',
'Destino',
'Cruce',
'Remite',
'Caja',
'ValorComercial',
'Inconterm'
],
]
]
/* jsonData.forEach(function (v) {
/* jsonData.forEach(function (v) {
delete v.tipodeCambiodePedimento
}) */
/* jsonData.map(function (item) {
/* jsonData.map(function (item) {
delete item.tipodeCambiodePedimento
return item
}) */
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)
}
function getParams(e: RowClickedEvent) {
const data: IArchivoElectronico = {
Referencia: e.data.referencia,
PedimentoLargo: '',
NoCliente: Cliente,
IdUsuario: 0,
Archivo: ''
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()
}
}
dispatch(setArchivoElectronico(data))
if (columnaVerPDF) {
let P: string = e.data.pedimento
P = P.substring(6)
P = P.replace(' ', e.data.aduanaSeccionEntrada)
window.open(
`${curURL}/ArchivoElectronico/getFile?Referencia=${e.data.referencia}&PedimentoLargo=${P}&Nocliente=${Cliente}&IdUsuario=${UserId}`
)
const filtraReporte = (e: any) => {
setFiltro(e.target.value)
gridRef.current.api.setQuickFilter(e.target.value)
}
}
const downloadPDFs = () => {
if (Cliente === 0) {
setMsg('Seleccione el cliente')
setHeader('Para poder continuar, favor de: ')
setShowMsg(true)
function getParams(e: RowClickedEvent) {
const data: IArchivoElectronico = {
Referencia: e.data.referencia,
PedimentoLargo: '',
NoCliente: Cliente,
IdUsuario: 0,
Archivo: '',
}
dispatch(setArchivoElectronico(data))
if (columnaVerPDF) {
let P: string = e.data.pedimento
P = P.substring(6)
P = P.replace(' ', e.data.aduanaSeccionEntrada)
window.open(
`${curURL}/ArchivoElectronico/getFile?Referencia=${e.data.referencia}&PedimentoLargo=${P}&Nocliente=${Cliente}&IdUsuario=${UserId}`
)
}
}
let selectedNodes = gridRef.current.api.getSelectedNodes()
let selectedData = selectedNodes.map((node: any) => node.data)
interface IPedimentos {
pedimento: string
const downloadPDFs = () => {
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)
interface IPedimentos {
pedimento: string
}
const Pedimentos = selectedData.map((item: IPedimentos) => item.pedimento)
const data: DTOgetThesePedimentos = {
Inicio: Inicio,
Fin: Fin,
NoCliente: Cliente,
IdUsuario: UserId,
TipoOperacion: TipoOperacion,
Pedimentos: Pedimentos,
}
AEOServices.getThesePDFs(data)
.then((response: any) => {
const url = window.URL.createObjectURL(new Blob([response.data]))
const link = document.createElement('a')
link.href = url
link.setAttribute('download', 'Pedimentos.zip')
document.body.appendChild(link)
link.click()
})
.catch((e: Error) => {
setHeader('Error')
setMsg('Ocurrio un error: ' + e)
setShowMsg(true)
return
})
}
const Pedimentos = selectedData.map((item: IPedimentos) => item.pedimento)
const data: DTOgetThesePedimentos = {
Inicio: Inicio,
Fin: Fin,
NoCliente: Cliente,
IdUsuario: UserId,
TipoOperacion: TipoOperacion,
Pedimentos: Pedimentos
async function getAE(e: any) {
if (e.column.colId === 'ver pedimento') {
setcolumnaVerPDF(true)
} else {
setcolumnaVerPDF(false)
}
}
AEOServices.getThesePDFs(data)
.then((response: any) => {
const url = window.URL.createObjectURL(new Blob([response.data]))
const link = document.createElement('a')
link.href = url
link.setAttribute('download', 'Pedimentos.zip')
document.body.appendChild(link)
link.click()
})
.catch((e: Error) => {
setHeader('Error')
setMsg('Ocurrio un error: ' + e)
setShowMsg(true)
return
})
}
async function getAE(e: any) {
if (e.column.colId === 'ver pedimento') {
setcolumnaVerPDF(true)
} else {
setcolumnaVerPDF(false)
const formatNumber = (number: string) => {
number = parseFloat(number).toFixed(2)
let value = Number(number).toLocaleString('en')
if (!value.indexOf('NaN')) return '0.00'
return value
}
}
const formatNumber = (number: string) => {
number = parseFloat(number).toFixed(2)
let value = Number(number).toLocaleString('en')
if (!value.indexOf('NaN')) return '0.00'
return value
}
return (
<div>
<Card>
<Card.Body>
<div className="row">
<div className="col-md-2">
<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"
/>
</div>
<div className="col-md-2">
<Form.Control
defaultValue={Fin}
type="date"
name="Fin"
placeholder="Fin"
title="Fin"
alt="Fin"
onChange={(e) => setFin(e.target.value)}
size="sm"
/>
</div>
<div className="col-md-1 right-label">
<Form.Label size="sm">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="1">Importacion</option>
<option value="2">Exportacion</option>
</Form.Control>
</div>
<div className="col-md-1 right-label">
<Form.Label size="sm">Cliente</Form.Label>
</div>
<div className="col-md-4">
<Form.Control
as="select"
onChange={(e) => {
setCliente(parseInt(e.target.value))
}}
className="form-select form-select-sm"
>
<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"
size="sm"
placeholder="Search..."
onChange={(e) => {
filtraReporte(e)
}}
/>
return (
<div>
<Card>
<Card.Body>
<div className='row'>
<div className='col-md-2'>
<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'
/>
</div>
<div className='col-md-2'>
<Form.Control
defaultValue={Fin}
type='date'
name='Fin'
placeholder='Fin'
title='Fin'
alt='Fin'
onChange={(e) => setFin(e.target.value)}
size='sm'
/>
</div>
<div className='col-md-1 right-label'>
<Form.Label size='sm'>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='1'>Importacion</option>
<option value='2'>Exportacion</option>
</Form.Control>
</div>
<div className='col-md-1 right-label'>
<Form.Label size='sm'>Cliente</Form.Label>
</div>
<div className='col-md-4'>
<Form.Control
as='select'
onChange={(e) => {
setCliente(parseInt(e.target.value))
}}
className='form-select form-select-sm'
>
<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="col">
<Button
size="sm"
variant="success"
onClick={() => {
downloadExcel()
}}
>
<BsFileEarmarkExcel />
&nbsp;Excel
</Button>
<div className='row' style={{ paddingTop: 5 }}>
<div className='col'>&nbsp;</div>
<div className='col-4'>
<Form.Control
type='text'
size='sm'
placeholder='Search...'
onChange={(e) => {
filtraReporte(e)
}}
/>
</div>
<div className='col'>
<Button
size='sm'
variant='success'
onClick={() => {
downloadExcel()
}}
>
<BsFileEarmarkExcel />
&nbsp;Excel
<BsCloudDownload />
&nbsp;PDF
</Button>
</div>
</div>
</div>
</Card.Body>
</Card>
<br />
<div className="ag-theme-alpine" style={{ height: 500, width: '100%' }}>
{/* <button onClick={onButtonClick}>Get selected rows</button> */}
<AgGridReact
rowData={filteredData}
columnDefs={columnDefs}
pagination={true}
paginationAutoPageSize={true}
ref={gridRef}
rowSelection={'multiple'}
rowMultiSelectWithClick={true}
onCellClicked={(e) => getAE(e)}
onRowClicked={(e) => getParams(e)}
></AgGridReact>
</Card.Body>
</Card>
<br />
<div className='ag-theme-alpine' style={{ height: 500, width: '100%' }}>
{/* <button onClick={onButtonClick}>Get selected rows</button> */}
<AgGridReact
rowData={filteredData}
columnDefs={columnDefs}
pagination={true}
paginationAutoPageSize={true}
ref={gridRef}
rowSelection={'multiple'}
rowMultiSelectWithClick={true}
onCellClicked={(e) => getAE(e)}
onRowClicked={(e) => getParams(e)}
></AgGridReact>
</div>
<MsgInformativo show={show} msg={msg} header={header} msgColor={msgColor} closeToast={closeToast} />
</div>
<MsgInformativo
show={show}
msg={msg}
header={header}
msgColor={msgColor}
closeToast={closeToast}
/>
</div>
)
}
)
}

@ -15,8 +15,8 @@ interface IProps {
export const MsgInformativo: FC<IProps> = (props) => {
return (
<div>
<ToastContainer position={'middle-center'} style={{zIndex:'99999 !important'}} >
<Toast
<ToastContainer position={'middle-center'}>
<Toast
show={props.show}
delay={props.time}
bg={props.msgColor}

@ -1,6 +0,0 @@
export default interface ICatFraccionesVulnerables{
id : number ,
fraccion : number,
nico : string,
activo : number
}

@ -1,7 +0,0 @@
export default interface IConsolidadosSinFirmaBanco{
referencia: string,
fechaPago: string,
firmaValidacion: string,
firmaBanco: string
}

@ -1,33 +1,32 @@
export interface IRegister {
id: number
usuario: string
nombre: string
contrasena: string
correo: string
tipoUsuario: number
activo: number
fechaAlta: string
usuarioAlta: number
fechaModifico: string
usuarioModifico: number
fechaElimino: string
usuarioElimino: number
motivoElimino: string
idModulo: number
dept: number
tmercancia: number
fechaUltimaVisita: string
visitas: number
internos: number
permisoEspecial: number
estadoConfiguracion: number
fechaValidacionConf: string
realizoEncuesta: string
encuestaActiva: number
fechaLimiteEncuesta: string
codigoAccesoM: string
tokenAccesoM: string
deviceToken: string
idPerfil: number
departamento: string
id: number;
usuario: string;
nombre: string;
contrasena: string;
correo: string;
tipoUsuario: number;
activo: number;
fechaAlta: string;
usuarioAlta: number;
fechaModifico: string;
usuarioModifico: number;
fechaElimino: string;
usuarioElimino: number;
motivoElimino: string;
idModulo: number;
dept: number;
tmercancia: number;
fechaUltimaVisita: string;
visitas: number;
internos: number;
permisoEspecial: number;
estadoConfiguracion: number;
fechaValidacionConf: string;
realizoEncuesta: string;
encuestaActiva: number;
fechaLimiteEncuesta: string;
codigoAccesoM: string;
tokenAccesoM: string;
deviceToken: string;
idPerfil: number;
}

@ -1,18 +0,0 @@
export default interface IRptArcosa{
Patente: string,
Pedimento: string,
PagoPedimento: string,
Regimen: string,
ValorDls: Number,
ValorAduana: Number,
Aduana: Number,
Planta: string,
DTA: string,
PREV : string
IVA: string,
IGI : string,
CC: string,
Total : number
}

@ -1,16 +0,0 @@
export interface IRptFacturasFraccion{
factura : string,
almacen : string,
orden : number ;
parte : string,
pais : string ,
fraccionFacturaXML : string,
fraccionGEMCO : string,
nicoGEMCO : string;
}

@ -1,10 +0,0 @@
export default interface IRptFacturasPedimentosPagados{
Referencia: string
Pedido: string
Factura: string
UUID: string
Fecha : string
RazonSocial : string
}

@ -1,24 +0,0 @@
export default interface IRptOperacionesPagadasMissionFood {
TipoOperacion : string,
sPedimento: string,
UUID :string,
FolioFactura : string,
dFechaFirmaBanco : string,
sRazonSocial : string,
sRFC : string,
sRefrencia : string,
sEDocument : string,
sHRazonSocial : string,
sHidentificadorProv : string,
AA : string,
RFCAA : string,
Incoterm : string,
Caja : string,
AcuceDoda : string,
Transportista : string,
Edocument : string
}

@ -1,27 +0,0 @@
import http from "../common/http-common";
import ICatFraccionesVulnerables from '../../Interfaces/Catalogos/ICatFraccionesVulnerables'
class FraccionesVulnerablesDataService {
constructor()
{
type returnData = [ICatFraccionesVulnerables[]]
}
getAll() {
return http.get<ICatFraccionesVulnerables[]>(`/Catalogos/CatFraccionesVulnerables/getAll`);
}
Append(data: ICatFraccionesVulnerables) {
return http.post<ICatFraccionesVulnerables>(`/Catalogos/CatFraccionesVulnerables/Append`, data);
}
Delete(id: number) {
return http.delete<ICatFraccionesVulnerables>(`/Catalogos/CatFraccionesVulnerables/Delete/${id}`);
}
}
export default new FraccionesVulnerablesDataService();

@ -1,8 +1,6 @@
import http from '../common/http-common'
import IConsolidadosSinCerrar from '../../Interfaces/Facturacion/Anexo/IConsolidadosSinCerrar'
import DTOAnexoFacturacionMission from '../../DTO/Facturacion/Anexo/DTOAnexoFacturacionMission'
import IConsolidadosSinFirmaBanco from '../../Interfaces/Facturacion/Anexo/IConsolidadosSinFirmaBanco'
class OperacionesDataService {
Get() {
@ -10,20 +8,5 @@ class OperacionesDataService {
`/AnexoFacturacion/GetRptConsolidadosSinCerrar`
)
}
OperacionesSinFirmaBancoGet(){
return http.post<IConsolidadosSinFirmaBanco[]>(
`/AnexoFacturacion/GetRptConsolidadosSinFirmaBanco`
)
}
}
export default new OperacionesDataService()

@ -17,12 +17,6 @@ import IRptOperacionesDiarias from '../../Interfaces/Reportes/IRptOperacionesDia
import { IRptPedimentosPagadosFacturasCruzadas } from '../../Interfaces/Reportes/IRptPedimentosPagadosFacturasCruzadas'
import { IRptMonitoreoFacturaPagadasAmazon } from '../../Interfaces/Reportes/IRptMonitoreoFacturasPagadasAmazon'
import DTORPTMonitorFacturasPagAmazon from '../../DTO/Utils/DTORPTMonitorFacturasPagAmazon'
import { IRptFacturasFraccion } from '../../Interfaces/Reportes/IRptContsFacturasFraccion'
import { data } from 'cypress/types/jquery'
import IRptMision from '../../Interfaces/Reportes/IRptOperacionesPagadasMisionFood'
import IRptOperacionesPagadasMissionFood from '../../Interfaces/Reportes/IRptOperacionesPagadasMisionFood'
import IRptFacturasPedimentosPagados from '../../Interfaces/Reportes/IRptFacturasPedimentosPagados'
import IRptArcosa from '../../Interfaces/Reportes/IRptArcosa'
class reportsDataService {
getRptPedimentosPagados(data: DTOReporte) {
return http.post<Array<IRptPedimentosPagados>>(
@ -121,32 +115,5 @@ class reportsDataService {
)
}
getRptContsFacturasFraccion(Referencia: string)
{
return http.get<Array<IRptFacturasFraccion>>(
`/reportes/RptContsFacturasConFraccion?Referencia=${Referencia}`
);
}
getRptOPeracionesPagadasMisionFood(data: DTOReporte) {
return http.post<Array<IRptOperacionesPagadasMissionFood>>(
'/reportes/RptOperacionesPagadasMissionFood', data
);
}
getRptFacturasPedimentosPagados(data: DTOReporte){
return http.post<Array<IRptFacturasPedimentosPagados>>(
'/reportes/RptFacturasPedimetosPagados', data
)
}
getRptArcosa(data: DTOReporte){
return http.post<Array<IRptArcosa>>(
'/reportes/RptArcosa', data
);
}
}
export default new reportsDataService()

@ -13,7 +13,6 @@ import { Login } from './Components/Login/login'
import AmazonNoPartes from './Components/Clientes/Amazon/Reportes/AmazonNoPartes'
import AvisoCruce from './Components/AgenciaAduanal/AvisoCruce/AvisoCruce'
import CatTabuladores from './Components/Catalogos/CatTabulador/CatTabulador'
import DashboardCorresponsales from './Components/Dashboard/DashboardCorresponsales'
import Dashboard from './Components/Dashboard/Dashboard'
import DashboardDireccion from './Components/Dashboard/DashboardDireccion'
@ -29,7 +28,6 @@ import RptArchivoElectronicoOficial from './Components/Reportes/RptArchivoElectr
import RptBattery from './Components/Reportes/RptBattery'
import RptControlDocumentosClientes from './Components/Reportes/RptControlDocumentosClientes'
import RptConsolidadosSinCerrar from './Components/GEMCO/Facturacion/Anexo/RptConsolidadosSinCerrar'
import RtpConsolidadosSinFirmaBanco from './Components/GEMCO/Facturacion/Anexo/RptConsolidadosSinFirmaBanco'
import RptDetalleAnexo24 from './Components/Reportes/RptDetalleAnexo24'
import RptFacturasTxtHeineken from './Components/Reportes/RptFacturasTxtHeineken'
import Notificaciones from './Components/Utils/Notificaciones/Notificaciones'
@ -64,12 +62,6 @@ import RptPedimentosCruces06 from './Components/Reportes/Direccion/RptPedimentos
import RptSegregacion from './Components/Clientes/Amazon/Reportes/Segregacion/RptSegregacion'
import RptConsultaTrafico from './Components/Clientes/Amazon/Reportes/ConsultaTrafico/RptConsultaTrafico'
import RptMonitoreoFacturasPagadasAmazon from './Components/Reportes/RptMonitoreoFacturasPagadasAmazon'
import CatFraccionesVulnerables from './Components/Catalogos/CatFraccionesVulnerables/CatFraccionesVulnerables'
import RptFacturasFraccion from './Components/Reportes/RptContsFacturasFraccion'
import CatConceptosConsulta from './Components/Clientes/Amazon/Catalogos/CatConceptosConsulta'
import RptOperacionesPagadasMisionFood from './Components/Reportes/RptOperacionesPagadasMisionFood'
import RptFacturasPedimentosPagados from './Components/Reportes/RptFacturasPedimentosPagados'
import RptArcosa from './Components/Reportes/RptArcosa'
require(`./css/${process.env.REACT_APP_ENVIRONMENT}-home.css`)
@ -145,11 +137,6 @@ ReactDOM.render(
path="/RptConsolidadosSinCerrar"
element={<RptConsolidadosSinCerrar />}
/>
<Route
path="/RptConsolidadosSinFirmaBanco"
element={<RtpConsolidadosSinFirmaBanco />}
/>
<Route
path="/RptOperacionesDiarias"
element={<RptOperacionesDiarias />}
@ -161,16 +148,6 @@ ReactDOM.render(
<Route path="/CatTabuladores" element={<CatTabuladores />} />
<Route path="/RptPedidos" element={<RptPedidos />} />
<Route path="/Rpt1868Facturas" element={<Rpt1868Facturas />} />
<Route
path="/CatFraccionesVulnerables"
element={<CatFraccionesVulnerables />}
/>
<Route
path="/CatConceptosConsulta"
element={<CatConceptosConsulta />}
/>
<Route
path="/Rpt1868Transportista"
element={<Rpt1868Transportista />}
@ -214,7 +191,10 @@ ReactDOM.render(
path="/RptAmazonFacturasPagadas"
element={<RptAmazonFacturasPagadas />}
/>
<Route path="/RptSegregacion" element={<RptSegregacion />} />
<Route
path="/RptSegregacion"
element={<RptSegregacion />}
/>
<Route
path="/RptCasaCuervoCOVEs"
element={<RptCasaCuervoCOVEs />}
@ -227,15 +207,9 @@ ReactDOM.render(
path="/RptPedimentosPagadosFacturasCruzadas"
element={<RptPedimentosPagadosFacturasCruzadas />}
/>
<Route
path="/RptOperacionesPagadasMisionFood"
element={<RptOperacionesPagadasMisionFood />}
/>
<Route
path="/RptMonitoreoFacturasPagadasAmazon"
element={<RptMonitoreoFacturasPagadasAmazon />}
<Route
path="/RptMonitoreoFacturasPagadasAmazon"
element = {<RptMonitoreoFacturasPagadasAmazon />}
/>
<Route
path="/RptPedimentosCruces01"
@ -261,17 +235,6 @@ ReactDOM.render(
path="/RptPedimentosCruces06"
element={<RptPedimentosCruces06 />}
/>
<Route
path="/RptConsFacturasFraccion"
element={<RptFacturasFraccion />}
/>
<Route
path="/RptFacturasPedimentosPagados"
element={<RptFacturasPedimentosPagados />}
/>
<Route path="/RptArcosa" element={<RptArcosa />} />
<Route path="*" element={<PageNotFound />} />
</Route>
</Routes>

@ -1,42 +0,0 @@
import { createSlice, PayloadAction } from '@reduxjs/toolkit'
import ICatFraccionesVulnerables from '../../../Interfaces/Catalogos/ICatFraccionesVulnerables';
const CatFraccionesVulnerables: ICatFraccionesVulnerables[] = [{id:0, fraccion:0 , nico:'' , activo:0 }]
const initialState = { CatFraccionesVulnerables }
export const CatFraccionesVulnerablesSlice = createSlice({
name: 'CatCorresponsales',
initialState: initialState,
reducers: {
populateCatFraccionesVulnerables : (state, action: PayloadAction<ICatFraccionesVulnerables[]>) => {
state.CatFraccionesVulnerables = []
state.CatFraccionesVulnerables.push(... action.payload)
},
addCatFraccionesVulnerables : (state, action: PayloadAction<ICatFraccionesVulnerables>) => {
var Existe = state.CatFraccionesVulnerables.find(function(item) {
return item.id === action.payload.id;
});
if (!Existe) state.CatFraccionesVulnerables.push(action.payload)
},
updateCatFraccionesVulnerables : (state, action: PayloadAction<ICatFraccionesVulnerables>) => {
const i = state.CatFraccionesVulnerables.findIndex(_element => _element.id === action.payload.id);
if (i > -1) state.CatFraccionesVulnerables[i] = action.payload;
else state.CatFraccionesVulnerables.push(action.payload);
},
deleteCatFraccionesVulnerables : (state, action: PayloadAction<number>) => {
const newArr = state.CatFraccionesVulnerables.filter(data => data.id != action.payload);
state.CatFraccionesVulnerables=newArr
},
InitCatFraccionesVulnerables : (state, action: PayloadAction<number>) => {
state.CatFraccionesVulnerables.splice(0,state.CatFraccionesVulnerables.length-1)
// state.CatCorresponsales = [{id:0, factura:'-Seleccione-', idTrafico:0, valorFacturaDls:0, proveedor:0}]
},
},
})
export const { addCatFraccionesVulnerables,
populateCatFraccionesVulnerables,
updateCatFraccionesVulnerables,
deleteCatFraccionesVulnerables,
InitCatFraccionesVulnerables } = CatFraccionesVulnerablesSlice.actions;
export default CatFraccionesVulnerablesSlice.reducer;

@ -1,50 +0,0 @@
import { createSlice, PayloadAction } from '@reduxjs/toolkit'
import ICat2096CatConceptosConsulta from '../../../../Components/Clientes/Amazon/Interfaces/I2096CatConceptosConsulta'
const CatConcetosConsulta: ICat2096CatConceptosConsulta[] = []
const initialState = { CatConcetosConsulta }
export const CatConceptosConsultaSlice = createSlice({
name: 'CatConceptosConsulta',
initialState: initialState,
reducers: {
initializeCatConcetosConsulta: (state, action: PayloadAction<ICat2096CatConceptosConsulta[]>) => {
state.CatConcetosConsulta = action.payload
},
populateCatConcetosConsultas: (state, action: PayloadAction<ICat2096CatConceptosConsulta[]>) => {
action.payload.forEach((newItem) => {
var Existe = state.CatConcetosConsulta.find(function (onMemoryItem) {
return onMemoryItem.id === newItem.id
})
if (!Existe) state.CatConcetosConsulta.push(newItem)
})
},
addCatConcetosConsulta: (state, action: PayloadAction<ICat2096CatConceptosConsulta>) => {
var Existe = state.CatConcetosConsulta.find(function (item) {
return item.id === action.payload.id
})
if (!Existe) state.CatConcetosConsulta.push(action.payload)
},
updateCatConcetosConsulta: (state, action: PayloadAction<ICat2096CatConceptosConsulta>) => {
const i = state.CatConcetosConsulta.findIndex(
(_element) => _element.id === action.payload.id
)
if (i > -1) state.CatConcetosConsulta[i] = action.payload
else state.CatConcetosConsulta.push(action.payload)
},
updateCatConcetosConsultaDetail: (state, action: PayloadAction<ICat2096CatConceptosConsulta>) => {
const i = state.CatConcetosConsulta.findIndex(
(_element) => _element.id === action.payload.id
)
if (i > -1) state.CatConcetosConsulta[i] = action.payload
else state.CatConcetosConsulta.push(action.payload)
},
deleteCatConcetosConsulta: (state, action: PayloadAction<number>) => {
const newArr = state.CatConcetosConsulta.filter((data) => data.id != action.payload)
state.CatConcetosConsulta = newArr
}
}
})
export const { initializeCatConcetosConsulta, addCatConcetosConsulta, populateCatConcetosConsultas, updateCatConcetosConsulta, deleteCatConcetosConsulta } =
CatConceptosConsultaSlice.actions
export default CatConceptosConsultaSlice.reducer

@ -3,7 +3,6 @@ import userStatusReducer from './features/userStatusSlice/userStatusSlice'
import ArchivoElectronicoSlice from './features/Reportes/ArchivoElectronico'
import CatProveedoresSlice from './features/CatProveedores/CatProveedoresSlice'
import CatCorresponsalesSlice from './features/CatCorresponsales/CatCorresponsalesSlice'
import CatFraccionesVulnerablesSlice from './features/CatFraccionesVulnerables/CatFraccionesVulnerablesSlice'
import CorresponsalesFacturasSlice from './features/Corresponsales/CorresponsalesFacturasSlice'
import CorresponsalesFacturasTercerosSlice from './features/Corresponsales/CorresponsalesFacturasTercerosSlice'
import CorresponsalesContenedoresSlice from './features/Corresponsales/CorresponsalesContenedoresSlice'
@ -18,8 +17,6 @@ import CorresponsalesCuentasComplementariasEstatusSlice from './features/Corresp
import AmazonInvoicesSlice from './features/Clientes/2096/AmazonInvoices'
import AmazonNoPartesSlice from './features/Clientes/2096/AmazonNoPartes'
import AmazonTraficoConsultaSlice from './features/Clientes/2096/AmazonTraficoConsulta'
import AmazonCatConceptosConsulta from './features/Clientes/2096/AmazonCatConceptosConsulta'
export const store = configureStore({
@ -28,7 +25,6 @@ export const store = configureStore({
ArchivoElectronico: ArchivoElectronicoSlice,
CatProveedores: CatProveedoresSlice,
CatCorresponsales: CatCorresponsalesSlice,
CatFraccionesVulnerables : CatFraccionesVulnerablesSlice,
CFData: CorresponsalesFacturasSlice,
CF3rosData: CorresponsalesFacturasTercerosSlice,
CCData : CorresponsalesContenedoresSlice,
@ -42,8 +38,7 @@ export const store = configureStore({
CCueCompEstatus : CorresponsalesCuentasComplementariasEstatusSlice,
AmazonInvoices : AmazonInvoicesSlice,
AmazonNoPartes: AmazonNoPartesSlice,
AmazonTraficoConsulta: AmazonTraficoConsultaSlice,
AmazonCatConceptosConsulta: AmazonCatConceptosConsulta
AmazonTraficoConsulta: AmazonTraficoConsultaSlice
}
})

Loading…
Cancel
Save