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 {
"month": month ? String(month.month_id).toString() : "",
"quartal": "",
"type_report_name": "Monthly Report",
"currency_id" : defaultCurrency.id
"currency_id": defaultCurrency.id
}
console.log(payload);
api.create().createDownloadFile(payload).then((response) => {
......@@ -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 datas = data.findIndex((val) => val[4] == items)
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 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}`
......@@ -2366,6 +2367,10 @@ export default class MonthlyReport extends Component {
if (res.status === 200) {
result = [...result, res];
}
} catch (error) {
alert(error)
}
}
console.log('ini result', result);
......
......@@ -246,6 +246,7 @@ export default class SubHolding extends Component {
this.setState({
defaultCurrencyID: response.data.data.default_currency,
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],
defaultCurrency: index == -1 ? null : datas[index]
})
......@@ -4262,7 +4263,7 @@ export default class SubHolding extends Component {
}
render() {
let { defaultCurrencyID, report } = this.state
let { defaultCurrencyID, report, usdBefore2024 } = this.state
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)' }}>
<PropagateLoader
......@@ -4382,7 +4383,7 @@ export default class SubHolding extends Component {
// })
// 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.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