Ultima version funcional 11.Abr.2023

AmazonRelease1.1
unknown 1 year ago
parent 86c390f343
commit 43bd9b63f7
  1. 37
      src/Components/Clientes/Amazon/Reportes/Clasification/Pending/RptAmazonPendingClasificationInvoices.tsx
  2. 816
      src/Components/Clientes/Amazon/Reportes/Clasification/WaitingAnswerFromAmazon/RptPendingAnswerFromAmazon.tsx
  3. 2
      src/Components/Clientes/Amazon/Reportes/Clasification/WaitingAnswerFromAmazon/RptPendingAnswerFromAmazonDetail.tsx
  4. 480
      src/Components/Clientes/Amazon/Reportes/Estatus/RtpAmazonInvoiceStatus.tsx
  5. 5
      src/index.tsx

@ -64,10 +64,9 @@ export default function RtpAmazonPendingInvoices(
const [msg, setMsg] = useState('')
const msgColor = 'primary'
const loadReport = () => {
const loadReport = async () => {
DSAmazon.AmazonPendingClasificationInvoiceGET()
.then((response) => {
console.log(response.data)
dispatch(initializeInvoice([]))
dispatch(populateInvoices(response.data))
})
@ -80,24 +79,18 @@ export default function RtpAmazonPendingInvoices(
loadReport()
}, [])
const invoiceChecked = (row: I2096Headers) => {
let Invoice: I2096Headers[] = mInvoices.filter((item) => item.id === row.id)
const Obj = { ...Invoice[0] }
Obj.max = !Obj.max
dispatch(updateInvoice(Obj))
DSAmazon.SETInvoiceDetail2Unchecked(row.id)
const check4Updates = (IDInvoice: number) => {
DSAmazon.SETInvoiceDetail2Unchecked(IDInvoice)
.then((response) => {
DSAmazon.AmazonInvoiceGET(row.id)
DSAmazon.AmazonInvoiceGET(IDInvoice)
.then((response) => {
if (response.data) {
//dispatch(updateInvoice(response.data[0]))
const Obj = { ...response.data[0] }
console.log(JSON.stringify(Obj))
Obj.max = !Obj.max
dispatch(updateInvoice(Obj))
return
}
dispatch(updateInvoice(response.data[0]))
let Invoice: I2096Headers[] = response.data.filter(
(item) => item.id === IDInvoice
)
const Obj = { ...Invoice[0] }
Obj.max = !Obj.max
dispatch(updateInvoice(Obj))
})
.catch((e: Error) => {
setHeader('Error')
@ -114,6 +107,14 @@ export default function RtpAmazonPendingInvoices(
})
}
const invoiceChecked = (row: I2096Headers) => {
if (!row.max) check4Updates(row.id)
let Invoice: I2096Headers[] = mInvoices.filter((item) => item.id === row.id)
const Obj = { ...Invoice[0] }
Obj.max = !Obj.max
dispatch(updateInvoice(Obj))
}
const descargaArchivoExcepciones = () => {
setShowModalW(false)
setWaitingMessage('Archivo de excepciones')

@ -37,6 +37,14 @@ export interface IRptPendingAnswerFromAmazonProps {}
export default function RptPendingAnswerFromAmazon(
props: IRptPendingAnswerFromAmazonProps
) {
const [Usuario, setUsuario] = useState(() => {
const stickyValue = window.localStorage.getItem('UserId')
return stickyValue !== null ? JSON.parse(stickyValue) : ''
})
const [Perfil, setPerfil] = useState(() => {
const stickyValue = window.localStorage.getItem('Perfil')
return stickyValue !== null ? JSON.parse(stickyValue) : 0
})
const dispatch = useDispatch()
const mInvoices = useSelector(
(state: RootState) => state.AmazonInvoices.Invoice
@ -210,7 +218,7 @@ export default function RptPendingAnswerFromAmazon(
<IconContext.Provider value={{ color: '#F6C34F', size: '8%' }}>
<FaAmazon />
</IconContext.Provider>
CLASIFICACION : facturas
CLASIFICACION : Facturas&nbsp;
<span
style={{
fontStyle: 'italic',
@ -218,9 +226,8 @@ export default function RptPendingAnswerFromAmazon(
textDecorationColor: 'red'
}}
>
pendientes
con Excepciones
</span>
de respuesta
</Card.Title>
</Col>
<Col xs={4}></Col>
@ -260,391 +267,414 @@ export default function RptPendingAnswerFromAmazon(
</thead>
<tbody>
{mInvoices
? mInvoices.map((MasterData) => {
return (
<>
<tr
style={{ cursor: 'pointer' }}
className={
MasterData.max === true
? 'masterSelected'
: 'normalSelected'
}
>
<td
style={{ textAlign: 'left' }}
? mInvoices
.filter((a) => {
if (
a.clasificador === parseInt(Usuario) &&
Perfil !== 'Clasificador lider'
) {
return a
} else if (
[
'Clasificador lider',
'Administrador',
'Sistemas'
].includes(Perfil)
) {
return a
}
})
.map((MasterData) => {
return (
<>
<tr
style={{ cursor: 'pointer' }}
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>
{existsExeptions(MasterData.id) > 0 ? (
<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>
{existsExeptions(MasterData.id) > 0 ? (
<div
onClick={() =>
downloadExceptionsFile(
MasterData.id,
MasterData.invoiceNumber
)
}
title="Archivo de excepciones"
>
<IconContext.Provider
value={{ color: 'orange', size: '20px' }}
>
<FaFileExcel />
</IconContext.Provider>
</div>
) : null}
</td>
<td>
<FormCheck
className="form-check form-switch form-control-sm"
id="switchEnabled"
type="switch"
checked={false}
onChange={() => {
sePuedeTerminarFactura(MasterData.id)
}}
label=""
/>
</td>
<td>
<div
onClick={() =>
downloadExceptionsFile(
MasterData.id,
MasterData.invoiceNumber
)
}
title="Archivo de excepciones"
onClick={() => {
setIDFactura(MasterData.id)
setShowModalAnswerFile(!ShowModalAnswerFile)
}}
title="Archivo de respuesta"
>
<IconContext.Provider
value={{ color: 'orange', size: '20px' }}
value={{ color: 'red', size: '23px' }}
>
<FaFileExcel />
<AiFillFileUnknown />
</IconContext.Provider>
</div>
) : null}
</td>
<td>
<FormCheck
className="form-check form-switch form-control-sm"
id="switchEnabled"
type="switch"
checked={false}
onChange={() => {
sePuedeTerminarFactura(MasterData.id)
}}
label=""
/>
</td>
<td>
<div
onClick={() => {
setIDFactura(MasterData.id)
setShowModalAnswerFile(!ShowModalAnswerFile)
</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'
}}
title="Archivo de respuesta"
>
<IconContext.Provider
value={{ color: 'red', size: '23px' }}
>
<AiFillFileUnknown />
</IconContext.Provider>
</div>
</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>
<td style={{ textAlign: 'center' }}>
{getUser(MasterData.clasificador)}
</td>
</tr>
{MasterData.max ? (
<tr
className={
MasterData.max === true
? 'masterSelected2'
: 'normalSelected2'
}
>
<th colSpan={17}>
<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: '200px',
backgroundColor: '#D3E0EA',
color: '#346288',
textAlign: 'center'
}}
>
Destination HTS Code
</th>
<th
style={{
width: '120px',
backgroundColor: '#D3E0EA',
color: '#346288',
textAlign: 'center'
}}
>
Valida
</th>
<th
style={{
width: '120px',
backgroundColor: '#D3E0EA',
color: '#346288',
textAlign: 'center'
}}
>
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'
}}
>
Autorizado
</th>
<th
style={{
width: '70px',
backgroundColor: '#D3E0EA',
color: '#346288'
}}
>
RN
</th>
<th
style={{
width: '70px',
backgroundColor: '#D3E0EA',
color: '#346288'
}}
>
Comm
</th>
</tr>
</thead>
<tbody>
{mInvoices.map((MD) => {
return (
<>
{MD.detail
.filter(
(detail) =>
MasterData.id ===
detail.idHeader
)
.map((detail) => {
return (
<RtpPendingAnswerFromAmazonDetail
IDMaster={MasterData.id}
detail={detail}
Habilitado={
MasterData.estatus <= 1
}
/>
)
})}
</>
)
})}
</tbody>
</table>
</th>
{mInvoices
.filter((value) => value.id === MasterData.id)
.map((row) => {
return row.detail.length
})}
</td>
<td style={{ textAlign: 'center' }}>
{getUser(MasterData.clasificador)}
</td>
</tr>
) : null}
</>
)
})
{MasterData.max ? (
<tr
className={
MasterData.max === true
? 'masterSelected2'
: 'normalSelected2'
}
>
<th colSpan={17}>
<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: '200px',
backgroundColor: '#D3E0EA',
color: '#346288',
textAlign: 'center'
}}
>
Destination HTS Code
</th>
<th
style={{
width: '120px',
backgroundColor: '#D3E0EA',
color: '#346288',
textAlign: 'center'
}}
>
Valida
</th>
<th
style={{
width: '120px',
backgroundColor: '#D3E0EA',
color: '#346288',
textAlign: 'center'
}}
>
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'
}}
>
Autorizado
</th>
<th
style={{
width: '70px',
backgroundColor: '#D3E0EA',
color: '#346288'
}}
>
RN
</th>
<th
style={{
width: '70px',
backgroundColor: '#D3E0EA',
color: '#346288'
}}
>
Comm
</th>
</tr>
</thead>
<tbody>
{mInvoices.map((MD) => {
return (
<>
{MD.detail
.filter(
(detail) =>
MasterData.id ===
detail.idHeader
)
.map((detail) => {
return (
<RtpPendingAnswerFromAmazonDetail
IDMaster={MasterData.id}
detail={detail}
Habilitado={
MasterData.estatus <= 1
}
/>
)
})}
</>
)
})}
</tbody>
</table>
</th>
</tr>
) : null}
</>
)
})
: null}
</tbody>
</Table>
@ -735,7 +765,7 @@ export default function RptPendingAnswerFromAmazon(
</div>
</Modal.Body>
</Modal>
<Modal
show={WaitingDialog}
onHide={() => {
@ -760,23 +790,29 @@ export default function RptPendingAnswerFromAmazon(
alt="proccessing"
/>
{WaitingMessage}
<div style={{overflow:'auto'}}>
<table>
<div style={{ overflow: 'auto' }}>
<table>
<tr>
<td style={{backgroundColor:'#6095BF', color: '#FFFFFF'}}>Parte</td>
<td style={{backgroundColor:'#6095BF', color: '#FFFFFF'}}>Lista de facturas</td>
</tr>
{ResumeData
? ResumeData.map((data) => {
return <>
<tr>
<td>{data.parte}</td>
<td>{data.facturas.replaceAll(Factura,'')}</td>
</tr>
</>
})
: ''}
</table>
<td style={{ backgroundColor: '#6095BF', color: '#FFFFFF' }}>
Parte
</td>
<td style={{ backgroundColor: '#6095BF', color: '#FFFFFF' }}>
Lista de facturas
</td>
</tr>
{ResumeData
? ResumeData.map((data) => {
return (
<>
<tr>
<td>{data.parte}</td>
<td>{data.facturas.replaceAll(Factura, '')}</td>
</tr>
</>
)
})
: ''}
</table>
</div>
</Modal.Body>
<Modal.Footer></Modal.Footer>

@ -294,7 +294,7 @@ export default function RptPendingAnswerFromAmazonDetail(
: '#000000', */
border: '2px solid #000000',
color: '@000000',
width: '115px',
width: '135px',
textAlign: 'right',
borderRadius: '10px'
}}

@ -0,0 +1,480 @@
import * as React from 'react'
import { useEffect, useState } from 'react'
import { RootState } from '../../../../../store/store'
import DSAmazon from '../../Services/Amazon.Services'
// Redux
import { useDispatch, useSelector } from 'react-redux'
import {
Alert,
Button,
Card,
Col,
Form,
Modal,
Row,
Table
} from 'react-bootstrap'
import { MsgInformativo } from '../../../../Utils/Toast/msgInformativo'
import { AiFillFileExcel } from 'react-icons/ai'
import { IconContext } from 'react-icons'
import { BsFilePdfFill } from 'react-icons/bs'
import { FaAmazon } from 'react-icons/fa'
import loadingImg from '../../../../../images/ajaxloader.gif'
import { MFileManager } from '../../../../Utils/MFileManager/MFileManager'
import DTO2096RptPayedOperations from '../../DTO/DTO2096RptPayedOperations'
export interface IRptAmazonInvoiceStatusProps {
}
export default function RptAmazonInvoiceStatus (props: IRptAmazonInvoiceStatusProps) {
const dispatch = useDispatch()
const mInvoices = useSelector(
(state: RootState) => state.AmazonInvoices.Invoice
)
const [header, setHeader] = useState('')
const [Referencia, setReferencia] = useState('')
const [Inicio, setInicio] = useState(currentDate())
const [Fin, setFin] = useState(currentDate())
const [Data, setData] = useState<DTO2096RptPayedOperations[]>([])
const [show, setShowMsg] = useState(false)
const [ShowModal, setShowModal] = useState(false)
const [WaitingDialog, setWaitingDialog] = useState(false)
const [WaitingMessage, setWaitingMessage] = useState('')
const [msg, setMsg] = useState('')
const [ShowModalAnswerFile, setShowModalAnswerFile] = useState(false)
const [IDProcess, setIDProcess] = useState(25)
const [IDFactura, setIDFactura] = useState(0)
const [Invoices, setInvoices] = useState<number[]>([])
const msgColor = 'primary'
function currentDate(): string {
var today = new Date()
var dd = String(today.getDate()).padStart(2, '0')
var mm = String(today.getMonth() + 1).padStart(2, '0') //January is 0!
var yyyy = today.getFullYear()
return yyyy + '-' + mm + '-' + dd
}
const loadReport = () => {
DSAmazon.AmazonPayedOperationsGET(Inicio, Fin)
.then((response) => {
console.log(response.data)
setData(response.data)
/* dispatch(initializeInvoice([]))
dispatch(populateInvoices(response.data)) */
})
.catch((e: Error) => {
alert('Ocurrio un error' + e.message.toString())
})
}
const downloadPDF = (id: number, InvoiceNumber: string) => {
setWaitingDialog(true)
setWaitingMessage(' archivo PDF ')
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', 'FAC_' + InvoiceNumber + '.pdf')
document.body.appendChild(link)
link.click()
setWaitingDialog(false)
}
})
.catch((e: Error) => {
setHeader('Error')
setMsg('Ocurrio un error')
setShowMsg(true)
return
})
}
const downloadExcelInvoices = (Referencia: string) => {
setWaitingMessage(' archivo Excel ')
DSAmazon.GETAmazonFacturasByReference(Referencia)
.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', Referencia + '_FACTURAS_MODIFICA.xls')
document.body.appendChild(link)
link.click()
loadReport()
}
})
.catch((e: Error) => {
setHeader('Error')
setMsg('Ocurrio un error')
setShowMsg(true)
return
})
}
const downloadExcelPartidas = (Referencia: string) => {
setWaitingMessage(' archivo Excel ')
DSAmazon.GETAmazonPartidasByReference(Referencia)
.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', Referencia + '_PARTIDAS_MODIFICA.xls')
document.body.appendChild(link)
link.click()
loadReport()
}
})
.catch((e: Error) => {
setHeader('Error')
setMsg('Ocurrio un error')
setShowMsg(true)
return
})
}
const downloadNoPartes = (id: number, Factura: string) => {
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 ' + Factura + '.xls'
)
document.body.appendChild(link)
link.click()
setWaitingDialog(false)
}
})
.catch((e: Error) => {
setHeader('Error')
setMsg('Ocurrio un error')
setShowMsg(true)
return
})
}
useEffect(() => {
loadReport()
}, [])
return (
<div>
<Card>
<Card.Body>
<Row>
<Col xs={5}>
<Card.Title>
<IconContext.Provider value={{ color: '#F6C34F', size: '8%' }}>
<FaAmazon />
</IconContext.Provider>
Operaciones Pagadas
</Card.Title>
</Col>
<Col></Col>
<Col style={{textAlign:'right'}}>Desde</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 style={{textAlign:'right'}}>Hasta</Col>
<Col xs={1}>
<Form.Control
defaultValue={Fin}
type="date"
name="Fin"
placeholder="Fin"
title="Fin"
alt="Fin"
onChange={(e) => setFin(e.target.value)}
size="sm"
/>
</Col>
<Col style={{textAlign:'right'}} onClick={()=>{loadReport()}}><Button variant="primary">Buscar</Button></Col>
</Row>
</Card.Body>
</Card>
<Card>
<Card.Body>
<div className="MDcontainer">
<Table className="MDTable" hover>
<thead style={{ position: 'sticky', top: '0' }}>
<tr>
<th style={{ width: '50px' }}>id</th>
<th style={{ width: '50px' }}>PDF</th>
<th style={{ width: '50px' }}>Facturas</th>
<th style={{ width: '50px' }}>Partidas</th>
<th style={{ width: '50px' }}>Arch Excep.</th>
<th style={{ width: '50px' }}>No Partes</th>
<th style={{ width: '100px' }}>Referencia</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>Fecha pago</th>
<th>Patente</th>
<th>Aduana</th>
<th>Pedimento</th>
</tr>
</thead>
<tbody>
{Data
? Data.map((MasterData) => {
return (
<>
<tr
style={{ cursor: 'pointer', height: '25px' }}
className={'normalSelected'}
>
<td
style={{
textAlign: 'right',
paddingRight: '10px'
}}
>
{MasterData.id}
</td>
<td style={{ width: '50px', textAlign: 'center' }}>
<div
onClick={() => {
downloadPDF(
MasterData.id,
MasterData.invoiceNumber
)
}}
>
<IconContext.Provider
value={{ color: 'red', size: '20px' }}
>
<BsFilePdfFill />
</IconContext.Provider>
</div>
</td>
<td
style={{
width: '50px',
textAlign: 'center',
visibility: MasterData.referencia
? 'visible'
: 'hidden'
}}
>
<div
onClick={() => {
downloadExcelInvoices(MasterData.referencia)
}}
>
<IconContext.Provider
value={{ color: 'green', size: '20px' }}
>
<AiFillFileExcel />
</IconContext.Provider>
</div>
</td>
<td
style={{
width: '50px',
textAlign: 'center',
visibility: MasterData.referencia
? 'visible'
: 'hidden'
}}
>
<div
onClick={() => {
downloadExcelPartidas(MasterData.referencia)
}}
>
<IconContext.Provider
value={{ color: 'green', size: '20px' }}
>
<AiFillFileExcel />
</IconContext.Provider>
</div>
</td>
<td
style={{
width: '50px',
textAlign: 'center',
visibility: MasterData.referencia
? 'visible'
: 'hidden'
}}
>
<div
onClick={() => {
setIDFactura(MasterData.id)
setShowModalAnswerFile(true)
}}
>
<IconContext.Provider
value={{ color: 'orange', size: '20px' }}
>
<AiFillFileExcel />
</IconContext.Provider>
</div>
</td>
<td
style={{
width: '50px',
textAlign: 'center',
visibility: MasterData.referencia
? 'visible'
: 'hidden'
}}
>
<div
onClick={() => {
downloadNoPartes(
MasterData.id,
MasterData.invoiceNumber
)
}}
>
<IconContext.Provider
value={{ color: 'blue', size: '20px' }}
>
<AiFillFileExcel />
</IconContext.Provider>
</div>
</td>
<td style={{ width: '100px', textAlign: 'center' }}>
{MasterData.referencia}
</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={{ textAlign: 'center' }}>
{MasterData.fPago.substring(0,10)}
</td>
<td style={{ textAlign: 'center', width:'100px' }}>
{MasterData.patente}
</td>
<td style={{ textAlign: 'center', width:'60px' }}>
{MasterData.aduana}
</td>
<td style={{ textAlign: 'center', width:'100px' }}>
{MasterData.pedimento}
</td>
</tr>
</>
)
})
: null}
</tbody>
</Table>
</div>
</Card.Body>
</Card>
<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>
<Modal
show={ShowModalAnswerFile}
onHide={() => {
setShowModalAnswerFile(false)
}}
size={'sm'}
dialogClassName={'modal-50w'}
>
<Modal.Body>
<div style={{ height: '330px' }}>
<Row style={{ paddingTop: '15px' }}>
<Col></Col>
<Col xs={10} style={{ textAlign: 'center' }}>
<MFileManager
IDTrafico={IDFactura}
Proceso={IDProcess}
showPreview={3}
canEdit={false}
Leyenda="Lista de archivos de respuesta de Amazon"
/>
</Col>
<Col></Col>
</Row>
</div>
</Modal.Body>
</Modal>
<MsgInformativo
show={show}
msg={msg}
header={header}
msgColor={msgColor}
closeToast={() => {
setShowMsg(false)
}}
/>
</div>
);
}

@ -50,6 +50,7 @@ import RptOperaciones from './Components/Reportes/RptOperaciones'
import RptRelacionMission from './Components/GEMCO/Facturacion/Anexo/RptRelacionMission'
import RptRelacionAlen from './Components/GEMCO/Facturacion/Anexo/RptRelacionAlen'
import RptCasaCuervoCOVEs from './Components/Clientes/CasaCuervo/Reportes/RptCasaCuervoCOVEs'
import RptAmazonInvoiceStatus from './Components/Clientes/Amazon/Reportes/Estatus/RtpAmazonInvoiceStatus'
require (`./css/${process.env.REACT_APP_ENVIRONMENT}-home.css`)
function PageNotFound() {
@ -186,6 +187,10 @@ ReactDOM.render(
<Route
path="/RptCasaCuervoCOVEs"
element={<RptCasaCuervoCOVEs />}
/>
<Route
path="/RptAmazonInvoiceStatus"
element={<RptAmazonInvoiceStatus />}
/>
<Route path="*" element={<PageNotFound />} />
</Route>

Loading…
Cancel
Save