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

@@ -79,7 +79,7 @@ export const GeneralLedgerSheetExportMenu = () => {
isCloseButtonShown: true,
timeout: 2000,
};
const { httpRequest } = useGeneralLedgerContext();
const { httpQuery } = useGeneralLedgerContext();
const openProgressToast = (amount: number) => {
return (
@@ -97,7 +97,7 @@ export const GeneralLedgerSheetExportMenu = () => {
};
// Export the report to xlsx.
const { mutateAsync: xlsxExport } = useGeneralLedgerSheetXlsxExport(
httpRequest,
httpQuery,
{
onDownloadProgress: (xlsxExportProgress: number) => {
if (!toastKey.current) {
@@ -118,27 +118,24 @@ export const GeneralLedgerSheetExportMenu = () => {
},
);
// Export the report to csv.
const { mutateAsync: csvExport } = useGeneralLedgerSheetCsvExport(
httpRequest,
{
onDownloadProgress: (xlsxExportProgress: number) => {
if (!toastKey.current) {
toastKey.current = AppToaster.show({
const { mutateAsync: csvExport } = useGeneralLedgerSheetCsvExport(httpQuery, {
onDownloadProgress: (xlsxExportProgress: number) => {
if (!toastKey.current) {
toastKey.current = AppToaster.show({
message: openProgressToast(xlsxExportProgress),
...commonToastConfig,
});
} else {
AppToaster.show(
{
message: openProgressToast(xlsxExportProgress),
...commonToastConfig,
});
} else {
AppToaster.show(
{
message: openProgressToast(xlsxExportProgress),
...commonToastConfig,
},
toastKey.current,
);
}
},
},
toastKey.current,
);
}
},
);
});
// Handle csv export button click.
const handleCsvExportBtnClick = () => {
csvExport();