Se agrega que el clasificador lider pueda asignar facturas

AmazonRelease1.1
unknown 2 years ago
parent dc634e616a
commit 02d27131fb
  1. 1
      src/Components/Clientes/Amazon/Components/ComboSelect/ComboDescripcion.tsx
  2. 1
      src/Components/Clientes/Amazon/Components/ComboSelect/ComboFraccion.tsx
  3. 5
      src/Components/Clientes/Amazon/DTO/DTO2096PerfilesParecidos.ts
  4. 1
      src/Components/Clientes/Amazon/Interfaces/I2096Header.ts
  5. 1
      src/Components/Clientes/Amazon/Reportes/Clasification/Finished/RptAmazonFinishedClasificationInvoicesDetail.tsx
  6. 133
      src/Components/Clientes/Amazon/Reportes/Clasification/Pending/ClasificatorAssign.tsx
  7. 867
      src/Components/Clientes/Amazon/Reportes/Clasification/Pending/RptAmazonPendingClasificationInvoices.tsx
  8. 1
      src/Components/Clientes/Amazon/Reportes/Clasification/Pending/RptAmazonPendingClasificationInvoicesDetail.tsx
  9. 2
      src/Components/Clientes/Amazon/Reportes/Clasification/WaitingAnswer/RptPendingAnswerFromAmazonDetail.tsx
  10. 1
      src/Components/Clientes/Amazon/Reportes/Traffic/Linking/RptAmazonInvoiceTrafficDetail.tsx
  11. 1
      src/Components/Clientes/Amazon/Reportes/Traffic/Pending/RptAmazonPendingTraficInvoiceDetail.tsx
  12. 7
      src/Components/Clientes/Amazon/Services/Amazon.Services.ts
  13. 17
      src/Components/Login/login.tsx
  14. 93
      src/Components/Register/UserList/UserList.tsx
  15. 1
      src/Interfaces/IjwtStructure.ts

@ -85,6 +85,7 @@ export function ComboDescripcion(props: IComboDescripcionProps) {
footNote: Invoice.footNote, footNote: Invoice.footNote,
archivo: Invoice.archivo, archivo: Invoice.archivo,
fCreacion: Invoice.fCreacion, fCreacion: Invoice.fCreacion,
clasificador: Invoice.clasificador,
estatus: Invoice.estatus, estatus: Invoice.estatus,
max: true, max: true,
detail: Detail detail: Detail

@ -79,6 +79,7 @@ export function ComboFraccion(props: IComboFraccionProps) {
footNote: Invoice.footNote, footNote: Invoice.footNote,
archivo: Invoice.archivo, archivo: Invoice.archivo,
fCreacion: Invoice.fCreacion, fCreacion: Invoice.fCreacion,
clasificador: Invoice.clasificador,
estatus: Invoice.estatus, estatus: Invoice.estatus,
max: true, max: true,
detail: Detail detail: Detail

@ -0,0 +1,5 @@
export default interface DTO2096PerfilesParecidos {
idUsuario: number
nombre: string
perfil: string
}

@ -22,6 +22,7 @@ export default interface I2096Headers {
footNote: string footNote: string
archivo: string archivo: string
fCreacion: string fCreacion: string
clasificador: number
estatus: number estatus: number
max: boolean max: boolean
detail: Detail[] detail: Detail[]

@ -89,6 +89,7 @@ export default function RptAmazonFinishedClasificationInvoicesDetail(
footNote: Invoice.footNote, footNote: Invoice.footNote,
archivo: Invoice.archivo, archivo: Invoice.archivo,
fCreacion: Invoice.fCreacion, fCreacion: Invoice.fCreacion,
clasificador: Invoice.clasificador,
estatus: Invoice.estatus, estatus: Invoice.estatus,
max: true, max: true,
detail: Detail detail: Detail

@ -0,0 +1,133 @@
import * as React from 'react'
import { useEffect, useState } from 'react'
import { Alert, Button, Col, Form, Modal, Row } from 'react-bootstrap'
import DTO2096PerfilesParecidos from '../../../DTO/DTO2096PerfilesParecidos'
import { RootState } from '../../../../../../store/store'
import { useDispatch, useSelector } from 'react-redux'
import I2096Headers from '../../../Interfaces/I2096Header'
import { updateInvoice } from '../../../../../../store/features/Clientes/2096/AmazonInvoices'
import DSAmazon from '../../../Services/Amazon.Services'
import I2096Detail from '../../../Interfaces/I2096Detail'
export interface IClasificatorAssignProps {
Invoice: I2096Headers
Disabled: boolean
}
export default function ClasificatorAssign(props: IClasificatorAssignProps) {
const dispatch = useDispatch()
const mInvoices = useSelector(
(state: RootState) => state.AmazonInvoices.Invoice
)
const [IDClasificador, setIDClasificador] = useState(
props.Invoice.clasificador ? props.Invoice.clasificador : 0
)
const [Clasificador, setClasificador] = useState('')
const [Data, setData] = useState<DTO2096PerfilesParecidos[]>([])
const [showModal, setShowModal] = useState(false)
useEffect(() => {
DSAmazon.PerfilesParecidosGet('Clasificador')
.then((response) => {
setData(response.data)
})
.catch((e: Error) => {
alert('Ocurrio un error' + e.message.toString())
})
}, [])
useEffect(() => {
setClasificador(getUser(IDClasificador))
}, [IDClasificador])
const getUser = (Id: number) => {
const NoAsignado = ' - NO ASIGNADO -'
if (Id === 0) return NoAsignado
else if (Data.length) {
const Usuario = Data.filter((item) => item.idUsuario === Id)
return Usuario[0].nombre ? Usuario[0].nombre : NoAsignado
}
return NoAsignado
}
const UpdateInfo = (updatedInvoice: I2096Headers) => {
dispatch(updateInvoice(updatedInvoice))
}
const editArray = () => {
const Invoice = mInvoices
.filter((el) => el.id === props.Invoice.id)
.map((el) => {
return {
...el,
clasificador: IDClasificador
}
})
UpdateInfo(Invoice[0])
}
const saveAsignation = () => {
DSAmazon.AsignaFactura(IDClasificador, props.Invoice.id)
.then((response) => {
setShowModal(false)
editArray()
})
.catch((e: Error) => {
alert('Ocurrio un error' + e.message.toString())
})
}
return (
<div>
<Form.Control
as="select"
disabled={props.Disabled}
className="form-select form-select-sm"
onChange={(e) => {
setIDClasificador(parseInt(e.target.value))
setShowModal(true)
}}
value={IDClasificador}
>
<option value="0">- NO ASIGNADO -</option>
{Data
? Data.map((item) => {
return <option value={item.idUsuario}>{item.nombre}</option>
})
: ''}
</Form.Control>
<Modal
show={showModal}
onHide={() => {
setShowModal(false)
}}
size={'sm'}
dialogClassName={'modal-50w'}
>
<Modal.Body>
<Row>
<Col xs={12}>
<Alert variant="danger">
<Alert.Heading>
¿Esta seguro de asignar esta factura Amazon a: {Clasificador}?
</Alert.Heading>
</Alert>
</Col>
</Row>
<Row style={{ paddingTop: '10px' }}>
<Col XS={9}></Col>
<Col xs={3}>
<Button
onClick={() => {
saveAsignation()
}}
>
Asignar
</Button>
</Col>
</Row>
</Modal.Body>
</Modal>
</div>
)
}

@ -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>

@ -90,6 +90,7 @@ export default function RtpAmazonPendingInvoivesDetail(
footNote: Invoice.footNote, footNote: Invoice.footNote,
archivo: Invoice.archivo, archivo: Invoice.archivo,
fCreacion: Invoice.fCreacion, fCreacion: Invoice.fCreacion,
clasificador: Invoice.clasificador,
estatus: Invoice.estatus, estatus: Invoice.estatus,
max: true, max: true,
detail: Detail detail: Detail

@ -95,6 +95,7 @@ export default function RptPendingAnswerFromAmazonDetail(
footNote: Invoice.footNote, footNote: Invoice.footNote,
archivo: Invoice.archivo, archivo: Invoice.archivo,
fCreacion: Invoice.fCreacion, fCreacion: Invoice.fCreacion,
clasificador: Invoice.clasificador,
estatus: Invoice.estatus, estatus: Invoice.estatus,
max: true, max: true,
detail: Detail detail: Detail
@ -392,7 +393,6 @@ export default function RptPendingAnswerFromAmazonDetail(
> >
{props.detail.netWeightUnitOfMeasure} {props.detail.netWeightUnitOfMeasure}
</td> </td>
<td <td
style={{ style={{
textAlign: 'center' textAlign: 'center'

@ -90,6 +90,7 @@ export default function RtpAmazonInvoiceTrafficDetail(
footNote: Invoice.footNote, footNote: Invoice.footNote,
archivo: Invoice.archivo, archivo: Invoice.archivo,
fCreacion: Invoice.fCreacion, fCreacion: Invoice.fCreacion,
clasificador: Invoice.clasificador,
estatus: Invoice.estatus, estatus: Invoice.estatus,
max: true, max: true,
detail: Detail detail: Detail

@ -86,6 +86,7 @@ export default function RptAmazonPendingTraficInvoiceDetail(
footNote: Invoice.footNote, footNote: Invoice.footNote,
archivo: Invoice.archivo, archivo: Invoice.archivo,
fCreacion: Invoice.fCreacion, fCreacion: Invoice.fCreacion,
clasificador: Invoice.clasificador,
estatus: Invoice.estatus, estatus: Invoice.estatus,
max: true, max: true,
detail: Detail detail: Detail

@ -10,6 +10,7 @@ import DTO2096ItemAutoriza from '../DTO/DTO2096ItemAutoriza'
import DTORespuesta from '../../ZincInternacional/DTO/DTORespuesta' import DTORespuesta from '../../ZincInternacional/DTO/DTORespuesta'
import DTO2096SightLine from '../DTO/DTO2096SightLine' import DTO2096SightLine from '../DTO/DTO2096SightLine'
import DTO2096FraccionDescripcion from '../DTO/DTO2096FraccionDescripcion' import DTO2096FraccionDescripcion from '../DTO/DTO2096FraccionDescripcion'
import DTO2096PerfilesParecidos from '../DTO/DTO2096PerfilesParecidos'
class AmazonDataService { class AmazonDataService {
AmazonPendingClasificationInvoiceGET() { AmazonPendingClasificationInvoiceGET() {
@ -112,5 +113,11 @@ class AmazonDataService {
NoPartesGet(Search: string) { NoPartesGet(Search: string) {
return http.get<I2096NoParte[]>(`/AmazonInvoice/NoPartesGet?Search=${Search}`) return http.get<I2096NoParte[]>(`/AmazonInvoice/NoPartesGet?Search=${Search}`)
} }
PerfilesParecidosGet(Perfil: string) {
return http.get<DTO2096PerfilesParecidos[]>(`/Usuarios/Catalogo/Usuarios/PerfilesParecidos?Perfil=${Perfil}`)
}
AsignaFactura(IdUsuario: number, IdFactura: number) {
return http.put<DTO2096PerfilesParecidos[]>(`/AmazonInvoice/AsignaFactura?IdUsuario=${IdUsuario}&IdFactura=${IdFactura}`)
}
} }
export default new AmazonDataService() export default new AmazonDataService()

@ -25,16 +25,6 @@ export const Login: React.FC<{}> = () => {
const [msgColor, setMsgColor] = React.useState('primary') const [msgColor, setMsgColor] = React.useState('primary')
const initialValues: ILogin = { Usuario: '', Contrasena: '' } const initialValues: ILogin = { Usuario: '', Contrasena: '' }
React.useEffect(() => {
/* if ('caches' in window) {
caches.keys().then((names) => {
names.forEach((name) => {
caches.delete(name)
})
})
} */
}, [])
return ( return (
<div> <div>
{!userLogued ? ( {!userLogued ? (
@ -80,9 +70,11 @@ export const Login: React.FC<{}> = () => {
'UserType', 'UserType',
JSON.stringify(values.UserType) JSON.stringify(values.UserType)
) )
localStorage.setItem(
'Perfil',
JSON.stringify(values.Perfil)
)
dispatch(logued(true)) dispatch(logued(true))
//navigate('/')
//window.location.href = '/#/Dashboard'
}) })
.catch((e: AxiosError) => { .catch((e: AxiosError) => {
localStorage.setItem('menu', '') localStorage.setItem('menu', '')
@ -97,7 +89,6 @@ export const Login: React.FC<{}> = () => {
} }
setShow(true) setShow(true)
}) })
// actions.setSubmitting(false);
}} }}
> >
<Form id='login-form' className='form'> <Form id='login-form' className='form'>

@ -3,6 +3,15 @@ import { Alert, Button, Col, Form, Modal, Row, Table } from 'react-bootstrap'
import DataTable from 'react-data-table-component' import DataTable from 'react-data-table-component'
import { IRegister } from '../../../Interfaces/IRegister' import { IRegister } from '../../../Interfaces/IRegister'
import usuariosServices from '../../../Services/Catalogos/Usuarios.Services' import usuariosServices from '../../../Services/Catalogos/Usuarios.Services'
import PerfilesServices from '../../../Services/Catalogos/PerfilesMenu.Services'
import { IPerfil } from '../../../Interfaces/Catalogos/IPerfiles'
import { IconContext } from 'react-icons'
import {
BsCheckCircleFill,
BsCheckLg,
BsFillPersonCheckFill,
BsFillPersonDashFill
} from 'react-icons/bs'
interface IProps { interface IProps {
show: boolean show: boolean
@ -14,12 +23,13 @@ export const UserList: React.FC<IProps> = (props) => {
const [sDialog, setsDialog] = React.useState(true) const [sDialog, setsDialog] = React.useState(true)
const [Usuarios, setUsuarios] = React.useState<IRegister[]>() const [Usuarios, setUsuarios] = React.useState<IRegister[]>()
const [Data, setData] = useState<IRegister[]>([]) const [Data, setData] = useState<IRegister[]>([])
const [DataPerfiles, setDataPerfiles] = useState<IPerfil[]>([])
const [DataOriginal, setDataOriginal] = useState<IRegister[]>([]) const [DataOriginal, setDataOriginal] = useState<IRegister[]>([])
const [filtro, setFiltro] = useState('') const [filtro, setFiltro] = useState('')
const columnsConcepts = [ const columnsConcepts = [
{ {
name: 'id', name: 'id',
width: '125px', width: '70px',
cell: (row: IRegister) => ( cell: (row: IRegister) => (
<div <div
style={{ width: '100%' }} style={{ width: '100%' }}
@ -30,11 +40,11 @@ export const UserList: React.FC<IProps> = (props) => {
{row.id} {row.id}
</div> </div>
), ),
sortable: true, sortable: true
}, },
{ {
name: 'Usuario', name: 'Usuario',
width: '250px', width: '200px',
cell: (row: IRegister) => ( cell: (row: IRegister) => (
<div <div
style={{ width: '100%' }} style={{ width: '100%' }}
@ -45,7 +55,7 @@ export const UserList: React.FC<IProps> = (props) => {
{row.usuario} {row.usuario}
</div> </div>
), ),
sortable: true, sortable: true
}, },
{ {
name: 'Nombre', name: 'Nombre',
@ -60,7 +70,7 @@ export const UserList: React.FC<IProps> = (props) => {
{row.nombre} {row.nombre}
</div> </div>
), ),
sortable: true, sortable: true
}, },
{ {
name: 'Correo', name: 'Correo',
@ -75,9 +85,9 @@ export const UserList: React.FC<IProps> = (props) => {
{row.correo} {row.correo}
</div> </div>
), ),
sortable: true, sortable: true
}, },
{ /* {
name: 'Ultima visita', name: 'Ultima visita',
width: '125px', width: '125px',
cell: (row: IRegister) => ( cell: (row: IRegister) => (
@ -90,11 +100,11 @@ export const UserList: React.FC<IProps> = (props) => {
{row.fechaUltimaVisita} {row.fechaUltimaVisita}
</div> </div>
), ),
sortable: true, sortable: true
}, }, */
{ {
name: 'Estatus', name: 'Perfil',
width: '125px', width: '250px',
cell: (row: IRegister) => ( cell: (row: IRegister) => (
<div <div
style={{ width: '100%' }} style={{ width: '100%' }}
@ -102,24 +112,63 @@ export const UserList: React.FC<IProps> = (props) => {
props.GetUserInfo(row) props.GetUserInfo(row)
}} }}
> >
{row.activo == 1 ? 'Activo' : 'Inactivo'} {getProfile(row.idPerfil)}
</div> </div>
), ),
sortable: true, sortable: true
}, },
{
name: 'Estatus',
width: '90px',
cell: (row: IRegister) => (
<div
style={{ width: '100%', textAlign:'center' }}
onClick={() => {
props.GetUserInfo(row)
}}
>
{row.activo == 1 ? (
<IconContext.Provider value={{ color: 'green', size: '20px' }}>
<BsCheckCircleFill />
</IconContext.Provider>
) : (
<IconContext.Provider value={{ color: 'red', size: '20px' }}>
<BsFillPersonDashFill />
</IconContext.Provider>
)}
</div>
),
sortable: true
}
] ]
const getProfile = (Id: number) => {
const NoAsignado = ' - NO ASIGNADO -'
if (Id === 0) return NoAsignado
else if (DataPerfiles) {
const Profile = DataPerfiles.filter((item) => item.id === Id)
return Profile[0].perfil ? Profile[0].perfil : NoAsignado
}
return NoAsignado
}
useEffect(() => { useEffect(() => {
usuariosServices usuariosServices
.getAllUsuarios() .getAllUsuarios()
.then((response) => { .then((response) => {
// setUsuarios(response.data)
setData(response.data) setData(response.data)
setDataOriginal(response.data) setDataOriginal(response.data)
}) })
.catch((e: Error) => { .catch((e: Error) => {
console.log(e) console.log(e)
}) })
PerfilesServices.getAllPerfiles()
.then((response) => {
setDataPerfiles(response.data)
})
.catch((e: Error) => {
console.log(e)
})
}, [props.show]) }, [props.show])
const filtraReporte = (e: any) => { const filtraReporte = (e: any) => {
@ -141,9 +190,15 @@ export const UserList: React.FC<IProps> = (props) => {
} }
return props.show ? ( return props.show ? (
<Modal {...props} size='lg' aria-labelledby='contained-modal-title-vcenter' centered dialogClassName={'modal-70w'}> <Modal
{...props}
size="lg"
aria-labelledby="contained-modal-title-vcenter"
centered
dialogClassName={'modal-70w'}
>
<Modal.Header> <Modal.Header>
<Modal.Title id='contained-modal-title-vcenter'></Modal.Title> <Modal.Title id="contained-modal-title-vcenter"></Modal.Title>
</Modal.Header> </Modal.Header>
<Alert> <Alert>
<Row> <Row>
@ -152,9 +207,9 @@ export const UserList: React.FC<IProps> = (props) => {
</Col> </Col>
<Col xs={10}> <Col xs={10}>
<Form.Control <Form.Control
type='text' type="text"
size='sm' size="sm"
placeholder='Search...' placeholder="Search..."
onChange={(e) => { onChange={(e) => {
filtraReporte(e) filtraReporte(e)
}} }}

@ -6,4 +6,5 @@ export default interface IjwtStructure {
Usuario: string; Usuario: string;
Departamento: string; Departamento: string;
UserType: number, UserType: number,
Perfil: string
} }
Loading…
Cancel
Save