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

@@ -49,11 +49,8 @@ export function APAgingSummarySheetLoadingBar() {
*/
export function APAgingSummaryExportMenu() {
const toastKey = useRef(null);
const commonToastConfig = {
isCloseButtonShown: true,
timeout: 2000,
};
const { query } = useAPAgingSummaryContext();
const commonToastConfig = { isCloseButtonShown: true, timeout: 2000 };
const { httpQuery } = useAPAgingSummaryContext();
const openProgressToast = (amount: number) => {
return (
@@ -70,7 +67,7 @@ export function APAgingSummaryExportMenu() {
);
};
// Export the report to xlsx.
const { mutateAsync: xlsxExport } = useAPAgingSheetXlsxExport(query, {
const { mutateAsync: xlsxExport } = useAPAgingSheetXlsxExport(httpQuery, {
onDownloadProgress: (xlsxExportProgress: number) => {
if (!toastKey.current) {
toastKey.current = AppToaster.show({
@@ -89,7 +86,7 @@ export function APAgingSummaryExportMenu() {
},
});
// Export the report to csv.
const { mutateAsync: csvExport } = useAPAgingSheetCsvExport(query, {
const { mutateAsync: csvExport } = useAPAgingSheetCsvExport(httpQuery, {
onDownloadProgress: (xlsxExportProgress: number) => {
if (!toastKey.current) {
toastKey.current = AppToaster.show({