diff --git a/src/Components/Clientes/Amazon/Interfaces/I2096NoParte.ts b/src/Components/Clientes/Amazon/Interfaces/I2096NoParte.ts index f7b6842..4f0378a 100644 --- a/src/Components/Clientes/Amazon/Interfaces/I2096NoParte.ts +++ b/src/Components/Clientes/Amazon/Interfaces/I2096NoParte.ts @@ -1,20 +1,18 @@ -import { string } from "yup" - export default interface I2096NoParte { - id: number, - claveCliente: number, - parte: string, - claveProveedor: number, - tipoOperacion: number, - fraccion: string, - subdivision: string, - descripcionFactura: string, - descripcionAgenteAduanal: string, - fechaConfirmacion: string, - paisOrigen: string, - unidadMedidaFactura: string, - unidadMedidaCOVE: string, - FHActualizacion: string, - usuarioActualizacion: number, - activo: number -} \ No newline at end of file + id: number + claveCliente: number + parte: string + claveProveedor: number + tipoOperacion: number + fraccion: string + subdivision: string + descripcionFactura: string + descripcionAgenteAduanal: string + fechaConfirmacion: string + paisOrigen: string + unidadMedidaFactura: string + unidadMedidaCOVE: string + FHActualizacion: string + usuarioActualizacion: number + activo: number +} diff --git a/src/Components/Clientes/Amazon/Interfaces/I2096NoParteLog.ts b/src/Components/Clientes/Amazon/Interfaces/I2096NoParteLog.ts new file mode 100644 index 0000000..de3387d --- /dev/null +++ b/src/Components/Clientes/Amazon/Interfaces/I2096NoParteLog.ts @@ -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 +} diff --git a/src/Components/Clientes/Amazon/Reportes/AmazonNoPartes.tsx b/src/Components/Clientes/Amazon/Reportes/AmazonNoPartes.tsx index 5f3d186..f5e88e4 100644 --- a/src/Components/Clientes/Amazon/Reportes/AmazonNoPartes.tsx +++ b/src/Components/Clientes/Amazon/Reportes/AmazonNoPartes.tsx @@ -17,6 +17,7 @@ import I2096PaisClave from '../Interfaces/I2096PaisClave' import DTO2096PerfilesParecidos from '../DTO/DTO2096PerfilesParecidos' import DSAmazon from '../Services/Amazon.Services' import DTO2096NoParte from '../DTO/DTO2096NoParte' +import I2096NoParteLog from '../Interfaces/I2096NoParteLog' export interface IAmazonNoPartesProps {} export function AmazonNoPartes(props: IAmazonNoPartesProps) { @@ -28,9 +29,11 @@ export function AmazonNoPartes(props: IAmazonNoPartesProps) { const stickyValue = window.localStorage.getItem('UserId') return stickyValue !== null ? JSON.parse(stickyValue) : 0 }) + const [NoParteLOG, setNoParteLOG] = useState([]) const [PaisClaves, setPaisClaves] = useState([]) const [Data, setData] = useState([]) const [ShowModal, setShowModal] = useState(false) + const [ShowModalLog, setShowModalLog] = useState(false) const [header, setHeader] = useState('') const [msgColor, setMsgColor] = useState('primary') const [show, setShowMsg] = useState(false) @@ -49,15 +52,20 @@ export function AmazonNoPartes(props: IAmazonNoPartesProps) { const [FechaInsercion, setFechaInsercion] = useState('') const [Clasificador, setClasificador] = useState('') - const openLink = (item: string) => { - window.open('https://www.amazon.com/dp/' + item) - } - const colsNoPartes = [ { name: 'id', - width: '60px', - selector: (row: I2096NoParte) => row.id, + width: '80px', + cell: (row: I2096NoParte) => ( +
{ + loadNoPartesLOG(row) + }} + > + {row.id} +
+ ), sortable: true }, { @@ -73,6 +81,7 @@ export function AmazonNoPartes(props: IAmazonNoPartesProps) { }} onClick={() => { loadData(row) + setShowModal(true) }} > @@ -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 NoAsignado = 'NO ASIGNADO' 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) => { setIDParte(row.id) setParte(row.parte) @@ -198,7 +280,6 @@ export function AmazonNoPartes(props: IAmazonNoPartesProps) { setUMF(row.unidadMedidaFactura) setFechaInsercion(row.FHActualizacion) setClasificador(getUser(row.usuarioActualizacion)) - setShowModal(true) } const loadPaisesClaves = () => { @@ -436,6 +517,41 @@ export function AmazonNoPartes(props: IAmazonNoPartesProps) { + + { + setShowModalLog(false) + }} + size={'sm'} + dialogClassName={'modal-90w'} + > + + No Parte: {Parte} + + + {/*
*/} + + + 0 + })} + /> + + + {/*
*/} +
+
- Popover right - - And here's some amazing content. It's very engaging. - right? - - - ) - return ( <> diff --git a/src/Components/Clientes/Amazon/Reportes/Clasification/WaitingAnswer/RptPendingAnswerFromAmazon.tsx b/src/Components/Clientes/Amazon/Reportes/Clasification/WaitingAnswer/RptPendingAnswerFromAmazon.tsx index a012a47..ce70a79 100644 --- a/src/Components/Clientes/Amazon/Reportes/Clasification/WaitingAnswer/RptPendingAnswerFromAmazon.tsx +++ b/src/Components/Clientes/Amazon/Reportes/Clasification/WaitingAnswer/RptPendingAnswerFromAmazon.tsx @@ -22,12 +22,13 @@ import { populateInvoices, updateInvoice } from '../../../../../../store/features/Clientes/2096/AmazonInvoices' + // Redux import { useDispatch, useSelector } from 'react-redux' import RtpPendingAnswerFromAmazonDetail from './RptPendingAnswerFromAmazonDetail' -import { AiTwotoneFileExcel } from 'react-icons/ai' -import { FiAlertCircle } from 'react-icons/fi' +import { AiFillFileUnknown, AiTwotoneFileExcel } from 'react-icons/ai' import DTO2096PerfilesParecidos from '../../../DTO/DTO2096PerfilesParecidos' +import FileManager from '../../../../../Utils/FileManager/FileManager' export interface IRptPendingAnswerFromAmazonProps {} export default function RptPendingAnswerFromAmazon( @@ -37,23 +38,20 @@ export default function RptPendingAnswerFromAmazon( const mInvoices = useSelector( (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([]) const [header, setHeader] = useState('') const [IDFactura, setIDFactura] = useState(0) + const [IDProcess, setIDProcess] = useState(25) const [show, setShowMsg] = useState(false) const [ShowModal, setShowModal] = useState(false) + const [ShowModalAnswerFile, setShowModalAnswerFile] = useState(false) const [msg, setMsg] = useState('') const msgColor = 'primary' - function currentDate(days: number): string { - var today = new Date() - today.setDate(today.getDate() + days) - var dd = String(today.getDate()).padStart(2, '0') - var mm = String(today.getMonth() + 1).padStart(2, '0') - var yyyy = today.getFullYear() - return yyyy + '-' + mm + '-' + dd - } - const loadReport = () => { DSAmazon.InvoicePendingFromAmazonGET() .then((response) => { @@ -153,7 +151,6 @@ export default function RptPendingAnswerFromAmazon( (child) => child.idHeader === IDMaster && !child.autorizado ) }) - console.log(JSON.stringify(Exceptions[0])) return Exceptions[0].length ? Exceptions[0].length : 0 } @@ -171,27 +168,40 @@ export default function RptPendingAnswerFromAmazon( return }) } - - const sePuedeTerminarFactura = (id: number) =>{ + + const sePuedeTerminarFactura = (id: number) => { setIDFactura(id) DSAmazon.SeRecibioRespuestaDeAmazon(id) - .then((response) => { - //alert(response.data.estatus) - if (response.data.estatus === 0) { - setHeader('Error') - setMsg('Verifique que todas las partidas esten verificadas por usted') - setShowMsg(true) - return - } else if (response.data.estatus === 1) { - //TerminadeClasificar() - setShowModal(true) - } else { + .then((response) => { + //alert(response.data.estatus) + if (response.data.estatus === 0) { + setHeader('Error') + setMsg('Verifique que todas las partidas esten verificadas por usted') + setShowMsg(true) + return + } else if (response.data.estatus === 1) { + //TerminadeClasificar() + setShowModal(true) + } else { + setIDFactura(0) + setHeader('Informativo') + setMsg(response.data.respuesta) + setShowMsg(true) + return + } + }) + .catch((e: Error) => { setIDFactura(0) - setHeader('Informativo') - setMsg(response.data.respuesta) + setHeader('Error') + setMsg('Ocurrio un error') setShowMsg(true) return - } + }) + } + + const relacionaIDArchivoRespuestaConFactura = (idFile : number) => { + DSAmazon.ArchivoRespuestaAmazon(IDFactura, idFile) + .then((response) => { }) .catch((e: Error) => { setIDFactura(0) @@ -244,6 +254,7 @@ export default function RptPendingAnswerFromAmazon( id + Commercial Invoice Date Invoice Number Name @@ -322,11 +333,23 @@ export default function RptPendingAnswerFromAmazon( type="switch" checked={false} onChange={() => { - sePuedeTerminarFactura(MasterData.id) + sePuedeTerminarFactura(MasterData.id) }} label="" /> + +
{ setShowModalAnswerFile(!ShowModalAnswerFile) }} + title="Archivo de respuesta" + > + + + +
+ {MasterData.commercialInvoiceDate} @@ -567,15 +590,6 @@ export default function RptPendingAnswerFromAmazon( > Unit Cost - - Total value - + + { + setShowModalAnswerFile(false) + }} + size={'sm'} + dialogClassName={'modal-50w'} + > + +
+ + + + Proporcione el archivo de respuesta de Amazon + + + + + + + + +
+
+
+ { window.open('https://www.amazon.com/dp/' + item) } - const target = React.useRef(null) const UpdateInfo = (Invoice: I2096Headers, Detail: I2096Detail[]) => { const updatedInvoice: I2096Headers = { @@ -156,7 +155,6 @@ export default function RptPendingAnswerFromAmazonDetail( comentarios: Comentarios, descripcionGEMCO: DescripcionGEMCO } - console.log(data) DSAmazon.AutorizaItemFacturaAmazon(data) .then((response) => { editArray(id, !props.detail.autorizado) @@ -170,42 +168,33 @@ export default function RptPendingAnswerFromAmazonDetail( autoriceItem(props.detail.id) }, [EstatusSwith, UserChanged]) - const popover = ( - - Popover right - - And here's some amazing content. It's very engaging. - right? - - - ) - const ColorSET = (value: number, mode: number) => { switch(mode) { - case 1: { - // Background color - if (value === 1) return '#FFFAF2' - else if (value === 2) return '#E5F7B6' - else if (value === 3) return '#E9F3FC' - break - } case 2: { - // Border color - if (value === 1) return '2px solid #F9A721' - else if (value === 2) return '2px solid green' - else if (value === 3) return '2px solid blue' - break - } case 3: { - // Color - if (value === 1) return '#5923F6' - if (value === 2) return '#000000' - if (value === 3) return 'blue' - break + case 1: { + // Background color + if (value === 1) return '#FFFAF2' + else if (value === 2) return '#E5F7B6' + else if (value === 3) return '#E9F3FC' + break + } case 2: { + // Border color + if (value === 1) return '2px solid #F9A721' + else if (value === 2) return '2px solid green' + else if (value === 3) return '2px solid blue' + break + } case 3: { + // Color + if (value === 1) return '#5923F6' + if (value === 2) return '#000000' + if (value === 3) return 'blue' + break + } } } - } return ( <> + {props.detail.confirmaFraccion === 2 ? @@ -436,14 +425,6 @@ export default function RptPendingAnswerFromAmazonDetail( > {props.detail.actualUnitCostMonetaryAmount} - - {props.detail.totalUnitValueMonetaryAmount} - - {' '} - {' '} {Comentarios}} @@ -529,7 +508,7 @@ export default function RptPendingAnswerFromAmazonDetail( )} - + : '' } ([]) const msgColor = 'primary' - function currentDate(days: number): string { - var today = new Date() - today.setDate(today.getDate() + days) - var dd = String(today.getDate()).padStart(2, '0') - var mm = String(today.getMonth() + 1).padStart(2, '0') - var yyyy = today.getFullYear() - return yyyy + '-' + mm + '-' + dd - } - const loadReport = () => { DSAmazon.AmazonLinkInvoice2TrafficGet() .then((response) => { @@ -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) => { + setWaitingDialog(true) + setWaitingMessage(' archivo PDF ') DSAmazon.PDFAmazonInvoiceGET(id) .then((response: any) => { if (response.status === 200) { @@ -115,7 +78,7 @@ export function RptAmazonLinkInvoice2Traffic( link.setAttribute('download', 'AmazonInvoice.pdf') document.body.appendChild(link) link.click() - loadReport() + setWaitingDialog(false) } }) .catch((e: Error) => { @@ -127,13 +90,14 @@ export function RptAmazonLinkInvoice2Traffic( } const downloadExcelInvoices = (Referencia: string) => { + setWaitingMessage(' archivo Excel ') DSAmazon.GETExcelInvoicesLinkByReference(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', 'FACTURAS_MODIFICA.xlsx') + link.setAttribute('download', Referencia+'_FACTURAS_MODIFICA.xlsx') document.body.appendChild(link) link.click() loadReport() @@ -148,13 +112,14 @@ export function RptAmazonLinkInvoice2Traffic( } const downloadExcelPartidas = (Referencia: string) => { + setWaitingMessage(' archivo Excel ') DSAmazon.GETAmazonExcelByReference(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', 'PARTIDAS_MODIFICA.xlsx') + link.setAttribute('download', Referencia+'_PARTIDAS_MODIFICA.xlsx') document.body.appendChild(link) link.click() loadReport() @@ -190,7 +155,6 @@ export function RptAmazonLinkInvoice2Traffic( }) ) } - console.log('Invoices=' + Invoices) } const processInvoices = () => { @@ -202,12 +166,10 @@ export function RptAmazonLinkInvoice2Traffic( setShowMsg(true) return } - //alert(Invoices) setShowModal(true) } const asociaFacturasReferencia = () => { - // alert(Invoices) const data : DTO2096LinkInvoice2Reference = { referencia: Referencia, facturas : Invoices @@ -227,9 +189,6 @@ export function RptAmazonLinkInvoice2Traffic( }) } - const openLink = (item: string) => { - window.open('https://www.amazon.com/dp/' + item) - } return (
@@ -339,7 +298,7 @@ export function RptAmazonLinkInvoice2Traffic(
- +
{downloadExcelInvoices(MasterData.referencia)}}>
- +
{downloadExcelPartidas(MasterData.referencia)}}> Item Description - - Pedimento Description - + - Destination HTS Code - - - Valida + Fraccion GEMCO - Confirme fraccion + Descripcion GEMCO - Fraccion GEMCO + Country of Origin - Confirme descripcion + ProductGroup - Descripcion GEMCO + Brand - Country of Origin + Model - ProductGroup + Unit Measure - Brand + Qty Shipped - Model + Unit of measure - Unit Measure + Unit Net Weight - Qty Shipped + Unit Cost - Unit of measure + Total value - Unit Net Weight + Sideline - Unit Cost - Total value @@ -618,7 +556,7 @@ export function RptAmazonLinkInvoice2Traffic( ) .map((detail) => { return ( - + { + setWaitingDialog(false) + }} + backdrop='static' + keyboard={false} + size='sm' + dialogClassName={'modal-50w'} + centered + > + + + + + proccessing + Generando {WaitingMessage}... + + + state.AmazonInvoices.Invoice ) 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 [header, setHeader] = useState('') const [show, setShowMsg] = useState(false) @@ -62,7 +63,7 @@ export default function RtpAmazonInvoiceTrafficDetail( const openLink = (item: string) => { 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 = { @@ -97,27 +98,9 @@ export default function RtpAmazonInvoiceTrafficDetail( detail: Detail } dispatch(updateInvoice(updatedInvoice)) - } - - const editArray = (id: number, valor: boolean) => { - const Invoice = mInvoices - .filter((el) => el.id === props.IDMaster) - .map((el) => { - return el - }) - const newDetail = Invoice[0].detail.map((el) => { - if (el.id === id) { - return { - ...el, - autorizado: valor - } - } - return el - }) - UpdateInfo(Invoice[0], newDetail) - } + } */ - const autoriceItem = (id: number) => { + /* const autoriceItem = (id: number) => { if (CumplimientoNormativo.length === 0 && EstatusSwith) { setHeader('Error') setMsg( @@ -132,29 +115,36 @@ export default function RtpAmazonInvoiceTrafficDetail( cumplimientoNormativo: CumplimientoNormativo, 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) => { - editArray(id, !props.detail.autorizado) + console.log(response.data) + //editArray(id, !props.detail.autorizado) 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) autoriceItem(props.detail.id) - }, [EstatusSwith, UserChanged]) + }, [EstatusSwith, UserChanged]) */ - const popover = ( - - Popover right - - And here's some amazing content. It's very engaging. - right? - - - ) + useEffect(() => { + if (UserChanged) setShowModal(true) + }, [EstatusSwith, UserChanged]) return ( <> @@ -180,79 +170,12 @@ export default function RtpAmazonInvoiceTrafficDetail( {props.detail.itemDescription} - - {props.detail.pedimentoDescription} - - -   {props.detail.destinationHTSCode} - - - {props.detail.validaFraccionOriginal === 0 ? ( - - - - ) : props.detail.validaFraccionOriginal === 1 ? ( - - - - ) : ( - - - - )} - - - - - - - @@ -325,7 +234,8 @@ export default function RtpAmazonInvoiceTrafficDetail( @@ -391,18 +301,11 @@ export default function RtpAmazonInvoiceTrafficDetail( - { + setEstatusSwitch(!EstatusSwith) + setUserChanged(true) + setShowModal(!EstatusSwith) + }} /> - { setShowModal(false) @@ -550,6 +463,58 @@ export default function RtpAmazonInvoiceTrafficDetail(
+
*/} + { + setShowModal(false) + }} + size={'sm'} + dialogClassName={'modal-50w'} + backdrop="static" + disableEscapeKeyDown={true} + > + +
+ + Comentarios + + {' '} + setComentarios(e.target.value)} + /> + +   + + + + + + + + + +
+
{ 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 = { @@ -95,7 +87,7 @@ export default function RptAmazonPendingTraficInvoiceDetail( dispatch(updateInvoice(updatedInvoice)) } - const editArray = (id: number, valor: boolean) => { + /* const editArray = (id: number, valor: boolean) => { const Invoice = mInvoices .filter((el) => el.id === props.IDMaster) .map((el) => { @@ -111,7 +103,7 @@ export default function RptAmazonPendingTraficInvoiceDetail( return el }) UpdateInfo(Invoice[0], newDetail) - } + } */ const ToggleSightLine = (id: number) => { const data: DTO2096SightLine = { @@ -135,19 +127,8 @@ export default function RptAmazonPendingTraficInvoiceDetail( useEffect(() => { if (UserChanged) setShowModal(true) - //ToggleSightLine(props.detail.id) }, [EstatusSwith, UserChanged]) - /* const popover = ( - - Popover right - - And here's some amazing content. It's very engaging. - right? - - - ) */ - return ( <> diff --git a/src/Components/Clientes/Amazon/Reportes/Traffic/Pending/RtpAmazonPendingTraficInvoice.tsx b/src/Components/Clientes/Amazon/Reportes/Traffic/Pending/RtpAmazonPendingTraficInvoice.tsx index 6a3fbaf..2d0ba10 100644 --- a/src/Components/Clientes/Amazon/Reportes/Traffic/Pending/RtpAmazonPendingTraficInvoice.tsx +++ b/src/Components/Clientes/Amazon/Reportes/Traffic/Pending/RtpAmazonPendingTraficInvoice.tsx @@ -41,15 +41,6 @@ export function RptAmazonPendingTraficInvoice( const [msg, setMsg] = useState('') const msgColor = 'primary' - function currentDate(days: number): string { - var today = new Date() - today.setDate(today.getDate() + days) - var dd = String(today.getDate()).padStart(2, '0') - var mm = String(today.getMonth() + 1).padStart(2, '0') - var yyyy = today.getFullYear() - return yyyy + '-' + mm + '-' + dd - } - const loadReport = () => { DSAmazon.AmazonPendingTraficInvoiceGET() .then((response) => { @@ -72,10 +63,6 @@ export function RptAmazonPendingTraficInvoice( dispatch(updateInvoice(Obj)) } - const openLink = (item: string) => { - window.open('https://www.amazon.com/dp/' + item) - } - const finishInvoice = (id: number) => { DSAmazon.SePuedeTerminarXTraficoFactura(id) .then((response) => { @@ -83,26 +70,6 @@ export function RptAmazonPendingTraficInvoice( DSAmazon.TerminaXTraficoFactura(id) .then((response) => { 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) => {}) setShowModal(false) @@ -426,7 +393,7 @@ export function RptAmazonPendingTraficInvoice( color: '#346288' }} > - Sight line + Sideline (`/AmazonInvoice/EnviaEsperaRespuestaAmazon?id=${id}`) } + ArchivoRespuestaAmazon(id: number, idFile: number) { + return http.put(`/AmazonInvoice/ArchivoRespuestaAmazon?id=${id}&idFile=${idFile}`) + } TerminaClasificarFactura(id: number) { return http.get(`/AmazonInvoice/TerminaClasificarFactura?id=${id}`) } @@ -140,6 +144,9 @@ class AmazonDataService { NoPartesUpdate(data: DTO2096NoParte) { return http.put(`/AmazonInvoice/NoPartesUpdate`, data) } + NoPartesLogGET(id: number) { + return http.get(`/AmazonInvoice/NoPartesLogGET?id=${id}`) + } PerfilesParecidosGet(Perfil: string) { return http.get(`/Usuarios/Catalogo/Usuarios/PerfilesParecidos?Perfil=${Perfil}`) }