|
|
@ -11,7 +11,7 @@ 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 { FaAmazon, FaFileExcel } from 'react-icons/fa' |
|
|
|
import { FaAmazon } 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' |
|
|
@ -24,12 +24,20 @@ import { |
|
|
|
// Redux
|
|
|
|
// Redux
|
|
|
|
import { useDispatch, useSelector } from 'react-redux' |
|
|
|
import { useDispatch, useSelector } from 'react-redux' |
|
|
|
import RtpAmazonPendingClasificationInvoicesDetail from './RptAmazonPendingClasificationInvoicesDetail' |
|
|
|
import RtpAmazonPendingClasificationInvoicesDetail from './RptAmazonPendingClasificationInvoicesDetail' |
|
|
|
import { AiTwotoneFileExcel } from 'react-icons/ai' |
|
|
|
import ClasificatorAssign from './ClasificatorAssign' |
|
|
|
export interface IRtpAmazonPendingInvoicesProps {} |
|
|
|
export interface IRtpAmazonPendingInvoicesProps {} |
|
|
|
|
|
|
|
|
|
|
|
export default function RtpAmazonPendingInvoices( |
|
|
|
export default function RtpAmazonPendingInvoices( |
|
|
|
props: IRtpAmazonPendingInvoicesProps |
|
|
|
props: IRtpAmazonPendingInvoicesProps |
|
|
|
) { |
|
|
|
) { |
|
|
|
|
|
|
|
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 dispatch = useDispatch() |
|
|
|
const mInvoices = useSelector( |
|
|
|
const mInvoices = useSelector( |
|
|
|
(state: RootState) => state.AmazonInvoices.Invoice |
|
|
|
(state: RootState) => state.AmazonInvoices.Invoice |
|
|
@ -42,14 +50,14 @@ export default function RtpAmazonPendingInvoices( |
|
|
|
const [msg, setMsg] = useState('') |
|
|
|
const [msg, setMsg] = useState('') |
|
|
|
const msgColor = 'primary' |
|
|
|
const msgColor = 'primary' |
|
|
|
|
|
|
|
|
|
|
|
function currentDate(days: number): string { |
|
|
|
/* function currentDate(days: number): string { |
|
|
|
var today = new Date() |
|
|
|
var today = new Date() |
|
|
|
today.setDate(today.getDate() + days) |
|
|
|
today.setDate(today.getDate() + days) |
|
|
|
var dd = String(today.getDate()).padStart(2, '0') |
|
|
|
var dd = String(today.getDate()).padStart(2, '0') |
|
|
|
var mm = String(today.getMonth() + 1).padStart(2, '0') |
|
|
|
var mm = String(today.getMonth() + 1).padStart(2, '0') |
|
|
|
var yyyy = today.getFullYear() |
|
|
|
var yyyy = today.getFullYear() |
|
|
|
return yyyy + '-' + mm + '-' + dd |
|
|
|
return yyyy + '-' + mm + '-' + dd |
|
|
|
} |
|
|
|
} */ |
|
|
|
|
|
|
|
|
|
|
|
const loadReport = () => { |
|
|
|
const loadReport = () => { |
|
|
|
DSAmazon.AmazonPendingClasificationInvoiceGET() |
|
|
|
DSAmazon.AmazonPendingClasificationInvoiceGET() |
|
|
@ -88,7 +96,7 @@ export default function RtpAmazonPendingInvoices( |
|
|
|
.catch((e: Error) => {}) |
|
|
|
.catch((e: Error) => {}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const downloadExceptionsFile = (id: number) => { |
|
|
|
/* const downloadExceptionsFile = (id: number) => { |
|
|
|
DSAmazon.SePuedeTerminardeClasificarFactura(id) |
|
|
|
DSAmazon.SePuedeTerminardeClasificarFactura(id) |
|
|
|
.then((response) => {}) |
|
|
|
.then((response) => {}) |
|
|
|
.catch((e: Error) => {}) |
|
|
|
.catch((e: Error) => {}) |
|
|
@ -112,10 +120,11 @@ export default function RtpAmazonPendingInvoices( |
|
|
|
setShowMsg(true) |
|
|
|
setShowMsg(true) |
|
|
|
return |
|
|
|
return |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} */ |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
useEffect(() => { |
|
|
|
loadReport() |
|
|
|
loadReport() |
|
|
|
|
|
|
|
console.log('Usuario=' + Usuario) |
|
|
|
}, []) |
|
|
|
}, []) |
|
|
|
|
|
|
|
|
|
|
|
const changeToggle = (row: I2096Headers) => { |
|
|
|
const changeToggle = (row: I2096Headers) => { |
|
|
@ -125,9 +134,9 @@ export default function RtpAmazonPendingInvoices( |
|
|
|
dispatch(updateInvoice(Obj)) |
|
|
|
dispatch(updateInvoice(Obj)) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
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 existsExeptions = (IDMaster: number) => { |
|
|
|
const existsExeptions = (IDMaster: number) => { |
|
|
|
const Exceptions = mInvoices |
|
|
|
const Exceptions = mInvoices |
|
|
@ -144,13 +153,13 @@ export default function RtpAmazonPendingInvoices( |
|
|
|
) |
|
|
|
) |
|
|
|
}) |
|
|
|
}) |
|
|
|
//console.log(JSON.stringify(Exceptions.length)+' '+IDMaster)
|
|
|
|
//console.log(JSON.stringify(Exceptions.length)+' '+IDMaster)
|
|
|
|
/* if (IDMaster === 2) { |
|
|
|
/* if (IDMaster === 2) { |
|
|
|
console.log(JSON.stringify(Exceptions)) |
|
|
|
console.log(JSON.stringify(Exceptions)) |
|
|
|
} */ |
|
|
|
} */ |
|
|
|
return Exceptions && Exceptions.length ? Exceptions[0].length : 0 |
|
|
|
return Exceptions && Exceptions.length ? Exceptions[0].length : 0 |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const invoiceIncomplete = (IDMaster: number) => { |
|
|
|
/* const invoiceIncomplete = (IDMaster: number) => { |
|
|
|
let itemsChecked = 0 |
|
|
|
let itemsChecked = 0 |
|
|
|
mInvoices.forEach((invoice) => { |
|
|
|
mInvoices.forEach((invoice) => { |
|
|
|
invoice.detail.forEach((det) => { |
|
|
|
invoice.detail.forEach((det) => { |
|
|
@ -168,62 +177,62 @@ export default function RtpAmazonPendingInvoices( |
|
|
|
//console.log(JSON.stringify(Exceptions.length)+' '+IDMaster)
|
|
|
|
//console.log(JSON.stringify(Exceptions.length)+' '+IDMaster)
|
|
|
|
console.log(IDMaster + ' ' + itemsChecked + ' ' + totItems) |
|
|
|
console.log(IDMaster + ' ' + itemsChecked + ' ' + totItems) |
|
|
|
return itemsChecked !== totItems |
|
|
|
return itemsChecked !== totItems |
|
|
|
} |
|
|
|
} */ |
|
|
|
|
|
|
|
|
|
|
|
const facturaTerminada = (row: I2096Headers) => { |
|
|
|
const facturaTerminada = (row: I2096Headers) => { |
|
|
|
if (!existsExeptions(row.id)) { |
|
|
|
if (!existsExeptions(row.id)) { |
|
|
|
DSAmazon.SePuedeTerminardeClasificarFactura(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) |
|
|
|
setShowModal(true) |
|
|
|
setShowModal(true) |
|
|
|
return |
|
|
|
return |
|
|
|
} 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 |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
.catch((e: Error) => { |
|
|
|
|
|
|
|
setIDFactura(0) |
|
|
|
|
|
|
|
setHeader('Error') |
|
|
|
|
|
|
|
setMsg('Ocurrio un error') |
|
|
|
|
|
|
|
setShowMsg(true) |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
DSAmazon.SePuedeTerminardeClasificarFacturaEsperandoRespuesta(row.id) |
|
|
|
DSAmazon.SePuedeTerminardeClasificarFacturaEsperandoRespuesta(row.id) |
|
|
|
.then((response) => { |
|
|
|
.then((response) => { |
|
|
|
if (response.data.respuesta.includes('lista')) { |
|
|
|
if (response.data.respuesta.includes('lista')) { |
|
|
|
setIDFactura(row.id) |
|
|
|
setIDFactura(row.id) |
|
|
|
setShowModalW(true) |
|
|
|
setShowModalW(true) |
|
|
|
return |
|
|
|
return |
|
|
|
} 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 |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
.catch((e: Error) => { |
|
|
|
|
|
|
|
setIDFactura(0) |
|
|
|
|
|
|
|
setHeader('Error') |
|
|
|
|
|
|
|
setMsg('Ocurrio un error') |
|
|
|
|
|
|
|
setShowMsg(true) |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
const send2WaitingProcess = (id: number) => { |
|
|
|
const send2WaitingProcess = (id: number) => { |
|
|
|
DSAmazon.EnviaEsperaRespuestaAmazon(id) |
|
|
|
DSAmazon.EnviaEsperaRespuestaAmazon(id) |
|
|
|
.then((response) => { |
|
|
|
.then((response) => { |
|
|
|
setShowModalW(false) |
|
|
|
setShowModalW(false) |
|
|
|
loadReport() |
|
|
|
loadReport() |
|
|
|
}) |
|
|
|
}) |
|
|
|
.catch((e: Error) => {}) |
|
|
|
.catch((e: Error) => {}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
@ -258,7 +267,6 @@ export default function RtpAmazonPendingInvoices( |
|
|
|
<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> |
|
|
@ -270,53 +278,63 @@ export default function RtpAmazonPendingInvoices( |
|
|
|
<th style={{ width: '100px' }}>Tot Charge or allowance</th> |
|
|
|
<th style={{ width: '100px' }}>Tot Charge or allowance</th> |
|
|
|
<th style={{ width: '100px' }}>Tot currency ISO code</th> |
|
|
|
<th style={{ width: '100px' }}>Tot currency ISO code</th> |
|
|
|
<th style={{ width: '100px' }}>Tot Monetary amount</th> |
|
|
|
<th style={{ width: '100px' }}>Tot Monetary amount</th> |
|
|
|
<th style={{ width: '500px' }}>Total de partidas</th> |
|
|
|
<th style={{ width: '250px' }}>Total de partidas</th> |
|
|
|
|
|
|
|
<th style={{ width: '250px' }}>Asignado</th> |
|
|
|
</tr> |
|
|
|
</tr> |
|
|
|
</thead> |
|
|
|
</thead> |
|
|
|
<tbody> |
|
|
|
<tbody> |
|
|
|
{mInvoices |
|
|
|
{mInvoices |
|
|
|
? mInvoices.map((MasterData) => { |
|
|
|
? mInvoices |
|
|
|
return ( |
|
|
|
.filter((a) => { |
|
|
|
<> |
|
|
|
if ( |
|
|
|
<tr |
|
|
|
a.clasificador === parseInt(Usuario) && |
|
|
|
style={{ cursor: 'pointer' }} |
|
|
|
Perfil !== 'Clasificador lider' |
|
|
|
className={ |
|
|
|
) { |
|
|
|
MasterData.max === true |
|
|
|
return a |
|
|
|
? 'masterSelected' |
|
|
|
} else if ( ["Clasificador lider", "Administrador"].includes(Perfil)) {return a} |
|
|
|
: 'normalSelected' |
|
|
|
}) |
|
|
|
} |
|
|
|
.map((MasterData) => { |
|
|
|
> |
|
|
|
return ( |
|
|
|
<td |
|
|
|
<> |
|
|
|
style={{ textAlign: 'left' }} |
|
|
|
<tr |
|
|
|
|
|
|
|
style={{ cursor: 'pointer' }} |
|
|
|
className={ |
|
|
|
className={ |
|
|
|
MasterData.max === true |
|
|
|
MasterData.max === true |
|
|
|
? 'masterSelected' |
|
|
|
? 'masterSelected' |
|
|
|
: 'normalSelected' |
|
|
|
: 'normalSelected' |
|
|
|
} |
|
|
|
} |
|
|
|
key={MasterData.id} |
|
|
|
|
|
|
|
onClick={() => { |
|
|
|
|
|
|
|
changeToggle(MasterData) |
|
|
|
|
|
|
|
}} |
|
|
|
|
|
|
|
> |
|
|
|
> |
|
|
|
{MasterData.max === true ? ( |
|
|
|
<td |
|
|
|
<IconContext.Provider |
|
|
|
style={{ textAlign: 'left' }} |
|
|
|
value={{ color: 'blue', size: '15px' }} |
|
|
|
className={ |
|
|
|
> |
|
|
|
MasterData.max === true |
|
|
|
<BsChevronDown /> |
|
|
|
? 'masterSelected' |
|
|
|
</IconContext.Provider> |
|
|
|
: 'normalSelected' |
|
|
|
) : ( |
|
|
|
} |
|
|
|
<IconContext.Provider |
|
|
|
key={MasterData.id} |
|
|
|
value={{ color: 'blue', size: '15px' }} |
|
|
|
onClick={() => { |
|
|
|
> |
|
|
|
changeToggle(MasterData) |
|
|
|
<BsChevronRight /> |
|
|
|
}} |
|
|
|
</IconContext.Provider> |
|
|
|
> |
|
|
|
)} |
|
|
|
{MasterData.max === true ? ( |
|
|
|
</td> |
|
|
|
<IconContext.Provider |
|
|
|
<td>{MasterData.id}</td> |
|
|
|
value={{ color: 'blue', size: '15px' }} |
|
|
|
<td></td> |
|
|
|
> |
|
|
|
<td> |
|
|
|
<BsChevronDown /> |
|
|
|
<FormCheck |
|
|
|
</IconContext.Provider> |
|
|
|
/* style={{ |
|
|
|
) : ( |
|
|
|
|
|
|
|
<IconContext.Provider |
|
|
|
|
|
|
|
value={{ color: 'blue', size: '15px' }} |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<BsChevronRight /> |
|
|
|
|
|
|
|
</IconContext.Provider> |
|
|
|
|
|
|
|
)} |
|
|
|
|
|
|
|
</td> |
|
|
|
|
|
|
|
<td>{MasterData.id}</td> |
|
|
|
|
|
|
|
<td></td> |
|
|
|
|
|
|
|
<td> |
|
|
|
|
|
|
|
<FormCheck |
|
|
|
|
|
|
|
/* style={{ |
|
|
|
visibility: |
|
|
|
visibility: |
|
|
|
(existsExeptions(MasterData.id) > 0) && invoiceIncomplete( |
|
|
|
(existsExeptions(MasterData.id) > 0) && invoiceIncomplete( |
|
|
|
MasterData.id |
|
|
|
MasterData.id |
|
|
@ -324,335 +342,350 @@ export default function RtpAmazonPendingInvoices( |
|
|
|
? 'hidden' |
|
|
|
? 'hidden' |
|
|
|
: 'visible' |
|
|
|
: 'visible' |
|
|
|
}} */ |
|
|
|
}} */ |
|
|
|
id="switchEnabled" |
|
|
|
id="switchEnabled" |
|
|
|
type="switch" |
|
|
|
type="switch" |
|
|
|
checked={false} |
|
|
|
checked={false} |
|
|
|
onChange={() => { |
|
|
|
onChange={() => { |
|
|
|
facturaTerminada(MasterData) |
|
|
|
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> |
|
|
|
|
|
|
|
<td |
|
|
|
|
|
|
|
style={{ |
|
|
|
|
|
|
|
fontWeight: 'bold', |
|
|
|
|
|
|
|
textAlign: 'center' |
|
|
|
}} |
|
|
|
}} |
|
|
|
label="" |
|
|
|
> |
|
|
|
/> |
|
|
|
{mInvoices |
|
|
|
</td> |
|
|
|
.filter((value) => value.id === MasterData.id) |
|
|
|
<td style={{ width: '80px', textAlign: 'center' }}> |
|
|
|
.map((row) => { |
|
|
|
{MasterData.commercialInvoiceDate} |
|
|
|
return row.detail.length |
|
|
|
</td> |
|
|
|
})} |
|
|
|
<td style={{ width: '150px' }}> |
|
|
|
</td> |
|
|
|
{MasterData.invoiceNumber} |
|
|
|
<td> |
|
|
|
</td> |
|
|
|
{' '} |
|
|
|
<td style={{ width: '50px', textAlign: 'center' }}> |
|
|
|
{/* Componente: Asigna clasificador */} |
|
|
|
{MasterData.name} |
|
|
|
{/* {Perfil==='Clasificador lider' ? 'Modifica' : 'NO MODIFICA'} */} |
|
|
|
</td> |
|
|
|
<ClasificatorAssign |
|
|
|
<td style={{ width: '100px', textAlign: 'center' }}> |
|
|
|
Disabled={Perfil !== 'Clasificador lider'} |
|
|
|
{MasterData.incoterms} |
|
|
|
Invoice={MasterData} |
|
|
|
</td> |
|
|
|
/> |
|
|
|
<td style={{ textAlign: 'center' }}> |
|
|
|
</td> |
|
|
|
{MasterData.totalInvoiceQuantityUnitOfMeasure} |
|
|
|
</tr> |
|
|
|
</td> |
|
|
|
{MasterData.max ? ( |
|
|
|
<td style={{ textAlign: 'center' }}> |
|
|
|
<tr |
|
|
|
{MasterData.totalInvoiceQuantity} |
|
|
|
className={ |
|
|
|
</td> |
|
|
|
MasterData.max === true |
|
|
|
<td style={{ textAlign: 'center' }}> |
|
|
|
? 'masterSelected2' |
|
|
|
{MasterData.totalInvoiceWeightUnitOfMeasure} |
|
|
|
: 'normalSelected2' |
|
|
|
</td> |
|
|
|
} |
|
|
|
<td style={{ textAlign: 'center' }}> |
|
|
|
> |
|
|
|
{MasterData.totalInvoiceWeight} |
|
|
|
<th colSpan={17}> |
|
|
|
</td> |
|
|
|
<table |
|
|
|
<td style={{ textAlign: 'center' }}> |
|
|
|
className="childTable" |
|
|
|
{MasterData.totalInvoiceValueChargeOrAllowance} |
|
|
|
style={{ width: '1450px' }} |
|
|
|
</td> |
|
|
|
> |
|
|
|
<td style={{ textAlign: 'center' }}> |
|
|
|
<thead> |
|
|
|
{MasterData.totalInvoiceValueCurrencyISOCode} |
|
|
|
<tr> |
|
|
|
</td> |
|
|
|
<th |
|
|
|
<td style={{ textAlign: 'center' }}> |
|
|
|
style={{ |
|
|
|
{MasterData.totalInvoiceValueMonetaryAmount} |
|
|
|
width: '50px', |
|
|
|
</td> |
|
|
|
backgroundColor: '#FFFFFF', |
|
|
|
<td |
|
|
|
color: '#346288' |
|
|
|
style={{ |
|
|
|
}} |
|
|
|
fontWeight: 'bold', |
|
|
|
></th> |
|
|
|
textAlign: 'center' |
|
|
|
<th |
|
|
|
}} |
|
|
|
style={{ |
|
|
|
> |
|
|
|
width: '100px', |
|
|
|
{mInvoices |
|
|
|
backgroundColor: '#D3E0EA', |
|
|
|
.filter((value) => value.id === MasterData.id) |
|
|
|
color: '#346288' |
|
|
|
.map((row) => { |
|
|
|
}} |
|
|
|
return row.detail.length |
|
|
|
> |
|
|
|
})} |
|
|
|
Item Id |
|
|
|
</td> |
|
|
|
</th> |
|
|
|
</tr> |
|
|
|
<th |
|
|
|
{MasterData.max ? ( |
|
|
|
style={{ |
|
|
|
<tr |
|
|
|
width: '400px', |
|
|
|
className={ |
|
|
|
backgroundColor: '#D3E0EA', |
|
|
|
MasterData.max === true |
|
|
|
color: '#346288' |
|
|
|
? 'masterSelected2' |
|
|
|
}} |
|
|
|
: 'normalSelected2' |
|
|
|
> |
|
|
|
} |
|
|
|
Item Description |
|
|
|
> |
|
|
|
</th> |
|
|
|
<th colSpan={17}> |
|
|
|
<th |
|
|
|
<table |
|
|
|
style={{ |
|
|
|
className="childTable" |
|
|
|
width: '120px', |
|
|
|
style={{ width: '1450px' }} |
|
|
|
backgroundColor: '#D3E0EA', |
|
|
|
> |
|
|
|
color: '#346288' |
|
|
|
<thead> |
|
|
|
}} |
|
|
|
<tr> |
|
|
|
> |
|
|
|
<th |
|
|
|
Pedimento Description |
|
|
|
style={{ |
|
|
|
</th> |
|
|
|
width: '50px', |
|
|
|
<th |
|
|
|
backgroundColor: '#FFFFFF', |
|
|
|
style={{ |
|
|
|
color: '#346288' |
|
|
|
width: '200px', |
|
|
|
}} |
|
|
|
backgroundColor: '#D3E0EA', |
|
|
|
></th> |
|
|
|
color: '#346288', |
|
|
|
<th |
|
|
|
textAlign: 'center' |
|
|
|
style={{ |
|
|
|
}} |
|
|
|
width: '100px', |
|
|
|
> |
|
|
|
backgroundColor: '#D3E0EA', |
|
|
|
Destination HTS Code |
|
|
|
color: '#346288' |
|
|
|
</th> |
|
|
|
}} |
|
|
|
<th |
|
|
|
> |
|
|
|
style={{ |
|
|
|
Item Id |
|
|
|
width: '120px', |
|
|
|
</th> |
|
|
|
backgroundColor: '#D3E0EA', |
|
|
|
<th |
|
|
|
color: '#346288', |
|
|
|
style={{ |
|
|
|
textAlign: 'center' |
|
|
|
width: '400px', |
|
|
|
}} |
|
|
|
backgroundColor: '#D3E0EA', |
|
|
|
> |
|
|
|
color: '#346288' |
|
|
|
Valida |
|
|
|
}} |
|
|
|
</th> |
|
|
|
> |
|
|
|
<th |
|
|
|
Item Description |
|
|
|
style={{ |
|
|
|
</th> |
|
|
|
width: '120px', |
|
|
|
<th |
|
|
|
backgroundColor: '#D3E0EA', |
|
|
|
style={{ |
|
|
|
color: '#346288', |
|
|
|
width: '120px', |
|
|
|
textAlign: 'center' |
|
|
|
backgroundColor: '#D3E0EA', |
|
|
|
}} |
|
|
|
color: '#346288' |
|
|
|
> |
|
|
|
}} |
|
|
|
Confirme fraccion |
|
|
|
> |
|
|
|
</th> |
|
|
|
Pedimento Description |
|
|
|
<th |
|
|
|
</th> |
|
|
|
style={{ |
|
|
|
<th |
|
|
|
width: '120px', |
|
|
|
style={{ |
|
|
|
backgroundColor: '#D3E0EA', |
|
|
|
width: '200px', |
|
|
|
color: '#346288', |
|
|
|
backgroundColor: '#D3E0EA', |
|
|
|
textAlign: 'center' |
|
|
|
color: '#346288', |
|
|
|
}} |
|
|
|
textAlign: 'center' |
|
|
|
> |
|
|
|
}} |
|
|
|
Fraccion GEMCO |
|
|
|
> |
|
|
|
</th> |
|
|
|
Destination HTS Code |
|
|
|
<th |
|
|
|
</th> |
|
|
|
style={{ |
|
|
|
<th |
|
|
|
width: '120px', |
|
|
|
style={{ |
|
|
|
backgroundColor: '#D3E0EA', |
|
|
|
width: '120px', |
|
|
|
color: '#346288', |
|
|
|
backgroundColor: '#D3E0EA', |
|
|
|
textAlign: 'center' |
|
|
|
color: '#346288', |
|
|
|
}} |
|
|
|
textAlign: 'center' |
|
|
|
> |
|
|
|
}} |
|
|
|
Confirme descripcion |
|
|
|
> |
|
|
|
</th> |
|
|
|
Valida |
|
|
|
<th |
|
|
|
</th> |
|
|
|
style={{ |
|
|
|
<th |
|
|
|
width: '70px', |
|
|
|
style={{ |
|
|
|
backgroundColor: '#D3E0EA', |
|
|
|
width: '120px', |
|
|
|
color: '#346288', |
|
|
|
backgroundColor: '#D3E0EA', |
|
|
|
textAlign: 'center' |
|
|
|
color: '#346288', |
|
|
|
}} |
|
|
|
textAlign: 'center' |
|
|
|
> |
|
|
|
}} |
|
|
|
Descripcion GEMCO |
|
|
|
> |
|
|
|
</th> |
|
|
|
Confirme fraccion |
|
|
|
<th |
|
|
|
</th> |
|
|
|
style={{ |
|
|
|
<th |
|
|
|
width: '70px', |
|
|
|
style={{ |
|
|
|
backgroundColor: '#D3E0EA', |
|
|
|
width: '120px', |
|
|
|
color: '#346288', |
|
|
|
backgroundColor: '#D3E0EA', |
|
|
|
textAlign: 'center' |
|
|
|
color: '#346288', |
|
|
|
}} |
|
|
|
textAlign: 'center' |
|
|
|
> |
|
|
|
}} |
|
|
|
Country of Origin |
|
|
|
> |
|
|
|
</th> |
|
|
|
Fraccion GEMCO |
|
|
|
<th |
|
|
|
</th> |
|
|
|
style={{ |
|
|
|
<th |
|
|
|
width: '70px', |
|
|
|
style={{ |
|
|
|
backgroundColor: '#D3E0EA', |
|
|
|
width: '120px', |
|
|
|
color: '#346288' |
|
|
|
backgroundColor: '#D3E0EA', |
|
|
|
}} |
|
|
|
color: '#346288', |
|
|
|
> |
|
|
|
textAlign: 'center' |
|
|
|
ProductGroup |
|
|
|
}} |
|
|
|
</th> |
|
|
|
> |
|
|
|
<th |
|
|
|
Confirme descripcion |
|
|
|
style={{ |
|
|
|
</th> |
|
|
|
width: '70px', |
|
|
|
<th |
|
|
|
backgroundColor: '#D3E0EA', |
|
|
|
style={{ |
|
|
|
color: '#346288' |
|
|
|
width: '70px', |
|
|
|
}} |
|
|
|
backgroundColor: '#D3E0EA', |
|
|
|
> |
|
|
|
color: '#346288', |
|
|
|
Brand |
|
|
|
textAlign: 'center' |
|
|
|
</th> |
|
|
|
}} |
|
|
|
<th |
|
|
|
> |
|
|
|
style={{ |
|
|
|
Descripcion GEMCO |
|
|
|
width: '70px', |
|
|
|
</th> |
|
|
|
backgroundColor: '#D3E0EA', |
|
|
|
<th |
|
|
|
color: '#346288' |
|
|
|
style={{ |
|
|
|
}} |
|
|
|
width: '70px', |
|
|
|
> |
|
|
|
backgroundColor: '#D3E0EA', |
|
|
|
Model |
|
|
|
color: '#346288', |
|
|
|
</th> |
|
|
|
textAlign: 'center' |
|
|
|
<th |
|
|
|
}} |
|
|
|
style={{ |
|
|
|
> |
|
|
|
width: '70px', |
|
|
|
Country of Origin |
|
|
|
backgroundColor: '#D3E0EA', |
|
|
|
</th> |
|
|
|
color: '#346288' |
|
|
|
<th |
|
|
|
}} |
|
|
|
style={{ |
|
|
|
> |
|
|
|
width: '70px', |
|
|
|
Unit Measure |
|
|
|
backgroundColor: '#D3E0EA', |
|
|
|
</th> |
|
|
|
color: '#346288' |
|
|
|
<th |
|
|
|
}} |
|
|
|
style={{ |
|
|
|
> |
|
|
|
width: '70px', |
|
|
|
ProductGroup |
|
|
|
backgroundColor: '#D3E0EA', |
|
|
|
</th> |
|
|
|
color: '#346288' |
|
|
|
<th |
|
|
|
}} |
|
|
|
style={{ |
|
|
|
> |
|
|
|
width: '70px', |
|
|
|
Qty Shipped |
|
|
|
backgroundColor: '#D3E0EA', |
|
|
|
</th> |
|
|
|
color: '#346288' |
|
|
|
<th |
|
|
|
}} |
|
|
|
style={{ |
|
|
|
> |
|
|
|
width: '70px', |
|
|
|
Brand |
|
|
|
backgroundColor: '#D3E0EA', |
|
|
|
</th> |
|
|
|
color: '#346288' |
|
|
|
<th |
|
|
|
}} |
|
|
|
style={{ |
|
|
|
> |
|
|
|
width: '70px', |
|
|
|
Unit Of measure |
|
|
|
backgroundColor: '#D3E0EA', |
|
|
|
</th> |
|
|
|
color: '#346288' |
|
|
|
<th |
|
|
|
}} |
|
|
|
style={{ |
|
|
|
> |
|
|
|
width: '70px', |
|
|
|
Model |
|
|
|
backgroundColor: '#D3E0EA', |
|
|
|
</th> |
|
|
|
color: '#346288' |
|
|
|
<th |
|
|
|
}} |
|
|
|
style={{ |
|
|
|
> |
|
|
|
width: '70px', |
|
|
|
Unit Net Weight |
|
|
|
backgroundColor: '#D3E0EA', |
|
|
|
</th> |
|
|
|
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 |
|
|
|
<th |
|
|
|
style={{ |
|
|
|
style={{ |
|
|
|
width: '70px', |
|
|
|
width: '70px', |
|
|
|
backgroundColor: '#D3E0EA', |
|
|
|
backgroundColor: '#D3E0EA', |
|
|
|
color: '#346288' |
|
|
|
color: '#346288' |
|
|
|
}} |
|
|
|
}} |
|
|
|
> |
|
|
|
> |
|
|
|
Unit Cost |
|
|
|
Unit Cost |
|
|
|
</th> |
|
|
|
</th> |
|
|
|
<th |
|
|
|
<th |
|
|
|
style={{ |
|
|
|
style={{ |
|
|
|
width: '70px', |
|
|
|
width: '70px', |
|
|
|
backgroundColor: '#D3E0EA', |
|
|
|
backgroundColor: '#D3E0EA', |
|
|
|
color: '#346288' |
|
|
|
color: '#346288' |
|
|
|
}} |
|
|
|
}} |
|
|
|
> |
|
|
|
> |
|
|
|
Total value |
|
|
|
Total value |
|
|
|
</th> |
|
|
|
</th> |
|
|
|
<th |
|
|
|
<th |
|
|
|
style={{ |
|
|
|
style={{ |
|
|
|
width: '70px', |
|
|
|
width: '70px', |
|
|
|
backgroundColor: '#D3E0EA', |
|
|
|
backgroundColor: '#D3E0EA', |
|
|
|
color: '#346288' |
|
|
|
color: '#346288' |
|
|
|
}} |
|
|
|
}} |
|
|
|
> |
|
|
|
> |
|
|
|
Autorizado |
|
|
|
Autorizado |
|
|
|
</th> |
|
|
|
</th> |
|
|
|
<th |
|
|
|
<th |
|
|
|
style={{ |
|
|
|
style={{ |
|
|
|
width: '70px', |
|
|
|
width: '70px', |
|
|
|
backgroundColor: '#D3E0EA', |
|
|
|
backgroundColor: '#D3E0EA', |
|
|
|
color: '#346288' |
|
|
|
color: '#346288' |
|
|
|
}} |
|
|
|
}} |
|
|
|
> |
|
|
|
> |
|
|
|
RN |
|
|
|
RN |
|
|
|
</th> |
|
|
|
</th> |
|
|
|
<th |
|
|
|
<th |
|
|
|
style={{ |
|
|
|
style={{ |
|
|
|
width: '70px', |
|
|
|
width: '70px', |
|
|
|
backgroundColor: '#D3E0EA', |
|
|
|
backgroundColor: '#D3E0EA', |
|
|
|
color: '#346288' |
|
|
|
color: '#346288' |
|
|
|
}} |
|
|
|
}} |
|
|
|
> |
|
|
|
> |
|
|
|
Comm |
|
|
|
Comm |
|
|
|
</th> |
|
|
|
</th> |
|
|
|
<th |
|
|
|
<th |
|
|
|
style={{ |
|
|
|
style={{ |
|
|
|
width: '70px', |
|
|
|
width: '70px', |
|
|
|
backgroundColor: '#D3E0EA', |
|
|
|
backgroundColor: '#D3E0EA', |
|
|
|
color: '#346288' |
|
|
|
color: '#346288' |
|
|
|
}} |
|
|
|
}} |
|
|
|
> |
|
|
|
> |
|
|
|
Chk |
|
|
|
Chk |
|
|
|
</th> |
|
|
|
</th> |
|
|
|
</tr> |
|
|
|
</tr> |
|
|
|
</thead> |
|
|
|
</thead> |
|
|
|
<tbody> |
|
|
|
<tbody> |
|
|
|
{mInvoices.map((MD) => { |
|
|
|
{mInvoices.map((MD) => { |
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<> |
|
|
|
<> |
|
|
|
{MD.detail |
|
|
|
{MD.detail |
|
|
|
.filter( |
|
|
|
.filter( |
|
|
|
(detail) => |
|
|
|
(detail) => |
|
|
|
MasterData.id === |
|
|
|
MasterData.id === |
|
|
|
detail.idHeader |
|
|
|
detail.idHeader |
|
|
|
) |
|
|
|
|
|
|
|
.map((detail) => { |
|
|
|
|
|
|
|
return ( |
|
|
|
|
|
|
|
<RtpAmazonPendingClasificationInvoicesDetail |
|
|
|
|
|
|
|
IDMaster={MasterData.id} |
|
|
|
|
|
|
|
detail={detail} |
|
|
|
|
|
|
|
Deshabilitado={ |
|
|
|
|
|
|
|
detail.destinationHTSCode |
|
|
|
|
|
|
|
.replaceAll('.', '') |
|
|
|
|
|
|
|
.trim() === |
|
|
|
|
|
|
|
detail.fraccionGEMCO |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
) |
|
|
|
) |
|
|
|
})} |
|
|
|
.map((detail) => { |
|
|
|
</> |
|
|
|
return ( |
|
|
|
) |
|
|
|
<RtpAmazonPendingClasificationInvoicesDetail |
|
|
|
})} |
|
|
|
IDMaster={MasterData.id} |
|
|
|
</tbody> |
|
|
|
detail={detail} |
|
|
|
</table> |
|
|
|
Deshabilitado={ |
|
|
|
</th> |
|
|
|
detail.destinationHTSCode |
|
|
|
</tr> |
|
|
|
.replaceAll('.', '') |
|
|
|
) : null} |
|
|
|
.trim() === |
|
|
|
</> |
|
|
|
detail.fraccionGEMCO |
|
|
|
) |
|
|
|
} |
|
|
|
}) |
|
|
|
/> |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
})} |
|
|
|
|
|
|
|
</> |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
})} |
|
|
|
|
|
|
|
</tbody> |
|
|
|
|
|
|
|
</table> |
|
|
|
|
|
|
|
</th> |
|
|
|
|
|
|
|
</tr> |
|
|
|
|
|
|
|
) : null} |
|
|
|
|
|
|
|
</> |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
}) |
|
|
|
: null} |
|
|
|
: null} |
|
|
|
</tbody> |
|
|
|
</tbody> |
|
|
|
</Table> |
|
|
|
</Table> |
|
|
@ -704,7 +737,6 @@ export default function RtpAmazonPendingInvoices( |
|
|
|
</Modal.Body> |
|
|
|
</Modal.Body> |
|
|
|
</Modal> |
|
|
|
</Modal> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Modal |
|
|
|
<Modal |
|
|
|
show={ShowModalW} |
|
|
|
show={ShowModalW} |
|
|
|
onHide={() => { |
|
|
|
onHide={() => { |
|
|
@ -719,7 +751,8 @@ export default function RtpAmazonPendingInvoices( |
|
|
|
<Col xs={1}></Col> |
|
|
|
<Col xs={1}></Col> |
|
|
|
<Col xs={10}> |
|
|
|
<Col xs={10}> |
|
|
|
<Alert key={'danger'} variant={'danger'}> |
|
|
|
<Alert key={'danger'} variant={'danger'}> |
|
|
|
La factura esta lista para enviarse al proceso de esperar respuesta de Amazon |
|
|
|
La factura esta lista para enviarse al proceso de esperar |
|
|
|
|
|
|
|
respuesta de Amazon |
|
|
|
</Alert> |
|
|
|
</Alert> |
|
|
|
</Col> |
|
|
|
</Col> |
|
|
|
<Col xs={1}></Col> |
|
|
|
<Col xs={1}></Col> |
|
|
|