Commit 9283bc94 authored by Riri Novita's avatar Riri Novita

Merge branch 'ENV-DEV' into 'ENV-DEPLOYMENT'

repot subco usd before 2024

See merge request !2211
parents 10340e77 e463e59e
...@@ -2312,7 +2312,7 @@ export default class MonthlyReport extends Component { ...@@ -2312,7 +2312,7 @@ export default class MonthlyReport extends Component {
"month": month ? String(month.month_id).toString() : "", "month": month ? String(month.month_id).toString() : "",
"quartal": "", "quartal": "",
"type_report_name": "Monthly Report", "type_report_name": "Monthly Report",
"currency_id" : defaultCurrency.id "currency_id": defaultCurrency.id
} }
console.log(payload); console.log(payload);
api.create().createDownloadFile(payload).then((response) => { api.create().createDownloadFile(payload).then((response) => {
...@@ -2359,6 +2359,7 @@ export default class MonthlyReport extends Component { ...@@ -2359,6 +2359,7 @@ export default class MonthlyReport extends Component {
let urlReport = items === 8 ? "profit_loss" : items === 12 ? "tax_planning" : items === 7 ? "balance_sheet" : items === 9 ? "fam" : items === 13 ? "cash_flow" : items === 11 ? "locf" : items === 10 ? "cat" : null let urlReport = items === 8 ? "profit_loss" : items === 12 ? "tax_planning" : items === 7 ? "balance_sheet" : items === 9 ? "fam" : items === 13 ? "cash_flow" : items === 11 ? "locf" : items === 10 ? "cat" : null
let datas = data.findIndex((val) => val[4] == items) let datas = data.findIndex((val) => val[4] == items)
let report = data[datas] let report = data[datas]
try {
let url = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/${urlReport}/monthly_report/export_monthly_report?monthly_report_id=${monthlyReportId}&&report_id=${report[4]}&&company_id=${company.company_id}&&year=${periode.periode}&&revision=${report[2]}&&months=${month.month_id}&&download_file_report_id=${downloadedFileReportId}&&currency_id=${defaultCurrency.id}` let url = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/${urlReport}/monthly_report/export_monthly_report?monthly_report_id=${monthlyReportId}&&report_id=${report[4]}&&company_id=${company.company_id}&&year=${periode.periode}&&revision=${report[2]}&&months=${month.month_id}&&download_file_report_id=${downloadedFileReportId}&&currency_id=${defaultCurrency.id}`
let res = await fetch( let res = await fetch(
`${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/${urlReport}/monthly_report/export_monthly_report?monthly_report_id=${monthlyReportId === null ? "" : monthlyReportId}&&report_id=${report[4]}&&company_id=${company.company_id}&&year=${periode.periode}&&revision=${report[2]}&&months=${month.month_id}&&download_file_report_id=${downloadedFileReportId}&&currency_id=${defaultCurrency.id}` `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/${urlReport}/monthly_report/export_monthly_report?monthly_report_id=${monthlyReportId === null ? "" : monthlyReportId}&&report_id=${report[4]}&&company_id=${company.company_id}&&year=${periode.periode}&&revision=${report[2]}&&months=${month.month_id}&&download_file_report_id=${downloadedFileReportId}&&currency_id=${defaultCurrency.id}`
...@@ -2366,6 +2367,10 @@ export default class MonthlyReport extends Component { ...@@ -2366,6 +2367,10 @@ export default class MonthlyReport extends Component {
if (res.status === 200) { if (res.status === 200) {
result = [...result, res]; result = [...result, res];
} }
} catch (error) {
alert(error)
}
} }
console.log('ini result', result); console.log('ini result', result);
......
...@@ -246,6 +246,7 @@ export default class SubHolding extends Component { ...@@ -246,6 +246,7 @@ export default class SubHolding extends Component {
this.setState({ this.setState({
defaultCurrencyID: response.data.data.default_currency, defaultCurrencyID: response.data.data.default_currency,
currency: datas, currency: datas,
usdBefore2024: response.data.data.usdBefore2024,
// report: response.data.data.default_currency == 2 && this.state.defaultCurrency == 1 ? this.state.reportType2[0] : this.state.reportType[0], // report: response.data.data.default_currency == 2 && this.state.defaultCurrency == 1 ? this.state.reportType2[0] : this.state.reportType[0],
defaultCurrency: index == -1 ? null : datas[index] defaultCurrency: index == -1 ? null : datas[index]
}) })
...@@ -4262,7 +4263,7 @@ export default class SubHolding extends Component { ...@@ -4262,7 +4263,7 @@ export default class SubHolding extends Component {
} }
render() { render() {
let { defaultCurrencyID, report } = this.state let { defaultCurrencyID, report, usdBefore2024 } = this.state
const loadingComponent = ( const loadingComponent = (
<div style={{ position: 'fixed', zIndex: 110, top: 0, left: 0, width: '100%', height: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center', background: 'rgba(255,255,255,0.8)' }}> <div style={{ position: 'fixed', zIndex: 110, top: 0, left: 0, width: '100%', height: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center', background: 'rgba(255,255,255,0.8)' }}>
<PropagateLoader <PropagateLoader
...@@ -4382,7 +4383,7 @@ export default class SubHolding extends Component { ...@@ -4382,7 +4383,7 @@ export default class SubHolding extends Component {
// }) // })
// console.log("report 2"); // console.log("report 2");
// } // }
let bizpar = defaultCurrencyID == 2 && newInputValue.id == 1 ? defaultReport.filter(e => e.report === 2) : defaultReport let bizpar = this.state.usdBefore2024 == false && defaultCurrencyID == 2 && newInputValue.id == 1 ? defaultReport.filter(e => e.report === 2) : defaultReport
this.setState({ report: bizpar[0], reportType: bizpar }) this.setState({ report: bizpar[0], reportType: bizpar })
this.getReportType() this.getReportType()
......
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