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')
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 [MsgDialogDelete, setMsgDialogDelete] = useState(false)
const [IDPartida, setIDPartida] = useState(0)
@ -178,7 +182,7 @@ export const Partidas: FC<IProps> = (props) => {
<Col>
<Button
style={{
visibility: Depto === 'Corresponsalias' ? 'visible' : 'hidden'
visibility: Depto === 'Corresponsalias' || Perfil === 'heineken' ? 'visible' : 'hidden'
}}
variant="primary"
onClick={() => {
@ -210,7 +214,7 @@ export const Partidas: FC<IProps> = (props) => {
setShowModal(false)
}}
size={'sm'}
dialogClassName={'modal-50w'}
dialogClassName={'modal-70w'}
>
<Modal.Body>
<div style={{ height: '400px', overflow: 'scroll' }}>

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

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

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

Loading…
Cancel
Save