This commit is contained in:
seb
2026-10-29 17:52:14 +01:00
parent f555a1c9dd
commit 8b680b5a1a

View File

@@ -42,14 +42,6 @@ import {
SURFACE_RAISED, SURFACE_RAISED,
} from '../../colors'; } from '../../colors';
const REASON_PRESETS = [
'Inventurdifferenz',
'Korrektur',
'Bruch / Beschädigung',
'Schwund',
'Eigenbedarf / Test',
];
export default class ArticleStockAdjustDialog extends PureComponent { export default class ArticleStockAdjustDialog extends PureComponent {
constructor(props) { constructor(props) {
super(props); super(props);
@@ -255,7 +247,7 @@ export default class ArticleStockAdjustDialog extends PureComponent {
} }
// Reload article in automat cache // Reload article in automat cache
void artikelAutomat.actions.reloadArticle(article.sku).catch(() => {}); void artikelAutomat.actions.reloadArticle(article.sku).catch(() => { });
if (updatedArticle) { if (updatedArticle) {
onArticleUpdated?.(updatedArticle); onArticleUpdated?.(updatedArticle);
@@ -379,11 +371,6 @@ export default class ArticleStockAdjustDialog extends PureComponent {
<Typography variant="subtitle2" sx={{ fontWeight: 600 }}> <Typography variant="subtitle2" sx={{ fontWeight: 600 }}>
Bestand verfolgen Bestand verfolgen
</Typography> </Typography>
<Typography variant="caption" color="text.secondary">
{trackStock
? 'Lagerbestand wird für diesen Artikel geführt und bei Buchungen aktualisiert.'
: 'Keine Bestandsführung. Artikel hat unbegrenzte Verfügbarkeit.'}
</Typography>
</Box> </Box>
<Switch <Switch
checked={Boolean(trackStock)} checked={Boolean(trackStock)}
@@ -473,11 +460,11 @@ export default class ArticleStockAdjustDialog extends PureComponent {
> >
<ToggleButton value="diff" sx={{ py: 0.75, fontWeight: 500 }}> <ToggleButton value="diff" sx={{ py: 0.75, fontWeight: 500 }}>
<TrendingUpIcon sx={{ fontSize: 18, mr: 0.75 }} /> <TrendingUpIcon sx={{ fontSize: 18, mr: 0.75 }} />
Menge zu-/abbuchen (+ / -) Zu-/abbuchen (+ / -)
</ToggleButton> </ToggleButton>
<ToggleButton value="target" sx={{ py: 0.75, fontWeight: 500 }}> <ToggleButton value="target" sx={{ py: 0.75, fontWeight: 500 }}>
<TuneIcon sx={{ fontSize: 18, mr: 0.75 }} /> <TuneIcon sx={{ fontSize: 18, mr: 0.75 }} />
Neuen Zählbestand setzen Bestand setzen
</ToggleButton> </ToggleButton>
</ToggleButtonGroup> </ToggleButtonGroup>
</Box> </Box>
@@ -491,7 +478,6 @@ export default class ArticleStockAdjustDialog extends PureComponent {
value={diffValue} value={diffValue}
onChange={this.handleDiffChange} onChange={this.handleDiffChange}
disabled={submitting || !trackStock} disabled={submitting || !trackStock}
placeholder="z.B. +5 oder -2"
slotProps={{ slotProps={{
input: { input: {
startAdornment: ( startAdornment: (
@@ -505,28 +491,15 @@ export default class ArticleStockAdjustDialog extends PureComponent {
), ),
}, },
}} }}
helperText={
valid
? `Neuer Bestand: ${formatStock(newStock)}${unit ? ` ${unit}` : ''}`
: 'Geben Sie einen positiven oder negativen Wert ein'
}
/> />
) : ( ) : (
<TextInput <TextInput
fullWidth fullWidth
label="Tatsächlicher Zählbestand (Ist-Bestand)" label="Bestand"
type="number" type="number"
value={targetValue} value={targetValue}
onChange={this.handleTargetChange} onChange={this.handleTargetChange}
disabled={submitting || !trackStock} disabled={submitting || !trackStock}
placeholder="z.B. 10"
helperText={
isZeroChange
? 'Der eingegebene Zählbestand entspricht dem aktuellen Bestand (keine Änderung).'
: valid
? `Berechnete Korrektur: ${amount > 0 ? `+${formatStock(amount)}` : formatStock(amount)}${unit ? ` ${unit}` : ''}`
: 'Geben Sie den neu gezählten Bestand ein'
}
/> />
)} )}
@@ -564,26 +537,11 @@ export default class ArticleStockAdjustDialog extends PureComponent {
<Box> <Box>
<TextInput <TextInput
fullWidth fullWidth
label="Grund / Buchungstext" label="Buchungstext"
value={reason} value={reason}
onChange={this.handleReasonChange} onChange={this.handleReasonChange}
disabled={submitting || !trackStock} disabled={submitting || !trackStock}
placeholder="z.B. Inventur, Bruch, Schwund"
helperText="Wird im Journal / Ledger als Transaktionstext gespeichert"
/> />
<Box sx={{ display: 'flex', flexWrap: 'wrap', gap: 0.75, mt: 1 }}>
{REASON_PRESETS.map((preset) => (
<Chip
key={preset}
label={preset}
size="small"
clickable
disabled={submitting || !trackStock}
onClick={() => this.setState({ reason: preset })}
sx={{ fontSize: '0.75rem' }}
/>
))}
</Box>
</Box> </Box>
</Box> </Box>
)} )}