Commit c056b564 authored by rifkaki's avatar rifkaki

download ytd, histori

parent 92723262
...@@ -1239,22 +1239,22 @@ export default class SummaryOfTriputra extends Component { ...@@ -1239,22 +1239,22 @@ export default class SummaryOfTriputra extends Component {
// a.click(); // a.click();
// } // }
} else if (this.state.report.value === 2) { } else if (this.state.report.value === 2) {
alert("Download YTD Report Coming Soon") // alert("Download YTD Report Coming Soon")
// let url = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/db_report/export_master_budget?submission_id=${this.state.submissionID}&&report_id=${this.state.report.value}&&company_id=${this.state.company.company_id}&&year=${this.state.periode.periode}&&revision=${this.state.lastRevision}` let url = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/summary_ytd/export_report?year=${this.state.periode.periode}&&months=${this.state.month.month_id}`
// let sub_null = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/db_report/export_master_budget?submission_id=&&report_id=${this.state.report.value}&&company_id=${this.state.company.company_id}&&year=${this.state.periode.periode}&&revision=${this.state.lastRevision}` let sub_null = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/summary_ytd/export_report?year=${this.state.periode.periode}&&months=${this.state.month.month_id}`
// // console.log(url); console.log(url);
// let res = await fetch( let res = await fetch(
// this.state.submissionID == null ? sub_null : url this.state.submissionID == null ? sub_null : url
// ) )
// res = await res.blob() res = await res.blob()
// this.setState({ loading: false }) this.setState({ loading: false })
// if (res.size > 0) { if (res.size > 0) {
// let url = window.URL.createObjectURL(res); let url = window.URL.createObjectURL(res);
// let a = document.createElement('a'); let a = document.createElement('a');
// a.href = url; a.href = url;
// a.download = 'Report DB Balance Sheet.xlsx'; a.download = 'Report YTD.xlsx';
// a.click(); a.click();
// } }
} else if (this.state.report.value === 3) { } else if (this.state.report.value === 3) {
alert("Download CPSM Report Coming Soon") alert("Download CPSM Report Coming Soon")
// let res = await fetch( // let res = await fetch(
...@@ -1270,19 +1270,22 @@ export default class SummaryOfTriputra extends Component { ...@@ -1270,19 +1270,22 @@ export default class SummaryOfTriputra extends Component {
// a.click(); // a.click();
// } // }
} else if (this.state.report.value === 4) { } else if (this.state.report.value === 4) {
alert("Download Historical Report Coming Soon") // alert("Download Historical Report Coming Soon")
// let res = await fetch( let url = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/summary_historical/export_report?year=${this.state.periode.periode}`
// `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/db_report_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.lastRevision}` let sub_null = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/summary_historical/export_report?year=${this.state.periode.periode}`
// ) console.log(url);
// res = await res.blob() let res = await fetch(
// this.setState({ loading: false }) this.state.submissionID == null ? sub_null : url
// if (res.size > 0) { )
// let url = window.URL.createObjectURL(res); res = await res.blob()
// let a = document.createElement('a'); this.setState({ loading: false })
// a.href = url; if (res.size > 0) {
// a.download = 'Report DB Financial Ratio.xlsx'; let url = window.URL.createObjectURL(res);
// a.click(); let a = document.createElement('a');
// } a.href = url;
a.download = 'Report Historical.xlsx';
a.click();
}
} else { } else {
// setTimeout(() => { // setTimeout(() => {
...@@ -1392,7 +1395,7 @@ export default class SummaryOfTriputra extends Component { ...@@ -1392,7 +1395,7 @@ export default class SummaryOfTriputra extends Component {
margin: 5, margin: 5,
outline: 'none' outline: 'none'
}} }}
onClick={() => this.setState({ loading: false }, () => { onClick={() => this.setState({ loading: true }, () => {
setTimeout(() => { setTimeout(() => {
this.downloadAllData() this.downloadAllData()
}, 100); }, 100);
......
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