Commit 1855aefd authored by Riri Novita's avatar Riri Novita

issue download data

parent 93c932ec
......@@ -288,6 +288,8 @@ export default class LOV extends Component {
console.log(lastArray);
this.setState({ dataTable, diff: lastArray[16], loanTotal: lastArray[17], perBS: lastArray[18], loading: false, visibleLOVMR: true }, () => {
this.props.sendToParent(dataTable, lastArray, 'LOV')
})
}
})
......@@ -478,6 +480,7 @@ export default class LOV extends Component {
this.setState({ dataTable, diff: lastArray[16], loanTotal: lastArray[17], perBS: lastArray[18], dataLoaded: true, loading: false, buttonError: false, dataDelete: [] }, () => {
this.props.sendToParent(dataTable, lastArray, 'LOV', 'upload', this.state.visibleLOVMR)
})
console.log(this.state.visibleLOVMR);
} else {
this.setState({ alert: true, messageAlert: response.data.message, typeAlert: 'warning', loading: false }, () => {
if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
......@@ -975,7 +978,7 @@ export default class LOV extends Component {
this.setState({ dataTable: dataTable2 }, () => {
setTimeout(() => {
this.setState({ loading: false })
this.props.sendToParent(dataTable2, lastArray, 'LOV', 'tambah')
this.props.sendToParent(dataTable2, lastArray, 'LOV', 'tambah', this.state.visibleLOVMR)
}, 500)
})
}
......
......@@ -158,8 +158,8 @@ export default class ListOfCreditFacilities extends Component {
}
dataTableForChild(data, array, params, type, visibleView) {
console.log(visibleView);
console.log(type);
// console.log(visibleView);
// console.log(type);
switch (params) {
case "LOV":
console.log(data);
......@@ -1022,10 +1022,14 @@ export default class ListOfCreditFacilities extends Component {
handleCalculateLOV = () => {
this.setState({ loading: true })
console.log(this.state.dataTablelov);
console.log(this.state.dataTableLOV);
console.log(this.state.tambahLOV);
console.log(this.state.visibleParent);
let dataTable2 = this.state.dataTablelov == undefined || this.state.tambahLOV == 'tambah' || this.state.tambahLOV == 'upload' ? this.state.dataTableLOV : this.state.dataTablelov
let data = []
let error = false
let bankNameEmpty = false
let bankNameEmpty = false
console.log(dataTable2);
dataTable2.map(i => {
if (i[6] == null) {
......
......@@ -2356,21 +2356,38 @@ export default class MonthlyReport extends Component {
let result = []
console.log('mulai hit')
for (const items of selectReport) {
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 === 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}`
)
if (res.status === 200) {
result = [...result, res];
if (items !== 11) {
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}`
)
if (res.status === 200) {
result = [...result, res];
}
} catch (error) {
alert(error)
}
} else {
try {
let res1 = await fetch(
`${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/locf/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}`
)
if (res1.status === 200) {
let res2 = await fetch(
`${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/lov/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}`
)
if (res2.status === 200) {
result = [...result, res2];
}
}
} catch (error) {
alert(error)
}
} catch (error) {
alert(error)
}
}
console.log('ini result', result);
......
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