Skip to content

Commit

Permalink
Merge pull request #674 from Tampere/feature/sap-report-credit-debit-…
Browse files Browse the repository at this point in the history
…columns

Added report summary to blanket contract report
  • Loading branch information
jlaamanen authored Aug 9, 2023
2 parents a3e542f + 39f22e2 commit 7cf65c5
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion frontend/src/views/SapReports/BlanketContractReportFilters.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
import { Download, Search } from '@mui/icons-material';
import { FormControl, FormLabel, InputAdornment, Paper, TextField, css } from '@mui/material';
import {
Divider,
FormControl,
FormLabel,
InputAdornment,
Paper,
TextField,
css,
} from '@mui/material';
import { useAtom, useAtomValue } from 'jotai';

import { trpc } from '@frontend/client';
Expand All @@ -12,8 +20,11 @@ import {
blanketOrderIdAtom,
consultCompaniesAtom,
textAtom,
useDebouncedBlanketContractReportFilters,
} from '@frontend/stores/sapReport/blanketContractReportFilters';

import { ReportSummary } from './ReportSummary';

export function BlanketContractReportFilters() {
const tr = useTranslations();
const notify = useNotifications();
Expand All @@ -27,6 +38,10 @@ export function BlanketContractReportFilters() {
trpc.sapReport.getConsultCompanies.useQuery();
const { sapReport } = trpc.useContext();

const debouncedFilters = useDebouncedBlanketContractReportFilters();
const { data: summary, isLoading: summaryLoading } =
trpc.sapReport.getBlanketContractReportSummary.useQuery({ filters: debouncedFilters });

return (
<Paper
css={css`
Expand Down Expand Up @@ -114,6 +129,13 @@ export function BlanketContractReportFilters() {
>
{tr('sapReports.downloadReport')}
</AsyncJobButton>
<Divider
css={css`
margin-top: 24px;
margin-bottom: 24px;
`}
/>
<ReportSummary loading={summaryLoading} summary={summary} />
</Paper>
);
}

0 comments on commit 7cf65c5

Please sign in to comment.