Commit ca479ecb authored by rifkaki's avatar rifkaki

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

parents d0e51ac2 0e519cba
...@@ -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,
...@@ -662,7 +646,7 @@ export default class SubHolding extends Component { ...@@ -662,7 +646,7 @@ export default class SubHolding extends Component {
PLID = null PLID = null
} }
this.setState({ PLID }, () => { this.setState({ PLID }, () => {
let payloads = {...payload, submission_id: this.state.PLID, months: this.state.month.month_id, quarter: 0} let payloads = {...payload, report_id: 28, submission_id: this.state.PLID, months: this.state.month.month_id, quarter: 0}
console.log(payloads); console.log(payloads);
api.create().getReportPL(payloads).then(response => { api.create().getReportPL(payloads).then(response => {
console.log(response); console.log(response);
...@@ -2911,7 +2895,7 @@ export default class SubHolding extends Component { ...@@ -2911,7 +2895,7 @@ export default class SubHolding extends Component {
} }
} else if (this.state.report.value === 3) { } else if (this.state.report.value === 3) {
let res = await fetch( let res = await fetch(
`${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/db_profit_loss/export_report?submission_id=${this.state.PLID === null ? "" : this.state.PLID}&&report_id=${this.state.report.value}&&company_id=${this.state.company.company_id}&&year=${this.state.periode.periode}&&revision=${this.state.revisionType}` `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/db_profit_loss/export_report?submission_id=${this.state.PLID === null ? "" : this.state.PLID}&&report_id=28&&company_id=${this.state.company.company_id}&&year=${this.state.periode.periode}&&revision=${this.state.revisionType}`
) )
res = await res.blob() res = await res.blob()
this.setState({ loading: false }) this.setState({ loading: false })
...@@ -2923,10 +2907,10 @@ export default class SubHolding extends Component { ...@@ -2923,10 +2907,10 @@ export default class SubHolding extends Component {
a.click(); a.click();
} }
} else if (this.state.report.value === 4) { } else if (this.state.report.value === 4) {
let url = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/db_ratio/export_report?submission_id=${this.state.FRID === null ? "" : this.state.FRID}&&report_id=${this.state.report.value}&&company_id=${this.state.company.company_id}&&year=${this.state.periode.periode}&&revision=${this.state.revisionType}` let url = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/db_ratio/export_report?submission_id=${this.state.FRID === null ? "" : this.state.FRID}&&report_id=29&&company_id=${this.state.company.company_id}&&year=${this.state.periode.periode}&&revision=${this.state.revisionType}`
console.log(url); console.log(url);
let res = await fetch( let res = await fetch(
`${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/db_ratio/export_report?submission_id=${this.state.FRID === null ? "" : this.state.FRID}&&report_id=${this.state.report.value}&&company_id=${this.state.company.company_id}&&year=${this.state.periode.periode}&&revision=${this.state.revisionType}` `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/db_ratio/export_report?submission_id=${this.state.FRID === null ? "" : this.state.FRID}&&report_id=29&&company_id=${this.state.company.company_id}&&year=${this.state.periode.periode}&&revision=${this.state.revisionType}`
) )
res = await res.blob() res = await res.blob()
this.setState({ loading: false }) this.setState({ loading: false })
...@@ -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 }, () => {
this.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]}, () => {
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