feature creacion del reporte mensual de newell

feature/ConsolidarPedimentos_20231229
Felix Morales 1 year ago
parent 68b77d7918
commit d6be08190b
  1. 14
      src/Classes/Corresponsales/CCorresponsalesTrafico.ts
  2. 564
      src/Components/Corresponsales/TraficoCorresponsales.tsx
  3. 174
      src/Components/ReportesClientes/ReporteMensualNewell.tsx
  4. 6
      src/Components/ReportesClientes/ReporteSemanalNewel.tsx
  5. 4
      src/Components/Utils/FileManager/FileManager.tsx
  6. 4
      src/Interfaces/Corresponsales/ICorresponsalTrafico.ts
  7. 2
      src/Interfaces/ReportesClientes/IReporteOperacionesNewell.ts
  8. 4
      src/Services/Corresponsalias/Corresponsales.Trafico.Services.ts
  9. 10
      src/Services/Reportes/reportesNewell.services.ts
  10. 4
      src/Services/Utils/FileManager.Services.ts
  11. 5
      src/css/generic01.css
  12. 2
      src/index.tsx
  13. 4
      src/store/features/Corresponsales/CorresponsalesTraficoSlice.ts

@ -42,7 +42,9 @@ export default class CCorresponsalesTrafico implements ICorresponsalTrafico {
noRecti: number;
estatusCode: number;
activo?: number;
idTipoMercancia: number | null;
idTipoMercancia: number | null;
cargoA: number;
causaRectificacion: string;
constructor() {
this.id=0
@ -87,6 +89,8 @@ export default class CCorresponsalesTrafico implements ICorresponsalTrafico {
this.estatusCode=0;
this.activo=1
this.idTipoMercancia=null;
this.cargoA = 0;
this.causaRectificacion = ''
}
public getEmptyObject(): ICorresponsalTrafico {
@ -132,7 +136,9 @@ export default class CCorresponsalesTrafico implements ICorresponsalTrafico {
noRecti:0,
estatusCode:0,
activo :1 ,
idTipoMercancia: null
idTipoMercancia: null,
cargoA: 0,
causaRectificacion: ''
}
}
@ -179,7 +185,9 @@ export default class CCorresponsalesTrafico implements ICorresponsalTrafico {
noRecti: data.noRecti,
estatusCode: data.estatusCode,
activo : data.activo,
idTipoMercancia: data.idTipoMercancia,
idTipoMercancia: data.idTipoMercancia,
cargoA: data.cargoA,
causaRectificacion: data.causaRectificacion
}
}
}

@ -136,6 +136,7 @@ interface IAduanas {
export default function TraficoCorresponsales (props:IProps) {
const URL = new TargetURL()
const token = localStorage.getItem('token');
const dispatch = useDispatch()
const [UserId, setUserId] = useState(() => {
const stickyValue = window.localStorage.getItem('UserId')
@ -303,6 +304,10 @@ export default function TraficoCorresponsales (props:IProps) {
const [showNextStepModal, setShowNexStepModal] = useState<boolean>(false);
const [nextStepModalHeader, setNextStepModalHeader] = useState<string>("");
const [nextStepModalBody, setNextStepModalBody] = useState<string>("");
const [CargoPara, setCargoPara] = useState(0);
const [CausaRectificacion, setCausaRectificacion] = useState('');
const [EncabezadoPedimento1, setEncabezadoPedimento1] = useState("Pedimento");
const [EncabezadoPedimento2, setEncabezadoPedimento2] = useState(".");
const FechaRegistro = currentDate()
const msgColor = 'primary'
@ -400,6 +405,8 @@ export default function TraficoCorresponsales (props:IProps) {
data.fechaCuenta = FechaCuenta
data.idTabulador = IDTabulador
data.idTipoMercancia = IDTipoMercancia
data.cargoA = CargoPara
data.causaRectificacion = CausaRectificacion
CTrafDataService.Append(data)
.then((response) => {
if (response.data.estatusCode === 0) {
@ -689,6 +696,8 @@ export default function TraficoCorresponsales (props:IProps) {
setNoCuenta(response.data.noCuenta)
setFechaCuenta(setDate(response.data.fechaCuenta))
setIDTipoMercancia(response.data.idTipoMercancia);
setCargoPara(response.data.cargoA)
setCausaRectificacion(response.data.causaRectificacion)
})
.catch((e: Error) => {
setHeader('Error')
@ -723,7 +732,10 @@ export default function TraficoCorresponsales (props:IProps) {
const loadRectificacionHistorico = () => {
CTrafDataService.GetRectificacionHistorico(IDTrafico)
.then((response) => {
if (response.data.id > 0) {
setEncabezadoPedimento1("Pedimento Rectificado")
setEncabezadoPedimento2("Pedimento Original")
setAduanaH(response.data.aduana.toString())
setPatenteH(response.data.patente.toString())
setPedimentoH(response.data.pedimento.toString())
@ -1296,7 +1308,11 @@ export default function TraficoCorresponsales (props:IProps) {
await axios.post(
URL.get() +
`/FileManager/AppendFileByProcess?IdUsuario=${UserId}&Proceso=${31}&Tags=${IDTrafico}&crud=1`,
formData
formData, {
headers:{
'Authorization': 'Bearer ' + token
}
}
);
/*const url = URL.createObjectURL(blob);
const link = document.createElement("a");
@ -1522,6 +1538,7 @@ export default function TraficoCorresponsales (props:IProps) {
<option value="2">Ferocarril</option>
<option value="3">Maritimo</option>
<option value="4">Terrestre</option>
<option value="5">Regularizacion</option>
</Form.Control>
</Col>
<Col sm={3} md={3} lg={3}>
@ -1538,6 +1555,7 @@ export default function TraficoCorresponsales (props:IProps) {
<option value="2">Ferocarril</option>
<option value="3">Maritimo</option>
<option value="4">Terrestre</option>
<option value="5">Regularizacion</option>
</Form.Control>
</Col>
</Row>
@ -1765,126 +1783,113 @@ export default function TraficoCorresponsales (props:IProps) {
</Row>
</Col>
</Row>
<Row style={{padding: "5px 0"}}>
<Row style={{padding: "5px 0"}}>
<Col sm={12} md={12} lg={6}>
<Row className='justify-content-around' style={{alignItems:'center'}}>
<Col sm={2} md={1} lg={1}>
<Form.Label>Trafico</Form.Label>
</Col>
<fieldset className='border p-2'>
<legend className='w-auto' style={{float:'none', fontSize:'1rem'}}>{EncabezadoPedimento1}</legend>
<Row className='justify-content-between' style={{alignItems:'center'}}>
<Col sm={3} md={3} lg={3}>
<Form.Control
type="text"
id="Trafico"
size="sm"
value={Trafico}
disabled={
Depto !== 'Corresponsalias' ? true : false
}
onChange={(e) => {
setTrafico(e.target.value)
}}
/>
</Col>
<Col sm={1} md={1} lg={2}>
<Form.Label>Aduana</Form.Label>
<Form.Label>
Trafico
<Form.Control
type="text"
id="Trafico"
size="sm"
value={Trafico}
disabled={
Depto !== 'Corresponsalias' ? true : false
}
onChange={(e) => {
setTrafico(e.target.value)
}}
/>
</Form.Label>
</Col>
<Col sm={2} md={3} lg={2}>
<Form.Control
type="text"
id="Aduana"
size="sm"
disabled={true}
value={Aduana}
/>
</Col>
<Col sm={1} md={1} lg={2}>
<Form.Label>Patente</Form.Label>
<Form.Label>
Aduana
<Form.Control
type="text"
id="Aduana"
size="sm"
disabled={true}
value={Aduana}
/>
</Form.Label>
</Col>
<Col sm={2} md={3} lg={2}>
<Form.Control
type="text"
id="Patente"
size="sm"
disabled={true}
value={Patente}
/>
<Form.Label>
Patente
<Form.Control
type="text"
id="Patente"
size="sm"
disabled={true}
value={Patente}
/>
</Form.Label>
</Col>
</Row>
</Col>
<Col sm={12} md={12} lg={6}>
<Row className='justify-content-around' style={{alignItems:'center'}}>
<Col sm={2} md={2}>
<Form.Label
onClick={() => {
openSOIA()
}}
style={{ cursor: 'pointer' }}
>
Pedimento
<Col sm={2} md={2} lg={3}>
<Form.Label>
<span
onClick={() => {
openSOIA()
}}
style={{ cursor: 'pointer' }}
>
Pedimento
</span>
<CurrencyFormat
value={Pedimento}
displayType='input'
readOnly= {Depto !== 'Corresponsalias' ? true : false}
format={'### ####'}
mask="_"
onValueChange={(values: any) => {
const { value } = values
setPedimento(value.length === 0 ? 0 : value)
if(value.length === 7 ){
CTrafDataService.ValidaTraficoDuplicado(Aduana, Patente, value).then( response => {
if(response.data !== ""){
setHeader('Informativo')
setMsg(`Ya existe un registro con los mismos datos de aduana, patente y pedimento con el folio: ${response.data}`)
setShowMsg(true)
}
})
}
}}
style={{
fontSize: '18px',
backgroundColor: '#FEFDF5',
border: '2px solid #837F5D',
width: '100%',
textAlign: 'right',
borderRadius: '10px'
}}
/>
</Form.Label>
</Col>
<Col sm={2} md={2}>
<CurrencyFormat
value={Pedimento}
displayType={
Depto === 'Corresponsalias' ? 'input' : 'text'
}
format={'### ####'}
mask="_"
onValueChange={(values: any) => {
const { value } = values
setPedimento(value.length === 0 ? 0 : value)
if(value.length === 7 ){
CTrafDataService.ValidaTraficoDuplicado(Aduana, Patente, value).then( response => {
if(response.data !== ""){
setHeader('Informativo')
setMsg(`Ya existe un registro con los mismos datos de aduana, patente y pedimento con el folio: ${response.data}`)
setShowMsg(true)
}
})
</Row>
<Row className='justify-content-between' style={{alignItems:'center'}}>
<Col sm={3} md={3} lg={3}>
<Form.Label>
Clave
<Form.Control
type="text"
id="Clave"
size="sm"
value={ClavePedimento}
disabled={
Depto !== 'Corresponsalias' ? true : false
}
}}
style={
Depto === 'Corresponsalias'
? {
fontSize: '18px',
backgroundColor: '#FEFDF5',
border: '2px solid #837F5D',
width: '100%',
textAlign: 'right',
borderRadius: '10px'
}
: {
fontSize: '16px',
backgroundColor: '#FEFDF5',
border: '2px solid #837F5D',
width: '100%',
textAlign: 'right',
borderRadius: '10px'
}
}
/>
</Col>
<Col sm={1} md={1}>
<Form.Label>Clave</Form.Label>
</Col>
<Col sm={3} md={3}>
<Form.Control
type="text"
id="Clave"
size="sm"
value={ClavePedimento}
disabled={
Depto !== 'Corresponsalias' ? true : false
}
onChange={(e) => setClavePedimento(e.target.value)}
/>
</Col>
<Col sm={1} md={1}>
<Form.Label>Fec. Pago</Form.Label>
onChange={(e) => setClavePedimento(e.target.value)}
/>
</Form.Label>
</Col>
<Col sm={3} md={3}>
<Form.Control
<Form.Label>
Fec. Pago
<Form.Control
type="date"
id="FechaPago"
size="sm"
@ -1893,19 +1898,58 @@ export default function TraficoCorresponsales (props:IProps) {
Depto !== 'Corresponsalias' ? true : false
}
onChange={(e) => setFechaPago(e.target.value)}
/>
</Form.Label>
</Col>
<Col xs={6}>
<Form.Label style={{width:'100%', visibility: AduanaH === '' ? 'hidden':'visible'}}>
Cargo A
<Form.Control
as="select"
className="form-select form-select-sm"
value={CargoPara}
disabled={
Depto !== 'Corresponsalias' ? true : false
}
onChange={(e) => {
setCargoPara(parseInt(e.target.value))
}}
>
<option value="0">-SELECCIONE-</option>
<option value="1">CLIENTE</option>
<option value="2">CORRESPONSAL</option>
</Form.Control>
</Form.Label>
</Col>
</Row>
<Row className='justify-content-between' style={{alignItems:'center'}}>
<Col sm={3}>
<Form.Label style={{visibility: AduanaH === '' ? 'hidden':'visible'}}>Causa Rectificacion:</Form.Label>
</Col>
<Col sm={9}>
<Form.Control
as="textarea"
id="Observacion"
size="sm"
value={CausaRectificacion}
disabled={Depto !== 'Corresponsalias'}
onChange={(e) => setCausaRectificacion(e.target.value)}
style={{visibility: AduanaH === '' ? 'hidden':'visible'}}
/>
</Col>
</Row>
</fieldset>
</Col>
</Row>
<Row style={{padding: "5px 0"}}>
<Col sm={12} md={12} lg={6}>
<Row className='justify-content-around' style={{alignItems:'center'}}>
<fieldset className='border p-2' style={{height:'100%'}}>
<legend className='w-auto' style={{float:'none', fontSize:'1rem'}}>{EncabezadoPedimento2}</legend>
<Row className='justify-content-between' style={{alignItems:'center', paddingTop:'15px'}}>
<Col sm={5} md={4} lg={4} style={{visibility: (IDTrafico>0 && !(AduanaH.length>0 && PatenteH.length>0 && PedimentoH.length>0 && FechaPagoH.length>0)) ? 'visible' : 'hidden' }}>
<Button variant="success" onClick={()=>{generaRectificacion()}}>Generar rectificacion</Button>
</Col>
<Button variant="success" disabled={Depto !== 'Corresponsalias'} onClick={()=>{generaRectificacion()}}>Generar rectificacion</Button>
</Col>
<Col sm={1} md={1} lg={2}>
<Form.Label>Aduana</Form.Label>
<Form.Label>Aduana</Form.Label>
</Col>
<Col sm={2} md={3} lg={2}>
<CurrencyFormat
@ -1919,7 +1963,9 @@ export default function TraficoCorresponsales (props:IProps) {
color: '#5923F6',
width: '100%',
textAlign: 'right',
borderRadius: '10px'
borderRadius: '10px',
paddingRight: '10px',
paddingLeft: '10px'
}}
/>
</Col>
@ -1927,89 +1973,94 @@ export default function TraficoCorresponsales (props:IProps) {
<Form.Label>Patente</Form.Label>
</Col>
<Col sm={2} md={3} lg={2}>
<CurrencyFormat
value={PatenteH}
disabled={true}
displayType={'input'}
style={{
fontSize: '18px',
backgroundColor: '#F1EEF9',
border: '2px solid #5923F6',
color: '#5923F6',
width: '100%',
textAlign: 'right',
borderRadius: '10px'
}}
/>
<CurrencyFormat
value={PatenteH}
disabled={true}
displayType={'input'}
style={{
fontSize: '18px',
backgroundColor: '#F1EEF9',
border: '2px solid #5923F6',
color: '#5923F6',
width: '100%',
textAlign: 'right',
borderRadius: '10px',
paddingRight: '10px',
paddingLeft: '10px'
}}
/>
</Col>
</Row>
</Col>
<Col sm={12} md={12} lg={6}>
<Row className='justify-content-around' style={{alignItems:'center'}}>
<Col sm={2} md={2}>
<Form.Label style={{ cursor: 'pointer' }}>
Pedimento
</Form.Label>
<Row className='justify-content-between' style={{alignItems:'center', paddingTop:'15px'}}>
<Col sm={2} md={2} lg={2}>
<Form.Label style={{ cursor: 'pointer' }}>
Pedimento
</Form.Label>
</Col>
<Col sm={2} md={2}>
<CurrencyFormat
value={PedimentoH}
disabled={true}
displayType={'input'}
format={'### ####'}
style={{
fontSize: '18px',
backgroundColor: '#F1EEF9',
border: '2px solid #5923F6',
color: '#5923F6',
width: '100%',
textAlign: 'right',
borderRadius: '10px'
}}
/>
<Col sm={2} md={2} lg={3}>
<CurrencyFormat
value={PedimentoH}
disabled={true}
displayType={'input'}
format={'### ####'}
style={{
fontSize: '18px',
backgroundColor: '#F1EEF9',
border: '2px solid #5923F6',
color: '#5923F6',
width: '100%',
textAlign: 'right',
borderRadius: '10px',
paddingRight: '10px',
paddingLeft: '10px'
}}
/>
</Col>
<Col sm={1} md={1}>
<Form.Label>Clave</Form.Label>
<Form.Label>Clave</Form.Label>
</Col>
<Col sm={3} md={3}>
<Form.Control
type="text"
id="ClavePedimentoH"
size="sm"
value={ClavePedimentoH}
disabled={true}
style={{
fontSize: '18px',
backgroundColor: '#F1EEF9',
border: '2px solid #5923F6',
color: '#5923F6',
width: '100%',
textAlign: 'right',
borderRadius: '10px'
}}
/>
<Col sm={3} md={3}lg={2}>
<Form.Control
type="text"
id="ClavePedimentoH"
size="sm"
value={ClavePedimentoH}
disabled={true}
style={{
fontSize: '18px',
backgroundColor: '#F1EEF9',
border: '2px solid #5923F6',
color: '#5923F6',
width: '100%',
textAlign: 'right',
borderRadius: '10px'
}}
/>
</Col>
<Col sm={1} md={1}>
<Form.Label>Fec. Pago</Form.Label>
<Form.Label>Fec. Pago</Form.Label>
</Col>
<Col sm={3} md={3}>
<CurrencyFormat
value={FechaPagoH}
disabled={true}
format={'##/##/####'}
displayType={'input'}
style={{
fontSize: '18px',
backgroundColor: '#F1EEF9',
border: '2px solid #5923F6',
color: '#5923F6',
width: '100%',
textAlign: 'right',
borderRadius: '10px'
}}
/>
<CurrencyFormat
value={FechaPagoH}
disabled={true}
format={'##/##/####'}
displayType={'input'}
style={{
fontSize: '18px',
backgroundColor: '#F1EEF9',
border: '2px solid #5923F6',
color: '#5923F6',
width: '100%',
textAlign: 'right',
borderRadius: '10px',
paddingRight: '10px',
paddingLeft: '10px'
}}
/>
</Col>
</Row>
</fieldset>
</Col>
</Row>
<Row style={{padding: "5px 0"}}>
@ -2024,35 +2075,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: '100%',
textAlign: 'right',
borderRadius: '10px'
}
: {
fontSize: '18px',
backgroundColor: '#F5FFED',
border: '2px solid #25D05B',
width: '100%',
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>
<Col sm={2} md={2} lg={2}>
@ -2064,35 +2103,23 @@ export default function TraficoCorresponsales (props:IProps) {
<CurrencyFormat
value={ValorAduanaMN}
prefix={'$'}
displayType={
Depto === 'Corresponsalias' ? 'input' : 'text'
}
displayType='input'
readOnly= {Depto !== 'Corresponsalias' ? true : false}
thousandSeparator={true}
onValueChange={(values: any) => {
const { value } = values
setValorAduanaMN(value)
}}
style={
Depto === 'Corresponsalias'
? {
fontSize: '18px',
backgroundColor: '#F5FFED',
border: '2px solid #25D05B',
width: '100%',
textAlign: 'right',
borderRadius: '10px'
}
: {
fontSize: '18px',
backgroundColor: '#F5FFED',
border: '2px solid #25D05B',
width: '100%',
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>
@ -2108,35 +2135,23 @@ export default function TraficoCorresponsales (props:IProps) {
<CurrencyFormat
value={TotalPagado}
prefix={'$'}
displayType={
Depto === 'Corresponsalias' ? 'input' : 'text'
}
displayType='input'
readOnly= {Depto !== 'Corresponsalias' ? true : false}
thousandSeparator={true}
onValueChange={(values: any) => {
const { value } = values
setTotalPagado(value)
}}
style={
Depto === 'Corresponsalias'
? {
fontSize: '18px',
backgroundColor: '#F5FFED',
border: '2px solid #25D05B',
width: '100%',
textAlign: 'right',
borderRadius: '10px'
}
: {
fontSize: '18px',
backgroundColor: '#F5FFED',
border: '2px solid #25D05B',
width: '100%',
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>
<Col sm={2} md={2} lg={2}>
@ -2253,27 +2268,16 @@ export default function TraficoCorresponsales (props:IProps) {
setValorFacturasDls(value)
}}
readOnly={true}
style={
Depto === 'Corresponsalias'
? {
fontSize: '18px',
backgroundColor: '#F5FFED',
border: '2px solid #25D05B',
width: '100%',
textAlign: 'right',
borderRadius: '10px'
}
: {
fontSize: '18px',
backgroundColor: '#F5FFED',
border: '2px solid #25D05B',
width: '100%',
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>

@ -0,0 +1,174 @@
import { useEffect, useRef, useState } from "react";
import { Row, Col, Card, Button, Form } from "react-bootstrap";
import { FaRegFileExcel } from "react-icons/fa";
import { MdCloudUpload, MdDeleteForever, MdCloudDownload } from "react-icons/md";
import { MsgInformativo } from "../Utils/Toast/msgInformativo";
import reportesNewellServices from "../../Services/Reportes/reportesNewell.services";
import axios from "axios";
import { TargetURL } from "../../Constants/TargetURL";
import FileManager from "../Utils/FileManager/FileManager";
import FileManagerServices from "../../Services/Utils/FileManager.Services";
export const ReporteMensualNewell: React.FC<{}> = () => {
const [Mes, setMes] = useState('Septiembre')
const [show, setShowMsg] = useState(false)
const [header, setHeader] = useState('')
const [msg, setMsg] = useState('')
const [msgColor, setMsgColor] = useState('primary')
const [UserId, setUserId] = useState(() => {
const stickyValue = window.localStorage.getItem('UserId')
return stickyValue !== null ? JSON.parse(stickyValue) : 0
});
const [IdTrailasFile, setIdTrailasFile] = useState(0);
const [IdOpCdAcunaFile, setIdOpCdAcunaFile] = useState(0);
const [IdOpMyMFile, setIdOpMyMFile] = useState(0);
const GenerarReporteMensualNewell = async () => {
if (IdTrailasFile === 0 || IdOpCdAcunaFile === 0 || IdOpMyMFile === 0){
setHeader('Error')
setMsg('Asegurese de cargar todos los archivos para continuar.')
setShowMsg(true)
return;
}
reportesNewellServices.getReporteMensual(IdTrailasFile, IdOpCdAcunaFile, IdOpMyMFile)
.then((response) => {
const url = window.URL.createObjectURL(new Blob([response.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', `ReporteMensual_${Mes}.xlsx`);
document.body.appendChild(link);
link.click();
}).catch(error => {
console.log(error);
});
}
const convertFile = (fileId: number, process: number) => {
FileManagerServices.ConvertFile(fileId, process).then((resp: any) => console.log(resp));
}
return (
<>
<Row style={{paddingTop:'7rem'}}></Row>
<Row>
<Col xs={4}></Col>
<Col xs={4}>
<Card style={{width:'100%'}}>
<Card.Header><h4>Reporte Mensual Newell</h4></Card.Header>
<Card.Body>
<Row className="justify-content-center">
<Col xs={6}>
<Form.Label style={{width:'100%'}}>
Mes
<Form.Control
as="select"
id="CmbOpEntrada"
onChange={(e) => setMes(e.target.value)}
value={Mes}
className="form-select form-select-sm"
>
<option value="Enero">Enero</option>
<option value="Febrero">Febrero</option>
<option value="Marzo">Marzo</option>
<option value="Abril">Abril</option>
<option value="Mayo">Mayo</option>
<option value="Junio">Junio</option>
<option value="Julio">Julio</option>
<option value="Agosto">Agosto</option>
<option value="Septiembre">Septiembre</option>
<option value="Octubre">Octubre</option>
<option value="Noviembre">Noviembre</option>
<option value="Diciembre">Diciembre</option>
</Form.Control>
</Form.Label>
</Col>
</Row>
<br/>
<Row style={{justifyContent:'center', alignItems:'center', padding:'0px 20px 0px 20px'}}>
<form
style={{
display: 'flex', flexDirection:'column', justifyContent:'center',
alignItems:'center', height: '280px', width:'500px'
}}
>
<div style={{
width:'100%', padding:'10px', margin:'5px 0', display:'flex', alignItems:'center', justifyContent: 'space-between',
border:'2px dashed rgb(20,117,207)', borderRadius:'5px'
}}>
<FileManager
width={'25rem'}
height={200}
IDProcess={32}
IDUser={UserId}
IdFile={0}
FileName={''}
canDelete={true}
FileType={['xls']}
Leyenda={
'Seleccione el reporte de trailas'
}
onAppendFM={function (idFile: number): void { setIdTrailasFile(idFile); convertFile(idFile, 32);}}
/>
</div>
<div style={{
width:'100%', padding:'10px', margin:'5px 0', display:'flex', alignItems:'center', justifyContent: 'space-between',
border:'2px dashed rgb(20,117,207)', borderRadius:'5px'
}}>
<FileManager
width={'25rem'}
height={200}
IDProcess={33}
IDUser={UserId}
IdFile={0}
FileName={''}
canDelete={true}
FileType={['xls']}
Leyenda={
'Seleccione el excel de operaciones de Cd. Acuña'
}
onAppendFM={function (idFile: number): void { setIdOpCdAcunaFile(idFile); convertFile(idFile, 33); }}
/>
</div>
<div style={{
width:'100%', padding:'10px', margin:'5px 0', display:'flex', alignItems:'center', justifyContent: 'space-between',
border:'2px dashed rgb(20,117,207)', borderRadius:'5px'
}}>
<FileManager
width={'25rem'}
height={200}
IDProcess={34}
IDUser={UserId}
IdFile={0}
FileName={''}
canDelete={true}
FileType={['xlsx']}
Leyenda={
'Seleccione el excel de operaciones de Lazaro Cardenas'
}
onAppendFM={function (idFile: number): void { setIdOpMyMFile(idFile);}}
/>
</div>
</form>
</Row>
</Card.Body>
<Card.Footer style={{textAlign:'end'}}>
<Button className="primary" onClick={GenerarReporteMensualNewell} title="Descargar reporte">
Generar <MdCloudDownload style={{marginLeft:'5px'}}/>
</Button>
</Card.Footer>
</Card>
</Col>
<Col xs={4}></Col>
</Row>
<MsgInformativo
show={show}
msg={msg}
header={header}
msgColor={msgColor}
closeToast={() => {
setShowMsg(false)
}}
/>
</>
)
}

@ -5,7 +5,7 @@ import * as XLSX from 'xlsx'
import CTrafDataService from '../../Services/Corresponsalias/Corresponsales.Trafico.Services'
import { MsgInformativo } from "../Utils/Toast/msgInformativo";
import { FaRegFileExcel } from "react-icons/fa";
import IReporteSemanalNewell from "../../Interfaces/ReportesClientes/IReporteSemanalNewell";
import IReporteOperacionesNewell from "../../Interfaces/ReportesClientes/IReporteOperacionesNewell";
export const ReporteSemanalNewell: React.FC<{}> = () => {
@ -56,14 +56,14 @@ export const ReporteSemanalNewell: React.FC<{}> = () => {
const oldWorkSheetName = oldWorkBook.SheetNames[0]//se toma el nombre de la primer hoja del archivo
const oldWorkSheet = oldWorkBook.Sheets[oldWorkSheetName]//Se crea una referencia a la misma hoja
XLSX.utils.sheet_add_aoa(oldWorkSheet,encabezadosTemp,{origin:'A1'});//Se cambian los encabezados originales por los temporales para que las columnas coincidan con las propiedades del dto IReporteSemanalNewell
const rows = XLSX.utils.sheet_to_json<IReporteSemanalNewell>(oldWorkSheet)//aqui es donde los renglones pasan a ser un array de objetos
const rows = XLSX.utils.sheet_to_json<IReporteOperacionesNewell>(oldWorkSheet)//aqui es donde los renglones pasan a ser un array de objetos
//Se obtienen los datos faltantes del reporte
let newWorkBookData = await getDataByPedimento(rows);
await exportReporteSemanal(newWorkBookData);
}
}
const getDataByPedimento = async (rows: IReporteSemanalNewell[]) => {
const getDataByPedimento = async (rows: IReporteOperacionesNewell[]) => {
let data = [...rows];
data=[];
await Promise.all(

@ -19,7 +19,7 @@ interface IProps {
Leyenda: string
canDelete: boolean
FileType: string[]
width: number
width: number | string
height: number
onDelete?: (val: boolean) => void
setBackgroundColor?: number
@ -206,7 +206,7 @@ export const FileManager: FC<IProps> = (props) => {
</div>
<Container className='labelSize13px'>
{Archivo?.nombreArchivo ? (
<Alert variant='primary'>
<Alert variant='primary' style={{margin:'0px'}}>
<Row>
<Col xs={11}>
<span style={{ fontWeight: 'bold' }}>{props.Prefijo ? props.Prefijo : 'Archivo'}</span> : &nbsp;

@ -40,5 +40,7 @@ export default interface ICorresponsalTrafico {
noRecti: number,
estatusCode: number,
activo?: number,
idTipoMercancia: number | null
idTipoMercancia: number | null,
cargoA: number,
causaRectificacion: string,
}

@ -1,4 +1,4 @@
export default interface IReporteSemanalNewell{
export default interface IReporteOperacionesNewell{
aduana: number; patente: number; pedimento: number; fechaDeEntrada: string|Date; fechaDePago: string|Date;
valorComercialMxn: number; valorComercialDlls: number; valorAduana: number; clave: string; iva: number;
dta: number; prv: number; lgi: number; factura: string; tc: number; proveedor: string; taxId: number; producto: string;

@ -6,7 +6,7 @@ import DTOTraficoCompleto from "../../DTO/Corresponsales/DTOTraficoCompleto";
import IRespuesta from "../../Interfaces/IRespuesta";
import ICorresponsalRectificacionHistorico from "../../Interfaces/Corresponsales/ICorresponsalRectificacionHistorico";
import DTORectificacionHistorico from "../../DTO/Corresponsales/DTORectificacionHistorico";
import IReporteSemanalNewell from "../../Interfaces/ReportesClientes/IReporteSemanalNewell";
import IReporteOperacionesNewell from "../../Interfaces/ReportesClientes/IReporteOperacionesNewell";
class Corresponsales_Trafico_DataService {
GetAll(id: number) {
@ -14,7 +14,7 @@ class Corresponsales_Trafico_DataService {
}
GetByPedimento(pedimento: number) {
return http.get<IReporteSemanalNewell>(`/Corresponsalias/Traficos/GetByPedimento?pedimento=${pedimento}`);
return http.get<IReporteOperacionesNewell>(`/Corresponsalias/Traficos/GetByPedimento?pedimento=${pedimento}`);
}
Append(data: ICorresponsalTrafico) {

@ -0,0 +1,10 @@
import http from "../common/http-common";
class ReportesNewellService{
getReporteMensual(IdTrailasFile: number, IdOpCdAcunaFile: number, IdOpMyMFile: number){
return http.get(`reportesNewell/ReporteMensual?idTrailasFile=${IdTrailasFile}&idRptCdAcunaFile=${IdOpCdAcunaFile}&idRptLazaroCardenasFile=${IdOpMyMFile}`, {responseType: 'blob'});
}
}
export default new ReportesNewellService();

@ -23,5 +23,9 @@ class FileManagerDataService {
return http.delete<IRespuesta>(`/FileManager/DeleteById/${id}`);
}
ConvertFile(fileId: number, process: number){
return http.get<IFileManager>(`/FileManager/ConvertExcel2New?id=${fileId}&Proceso=${process}`);
}
}
export default new FileManagerDataService();

@ -65,9 +65,10 @@
tr:nth-child(odd) { background-color: #f5f5f5; }
.hideDiv {
visibility: 'hidden';
display: none;
/*visibility: 'hidden';
height: '0px';
width: '0px';
width: '0px';*/
}
.hideRow {

@ -21,6 +21,7 @@ import PIN from './Components/Login/PIN'
import UserControl from './Components/UserControl/UserControl'
import ResetCredentials from './Components/Login/ResetCredentials'
import { ReporteSemanalNewell } from './Components/ReportesClientes/ReporteSemanalNewel'
import { ReporteMensualNewell } from './Components/ReportesClientes/ReporteMensualNewell'
require (`./css/${process.env.REACT_APP_ENVIRONMENT}-home.css`)
function PageNotFound() {
@ -73,6 +74,7 @@ root.render(
<Route path="/CatTabuladores" element={<CatTabuladores />} />
<Route path="*" element={<PageNotFound />} />
<Route path='newellSemanal' element={<ReporteSemanalNewell/>}/>
<Route path='newellMensual' element={<ReporteMensualNewell/>}/>
</Route>
</Routes>
</HashRouter>

@ -42,7 +42,9 @@ const CorresponsalesTrafico: ICorresponsalTrafico[] = [{
noRecti:0,
estatusCode:0,
activo: 0,
idTipoMercancia:0
idTipoMercancia:0,
cargoA: 0,
causaRectificacion: ''
}]
const initialState = { CorresponsalesTrafico }

Loading…
Cancel
Save