Se realizan ultimos cambios previos a Go Live

AmazonRelease1.1
unknown 2 years ago
parent 82b77d1e6e
commit c8e6e52977
  1. 36
      src/Components/Clientes/Amazon/Interfaces/I2096NoParte.ts
  2. 14
      src/Components/Clientes/Amazon/Interfaces/I2096NoParteLog.ts
  3. 130
      src/Components/Clientes/Amazon/Reportes/AmazonNoPartes.tsx
  4. 13
      src/Components/Clientes/Amazon/Reportes/Clasification/Finished/RptAmazonFinishedClasificationInvoicesDetail.tsx
  5. 128
      src/Components/Clientes/Amazon/Reportes/Clasification/WaitingAnswer/RptPendingAnswerFromAmazon.tsx
  6. 65
      src/Components/Clientes/Amazon/Reportes/Clasification/WaitingAnswer/RptPendingAnswerFromAmazonDetail.tsx
  7. 154
      src/Components/Clientes/Amazon/Reportes/Traffic/Linking/RptAmazonLinkInvoice2Traffic.tsx
  8. 233
      src/Components/Clientes/Amazon/Reportes/Traffic/Linking/RptAmazonLinkInvoice2TrafficDetail.tsx
  9. 27
      src/Components/Clientes/Amazon/Reportes/Traffic/Pending/RptAmazonPendingTraficInvoiceDetail.tsx
  10. 35
      src/Components/Clientes/Amazon/Reportes/Traffic/Pending/RtpAmazonPendingTraficInvoice.tsx
  11. 7
      src/Components/Clientes/Amazon/Services/Amazon.Services.ts

@ -1,20 +1,18 @@
import { string } from "yup"
export default interface I2096NoParte { export default interface I2096NoParte {
id: number, id: number
claveCliente: number, claveCliente: number
parte: string, parte: string
claveProveedor: number, claveProveedor: number
tipoOperacion: number, tipoOperacion: number
fraccion: string, fraccion: string
subdivision: string, subdivision: string
descripcionFactura: string, descripcionFactura: string
descripcionAgenteAduanal: string, descripcionAgenteAduanal: string
fechaConfirmacion: string, fechaConfirmacion: string
paisOrigen: string, paisOrigen: string
unidadMedidaFactura: string, unidadMedidaFactura: string
unidadMedidaCOVE: string, unidadMedidaCOVE: string
FHActualizacion: string, FHActualizacion: string
usuarioActualizacion: number, usuarioActualizacion: number
activo: number activo: number
} }

@ -0,0 +1,14 @@
export default interface I2096NoParteLog {
id: number
idCatNoParte: number
noParte: number
fraccionGEMCO: string
subdivisionGEMCO: string
descripcionAgenteAduanal: string
fraccionOriginal: string
subdivisionOriginal: string
descripcionOriginal: string
usuario: number
fhCreacion: string
sUsuario: string
}

@ -17,6 +17,7 @@ import I2096PaisClave from '../Interfaces/I2096PaisClave'
import DTO2096PerfilesParecidos from '../DTO/DTO2096PerfilesParecidos' import DTO2096PerfilesParecidos from '../DTO/DTO2096PerfilesParecidos'
import DSAmazon from '../Services/Amazon.Services' import DSAmazon from '../Services/Amazon.Services'
import DTO2096NoParte from '../DTO/DTO2096NoParte' import DTO2096NoParte from '../DTO/DTO2096NoParte'
import I2096NoParteLog from '../Interfaces/I2096NoParteLog'
export interface IAmazonNoPartesProps {} export interface IAmazonNoPartesProps {}
export function AmazonNoPartes(props: IAmazonNoPartesProps) { export function AmazonNoPartes(props: IAmazonNoPartesProps) {
@ -28,9 +29,11 @@ export function AmazonNoPartes(props: IAmazonNoPartesProps) {
const stickyValue = window.localStorage.getItem('UserId') const stickyValue = window.localStorage.getItem('UserId')
return stickyValue !== null ? JSON.parse(stickyValue) : 0 return stickyValue !== null ? JSON.parse(stickyValue) : 0
}) })
const [NoParteLOG, setNoParteLOG] = useState<I2096NoParteLog[]>([])
const [PaisClaves, setPaisClaves] = useState<I2096PaisClave[]>([]) const [PaisClaves, setPaisClaves] = useState<I2096PaisClave[]>([])
const [Data, setData] = useState<DTO2096PerfilesParecidos[]>([]) const [Data, setData] = useState<DTO2096PerfilesParecidos[]>([])
const [ShowModal, setShowModal] = useState(false) const [ShowModal, setShowModal] = useState(false)
const [ShowModalLog, setShowModalLog] = useState(false)
const [header, setHeader] = useState('') const [header, setHeader] = useState('')
const [msgColor, setMsgColor] = useState('primary') const [msgColor, setMsgColor] = useState('primary')
const [show, setShowMsg] = useState(false) const [show, setShowMsg] = useState(false)
@ -49,15 +52,20 @@ export function AmazonNoPartes(props: IAmazonNoPartesProps) {
const [FechaInsercion, setFechaInsercion] = useState('') const [FechaInsercion, setFechaInsercion] = useState('')
const [Clasificador, setClasificador] = useState('') const [Clasificador, setClasificador] = useState('')
const openLink = (item: string) => {
window.open('https://www.amazon.com/dp/' + item)
}
const colsNoPartes = [ const colsNoPartes = [
{ {
name: 'id', name: 'id',
width: '60px', width: '80px',
selector: (row: I2096NoParte) => row.id, cell: (row: I2096NoParte) => (
<div
style={{ cursor: 'pointer' }}
onClick={() => {
loadNoPartesLOG(row)
}}
>
{row.id}
</div>
),
sortable: true sortable: true
}, },
{ {
@ -73,6 +81,7 @@ export function AmazonNoPartes(props: IAmazonNoPartesProps) {
}} }}
onClick={() => { onClick={() => {
loadData(row) loadData(row)
setShowModal(true)
}} }}
> >
<IconContext.Provider value={{ color: 'blue', size: '20px' }}> <IconContext.Provider value={{ color: 'blue', size: '20px' }}>
@ -166,6 +175,67 @@ export function AmazonNoPartes(props: IAmazonNoPartesProps) {
} }
] ]
const colsNoPartesLOG = [
{
name: 'Fracc GEMCO',
width: '120px',
cell: (row: I2096NoParteLog) => row.fraccionGEMCO,
sortable: true
},
{
name: 'Fracc Original',
width: '130px',
cell: (row: I2096NoParteLog) => row.fraccionOriginal ? row.fraccionOriginal : '',
sortable: true
},
{
name: 'NICO GEMCO',
width: '130px',
cell: (row: I2096NoParteLog) => row.subdivisionGEMCO,
sortable: true,
center: true
},
{
name: 'NICO Original',
width: '130px',
cell: (row: I2096NoParteLog) => row.subdivisionOriginal ? row.subdivisionOriginal : '',
sortable: true,
center: true
},
{
name: 'Desc A. A.',
width: '250px',
cell: (row: I2096NoParteLog) => row.descripcionAgenteAduanal,
wrap: true,
sortable: true,
},
{
name: 'Desc Original',
width: '250px',
cell: (row: I2096NoParteLog) => row.descripcionOriginal,
wrap: true,
sorteable: true
},
{
name: 'Fecha / Hora',
width: '200px',
cell: (row: I2096NoParteLog) => row.fhCreacion,
sortable: true
},
{
name: 'Usuario',
width: '300px',
cell: (row: I2096NoParteLog) => row.sUsuario ? row.sUsuario : '',
wrap: true,
sortable: true
}
]
const openLink = (item: string) => {
window.open('https://www.amazon.com/dp/' + item)
}
const getUser = (Id: number) => { const getUser = (Id: number) => {
const NoAsignado = 'NO ASIGNADO' const NoAsignado = 'NO ASIGNADO'
if (Id === 0) return NoAsignado if (Id === 0) return NoAsignado
@ -186,6 +256,18 @@ export function AmazonNoPartes(props: IAmazonNoPartesProps) {
}) })
} }
const loadNoPartesLOG = (row: I2096NoParte) => {
loadData(row)
setShowModalLog(true)
DSAmazon.NoPartesLogGET(row.id)
.then((response) => {
setNoParteLOG(response.data)
})
.catch((e: Error) => {
alert('Ocurrio un error' + e.message.toString())
})
}
const loadData = (row: I2096NoParte) => { const loadData = (row: I2096NoParte) => {
setIDParte(row.id) setIDParte(row.id)
setParte(row.parte) setParte(row.parte)
@ -198,7 +280,6 @@ export function AmazonNoPartes(props: IAmazonNoPartesProps) {
setUMF(row.unidadMedidaFactura) setUMF(row.unidadMedidaFactura)
setFechaInsercion(row.FHActualizacion) setFechaInsercion(row.FHActualizacion)
setClasificador(getUser(row.usuarioActualizacion)) setClasificador(getUser(row.usuarioActualizacion))
setShowModal(true)
} }
const loadPaisesClaves = () => { const loadPaisesClaves = () => {
@ -436,6 +517,41 @@ export function AmazonNoPartes(props: IAmazonNoPartesProps) {
</div> </div>
</Modal.Body> </Modal.Body>
</Modal> </Modal>
<Modal
show={ShowModalLog}
onHide={() => {
setShowModalLog(false)
}}
size={'sm'}
dialogClassName={'modal-90w'}
>
<Modal.Header closeButton>
<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> */}
</Modal.Body>
</Modal>
<MsgInformativo <MsgInformativo
show={show} show={show}
msg={msg} msg={msg}

@ -7,7 +7,6 @@ import {
Form, Form,
Modal, Modal,
OverlayTrigger, OverlayTrigger,
Popover,
Row, Row,
Tooltip Tooltip
} from 'react-bootstrap' } from 'react-bootstrap'
@ -17,10 +16,8 @@ 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 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'
// Redux // Redux
import { RootState } from '../../../../../../store/store' import { RootState } from '../../../../../../store/store'
import { useDispatch, useSelector } from 'react-redux' import { useDispatch, useSelector } from 'react-redux'
@ -145,16 +142,6 @@ export default function RptAmazonFinishedClasificationInvoicesDetail(
autoriceItem(props.detail.id) autoriceItem(props.detail.id)
}, [EstatusSwith, UserChanged]) }, [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 ( return (
<> <>
<tr> <tr>

@ -22,12 +22,13 @@ import {
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 RtpPendingAnswerFromAmazonDetail from './RptPendingAnswerFromAmazonDetail' import RtpPendingAnswerFromAmazonDetail from './RptPendingAnswerFromAmazonDetail'
import { AiTwotoneFileExcel } from 'react-icons/ai' import { AiFillFileUnknown, AiTwotoneFileExcel } from 'react-icons/ai'
import { FiAlertCircle } from 'react-icons/fi'
import DTO2096PerfilesParecidos from '../../../DTO/DTO2096PerfilesParecidos' import DTO2096PerfilesParecidos from '../../../DTO/DTO2096PerfilesParecidos'
import FileManager from '../../../../../Utils/FileManager/FileManager'
export interface IRptPendingAnswerFromAmazonProps {} export interface IRptPendingAnswerFromAmazonProps {}
export default function RptPendingAnswerFromAmazon( export default function RptPendingAnswerFromAmazon(
@ -37,23 +38,20 @@ export default function RptPendingAnswerFromAmazon(
const mInvoices = useSelector( const mInvoices = useSelector(
(state: RootState) => state.AmazonInvoices.Invoice (state: RootState) => state.AmazonInvoices.Invoice
) )
const [UserId, setUserId] = useState(() => {
const stickyValue = window.localStorage.getItem('UserId')
return stickyValue !== null ? JSON.parse(stickyValue) : 0
})
const [Data, setData] = useState<DTO2096PerfilesParecidos[]>([]) const [Data, setData] = useState<DTO2096PerfilesParecidos[]>([])
const [header, setHeader] = useState('') const [header, setHeader] = useState('')
const [IDFactura, setIDFactura] = useState(0) const [IDFactura, setIDFactura] = useState(0)
const [IDProcess, setIDProcess] = useState(25)
const [show, setShowMsg] = useState(false) const [show, setShowMsg] = useState(false)
const [ShowModal, setShowModal] = useState(false) const [ShowModal, setShowModal] = useState(false)
const [ShowModalAnswerFile, setShowModalAnswerFile] = useState(false)
const [msg, setMsg] = useState('') const [msg, setMsg] = useState('')
const msgColor = 'primary' 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 = () => { const loadReport = () => {
DSAmazon.InvoicePendingFromAmazonGET() DSAmazon.InvoicePendingFromAmazonGET()
.then((response) => { .then((response) => {
@ -153,7 +151,6 @@ export default function RptPendingAnswerFromAmazon(
(child) => child.idHeader === IDMaster && !child.autorizado (child) => child.idHeader === IDMaster && !child.autorizado
) )
}) })
console.log(JSON.stringify(Exceptions[0]))
return Exceptions[0].length ? Exceptions[0].length : 0 return Exceptions[0].length ? Exceptions[0].length : 0
} }
@ -171,27 +168,40 @@ export default function RptPendingAnswerFromAmazon(
return return
}) })
} }
const sePuedeTerminarFactura = (id: number) =>{ const sePuedeTerminarFactura = (id: number) => {
setIDFactura(id) setIDFactura(id)
DSAmazon.SeRecibioRespuestaDeAmazon(id) DSAmazon.SeRecibioRespuestaDeAmazon(id)
.then((response) => { .then((response) => {
//alert(response.data.estatus) //alert(response.data.estatus)
if (response.data.estatus === 0) { if (response.data.estatus === 0) {
setHeader('Error') setHeader('Error')
setMsg('Verifique que todas las partidas esten verificadas por usted') setMsg('Verifique que todas las partidas esten verificadas por usted')
setShowMsg(true) setShowMsg(true)
return return
} else if (response.data.estatus === 1) { } else if (response.data.estatus === 1) {
//TerminadeClasificar() //TerminadeClasificar()
setShowModal(true) setShowModal(true)
} else { } else {
setIDFactura(0)
setHeader('Informativo')
setMsg(response.data.respuesta)
setShowMsg(true)
return
}
})
.catch((e: Error) => {
setIDFactura(0) setIDFactura(0)
setHeader('Informativo') setHeader('Error')
setMsg(response.data.respuesta) setMsg('Ocurrio un error')
setShowMsg(true) setShowMsg(true)
return return
} })
}
const relacionaIDArchivoRespuestaConFactura = (idFile : number) => {
DSAmazon.ArchivoRespuestaAmazon(IDFactura, idFile)
.then((response) => {
}) })
.catch((e: Error) => { .catch((e: Error) => {
setIDFactura(0) setIDFactura(0)
@ -244,6 +254,7 @@ export default function RptPendingAnswerFromAmazon(
<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: '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 style={{ width: '50px' }}>Name</th> <th style={{ width: '50px' }}>Name</th>
@ -322,11 +333,23 @@ export default function RptPendingAnswerFromAmazon(
type="switch" type="switch"
checked={false} checked={false}
onChange={() => { onChange={() => {
sePuedeTerminarFactura(MasterData.id) sePuedeTerminarFactura(MasterData.id)
}} }}
label="" label=""
/> />
</td> </td>
<td>
<div
onClick={() => { setShowModalAnswerFile(!ShowModalAnswerFile) }}
title="Archivo de respuesta"
>
<IconContext.Provider
value={{ color: 'red', size: '23px' }}
>
<AiFillFileUnknown />
</IconContext.Provider>
</div>
</td>
<td style={{ width: '80px', textAlign: 'center' }}> <td style={{ width: '80px', textAlign: 'center' }}>
{MasterData.commercialInvoiceDate} {MasterData.commercialInvoiceDate}
</td> </td>
@ -567,15 +590,6 @@ export default function RptPendingAnswerFromAmazon(
> >
Unit Cost Unit Cost
</th> </th>
<th
style={{
width: '70px',
backgroundColor: '#D3E0EA',
color: '#346288'
}}
>
Total value
</th>
<th <th
style={{ style={{
width: '70px', width: '70px',
@ -688,6 +702,44 @@ export default function RptPendingAnswerFromAmazon(
</div> </div>
</Modal.Body> </Modal.Body>
</Modal> </Modal>
<Modal
show={ShowModalAnswerFile}
onHide={() => {
setShowModalAnswerFile(false)
}}
size={'sm'}
dialogClassName={'modal-50w'}
>
<Modal.Body>
<div style={{ height: '180px' }}>
<Row style={{ paddingTop: '15px' }}>
<Col xs={12}>
<Alert key={'danger'} variant={'danger'} style={{textAlign:'center'}}>
Proporcione el archivo de respuesta de Amazon
</Alert>
</Col>
</Row>
<Row style={{ paddingTop: '15px' }}>
<Col xs={12} style={{ textAlign: 'center' }}>
<FileManager
IDUser={UserId}
width={730}
height={100}
IDProcess={IDProcess}
IdFile={IDFactura}
FileName={'Answer'}
canDelete={true}
FileType={['xlsx']}
Leyenda={`Seleccione el archivo de respuesta de Amazon, arrastrelo hasta aqui y sueltelo para subirlo al servidor...`}
onAppendFM={function (idFile: number): void { relacionaIDArchivoRespuestaConFactura(idFile)}}
/>
</Col>
</Row>
</div>
</Modal.Body>
</Modal>
<MsgInformativo <MsgInformativo
show={show} show={show}
msg={msg} msg={msg}

@ -67,7 +67,6 @@ export default function RptPendingAnswerFromAmazonDetail(
const openLink = (item: string) => { const openLink = (item: string) => {
window.open('https://www.amazon.com/dp/' + item) window.open('https://www.amazon.com/dp/' + item)
} }
const target = React.useRef(null)
const UpdateInfo = (Invoice: I2096Headers, Detail: I2096Detail[]) => { const UpdateInfo = (Invoice: I2096Headers, Detail: I2096Detail[]) => {
const updatedInvoice: I2096Headers = { const updatedInvoice: I2096Headers = {
@ -156,7 +155,6 @@ export default function RptPendingAnswerFromAmazonDetail(
comentarios: Comentarios, comentarios: Comentarios,
descripcionGEMCO: DescripcionGEMCO descripcionGEMCO: DescripcionGEMCO
} }
console.log(data)
DSAmazon.AutorizaItemFacturaAmazon(data) DSAmazon.AutorizaItemFacturaAmazon(data)
.then((response) => { .then((response) => {
editArray(id, !props.detail.autorizado) editArray(id, !props.detail.autorizado)
@ -170,42 +168,33 @@ export default function RptPendingAnswerFromAmazonDetail(
autoriceItem(props.detail.id) autoriceItem(props.detail.id)
}, [EstatusSwith, UserChanged]) }, [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>
)
const ColorSET = (value: number, mode: number) => { const ColorSET = (value: number, mode: number) => {
switch(mode) { switch(mode) {
case 1: { case 1: {
// Background color // Background color
if (value === 1) return '#FFFAF2' if (value === 1) return '#FFFAF2'
else if (value === 2) return '#E5F7B6' else if (value === 2) return '#E5F7B6'
else if (value === 3) return '#E9F3FC' else if (value === 3) return '#E9F3FC'
break break
} case 2: { } case 2: {
// Border color // Border color
if (value === 1) return '2px solid #F9A721' if (value === 1) return '2px solid #F9A721'
else if (value === 2) return '2px solid green' else if (value === 2) return '2px solid green'
else if (value === 3) return '2px solid blue' else if (value === 3) return '2px solid blue'
break break
} case 3: { } case 3: {
// Color // Color
if (value === 1) return '#5923F6' if (value === 1) return '#5923F6'
if (value === 2) return '#000000' if (value === 2) return '#000000'
if (value === 3) return 'blue' if (value === 3) return 'blue'
break break
}
} }
} }
}
return ( return (
<> <>
{props.detail.confirmaFraccion === 2 ?
<tr> <tr>
<th <th
style={{ style={{
@ -374,7 +363,7 @@ export default function RptPendingAnswerFromAmazonDetail(
</td> </td>
<td <td
style={{ style={{
textAlign: 'right' textAlign: 'center'
}} }}
className="DetailData" className="DetailData"
> >
@ -436,14 +425,6 @@ export default function RptPendingAnswerFromAmazonDetail(
> >
{props.detail.actualUnitCostMonetaryAmount} {props.detail.actualUnitCostMonetaryAmount}
</td> </td>
<td
style={{
textAlign: 'center'
}}
className="DetailData"
>
{props.detail.totalUnitValueMonetaryAmount}
</td>
<td <td
style={{ style={{
textAlign: 'center', textAlign: 'center',
@ -481,7 +462,6 @@ export default function RptPendingAnswerFromAmazonDetail(
CumplimientoNormativo.length === 0 ? 'hidden' : 'visible' CumplimientoNormativo.length === 0 ? 'hidden' : 'visible'
}} }}
> >
{' '}
<OverlayTrigger <OverlayTrigger
placement="bottom" placement="bottom"
overlay={ overlay={
@ -509,7 +489,6 @@ export default function RptPendingAnswerFromAmazonDetail(
CumplimientoNormativo.length === 0 ? 'hidden' : 'visible' CumplimientoNormativo.length === 0 ? 'hidden' : 'visible'
}} }}
> >
{' '}
<OverlayTrigger <OverlayTrigger
placement="bottom" placement="bottom"
overlay={<Tooltip id="button-tooltip-2">{Comentarios}</Tooltip>} overlay={<Tooltip id="button-tooltip-2">{Comentarios}</Tooltip>}
@ -529,7 +508,7 @@ export default function RptPendingAnswerFromAmazonDetail(
)} )}
</OverlayTrigger> </OverlayTrigger>
</td> </td>
</tr> </tr> : '' }
<Modal <Modal
show={ShowModal} show={ShowModal}

@ -14,23 +14,13 @@ import {
BsChevronDown, BsChevronDown,
BsChevronRight, BsChevronRight,
BsFilePdfFill, BsFilePdfFill,
BsSearch
} from 'react-icons/bs' } from 'react-icons/bs'
import { import {
FaAmazon, FaAmazon,
FaCheckCircle,
FaFileExcel,
FaQuestionCircle
} from 'react-icons/fa' } 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 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 { MsgInformativo } from '../../../../../Utils/Toast/msgInformativo' import { MsgInformativo } from '../../../../../Utils/Toast/msgInformativo'
import { RootState } from '../../../../../../store/store' import { RootState } from '../../../../../../store/store'
import { import {
@ -38,12 +28,13 @@ import {
populateInvoices, populateInvoices,
updateInvoice updateInvoice
} from '../../../../../../store/features/Clientes/2096/AmazonInvoices' } from '../../../../../../store/features/Clientes/2096/AmazonInvoices'
import RptAmazonInvoiceTrafficDetail from './RptAmazonLinkInvoice2TrafficDetail'
// Redux // Redux
import { useDispatch, useSelector } from 'react-redux' import { useDispatch, useSelector } from 'react-redux'
import DTO2096LinkInvoice2Reference from '../../../DTO/DTO2096LinkInvoice2Reference' import DTO2096LinkInvoice2Reference from '../../../DTO/DTO2096LinkInvoice2Reference'
import { AiFillFileExcel } from 'react-icons/ai' import { AiFillFileExcel } from 'react-icons/ai'
import RptAmazonLinkInvoice2TrafficDetail from './RptAmazonLinkInvoice2TrafficDetail'
import loadingImg from '../../../../../../images/ajaxloader.gif'
export interface IRptAmazonLinkInvoice2TrafficProps {} export interface IRptAmazonLinkInvoice2TrafficProps {}
@ -58,19 +49,12 @@ export function RptAmazonLinkInvoice2Traffic(
const [Referencia, setReferencia] = useState('') const [Referencia, setReferencia] = useState('')
const [show, setShowMsg] = useState(false) const [show, setShowMsg] = useState(false)
const [ShowModal, setShowModal] = useState(false) const [ShowModal, setShowModal] = useState(false)
const [WaitingDialog, setWaitingDialog] = useState(false)
const [WaitingMessage, setWaitingMessage] = useState('')
const [msg, setMsg] = useState('') const [msg, setMsg] = useState('')
const [Invoices, setInvoices] = useState<number[]>([]) const [Invoices, setInvoices] = useState<number[]>([])
const msgColor = 'primary' 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 = () => { const loadReport = () => {
DSAmazon.AmazonLinkInvoice2TrafficGet() DSAmazon.AmazonLinkInvoice2TrafficGet()
.then((response) => { .then((response) => {
@ -82,30 +66,9 @@ export function RptAmazonLinkInvoice2Traffic(
}) })
} }
/* 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
})
}
*/
const downloadPDF = (id: number) => { const downloadPDF = (id: number) => {
setWaitingDialog(true)
setWaitingMessage(' archivo PDF ')
DSAmazon.PDFAmazonInvoiceGET(id) DSAmazon.PDFAmazonInvoiceGET(id)
.then((response: any) => { .then((response: any) => {
if (response.status === 200) { if (response.status === 200) {
@ -115,7 +78,7 @@ export function RptAmazonLinkInvoice2Traffic(
link.setAttribute('download', 'AmazonInvoice.pdf') link.setAttribute('download', 'AmazonInvoice.pdf')
document.body.appendChild(link) document.body.appendChild(link)
link.click() link.click()
loadReport() setWaitingDialog(false)
} }
}) })
.catch((e: Error) => { .catch((e: Error) => {
@ -127,13 +90,14 @@ export function RptAmazonLinkInvoice2Traffic(
} }
const downloadExcelInvoices = (Referencia: string) => { const downloadExcelInvoices = (Referencia: string) => {
setWaitingMessage(' archivo Excel ')
DSAmazon.GETExcelInvoicesLinkByReference(Referencia) DSAmazon.GETExcelInvoicesLinkByReference(Referencia)
.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', 'FACTURAS_MODIFICA.xlsx') link.setAttribute('download', Referencia+'_FACTURAS_MODIFICA.xlsx')
document.body.appendChild(link) document.body.appendChild(link)
link.click() link.click()
loadReport() loadReport()
@ -148,13 +112,14 @@ export function RptAmazonLinkInvoice2Traffic(
} }
const downloadExcelPartidas = (Referencia: string) => { const downloadExcelPartidas = (Referencia: string) => {
setWaitingMessage(' archivo Excel ')
DSAmazon.GETAmazonExcelByReference(Referencia) DSAmazon.GETAmazonExcelByReference(Referencia)
.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', 'PARTIDAS_MODIFICA.xlsx') link.setAttribute('download', Referencia+'_PARTIDAS_MODIFICA.xlsx')
document.body.appendChild(link) document.body.appendChild(link)
link.click() link.click()
loadReport() loadReport()
@ -190,7 +155,6 @@ export function RptAmazonLinkInvoice2Traffic(
}) })
) )
} }
console.log('Invoices=' + Invoices)
} }
const processInvoices = () => { const processInvoices = () => {
@ -202,12 +166,10 @@ export function RptAmazonLinkInvoice2Traffic(
setShowMsg(true) setShowMsg(true)
return return
} }
//alert(Invoices)
setShowModal(true) setShowModal(true)
} }
const asociaFacturasReferencia = () => { const asociaFacturasReferencia = () => {
// alert(Invoices)
const data : DTO2096LinkInvoice2Reference = { const data : DTO2096LinkInvoice2Reference = {
referencia: Referencia, referencia: Referencia,
facturas : Invoices facturas : Invoices
@ -227,9 +189,6 @@ export function RptAmazonLinkInvoice2Traffic(
}) })
} }
const openLink = (item: string) => {
window.open('https://www.amazon.com/dp/' + item)
}
return ( return (
<div> <div>
<Card> <Card>
@ -339,7 +298,7 @@ export function RptAmazonLinkInvoice2Traffic(
</IconContext.Provider> </IconContext.Provider>
</div> </div>
</td> </td>
<td style={{ width: '50px', textAlign: 'center' }}> <td style={{ width: '50px', textAlign: 'center', visibility: MasterData.referencia ? 'visible' : 'hidden'}}>
<div onClick={() => {downloadExcelInvoices(MasterData.referencia)}}> <div onClick={() => {downloadExcelInvoices(MasterData.referencia)}}>
<IconContext.Provider <IconContext.Provider
value={{ color: 'green', size: '20px' }} value={{ color: 'green', size: '20px' }}
@ -348,7 +307,7 @@ export function RptAmazonLinkInvoice2Traffic(
</IconContext.Provider> </IconContext.Provider>
</div> </div>
</td> </td>
<td style={{ width: '50px', textAlign: 'center' }}> <td style={{ width: '50px', textAlign: 'center', visibility: MasterData.referencia ? 'visible' : 'hidden'}}>
<div onClick={() => {downloadExcelPartidas(MasterData.referencia)}}> <div onClick={() => {downloadExcelPartidas(MasterData.referencia)}}>
<IconContext.Provider <IconContext.Provider
value={{ color: 'green', size: '20px' }} value={{ color: 'green', size: '20px' }}
@ -446,15 +405,7 @@ export function RptAmazonLinkInvoice2Traffic(
> >
Item Description Item Description
</th> </th>
<th
style={{
width: '120px',
backgroundColor: '#D3E0EA',
color: '#346288'
}}
>
Pedimento Description
</th>
<th <th
style={{ style={{
width: '120px', width: '120px',
@ -463,65 +414,54 @@ export function RptAmazonLinkInvoice2Traffic(
textAlign: 'center' textAlign: 'center'
}} }}
> >
Destination HTS Code Fraccion GEMCO
</th>
<th
style={{
width: '120px',
backgroundColor: '#D3E0EA',
color: '#346288'
}}
>
Valida
</th> </th>
<th <th
style={{ style={{
width: '120px', width: '70px',
backgroundColor: '#D3E0EA', backgroundColor: '#D3E0EA',
color: '#346288' color: '#346288',
textAlign: 'center'
}} }}
> >
Confirme fraccion Descripcion GEMCO
</th> </th>
<th <th
style={{ style={{
width: '120px', width: '70px',
backgroundColor: '#D3E0EA', backgroundColor: '#D3E0EA',
color: '#346288', color: '#346288',
textAlign: 'center' textAlign: 'center'
}} }}
> >
Fraccion GEMCO Country of Origin
</th> </th>
<th <th
style={{ style={{
width: '120px', width: '70px',
backgroundColor: '#D3E0EA', backgroundColor: '#D3E0EA',
color: '#346288', color: '#346288'
textAlign: 'center'
}} }}
> >
Confirme descripcion ProductGroup
</th> </th>
<th <th
style={{ style={{
width: '70px', width: '70px',
backgroundColor: '#D3E0EA', backgroundColor: '#D3E0EA',
color: '#346288', color: '#346288'
textAlign: 'center'
}} }}
> >
Descripcion GEMCO Brand
</th> </th>
<th <th
style={{ style={{
width: '70px', width: '70px',
backgroundColor: '#D3E0EA', backgroundColor: '#D3E0EA',
color: '#346288', color: '#346288'
textAlign: 'center'
}} }}
> >
Country of Origin Model
</th> </th>
<th <th
style={{ style={{
@ -530,7 +470,7 @@ export function RptAmazonLinkInvoice2Traffic(
color: '#346288' color: '#346288'
}} }}
> >
ProductGroup Unit Measure
</th> </th>
<th <th
style={{ style={{
@ -539,7 +479,7 @@ export function RptAmazonLinkInvoice2Traffic(
color: '#346288' color: '#346288'
}} }}
> >
Brand Qty Shipped
</th> </th>
<th <th
style={{ style={{
@ -548,7 +488,7 @@ export function RptAmazonLinkInvoice2Traffic(
color: '#346288' color: '#346288'
}} }}
> >
Model Unit of measure
</th> </th>
<th <th
style={{ style={{
@ -557,7 +497,7 @@ export function RptAmazonLinkInvoice2Traffic(
color: '#346288' color: '#346288'
}} }}
> >
Unit Measure Unit Net Weight
</th> </th>
<th <th
style={{ style={{
@ -566,7 +506,7 @@ export function RptAmazonLinkInvoice2Traffic(
color: '#346288' color: '#346288'
}} }}
> >
Qty Shipped Unit Cost
</th> </th>
<th <th
style={{ style={{
@ -575,7 +515,7 @@ export function RptAmazonLinkInvoice2Traffic(
color: '#346288' color: '#346288'
}} }}
> >
Unit of measure Total value
</th> </th>
<th <th
style={{ style={{
@ -584,7 +524,7 @@ export function RptAmazonLinkInvoice2Traffic(
color: '#346288' color: '#346288'
}} }}
> >
Unit Net Weight Sideline
</th> </th>
<th <th
style={{ style={{
@ -593,7 +533,6 @@ export function RptAmazonLinkInvoice2Traffic(
color: '#346288' color: '#346288'
}} }}
> >
Unit Cost
</th> </th>
<th <th
style={{ style={{
@ -602,7 +541,6 @@ export function RptAmazonLinkInvoice2Traffic(
color: '#346288' color: '#346288'
}} }}
> >
Total value
</th> </th>
</tr> </tr>
</thead> </thead>
@ -618,7 +556,7 @@ export function RptAmazonLinkInvoice2Traffic(
) )
.map((detail) => { .map((detail) => {
return ( return (
<RptAmazonInvoiceTrafficDetail <RptAmazonLinkInvoice2TrafficDetail
IDMaster={MasterData.id} IDMaster={MasterData.id}
detail={detail} detail={detail}
Habilitado={ Habilitado={
@ -690,6 +628,26 @@ export function RptAmazonLinkInvoice2Traffic(
</div> </div>
</Modal.Body> </Modal.Body>
</Modal> </Modal>
<Modal
show={WaitingDialog}
onHide={() => {
setWaitingDialog(false)
}}
backdrop='static'
keyboard={false}
size='sm'
dialogClassName={'modal-50w'}
centered
>
<Modal.Header closeButton>
<Modal.Title></Modal.Title>
</Modal.Header>
<Modal.Body>
<img src={loadingImg} style={{ height: '150px' }} alt='proccessing' />
Generando {WaitingMessage}...
</Modal.Body>
<Modal.Footer></Modal.Footer>
</Modal>
<MsgInformativo <MsgInformativo
show={show} show={show}
msg={msg} msg={msg}

@ -29,6 +29,7 @@ import { updateInvoice } from '../../../../../../store/features/Clientes/2096/Am
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 IRtpAmazonInvoiceTrafficDetailProps { export interface IRtpAmazonInvoiceTrafficDetailProps {
IDMaster: number IDMaster: number
@ -36,7 +37,7 @@ export interface IRtpAmazonInvoiceTrafficDetailProps {
Habilitado: boolean Habilitado: boolean
} }
export default function RtpAmazonInvoiceTrafficDetail( export default function RtpAmazonInvoice2TrafficDetail(
props: IRtpAmazonInvoiceTrafficDetailProps props: IRtpAmazonInvoiceTrafficDetailProps
) { ) {
const dispatch = useDispatch() const dispatch = useDispatch()
@ -44,7 +45,7 @@ export default function RtpAmazonInvoiceTrafficDetail(
(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.autorizado) const [EstatusSwith, setEstatusSwitch] = useState(props.detail.sightLine)
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)
@ -62,7 +63,7 @@ export default function RtpAmazonInvoiceTrafficDetail(
const openLink = (item: string) => { const openLink = (item: string) => {
window.open('https://www.amazon.com/dp/' + item) window.open('https://www.amazon.com/dp/' + item)
} }
const target = React.useRef(null) /* const target = React.useRef(null)
const UpdateInfo = (Invoice: I2096Headers, Detail: I2096Detail[]) => { const UpdateInfo = (Invoice: I2096Headers, Detail: I2096Detail[]) => {
const updatedInvoice: I2096Headers = { const updatedInvoice: I2096Headers = {
@ -97,27 +98,9 @@ export default function RtpAmazonInvoiceTrafficDetail(
detail: Detail detail: Detail
} }
dispatch(updateInvoice(updatedInvoice)) 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 autoriceItem = (id: number) => { /* const autoriceItem = (id: number) => {
if (CumplimientoNormativo.length === 0 && EstatusSwith) { if (CumplimientoNormativo.length === 0 && EstatusSwith) {
setHeader('Error') setHeader('Error')
setMsg( setMsg(
@ -132,29 +115,36 @@ export default function RtpAmazonInvoiceTrafficDetail(
cumplimientoNormativo: CumplimientoNormativo, cumplimientoNormativo: CumplimientoNormativo,
comentarios: Comentarios comentarios: Comentarios
} }
console.log(data) } */
/* DSAmazon.AutorizadoSET(data)
const ToggleSightLine = (id: number) => {
const data: DTO2096SightLine = {
id: id,
sightLine: EstatusSwith,
comentariosSightLine: Comentarios
}
DSAmazon.SightLineSET(data)
.then((response) => { .then((response) => {
editArray(id, !props.detail.autorizado) console.log(response.data)
//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 && EstatusSwith && !props.detail.fraccionGEMCO) if (UserChanged && EstatusSwith && !props.detail.fraccionGEMCO)
autoriceItem(props.detail.id) autoriceItem(props.detail.id)
}, [EstatusSwith, UserChanged]) }, [EstatusSwith, UserChanged]) */
const popover = ( useEffect(() => {
<Popover id="popover-basic"> if (UserChanged) setShowModal(true)
<Popover.Header as="h3">Popover right</Popover.Header> }, [EstatusSwith, UserChanged])
<Popover.Body>
And here's some <strong>amazing</strong> content. It's very engaging.
right?
</Popover.Body>
</Popover>
)
return ( return (
<> <>
@ -180,79 +170,12 @@ export default function RtpAmazonInvoiceTrafficDetail(
</td> </td>
<td <td
style={{ style={{
textAlign: 'right' textAlign: 'left'
}} }}
className="DetailData" className="DetailData"
> >
{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}
Deshabilitado={props.Habilitado}
Detail={props.detail}
/>
</td>
<td <td
style={{ style={{
textAlign: 'center' textAlign: 'center'
@ -284,21 +207,6 @@ export default function RtpAmazonInvoiceTrafficDetail(
}} }}
/> />
</td> </td>
<td
style={{
textAlign: 'center'
}}
className="DetailData"
>
<ComboDescripcion
IDInvoice={props.IDMaster}
IDDetail={props.detail.id}
DescripcionOriginal={props.detail.pedimentoDescription}
ConfirmaDescripcion={props.detail.confirmaDescripcion}
Deshabilitado={props.Habilitado}
Detail={props.detail}
/>
</td>
<td <td
style={{ style={{
textAlign: 'center' textAlign: 'center'
@ -317,7 +225,8 @@ export default function RtpAmazonInvoiceTrafficDetail(
</td> </td>
<td <td
style={{ style={{
textAlign: 'right' textAlign: 'left',
paddingLeft: '15px'
}} }}
className="DetailData" className="DetailData"
> >
@ -325,7 +234,8 @@ export default function RtpAmazonInvoiceTrafficDetail(
</td> </td>
<td <td
style={{ style={{
textAlign: 'right' textAlign: 'left',
paddingLeft: '15px'
}} }}
className="DetailData" className="DetailData"
> >
@ -391,18 +301,11 @@ export default function RtpAmazonInvoiceTrafficDetail(
<td <td
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"
> >
<FormCheck {/* <FormCheck
className="form-check form-switch form-control-lg" className="form-check form-switch form-control-lg"
id="switchEnabled" id="switchEnabled"
type="switch" type="switch"
@ -416,7 +319,17 @@ export default function RtpAmazonInvoiceTrafficDetail(
setUserChanged(true) setUserChanged(true)
setShowModal(!EstatusSwith) setShowModal(!EstatusSwith)
}} }}
label="" label="" */}
<FormCheck
className="form-check form-switch form-control-lg"
id="switchEnabled"
type="switch"
checked={EstatusSwith}
onChange={() => {
setEstatusSwitch(!EstatusSwith)
setUserChanged(true)
setShowModal(!EstatusSwith)
}}
/> />
</td> </td>
<td <td
@ -475,7 +388,7 @@ export default function RtpAmazonInvoiceTrafficDetail(
</td> </td>
</tr> </tr>
<Modal {/* <Modal
show={ShowModal} show={ShowModal}
onHide={() => { onHide={() => {
setShowModal(false) setShowModal(false)
@ -550,6 +463,58 @@ export default function RtpAmazonInvoiceTrafficDetail(
</Row> </Row>
</div> </div>
</Modal.Body> </Modal.Body>
</Modal> */}
<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> </Modal>
<MsgInformativo <MsgInformativo
show={show} show={show}

@ -1,24 +1,17 @@
import * as React from 'react' import * as React from 'react'
import { useEffect, useState } from 'react' import { useEffect, useState } from 'react'
import { import {
Alert,
Button, Button,
Col, Col,
Form, Form,
FormCheck, FormCheck,
Modal, Modal,
OverlayTrigger, OverlayTrigger,
Popover,
Row, Row,
Tooltip Tooltip
} from 'react-bootstrap' } from 'react-bootstrap'
import { IconContext } from 'react-icons' 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 { 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 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'
@ -27,7 +20,6 @@ import { RootState } from '../../../../../../store/store'
import { useDispatch, useSelector } from 'react-redux' import { useDispatch, useSelector } from 'react-redux'
import { updateInvoice } from '../../../../../../store/features/Clientes/2096/AmazonInvoices' import { 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 { BsFillChatRightTextFill } from 'react-icons/bs' import { BsFillChatRightTextFill } from 'react-icons/bs'
import DTO2096SightLine from '../../../DTO/DTO2096SightLine' import DTO2096SightLine from '../../../DTO/DTO2096SightLine'
@ -49,7 +41,7 @@ export default function RptAmazonPendingTraficInvoiceDetail(
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 [Comentarios, setComentarios] = useState(
props.detail.comentariosSightLine ? props.detail.comentariosSightLine : '' props.detail.comentariosSightLine ? props.detail.comentariosSightLine : ''
@ -58,7 +50,7 @@ export default function RptAmazonPendingTraficInvoiceDetail(
const openLink = (item: string) => { const openLink = (item: string) => {
window.open('https://www.amazon.com/dp/' + item) window.open('https://www.amazon.com/dp/' + item)
} }
const target = React.useRef(null) //const target = React.useRef(null)
const UpdateInfo = (Invoice: I2096Headers, Detail: I2096Detail[]) => { const UpdateInfo = (Invoice: I2096Headers, Detail: I2096Detail[]) => {
const updatedInvoice: I2096Headers = { const updatedInvoice: I2096Headers = {
@ -95,7 +87,7 @@ export default function RptAmazonPendingTraficInvoiceDetail(
dispatch(updateInvoice(updatedInvoice)) dispatch(updateInvoice(updatedInvoice))
} }
const editArray = (id: number, valor: boolean) => { /* const editArray = (id: number, valor: boolean) => {
const Invoice = mInvoices const Invoice = mInvoices
.filter((el) => el.id === props.IDMaster) .filter((el) => el.id === props.IDMaster)
.map((el) => { .map((el) => {
@ -111,7 +103,7 @@ export default function RptAmazonPendingTraficInvoiceDetail(
return el return el
}) })
UpdateInfo(Invoice[0], newDetail) UpdateInfo(Invoice[0], newDetail)
} } */
const ToggleSightLine = (id: number) => { const ToggleSightLine = (id: number) => {
const data: DTO2096SightLine = { const data: DTO2096SightLine = {
@ -135,19 +127,8 @@ export default function RptAmazonPendingTraficInvoiceDetail(
useEffect(() => { useEffect(() => {
if (UserChanged) setShowModal(true) if (UserChanged) setShowModal(true)
//ToggleSightLine(props.detail.id)
}, [EstatusSwith, UserChanged]) }, [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 ( return (
<> <>
<tr> <tr>

@ -41,15 +41,6 @@ export function RptAmazonPendingTraficInvoice(
const [msg, setMsg] = useState('') const [msg, setMsg] = useState('')
const msgColor = 'primary' 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 = () => { const loadReport = () => {
DSAmazon.AmazonPendingTraficInvoiceGET() DSAmazon.AmazonPendingTraficInvoiceGET()
.then((response) => { .then((response) => {
@ -72,10 +63,6 @@ export function RptAmazonPendingTraficInvoice(
dispatch(updateInvoice(Obj)) dispatch(updateInvoice(Obj))
} }
const openLink = (item: string) => {
window.open('https://www.amazon.com/dp/' + item)
}
const finishInvoice = (id: number) => { const finishInvoice = (id: number) => {
DSAmazon.SePuedeTerminarXTraficoFactura(id) DSAmazon.SePuedeTerminarXTraficoFactura(id)
.then((response) => { .then((response) => {
@ -83,26 +70,6 @@ export function RptAmazonPendingTraficInvoice(
DSAmazon.TerminaXTraficoFactura(id) DSAmazon.TerminaXTraficoFactura(id)
.then((response) => { .then((response) => {
loadReport() loadReport()
/* 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()
loadReport()
}
})
.catch((e: Error) => {
setHeader('Error')
setMsg('Ocurrio un error')
setShowMsg(true)
return
}) */
}) })
.catch((e: Error) => {}) .catch((e: Error) => {})
setShowModal(false) setShowModal(false)
@ -426,7 +393,7 @@ export function RptAmazonPendingTraficInvoice(
color: '#346288' color: '#346288'
}} }}
> >
Sight line Sideline
</th> </th>
<th <th
style={{ style={{

@ -13,6 +13,7 @@ import DTO2096PerfilesParecidos from '../DTO/DTO2096PerfilesParecidos'
import DTO2096LinkInvoice2Reference from '../DTO/DTO2096LinkInvoice2Reference' import DTO2096LinkInvoice2Reference from '../DTO/DTO2096LinkInvoice2Reference'
import DTO2096Estatus from '../DTO/DTO2096Estatus' import DTO2096Estatus from '../DTO/DTO2096Estatus'
import DTO2096NoParte from '../DTO/DTO2096NoParte' import DTO2096NoParte from '../DTO/DTO2096NoParte'
import I2096NoParteLog from '../Interfaces/I2096NoParteLog'
class AmazonDataService { class AmazonDataService {
AmazonPendingClasificationInvoiceGET() { AmazonPendingClasificationInvoiceGET() {
@ -36,6 +37,9 @@ class AmazonDataService {
EnviaEsperaRespuestaAmazon(id: number) { EnviaEsperaRespuestaAmazon(id: number) {
return http.get<DTORespuesta>(`/AmazonInvoice/EnviaEsperaRespuestaAmazon?id=${id}`) return http.get<DTORespuesta>(`/AmazonInvoice/EnviaEsperaRespuestaAmazon?id=${id}`)
} }
ArchivoRespuestaAmazon(id: number, idFile: number) {
return http.put<DTORespuesta>(`/AmazonInvoice/ArchivoRespuestaAmazon?id=${id}&idFile=${idFile}`)
}
TerminaClasificarFactura(id: number) { TerminaClasificarFactura(id: number) {
return http.get<boolean>(`/AmazonInvoice/TerminaClasificarFactura?id=${id}`) return http.get<boolean>(`/AmazonInvoice/TerminaClasificarFactura?id=${id}`)
} }
@ -140,6 +144,9 @@ class AmazonDataService {
NoPartesUpdate(data: DTO2096NoParte) { NoPartesUpdate(data: DTO2096NoParte) {
return http.put<I2096NoParte>(`/AmazonInvoice/NoPartesUpdate`, data) return http.put<I2096NoParte>(`/AmazonInvoice/NoPartesUpdate`, data)
} }
NoPartesLogGET(id: number) {
return http.get<I2096NoParteLog[]>(`/AmazonInvoice/NoPartesLogGET?id=${id}`)
}
PerfilesParecidosGet(Perfil: string) { PerfilesParecidosGet(Perfil: string) {
return http.get<DTO2096PerfilesParecidos[]>(`/Usuarios/Catalogo/Usuarios/PerfilesParecidos?Perfil=${Perfil}`) return http.get<DTO2096PerfilesParecidos[]>(`/Usuarios/Catalogo/Usuarios/PerfilesParecidos?Perfil=${Perfil}`)
} }

Loading…
Cancel
Save