Fixed strange behaviour on opening and closing the Invoice detail on the clasification report from

featureBotClasifcacion
alfonso 1 year ago
parent 18b1428632
commit dfe741a194
  1. 25
      src/Components/Clientes/Amazon/Reportes/Clasification/Pending/RptAmazonPendingClasificationInvoices.tsx

@ -114,8 +114,7 @@ export default function RtpAmazonPendingInvoices(
} }
const toggleExpandRow = (row: I2096Headers) => { const toggleExpandRow = (row: I2096Headers) => {
//if (!row.max) if (!row.max) check4Updates(row.id)
check4Updates(row.id)
let Invoice: I2096Headers[] = mInvoices.filter((item) => item.id === row.id) let Invoice: I2096Headers[] = mInvoices.filter((item) => item.id === row.id)
const Obj = { ...Invoice[0] } const Obj = { ...Invoice[0] }
Obj.max = !Obj.max Obj.max = !Obj.max
@ -309,10 +308,11 @@ export default function RtpAmazonPendingInvoices(
} }
const RunBOT = (row: I2096Headers) => { const RunBOT = (row: I2096Headers) => {
if (!BOTEnabled) { if (!BOTEnabled || row.max) {
toggleExpandRow(row) toggleExpandRow(row)
return false return false
} }
if (BOTEnabled && !row.max) {
setWaitingMessage('BOT trabajando...') setWaitingMessage('BOT trabajando...')
setWaitingDialog(true) setWaitingDialog(true)
DSAmazon.ClasificacionBOT(row.id) DSAmazon.ClasificacionBOT(row.id)
@ -335,6 +335,7 @@ export default function RtpAmazonPendingInvoices(
return return
}) })
} }
}
return ( return (
<div> <div>
@ -350,9 +351,17 @@ export default function RtpAmazonPendingInvoices(
</Card.Title> </Card.Title>
</Col> </Col>
<Col xs={3}></Col> <Col xs={3}></Col>
<Col xs={2} style={{ paddingTop: '20px' }}> <Col xs={2}>
<Form> <Row style={{}}>
<Form.Check // prettier-ignore <Col xs={4} style={{ textAlign: 'right' }}>
<IconContext.Provider
value={{ color: 'green', size: '65px' }}
>
<VscHubot />
</IconContext.Provider>
</Col>
<Col xs={8} style={{ textAlign: 'left', paddingTop: '25px' }}>
<Form.Check
type="switch" type="switch"
id="custom-switch" id="custom-switch"
label="¿Aplica BOT?" label="¿Aplica BOT?"
@ -361,7 +370,9 @@ export default function RtpAmazonPendingInvoices(
setBOTEnabled(!BOTEnabled) setBOTEnabled(!BOTEnabled)
}} }}
/> />
</Form> </Col>
</Row>
<Form></Form>
</Col> </Col>
<Col xs={2}> <Col xs={2}>
<Alert <Alert

Loading…
Cancel
Save