primer avance al proceso de heineken

feature/ConsolidarPedimentos_20231229
Felix Morales 1 year ago
parent 651e2e9cab
commit f616dfc2d9
  1. 8
      src/Components/Corresponsales/Partidas/Partidas.tsx
  2. 257
      src/Components/Corresponsales/TraficoCorresponsales.tsx
  3. 6
      src/Components/Login/login.tsx
  4. 100
      src/Components/Reportes/RptCorresponsalesTraficos.tsx

@ -22,6 +22,10 @@ export const Partidas: FC<IProps> = (props) => {
const stickyValue = window.localStorage.getItem('Departamento') const stickyValue = window.localStorage.getItem('Departamento')
return stickyValue !== null ? JSON.parse(stickyValue) : '' return stickyValue !== null ? JSON.parse(stickyValue) : ''
}) })
const [Perfil, setPerfil] = useState(() => {
const stickyValue = window.localStorage.getItem('Perfil')
return stickyValue !== null ? JSON.parse(stickyValue) : ''
})
const [ShowModal, setShowModal] = useState(false) const [ShowModal, setShowModal] = useState(false)
const [MsgDialogDelete, setMsgDialogDelete] = useState(false) const [MsgDialogDelete, setMsgDialogDelete] = useState(false)
const [IDPartida, setIDPartida] = useState(0) const [IDPartida, setIDPartida] = useState(0)
@ -178,7 +182,7 @@ export const Partidas: FC<IProps> = (props) => {
<Col> <Col>
<Button <Button
style={{ style={{
visibility: Depto === 'Corresponsalias' ? 'visible' : 'hidden' visibility: Depto === 'Corresponsalias' || Perfil === 'heineken' ? 'visible' : 'hidden'
}} }}
variant="primary" variant="primary"
onClick={() => { onClick={() => {
@ -210,7 +214,7 @@ export const Partidas: FC<IProps> = (props) => {
setShowModal(false) setShowModal(false)
}} }}
size={'sm'} size={'sm'}
dialogClassName={'modal-50w'} dialogClassName={'modal-70w'}
> >
<Modal.Body> <Modal.Body>
<div style={{ height: '400px', overflow: 'scroll' }}> <div style={{ height: '400px', overflow: 'scroll' }}>

@ -153,6 +153,10 @@ export default function TraficoCorresponsales (props:IProps) {
const stickyValue = window.localStorage.getItem('Departamento') const stickyValue = window.localStorage.getItem('Departamento')
return stickyValue !== null ? JSON.parse(stickyValue) : '' return stickyValue !== null ? JSON.parse(stickyValue) : ''
}) })
const [Perfil, setPerfil] = useState(() => {
const stickyValue = window.localStorage.getItem('Perfil')
return stickyValue !== null ? JSON.parse(stickyValue) : ''
})
const mCorresponsales = useSelector( const mCorresponsales = useSelector(
(state: RootState) => state.CatCorresponsales.CatCorresponsales (state: RootState) => state.CatCorresponsales.CatCorresponsales
) )
@ -472,7 +476,7 @@ export default function TraficoCorresponsales (props:IProps) {
}) })
} }
setIDTrafico(response.data.id) setIDTrafico(response.data.id)
if (Ready4NextProcess && TerminaProceso >= 0) { if (Ready4NextProcess && TerminaProceso >= 0 && Depto === 'Corresponsalias') {
if(Proceso === 1) { if(Proceso === 1) {
setNextStepModalHeader("Referencia completa"); setNextStepModalHeader("Referencia completa");
setNextStepModalBody("Esta referencia se encuentra completa ¿Desea enviarla a contabilidad?") setNextStepModalBody("Esta referencia se encuentra completa ¿Desea enviarla a contabilidad?")
@ -850,7 +854,9 @@ export default function TraficoCorresponsales (props:IProps) {
setChangePermission(true) setChangePermission(true)
} else if (Depto === 'Corresponsalias' && Proceso > 1) { } else if (Depto === 'Corresponsalias' && Proceso > 1) {
setChangePermission(false) setChangePermission(false)
} else setChangePermission(false) } else if (Perfil === 'heineken' && Proceso <= 1){
setChangePermission(true)
}else setChangePermission(false)
} }
if (IDTrafico === 0) { if (IDTrafico === 0) {
setChangePermission(true) setChangePermission(true)
@ -1353,29 +1359,31 @@ export default function TraficoCorresponsales (props:IProps) {
} }
const getCentroCostos = (idCliente: number) => { const getCentroCostos = (idCliente: number) => {
if(idCliente > 0){ if(Perfil !== 'heineken'){
CentrosCostosService.get(idCliente) if(idCliente > 0){
.then(response => { CentrosCostosService.get(idCliente)
if(response.status === 204){ .then(response => {
setHeader('Informativo') if(response.status === 204){
setMsg('Centro de costos no asignado. Solicitar a servicios administrativos la asignacion del centro de costos del cliente.') setHeader('Informativo')
setMsg('Centro de costos no asignado. Solicitar a servicios administrativos la asignacion del centro de costos del cliente.')
setShowMsg(true)
return
}
setCentroCostos(response.data)
})
.catch((e: Error) => {
setHeader('Error')
setMsg('Ocurrio un error: ' + e)
setShowMsg(true) setShowMsg(true)
return return
} });
setCentroCostos(response.data) }
})
.catch((e: Error) => {
setHeader('Error')
setMsg('Ocurrio un error: ' + e)
setShowMsg(true)
return
});
} }
} }
return ( return (
<div> <div style={{height:'100%', overflowY:'scroll'}}>
<Card className="labelSize13px" style={{borderStyle:'none', height:'40rem', overflowY:'scroll'}}> <Card className="labelSize13px" style={{borderStyle:'none', height:'100%'}}>
<Card.Body className={StatusColor}> <Card.Body className={StatusColor}>
<Card> <Card>
<Card.Header> <Card.Header>
@ -1705,7 +1713,7 @@ export default function TraficoCorresponsales (props:IProps) {
</Card> </Card>
<br /> <br />
<Tabs <Tabs
defaultActiveKey="InformacionGeneral" defaultActiveKey= {Perfil === 'heineken'? "InformacionCorresponsal" : "InformacionGeneral"}
id="uncontrolled-tab-example" id="uncontrolled-tab-example"
className="mb-3" className="mb-3"
style={{visibility: IDTrafico !== 0 ? 'visible' : 'hidden'}} style={{visibility: IDTrafico !== 0 ? 'visible' : 'hidden'}}
@ -1714,6 +1722,7 @@ export default function TraficoCorresponsales (props:IProps) {
eventKey="InformacionGeneral" eventKey="InformacionGeneral"
title="Informacion general" title="Informacion general"
id="TabInformacionGeneral" id="TabInformacionGeneral"
tabClassName={Perfil === 'heineken' ? 'd-none' : ''}
> >
<Card <Card
style={{ visibility: IDTrafico !== 0 ? 'visible' : 'hidden' }} style={{ visibility: IDTrafico !== 0 ? 'visible' : 'hidden' }}
@ -2797,7 +2806,7 @@ export default function TraficoCorresponsales (props:IProps) {
<Tab <Tab
eventKey="InformacionAdicional" eventKey="InformacionAdicional"
title="Informacion adicional" title="Informacion adicional"
tabClassName={mCFacturas.length >= 2 ? '' : 'd-none'} tabClassName={mCFacturas.length >= 2 && Perfil !== 'heineken' ? '' : 'd-none'}
> >
<Card> <Card>
<Card.Body> <Card.Body>
@ -3234,31 +3243,29 @@ export default function TraficoCorresponsales (props:IProps) {
<Card> <Card>
<Card.Body> <Card.Body>
{CatTiposDocumento ? ( {CatTiposDocumento ? (
<div> <Row className="g-1">
<Row xs={1} md={3} className="g-1"> {CatTiposDocumento.map((c) => {
{CatTiposDocumento.map((c) => { return (
return ( <Col key={c.id} xs={4}>
<Col key={c.id}> <Card
<Card style={{ width: '100%', textAlign: 'center', height:'100%' }}
style={{ width: '28rem', textAlign: 'center' }} key={c.id}
key={c.id} >
> <Card.Body key={c.id}>
<Card.Body key={c.id}> <MFileManager
<MFileManager key={c.id}
key={c.id} IDTrafico={IDTrafico}
IDTrafico={IDTrafico} Proceso={c.proceso}
Proceso={c.proceso} showPreview={3}
showPreview={3} canEdit={Depto === 'Corresponsalias'}
canEdit={Depto === 'Corresponsalias'} Leyenda={'Seleccione: ' + c.descripcion}
Leyenda={'Seleccione: ' + c.descripcion} />
/> </Card.Body>
</Card.Body> </Card>
</Card> </Col>
</Col> )
) })}
})} </Row>
</Row>
</div>
) : null} ) : null}
</Card.Body> </Card.Body>
</Card> </Card>
@ -3290,7 +3297,7 @@ export default function TraficoCorresponsales (props:IProps) {
id="FechaEntrada" id="FechaEntrada"
size="sm" size="sm"
value={FEntrada} value={FEntrada}
disabled={Depto !== 'Corresponsalias'} disabled={Depto !== 'Corresponsalias' && Perfil !== 'heineken'}
onChange={(e) => setFEntrada(e.target.value)} onChange={(e) => setFEntrada(e.target.value)}
/> />
</Col> </Col>
@ -3301,7 +3308,7 @@ export default function TraficoCorresponsales (props:IProps) {
id="FechaRevalidacionGuia" id="FechaRevalidacionGuia"
size="sm" size="sm"
value={FRevalidacionGuia} value={FRevalidacionGuia}
disabled={Depto !== 'Corresponsalias'} disabled={Depto !== 'Corresponsalias' && Perfil !== 'heineken'}
onChange={(e) => setFRevalidacionGuia(e.target.value)} onChange={(e) => setFRevalidacionGuia(e.target.value)}
/> />
</Col> </Col>
@ -3332,7 +3339,7 @@ export default function TraficoCorresponsales (props:IProps) {
<Col> <Col>
<CurrencyFormat <CurrencyFormat
value={Fletes} value={Fletes}
disabled={Depto !== 'Corresponsalias'} disabled={Depto !== 'Corresponsalias' && Perfil !== 'heineken'}
thousandSeparator={true} thousandSeparator={true}
onValueChange={(values: any) => { onValueChange={(values: any) => {
const { value } = values const { value } = values
@ -3364,7 +3371,7 @@ export default function TraficoCorresponsales (props:IProps) {
<CurrencyFormat <CurrencyFormat
value={Seguros} value={Seguros}
thousandSeparator={true} thousandSeparator={true}
disabled={Depto !== 'Corresponsalias'} disabled={Depto !== 'Corresponsalias' && Perfil !== 'heineken'}
onValueChange={(values: any) => { onValueChange={(values: any) => {
const { value } = values const { value } = values
setSeguros(value) setSeguros(value)
@ -3395,7 +3402,7 @@ export default function TraficoCorresponsales (props:IProps) {
<CurrencyFormat <CurrencyFormat
value={Embalaje} value={Embalaje}
thousandSeparator={true} thousandSeparator={true}
disabled={Depto !== 'Corresponsalias'} disabled={Depto !== 'Corresponsalias' && Perfil !== 'heineken'}
onValueChange={(values: any) => { onValueChange={(values: any) => {
const { value } = values const { value } = values
setEmbalaje(value) setEmbalaje(value)
@ -3426,7 +3433,7 @@ export default function TraficoCorresponsales (props:IProps) {
<CurrencyFormat <CurrencyFormat
value={Otros} value={Otros}
thousandSeparator={true} thousandSeparator={true}
disabled={Depto !== 'Corresponsalias'} disabled={Depto !== 'Corresponsalias' && Perfil !== 'heineken'}
onValueChange={(values: any) => { onValueChange={(values: any) => {
const { value } = values const { value } = values
setOtros(value) setOtros(value)
@ -3473,7 +3480,7 @@ export default function TraficoCorresponsales (props:IProps) {
id="FechaInicioGastosAlmacenaje" id="FechaInicioGastosAlmacenaje"
size="sm" size="sm"
value={FAlmacenajeInicioGastos} value={FAlmacenajeInicioGastos}
disabled={Depto !== 'Corresponsalias'} disabled={Depto !== 'Corresponsalias' && Perfil !== 'heineken'}
onChange={(e) => onChange={(e) =>
setFAlmacenajeInicioGastos(e.target.value) setFAlmacenajeInicioGastos(e.target.value)
} }
@ -3484,7 +3491,7 @@ export default function TraficoCorresponsales (props:IProps) {
<CurrencyFormat <CurrencyFormat
value={CostoDiario} value={CostoDiario}
thousandSeparator={true} thousandSeparator={true}
disabled={Depto !== 'Corresponsalias'} disabled={Depto !== 'Corresponsalias' && Perfil !== 'heineken'}
onValueChange={(values: any) => { onValueChange={(values: any) => {
const { value } = values const { value } = values
setCostoDiario(value) setCostoDiario(value)
@ -3515,7 +3522,7 @@ export default function TraficoCorresponsales (props:IProps) {
<CurrencyFormat <CurrencyFormat
value={TotalPagar} value={TotalPagar}
thousandSeparator={true} thousandSeparator={true}
disabled={Depto !== 'Corresponsalias'} disabled={Depto !== 'Corresponsalias' && Perfil !== 'heineken'}
onValueChange={(values: any) => { onValueChange={(values: any) => {
const { value } = values const { value } = values
setTotalPagar(value) setTotalPagar(value)
@ -3565,35 +3572,23 @@ export default function TraficoCorresponsales (props:IProps) {
<CurrencyFormat <CurrencyFormat
value={TipoCambio} value={TipoCambio}
prefix={'$'} prefix={'$'}
displayType={ displayType='input'
Depto === 'Corresponsalias' ? 'input' : 'text' readOnly= {Depto !== 'Corresponsalias' ? true : false}
}
thousandSeparator={true} thousandSeparator={true}
onValueChange={(values: any) => { onValueChange={(values: any) => {
const { value } = values const { value } = values
setTipoCambio(value) setTipoCambio(value)
}} }}
style={ style={{
Depto === 'Corresponsalias' fontSize: '18px',
? { backgroundColor: '#F5FFED',
fontSize: '18px', border: '2px solid #25D05B',
backgroundColor: '#F5FFED', width: '100%',
border: '2px solid #25D05B', textAlign: 'right',
width: '100px', borderRadius: '10px',
textAlign: 'right', paddingRight: '10px',
borderRadius: '10px' paddingLeft: '10px'
} }}
: {
fontSize: '18px',
backgroundColor: '#F5FFED',
border: '2px solid #25D05B',
width: '100px',
textAlign: 'right',
borderRadius: '10px',
paddingRight: '5px',
paddingLeft: '5px'
}
}
/> />
</Col> </Col>
</Row> </Row>
@ -3607,7 +3602,7 @@ export default function TraficoCorresponsales (props:IProps) {
id="FechaDespacho" id="FechaDespacho"
size="sm" size="sm"
value={FDespacho} value={FDespacho}
disabled={Depto !== 'Corresponsalias'} disabled={Depto !== 'Corresponsalias' && Perfil !== 'heineken'}
onChange={(e) => setFDespacho(e.target.value)} onChange={(e) => setFDespacho(e.target.value)}
/> />
</Col> </Col>
@ -3621,7 +3616,7 @@ export default function TraficoCorresponsales (props:IProps) {
as="select" as="select"
className="form-select form-select-sm" className="form-select form-select-sm"
value={Estatus} value={Estatus}
disabled={Depto !== 'Corresponsalias' ? true : false} disabled={Depto !== 'Corresponsalias' && Perfil !== 'heineken'}
onChange={(e) => { onChange={(e) => {
setEstatus(parseInt(e.target.value)) setEstatus(parseInt(e.target.value))
}} }}
@ -3646,56 +3641,56 @@ export default function TraficoCorresponsales (props:IProps) {
<Col xs={12}> <Col xs={12}>
<Partidas <Partidas
IDTrafico={IDTrafico} IDTrafico={IDTrafico}
canEdit={Depto === 'Corresponsalias'} canEdit={Depto === 'Corresponsalias' || Perfil === 'heineken'}
/> />
</Col> </Col>
</Row> </Row>
<Row style={{ paddingTop: 10 }}> <Row style={{ paddingTop: 10 }}>
<Card> <Col xs={12}>
<Card.Body> <Card>
{CatTiposDocumento ? ( <Card.Body>
<div> {CatTiposDocumento ? (
<Row xs={1} md={3} className="g-1"> <Row xs={1} md={3} className="g-1">
{CatTiposDocumentoInfoCorresponsal {CatTiposDocumentoInfoCorresponsal
? CatTiposDocumentoInfoCorresponsal.map((c) => { ? CatTiposDocumentoInfoCorresponsal.map((c) => {
return ( return (
<Col key={c.id}> <Col key={c.id}>
<Card <Card
style={{ style={{
width: '28rem', textAlign: 'center',
textAlign: 'center' height:'100%'
}} }}
> >
<Card.Body> <Card.Body>
<FileManager <FileManager
IDUser={UserId} IDUser={UserId}
width={400} width={'100%'}
height={100} height={100}
IDProcess={c.proceso} IDProcess={c.proceso}
IdFile={IDTrafico} IdFile={IDTrafico}
FileName={''} FileName={''}
canDelete={ canDelete={
Depto === 'Corresponsalias' Depto === 'Corresponsalias' && Perfil !== 'heineken'
} }
FileType={['pdf']} FileType={['pdf']}
setBackgroundColor={c.id} setBackgroundColor={c.id}
Prefijo={c.descripcion} Prefijo={c.descripcion}
Leyenda={`Seleccione el archivo ${c.descripcion}, arrastrelo hasta aqui y sueltelo para subirlo al servidor...`} Leyenda={`Seleccione el archivo ${c.descripcion}, arrastrelo hasta aqui y sueltelo para subirlo al servidor...`}
onAppendFM={function ( onAppendFM={function (
idFile: number idFile: number
): void {}} ): void {}}
/> />
</Card.Body> </Card.Body>
</Card> </Card>
</Col> </Col>
) )
}) })
: ''} : ''}
</Row> </Row>
</div> ) : null}
) : null} </Card.Body>
</Card.Body> </Card>
</Card> </Col>
</Row> </Row>
<Row> <Row>
<Col xs={12}> <Col xs={12}>
@ -3704,7 +3699,7 @@ export default function TraficoCorresponsales (props:IProps) {
IDTrafico={IDTrafico} IDTrafico={IDTrafico}
Proceso={10} Proceso={10}
showPreview={1} showPreview={1}
canEdit={Depto === 'Corresponsalias'} canEdit={Depto === 'Corresponsalias' || Perfil === 'heineken'}
Leyenda={'Selecciones las imagenes de previo...'} Leyenda={'Selecciones las imagenes de previo...'}
/> />
</Col> </Col>
@ -3713,7 +3708,7 @@ export default function TraficoCorresponsales (props:IProps) {
<Tab <Tab
eventKey="CuentasComplementarias" eventKey="CuentasComplementarias"
title="Cuentas complementarias" title="Cuentas complementarias"
tabClassName="" tabClassName={Perfil === 'heineken' ? 'd-none' : ''}
> >
<Row> <Row>
<Col xs={12}> <Col xs={12}>
@ -3727,7 +3722,7 @@ export default function TraficoCorresponsales (props:IProps) {
<Tab <Tab
eventKey="Rectificaciones" eventKey="Rectificaciones"
title="Rectificaciones" title="Rectificaciones"
tabClassName="" tabClassName={Perfil === 'heineken' ? 'd-none' : ''}
> >
{/* <Card> {/* <Card>
<Row> <Row>
@ -3854,7 +3849,7 @@ export default function TraficoCorresponsales (props:IProps) {
<div style={{ height: '350px', overflow: 'scroll' }}> <div style={{ height: '350px', overflow: 'scroll' }}>
<Partidas <Partidas
IDTrafico={IDTrafico} IDTrafico={IDTrafico}
canEdit={Depto === 'Corresponsalias'} canEdit={Depto === 'Corresponsalias' || Perfil === 'heineken'}
/> />
</div> </div>
) : null} ) : null}

@ -55,7 +55,11 @@ export const Login: React.FC<{}> = () => {
localStorage.setItem('UserType', JSON.stringify(values.UserType)) localStorage.setItem('UserType', JSON.stringify(values.UserType))
localStorage.setItem('Perfil', JSON.stringify(values.Perfil)) localStorage.setItem('Perfil', JSON.stringify(values.Perfil))
dispatch(logued(true)) dispatch(logued(true))
navigate('/') if(values.Perfil === 'heineken'){
navigate('/RptCorresponsalesTraficos/proc=1/modo=1')
}else{
navigate('/')
}
}) })
.catch((e: AxiosError) => { .catch((e: AxiosError) => {
localStorage.setItem('menu', '') localStorage.setItem('menu', '')

@ -597,52 +597,54 @@ export default function RptCorresponsalesTraficos(props: IProps) {
</Form.Control> </Form.Control>
</Form.Label> </Form.Label>
</Col> </Col>
<Col lg={4}> {(Depto === 'Corresponsalias' || Depto === 'Sistemas')? <>
<Form.Label style={{width:'100%', fontSize:'smaller'}}> <Col lg={4}>
Cliente <Form.Label style={{width:'100%', fontSize:'smaller'}}>
<Form.Control Cliente
as='select' <Form.Control
onChange={(e) => { as='select'
setCliente(parseInt(e.target.value)) onChange={(e) => {
}} setCliente(parseInt(e.target.value))
className='form-select form-select-sm' }}
> className='form-select form-select-sm'
<option value='0'>-SELECCIONE-</option> >
{Clientes <option value='0'>-SELECCIONE-</option>
? Clientes.map((c) => { {Clientes
return ( ? Clientes.map((c) => {
<option value={c.sClave} key={c.sClave}> return (
{c.sRazonSocial} <option value={c.sClave} key={c.sClave}>
</option> {c.sRazonSocial}
) </option>
}) )
: null} })
</Form.Control> : null}
</Form.Label> </Form.Control>
</Col> </Form.Label>
<Col lg={4}> </Col>
<Form.Label style={{width:'100%', fontSize:'smaller'}}> <Col lg={4}>
Corresponsal <Form.Label style={{width:'100%', fontSize:'smaller'}}>
<Form.Control Corresponsal
as='select' <Form.Control
onChange={(e) => { as='select'
setCorresponsal(parseInt(e.target.value)) onChange={(e) => {
}} setCorresponsal(parseInt(e.target.value))
className='form-select form-select-sm' }}
> className='form-select form-select-sm'
<option value='0'>-SELECCIONE-</option> >
{DataCorresponsales <option value='0'>-SELECCIONE-</option>
? DataCorresponsales.map((c) => { {DataCorresponsales
return ( ? DataCorresponsales.map((c) => {
<option value={c.id} key={c.id}> return (
{c.nombre} <option value={c.id} key={c.id}>
</option> {c.nombre}
) </option>
}) )
: null} })
</Form.Control> : null}
</Form.Label> </Form.Control>
</Col> </Form.Label>
</Col></> : ""
}
</Row> </Row>
<Row style={{paddingTop:'10px'}}> <Row style={{paddingTop:'10px'}}>
<Col lg={12} style={{textAlign:'end'}}> <Col lg={12} style={{textAlign:'end'}}>
@ -683,7 +685,7 @@ export default function RptCorresponsalesTraficos(props: IProps) {
<BsFileEarmarkExcel /> <BsFileEarmarkExcel />
&nbsp; Excel &nbsp; Excel
</Button> </Button>
{ parseInt(proc!.replace('proc=', '')) === 1 && parseInt(modo!.replace('modo=', '')) === 1? <> { (Depto === 'Corresponsalias' || Depto === 'Sistemas') ? <>
<Form.Control type="file" style={{display:'none'}} onChange={readFile} ref={hiddenFileInputRef}/> <Form.Control type="file" style={{display:'none'}} onChange={readFile} ref={hiddenFileInputRef}/>
<Button <Button
id="BtnLoadTxt" id="BtnLoadTxt"
@ -730,11 +732,11 @@ export default function RptCorresponsalesTraficos(props: IProps) {
> >
<Modal.Body <Modal.Body
style={{ style={{
maxHeight: 'calc(90vh)', height: 'calc(90vh)',
overflowY: 'auto', overflowY: 'auto',
}} }}
> >
<div> <div style={{height:'100%'}}>
<TraficoCorresponsales <TraficoCorresponsales
IDTrafico={IDTrafico} IDTrafico={IDTrafico}
onClose={function (val: boolean): void { onClose={function (val: boolean): void {

Loading…
Cancel
Save