|
@@ -56,8 +56,16 @@ const GenerateProjectPandLReport: React.FC<Props> & SubComponents = ({ projects |
|
|
if (Boolean(query.project) && query.project !== "All") { |
|
|
if (Boolean(query.project) && query.project !== "All") { |
|
|
if(query.project != null && query.startMonth != "" && query.startMonthTo != undefined){ |
|
|
if(query.project != null && query.startMonth != "" && query.startMonthTo != undefined){ |
|
|
const response = await fetchProjectPandLReport({ projectId: parseFloat(query.project), startMonth: query.startMonth, endMonth: query.startMonthTo }) |
|
|
const response = await fetchProjectPandLReport({ projectId: parseFloat(query.project), startMonth: query.startMonth, endMonth: query.startMonthTo }) |
|
|
if (response) { |
|
|
|
|
|
downloadFile(new Uint8Array(response.blobValue), response.filename!!) |
|
|
|
|
|
|
|
|
try{ |
|
|
|
|
|
if (response) { |
|
|
|
|
|
downloadFile(new Uint8Array(response.blobValue), response.filename!!) |
|
|
|
|
|
} |
|
|
|
|
|
}catch(error){ |
|
|
|
|
|
errorDialogWithContent(t("Download Fail"), |
|
|
|
|
|
t(`Please try it later`), t) |
|
|
|
|
|
.then(() => { |
|
|
|
|
|
window.location.reload() |
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
}else{ |
|
|
}else{ |
|
|
errorDialogWithContent(t("Download Fail"), |
|
|
errorDialogWithContent(t("Download Fail"), |
|
|