Commit 542416fd authored by Riri Novita's avatar Riri Novita

Update RO

parent 55cb53a9
...@@ -1088,6 +1088,37 @@ export default class TaxPlanning extends Component { ...@@ -1088,6 +1088,37 @@ export default class TaxPlanning extends Component {
} }
} }
handleValidateSimulasi() {
// let data = []
let errorContrl = this.state.buttonError
let editAble = this.state.editAble
// console.log(this.state.dataTable)
this.state.dataTable.map((i, index) => {
if (String(i[8]) == "Control (should be nil)") {
this.setState({ loading: true })
let n = 0
for (n = (this.props.quarter == 'q1' ? 12 : (this.props.quarter == 'q2' ? 15 : 18)); n <= 20; n++) {
if ((Number(i[n].tbf.value) < Number(this.state.minValue) || Number(i[n].tbf.value) > Number(this.state.maxValue))) {
errorContrl = true
editAble = true
break
}
else {
errorContrl = false
editAble = false
}
}
}
})
console.log(errorContrl)
console.log(editAble)
if (errorContrl === false && editAble === false) {
this.setState({ loading: false, buttonError: false, editable: false, saveDraft: false })
} else {
this.setState({ loading: false, buttonError: true, editable: true, saveDraft: false })
}
}
downloadTemplate = async () => { downloadTemplate = async () => {
let url = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/tax_planning/rolling_outlook/download_template?report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&quartal=${this.props.quarter}&&currency_id=${this.props.defaultCurrency.id}` let url = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/tax_planning/rolling_outlook/download_template?report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&quartal=${this.props.quarter}&&currency_id=${this.props.defaultCurrency.id}`
console.log(url); console.log(url);
...@@ -6607,6 +6638,29 @@ export default class TaxPlanning extends Component { ...@@ -6607,6 +6638,29 @@ export default class TaxPlanning extends Component {
</button> </button>
</div> </div>
<div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}> <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
<button
className="button"
type="button"
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
outline: 'none',
marginRight: 20
}}
onClick={() => {
// this.forceUpdate()
this.setState({ loading: true, buttonDraft: false }, () => {
setTimeout(() => {
this.handleValidateSimulasi()
}, 100);
})
}}
>
<div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960' }}>
<Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Calculate</Typography>
</div>
</button>
<button <button
type="button" type="button"
// disabled={this.state.buttonError} // disabled={this.state.buttonError}
......
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