From de7a0351d4de925b5ae570e2aa43f41c9430d190 Mon Sep 17 00:00:00 2001 From: alfonso Date: Mon, 31 Jul 2023 16:59:10 -0500 Subject: [PATCH 01/10] Added Clasification BOT --- .vscode/settings.json | 4 +- .../ComboSelect/ComboDescripcion.tsx | 5 ++ .../Components/ComboSelect/ComboFraccion.tsx | 2 +- .../RptAmazonPendingClasificationInvoices.tsx | 61 +++++++++++++++---- ...azonPendingClasificationInvoicesDetail.tsx | 44 ++++++------- .../Amazon/Services/Amazon.Services.ts | 3 + 6 files changed, 83 insertions(+), 36 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index dde7088..14ac9fb 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,3 @@ { - "workbench.colorTheme": "Abyss" -} \ No newline at end of file + "workbench.colorTheme": "Infinity Dark Theme Eye Friendly Colors" +} diff --git a/src/Components/Clientes/Amazon/Components/ComboSelect/ComboDescripcion.tsx b/src/Components/Clientes/Amazon/Components/ComboSelect/ComboDescripcion.tsx index f9720b3..f513195 100644 --- a/src/Components/Clientes/Amazon/Components/ComboSelect/ComboDescripcion.tsx +++ b/src/Components/Clientes/Amazon/Components/ComboSelect/ComboDescripcion.tsx @@ -177,6 +177,11 @@ export function ComboDescripcion(props: IComboDescripcionProps) { ) : ( '' )} + {props.Detail.validaFraccionOriginal === 5 ? ( + + ) : ( + '' + )} + ) : ( '' @@ -222,7 +223,6 @@ export function ComboFraccion(props: IComboFraccionProps) { ) : ( '' )} - {/* */} {props.Detail.validaFraccionOriginal === 3 ? ( ) : ( diff --git a/src/Components/Clientes/Amazon/Reportes/Clasification/Pending/RptAmazonPendingClasificationInvoices.tsx b/src/Components/Clientes/Amazon/Reportes/Clasification/Pending/RptAmazonPendingClasificationInvoices.tsx index 25c925a..c88351d 100644 --- a/src/Components/Clientes/Amazon/Reportes/Clasification/Pending/RptAmazonPendingClasificationInvoices.tsx +++ b/src/Components/Clientes/Amazon/Reportes/Clasification/Pending/RptAmazonPendingClasificationInvoices.tsx @@ -35,6 +35,7 @@ import { MFileManager } from '../../../../../Utils/MFileManager/MFileManager' import { AiFillWarning } from 'react-icons/ai' import { PrioritySelector } from '../PrioritySelector/PrioritySelector' import IFileManager from '../../../../../../Interfaces/Utils/IFileManager' +import { VscHubot } from "react-icons/vsc"; export interface IRtpAmazonPendingInvoicesProps {} @@ -111,7 +112,8 @@ export default function RtpAmazonPendingInvoices( } const toggleExpandRow = (row: I2096Headers) => { - if (!row.max) check4Updates(row.id) + //if (!row.max) + check4Updates(row.id) let Invoice: I2096Headers[] = mInvoices.filter((item) => item.id === row.id) const Obj = { ...Invoice[0] } Obj.max = !Obj.max @@ -303,7 +305,31 @@ export default function RtpAmazonPendingInvoices( return }) } - + + const RunBOT = (row: I2096Headers) => { + setWaitingMessage('BOT trabajando...') + setWaitingDialog(true) + DSAmazon.ClasificacionBOT(row.id) + .then((response) => { + if (response.data) { + setIDFactura(0) + setFactura('') + setShowModalInvoiceFile(false) + setWaitingDialog(false) + //loadReport() + toggleExpandRow(row) + return + } + }) + .catch((e: Error) => { + setHeader('Error') + setMsg('Ocurrio un error') + setShowModalDeleteInvoice(false) + setWaitingDialog(false) + return + }) + } + return (
@@ -379,7 +405,7 @@ export default function RtpAmazonPendingInvoices( id - + @@ -441,7 +467,8 @@ export default function RtpAmazonPendingInvoices( } key={MasterData.id} onClick={() => { - toggleExpandRow(MasterData) + //toggleExpandRow(MasterData) + RunBOT(MasterData) }} > {MasterData.max === true ? ( @@ -459,10 +486,15 @@ export default function RtpAmazonPendingInvoices( )} {MasterData.id} - - + + proccessing + { WaitingMessage.includes('BOT') ? + + + : ''} {WaitingMessage} @@ -1017,8 +1055,9 @@ export default function RtpAmazonPendingInvoices( Proceso={IDProcess} showPreview={0} canEdit={true} - Leyenda="Seleccione las facturas de Amazon" onAppendMFM={function (Files: IFileManager[]): void { - } } /> + Leyenda="Seleccione las facturas de Amazon" + onAppendMFM={function (Files: IFileManager[]): void {}} + /> diff --git a/src/Components/Clientes/Amazon/Reportes/Clasification/Pending/RptAmazonPendingClasificationInvoicesDetail.tsx b/src/Components/Clientes/Amazon/Reportes/Clasification/Pending/RptAmazonPendingClasificationInvoicesDetail.tsx index ac9256b..8745fd4 100644 --- a/src/Components/Clientes/Amazon/Reportes/Clasification/Pending/RptAmazonPendingClasificationInvoicesDetail.tsx +++ b/src/Components/Clientes/Amazon/Reportes/Clasification/Pending/RptAmazonPendingClasificationInvoicesDetail.tsx @@ -186,7 +186,7 @@ export default function RtpAmazonPendingInvoivesDetail( style={{ textAlign: 'center', cursor: 'pointer', - backgroundColor: props.detail.checked ? '#E6EEF5' : '#ffffff' + backgroundColor: props.detail.checked ? props.detail.confirmaFraccion==5 ? '#F7E2D2' : '#E6EEF5' : '#ffffff' }} className="DetailData" onClick={() => openLink(props.detail.itemId)} @@ -196,7 +196,7 @@ export default function RtpAmazonPendingInvoivesDetail( @@ -205,7 +205,7 @@ export default function RtpAmazonPendingInvoivesDetail( {props.detail.pedimentoDescription} @@ -214,7 +214,7 @@ export default function RtpAmazonPendingInvoivesDetail( style={{ textAlign: 'center', fontSize: '18px', - backgroundColor: props.detail.checked ? '#E6EEF5' : '#ffffff' + backgroundColor: props.detail.checked ? props.detail.confirmaFraccion==5 ? '#F7E2D2' : '#E6EEF5' : '#ffffff' }} >   {props.detail.destinationHTSCode} @@ -222,7 +222,7 @@ export default function RtpAmazonPendingInvoivesDetail( @@ -230,7 +230,7 @@ export default function RtpAmazonPendingInvoivesDetail( @@ -247,7 +247,7 @@ export default function RtpAmazonPendingInvoivesDetail( @@ -270,7 +270,7 @@ export default function RtpAmazonPendingInvoivesDetail( @@ -287,7 +287,7 @@ export default function RtpAmazonPendingInvoivesDetail( @@ -296,7 +296,7 @@ export default function RtpAmazonPendingInvoivesDetail( @@ -305,7 +305,7 @@ export default function RtpAmazonPendingInvoivesDetail( @@ -314,7 +314,7 @@ export default function RtpAmazonPendingInvoivesDetail( @@ -323,7 +323,7 @@ export default function RtpAmazonPendingInvoivesDetail( @@ -332,7 +332,7 @@ export default function RtpAmazonPendingInvoivesDetail( @@ -341,7 +341,7 @@ export default function RtpAmazonPendingInvoivesDetail( @@ -350,7 +350,7 @@ export default function RtpAmazonPendingInvoivesDetail( @@ -359,7 +359,7 @@ export default function RtpAmazonPendingInvoivesDetail( @@ -369,7 +369,7 @@ export default function RtpAmazonPendingInvoivesDetail( @@ -378,7 +378,7 @@ export default function RtpAmazonPendingInvoivesDetail( @@ -386,7 +386,7 @@ export default function RtpAmazonPendingInvoivesDetail(
diff --git a/src/Components/Clientes/Amazon/Services/Amazon.Services.ts b/src/Components/Clientes/Amazon/Services/Amazon.Services.ts index 387b57c..08b71f4 100644 --- a/src/Components/Clientes/Amazon/Services/Amazon.Services.ts +++ b/src/Components/Clientes/Amazon/Services/Amazon.Services.ts @@ -264,5 +264,8 @@ class AmazonDataService { TraficoConsultasAmazonById(id: number) { return http.get(`/AmazonInvoice/TraficoConsultasAmazonById?id=${id}`) } + ClasificacionBOT(id: number) { + return http.get(`/AmazonInvoice/Bot/Clasificacion?id=${id}`) + } } export default new AmazonDataService() From 18b1428632db8b3aa9c15059396eef4f55b4e456 Mon Sep 17 00:00:00 2001 From: alfonso Date: Tue, 1 Aug 2023 10:09:14 -0500 Subject: [PATCH 02/10] Just added a switch for selectebly actionatin the BOT --- .../RptAmazonPendingClasificationInvoices.tsx | 34 +++++++++++++++---- 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/src/Components/Clientes/Amazon/Reportes/Clasification/Pending/RptAmazonPendingClasificationInvoices.tsx b/src/Components/Clientes/Amazon/Reportes/Clasification/Pending/RptAmazonPendingClasificationInvoices.tsx index c88351d..522b519 100644 --- a/src/Components/Clientes/Amazon/Reportes/Clasification/Pending/RptAmazonPendingClasificationInvoices.tsx +++ b/src/Components/Clientes/Amazon/Reportes/Clasification/Pending/RptAmazonPendingClasificationInvoices.tsx @@ -4,6 +4,7 @@ import { Button, Card, Col, + Form, FormCheck, Modal, Row, @@ -35,7 +36,7 @@ import { MFileManager } from '../../../../../Utils/MFileManager/MFileManager' import { AiFillWarning } from 'react-icons/ai' import { PrioritySelector } from '../PrioritySelector/PrioritySelector' import IFileManager from '../../../../../../Interfaces/Utils/IFileManager' -import { VscHubot } from "react-icons/vsc"; +import { VscHubot } from 'react-icons/vsc' export interface IRtpAmazonPendingInvoicesProps {} @@ -65,6 +66,7 @@ export default function RtpAmazonPendingInvoices( const [WaitingMessage, setWaitingMessage] = useState('Generado...') const [ShowModal, setShowModal] = useState(false) const [ShowModalW, setShowModalW] = useState(false) + const [BOTEnabled, setBOTEnabled] = useState(false) const [msg, setMsg] = useState('') const msgColor = 'primary' @@ -307,6 +309,10 @@ export default function RtpAmazonPendingInvoices( } const RunBOT = (row: I2096Headers) => { + if (!BOTEnabled) { + toggleExpandRow(row) + return false + } setWaitingMessage('BOT trabajando...') setWaitingDialog(true) DSAmazon.ClasificacionBOT(row.id) @@ -343,7 +349,20 @@ export default function RtpAmazonPendingInvoices( CLASIFICACION : facturas pendientes - + + + + { + setBOTEnabled(!BOTEnabled) + }} + /> + + proccessing - { WaitingMessage.includes('BOT') ? - - - : ''} + {WaitingMessage.includes('BOT') ? ( + + + + ) : ( + '' + )} {WaitingMessage} From dfe741a194be693770ab5eebe9f24be6432d0b63 Mon Sep 17 00:00:00 2001 From: alfonso Date: Tue, 1 Aug 2023 10:58:56 -0500 Subject: [PATCH 03/10] Fixed strange behaviour on opening and closing the Invoice detail on the clasification report from --- .../RptAmazonPendingClasificationInvoices.tsx | 83 +++++++++++-------- 1 file changed, 47 insertions(+), 36 deletions(-) diff --git a/src/Components/Clientes/Amazon/Reportes/Clasification/Pending/RptAmazonPendingClasificationInvoices.tsx b/src/Components/Clientes/Amazon/Reportes/Clasification/Pending/RptAmazonPendingClasificationInvoices.tsx index 522b519..8b44c02 100644 --- a/src/Components/Clientes/Amazon/Reportes/Clasification/Pending/RptAmazonPendingClasificationInvoices.tsx +++ b/src/Components/Clientes/Amazon/Reportes/Clasification/Pending/RptAmazonPendingClasificationInvoices.tsx @@ -114,8 +114,7 @@ export default function RtpAmazonPendingInvoices( } const toggleExpandRow = (row: I2096Headers) => { - //if (!row.max) - check4Updates(row.id) + if (!row.max) check4Updates(row.id) let Invoice: I2096Headers[] = mInvoices.filter((item) => item.id === row.id) const Obj = { ...Invoice[0] } Obj.max = !Obj.max @@ -309,31 +308,33 @@ export default function RtpAmazonPendingInvoices( } const RunBOT = (row: I2096Headers) => { - if (!BOTEnabled) { - toggleExpandRow(row) - return false + if (!BOTEnabled || row.max) { + toggleExpandRow(row) + return false } - setWaitingMessage('BOT trabajando...') - setWaitingDialog(true) - DSAmazon.ClasificacionBOT(row.id) - .then((response) => { - if (response.data) { - setIDFactura(0) - setFactura('') - setShowModalInvoiceFile(false) + if (BOTEnabled && !row.max) { + setWaitingMessage('BOT trabajando...') + setWaitingDialog(true) + DSAmazon.ClasificacionBOT(row.id) + .then((response) => { + if (response.data) { + setIDFactura(0) + setFactura('') + setShowModalInvoiceFile(false) + setWaitingDialog(false) + //loadReport() + toggleExpandRow(row) + return + } + }) + .catch((e: Error) => { + setHeader('Error') + setMsg('Ocurrio un error') + setShowModalDeleteInvoice(false) setWaitingDialog(false) - //loadReport() - toggleExpandRow(row) return - } - }) - .catch((e: Error) => { - setHeader('Error') - setMsg('Ocurrio un error') - setShowModalDeleteInvoice(false) - setWaitingDialog(false) - return - }) + }) + } } return ( @@ -350,18 +351,28 @@ export default function RtpAmazonPendingInvoices( - -
- { - setBOTEnabled(!BOTEnabled) - }} - /> - + + + + + + + + + { + setBOTEnabled(!BOTEnabled) + }} + /> + + +
Date: Thu, 3 Aug 2023 08:04:23 -0500 Subject: [PATCH 04/10] Fixed bot mechanism --- .../RptAmazonPendingClasificationInvoices.tsx | 44 ++++++++++--------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/src/Components/Clientes/Amazon/Reportes/Clasification/Pending/RptAmazonPendingClasificationInvoices.tsx b/src/Components/Clientes/Amazon/Reportes/Clasification/Pending/RptAmazonPendingClasificationInvoices.tsx index 8b44c02..594c7b2 100644 --- a/src/Components/Clientes/Amazon/Reportes/Clasification/Pending/RptAmazonPendingClasificationInvoices.tsx +++ b/src/Components/Clientes/Amazon/Reportes/Clasification/Pending/RptAmazonPendingClasificationInvoices.tsx @@ -312,28 +312,32 @@ export default function RtpAmazonPendingInvoices( toggleExpandRow(row) return false } - if (BOTEnabled && !row.max) { - setWaitingMessage('BOT trabajando...') - setWaitingDialog(true) - DSAmazon.ClasificacionBOT(row.id) - .then((response) => { - if (response.data) { - setIDFactura(0) - setFactura('') - setShowModalInvoiceFile(false) + if (BOTEnabled) { + // if (!row.max) { + setWaitingMessage('BOT trabajando...') + setWaitingDialog(true) + DSAmazon.ClasificacionBOT(row.id) + .then((response) => { + if (response.data) { + setIDFactura(0) + setFactura('') + setShowModalInvoiceFile(false) + setWaitingDialog(false) + //loadReport() + toggleExpandRow(row) + return + } + }) + .catch((e: Error) => { + setHeader('Error') + setMsg('Ocurrio un error') + setShowModalDeleteInvoice(false) setWaitingDialog(false) - //loadReport() - toggleExpandRow(row) return - } - }) - .catch((e: Error) => { - setHeader('Error') - setMsg('Ocurrio un error') - setShowModalDeleteInvoice(false) - setWaitingDialog(false) - return - }) + }) + /* } else { + toggleExpandRow(row) + } */ } } From 8f4bcf1df95ee7d43a9288e37407e752f7477c6a Mon Sep 17 00:00:00 2001 From: alfonso Date: Thu, 3 Aug 2023 10:02:19 -0500 Subject: [PATCH 05/10] Fixed form: AmazonNoPartes Fraccion + subdivision also validated with public web service --- .../Amazon/Reportes/AmazonNoPartes.tsx | 130 ++++++++++-------- src/Components/Utils/Toast/msgInformativo.tsx | 4 +- 2 files changed, 76 insertions(+), 58 deletions(-) diff --git a/src/Components/Clientes/Amazon/Reportes/AmazonNoPartes.tsx b/src/Components/Clientes/Amazon/Reportes/AmazonNoPartes.tsx index 1c8396e..77b59d7 100644 --- a/src/Components/Clientes/Amazon/Reportes/AmazonNoPartes.tsx +++ b/src/Components/Clientes/Amazon/Reportes/AmazonNoPartes.tsx @@ -35,10 +35,13 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) { const [NoParteLOG, setNoParteLOG] = useState([]) const [PaisClaves, setPaisClaves] = useState([]) const [Data, setData] = useState([]) - const [DataNoParteVerificacion, setDataNoParteVeriifcacion] = useState([]) + const [DataNoParteVerificacion, setDataNoParteVeriifcacion] = useState< + DTO2096NoParteVerificacion[] + >([]) const [ShowModal, setShowModal] = useState(false) const [ShowModalLog, setShowModalLog] = useState(false) - const [ShowModalNoParteVerificacion, setShowModalNoParteVerificacion] = useState(false) + const [ShowModalNoParteVerificacion, setShowModalNoParteVerificacion] = + useState(false) const [header, setHeader] = useState('') const [msgColor, setMsgColor] = useState('primary') const [show, setShowMsg] = useState(false) @@ -81,12 +84,11 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) {
{ loadDataNoParteVerificacion(row) setShowModalNoParteVerificacion(true) - }} > @@ -166,13 +168,15 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) { { name: 'UMF', width: '80px', - selector: (row: I2096NoParte) => row.unidadMedidaFactura ? row.unidadMedidaFactura : '', + selector: (row: I2096NoParte) => + row.unidadMedidaFactura ? row.unidadMedidaFactura : '', sortable: true }, { name: 'UMC', width: '80px', - selector: (row: I2096NoParte) => row.unidadMedidaCOVE ? row.unidadMedidaCOVE : '', + selector: (row: I2096NoParte) => + row.unidadMedidaCOVE ? row.unidadMedidaCOVE : '', sortable: true }, { @@ -215,7 +219,8 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) { { name: 'Fracc Original', width: '130px', - cell: (row: I2096NoParteLog) => row.fraccionOriginal ? row.fraccionOriginal : '', + cell: (row: I2096NoParteLog) => + row.fraccionOriginal ? row.fraccionOriginal : '', sortable: true }, { @@ -228,7 +233,8 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) { { name: 'NICO Original', width: '130px', - cell: (row: I2096NoParteLog) => row.subdivisionOriginal ? row.subdivisionOriginal : '', + cell: (row: I2096NoParteLog) => + row.subdivisionOriginal ? row.subdivisionOriginal : '', sortable: true, center: true }, @@ -237,7 +243,7 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) { width: '250px', cell: (row: I2096NoParteLog) => row.descripcionAgenteAduanal, wrap: true, - sortable: true, + sortable: true }, { name: 'Desc Original', @@ -246,7 +252,7 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) { wrap: true, sorteable: true }, - + { name: 'Fecha / Hora', width: '200px', @@ -256,7 +262,7 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) { { name: 'Usuario', width: '300px', - cell: (row: I2096NoParteLog) => row.sUsuario ? row.sUsuario : '', + cell: (row: I2096NoParteLog) => (row.sUsuario ? row.sUsuario : ''), wrap: true, sortable: true } @@ -294,7 +300,7 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) { width: '100px', cell: (row: DTO2096NoParteVerificacion) => row.aduana, wrap: true, - sortable: true, + sortable: true }, { name: 'Pedimento', @@ -305,7 +311,6 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) { } ] - const openLink = (item: string) => { window.open('https://www.amazon.com/dp/' + item) } @@ -315,7 +320,7 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) { if (Id === 0) return NoAsignado else if (Data.length) { const Usuario = Data.filter((item) => item.idUsuario === Id) - return Usuario ? Usuario[0].nombre : NoAsignado + return Usuario.length ? Usuario[0].nombre : NoAsignado } return NoAsignado } @@ -396,6 +401,7 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) { } AmazonDS.NoPartesGet(Search) .then((response) => { + console.log(response.data) dispatch(populateNoPartes(response.data)) }) .catch((e: Error) => { @@ -417,11 +423,23 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) { AmazonDS.NoPartesUpdate(data) .then((response) => { dispatch(updateNoPartes(response.data)) + setHeader('Informativo') + setMsg('La informacion se guardo correctamente') + setShowMsg(true) }) - .catch((e: Error) => { + .catch(function(error) { + console.log(error.toJSON()) + if (error.message == 'Request failed with status code 400') { + setHeader('Error') + setMsg('Fraccion no valida!') + setShowMsg(true) + } + /* console.log(error.toJSON()) + const errorMessage = error?.response?.data?.message + const message = errorMessage setHeader('Error') - setMsg('Ocurrio un error: ' + e) - setShowMsg(true) + setMsg(message) + setShowMsg(true) */ return }) } @@ -616,26 +634,26 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) { No Parte: {Parte} - {/*
*/} - - - 0 - })} - /> - - - {/*
*/} + {/*
*/} + + + 0 + })} + /> + + + {/*
*/}
@@ -651,25 +669,25 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) { No Parte: {Search} - - - - - - {/*
*/} + + + + + + {/*
*/}
= (props) => { return (
- - + Date: Thu, 3 Aug 2023 10:46:24 -0500 Subject: [PATCH 06/10] v2.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1f2d258..cfb238f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gemco", - "version": "0.1.0", + "version": "2.0.0", "homepage": ".", "private": true, "dependencies": { From c9a9433790b45e23d70630d1c646396a24cce021 Mon Sep 17 00:00:00 2001 From: alfonso Date: Thu, 3 Aug 2023 10:46:39 -0500 Subject: [PATCH 07/10] v3.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index cfb238f..17f330d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gemco", - "version": "2.0.0", + "version": "3.0.0", "homepage": ".", "private": true, "dependencies": { From 9a45e404ac13385270969c4cb3f71460d8819acf Mon Sep 17 00:00:00 2001 From: alfonso Date: Fri, 4 Aug 2023 15:49:06 -0500 Subject: [PATCH 08/10] Added delete feature to NoPartes Catalog --- package.json | 2 +- .../Amazon/Reportes/AmazonNoPartes.tsx | 90 +++++++++++++++++-- .../Amazon/Services/Amazon.Services.ts | 3 + src/Components/Utils/Toast/msgInformativo.tsx | 2 +- 4 files changed, 87 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 17f330d..5784264 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,7 @@ "start-dev": "env-cmd -f .env.development react-scripts start", "start-qa": "env-cmd -f .env.qa react-scripts start", "start-prod": "env-cmd -f .env.production react-scripts start", - "build-qa": "env-cmd -f .env.qa react-scripts build", + "build-qa": "env-cmd -f .env.qa react-scripts -version -patch build", "build-prod": "env-cmd -f .env.production react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject" diff --git a/src/Components/Clientes/Amazon/Reportes/AmazonNoPartes.tsx b/src/Components/Clientes/Amazon/Reportes/AmazonNoPartes.tsx index 77b59d7..8c02df9 100644 --- a/src/Components/Clientes/Amazon/Reportes/AmazonNoPartes.tsx +++ b/src/Components/Clientes/Amazon/Reportes/AmazonNoPartes.tsx @@ -4,6 +4,7 @@ import DataTable from 'react-data-table-component' import I2096NoParte from '../Interfaces/I2096NoParte' import AmazonDS from '../Services/Amazon.Services' import { + deleteNoPartes, populateNoPartes, updateNoPartes } from '../../../../store/features/Clientes/2096/AmazonNoPartes' @@ -12,7 +13,7 @@ import { useDispatch, useSelector } from 'react-redux' import { useEffect, useState } from 'react' import { MsgInformativo } from '../../../Utils/Toast/msgInformativo' import { IconContext } from 'react-icons' -import { BsFillPencilFill } from 'react-icons/bs' +import { BsFillPencilFill, BsFillXCircleFill } from 'react-icons/bs' import I2096PaisClave from '../Interfaces/I2096PaisClave' import DTO2096PerfilesParecidos from '../DTO/DTO2096PerfilesParecidos' @@ -42,6 +43,7 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) { const [ShowModalLog, setShowModalLog] = useState(false) const [ShowModalNoParteVerificacion, setShowModalNoParteVerificacion] = useState(false) + const [ShowModalDelete, setShowModalDelete] = useState(false) const [header, setHeader] = useState('') const [msgColor, setMsgColor] = useState('primary') const [show, setShowMsg] = useState(false) @@ -76,6 +78,30 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) { ), sortable: true }, + { + name: '', + width: '60px', + cell: (row: I2096NoParte) => ( + + +
{ + setIDParte(row.id) + setShowModalDelete(true) + }} + > + + + +
+ +
+ ), + sortable: true + }, { name: '', width: '60px', @@ -427,19 +453,32 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) { setMsg('La informacion se guardo correctamente') setShowMsg(true) }) - .catch(function(error) { + .catch(function (error) { + console.log(error.toJSON()) + if (error.message == 'Request failed with status code 400') { + setHeader('Error') + setMsg('Fraccion no valida!') + setShowMsg(true) + } + return + }) + } + + const deleteNoParte = () => { + AmazonDS.DeleteNoParte(IDParte) + .then((response) => { + dispatch(deleteNoPartes(IDParte)) + setHeader('Informativo') + setMsg('La informacion se guardo correctamente') + setShowMsg(true) + }) + .catch(function (error) { console.log(error.toJSON()) if (error.message == 'Request failed with status code 400') { setHeader('Error') setMsg('Fraccion no valida!') setShowMsg(true) } - /* console.log(error.toJSON()) - const errorMessage = error?.response?.data?.message - const message = errorMessage - setHeader('Error') - setMsg(message) - setShowMsg(true) */ return }) } @@ -690,6 +729,41 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) { {/*
*/} + + { + setShowModalDelete(false) + }} + size={'sm'} + dialogClassName={'modal-50w'} + > + + + + + +

¿Esta seguro de eliminar el no parte: {Parte}

+
+ +
+
+
+ + + + + + + + + + + + {/* */} + +
+ (`/AmazonInvoice/Bot/Clasificacion?id=${id}`) } + DeleteNoParte(id: number) { + return http.delete(`/AmazonInvoice/DeleteNoParte?id=${id}`) + } } export default new AmazonDataService() diff --git a/src/Components/Utils/Toast/msgInformativo.tsx b/src/Components/Utils/Toast/msgInformativo.tsx index f75f300..0b07e51 100644 --- a/src/Components/Utils/Toast/msgInformativo.tsx +++ b/src/Components/Utils/Toast/msgInformativo.tsx @@ -15,7 +15,7 @@ interface IProps { export const MsgInformativo: FC = (props) => { return (
- + Date: Fri, 4 Aug 2023 16:33:22 -0500 Subject: [PATCH 09/10] Added version number that will be showned on login form --- package.json | 2 +- src/Components/Login/login.tsx | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 5784264..2b2bb25 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,7 @@ "start-dev": "env-cmd -f .env.development react-scripts start", "start-qa": "env-cmd -f .env.qa react-scripts start", "start-prod": "env-cmd -f .env.production react-scripts start", - "build-qa": "env-cmd -f .env.qa react-scripts -version -patch build", + "build-qa": "env-cmd -f .env.qa react-scripts build version --patch", "build-prod": "env-cmd -f .env.production react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject" diff --git a/src/Components/Login/login.tsx b/src/Components/Login/login.tsx index 9399962..34a4bca 100644 --- a/src/Components/Login/login.tsx +++ b/src/Components/Login/login.tsx @@ -14,6 +14,7 @@ import { MsgInformativo } from '../Utils/Toast/msgInformativo' import logo from '../../images/GEMCO_mini.png' import Dashboard from '../Dashboard/Dashboard' import { Nav } from 'react-bootstrap' +import Info from '../../../package.json' export const Login: React.FC<{}> = () => { const dispatch = useDispatch() @@ -132,6 +133,7 @@ export const Login: React.FC<{}> = () => { login
+
v{Info.version}
From 118cce6dd322cf54477af7177b71ea414aee57fd Mon Sep 17 00:00:00 2001 From: alfonso Date: Sat, 12 Aug 2023 15:08:34 -0500 Subject: [PATCH 10/10] v3.1.0 --- package.json | 2 +- .../Components/ComboSelect/ComboFraccion.tsx | 2 +- .../RptAmazonFinishedClasificationInvoices.tsx | 15 +++++++++++++++ .../RptAmazonPendingClasificationInvoices.tsx | 10 +++------- .../RptPendingAnswerFromAmazon.tsx | 2 +- 5 files changed, 21 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 2b2bb25..3958cc2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gemco", - "version": "3.0.0", + "version": "3.1.0", "homepage": ".", "private": true, "dependencies": { diff --git a/src/Components/Clientes/Amazon/Components/ComboSelect/ComboFraccion.tsx b/src/Components/Clientes/Amazon/Components/ComboSelect/ComboFraccion.tsx index 74593e1..d4f9493 100644 --- a/src/Components/Clientes/Amazon/Components/ComboSelect/ComboFraccion.tsx +++ b/src/Components/Clientes/Amazon/Components/ComboSelect/ComboFraccion.tsx @@ -209,7 +209,7 @@ export function ComboFraccion(props: IComboFraccionProps) { - + {/* */} ) : ( '' diff --git a/src/Components/Clientes/Amazon/Reportes/Clasification/Finished/RptAmazonFinishedClasificationInvoices.tsx b/src/Components/Clientes/Amazon/Reportes/Clasification/Finished/RptAmazonFinishedClasificationInvoices.tsx index fa22ed7..514bb84 100644 --- a/src/Components/Clientes/Amazon/Reportes/Clasification/Finished/RptAmazonFinishedClasificationInvoices.tsx +++ b/src/Components/Clientes/Amazon/Reportes/Clasification/Finished/RptAmazonFinishedClasificationInvoices.tsx @@ -161,6 +161,13 @@ export default function RptAmazonFinishedClasificationInvoices( }) } + function getReceiver(Cadena: string, char1: string[1], char2: string[1]) { + return Cadena.slice( + Cadena.indexOf(char1) + 1, + Cadena.lastIndexOf(char2), + ); + } + return (
@@ -195,6 +202,7 @@ export default function RptAmazonFinishedClasificationInvoices( Commercial Invoice Date Invoice Number + Receiver Incoterms HAWB Qty Unit of measure @@ -300,6 +308,13 @@ export default function RptAmazonFinishedClasificationInvoices( {MasterData.invoiceNumber} + + {mInvoices + .filter((value) => value.id === MasterData.id) + .map((row) => { + return getReceiver(row.detail[0].amazonShipmentReferenceId,'_','_') + })} + {MasterData.incoterms} diff --git a/src/Components/Clientes/Amazon/Reportes/Clasification/Pending/RptAmazonPendingClasificationInvoices.tsx b/src/Components/Clientes/Amazon/Reportes/Clasification/Pending/RptAmazonPendingClasificationInvoices.tsx index 594c7b2..c9686c5 100644 --- a/src/Components/Clientes/Amazon/Reportes/Clasification/Pending/RptAmazonPendingClasificationInvoices.tsx +++ b/src/Components/Clientes/Amazon/Reportes/Clasification/Pending/RptAmazonPendingClasificationInvoices.tsx @@ -313,7 +313,6 @@ export default function RtpAmazonPendingInvoices( return false } if (BOTEnabled) { - // if (!row.max) { setWaitingMessage('BOT trabajando...') setWaitingDialog(true) DSAmazon.ClasificacionBOT(row.id) @@ -335,9 +334,6 @@ export default function RtpAmazonPendingInvoices( setWaitingDialog(false) return }) - /* } else { - toggleExpandRow(row) - } */ } } @@ -356,7 +352,7 @@ export default function RtpAmazonPendingInvoices( - + {/* - + */}
@@ -449,7 +445,7 @@ export default function RtpAmazonPendingInvoices( Commercial Invoice Date Invoice Number - Name + Receiver Incoterms Qty Unit of measure Tot Qty diff --git a/src/Components/Clientes/Amazon/Reportes/Clasification/WaitingAnswerFromAmazon/RptPendingAnswerFromAmazon.tsx b/src/Components/Clientes/Amazon/Reportes/Clasification/WaitingAnswerFromAmazon/RptPendingAnswerFromAmazon.tsx index aa82847..dbbb9fd 100644 --- a/src/Components/Clientes/Amazon/Reportes/Clasification/WaitingAnswerFromAmazon/RptPendingAnswerFromAmazon.tsx +++ b/src/Components/Clientes/Amazon/Reportes/Clasification/WaitingAnswerFromAmazon/RptPendingAnswerFromAmazon.tsx @@ -305,7 +305,7 @@ export default function RptPendingAnswerFromAmazon( Commercial Invoice Date Invoice Number - Name + Receiver Incoterms Qty Unit of measure Tot Qty