feat(webapp): wip printing financial reports

This commit is contained in:
Ahmed Bouhuolia
2024-02-17 00:15:20 +02:00
parent d67189587e
commit 27fed5f18a
62 changed files with 303 additions and 244 deletions

View File

@@ -95,7 +95,7 @@ export function CashflowSheetExportMenu() {
isCloseButtonShown: true,
timeout: 2000,
};
const { query } = useCashFlowStatementContext();
const { httpQuery } = useCashFlowStatementContext();
const openProgressToast = (amount: number) => {
return (
@@ -113,26 +113,30 @@ export function CashflowSheetExportMenu() {
};
// Export the report to xlsx.
const { mutateAsync: xlsxExport } = useCashFlowStatementXlsxExport(query, {
onDownloadProgress: (xlsxExportProgress: number) => {
if (!toastKey.current) {
toastKey.current = AppToaster.show({
message: openProgressToast(xlsxExportProgress),
...commonToastConfig,
});
} else {
AppToaster.show(
{
const { mutateAsync: xlsxExport } = useCashFlowStatementXlsxExport(
httpQuery,
{
onDownloadProgress: (xlsxExportProgress: number) => {
if (!toastKey.current) {
toastKey.current = AppToaster.show({
message: openProgressToast(xlsxExportProgress),
...commonToastConfig,
},
toastKey.current,
);
}
});
} else {
AppToaster.show(
{
message: openProgressToast(xlsxExportProgress),
...commonToastConfig,
},
toastKey.current,
);
}
},
},
});
);
// Export the report to csv.
const { mutateAsync: csvExport } = useCashFlowStatementCsvExport(query, {
const { mutateAsync: csvExport } = useCashFlowStatementCsvExport(httpQuery, {
onDownloadProgress: (xlsxExportProgress: number) => {
if (!toastKey.current) {
toastKey.current = AppToaster.show({