update
This commit is contained in:
@@ -451,7 +451,7 @@ export default function BestellungDetail() {
|
||||
|
||||
// ── Line items table ──
|
||||
const steuersatz = (parseFloat(String(bestellung.steuersatz)) || 20) / 100;
|
||||
const hasPrices = positionen.some((p) => p.einzelpreis != null);
|
||||
const hasPrices = positionen.some((p) => p.einzelpreis != null && p.einzelpreis > 0);
|
||||
|
||||
const totalNetto = positionen.reduce((sum, p) => {
|
||||
const ep = p.einzelpreis != null ? parseFloat(String(p.einzelpreis)) : 0;
|
||||
@@ -482,7 +482,7 @@ export default function BestellungDetail() {
|
||||
head: [['Bezeichnung', 'Art.-Nr.', 'Menge', 'Einzelpreis', 'Gesamt']],
|
||||
body: rows,
|
||||
startY: curY,
|
||||
theme: 'grid',
|
||||
theme: 'striped',
|
||||
headStyles: { fillColor: [66, 66, 66], textColor: 255, fontStyle: 'bold' },
|
||||
alternateRowStyles: { fillColor: [245, 245, 245] },
|
||||
margin: { left: 10, right: 10 },
|
||||
@@ -525,7 +525,7 @@ export default function BestellungDetail() {
|
||||
head: [['Bezeichnung', 'Art.-Nr.', 'Menge']],
|
||||
body: rows,
|
||||
startY: curY,
|
||||
theme: 'grid',
|
||||
theme: 'striped',
|
||||
headStyles: { fillColor: [66, 66, 66], textColor: 255, fontStyle: 'bold' },
|
||||
alternateRowStyles: { fillColor: [245, 245, 245] },
|
||||
margin: { left: 10, right: 10 },
|
||||
@@ -897,40 +897,40 @@ export default function BestellungDetail() {
|
||||
</TableRow>
|
||||
</React.Fragment>
|
||||
) : (
|
||||
<TableRow key={p.id}>
|
||||
<TableCell>
|
||||
<Box>
|
||||
{p.bezeichnung}
|
||||
{p.spezifikationen && p.spezifikationen.length > 0 && (
|
||||
<Box sx={{ pl: 2, mt: 0.5 }}>
|
||||
{p.spezifikationen.map((spec, i) => (
|
||||
<Typography key={i} variant="caption" color="text.secondary" display="block">• {spec}</Typography>
|
||||
))}
|
||||
</Box>
|
||||
<React.Fragment key={p.id}>
|
||||
<TableRow>
|
||||
<TableCell>{p.bezeichnung}</TableCell>
|
||||
<TableCell>{p.artikelnummer || '–'}</TableCell>
|
||||
<TableCell align="right">{p.menge}</TableCell>
|
||||
<TableCell>{p.einheit}</TableCell>
|
||||
<TableCell align="right">{formatCurrency(p.einzelpreis)}</TableCell>
|
||||
<TableCell align="right">{formatCurrency((p.einzelpreis ?? 0) * p.menge)}</TableCell>
|
||||
<TableCell align="right">
|
||||
{canManageOrders ? (
|
||||
<TextField
|
||||
size="small"
|
||||
type="number"
|
||||
sx={{ width: 70 }}
|
||||
value={p.erhalten_menge}
|
||||
inputProps={{ min: 0, max: p.menge }}
|
||||
disabled={bestellung.status !== 'bestellt' && bestellung.status !== 'teillieferung'}
|
||||
onChange={(e) => updateReceived.mutate({ itemId: p.id, menge: Number(e.target.value) })}
|
||||
/>
|
||||
) : (
|
||||
p.erhalten_menge
|
||||
)}
|
||||
</Box>
|
||||
</TableCell>
|
||||
<TableCell>{p.artikelnummer || '–'}</TableCell>
|
||||
<TableCell align="right">{p.menge}</TableCell>
|
||||
<TableCell>{p.einheit}</TableCell>
|
||||
<TableCell align="right">{formatCurrency(p.einzelpreis)}</TableCell>
|
||||
<TableCell align="right">{formatCurrency((p.einzelpreis ?? 0) * p.menge)}</TableCell>
|
||||
<TableCell align="right">
|
||||
{canManageOrders ? (
|
||||
<TextField
|
||||
size="small"
|
||||
type="number"
|
||||
sx={{ width: 70 }}
|
||||
value={p.erhalten_menge}
|
||||
inputProps={{ min: 0, max: p.menge }}
|
||||
disabled={bestellung.status !== 'bestellt' && bestellung.status !== 'teillieferung'}
|
||||
onChange={(e) => updateReceived.mutate({ itemId: p.id, menge: Number(e.target.value) })}
|
||||
/>
|
||||
) : (
|
||||
p.erhalten_menge
|
||||
)}
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
{p.spezifikationen && p.spezifikationen.length > 0 && (
|
||||
<TableRow>
|
||||
<TableCell colSpan={7} sx={{ pt: 0, pb: 1, pl: 4, borderTop: 'none' }}>
|
||||
{p.spezifikationen.map((spec, i) => (
|
||||
<Typography key={i} variant="caption" color="text.secondary" display="block">• {spec}</Typography>
|
||||
))}
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
)}
|
||||
</React.Fragment>
|
||||
),
|
||||
)}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user