Commit ac71facb authored by Riri Novita's avatar Riri Novita

Merge branch 'master' of http://103.44.149.204/d.arizona/tia-dev into riri

parents 38df86c4 7794bcff
...@@ -266,22 +266,6 @@ export default class SubHolding extends Component { ...@@ -266,22 +266,6 @@ export default class SubHolding extends Component {
} }
getReportType() { getReportType() {
console.log('sini deh')
let data = this.state.listPeriode.options
let currentYear = new Date().getFullYear()
let periode = (this.state.lastPeriod == "" ? String(Number(currentYear) + 1) : this.state.lastPeriod)
let dateNow = new Date()
dateNow.setMonth(dateNow.getMonth() - 1);
let yearNow = dateNow.getFullYear()
// console.log(data)
// console.log(yearNow)
// console.log(periode)
if (String(this.state.report.label).toLocaleLowerCase().includes('summary')) {
let index = data.sort((a, b) => a - b).findIndex((val) => val.periode == yearNow)
// console.log(index)
this.setState({periode: data[index]})
}
let payload = { let payload = {
"company_id": this.state.company.company_id, "company_id": this.state.company.company_id,
"periode": this.state.periode.periode, "periode": this.state.periode.periode,
...@@ -3049,7 +3033,25 @@ export default class SubHolding extends Component { ...@@ -3049,7 +3033,25 @@ export default class SubHolding extends Component {
getOptionLabel={(option) => titleCase(option.label)} getOptionLabel={(option) => titleCase(option.label)}
id="typereport" id="typereport"
onChange={(event, newInputValue) => this.setState({ report: newInputValue, loading: true, previewTable: false }, () => { onChange={(event, newInputValue) => this.setState({ report: newInputValue, loading: true, previewTable: false }, () => {
console.log('sini deh')
let data = this.state.listPeriode.options
let currentYear = new Date().getFullYear()
let periode = (this.state.lastPeriod == "" ? String(Number(currentYear) + 1) : this.state.lastPeriod)
let dateNow = new Date()
dateNow.setMonth(dateNow.getMonth() - 1);
let yearNow = dateNow.getFullYear()
// console.log(data)
// console.log(yearNow)
// console.log(periode)
if (String(this.state.report.label).toLocaleLowerCase().includes('summary')) {
let index = data.sort((a, b) => a - b).findIndex((val) => val.periode == yearNow)
// console.log(index)
this.setState({periode: data[index]}, () => {
this.getReportType() this.getReportType()
})
} else {
this.getReportType()
}
})} })}
disableClearable disableClearable
style={{ width: 250 }} style={{ width: 250 }}
......
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