Commit 0d006551 authored by Dida Adams Arizona's avatar Dida Adams Arizona

Merge branch 'rifka' into 'master'

tp mb issue handleTotal should be nil karena status close

See merge request !729
parents 05e03f42 d44c7b0e
......@@ -125,7 +125,7 @@ export default class TaxPlanning extends Component {
"submission_id": this.props.submissionID
}
api.create().getDetailReportMB(payload).then(response => {
// console.log(response);
console.log(response);
let dataTable = []
if (response.data) {
if (response.data.status == 'success') {
......@@ -217,7 +217,7 @@ export default class TaxPlanning extends Component {
}
}
})
// console.log(dataTable)
console.log(dataTable)
this.setState({ dataTable, loading: false, buttonError: true, editable: true })
} else {
this.setState({ loading: false, alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
......@@ -1269,9 +1269,16 @@ export default class TaxPlanning extends Component {
let total = 0
dataTable2[tableMeta.rowIndex].map((item, index) => {
if (index >= 9 && index <= 20) {
let indexChild = item.tbf.formula.findIndex((val) => val.periode === periode)
if (indexChild !== -1) {
total += Number(item.tbf.formula[indexChild].value)
if (this.props.status === 'CLOSED') {
let indexChild = item.tbf
if (indexChild !== -1) {
total += Number(item.tbf)
}
} else {
let indexChild = item.tbf.formula.findIndex((val) => val.periode === periode)
if (indexChild !== -1) {
total += Number(item.tbf.formula[indexChild].value)
}
}
}
})
......@@ -8131,22 +8138,59 @@ export default class TaxPlanning extends Component {
}
/>
</div> :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value.tbf}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
tableMeta.rowData[3] === 7 ?
(Number(handleForecast(tableMeta, Number(this.props.periode) + 1, 3)).toFixed(3) >= Number(this.state.minValue) && Number(handleForecast(tableMeta, Number(this.props.periode) + 1, 3)).toFixed(3) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'black'
}}
type="text"
placeholder=""
disabled={true}
value={Number(handleForecast(tableMeta, Number(this.props.periode) + 1, 3)).toFixed(3)}
/> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[25].tbf}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat
thousandSeparator={true}
style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'red'
}}
type="text"
placeholder=""
disabled={true}
value={Number(value.tbf).toFixed(3)}
value={Number(handleForecast(tableMeta, Number(this.props.periode) + 1, 3)).toFixed(3)}
/>
}
/>
</div>
</LightTooltip>
:
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value.tbf}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value.tbf).toFixed(3)}
/>
}
/>
</div>
:
tableMeta.rowData[3] === 3 ?
<div style={{ flex: 1 }}>
......@@ -8660,22 +8704,59 @@ export default class TaxPlanning extends Component {
}
/>
</div> :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value.tbf}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
tableMeta.rowData[3] === 7 ?
(Number(handleForecast(tableMeta, Number(this.props.periode) + 2, 3)).toFixed(3) >= Number(this.state.minValue) && Number(handleForecast(tableMeta, Number(this.props.periode) + 2, 3)).toFixed(3) <= Number(this.state.maxValue)) ?
<NumberFormat
thousandSeparator={true}
style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'black'
}}
type="text"
placeholder=""
disabled={true}
value={Number(handleForecast(tableMeta, Number(this.props.periode) + 2, 3)).toFixed(3)}
/> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[25].tbf}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat
thousandSeparator={true}
style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'red'
}}
type="text"
placeholder=""
disabled={true}
value={Number(value.tbf).toFixed(3)}
value={Number(handleForecast(tableMeta, Number(this.props.periode) + 2, 3)).toFixed(3)}
/>
}
/>
</div>
</LightTooltip>
:
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value.tbf}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value.tbf).toFixed(3)}
/>
}
/>
</div>
:
tableMeta.rowData[3] === 3 ?
<div style={{ flex: 1 }}>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment