-
+
T. Operacion
-
+
Descripcion factura
-
+
-
+
Descripcion agente aduanal
-
+
- Pais Origen
-
+ Pais Origen
+
setPaisOrigen(e.target.value)}
className="form-select form-select-sm"
- > {
- PaisClaves ? (
- PaisClaves.map((row) =>{
- return
- })
- ) : ''
- }
+ >
+ {' '}
+ {PaisClaves
+ ? PaisClaves.map((row) => {
+ return (
+
+ )
+ })
+ : ''}
-
- Unidad medida factura
-
+ Unidad medida factura
+
+ setUMF(e.target.value)}
size="sm"
/>
-
+
-
-
-
+
+
+
+
+
diff --git a/src/Components/Clientes/Amazon/Reportes/RptAmazonPendingInvoices.tsx b/src/Components/Clientes/Amazon/Reportes/RptAmazonPendingInvoices.tsx
index a9b2f17..e3b9f6b 100644
--- a/src/Components/Clientes/Amazon/Reportes/RptAmazonPendingInvoices.tsx
+++ b/src/Components/Clientes/Amazon/Reportes/RptAmazonPendingInvoices.tsx
@@ -1,5 +1,5 @@
import { useEffect, useState } from 'react'
-import { Button, Card, Col, Form, Row, Table } from 'react-bootstrap'
+import { Alert, Button, Card, Col, Form, FormCheck, Modal, Row, Table } from 'react-bootstrap'
import { IconContext } from 'react-icons'
import { BsChevronDown, BsChevronRight, BsSearch } from 'react-icons/bs'
import { FaCheckCircle, FaFileExcel, FaQuestionCircle } from 'react-icons/fa'
@@ -37,7 +37,9 @@ export default function RtpAmazonPendingInvoices(
const [Fin, setFin] = useState(currentDate(0))
const [filtro, setFiltro] = useState('')
const [header, setHeader] = useState('')
+ const [IDFactura, setIDFactura] = useState(0)
const [show, setShowMsg] = useState(false)
+ const [ShowModal, setShowModal] = useState(false)
const [msg, setMsg] = useState('')
const msgColor = 'primary'
@@ -84,7 +86,6 @@ export default function RtpAmazonPendingInvoices(
})
}
-
const downloadExceptionsFile = (id: number) => {
DSAmazon.TerminaFactura(id)
.then((response) => {})
@@ -95,7 +96,10 @@ export default function RtpAmazonPendingInvoices(
const url = window.URL.createObjectURL(new Blob([response.data]))
const link = document.createElement('a')
link.href = url
- link.setAttribute('download', 'Formato de consultas (Exceptions Handling 2021).xlsx')
+ link.setAttribute(
+ 'download',
+ 'Formato de consultas (Exceptions Handling 2021).xlsx'
+ )
document.body.appendChild(link)
link.click()
}
@@ -108,7 +112,6 @@ export default function RtpAmazonPendingInvoices(
})
}
-
useEffect(() => {
loadReport()
}, [])
@@ -132,13 +135,36 @@ export default function RtpAmazonPendingInvoices(
.map((element) => {
let newElt = Object.assign({}, element) // copies element
return newElt.detail.filter(
- (child) =>
- (child.idHeader === IDMaster) &&
- (child.autorizado) &&
- (child.destinationHTSCode.toString().replaceAll('.','') !== child.fraccionGEMCO)
+ (child) => child.idHeader === IDMaster && !child.autorizado
)
})
- return Exceptions[0].length ? Exceptions[0].length : 0
+ console.log(JSON.stringify(Exceptions[0]))
+ return Exceptions[0].length ? Exceptions[0].length : 0
+ }
+
+ const facturaTerminada = (row: I2096Headers) => {
+ DSAmazon.Se$Puede$Terminar$Factura(row.id)
+ .then((response) => {
+ if (response.data.respuesta.includes('lista')) {
+ setIDFactura(row.id)
+ setShowModal(true)
+ return
+ } else {
+ setIDFactura(0)
+ setHeader('Informativo')
+ setMsg(response.data.respuesta)
+ setShowMsg(true)
+ return
+ }
+ })
+ .catch((e: Error) => {
+ setIDFactura(0)
+ setHeader('Error')
+ setMsg('Ocurrio un error')
+ setShowMsg(true)
+ return
+ })
+
}
return (
@@ -168,14 +194,10 @@ export default function RtpAmazonPendingInvoices(
id |
|
|
+ |
Commercial Invoice Date |
Invoice Number |
Name |
- {/* Trailer Number |
- Trailer Id |
- Por Of Loading |
- Port of entry |
- Payments Terms | */}
Incoterms |
HAWB |
Qty Unit of measure |
@@ -226,12 +248,15 @@ export default function RtpAmazonPendingInvoices(
)}
+
{MasterData.id} |
{existsExeptions(MasterData.id) > 0 ? (
downloadExceptionsFile(MasterData.id)}
- title='Archivo de excepciones'
+ onClick={() =>
+ downloadExceptionsFile(MasterData.id)
+ }
+ title="Archivo de excepciones"
>
) : null}
|
+
+ {
+ facturaTerminada(MasterData)
+ }
+ }
+ label=""
+ />
+ |
{MasterData.commercialInvoiceDate}
|
{MasterData.invoiceNumber}
|
-
+ |
{MasterData.name}
|
- {/*
- {MasterData.trailerNumber}
- |
-
- {MasterData.trailerId}
- |
-
- {MasterData.porOfLoading}
- |
-
- {MasterData.portOfEntry}
- |
-
- {MasterData.paymentsTerms}
- | */}
{MasterData.incoterms}
|
@@ -357,7 +380,7 @@ export default function RtpAmazonPendingInvoices(
+ {
+ setShowModal(false)
+ }}
+ size={'sm'}
+ dialogClassName={'modal-50w'}
+ >
+
+
+
+
+
+
+ La factura esta lista para terminarse, desea terminarla?
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
{
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 updatedInvoice: I2096Headers = {
@@ -141,7 +149,8 @@ export default function RtpAmazonPendingInvoivesDetail(
}
useEffect(() => {
- if (UserChanged && EstatusSwith && !props.detail.fraccionGEMCO) autoriceItem(props.detail.id)
+ if (UserChanged && EstatusSwith && !props.detail.fraccionGEMCO)
+ autoriceItem(props.detail.id)
}, [EstatusSwith, UserChanged])
const popover = (
@@ -152,7 +161,7 @@ export default function RtpAmazonPendingInvoivesDetail(
right?
- );
+ )
return (
<>
@@ -194,11 +203,12 @@ export default function RtpAmazonPendingInvoivesDetail(
- {props.detail.destinationHTSCode}
+ {props.detail.destinationHTSCode}
|
|
@@ -378,61 +401,74 @@ export default function RtpAmazonPendingInvoivesDetail(
id="switchEnabled"
type="switch"
disabled={
- (props.detail.fraccionGEMCO===props.detail.destinationHTSCode.replaceAll('.',''))
+ props.detail.fraccionGEMCO ===
+ props.detail.destinationHTSCode.replaceAll('.', '')
}
- checked={EstatusSwith && props.detail.autorizado /* (props.detail.fraccionGEMCO===props.detail.destinationHTSCode.replace('.','')) */}
+ checked={EstatusSwith && props.detail.autorizado}
onChange={() => {
setEstatusSwitch(!EstatusSwith)
- setUserChanged(true)
+ setUserChanged(true)
setShowModal(!EstatusSwith)
}}
label=""
/>
|
- {RequerimientoNormativo}}
- >
- {({ ref, ...triggerHandler }) => (
-
- )}
- |
- {Comentarios}}
- >
- {({ ref, ...triggerHandler }) => (
-
+ |
+
-
-
-
-
-
- )}
- |
+ {' '}
+ {Comentarios}}
+ >
+ {({ ref, ...triggerHandler }) => (
+
+
+
+
+
+
+ )}
+
+
-
+
{
@@ -453,7 +489,7 @@ export default function RtpAmazonPendingInvoivesDetail(
- Reparto normativo
+ Cumplimiento normativo
{' '}
setRequerimientoNormativo(e.target.value)}
+ onChange={(e) => setComentarios(e.target.value)}
/>
diff --git a/src/Components/Clientes/Amazon/Services/Amazon.Services.ts b/src/Components/Clientes/Amazon/Services/Amazon.Services.ts
index 3ffe8d3..6b7cbde 100644
--- a/src/Components/Clientes/Amazon/Services/Amazon.Services.ts
+++ b/src/Components/Clientes/Amazon/Services/Amazon.Services.ts
@@ -7,6 +7,7 @@ import DTO2096Descripcion from '../DTO/DTO2096Descripcion'
import I2096NoParte from '../Interfaces/I2096NoParte'
import I2096PaisClave from '../Interfaces/I2096PaisClave'
import DTO2096ItemAutoriza from '../DTO/DTO2096ItemAutoriza'
+import DTORespuesta from '../../ZincInternacional/DTO/DTORespuesta'
class AmazonDataService {
GetPendingInvoice() {
@@ -51,8 +52,11 @@ class AmazonDataService {
console.log(error)
})
}
- NoPartesGet() {
- return http.get(`/AmazonInvoice/NoPartesGet`)
- }
+ NoPartesGet(Search: string) {
+ return http.get(`/AmazonInvoice/NoPartesGet?Search=${Search}`)
+ }
+ Se$Puede$Terminar$Factura(id: number) {
+ return http.get(`/AmazonInvoice/SePuedeTerminarFactura?id=${id}`)
+ }
}
export default new AmazonDataService()
|