diff --git a/web/src/features/grains-permits/pages.tsx b/web/src/features/grains-permits/pages.tsx index d936ed5..5e55e51 100644 --- a/web/src/features/grains-permits/pages.tsx +++ b/web/src/features/grains-permits/pages.tsx @@ -42,6 +42,8 @@ import { formatDate, formatNumber } from '@/components/meta/format'; import { elementToPdfUrl, type PdfOrientation } from '@/lib/pdf'; import { useFeatureUi } from '@/i18n/useUi'; import { useAuth } from '@/providers/AuthProvider'; +import AssessmentIcon from '@mui/icons-material/Assessment'; +import reportStrings from '../grains-reports/strings'; import { useConfirm } from '@/providers/ConfirmProvider'; import { useToast } from '@/providers/ToastProvider'; import { @@ -211,7 +213,10 @@ function usePermitActions() { // ================================================================= permit list (GNPermits.cfm) export function PermitsPage() { const { t, lang } = useFeatureUi(strings); - const { user } = useAuth(); + const { user, can } = useAuth(); + const navigate = useNavigate(); + // shortcuts to the reports of this screen, shown with the permission of each report menu entry + const reportLinks = (['tender-order', 'distribution-summary'] as const).filter((k) => can(`grains.reports.t.${k}`)); const { run, element } = usePermitActions(); const companyUser = Number(user?.stkId) === 62; // legacy session.stkid = 62 const showRevoked = String(user?.userId ?? '').toUpperCase() === 'GTOM1'; // legacy: only this login sees "ملغي" @@ -238,6 +243,11 @@ export function PermitsPage() { title={t('pm.list.title')} subtitle={t('pm.list.subtitle')} actions={( <> + {reportLinks.map((k) => ( + + ))} {canVoiceCall && (