Se empieza el reporte de Trafico de Fracturas terminadas

AmazonRelease1.1
unknown 2 years ago
parent 4c90e28c7b
commit 5752dfb4b5
  1. 7
      src/Components/Clientes/Amazon/Components/ComboSelect/ComboDescripcion.tsx
  2. 6
      src/Components/Clientes/Amazon/Components/ComboSelect/ComboFraccion.tsx
  3. 4
      src/Components/Clientes/Amazon/Reportes/AmazonNoPartes.tsx
  4. 142
      src/Components/Clientes/Amazon/Reportes/Clasification/RptAmazonFinishedClasificationInvoices.tsx
  5. 113
      src/Components/Clientes/Amazon/Reportes/Clasification/RptAmazonPendingClasificationInvoices.tsx
  6. 38
      src/Components/Clientes/Amazon/Reportes/Clasification/RptAmazonPendingClasificationInvoicesDetail.tsx
  7. 540
      src/Components/Clientes/Amazon/Reportes/RtpAmazonPendingTraficInvoice.tsx
  8. 239
      src/Components/Clientes/Amazon/Reportes/Traffic/RptAmazonInvoiceTrafficDetail.tsx
  9. 578
      src/Components/Clientes/Amazon/Reportes/Traffic/RptAmazonLinkInvoice2Traffic.tsx
  10. 408
      src/Components/Clientes/Amazon/Reportes/Traffic/RptAmazonPendingTraficInvoiceDetail.tsx
  11. 533
      src/Components/Clientes/Amazon/Reportes/Traffic/RtpAmazonPendingTraficInvoice.tsx
  12. 62
      src/Components/Clientes/Amazon/Services/Amazon.Services.ts
  13. 2
      src/Components/Dashboard/DashboardTrafico.tsx
  14. 107
      src/index.tsx

@ -48,13 +48,10 @@ export function ComboDescripcion(props: IComboDescripcionProps) {
descripcion: Descripcion, descripcion: Descripcion,
confirmaDescripcion: Validacion confirmaDescripcion: Validacion
} }
DSAmazon.SetDescripcion(data) DSAmazon.DescripcionSET(data)
.then((response) => { .then((response) => {
UpdateInfo() UpdateInfo()
setShowModal(false) setShowModal(false)
/* setHeader('Confirmacion')
setMsg('La descripcion se ha guardado correctamente')
setShowMsg(true) */
return return
}) })
.catch((e: Error) => { .catch((e: Error) => {
@ -126,7 +123,7 @@ export function ComboDescripcion(props: IComboDescripcionProps) {
confirmaDescripcion: Validacion confirmaDescripcion: Validacion
} }
setDescripcion(props.DescripcionOriginal) setDescripcion(props.DescripcionOriginal)
DSAmazon.SetDescripcion(data) DSAmazon.DescripcionSET(data)
.then((response) => { .then((response) => {
UpdateInfo() UpdateInfo()
setShowModal(false) setShowModal(false)

@ -107,7 +107,7 @@ export function ComboFraccion(props: IComboFraccionProps) {
fraccion: Fraccion, fraccion: Fraccion,
confirmaFraccion: Validacion confirmaFraccion: Validacion
} }
DSAmazon.SetFraccion(data) DSAmazon.FraccionSET(data)
.then((response) => { .then((response) => {
UpdateInfo(response.data) UpdateInfo(response.data)
return return
@ -120,7 +120,7 @@ export function ComboFraccion(props: IComboFraccionProps) {
}, [Validacion, UserChanged]) }, [Validacion, UserChanged])
const saveFraccion = () => { const saveFraccion = () => {
DSAmazon.GetValidaFraccion(Fraccion) DSAmazon.ValidaFraccionGET(Fraccion)
.then((response) => { .then((response) => {
if (response.data.respuesta === 'Si') { if (response.data.respuesta === 'Si') {
const data: DTO2096Fraccion = { const data: DTO2096Fraccion = {
@ -128,7 +128,7 @@ export function ComboFraccion(props: IComboFraccionProps) {
fraccion: Fraccion, fraccion: Fraccion,
confirmaFraccion: Validacion confirmaFraccion: Validacion
} }
DSAmazon.SetFraccion(data) DSAmazon.FraccionSET(data)
.then((response) => { .then((response) => {
console.log('respuesta de set fraccion:'+JSON.stringify(response.data)) console.log('respuesta de set fraccion:'+JSON.stringify(response.data))
UpdateInfo(response.data) UpdateInfo(response.data)

@ -4,8 +4,6 @@ import DataTable from 'react-data-table-component'
import I2096NoParte from '../Interfaces/I2096NoParte' import I2096NoParte from '../Interfaces/I2096NoParte'
import AmazonDS from '../Services/Amazon.Services' import AmazonDS from '../Services/Amazon.Services'
import { import {
addNoPartes,
deleteNoPartes,
populateNoPartes populateNoPartes
} from '../../../../store/features/Clientes/2096/AmazonNoPartes' } from '../../../../store/features/Clientes/2096/AmazonNoPartes'
import { RootState } from '../../../../store/store' import { RootState } from '../../../../store/store'
@ -153,7 +151,7 @@ export function AmazonNoPartes(props: IAmazonNoPartesProps) {
} }
useEffect(() => { useEffect(() => {
AmazonDS.Get$Pais$Claves() AmazonDS.PaisClavesGET()
.then((response) => { .then((response) => {
setPaisClaves(response.data) setPaisClaves(response.data)
}) })

@ -2,23 +2,28 @@ import { useEffect, useState } from 'react'
import { Button, Card, Col, Form, Row, Table } from 'react-bootstrap' import { Button, Card, Col, Form, Row, Table } from 'react-bootstrap'
import { IconContext } from 'react-icons' import { IconContext } from 'react-icons'
import { BsChevronDown, BsChevronRight, BsSearch } from 'react-icons/bs' import { BsChevronDown, BsChevronRight, BsSearch } from 'react-icons/bs'
import { FaCheckCircle, FaFileExcel, FaQuestionCircle } from 'react-icons/fa' import {
FaAmazon,
FaCheckCircle,
FaFileExcel,
FaQuestionCircle
} from 'react-icons/fa'
import { ImCross } from 'react-icons/im' import { ImCross } from 'react-icons/im'
import { ComboDescripcion } from '../Components/ComboSelect/ComboDescripcion' import { ComboDescripcion } from '../../Components/ComboSelect/ComboDescripcion'
import { ComboFraccion } from '../Components/ComboSelect/ComboFraccion' import { ComboFraccion } from '../../Components/ComboSelect/ComboFraccion'
import { TextBoxFraccion } from '../Components/TextBox/TextBoxFraccion' import { TextBoxFraccion } from '../../Components/TextBox/TextBoxFraccion'
import I2096Detail from '../Interfaces/I2096Detail' import I2096Detail from '../../Interfaces/I2096Detail'
import I2096Headers from '../Interfaces/I2096Header' import I2096Headers from '../../Interfaces/I2096Header'
import DSAmazon from '../Services/Amazon.Services' import DSAmazon from '../../Services/Amazon.Services'
import * as XLSX from 'xlsx' import * as XLSX from 'xlsx'
import DTO2096PrevioExcel from '../DTO/DTO2096PrevioExcel' import DTO2096PrevioExcel from '../../DTO/DTO2096PrevioExcel'
import { MsgInformativo } from '../../../Utils/Toast/msgInformativo' import { MsgInformativo } from '../../../../Utils/Toast/msgInformativo'
import { RootState } from '../../../../store/store' import { RootState } from '../../../../../store/store'
import { import {
initializeInvoice, initializeInvoice,
populateInvoices, populateInvoices,
updateInvoice updateInvoice
} from '../../../../store/features/Clientes/2096/AmazonInvoices' } from '../../../../../store/features/Clientes/2096/AmazonInvoices'
import RtpAmazonPendingInvoicesDetail from './RptAmazonPendingClasificationInvoicesDetail' import RtpAmazonPendingInvoicesDetail from './RptAmazonPendingClasificationInvoicesDetail'
// Redux // Redux
import { useDispatch, useSelector } from 'react-redux' import { useDispatch, useSelector } from 'react-redux'
@ -50,7 +55,7 @@ export default function RptAmazonFinishedInvoices(
} }
const loadReport = () => { const loadReport = () => {
DSAmazon.AmazonFinishedClasificationInvoice$GET() DSAmazon.AmazonFinishedClasificationInvoiceGET()
.then((response) => { .then((response) => {
dispatch(initializeInvoice([])) dispatch(initializeInvoice([]))
dispatch(populateInvoices(response.data)) dispatch(populateInvoices(response.data))
@ -61,10 +66,10 @@ export default function RptAmazonFinishedInvoices(
} }
const downloadExcel = (id: number) => { const downloadExcel = (id: number) => {
DSAmazon.TerminaFactura(id) DSAmazon.SePuedeTerminardeClasificarFactura(id)
.then((response) => {}) .then((response) => {})
.catch((e: Error) => {}) .catch((e: Error) => {})
DSAmazon.GetNoPartesAmazon2SIR(id) DSAmazon.NoPartesAmazon2SIRGET(id)
.then((response: any) => { .then((response: any) => {
if (response.status === 200) { if (response.status === 200) {
const url = window.URL.createObjectURL(new Blob([response.data])) const url = window.URL.createObjectURL(new Blob([response.data]))
@ -94,21 +99,6 @@ export default function RptAmazonFinishedInvoices(
dispatch(updateInvoice(Obj)) dispatch(updateInvoice(Obj))
} }
const filtraReporte = (e: any) => {
/* setFiltro(e.target.value)
if (e.target.value.length > 0) {
setData(
Data.filter(function (row) {
return row.invoiceNumber
.toLowerCase()
.includes(e.target.value.toLocaleLowerCase())
})
)
} else {
setData(DataOriginal)
} */
}
const openLink = (item: string) => { const openLink = (item: string) => {
window.open('https://www.amazon.com/dp/' + item) window.open('https://www.amazon.com/dp/' + item)
} }
@ -117,56 +107,15 @@ export default function RptAmazonFinishedInvoices(
<Card> <Card>
<Card.Body> <Card.Body>
<Row> <Row>
<Col xs={3}> <Col xs={5}>
<Card.Title>Amazon: facturas terminadas</Card.Title> <Card.Title>
<IconContext.Provider value={{ color: '#F6C34F', size: '8%' }}>
<FaAmazon />
</IconContext.Provider>{' '}
CLASIFICACION : facturas terminadas
</Card.Title>
</Col> </Col>
<Col xs={4}></Col> <Col xs={4}></Col>
{/* <Col xs={1} style={{textAlign:'right'}}>Inicio</Col>
<Col xs={1}><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"
/></Col>
<Col xs={1} style={{textAlign:'right'}}>Hasta</Col>
<Col xs={1}><Form.Control
defaultValue={Fin}
type="date"
name="Inicio"
placeholder="Inicio"
title="Inicio"
alt="Inicio"
data-date-format="YYYY-mm-dd"
onChange={(e) => setFin(e.target.value)}
size="sm"
/></Col> */}
{/* <Col xs={1}>
<Button
variant="primary"
size="sm"
onClick={() => {
loadReport()
}}
>
<BsSearch />
Buscar
</Button>
</Col>
<Col xs={4}>
<Form.Control
type="text"
size="sm"
placeholder="Search..."
onChange={(e) => {
filtraReporte(e)
}}
/>
</Col> */}
</Row> </Row>
</Card.Body> </Card.Body>
</Card> </Card>
@ -186,11 +135,11 @@ export default function RptAmazonFinishedInvoices(
<th style={{ width: '50px' }}></th> <th style={{ width: '50px' }}></th>
<th style={{ width: '80px' }}>Commercial Invoice Date</th> <th style={{ width: '80px' }}>Commercial Invoice Date</th>
<th style={{ width: '300px' }}>Invoice Number</th> <th style={{ width: '300px' }}>Invoice Number</th>
<th>Trailer Number</th> {/* <th>Trailer Number</th>
<th>Trailer Id</th> <th>Trailer Id</th>
<th>Por Of Loading</th> <th>Por Of Loading</th>
<th>Port of entry</th> <th>Port of entry</th>
<th>Payments Terms</th> <th>Payments Terms</th> */}
<th style={{ width: '100px' }}>Incoterms</th> <th style={{ width: '100px' }}>Incoterms</th>
<th style={{ textAlign: 'center' }}>HAWB</th> <th style={{ textAlign: 'center' }}>HAWB</th>
<th>Qty Unit of measure</th> <th>Qty Unit of measure</th>
@ -200,6 +149,7 @@ export default function RptAmazonFinishedInvoices(
<th>Tot Charge or allowance</th> <th>Tot Charge or allowance</th>
<th>Tot currency ISO code</th> <th>Tot currency ISO code</th>
<th>Tot Monetary amount</th> <th>Tot Monetary amount</th>
<th>Total de partidas</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -261,7 +211,7 @@ export default function RptAmazonFinishedInvoices(
<td style={{ width: '300px' }}> <td style={{ width: '300px' }}>
{MasterData.invoiceNumber} {MasterData.invoiceNumber}
</td> </td>
<td style={{ textAlign: 'center' }}> {/* <td style={{ textAlign: 'center' }}>
{MasterData.trailerNumber} {MasterData.trailerNumber}
</td> </td>
<td style={{ textAlign: 'center' }}> <td style={{ textAlign: 'center' }}>
@ -275,7 +225,7 @@ export default function RptAmazonFinishedInvoices(
</td> </td>
<td style={{ textAlign: 'center' }}> <td style={{ textAlign: 'center' }}>
{MasterData.paymentsTerms} {MasterData.paymentsTerms}
</td> </td> */}
<td style={{ width: '100px', textAlign: 'center' }}> <td style={{ width: '100px', textAlign: 'center' }}>
{MasterData.incoterms} {MasterData.incoterms}
</td> </td>
@ -303,6 +253,18 @@ export default function RptAmazonFinishedInvoices(
<td style={{ textAlign: 'center' }}> <td style={{ textAlign: 'center' }}>
{MasterData.totalInvoiceValueMonetaryAmount} {MasterData.totalInvoiceValueMonetaryAmount}
</td> </td>
<td
style={{
fontWeight: 'bold',
textAlign: 'center'
}}
>
{mInvoices
.filter((value) => value.id === MasterData.id)
.map((row) => {
return row.detail.length
})}
</td>
</tr> </tr>
{MasterData.max ? ( {MasterData.max ? (
<tr <tr
@ -372,6 +334,15 @@ export default function RptAmazonFinishedInvoices(
> >
Valida Valida
</th> </th>
<th
style={{
width: '120px',
backgroundColor: '#D3E0EA',
color: '#346288'
}}
>
Confirme fraccion
</th>
<th <th
style={{ style={{
width: '120px', width: '120px',
@ -457,6 +428,15 @@ export default function RptAmazonFinishedInvoices(
> >
Qty Shipped Qty Shipped
</th> </th>
<th
style={{
width: '70px',
backgroundColor: '#D3E0EA',
color: '#346288'
}}
>
Unit of measure
</th>
<th <th
style={{ style={{
width: '70px', width: '70px',

@ -11,16 +11,16 @@ import {
} from 'react-bootstrap' } from 'react-bootstrap'
import { IconContext } from 'react-icons' import { IconContext } from 'react-icons'
import { BsChevronDown, BsChevronRight } from 'react-icons/bs' import { BsChevronDown, BsChevronRight } from 'react-icons/bs'
import { FaFileExcel } from 'react-icons/fa' import { FaAmazon, FaFileExcel } from 'react-icons/fa'
import I2096Headers from '../Interfaces/I2096Header' import I2096Headers from '../../Interfaces/I2096Header'
import DSAmazon from '../Services/Amazon.Services' import DSAmazon from '../../Services/Amazon.Services'
import { MsgInformativo } from '../../../Utils/Toast/msgInformativo' import { MsgInformativo } from '../../../../Utils/Toast/msgInformativo'
import { RootState } from '../../../../store/store' import { RootState } from '../../../../../store/store'
import { import {
initializeInvoice, initializeInvoice,
populateInvoices, populateInvoices,
updateInvoice updateInvoice
} from '../../../../store/features/Clientes/2096/AmazonInvoices' } from '../../../../../store/features/Clientes/2096/AmazonInvoices'
// Redux // Redux
import { useDispatch, useSelector } from 'react-redux' import { useDispatch, useSelector } from 'react-redux'
import RtpAmazonPendingInvoicesDetail from './RptAmazonPendingClasificationInvoicesDetail' import RtpAmazonPendingInvoicesDetail from './RptAmazonPendingClasificationInvoicesDetail'
@ -51,7 +51,7 @@ export default function RtpAmazonPendingInvoices(
} }
const loadReport = () => { const loadReport = () => {
DSAmazon.AmazonPendingClasificationInvoice$GET() DSAmazon.AmazonPendingClasificationInvoiceGET()
.then((response) => { .then((response) => {
dispatch(initializeInvoice([])) dispatch(initializeInvoice([]))
dispatch(populateInvoices(response.data)) dispatch(populateInvoices(response.data))
@ -62,33 +62,34 @@ export default function RtpAmazonPendingInvoices(
} }
const downloadExcel = (id: number) => { const downloadExcel = (id: number) => {
DSAmazon.TerminaFactura(id) DSAmazon.TerminaClasificarFactura(id)
.then((response) => {}) .then((response) => {
.catch((e: Error) => {}) DSAmazon.NoPartesAmazon2SIRGET(id)
DSAmazon.GetNoPartesAmazon2SIR(id) .then((response: any) => {
.then((response: any) => { if (response.status === 200) {
if (response.status === 200) { const url = window.URL.createObjectURL(new Blob([response.data]))
const url = window.URL.createObjectURL(new Blob([response.data])) const link = document.createElement('a')
const link = document.createElement('a') link.href = url
link.href = url link.setAttribute('download', 'Plantilla de partes.xlsx')
link.setAttribute('download', 'Plantilla de partes.xlsx') document.body.appendChild(link)
document.body.appendChild(link) link.click()
link.click() }
} })
}) .catch((e: Error) => {
.catch((e: Error) => { setHeader('Error')
setHeader('Error') setMsg('Ocurrio un error')
setMsg('Ocurrio un error') setShowMsg(true)
setShowMsg(true) return
return })
}) })
.catch((e: Error) => {})
} }
const downloadExceptionsFile = (id: number) => { const downloadExceptionsFile = (id: number) => {
DSAmazon.TerminaFactura(id) DSAmazon.SePuedeTerminardeClasificarFactura(id)
.then((response) => {}) .then((response) => {})
.catch((e: Error) => {}) .catch((e: Error) => {})
DSAmazon.Get$ExceptionsFile$Amazon(id) DSAmazon.ExceptionsFileAmazonGET(id)
.then((response: any) => { .then((response: any) => {
if (response.status === 200) { if (response.status === 200) {
const url = window.URL.createObjectURL(new Blob([response.data])) const url = window.URL.createObjectURL(new Blob([response.data]))
@ -141,7 +142,7 @@ export default function RtpAmazonPendingInvoices(
} }
const facturaTerminada = (row: I2096Headers) => { const facturaTerminada = (row: I2096Headers) => {
DSAmazon.Se$Puede$Terminar$Factura(row.id) DSAmazon.SePuedeTerminardeClasificarFactura(row.id)
.then((response) => { .then((response) => {
if (response.data.respuesta.includes('lista')) { if (response.data.respuesta.includes('lista')) {
setIDFactura(row.id) setIDFactura(row.id)
@ -169,8 +170,13 @@ export default function RtpAmazonPendingInvoices(
<Card> <Card>
<Card.Body> <Card.Body>
<Row> <Row>
<Col xs={3}> <Col xs={5}>
<Card.Title>Amazon: facturas pendientes</Card.Title> <Card.Title>
<IconContext.Provider value={{ color: '#F6C34F', size: '8%' }}>
<FaAmazon />
</IconContext.Provider>{' '}
CLASIFICACION : facturas pendientes
</Card.Title>
</Col> </Col>
<Col xs={4}></Col> <Col xs={4}></Col>
</Row> </Row>
@ -187,22 +193,23 @@ export default function RtpAmazonPendingInvoices(
<Table className="MDTable" hover> <Table className="MDTable" hover>
<thead style={{ position: 'sticky', top: '0' }}> <thead style={{ position: 'sticky', top: '0' }}>
<tr> <tr>
<th></th> <th style={{ width: '50px' }}></th>
<th style={{ width: '50px' }}>id</th> <th style={{ width: '50px' }}>id</th>
<th style={{ width: '50px' }}></th> <th style={{ width: '50px' }}></th>
<th style={{ width: '50px' }}></th> <th style={{ width: '50px' }}></th>
<th style={{ width: '50px' }}></th> <th style={{ width: '50px' }}></th>
<th style={{ width: '80px' }}>Commercial Invoice Date</th> <th style={{ width: '80px' }}>Commercial Invoice Date</th>
<th style={{ width: '150px' }}>Invoice Number</th> <th style={{ width: '300px' }}>Invoice Number</th>
<th style={{ width: '50px' }}>Name</th> <th style={{ width: '50px' }}>Name</th>
<th style={{ width: '100px' }}>Incoterms</th> <th style={{ width: '100px' }}>Incoterms</th>
<th>Qty Unit of measure</th> <th style={{ width: '100px' }}>Qty Unit of measure</th>
<th>Tot Qty</th> <th style={{ width: '100px' }}>Tot Qty</th>
<th>Weight unit of measure</th> <th style={{ width: '100px' }}>Weight unit of measure</th>
<th>Tot weight</th> <th style={{ width: '100px' }}>Tot weight</th>
<th>Tot Charge or allowance</th> <th style={{ width: '100px' }}>Tot Charge or allowance</th>
<th>Tot currency ISO code</th> <th style={{ width: '100px' }}>Tot currency ISO code</th>
<th>Tot Monetary amount</th> <th style={{ width: '100px' }}>Tot Monetary amount</th>
<th style={{ width: '500px' }}>Total de partidas</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -244,7 +251,6 @@ export default function RtpAmazonPendingInvoices(
</IconContext.Provider> </IconContext.Provider>
)} )}
</td> </td>
<td>{MasterData.id}</td> <td>{MasterData.id}</td>
<td> <td>
{existsExeptions(MasterData.id) > 0 ? ( {existsExeptions(MasterData.id) > 0 ? (
@ -299,9 +305,6 @@ export default function RtpAmazonPendingInvoices(
<td style={{ width: '100px', textAlign: 'center' }}> <td style={{ width: '100px', textAlign: 'center' }}>
{MasterData.incoterms} {MasterData.incoterms}
</td> </td>
{/* <td style={{ textAlign: 'center' }}>
{MasterData.hawb}
</td> */}
<td style={{ textAlign: 'center' }}> <td style={{ textAlign: 'center' }}>
{MasterData.totalInvoiceQuantityUnitOfMeasure} {MasterData.totalInvoiceQuantityUnitOfMeasure}
</td> </td>
@ -323,6 +326,18 @@ export default function RtpAmazonPendingInvoices(
<td style={{ textAlign: 'center' }}> <td style={{ textAlign: 'center' }}>
{MasterData.totalInvoiceValueMonetaryAmount} {MasterData.totalInvoiceValueMonetaryAmount}
</td> </td>
<td
style={{
fontWeight: 'bold',
textAlign: 'center'
}}
>
{mInvoices
.filter((value) => value.id === MasterData.id)
.map((row) => {
return row.detail.length
})}
</td>
</tr> </tr>
{MasterData.max ? ( {MasterData.max ? (
<tr <tr
@ -488,6 +503,15 @@ export default function RtpAmazonPendingInvoices(
> >
Qty Shipped Qty Shipped
</th> </th>
<th
style={{
width: '70px',
backgroundColor: '#D3E0EA',
color: '#346288'
}}
>
Unit Of measure
</th>
<th <th
style={{ style={{
width: '70px', width: '70px',
@ -497,6 +521,7 @@ export default function RtpAmazonPendingInvoices(
> >
Unit Net Weight Unit Net Weight
</th> </th>
<th <th
style={{ style={{
width: '70px', width: '70px',

@ -15,19 +15,17 @@ import {
import { IconContext } from 'react-icons' import { IconContext } from 'react-icons'
import { FaCheckCircle, FaQuestionCircle } from 'react-icons/fa' import { FaCheckCircle, FaQuestionCircle } from 'react-icons/fa'
import { ImCross } from 'react-icons/im' import { ImCross } from 'react-icons/im'
import { MsgInformativo } from '../../../Utils/Toast/msgInformativo' import { MsgInformativo } from '../../../../Utils/Toast/msgInformativo'
import { ComboDescripcion } from '../Components/ComboSelect/ComboDescripcion' import { ComboDescripcion } from '../../Components/ComboSelect/ComboDescripcion'
import { ComboFraccion } from '../Components/ComboSelect/ComboFraccion' import { ComboFraccion } from '../../Components/ComboSelect/ComboFraccion'
import DTO2096ItemAutoriza from '../DTO/DTO2096ItemAutoriza' import DTO2096ItemAutoriza from '../../DTO/DTO2096ItemAutoriza'
import I2096Detail from '../Interfaces/I2096Detail' import I2096Detail from '../../Interfaces/I2096Detail'
import I2096Headers from '../Interfaces/I2096Header' import I2096Headers from '../../Interfaces/I2096Header'
import DSAmazon from '../Services/Amazon.Services' import DSAmazon from '../../Services/Amazon.Services'
// Redux // Redux
import { RootState } from '../../../../store/store' import { RootState } from '../../../../../store/store'
import { useDispatch, useSelector } from 'react-redux' import { useDispatch, useSelector } from 'react-redux'
import { import { updateInvoice } from '../../../../../store/features/Clientes/2096/AmazonInvoices'
updateInvoice,
} from '../../../../store/features/Clientes/2096/AmazonInvoices'
import * as CurrencyFormat from 'react-currency-format' import * as CurrencyFormat from 'react-currency-format'
import { AiOutlineFileSearch } from 'react-icons/ai' import { AiOutlineFileSearch } from 'react-icons/ai'
import { BsFillChatRightTextFill } from 'react-icons/bs' import { BsFillChatRightTextFill } from 'react-icons/bs'
@ -135,7 +133,7 @@ export default function RtpAmazonPendingInvoivesDetail(
comentarios: Comentarios comentarios: Comentarios
} }
console.log(data) console.log(data)
DSAmazon.Set$Autorizado(data) DSAmazon.AutorizadoSET(data)
.then((response) => { .then((response) => {
editArray(id, !props.detail.autorizado) editArray(id, !props.detail.autorizado)
setShowModal(false) setShowModal(false)
@ -199,7 +197,7 @@ export default function RtpAmazonPendingInvoivesDetail(
<td <td
style={{ style={{
textAlign: 'center', textAlign: 'center',
fontSize:'18px' fontSize: '18px'
}} }}
className="DetailData" className="DetailData"
> >
@ -356,6 +354,14 @@ export default function RtpAmazonPendingInvoivesDetail(
> >
{props.detail.quantity} {props.detail.quantity}
</td> </td>
<td
style={{
textAlign: 'center'
}}
className="DetailData"
>
{props.detail.weightValue}
</td>
<td <td
style={{ style={{
textAlign: 'center' textAlign: 'center'
@ -364,6 +370,7 @@ export default function RtpAmazonPendingInvoivesDetail(
> >
{props.detail.netWeightUnitOfMeasure} {props.detail.netWeightUnitOfMeasure}
</td> </td>
<td <td
style={{ style={{
textAlign: 'center' textAlign: 'center'
@ -385,7 +392,10 @@ export default function RtpAmazonPendingInvoivesDetail(
textAlign: 'center', textAlign: 'center',
paddingLeft: '30px', paddingLeft: '30px',
visibility: visibility:
props.detail.destinationHTSCode.replaceAll('.', '').trim()!==(props.detail.fraccionGEMCO ? props.detail.fraccionGEMCO.trim() : '') props.detail.destinationHTSCode.replaceAll('.', '').trim() !==
(props.detail.fraccionGEMCO
? props.detail.fraccionGEMCO.trim()
: '')
? 'visible' ? 'visible'
: 'hidden' : 'hidden'
}} }}

@ -1,540 +0,0 @@
import { useEffect, useState } from 'react'
import { Alert, Button, Card, Col, FormCheck, Modal, Row, Table } from 'react-bootstrap'
import { IconContext } from 'react-icons'
import { BsChevronDown, BsChevronRight } from 'react-icons/bs'
import I2096Headers from '../Interfaces/I2096Header'
import DSAmazon from '../Services/Amazon.Services'
import { MsgInformativo } from '../../../Utils/Toast/msgInformativo'
import { RootState } from '../../../../store/store'
import {
initializeInvoice,
populateInvoices,
updateInvoice,
} from '../../../../store/features/Clientes/2096/AmazonInvoices'
// Redux
import { useDispatch, useSelector } from 'react-redux'
import RtpAmazonPendingTraficInvoiceDetail from './RptAmazonPendingTraficInvoiceDetail'
export interface IRptAmazonPendingTraficInvoiceProps {}
export function RptAmazonPendingTraficInvoice(
props: IRptAmazonPendingTraficInvoiceProps
) { const dispatch = useDispatch()
const mInvoices = useSelector(
(state: RootState) => state.AmazonInvoices.Invoice
)
const [header, setHeader] = useState('')
const [IDFactura, setIDFactura] = useState(0)
const [show, setShowMsg] = useState(false)
const [ShowModal, setShowModal] = useState(false)
const [msg, setMsg] = useState('')
const msgColor = 'primary'
function currentDate(days: number): string {
var today = new Date()
today.setDate(today.getDate() + days)
var dd = String(today.getDate()).padStart(2, '0')
var mm = String(today.getMonth() + 1).padStart(2, '0')
var yyyy = today.getFullYear()
return yyyy + '-' + mm + '-' + dd
}
const loadReport = () => {
DSAmazon.AmazonPendingTraficInvoice$GET()
.then((response) => {
dispatch(initializeInvoice([]))
dispatch(populateInvoices(response.data))
})
.catch((e: Error) => {
alert('Ocurrio un error' + e.message.toString())
})
}
const downloadExcel = (id: number) => {
DSAmazon.TerminaFactura(id)
.then((response) => {})
.catch((e: Error) => {})
DSAmazon.GetNoPartesAmazon2SIR(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', 'Plantilla de partes.xlsx')
document.body.appendChild(link)
link.click()
}
})
.catch((e: Error) => {
setHeader('Error')
setMsg('Ocurrio un error')
setShowMsg(true)
return
})
}
const downloadExceptionsFile = (id: number) => {
DSAmazon.TerminaFactura(id)
.then((response) => {})
.catch((e: Error) => {})
DSAmazon.Get$ExceptionsFile$Amazon(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',
'Formato de consultas (Exceptions Handling 2021).xlsx'
)
document.body.appendChild(link)
link.click()
}
})
.catch((e: Error) => {
setHeader('Error')
setMsg('Ocurrio un error')
setShowMsg(true)
return
})
}
useEffect(() => {
loadReport()
}, [])
const changeToggle = (row: I2096Headers) => {
let Invoice: I2096Headers[] = mInvoices.filter((item) => item.id === row.id)
const Obj = { ...Invoice[0] }
Obj.max = !Obj.max
dispatch(updateInvoice(Obj))
}
const openLink = (item: string) => {
window.open('https://www.amazon.com/dp/' + item)
}
const existsExeptions = (IDMaster: number) => {
const Exceptions = mInvoices
.filter((element) =>
element.detail.some((sub) => sub.idHeader === IDMaster)
)
.map((element) => {
let newElt = Object.assign({}, element) // copies element
return newElt.detail.filter(
(child) => child.idHeader === IDMaster && !child.autorizado
)
})
console.log(JSON.stringify(Exceptions[0]))
return Exceptions[0].length ? Exceptions[0].length : 0
}
const facturaTerminada = (row: I2096Headers) => {
DSAmazon.Se$Puede$Terminar$Factura(row.id)
.then((response) => {
if (response.data.respuesta.includes('lista')) {
setIDFactura(row.id)
setShowModal(true)
return
} else {
setIDFactura(0)
setHeader('Informativo')
setMsg(response.data.respuesta)
setShowMsg(true)
return
}
})
.catch((e: Error) => {
setIDFactura(0)
setHeader('Error')
setMsg('Ocurrio un error')
setShowMsg(true)
return
})
}
return (
<div>
<Card>
<Card.Body>
<Row>
<Col xs={3}>
<Card.Title>Amazon: facturas pendientes</Card.Title>
</Col>
<Col xs={4}></Col>
</Row>
</Card.Body>
</Card>
<Row>
<Col xs={2}></Col>
<Col xs={8}></Col>
<Col xs={2} className="totalLabel"></Col>
</Row>
<Card>
<Card.Body>
<div className="MDcontainer">
<Table className="MDTable" hover>
<thead style={{ position: 'sticky', top: '0' }}>
<tr>
<th></th>
<th style={{ width: '50px' }}>id</th>
<th style={{ width: '50px' }}></th>
{/* <th style={{ width: '50px' }}></th>
<th style={{ width: '50px' }}></th> */}
<th style={{ width: '80px' }}>Commercial Invoice Date</th>
<th style={{ width: '150px' }}>Invoice Number</th>
<th style={{ width: '50px' }}>Name</th>
<th style={{ width: '100px' }}>Incoterms</th>
<th>Qty Unit of measure</th>
<th>Tot Qty</th>
<th>Weight unit of measure</th>
<th>Tot weight</th>
<th>Tot Charge or allowance</th>
<th>Tot currency ISO code</th>
<th>Tot Monetary amount</th>
</tr>
</thead>
<tbody>
{mInvoices
? mInvoices.map((MasterData) => {
return (
<>
<tr
style={{ cursor: 'pointer' }}
className={
MasterData.max === true
? 'masterSelected'
: 'normalSelected'
}
>
<td
style={{ textAlign: 'left' }}
className={
MasterData.max === true
? 'masterSelected'
: 'normalSelected'
}
key={MasterData.id}
onClick={() => {
changeToggle(MasterData)
}}
>
{MasterData.max === true ? (
<IconContext.Provider
value={{ color: 'blue', size: '15px' }}
>
<BsChevronDown />
</IconContext.Provider>
) : (
<IconContext.Provider
value={{ color: 'blue', size: '15px' }}
>
<BsChevronRight />
</IconContext.Provider>
)}
</td>
<td>{MasterData.id}</td>
<td>
<FormCheck
className="form-check form-switch form-control-sm"
id="switchEnabled"
type="switch"
checked={false}
onChange={() => {
facturaTerminada(MasterData)
}
}
label=""
/>
</td>
<td style={{ width: '80px', textAlign: 'center' }}>
{MasterData.commercialInvoiceDate}
</td>
<td style={{ width: '150px' }}>
{MasterData.invoiceNumber}
</td>
<td style={{ width: '50px', textAlign: 'center' }}>
{MasterData.name}
</td>
<td style={{ width: '100px', textAlign: 'center' }}>
{MasterData.incoterms}
</td>
<td style={{ textAlign: 'center' }}>
{MasterData.totalInvoiceQuantityUnitOfMeasure}
</td>
<td style={{ textAlign: 'center' }}>
{MasterData.totalInvoiceQuantity}
</td>
<td style={{ textAlign: 'center' }}>
{MasterData.totalInvoiceWeightUnitOfMeasure}
</td>
<td style={{ textAlign: 'center' }}>
{MasterData.totalInvoiceWeight}
</td>
<td style={{ textAlign: 'center' }}>
{MasterData.totalInvoiceValueChargeOrAllowance}
</td>
<td style={{ textAlign: 'center' }}>
{MasterData.totalInvoiceValueCurrencyISOCode}
</td>
<td style={{ textAlign: 'center' }}>
{MasterData.totalInvoiceValueMonetaryAmount}
</td>
</tr>
{MasterData.max ? (
<tr
className={
MasterData.max === true
? 'masterSelected2'
: 'normalSelected2'
}
>
<th colSpan={10}>
<table
className="childTable"
style={{ width: '1450px' }}
>
<thead>
<tr>
<th
style={{
width: '50px',
backgroundColor: '#FFFFFF',
color: '#346288'
}}
></th>
<th
style={{
width: '100px',
backgroundColor: '#D3E0EA',
color: '#346288'
}}
>
Item Id
</th>
<th
style={{
width: '400px',
backgroundColor: '#D3E0EA',
color: '#346288'
}}
>
Item Description
</th>
<th
style={{
width: '120px',
backgroundColor: '#D3E0EA',
color: '#346288',
textAlign: 'center'
}}
>
Fraccion GEMCO
</th>
<th
style={{
width: '70px',
backgroundColor: '#D3E0EA',
color: '#346288',
textAlign: 'center'
}}
>
Descripcion GEMCO
</th>
<th
style={{
width: '70px',
backgroundColor: '#D3E0EA',
color: '#346288',
textAlign: 'center'
}}
>
Country of Origin
</th>
<th
style={{
width: '70px',
backgroundColor: '#D3E0EA',
color: '#346288'
}}
>
ProductGroup
</th>
<th
style={{
width: '70px',
backgroundColor: '#D3E0EA',
color: '#346288'
}}
>
Brand
</th>
<th
style={{
width: '70px',
backgroundColor: '#D3E0EA',
color: '#346288'
}}
>
Model
</th>
<th
style={{
width: '70px',
backgroundColor: '#D3E0EA',
color: '#346288'
}}
>
Unit Measure
</th>
<th
style={{
width: '70px',
backgroundColor: '#D3E0EA',
color: '#346288'
}}
>
Qty Shipped
</th>
<th
style={{
width: '70px',
backgroundColor: '#D3E0EA',
color: '#346288'
}}
>
Unit Net Weight
</th>
<th
style={{
width: '70px',
backgroundColor: '#D3E0EA',
color: '#346288'
}}
>
Unit Cost
</th>
<th
style={{
width: '70px',
backgroundColor: '#D3E0EA',
color: '#346288'
}}
>
Total value
</th>
<th
style={{
width: '70px',
backgroundColor: '#D3E0EA',
color: '#346288'
}}
>
Sight line
</th>
<th
style={{
width: '70px',
backgroundColor: '#D3E0EA',
color: '#346288'
}}
>
Comentarios
</th>
</tr>
</thead>
<tbody>
{mInvoices.map((MD) => {
return (
<>
{MD.detail
.filter(
(detail) =>
MasterData.id ===
detail.idHeader
)
.map((detail) => {
return (
<RtpAmazonPendingTraficInvoiceDetail
IDMaster={MasterData.id}
detail={detail}
Habilitado={
MasterData.estatus <= 1
}
/>
)
})}
</>
)
})}
</tbody>
</table>
</th>
</tr>
) : null}
</>
)
})
: null}
</tbody>
</Table>
</div>
</Card.Body>
</Card>
<Modal
show={ShowModal}
onHide={() => {
setShowModal(false)
}}
size={'sm'}
dialogClassName={'modal-50w'}
>
<Modal.Body>
<div style={{ height: '180px' }}>
<Row style={{ paddingTop: '15px' }}>
<Col xs={1}></Col>
<Col xs={10}>
<Alert key={'danger'} variant={'danger'}>
La factura esta lista para terminarse, desea terminarla?
</Alert>
</Col>
<Col xs={1}></Col>
</Row>
<Row style={{ paddingTop: '15px' }}>
<Col xs={6} style={{ textAlign: 'center' }}>
<Button
variant="secondary"
onClick={() => {
setShowModal(false)
}}
>
&nbsp;&nbsp;No&nbsp;&nbsp;
</Button>
</Col>
<Col xs={6} style={{ textAlign: 'center' }}>
<Button
variant="danger"
onClick={() => {
downloadExcel(IDFactura)
}}
>
&nbsp;&nbsp;Si&nbsp;&nbsp;
</Button>
</Col>
</Row>
</div>
</Modal.Body>
</Modal>
<MsgInformativo
show={show}
msg={msg}
header={header}
msgColor={msgColor}
closeToast={() => {
setShowMsg(false)
}}
/>
</div>
)
}

@ -15,47 +15,49 @@ import {
import { IconContext } from 'react-icons' import { IconContext } from 'react-icons'
import { FaCheckCircle, FaQuestionCircle } from 'react-icons/fa' import { FaCheckCircle, FaQuestionCircle } from 'react-icons/fa'
import { ImCross } from 'react-icons/im' import { ImCross } from 'react-icons/im'
import { MsgInformativo } from '../../../Utils/Toast/msgInformativo' import { MsgInformativo } from '../../../../Utils/Toast/msgInformativo'
import { ComboDescripcion } from '../Components/ComboSelect/ComboDescripcion' import { ComboDescripcion } from '../../Components/ComboSelect/ComboDescripcion'
import { ComboFraccion } from '../Components/ComboSelect/ComboFraccion' import { ComboFraccion } from '../../Components/ComboSelect/ComboFraccion'
import DTO2096ItemAutoriza from '../DTO/DTO2096ItemAutoriza' import DTO2096ItemAutoriza from '../../DTO/DTO2096ItemAutoriza'
import I2096Detail from '../Interfaces/I2096Detail' import I2096Detail from '../../Interfaces/I2096Detail'
import I2096Headers from '../Interfaces/I2096Header' import I2096Headers from '../../Interfaces/I2096Header'
import DSAmazon from '../Services/Amazon.Services' import DSAmazon from '../../Services/Amazon.Services'
// Redux // Redux
import { RootState } from '../../../../store/store' import { RootState } from '../../../../../store/store'
import { useDispatch, useSelector } from 'react-redux' import { useDispatch, useSelector } from 'react-redux'
import { import { updateInvoice } from '../../../../../store/features/Clientes/2096/AmazonInvoices'
updateInvoice,
} from '../../../../store/features/Clientes/2096/AmazonInvoices'
import * as CurrencyFormat from 'react-currency-format' import * as CurrencyFormat from 'react-currency-format'
import { AiOutlineFileSearch } from 'react-icons/ai' import { AiOutlineFileSearch } from 'react-icons/ai'
import { BsFillChatRightTextFill } from 'react-icons/bs' import { BsFillChatRightTextFill } from 'react-icons/bs'
import DTO2096SightLine from '../DTO/DTO2096SightLine'
export interface IRptAmazonPendingTraficInvoiceDetailProps { export interface IRtpAmazonInvoiceTrafficDetailProps {
IDMaster: number IDMaster: number
detail: I2096Detail detail: I2096Detail
Habilitado: boolean Habilitado: boolean
} }
export default function RptAmazonPendingTraficInvoiceDetail (props: IRptAmazonPendingTraficInvoiceDetailProps) { export default function RtpAmazonInvoiceTrafficDetail (props: IRtpAmazonInvoiceTrafficDetailProps) {
const dispatch = useDispatch() const dispatch = useDispatch()
const mInvoices = useSelector( const mInvoices = useSelector(
(state: RootState) => state.AmazonInvoices.Invoice (state: RootState) => state.AmazonInvoices.Invoice
) )
const [ShowModal, setShowModal] = useState(false) const [ShowModal, setShowModal] = useState(false)
const [EstatusSwith, setEstatusSwitch] = useState(props.detail.sightLine) const [EstatusSwith, setEstatusSwitch] = useState(props.detail.autorizado)
const [UserChanged, setUserChanged] = useState(false) const [UserChanged, setUserChanged] = useState(false)
const [header, setHeader] = useState('') const [header, setHeader] = useState('')
const [show, setShowMsg] = useState(false) const [show, setShowMsg] = useState(false)
const [Show, setShow] = useState(false) const [Show, setShow] = useState(false)
const [msg, setMsg] = useState('') const [msg, setMsg] = useState('')
const [Comentarios, setComentarios] = useState( const [RequerimientoNormativo, setRequerimientoNormativo] = useState(
props.detail.comentariosSightLine props.detail.requerimientoNormativo
? props.detail.comentariosSightLine ? props.detail.requerimientoNormativo
: '' : ''
) )
const [Comentarios, setComentarios] = useState(
props.detail.comentarios
? props.detail.comentarios
: 'Clasificacion Incorrecta'
)
const msgColor = 'primary' const msgColor = 'primary'
const openLink = (item: string) => { const openLink = (item: string) => {
window.open('https://www.amazon.com/dp/' + item) window.open('https://www.amazon.com/dp/' + item)
@ -113,29 +115,33 @@ export default function RptAmazonPendingTraficInvoiceDetail (props: IRptAmazonPe
UpdateInfo(Invoice[0], newDetail) UpdateInfo(Invoice[0], newDetail)
} }
const ToggleSightLine = (id: number) => { const autoriceItem = (id: number) => {
const data: DTO2096SightLine = { if (RequerimientoNormativo.length === 0 && EstatusSwith) {
setHeader('Error')
setMsg(
'Antes de poder guardar la informacion es necesario que proporcione el reparto normativo'
)
setShowMsg(true)
return
}
const data: DTO2096ItemAutoriza = {
id: id, id: id,
sightLine: EstatusSwith, autorizado: EstatusSwith,
comentariosSightLine: Comentarios requerimientoNormativo: RequerimientoNormativo,
comentarios: Comentarios
} }
DSAmazon.SightLineSET(data) console.log(data)
DSAmazon.AutorizadoSET(data)
.then((response) => { .then((response) => {
console.log(response.data) editArray(id, !props.detail.autorizado)
//editArray(id, !props.detail.autorizado)
setShowModal(false) setShowModal(false)
}) })
.catch((e: Error) => { .catch((e: Error) => {})
setHeader('Error')
setMsg('Ocurrio un error, no se guardo la informacion en BD')
setShowMsg(true)
return
})
} }
useEffect(() => { useEffect(() => {
if (UserChanged) setShowModal(true) if (UserChanged && EstatusSwith && !props.detail.fraccionGEMCO)
//ToggleSightLine(props.detail.id) autoriceItem(props.detail.id)
}, [EstatusSwith, UserChanged]) }, [EstatusSwith, UserChanged])
const popover = ( const popover = (
@ -178,6 +184,73 @@ export default function RptAmazonPendingTraficInvoiceDetail (props: IRptAmazonPe
> >
{props.detail.itemDescription} {props.detail.itemDescription}
</td> </td>
<td
style={{
textAlign: 'right'
}}
className="DetailData"
>
{props.detail.pedimentoDescription}
</td>
<td
style={{
textAlign: 'center',
fontSize: '18px'
}}
className="DetailData"
>
&nbsp;&nbsp;{props.detail.destinationHTSCode}
</td>
<td
style={{
textAlign: 'center'
}}
className="DetailData"
>
{props.detail.validaFraccionOriginal === 0 ? (
<IconContext.Provider
value={{
color: 'orange',
size: '20px'
}}
>
<FaQuestionCircle />
</IconContext.Provider>
) : props.detail.validaFraccionOriginal === 1 ? (
<IconContext.Provider
value={{
color: 'green',
size: '20px'
}}
>
<FaCheckCircle />
</IconContext.Provider>
) : (
<IconContext.Provider
value={{
color: 'red',
size: '20px'
}}
>
<ImCross />
</IconContext.Provider>
)}
</td>
<td
style={{
textAlign: 'center'
}}
className="DetailData"
>
<ComboFraccion
IDInvoice={props.IDMaster}
IDDetail={props.detail.id}
FraccionOriginal={props.detail.destinationHTSCode}
ConfirmaFraccion={props.detail.confirmaFraccion}
/* parentFunction={parentFunction} */
Habilitado={props.Habilitado}
/>
</td>
<td <td
style={{ style={{
textAlign: 'center' textAlign: 'center'
@ -209,6 +282,20 @@ export default function RptAmazonPendingTraficInvoiceDetail (props: IRptAmazonPe
}} }}
/> />
</td> </td>
<td
style={{
textAlign: 'center'
}}
className="DetailData"
>
<ComboDescripcion
IDInvoice={props.IDMaster}
IDDetail={props.detail.id}
DescripcionOriginal={props.detail.pedimentoDescription}
ConfirmaDescripcion={props.detail.confirmaDescripcion}
Habilitado={props.Habilitado}
/>
</td>
<td <td
style={{ style={{
textAlign: 'center' textAlign: 'center'
@ -265,6 +352,14 @@ export default function RptAmazonPendingTraficInvoiceDetail (props: IRptAmazonPe
> >
{props.detail.quantity} {props.detail.quantity}
</td> </td>
<td
style={{
textAlign: 'center'
}}
className="DetailData"
>
{props.detail.weightValue}
</td>
<td <td
style={{ style={{
textAlign: 'center' textAlign: 'center'
@ -273,6 +368,7 @@ export default function RptAmazonPendingTraficInvoiceDetail (props: IRptAmazonPe
> >
{props.detail.netWeightUnitOfMeasure} {props.detail.netWeightUnitOfMeasure}
</td> </td>
<td <td
style={{ style={{
textAlign: 'center' textAlign: 'center'
@ -293,6 +389,13 @@ export default function RptAmazonPendingTraficInvoiceDetail (props: IRptAmazonPe
style={{ style={{
textAlign: 'center', textAlign: 'center',
paddingLeft: '30px', paddingLeft: '30px',
visibility:
props.detail.destinationHTSCode.replaceAll('.', '').trim() !==
(props.detail.fraccionGEMCO
? props.detail.fraccionGEMCO.trim()
: '')
? 'visible'
: 'hidden'
}} }}
className="DetailData" className="DetailData"
> >
@ -300,7 +403,11 @@ export default function RptAmazonPendingTraficInvoiceDetail (props: IRptAmazonPe
className="form-check form-switch form-control-lg" className="form-check form-switch form-control-lg"
id="switchEnabled" id="switchEnabled"
type="switch" type="switch"
checked={EstatusSwith} disabled={
props.detail.fraccionGEMCO ===
props.detail.destinationHTSCode.replaceAll('.', '')
}
checked={EstatusSwith && props.detail.autorizado}
onChange={() => { onChange={() => {
setEstatusSwitch(!EstatusSwith) setEstatusSwitch(!EstatusSwith)
setUserChanged(true) setUserChanged(true)
@ -312,13 +419,15 @@ export default function RptAmazonPendingTraficInvoiceDetail (props: IRptAmazonPe
<td <td
style={{ style={{
visibility: visibility:
props.detail.sightLine ? 'hidden' : 'visible' RequerimientoNormativo.length === 0 ? 'hidden' : 'visible'
}} }}
> >
{' '} {' '}
<OverlayTrigger <OverlayTrigger
placement="bottom" placement="bottom"
overlay={<Tooltip id="button-tooltip-2">{Comentarios}</Tooltip>} overlay={
<Tooltip id="button-tooltip-2">{RequerimientoNormativo}</Tooltip>
}
> >
{({ ref, ...triggerHandler }) => ( {({ ref, ...triggerHandler }) => (
<Button variant="light" {...triggerHandler}> <Button variant="light" {...triggerHandler}>
@ -327,6 +436,32 @@ export default function RptAmazonPendingTraficInvoiceDetail (props: IRptAmazonPe
color: 'blue', color: 'blue',
size: '25px' size: '25px'
}} }}
>
<AiOutlineFileSearch />
</IconContext.Provider>
<span className="ms-1"></span>
</Button>
)}
</OverlayTrigger>
</td>
<td
style={{
visibility:
RequerimientoNormativo.length === 0 ? 'hidden' : 'visible'
}}
>
{' '}
<OverlayTrigger
placement="bottom"
overlay={<Tooltip id="button-tooltip-2">{Comentarios}</Tooltip>}
>
{({ ref, ...triggerHandler }) => (
<Button variant="light" {...triggerHandler}>
<IconContext.Provider
value={{
color: 'green',
size: '25px'
}}
> >
<BsFillChatRightTextFill /> <BsFillChatRightTextFill />
</IconContext.Provider> </IconContext.Provider>
@ -344,11 +479,32 @@ export default function RptAmazonPendingTraficInvoiceDetail (props: IRptAmazonPe
}} }}
size={'sm'} size={'sm'}
dialogClassName={'modal-50w'} dialogClassName={'modal-50w'}
backdrop='static'
disableEscapeKeyDown = {true}
> >
<Modal.Body> <Modal.Body>
<div style={{ height: '150px' }}> <div style={{ height: '280px' }}>
<Row style={{ paddingTop: '15px' }}>
<Col xs={1}></Col>
<Col xs={10}>
<Alert key={'danger'} variant={'danger'}>
¿Esta seguro que esta fraccion ya la autorizo Amazon?
</Alert>
</Col>
<Col xs={1}></Col>
</Row>
<Row style={{ paddingTop: '15px' }}>
<Col xs={3}>Cumplimiento normativo</Col>
<Col xs={8}>
{' '}
<Form.Control
as="textarea"
id="RequerimientoNormativo"
size="sm"
value={RequerimientoNormativo}
onChange={(e) => setRequerimientoNormativo(e.target.value)}
/>
</Col>
<Col>&nbsp;</Col>
</Row>
<Row style={{ paddingTop: '15px' }}> <Row style={{ paddingTop: '15px' }}>
<Col xs={3}>Comentarios</Col> <Col xs={3}>Comentarios</Col>
<Col xs={8}> <Col xs={8}>
@ -360,7 +516,7 @@ export default function RptAmazonPendingTraficInvoiceDetail (props: IRptAmazonPe
value={ value={
Comentarios.length Comentarios.length
? Comentarios ? Comentarios
: '' : 'Clasificacion incorrecta.'
} }
onChange={(e) => setComentarios(e.target.value)} onChange={(e) => setComentarios(e.target.value)}
/> />
@ -372,7 +528,6 @@ export default function RptAmazonPendingTraficInvoiceDetail (props: IRptAmazonPe
<Button <Button
variant="secondary" variant="secondary"
onClick={() => { onClick={() => {
setEstatusSwitch(true)
setShowModal(false) setShowModal(false)
}} }}
> >
@ -383,7 +538,7 @@ export default function RptAmazonPendingTraficInvoiceDetail (props: IRptAmazonPe
<Button <Button
variant="danger" variant="danger"
onClick={() => { onClick={() => {
ToggleSightLine(props.detail.id) autoriceItem(props.detail.id)
}} }}
> >
&nbsp;&nbsp;Si&nbsp;&nbsp; &nbsp;&nbsp;Si&nbsp;&nbsp;

@ -0,0 +1,578 @@
import { useEffect, useState } from 'react'
import {
Alert,
Button,
Card,
Col,
Form,
Modal,
Row,
Table
} from 'react-bootstrap'
import { IconContext } from 'react-icons'
import { BsChevronDown, BsChevronRight, BsSearch } from 'react-icons/bs'
import {
FaAmazon,
FaCheckCircle,
FaFileExcel,
FaQuestionCircle
} from 'react-icons/fa'
import { ImCross } from 'react-icons/im'
import { ComboDescripcion } from '../../Components/ComboSelect/ComboDescripcion'
import { ComboFraccion } from '../../Components/ComboSelect/ComboFraccion'
import { TextBoxFraccion } from '../../Components/TextBox/TextBoxFraccion'
import I2096Detail from '../../Interfaces/I2096Detail'
import I2096Headers from '../../Interfaces/I2096Header'
import DSAmazon from '../../Services/Amazon.Services'
import * as XLSX from 'xlsx'
import DTO2096PrevioExcel from '../../DTO/DTO2096PrevioExcel'
import { MsgInformativo } from '../../../../Utils/Toast/msgInformativo'
import { RootState } from '../../../../../store/store'
import {
initializeInvoice,
populateInvoices,
updateInvoice
} from '../../../../../store/features/Clientes/2096/AmazonInvoices'
import RptAmazonInvoiceTrafficDetail from './RptAmazonInvoiceTrafficDetail'
// Redux
import { useDispatch, useSelector } from 'react-redux'
export interface IRptAmazonLinkInvoice2TrafficProps {}
export function RptAmazonLinkInvoice2Traffic(
props: IRptAmazonLinkInvoice2TrafficProps
) {
const dispatch = useDispatch()
const mInvoices = useSelector(
(state: RootState) => state.AmazonInvoices.Invoice
)
const [header, setHeader] = useState('')
const [Referencia, setReferencia] = useState('')
const [show, setShowMsg] = useState(false)
const [ShowModal, setShowModal] = useState(false)
const [msg, setMsg] = useState('')
const [Invoices, setInvoices] = useState<number[]>([])
const msgColor = 'primary'
function currentDate(days: number): string {
var today = new Date()
today.setDate(today.getDate() + days)
var dd = String(today.getDate()).padStart(2, '0')
var mm = String(today.getMonth() + 1).padStart(2, '0')
var yyyy = today.getFullYear()
return yyyy + '-' + mm + '-' + dd
}
const loadReport = () => {
DSAmazon.AmazonLinkInvoice2TrafficGet()
.then((response) => {
dispatch(initializeInvoice([]))
dispatch(populateInvoices(response.data))
})
.catch((e: Error) => {
alert('Ocurrio un error' + e.message.toString())
})
}
const downloadExcel = (id: number) => {
DSAmazon.SePuedeTerminardeClasificarFactura(id)
.then((response) => {})
.catch((e: Error) => {})
DSAmazon.NoPartesAmazon2SIRGET(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', 'Plantilla de partes.xlsx')
document.body.appendChild(link)
link.click()
}
})
.catch((e: Error) => {
setHeader('Error')
setMsg('Ocurrio un error')
setShowMsg(true)
return
})
}
useEffect(() => {
loadReport()
}, [])
const changeToggle = (row: I2096Headers) => {
let Invoice: I2096Headers[] = mInvoices.filter((item) => item.id === row.id)
const Obj = { ...Invoice[0] }
Obj.max = !Obj.max
dispatch(updateInvoice(Obj))
}
const toggleInvoice = (id: number) => {
if (!Invoices.includes(id)) {
Invoices.push(id)
} else {
setInvoices(
Invoices.filter(function (el) {
return el != id
})
)
}
console.log('Invoices=' + Invoices)
}
const processInvoices = () => {
if (Invoices.length === 0) {
setHeader('Error')
setMsg(
'Para poder continuar es necesario que seleccione por lo menos 1 factura'
)
setShowMsg(true)
return
}
//alert(Invoices)
setShowModal(true)
}
const openLink = (item: string) => {
window.open('https://www.amazon.com/dp/' + item)
}
return (
<div>
<Card>
<Card.Body>
<Row>
<Col xs={5}>
<Card.Title>
<IconContext.Provider value={{ color: '#F6C34F', size: '8%' }}>
<FaAmazon />
</IconContext.Provider>{' '}
TRAFICO : facturas terminadas
</Card.Title>
</Col>
<Col xs={6}></Col>
<Col>
<Button
onClick={() => {
processInvoices()
}}
>
Procesa
</Button>
</Col>
</Row>
</Card.Body>
</Card>
<Card>
<Card.Body>
<div className="MDcontainer">
<Table className="MDTable" hover>
<thead style={{ position: 'sticky', top: '0' }}>
<tr>
<th></th>
<th style={{ width: '50px' }}>id</th>
<th style={{ width: '50px' }}>[...]</th>
<th style={{ width: '80px' }}>Commercial Invoice Date</th>
<th style={{ width: '250px' }}>Invoice Number</th>
<th style={{ width: '100px' }}>Incoterms</th>
<th style={{ textAlign: 'center' }}>HAWB</th>
<th>Qty Unit of measure</th>
<th>Tot Qty</th>
<th>Weight unit of measure</th>
<th>Tot weight</th>
<th>Tot Charge or allowance</th>
<th>Tot currency ISO code</th>
<th>Tot Monetary amount</th>
<th>Total de partidas</th>
</tr>
</thead>
<tbody>
{mInvoices
? mInvoices.map((MasterData) => {
return (
<>
<tr
style={{ cursor: 'pointer' }}
className={
MasterData.max === true
? 'masterSelected'
: 'normalSelected'
}
>
<td
style={{ textAlign: 'left' }}
className={
MasterData.max === true
? 'masterSelected'
: 'normalSelected'
}
key={MasterData.id}
onClick={() => {
changeToggle(MasterData)
}}
>
{MasterData.max === true ? (
<IconContext.Provider
value={{ color: 'blue', size: '15px' }}
>
<BsChevronDown />
</IconContext.Provider>
) : (
<IconContext.Provider
value={{ color: 'blue', size: '15px' }}
>
<BsChevronRight />
</IconContext.Provider>
)}
</td>
<td>{MasterData.id}</td>
<td style={{ textAlign: 'center' }}>
<Form.Check
aria-label="ChkRow"
onClick={() => toggleInvoice(MasterData.id)}
/>
</td>
<td style={{ width: '80px', textAlign: 'center' }}>
{MasterData.commercialInvoiceDate}
</td>
<td style={{ width: '300px' }}>
{MasterData.invoiceNumber}
</td>
<td style={{ width: '100px', textAlign: 'center' }}>
{MasterData.incoterms}
</td>
<td style={{ textAlign: 'center' }}>
{MasterData.hawb}
</td>
<td style={{ textAlign: 'center' }}>
{MasterData.totalInvoiceQuantityUnitOfMeasure}
</td>
<td style={{ textAlign: 'center' }}>
{MasterData.totalInvoiceQuantity}
</td>
<td style={{ textAlign: 'center' }}>
{MasterData.totalInvoiceWeightUnitOfMeasure}
</td>
<td style={{ textAlign: 'center' }}>
{MasterData.totalInvoiceWeight}
</td>
<td style={{ textAlign: 'center' }}>
{MasterData.totalInvoiceValueChargeOrAllowance}
</td>
<td style={{ textAlign: 'center' }}>
{MasterData.totalInvoiceValueCurrencyISOCode}
</td>
<td style={{ textAlign: 'center' }}>
{MasterData.totalInvoiceValueMonetaryAmount}
</td>
<td
style={{
fontWeight: 'bold',
textAlign: 'center'
}}
>
{mInvoices
.filter((value) => value.id === MasterData.id)
.map((row) => {
return row.detail.length
})}
</td>
</tr>
{MasterData.max ? (
<tr
className={
MasterData.max === true
? 'masterSelected2'
: 'normalSelected2'
}
>
<th colSpan={10}>
<table
className="childTable"
style={{ width: '1450px' }}
>
<thead>
<tr>
<th
style={{
width: '50px',
backgroundColor: '#FFFFFF',
color: '#346288'
}}
></th>
<th
style={{
width: '100px',
backgroundColor: '#D3E0EA',
color: '#346288'
}}
>
Item Id
</th>
<th
style={{
width: '400px',
backgroundColor: '#D3E0EA',
color: '#346288'
}}
>
Item Description
</th>
<th
style={{
width: '120px',
backgroundColor: '#D3E0EA',
color: '#346288'
}}
>
Pedimento Description
</th>
<th
style={{
width: '120px',
backgroundColor: '#D3E0EA',
color: '#346288',
textAlign: 'center'
}}
>
Destination HTS Code
</th>
<th
style={{
width: '120px',
backgroundColor: '#D3E0EA',
color: '#346288'
}}
>
Valida
</th>
<th
style={{
width: '120px',
backgroundColor: '#D3E0EA',
color: '#346288'
}}
>
Confirme fraccion
</th>
<th
style={{
width: '120px',
backgroundColor: '#D3E0EA',
color: '#346288',
textAlign: 'center'
}}
>
Fraccion GEMCO
</th>
<th
style={{
width: '120px',
backgroundColor: '#D3E0EA',
color: '#346288',
textAlign: 'center'
}}
>
Confirme descripcion
</th>
<th
style={{
width: '70px',
backgroundColor: '#D3E0EA',
color: '#346288',
textAlign: 'center'
}}
>
Descripcion GEMCO
</th>
<th
style={{
width: '70px',
backgroundColor: '#D3E0EA',
color: '#346288',
textAlign: 'center'
}}
>
Country of Origin
</th>
<th
style={{
width: '70px',
backgroundColor: '#D3E0EA',
color: '#346288'
}}
>
ProductGroup
</th>
<th
style={{
width: '70px',
backgroundColor: '#D3E0EA',
color: '#346288'
}}
>
Brand
</th>
<th
style={{
width: '70px',
backgroundColor: '#D3E0EA',
color: '#346288'
}}
>
Model
</th>
<th
style={{
width: '70px',
backgroundColor: '#D3E0EA',
color: '#346288'
}}
>
Unit Measure
</th>
<th
style={{
width: '70px',
backgroundColor: '#D3E0EA',
color: '#346288'
}}
>
Qty Shipped
</th>
<th
style={{
width: '70px',
backgroundColor: '#D3E0EA',
color: '#346288'
}}
>
Unit of measure
</th>
<th
style={{
width: '70px',
backgroundColor: '#D3E0EA',
color: '#346288'
}}
>
Unit Net Weight
</th>
<th
style={{
width: '70px',
backgroundColor: '#D3E0EA',
color: '#346288'
}}
>
Unit Cost
</th>
<th
style={{
width: '70px',
backgroundColor: '#D3E0EA',
color: '#346288'
}}
>
Total value
</th>
</tr>
</thead>
<tbody>
{mInvoices.map((MD) => {
return (
<>
{MD.detail
.filter(
(detail) =>
MasterData.id ===
detail.idHeader
)
.map((detail) => {
return (
<RptAmazonInvoiceTrafficDetail
IDMaster={MasterData.id}
detail={detail}
Habilitado={
MasterData.estatus <= 1
}
/>
)
})}
</>
)
})}
</tbody>
</table>
</th>
</tr>
) : null}
</>
)
})
: null}
</tbody>
</Table>
</div>
</Card.Body>
</Card>
<Modal
show={ShowModal}
onHide={() => {
setShowModal(false)
}}
size={'sm'}
dialogClassName={'modal-50w'}
>
<Modal.Body>
<div style={{ height: '180px' }}>
<Alert key={'danger'} variant={'danger'}>
<Row style={{ paddingTop: '15px' }}>
<Col xs={9}>
Para asociar estar facturas proporcione la referencia de SIR
</Col>
<Col xs={3}>
<Form.Control
type="text"
id="Referencia"
size="sm"
value={Referencia}
onChange={(e) => setReferencia(e.target.value)}
/>
</Col>
</Row>
</Alert>
<Row style={{ paddingTop: '15px' }}>
<Col xs={6} style={{ textAlign: 'center' }}>
<Button
variant="secondary"
onClick={() => {
setShowModal(false)
}}
>
&nbsp;&nbsp;Cancelar&nbsp;&nbsp;
</Button>
</Col>
<Col xs={6} style={{ textAlign: 'center' }}>
<Button variant="danger" onClick={() => {}}>
&nbsp;&nbsp;Asociar referencia&nbsp;&nbsp;
</Button>
</Col>
</Row>
</div>
</Modal.Body>
</Modal>
<MsgInformativo
show={show}
msg={msg}
header={header}
msgColor={msgColor}
closeToast={() => {
setShowMsg(false)
}}
/>
</div>
)
}

@ -0,0 +1,408 @@
import * as React from 'react'
import { useEffect, useState } from 'react'
import {
Alert,
Button,
Col,
Form,
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'
import DTO2096ItemAutoriza from '../../DTO/DTO2096ItemAutoriza'
import I2096Detail from '../../Interfaces/I2096Detail'
import I2096Headers from '../../Interfaces/I2096Header'
import DSAmazon from '../../Services/Amazon.Services'
// Redux
import { RootState } from '../../../../../store/store'
import { useDispatch, useSelector } from 'react-redux'
import { updateInvoice } from '../../../../../store/features/Clientes/2096/AmazonInvoices'
import * as CurrencyFormat from 'react-currency-format'
import { AiOutlineFileSearch } from 'react-icons/ai'
import { BsFillChatRightTextFill } from 'react-icons/bs'
import DTO2096SightLine from '../../DTO/DTO2096SightLine'
export interface IRptAmazonPendingTraficInvoiceDetailProps {
IDMaster: number
detail: I2096Detail
Habilitado: boolean
}
export default function RptAmazonPendingTraficInvoiceDetail(
props: IRptAmazonPendingTraficInvoiceDetailProps
) {
const dispatch = useDispatch()
const mInvoices = useSelector(
(state: RootState) => state.AmazonInvoices.Invoice
)
const [ShowModal, setShowModal] = useState(false)
const [EstatusSwith, setEstatusSwitch] = useState(props.detail.sightLine)
const [UserChanged, setUserChanged] = useState(false)
const [header, setHeader] = useState('')
const [show, setShowMsg] = useState(false)
const [Show, setShow] = useState(false)
const [msg, setMsg] = useState('')
const [Comentarios, setComentarios] = useState(
props.detail.comentariosSightLine ? props.detail.comentariosSightLine : ''
)
const msgColor = 'primary'
const openLink = (item: string) => {
window.open('https://www.amazon.com/dp/' + item)
}
const target = React.useRef(null)
const UpdateInfo = (Invoice: I2096Headers, Detail: I2096Detail[]) => {
const updatedInvoice: I2096Headers = {
id: props.IDMaster,
commercialInvoiceDate: Invoice.commercialInvoiceDate,
invoiceNumber: Invoice.invoiceNumber,
name: Invoice.name,
trailerNumber: Invoice.trailerNumber,
trailerId: Invoice.trailerId,
porOfLoading: Invoice.porOfLoading,
portOfEntry: Invoice.portOfEntry,
paymentsTerms: Invoice.paymentsTerms,
incoterms: Invoice.incoterms,
hawb: Invoice.hawb,
totalInvoiceQuantityUnitOfMeasure:
Invoice.totalInvoiceQuantityUnitOfMeasure,
totalInvoiceQuantity: Invoice.totalInvoiceQuantity,
totalInvoiceWeightUnitOfMeasure: Invoice.totalInvoiceWeightUnitOfMeasure,
totalInvoiceWeight: Invoice.totalInvoiceWeight,
totalInvoiceValueChargeOrAllowance:
Invoice.totalInvoiceValueChargeOrAllowance,
totalInvoiceValueCurrencyISOCode:
Invoice.totalInvoiceValueCurrencyISOCode,
totalInvoiceValueMonetaryAmount: Invoice.totalInvoiceValueMonetaryAmount,
footNote: Invoice.footNote,
archivo: Invoice.archivo,
fCreacion: Invoice.fCreacion,
estatus: Invoice.estatus,
max: true,
detail: Detail
}
dispatch(updateInvoice(updatedInvoice))
}
const editArray = (id: number, valor: boolean) => {
const Invoice = mInvoices
.filter((el) => el.id === props.IDMaster)
.map((el) => {
return el
})
const newDetail = Invoice[0].detail.map((el) => {
if (el.id === id) {
return {
...el,
autorizado: valor
}
}
return el
})
UpdateInfo(Invoice[0], newDetail)
}
const ToggleSightLine = (id: number) => {
const data: DTO2096SightLine = {
id: id,
sightLine: EstatusSwith,
comentariosSightLine: Comentarios
}
DSAmazon.SightLineSET(data)
.then((response) => {
console.log(response.data)
//editArray(id, !props.detail.autorizado)
setShowModal(false)
})
.catch((e: Error) => {
setHeader('Error')
setMsg('Ocurrio un error, no se guardo la informacion en BD')
setShowMsg(true)
return
})
}
useEffect(() => {
if (UserChanged) setShowModal(true)
//ToggleSightLine(props.detail.id)
}, [EstatusSwith, UserChanged])
const popover = (
<Popover id="popover-basic">
<Popover.Header as="h3">Popover right</Popover.Header>
<Popover.Body>
And here's some <strong>amazing</strong> content. It's very engaging.
right?
</Popover.Body>
</Popover>
)
return (
<>
<tr>
<th
style={{
width: '50px',
backgroundColor: '#FFFFFF'
}}
className="DetailData"
>
&nbsp;
</th>
<td
style={{
textAlign: 'center',
cursor: 'pointer'
}}
className="DetailData"
onClick={() => openLink(props.detail.itemId)}
>
{props.detail.itemId}
</td>
<td
style={{
textAlign: 'right'
}}
className="DetailData"
>
{props.detail.itemDescription}
</td>
<td
style={{
textAlign: 'center'
}}
className="DetailData"
>
<CurrencyFormat
value={props.detail.fraccionGEMCO ? props.detail.fraccionGEMCO : ''}
disabled={true}
format={'######## ##'}
displayType={'input'}
style={{
fontSize: '18px',
backgroundColor:
props.detail.validaFraccionOriginal === 0
? '#FFFAF2 '
: '#E5F7B6',
border:
props.detail.validaFraccionOriginal === 0
? '2px solid #F9A721'
: '2px solid green',
color:
props.detail.validaFraccionOriginal === 0
? '#5923F6'
: '#000000',
width: '115px',
textAlign: 'right',
borderRadius: '10px'
}}
/>
</td>
<td
style={{
textAlign: 'center'
}}
className="DetailData"
>
{props.detail.descripcionGEMCO}
</td>
<td
style={{
textAlign: 'center'
}}
className="DetailData"
>
{props.detail.countryOfOrigin}
</td>
<td
style={{
textAlign: 'right'
}}
className="DetailData"
>
{props.detail.productGroup}
</td>
<td
style={{
textAlign: 'right'
}}
className="DetailData"
>
{props.detail.brand}
</td>
<td
style={{
textAlign: 'right'
}}
className="DetailData"
>
{props.detail.model}
</td>
<td
style={{
textAlign: 'center'
}}
className="DetailData"
>
{props.detail.itemQuantityUnitOfMeasure}
</td>
<td
style={{
textAlign: 'center'
}}
className="DetailData"
>
{props.detail.quantity}
</td>
<td
style={{
textAlign: 'center'
}}
className="DetailData"
>
{props.detail.weightValue}
</td>
<td
style={{
textAlign: 'center'
}}
className="DetailData"
>
{props.detail.netWeightUnitOfMeasure}
</td>
<td
style={{
textAlign: 'center'
}}
className="DetailData"
>
{props.detail.actualUnitCostMonetaryAmount}
</td>
<td
style={{
textAlign: 'center'
}}
className="DetailData"
>
{props.detail.totalUnitValueMonetaryAmount}
</td>
<td
style={{
textAlign: 'center',
paddingLeft: '30px'
}}
className="DetailData"
>
<FormCheck
className="form-check form-switch form-control-lg"
id="switchEnabled"
type="switch"
checked={EstatusSwith}
onChange={() => {
setEstatusSwitch(!EstatusSwith)
setUserChanged(true)
setShowModal(!EstatusSwith)
}}
label=""
/>
</td>
<td
style={{
visibility: props.detail.sightLine ? 'hidden' : 'visible'
}}
>
{' '}
<OverlayTrigger
placement="bottom"
overlay={<Tooltip id="button-tooltip-2">{Comentarios}</Tooltip>}
>
{({ ref, ...triggerHandler }) => (
<Button variant="light" {...triggerHandler}>
<IconContext.Provider
value={{
color: 'blue',
size: '25px'
}}
>
<BsFillChatRightTextFill />
</IconContext.Provider>
<span className="ms-1"></span>
</Button>
)}
</OverlayTrigger>
</td>
</tr>
<Modal
show={ShowModal}
onHide={() => {
setShowModal(false)
}}
size={'sm'}
dialogClassName={'modal-50w'}
backdrop="static"
disableEscapeKeyDown={true}
>
<Modal.Body>
<div style={{ height: '150px' }}>
<Row style={{ paddingTop: '15px' }}>
<Col xs={3}>Comentarios</Col>
<Col xs={8}>
{' '}
<Form.Control
as="textarea"
id="Comentarios"
size="sm"
value={Comentarios.length ? Comentarios : ''}
onChange={(e) => setComentarios(e.target.value)}
/>
</Col>
<Col>&nbsp;</Col>
</Row>
<Row style={{ paddingTop: '15px' }}>
<Col xs={6} style={{ textAlign: 'center' }}>
<Button
variant="secondary"
onClick={() => {
setEstatusSwitch(true)
setShowModal(false)
}}
>
&nbsp;&nbsp;No&nbsp;&nbsp;
</Button>
</Col>
<Col xs={6} style={{ textAlign: 'center' }}>
<Button
variant="danger"
onClick={() => {
ToggleSightLine(props.detail.id)
}}
>
&nbsp;&nbsp;Si&nbsp;&nbsp;
</Button>
</Col>
</Row>
</div>
</Modal.Body>
</Modal>
<MsgInformativo
show={show}
msg={msg}
header={header}
msgColor={msgColor}
closeToast={() => {
setShowMsg(false)
}}
/>
</>
)
}

@ -0,0 +1,533 @@
import { useEffect, useState } from 'react'
import {
Alert,
Button,
Card,
Col,
FormCheck,
Modal,
Row,
Table
} from 'react-bootstrap'
import { IconContext } from 'react-icons'
import { BsChevronDown, BsChevronRight } from 'react-icons/bs'
import I2096Headers from '../../Interfaces/I2096Header'
import DSAmazon from '../../Services/Amazon.Services'
import { MsgInformativo } from '../../../../Utils/Toast/msgInformativo'
import { RootState } from '../../../../../store/store'
import {
initializeInvoice,
populateInvoices,
updateInvoice
} from '../../../../../store/features/Clientes/2096/AmazonInvoices'
// Redux
import { useDispatch, useSelector } from 'react-redux'
import RtpAmazonPendingTraficInvoiceDetail from './RptAmazonPendingTraficInvoiceDetail'
import { FaAmazon } from 'react-icons/fa'
export interface IRptAmazonPendingTraficInvoiceProps {}
export function RptAmazonPendingTraficInvoice(
props: IRptAmazonPendingTraficInvoiceProps
) {
const dispatch = useDispatch()
const mInvoices = useSelector(
(state: RootState) => state.AmazonInvoices.Invoice
)
const [header, setHeader] = useState('')
const [IDFactura, setIDFactura] = useState(0)
const [show, setShowMsg] = useState(false)
const [ShowModal, setShowModal] = useState(false)
const [msg, setMsg] = useState('')
const msgColor = 'primary'
function currentDate(days: number): string {
var today = new Date()
today.setDate(today.getDate() + days)
var dd = String(today.getDate()).padStart(2, '0')
var mm = String(today.getMonth() + 1).padStart(2, '0')
var yyyy = today.getFullYear()
return yyyy + '-' + mm + '-' + dd
}
const loadReport = () => {
DSAmazon.AmazonPendingTraficInvoiceGET()
.then((response) => {
dispatch(initializeInvoice([]))
dispatch(populateInvoices(response.data))
})
.catch((e: Error) => {
alert('Ocurrio un error' + e.message.toString())
})
}
useEffect(() => {
loadReport()
}, [])
const InvoiceToggle = (row: I2096Headers) => {
let Invoice: I2096Headers[] = mInvoices.filter((item) => item.id === row.id)
const Obj = { ...Invoice[0] }
Obj.max = !Obj.max
dispatch(updateInvoice(Obj))
}
const openLink = (item: string) => {
window.open('https://www.amazon.com/dp/' + item)
}
const finishInvoice = (id: number) => {
DSAmazon.SePuedeTerminarXTraficoFactura(id)
.then((response) => {
if (response.data.respuesta.includes('lista')) {
DSAmazon.TerminaXTraficoFactura(id)
.then((response) => {
DSAmazon.PDFAmazonInvoiceGET(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', 'AmazonInvoice.pdf')
document.body.appendChild(link)
link.click()
}
})
.catch((e: Error) => {
setHeader('Error')
setMsg('Ocurrio un error')
setShowMsg(true)
return
})
})
.catch((e: Error) => {})
setShowModal(false)
} else {
setIDFactura(0)
setHeader('Informativo')
setMsg(response.data.respuesta)
setShowMsg(true)
return
}
})
.catch((e: Error) => {
setIDFactura(0)
setHeader('Error')
setMsg('Ocurrio un error')
setShowMsg(true)
return
})
}
return (
<div>
<Card>
<Card.Body>
<Row>
<Col xs={4}>
<Card.Title>
<IconContext.Provider value={{ color: '#F6C34F', size: '8%' }}>
<FaAmazon />
</IconContext.Provider>{' '}
TRAFICO : facturas pendientes
</Card.Title>
</Col>
<Col xs={4}></Col>
</Row>
</Card.Body>
</Card>
<Row>
<Col xs={2}></Col>
<Col xs={8}></Col>
<Col xs={2} className="totalLabel"></Col>
</Row>
<Card>
<Card.Body>
<div className="MDcontainer">
<Table className="MDTable" hover>
<thead style={{ position: 'sticky', top: '0' }}>
<tr>
<th></th>
<th style={{ width: '50px' }}>id</th>
<th style={{ width: '50px' }}></th>
<th style={{ width: '80px' }}>Commercial Invoice Date</th>
<th style={{ width: '150px' }}>Invoice Number</th>
<th style={{ width: '50px' }}>Name</th>
<th style={{ width: '100px' }}>Incoterms</th>
<th>Qty Unit of measure</th>
<th>Tot Qty</th>
<th>Weight unit of measure</th>
<th>Tot weight</th>
<th>Tot Charge or allowance</th>
<th>Tot currency ISO code</th>
<th>Tot Monetary amount</th>
<th style={{ width: '500px' }}>Total de partidas</th>
</tr>
</thead>
<tbody>
{mInvoices
? mInvoices.map((MasterData) => {
return (
<>
<tr
style={{ cursor: 'pointer' }}
className={
MasterData.max === true
? 'masterSelected'
: 'normalSelected'
}
>
<td
style={{ textAlign: 'left' }}
className={
MasterData.max === true
? 'masterSelected'
: 'normalSelected'
}
key={MasterData.id}
onClick={() => {
InvoiceToggle(MasterData)
}}
>
{MasterData.max === true ? (
<IconContext.Provider
value={{ color: 'blue', size: '15px' }}
>
<BsChevronDown />
</IconContext.Provider>
) : (
<IconContext.Provider
value={{ color: 'blue', size: '15px' }}
>
<BsChevronRight />
</IconContext.Provider>
)}
</td>
<td>{MasterData.id}</td>
<td>
<FormCheck
className="form-check form-switch form-control-sm"
id="switchEnabled"
type="switch"
checked={false}
onChange={() => {
/* facturaTerminada(MasterData) */
setIDFactura(MasterData.id)
setShowModal(true)
}}
label=""
/>
</td>
<td style={{ width: '80px', textAlign: 'center' }}>
{MasterData.commercialInvoiceDate}
</td>
<td style={{ width: '150px' }}>
{MasterData.invoiceNumber}
</td>
<td style={{ width: '50px', textAlign: 'center' }}>
{MasterData.name}
</td>
<td style={{ width: '100px', textAlign: 'center' }}>
{MasterData.incoterms}
</td>
<td style={{ textAlign: 'center' }}>
{MasterData.totalInvoiceQuantityUnitOfMeasure}
</td>
<td style={{ textAlign: 'center' }}>
{MasterData.totalInvoiceQuantity}
</td>
<td style={{ textAlign: 'center' }}>
{MasterData.totalInvoiceWeightUnitOfMeasure}
</td>
<td style={{ textAlign: 'center' }}>
{MasterData.totalInvoiceWeight}
</td>
<td style={{ textAlign: 'center' }}>
{MasterData.totalInvoiceValueChargeOrAllowance}
</td>
<td style={{ textAlign: 'center' }}>
{MasterData.totalInvoiceValueCurrencyISOCode}
</td>
<td style={{ textAlign: 'center' }}>
{MasterData.totalInvoiceValueMonetaryAmount}
</td>
<td
style={{
fontWeight: 'bold',
textAlign: 'center'
}}
>
{mInvoices
.filter((value) => value.id === MasterData.id)
.map((row) => {
return row.detail.length
})}
</td>
</tr>
{MasterData.max ? (
<tr
className={
MasterData.max === true
? 'masterSelected2'
: 'normalSelected2'
}
>
<th colSpan={10}>
<table
className="childTable"
style={{ width: '1450px' }}
>
<thead>
<tr>
<th
style={{
width: '50px',
backgroundColor: '#FFFFFF',
color: '#346288'
}}
></th>
<th
style={{
width: '100px',
backgroundColor: '#D3E0EA',
color: '#346288'
}}
>
Item Id
</th>
<th
style={{
width: '400px',
backgroundColor: '#D3E0EA',
color: '#346288'
}}
>
Item Description
</th>
<th
style={{
width: '120px',
backgroundColor: '#D3E0EA',
color: '#346288',
textAlign: 'center'
}}
>
Fraccion GEMCO
</th>
<th
style={{
width: '70px',
backgroundColor: '#D3E0EA',
color: '#346288',
textAlign: 'center'
}}
>
Descripcion GEMCO
</th>
<th
style={{
width: '70px',
backgroundColor: '#D3E0EA',
color: '#346288',
textAlign: 'center'
}}
>
Country of Origin
</th>
<th
style={{
width: '70px',
backgroundColor: '#D3E0EA',
color: '#346288'
}}
>
ProductGroup
</th>
<th
style={{
width: '70px',
backgroundColor: '#D3E0EA',
color: '#346288'
}}
>
Brand
</th>
<th
style={{
width: '70px',
backgroundColor: '#D3E0EA',
color: '#346288'
}}
>
Model
</th>
<th
style={{
width: '70px',
backgroundColor: '#D3E0EA',
color: '#346288'
}}
>
Unit Measure
</th>
<th
style={{
width: '70px',
backgroundColor: '#D3E0EA',
color: '#346288'
}}
>
Qty Shipped
</th>
<th
style={{
width: '70px',
backgroundColor: '#D3E0EA',
color: '#346288'
}}
>
Unit of measure
</th>
<th
style={{
width: '70px',
backgroundColor: '#D3E0EA',
color: '#346288'
}}
>
Unit Net Weight
</th>
<th
style={{
width: '70px',
backgroundColor: '#D3E0EA',
color: '#346288'
}}
>
Unit Cost
</th>
<th
style={{
width: '70px',
backgroundColor: '#D3E0EA',
color: '#346288'
}}
>
Total value
</th>
<th
style={{
width: '70px',
backgroundColor: '#D3E0EA',
color: '#346288'
}}
>
Sight line
</th>
<th
style={{
width: '70px',
backgroundColor: '#D3E0EA',
color: '#346288'
}}
>
Comentarios
</th>
</tr>
</thead>
<tbody>
{mInvoices.map((MD) => {
return (
<>
{MD.detail
.filter(
(detail) =>
MasterData.id ===
detail.idHeader
)
.map((detail) => {
return (
<RtpAmazonPendingTraficInvoiceDetail
IDMaster={MasterData.id}
detail={detail}
Habilitado={
MasterData.estatus <= 1
}
/>
)
})}
</>
)
})}
</tbody>
</table>
</th>
</tr>
) : null}
</>
)
})
: null}
</tbody>
</Table>
</div>
</Card.Body>
</Card>
<Modal
show={ShowModal}
onHide={() => {
setShowModal(false)
}}
size={'sm'}
dialogClassName={'modal-50w'}
>
<Modal.Body>
<div style={{ height: '180px' }}>
<Row style={{ paddingTop: '15px' }}>
<Col xs={1}></Col>
<Col xs={10}>
<Alert key={'danger'} variant={'danger'}>
La factura esta lista para terminarse, desea terminarla?
</Alert>
</Col>
<Col xs={1}></Col>
</Row>
<Row style={{ paddingTop: '15px' }}>
<Col xs={6} style={{ textAlign: 'center' }}>
<Button
variant="secondary"
onClick={() => {
setShowModal(false)
}}
>
&nbsp;&nbsp;No&nbsp;&nbsp;
</Button>
</Col>
<Col xs={6} style={{ textAlign: 'center' }}>
<Button
variant="danger"
onClick={() => {
finishInvoice(IDFactura)
}}
>
&nbsp;&nbsp;Si&nbsp;&nbsp;
</Button>
</Col>
</Row>
</div>
</Modal.Body>
</Modal>
<MsgInformativo
show={show}
msg={msg}
header={header}
msgColor={msgColor}
closeToast={() => {
setShowMsg(false)
}}
/>
</div>
)
}

@ -11,40 +11,58 @@ import DTORespuesta from '../../ZincInternacional/DTO/DTORespuesta'
import DTO2096SightLine from '../DTO/DTO2096SightLine' import DTO2096SightLine from '../DTO/DTO2096SightLine'
class AmazonDataService { class AmazonDataService {
AmazonPendingClasificationInvoice$GET() { AmazonPendingClasificationInvoiceGET() {
return http.get<I2096Headers[]>(`/AmazonInvoice/AmazonPendingClasificationInvoiceGet`) return http.get<I2096Headers[]>(`/AmazonInvoice/AmazonPendingClasificationInvoiceGet`)
} }
AmazonFinishedClasificationInvoice$GET() { AmazonFinishedClasificationInvoiceGET() {
return http.get<I2096Headers[]>(`/AmazonInvoice/AmazonFinishedClasificationInvoiceGet`) return http.get<I2096Headers[]>(`/AmazonInvoice/AmazonFinishedClasificationInvoiceGet`)
} }
AmazonPendingTraficInvoice$GET() { SePuedeTerminardeClasificarFactura(id: number) {
return http.get<DTORespuesta>(`/AmazonInvoice/SePuedeTerminardeClasificarFactura?id=${id}`)
}
TerminaClasificarFactura(id: number) {
return http.get<boolean>(`/AmazonInvoice/TerminaClasificarFactura?id=${id}`)
}
AmazonPendingTraficInvoiceGET() {
return http.get<I2096Headers[]>(`/AmazonInvoice/AmazonPendingTraficInvoiceGet`) return http.get<I2096Headers[]>(`/AmazonInvoice/AmazonPendingTraficInvoiceGet`)
} }
AmazonFinishedTraficInvoice$GET() { /* AmazonFinishedTraficInvoiceGET() {
return http.get<I2096Headers[]>(`/AmazonInvoice/AmazonFinishedTraficInvoiceGet`) return http.get<I2096Headers[]>(`/AmazonInvoice/AmazonFinishedTraficInvoiceGet`)
} */
AmazonLinkInvoice2TrafficGet() {
return http.get<I2096Headers[]>(`/AmazonInvoice/AmazonLinkInvoice2TrafficGet`)
} }
GetValidaFraccion(Fraccion: string) { SePuedeTerminarXTraficoFactura(id: number) {
return http.get<DTORespuesta>(`/AmazonInvoice/SePuedeTerminarXTraficoFactura?id=${id}`)
}
TerminaXTraficoFactura(id: number) {
return http.get<boolean>(`/AmazonInvoice/TerminaXTraficoFactura?id=${id}`)
}
/* SePuedeTerminarFactura(id: number) {
return http.get<DTORespuesta>(`/AmazonInvoice/SePuedeTerminarFactura?id=${id}`)
} */
ValidaFraccionGET(Fraccion: string) {
return http.get<IRespuesta>(`/AmazonInvoice/C2096ValidaFraccion?Fraccion=${Fraccion}`) return http.get<IRespuesta>(`/AmazonInvoice/C2096ValidaFraccion?Fraccion=${Fraccion}`)
} }
SetFraccion(data: DTO2096Fraccion) { FraccionSET(data: DTO2096Fraccion) {
return http.post<I2096Detail>(`/AmazonInvoice/C2096FraccionSet`, data) return http.post<I2096Detail>(`/AmazonInvoice/C2096FraccionSet`, data)
} }
SetDescripcion(data: DTO2096Descripcion) { DescripcionSET(data: DTO2096Descripcion) {
return http.post<I2096Detail>(`/AmazonInvoice/C2096DescripcionSet`, data) return http.post<I2096Detail>(`/AmazonInvoice/C2096DescripcionSet`, data)
} }
Set$Autorizado(data: DTO2096ItemAutoriza) { AutorizadoSET(data: DTO2096ItemAutoriza) {
return http.post<DTO2096ItemAutoriza>(`/AmazonInvoice/C2096ItemAutorizado`, data) return http.post<DTO2096ItemAutoriza>(`/AmazonInvoice/C2096ItemAutorizado`, data)
} }
SightLineSET(data: DTO2096SightLine) { SightLineSET(data: DTO2096SightLine) {
return http.put<DTO2096SightLine>(`/AmazonInvoice/AmazonSightLineSET`, data) return http.put<DTO2096SightLine>(`/AmazonInvoice/AmazonSightLineSET`, data)
} }
TerminaFactura(id: number) {
return http.get<Boolean>(`/AmazonInvoice/TerminaFactura?id=${id}`) PaisClavesGET() {
}
Get$Pais$Claves() {
return http.get<I2096PaisClave[]>(`/AmazonInvoice/PaisClavesGet`) return http.get<I2096PaisClave[]>(`/AmazonInvoice/PaisClavesGet`)
} }
GetNoPartesAmazon2SIR(id: number) { NoPartesAmazon2SIRGET(id: number) {
return http.get<ArrayBuffer>(`/AmazonInvoice/GetNoPartesAmazon2SIR?id=${id}`, {responseType: 'arraybuffer'}) return http.get<ArrayBuffer>(`/AmazonInvoice/GetNoPartesAmazon2SIR?id=${id}`, {responseType: 'arraybuffer'})
.then(function (response) { .then(function (response) {
return response return response
@ -53,7 +71,7 @@ class AmazonDataService {
console.log(error) console.log(error)
}) })
} }
Get$ExceptionsFile$Amazon(id: number) { ExceptionsFileAmazonGET(id: number) {
return http.get<ArrayBuffer>(`/AmazonInvoice/GetArchivoExcepcionesAmazon?id=${id}`, {responseType: 'arraybuffer'}) return http.get<ArrayBuffer>(`/AmazonInvoice/GetArchivoExcepcionesAmazon?id=${id}`, {responseType: 'arraybuffer'})
.then(function (response) { .then(function (response) {
return response return response
@ -62,11 +80,21 @@ class AmazonDataService {
console.log(error) console.log(error)
}) })
} }
PDFAmazonInvoiceGET(id: number) {
return http.get<ArrayBuffer>(`/AmazonInvoice/PDFAmazonInvoiceGET?id=${id}`, {responseType: 'arraybuffer'})
.then(function (response) {
return response
})
.catch(function (error) {
console.log(error)
})
}
NoPartesGet(Search: string) { NoPartesGet(Search: string) {
return http.get<I2096NoParte[]>(`/AmazonInvoice/NoPartesGet?Search=${Search}`) return http.get<I2096NoParte[]>(`/AmazonInvoice/NoPartesGet?Search=${Search}`)
} }
Se$Puede$Terminar$Factura(id: number) {
return http.get<DTORespuesta>(`/AmazonInvoice/SePuedeTerminarFactura?id=${id}`)
}
} }
export default new AmazonDataService() export default new AmazonDataService()

@ -51,7 +51,7 @@ export default function DashboardTrafico (props: IDashboardTraficoProps) {
<Row > <Row >
<Col xs={6} style={{}}> <Col xs={6} style={{}}>
<Link <Link
to="#" to="RptAmazonLinkInvoice2Traffic"
style={{ style={{
textDecoration: 'none', textDecoration: 'none',
float: 'left', float: 'left',

@ -40,14 +40,15 @@ import RptConsolidadosSinCerrar from './Components/GEMCO/Facturacion/Anexo/RptCo
import RptRelacionAlen from './Components/GEMCO/Facturacion/Anexo/RptRelacionAlen' import RptRelacionAlen from './Components/GEMCO/Facturacion/Anexo/RptRelacionAlen'
import { RptFacturasTxtHeineken } from './Components/Reportes/RptFacturasTxtHeineken' import { RptFacturasTxtHeineken } from './Components/Reportes/RptFacturasTxtHeineken'
import { Notificaciones } from './Components/Utils/Notificaciones/Notificaciones' import { Notificaciones } from './Components/Utils/Notificaciones/Notificaciones'
import RtpAmazonPendingInvoices from './Components/Clientes/Amazon/Reportes/RptAmazonPendingClasificationInvoices' import RtpAmazonPendingInvoices from './Components/Clientes/Amazon/Reportes/Clasification/RptAmazonPendingClasificationInvoices'
import RtpAmazonFinishedInvoices from './Components/Clientes/Amazon/Reportes/RptAmazonFinishedClasificationInvoices' import RtpAmazonFinishedInvoices from './Components/Clientes/Amazon/Reportes/Clasification/RptAmazonFinishedClasificationInvoices'
import { AmazonNoPartes } from './Components/Clientes/Amazon/Reportes/AmazonNoPartes' import { AmazonNoPartes } from './Components/Clientes/Amazon/Reportes/AmazonNoPartes'
import { RptAmazonPendingTraficInvoice } from './Components/Clientes/Amazon/Reportes/RtpAmazonPendingTraficInvoice' import { RptAmazonPendingTraficInvoice } from './Components/Clientes/Amazon/Reportes/Traffic/RtpAmazonPendingTraficInvoice'
import { RptAmazonLinkInvoice2Traffic } from './Components/Clientes/Amazon/Reportes/Traffic/RptAmazonLinkInvoice2Traffic'
function PageNotFound() { function PageNotFound() {
return ( return (
<div style={{textAlign:'center', paddingTop: '300px'}}> <div style={{ textAlign: 'center', paddingTop: '300px' }}>
<h2>Sorry, no matching page</h2> <h2>Sorry, no matching page</h2>
</div> </div>
) )
@ -58,42 +59,42 @@ ReactDOM.render(
<React.StrictMode> <React.StrictMode>
<HashRouter> <HashRouter>
<Routes> <Routes>
<Route path='/' element={<App />}> <Route path="/" element={<App />}>
<Route path='/' element={<Dashboard />}></Route> <Route path="/" element={<Dashboard />}></Route>
<Route path='/login' element={<Login />} /> <Route path="/login" element={<Login />} />
<Route path='/logout' element={<Logout />} /> <Route path="/logout" element={<Logout />} />
<Route path='/reset' element={<ResetCredentials />} /> <Route path="/reset" element={<ResetCredentials />} />
<Route path='/register' element={<Register />} /> <Route path="/register" element={<Register />} />
<Route path='/permisos' element={<RegisterPermisoClientes />} /> <Route path="/permisos" element={<RegisterPermisoClientes />} />
<Route <Route
path='/rptPedimentosPagados' path="/rptPedimentosPagados"
element={<RptPedimentosPagados />} element={<RptPedimentosPagados />}
/> />
<Route <Route
path='/rptPedimentosPagadosImpuestos' path="/rptPedimentosPagadosImpuestos"
element={<RptPedimentosPagadosImpuestos />} element={<RptPedimentosPagadosImpuestos />}
/> />
<Route path='/rptDetalleAnexo24' element={<RptDetalleAnexo24 />} /> <Route path="/rptDetalleAnexo24" element={<RptDetalleAnexo24 />} />
<Route <Route
path='/rptOperacionesRemesa' path="/rptOperacionesRemesa"
element={<RptOperacionesRemesa />} element={<RptOperacionesRemesa />}
/> />
<Route path='/FotosBodega' element={<FotosBodega />} /> <Route path="/FotosBodega" element={<FotosBodega />} />
<Route path='/rptBattery' element={<RptBattery />} /> <Route path="/rptBattery" element={<RptBattery />} />
<Route <Route
path='/RptArchivoElectronicoOficial' path="/RptArchivoElectronicoOficial"
element={<RptArchivoElectronicoOficial />} element={<RptArchivoElectronicoOficial />}
/> />
<Route <Route
path='/RptPedimentosConsolidados' path="/RptPedimentosConsolidados"
element={<RptPedimentosConsolidados />} element={<RptPedimentosConsolidados />}
/> />
<Route <Route
path='/RptOperacionesConsolidadas' path="/RptOperacionesConsolidadas"
element={<RptOperacionesConsolidadas />} element={<RptOperacionesConsolidadas />}
/> />
<Route <Route
path='/TraficoCorresponsales' path="/TraficoCorresponsales"
element={ element={
<TraficoCorresponsales <TraficoCorresponsales
IDTrafico={0} IDTrafico={0}
@ -104,62 +105,72 @@ ReactDOM.render(
} }
/> />
<Route <Route
path='/DashboardCorresponsales' path="/DashboardCorresponsales"
element={<DashboardCorresponsales />} element={<DashboardCorresponsales />}
/> />
<Route path='/Dashboard' element={<Dashboard />} /> <Route path="/Dashboard" element={<Dashboard />} />
<Route <Route
path='/RptCorresponsalesTraficos/:proc/:modo' path="/RptCorresponsalesTraficos/:proc/:modo"
element={<RptCorresponsalesTraficos />} element={<RptCorresponsalesTraficos />}
/> />
<Route <Route
path='/RptCorresponsalesTraficosHst' path="/RptCorresponsalesTraficosHst"
element={<RptCorresponsalesTraficosHst />} element={<RptCorresponsalesTraficosHst />}
/> />
<Route path='/RptOperaciones' element={<RptOperaciones />} /> <Route path="/RptOperaciones" element={<RptOperaciones />} />
<Route <Route
path='/RptControlDocumentosClientes' path="/RptControlDocumentosClientes"
element={<RptControlDocumentosClientes />} element={<RptControlDocumentosClientes />}
/> />
<Route <Route
path='/RptRelacionMission' path="/RptRelacionMission"
element={<RptRelacionMission />} element={<RptRelacionMission />}
/> />
<Route path="/RptRelacionAlen" element={<RptRelacionAlen />} />
<Route <Route
path='/RptRelacionAlen' path="/RptConsolidadosSinCerrar"
element={<RptRelacionAlen />}
/>
<Route
path='/RptConsolidadosSinCerrar'
element={<RptConsolidadosSinCerrar />} element={<RptConsolidadosSinCerrar />}
/> />
<Route <Route
path='/RptOperacionesDiarias' path="/RptOperacionesDiarias"
element={<RptOperacionesDiarias />} element={<RptOperacionesDiarias />}
/> />
<Route <Route
path='/RptFacturasTxtHeineken' path="/RptFacturasTxtHeineken"
element={<RptFacturasTxtHeineken />} element={<RptFacturasTxtHeineken />}
/> />
<Route path='/CatTabuladores' element={<CatTabuladores />} /> <Route path="/CatTabuladores" element={<CatTabuladores />} />
<Route path='/RptPedidos' element={<RptPedidos />} /> <Route path="/RptPedidos" element={<RptPedidos />} />
<Route path='/Rpt1868Facturas' element={<Rpt1868Facturas />} /> <Route path="/Rpt1868Facturas" element={<Rpt1868Facturas />} />
<Route <Route
path='/Rpt1868Transportista' path="/Rpt1868Transportista"
element={<Rpt1868Transportista />} element={<Rpt1868Transportista />}
/> />
<Route path='/AvisoCruce' element={<AvisoCruce />} /> <Route path="/AvisoCruce" element={<AvisoCruce />} />
<Route path='/Notificaciones' element={<Notificaciones />} /> <Route path="/Notificaciones" element={<Notificaciones />} />
<Route <Route
path='/FormatoRevision/:id' path="/FormatoRevision/:id"
element={<FormatoRevision />} element={<FormatoRevision />}
></Route> ></Route>
<Route path='/RptAmazonPendingInvoices' element={<RtpAmazonPendingInvoices />} /> <Route
<Route path='/RptAmazonFinishedInvoices' element={<RtpAmazonFinishedInvoices />} /> path="/RptAmazonPendingInvoices"
<Route path='/AmazonNoPartes' element={<AmazonNoPartes />} /> element={<RtpAmazonPendingInvoices />}
<Route path='/RptAmazonPendingTraficInvoice' element={<RptAmazonPendingTraficInvoice/>} /> />
<Route
path="/RptAmazonFinishedInvoices"
element={<RtpAmazonFinishedInvoices />}
/>
<Route path="/AmazonNoPartes" element={<AmazonNoPartes />} />
<Route
path="/RptAmazonPendingTraficInvoice"
element={<RptAmazonPendingTraficInvoice />}
/>
<Route
path="/RptAmazonLinkInvoice2Traffic"
element={<RptAmazonLinkInvoice2Traffic />}
/>
</Route> </Route>
<Route path='*' element={<PageNotFound />} /> <Route path="*" element={<PageNotFound />} />
</Routes> </Routes>
</HashRouter> </HashRouter>
</React.StrictMode> </React.StrictMode>

Loading…
Cancel
Save