Commit 21304aaf authored by r.kurnia's avatar r.kurnia

issue tp 15 & 16

parent 802d802c
...@@ -217,7 +217,7 @@ export default class TaxPlanning extends Component { ...@@ -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 }) this.setState({ dataTable, loading: false, buttonError: true, editable: true })
} else { } else {
this.setState({ loading: false, alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => { this.setState({ loading: false, alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
...@@ -946,8 +946,13 @@ export default class TaxPlanning extends Component { ...@@ -946,8 +946,13 @@ export default class TaxPlanning extends Component {
// console.log(tableMeta.rowData[8], baru, anjay, total); // console.log(tableMeta.rowData[8], baru, anjay, total);
if (String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX") { if (String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX") {
total = R.equals(total, NaN) ? "0.00" : Number(total).toFixed(2) total = R.equals(total, NaN) ? "0.00" : Number(total).toFixed(2)
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = total if (total < 0) {
return total total = 0
return total
} else {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = total
return total
}
} else { } else {
total = R.equals(total, NaN) ? "0.0" : Number(total).toFixed(1) total = R.equals(total, NaN) ? "0.0" : Number(total).toFixed(1)
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = total dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = total
...@@ -1164,7 +1169,16 @@ export default class TaxPlanning extends Component { ...@@ -1164,7 +1169,16 @@ export default class TaxPlanning extends Component {
if (dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf.value == undefined) { if (dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf.value == undefined) {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf = Number(total).toFixed(1) dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf = Number(total).toFixed(1)
} else { } else {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf.value = Number(total).toFixed(1) if (tableMeta.rowData[8] == "Corporate Income Tax") {
if (Number(dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf.value) < 0) {
total = 0
} else {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf.value = Number(total).toFixed(1)
}
} else {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf.value = Number(total).toFixed(1)
}
} }
} }
...@@ -1203,9 +1217,27 @@ export default class TaxPlanning extends Component { ...@@ -1203,9 +1217,27 @@ export default class TaxPlanning extends Component {
} }
} else { } else {
if (dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf.value == undefined) { if (dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf.value == undefined) {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf = total if (tableMeta.rowData[8] == "Corporate Income Tax") {
if (Number(dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf) < 0) {
total = 0
} else {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf = Number(total)
}
} else {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf = Number(total)
}
} else { } else {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf.value = total if (tableMeta.rowData[8] == "Corporate Income Tax") {
if (Number(dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf.value) < 0) {
total = 0
} else {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf.value = Number(total)
}
} else {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf.value = Number(total)
}
} }
} }
...@@ -8207,7 +8239,7 @@ export default class TaxPlanning extends Component { ...@@ -8207,7 +8239,7 @@ export default class TaxPlanning extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleForecast(tableMeta, Number(this.props.periode) + 2, 3)).toFixed(1)} value={Number(handleForecast(tableMeta, Number(this.props.periode) + 1, 3)).toFixed(1)}
/> : /> :
<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> <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 <NumberFormat
...@@ -8224,7 +8256,7 @@ export default class TaxPlanning extends Component { ...@@ -8224,7 +8256,7 @@ export default class TaxPlanning extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleForecast(tableMeta, Number(this.props.periode) + 2, 3)).toFixed(1)} value={Number(handleForecast(tableMeta, Number(this.props.periode) + 1, 3)).toFixed(1)}
/> />
</LightTooltip> </LightTooltip>
: :
......
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