Commit 77702b09 authored by Deni Rinaldi's avatar Deni Rinaldi

lastperiod OI

parent f51e4e68
...@@ -40,7 +40,9 @@ export default class OperatingIndicator extends Component { ...@@ -40,7 +40,9 @@ export default class OperatingIndicator extends Component {
messageAlert: '', messageAlert: '',
buttonCreate: true, buttonCreate: true,
buttonEdit: true, buttonEdit: true,
buttonDelete: true buttonDelete: true,
lastPeriod: '',
latestPeriode: ''
} }
this.fileHandler = this.fileHandler.bind(this); this.fileHandler = this.fileHandler.bind(this);
} }
...@@ -237,7 +239,7 @@ export default class OperatingIndicator extends Component { ...@@ -237,7 +239,7 @@ export default class OperatingIndicator extends Component {
options: periodeData, options: periodeData,
getOptionLabel: (option) => option.periode, getOptionLabel: (option) => option.periode,
}; };
let periode = (this.state.latestPeriode == "" ? String(Number(currentYear) + 1) : this.state.latestPeriode) let periode = (this.state.lastPeriod == "" ? String(Number(currentYear) + 1) : this.state.lastPeriod)
let index = data.sort((a, b) => a - b).findIndex((val) => val === periode) let index = data.sort((a, b) => a - b).findIndex((val) => val === periode)
this.setState({ listPeriode: defaultProps, periode: index == -1 ? periodeData[0] : periodeData[index] }, () => { this.setState({ listPeriode: defaultProps, periode: index == -1 ? periodeData[0] : periodeData[index] }, () => {
this.getReport() this.getReport()
......
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