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/package.json b/package.json index 1f2d258..3958cc2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gemco", - "version": "0.1.0", + "version": "3.1.0", "homepage": ".", "private": true, "dependencies": { @@ -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 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/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/AmazonNoPartes.tsx b/src/Components/Clientes/Amazon/Reportes/AmazonNoPartes.tsx index 1c8396e..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' @@ -35,10 +36,14 @@ 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 [ShowModalDelete, setShowModalDelete] = useState(false) const [header, setHeader] = useState('') const [msgColor, setMsgColor] = useState('primary') const [show, setShowMsg] = useState(false) @@ -81,12 +86,35 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) {
{ + setIDParte(row.id) + setShowModalDelete(true) + }} + > + + + +
+ + + ), + sortable: true + }, + { + name: '', + width: '60px', + cell: (row: I2096NoParte) => ( + + +
{ loadDataNoParteVerificacion(row) setShowModalNoParteVerificacion(true) - }} > @@ -166,13 +194,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 +245,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 +259,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 +269,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 +278,7 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) { wrap: true, sorteable: true }, - + { name: 'Fecha / Hora', width: '200px', @@ -256,7 +288,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 +326,7 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) { width: '100px', cell: (row: DTO2096NoParteVerificacion) => row.aduana, wrap: true, - sortable: true, + sortable: true }, { name: 'Pedimento', @@ -305,7 +337,6 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) { } ] - const openLink = (item: string) => { window.open('https://www.amazon.com/dp/' + item) } @@ -315,7 +346,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 +427,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 +449,36 @@ 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) => { - setHeader('Error') - setMsg('Ocurrio un error: ' + e) + .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) + } return }) } @@ -616,26 +673,26 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) { No Parte: {Parte} - {/*
*/} - - - 0 - })} - /> - - - {/*
*/} + {/*
*/} + + + 0 + })} + /> + + + {/*
*/}
@@ -651,27 +708,62 @@ export default function AmazonNoPartes(props: IAmazonNoPartesProps) { No Parte: {Search} - + + + + + + {/*
*/} + +
+ + { + setShowModalDelete(false) + }} + size={'sm'} + dialogClassName={'modal-50w'} + > + + + - + +

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

+
- {/* */} +
+
+ + + + + + + + + + + + {/* */}
+ @@ -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 25c925a..c9686c5 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,6 +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' export interface IRtpAmazonPendingInvoicesProps {} @@ -64,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' @@ -303,7 +306,37 @@ export default function RtpAmazonPendingInvoices( return }) } - + + const RunBOT = (row: I2096Headers) => { + if (!BOTEnabled || row.max) { + toggleExpandRow(row) + return false + } + if (BOTEnabled) { + 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 (
@@ -317,7 +350,30 @@ export default function RtpAmazonPendingInvoices( CLASIFICACION : facturas pendientes - + + + {/* + + + + + + + { + setBOTEnabled(!BOTEnabled) + }} + /> + + */} +
+ id - + @@ -389,7 +445,7 @@ export default function RtpAmazonPendingInvoices( Commercial Invoice Date Invoice Number - Name + Receiver Incoterms Qty Unit of measure Tot Qty @@ -441,7 +497,8 @@ export default function RtpAmazonPendingInvoices( } key={MasterData.id} onClick={() => { - toggleExpandRow(MasterData) + //toggleExpandRow(MasterData) + RunBOT(MasterData) }} > {MasterData.max === true ? ( @@ -459,10 +516,15 @@ export default function RtpAmazonPendingInvoices( )} {MasterData.id} - - + + proccessing + {WaitingMessage.includes('BOT') ? ( + + + + ) : ( + '' + )} {WaitingMessage} @@ -1017,8 +1088,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/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 diff --git a/src/Components/Clientes/Amazon/Services/Amazon.Services.ts b/src/Components/Clientes/Amazon/Services/Amazon.Services.ts index 387b57c..ef2b0ee 100644 --- a/src/Components/Clientes/Amazon/Services/Amazon.Services.ts +++ b/src/Components/Clientes/Amazon/Services/Amazon.Services.ts @@ -264,5 +264,11 @@ class AmazonDataService { TraficoConsultasAmazonById(id: number) { return http.get(`/AmazonInvoice/TraficoConsultasAmazonById?id=${id}`) } + ClasificacionBOT(id: number) { + return http.get(`/AmazonInvoice/Bot/Clasificacion?id=${id}`) + } + DeleteNoParte(id: number) { + return http.delete(`/AmazonInvoice/DeleteNoParte?id=${id}`) + } } export default new AmazonDataService() 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}
diff --git a/src/Components/Utils/Toast/msgInformativo.tsx b/src/Components/Utils/Toast/msgInformativo.tsx index ca41a64..0b07e51 100644 --- a/src/Components/Utils/Toast/msgInformativo.tsx +++ b/src/Components/Utils/Toast/msgInformativo.tsx @@ -15,8 +15,8 @@ interface IProps { export const MsgInformativo: FC = (props) => { return (
- - +