feat(bestellungen): add optional "Für Mitglied" field, auto-populated from internal request submitter
This commit is contained in:
@@ -480,6 +480,7 @@ export default function BestellungDetail() {
|
||||
bezeichnung: string;
|
||||
lieferant_id?: number;
|
||||
besteller_id?: string;
|
||||
mitglied_id?: string;
|
||||
notizen: string;
|
||||
steuersatz: number;
|
||||
}>({ bezeichnung: '', notizen: '', steuersatz: 20 });
|
||||
@@ -661,6 +662,7 @@ export default function BestellungDetail() {
|
||||
bezeichnung: bestellung.bezeichnung,
|
||||
lieferant_id: bestellung.lieferant_id,
|
||||
besteller_id: bestellung.besteller_id || '',
|
||||
mitglied_id: bestellung.mitglied_id || '',
|
||||
notizen: bestellung.notizen || '',
|
||||
steuersatz: parseFloat(String(bestellung.steuersatz ?? 20)),
|
||||
});
|
||||
@@ -690,6 +692,7 @@ export default function BestellungDetail() {
|
||||
bezeichnung: editOrderData.bezeichnung,
|
||||
lieferant_id: editOrderData.lieferant_id,
|
||||
besteller_id: editOrderData.besteller_id || undefined,
|
||||
mitglied_id: editOrderData.mitglied_id || undefined,
|
||||
notizen: editOrderData.notizen,
|
||||
steuersatz: editOrderData.steuersatz,
|
||||
});
|
||||
@@ -822,6 +825,19 @@ export default function BestellungDetail() {
|
||||
curY += 3;
|
||||
}
|
||||
|
||||
// ── Für Mitglied block ──
|
||||
if (bestellung.mitglied_name) {
|
||||
doc.setFontSize(10);
|
||||
doc.setFont('helvetica', 'bold');
|
||||
doc.text('Für Mitglied', 10, curY);
|
||||
curY += 5;
|
||||
const mitgliedNameWithRank = bestellung.mitglied_dienstgrad
|
||||
? `${kurzDienstgrad(bestellung.mitglied_dienstgrad)} ${bestellung.mitglied_name}`
|
||||
: bestellung.mitglied_name;
|
||||
row('Name', mitgliedNameWithRank);
|
||||
curY += 3;
|
||||
}
|
||||
|
||||
// ── Order info block ──
|
||||
doc.setFontSize(10);
|
||||
doc.setFont('helvetica', 'bold');
|
||||
@@ -1115,6 +1131,15 @@ export default function BestellungDetail() {
|
||||
renderInput={(params) => <TextField {...params} label="Besteller" size="small" />}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Autocomplete
|
||||
options={orderUsers}
|
||||
getOptionLabel={(o) => o.name}
|
||||
value={orderUsers.find(u => u.id === editOrderData.mitglied_id) ?? null}
|
||||
onChange={(_, v) => setEditOrderData(d => ({ ...d, mitglied_id: v?.id || '' }))}
|
||||
renderInput={(params) => <TextField {...params} label="Für Mitglied" size="small" />}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<TextField label="Notizen" fullWidth multiline rows={3} size="small"
|
||||
value={editOrderData.notizen}
|
||||
@@ -1136,6 +1161,18 @@ export default function BestellungDetail() {
|
||||
<Typography>{bestellung.besteller_name || '–'}</Typography>
|
||||
</CardContent></Card>
|
||||
</Grid>
|
||||
{bestellung.mitglied_name && (
|
||||
<Grid item xs={12} sm={6} md={4}>
|
||||
<Card variant="outlined"><CardContent>
|
||||
<Typography variant="caption" color="text.secondary">Für Mitglied</Typography>
|
||||
<Typography>
|
||||
{bestellung.mitglied_dienstgrad
|
||||
? `${kurzDienstgrad(bestellung.mitglied_dienstgrad)} ${bestellung.mitglied_name}`
|
||||
: bestellung.mitglied_name}
|
||||
</Typography>
|
||||
</CardContent></Card>
|
||||
</Grid>
|
||||
)}
|
||||
<Grid item xs={12} sm={6} md={4}>
|
||||
<Card variant="outlined"><CardContent>
|
||||
<Typography variant="caption" color="text.secondary">Erstellt am</Typography>
|
||||
|
||||
Reference in New Issue
Block a user