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,
} from '../../colors';
const REASON_PRESETS = [
'Inventurdifferenz',
'Korrektur',
'Bruch / Beschädigung',
'Schwund',
'Eigenbedarf / Test',
];
export default class ArticleStockAdjustDialog extends PureComponent {
constructor(props) {
super(props);
@@ -255,7 +247,7 @@ export default class ArticleStockAdjustDialog extends PureComponent {
}
// Reload article in automat cache
void artikelAutomat.actions.reloadArticle(article.sku).catch(() => {});
void artikelAutomat.actions.reloadArticle(article.sku).catch(() => { });
if (updatedArticle) {
onArticleUpdated?.(updatedArticle);
@@ -379,11 +371,6 @@ export default class ArticleStockAdjustDialog extends PureComponent {
<Typography variant="subtitle2" sx={{ fontWeight: 600 }}>
Bestand verfolgen
</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>
<Switch
checked={Boolean(trackStock)}
@@ -473,11 +460,11 @@ export default class ArticleStockAdjustDialog extends PureComponent {
>
<ToggleButton value="diff" sx={{ py: 0.75, fontWeight: 500 }}>
<TrendingUpIcon sx={{ fontSize: 18, mr: 0.75 }} />
Menge zu-/abbuchen (+ / -)
Zu-/abbuchen (+ / -)
</ToggleButton>
<ToggleButton value="target" sx={{ py: 0.75, fontWeight: 500 }}>
<TuneIcon sx={{ fontSize: 18, mr: 0.75 }} />
Neuen Zählbestand setzen
Bestand setzen
</ToggleButton>
</ToggleButtonGroup>
</Box>
@@ -491,7 +478,6 @@ export default class ArticleStockAdjustDialog extends PureComponent {
value={diffValue}
onChange={this.handleDiffChange}
disabled={submitting || !trackStock}
placeholder="z.B. +5 oder -2"
slotProps={{
input: {
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
fullWidth
label="Tatsächlicher Zählbestand (Ist-Bestand)"
label="Bestand"
type="number"
value={targetValue}
onChange={this.handleTargetChange}
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>
<TextInput
fullWidth
label="Grund / Buchungstext"
label="Buchungstext"
value={reason}
onChange={this.handleReasonChange}
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>
)}