fix(mitglieder): improve Fahrgenehmigungen labels, pagination, and AT20 sync

This commit is contained in:
Matthias Hochmeister
2026-04-18 18:00:54 +02:00
parent e1c7f44e56
commit 26df8b427e
5 changed files with 54 additions and 22 deletions

View File

@@ -245,7 +245,7 @@ export default function BuchhaltungTransaktionForm() {
<Select
value={form.konto_id ?? ''}
label="Konto (Topf)"
onChange={e => setForm(f => ({ ...f, konto_id: e.target.value ? Number(e.target.value) : null, ausgaben_typ: null }))}
onChange={e => setForm(f => ({ ...f, konto_id: e.target.value ? Number(e.target.value) : null }))}
>
<MenuItem value=""><em>Kein Konto</em></MenuItem>
{konten.map(k => (

View File

@@ -1265,20 +1265,22 @@ function MitgliedDetail() {
<Typography variant="body2" fontWeight={500}>
{f.klasse}
</Typography>
<Typography variant="caption" color="text.secondary">
{f.ausstellungsdatum ? new Date(f.ausstellungsdatum).toLocaleDateString('de-AT') : '—'}
</Typography>
<Box sx={{ display: 'flex', gap: 2 }}>
<Typography variant="caption" color="text.secondary">
Erhalten am: {f.ausstellungsdatum ? new Date(f.ausstellungsdatum).toLocaleDateString('de-AT') : '—'}
</Typography>
{f.gueltig_bis && (
<Typography variant="caption" color="text.secondary">
Gültig bis: {new Date(f.gueltig_bis).toLocaleDateString('de-AT')}
</Typography>
)}
</Box>
</Box>
{(f.behoerde || f.nummer) && (
<Typography variant="body2" color="text.secondary">
{[f.behoerde, f.nummer].filter(Boolean).join(' · ')}
</Typography>
)}
{f.gueltig_bis && (
<Typography variant="caption" color="text.secondary">
Gültig bis: {new Date(f.gueltig_bis).toLocaleDateString('de-AT')}
</Typography>
)}
</Box>
))
)}

View File

@@ -120,25 +120,16 @@ function Mitglieder() {
}, [debouncedSearch, selectedStatus, selectedDienstgrad, page, pageSize]);
useEffect(() => {
// Reset to page 0 when search changes
if (debouncedSearch !== prevSearch.current) {
prevSearch.current = debouncedSearch;
setPage(0);
return;
if (page !== 0) {
setPage(0);
return; // page change will re-render → fetchMembers recreated → effect re-fires
}
}
fetchMembers();
}, [fetchMembers, debouncedSearch]);
// Also fetch when page/filters change (skip initial mount to avoid double-fetch)
const isInitialMount = useRef(true);
useEffect(() => {
if (isInitialMount.current) {
isInitialMount.current = false;
return;
}
fetchMembers();
}, [page, pageSize, selectedStatus, selectedDienstgrad]);
// ----------------------------------------------------------------
// Event handlers
// ----------------------------------------------------------------