fix(mitglieder): improve Fahrgenehmigungen labels, pagination, and AT20 sync
This commit is contained in:
@@ -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 => (
|
||||
|
||||
@@ -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>
|
||||
))
|
||||
)}
|
||||
|
||||
@@ -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
|
||||
// ----------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user