Commit 709526c1 authored by Dida Adams Arizona's avatar Dida Adams Arizona

Merge branch 'didam' into 'master'

Didam

See merge request !1040
parents 4f64f80c af86bc39
......@@ -1086,7 +1086,7 @@ export default class SubHolding extends Component {
}
}
})
this.setState({ dataTable, previewTable: true, loading: false, previewDownload: false })
this.setState({ dataTable, previewTable: true, loading: false, previewDownload: true })
// this.setState({ dataTable }, () => {
// console.log(this.state.dataTable)
......@@ -2271,7 +2271,7 @@ export default class SubHolding extends Component {
}
} else if (this.state.report.value === 3) {
let res = await fetch(
`${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/db_profit_loss_detail/export_master_budget?submission_id=${this.state.submissionID === null ? "" : this.state.submissionID}&&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.submissionID === null ? "" : this.state.submissionID}&&report_id=${this.state.report.value}&&company_id=${this.state.company.company_id}&&year=${this.state.periode.periode}&&revision=${this.state.revisionType}`
)
res = await res.blob()
this.setState({ loading: false })
......@@ -2283,10 +2283,10 @@ export default class SubHolding extends Component {
a.click();
}
} else if (this.state.report.value === 4) {
let url = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction//db_ratio/export_master_budget?submission_id=${this.state.submissionID === null ? "" : this.state.submissionID}&&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.submissionID === null ? "" : this.state.submissionID}&&report_id=${this.state.report.value}&&company_id=${this.state.company.company_id}&&year=${this.state.periode.periode}&&revision=${this.state.revisionType}`
console.log(url);
let res = await fetch(
`${process.env.REACT_APP_URL_MAIN_BE}/public/transaction//db_ratio/export_master_budget?submission_id=${this.state.submissionID === null ? "" : this.state.submissionID}&&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.submissionID === null ? "" : this.state.submissionID}&&report_id=${this.state.report.value}&&company_id=${this.state.company.company_id}&&year=${this.state.periode.periode}&&revision=${this.state.revisionType}`
)
res = await res.blob()
this.setState({ loading: false })
......@@ -2297,6 +2297,21 @@ export default class SubHolding extends Component {
a.download = 'Report DB Financial Ratio.xlsx';
a.click();
}
} else if (this.state.report.value === 21) {
let url = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/db_operating_indicator/export_report?operating_indicator_id=${this.state.OPID === null ? "" : this.state.OPID}&&report_id=${this.state.report.value}&&company_id=${this.state.company.company_id}&&year=${this.state.periode.periode}`
console.log(url);
let res = await fetch(
`${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/db_operating_indicator/export_report?operating_indicator_id=${this.state.OPID === null ? "" : this.state.OPID}&&report_id=${this.state.report.value}&&company_id=${this.state.company.company_id}&&year=${this.state.periode.periode}`
)
res = await res.blob()
this.setState({ loading: false })
if (res.size > 0) {
let url = window.URL.createObjectURL(res);
let a = document.createElement('a');
a.href = url;
a.download = 'Report DB Operating Indicator.xlsx';
a.click();
}
} else {
setTimeout(() => {
this.setState({ loading: false })
......@@ -2363,7 +2378,7 @@ export default class SubHolding extends Component {
renderInput={(params) => <TextField {...params} label="Company" margin="normal" style={{ marginTop: 7 }} />}
value={this.state.company}
/>
{this.state.report != null ? String(this.state.report.label).toLocaleLowerCase().includes('summary') ? <Autocomplete
{/* {this.state.report != null ? String(this.state.report.label).toLocaleLowerCase().includes('summary') ? <Autocomplete
{...this.state.listUom}
// getOptionLabel={(option) => titleCase(option.label)}
id="uom"
......@@ -2374,7 +2389,7 @@ export default class SubHolding extends Component {
style={{ width: 250, marginLeft: 10 }}
renderInput={(params) => <TextField {...params} label="Uom" margin="normal" style={{ marginTop: 7 }} />}
value={this.state.uom}
/> : null : null}
/> : null : null} */}
</div>
<div style={{ marginTop: 15, display: 'flex' }}>
<Autocomplete
......@@ -2391,18 +2406,7 @@ export default class SubHolding extends Component {
/>}
value={this.state.periode}
/>
{this.state.report != null ? String(this.state.report.label).toLocaleLowerCase().includes('summary') ? <Autocomplete
{...this.state.listMonths}
// getOptionLabel={(option) => titleCase(option.label)}
id="months"
onChange={(event, newInputValue) => this.setState({ month: newInputValue, loading: true, previewTable: false }, () => {
this.getReportType()
})}
disableClearable
style={{ width: 250, marginLeft: 10 }}
renderInput={(params) => <TextField {...params} label="Months" margin="normal" style={{ marginTop: 7 }} />}
value={this.state.month}
/> : null : null}
{/* {this.state.report != null ? String(this.state.report.label).toLocaleLowerCase().includes('summary') ? <Autocomplete
{...this.state.listQuarter}
// getOptionLabel={(option) => titleCase(option.label)}
......@@ -2416,6 +2420,20 @@ export default class SubHolding extends Component {
value={this.state.quarter}
/> : null : null} */}
</div>
{this.state.report != null ? String(this.state.report.label).toLocaleLowerCase().includes('summary') ? <div style={{ marginTop: 15, display: 'flex' }}>
<Autocomplete
{...this.state.listMonths}
// getOptionLabel={(option) => titleCase(option.label)}
id="months"
onChange={(event, newInputValue) => this.setState({ month: newInputValue, loading: true, previewTable: false }, () => {
this.getReportType()
})}
disableClearable
style={{ width: 250, marginLeft: 10 }}
renderInput={(params) => <TextField {...params} label="Months" margin="normal" style={{ marginTop: 7 }} />}
value={this.state.month}
/>
</div> : null : null}
</div>
<div>
<div style={{ display: 'flex', justifyContent: 'space-between', padding: '0px 20px 10px 20px' }}>
......
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