u
This commit is contained in:
@@ -32,8 +32,13 @@ export default class ArticleViewStock extends PureComponent {
|
||||
const { article: articleData } = this.props;
|
||||
const { adjustOpen } = this.state;
|
||||
const isFather = Boolean(articleData?.isFather);
|
||||
const isStueckliste = Boolean(
|
||||
articleData?.articlelistId != null ||
|
||||
(articleData?.articleListCount ?? 0) > 0 ||
|
||||
articleData?.articlelist?.length > 0
|
||||
);
|
||||
const isTrackStock =
|
||||
!isFather && articleData?.track_stock !== false && articleData?.track_stock !== 0;
|
||||
!isFather && !isStueckliste && articleData?.track_stock !== false && articleData?.track_stock !== 0;
|
||||
|
||||
const rawWarehouses = Array.isArray(articleData?.warehouses)
|
||||
? articleData.warehouses
|
||||
@@ -61,9 +66,9 @@ export default class ArticleViewStock extends PureComponent {
|
||||
<PanelTile
|
||||
wide={1}
|
||||
minHeight={SECOND_ROW_MIN_HEIGHT}
|
||||
color={isFather ? '#e2e8f0' : '#bbf7d0'}
|
||||
color={isFather ? '#e2e8f0' : isStueckliste ? '#cffafe' : '#bbf7d0'}
|
||||
action={
|
||||
isFather
|
||||
isFather || isStueckliste
|
||||
? null
|
||||
: {
|
||||
label: 'Bestand anpassen',
|
||||
@@ -116,6 +121,41 @@ export default class ArticleViewStock extends PureComponent {
|
||||
Bestand wird auf Variantenebene geführt
|
||||
</Typography>
|
||||
</Box>
|
||||
) : isStueckliste ? (
|
||||
<Tooltip title="Virtueller Bestand – Anpassung erfolgt an den einzelnen Komponenten" arrow placement="top-start">
|
||||
<Box sx={{ my: 0.5 }}>
|
||||
<Box sx={{ display: 'inline-flex', alignItems: 'baseline', gap: 0.75 }}>
|
||||
<Typography
|
||||
component="div"
|
||||
sx={{
|
||||
fontSize: '2.4rem',
|
||||
fontWeight: 700,
|
||||
lineHeight: 1.1,
|
||||
letterSpacing: '-0.02em',
|
||||
color: totalStock > 0 ? 'text.primary' : 'text.secondary',
|
||||
}}
|
||||
>
|
||||
{formatStock(totalStock)}
|
||||
</Typography>
|
||||
{unit ? (
|
||||
<Typography
|
||||
variant="body2"
|
||||
color="text.secondary"
|
||||
sx={{ fontWeight: 500 }}
|
||||
>
|
||||
{unit}
|
||||
</Typography>
|
||||
) : null}
|
||||
</Box>
|
||||
<Typography
|
||||
variant="caption"
|
||||
color="text.secondary"
|
||||
sx={{ display: 'block', mt: 0.25 }}
|
||||
>
|
||||
Virtueller Bestand (aus Komponenten)
|
||||
</Typography>
|
||||
</Box>
|
||||
</Tooltip>
|
||||
) : isTrackStock ? (
|
||||
<Tooltip title="Klicken, um Bestand anzupassen" arrow placement="top-start">
|
||||
<Box
|
||||
@@ -277,7 +317,7 @@ export default class ArticleViewStock extends PureComponent {
|
||||
</Box>
|
||||
</PanelTile>
|
||||
|
||||
{!isFather ? (
|
||||
{!isFather && !isStueckliste ? (
|
||||
<ArticleStockAdjustDialog
|
||||
open={adjustOpen}
|
||||
onClose={this.handleCloseAdjust}
|
||||
|
||||
Reference in New Issue
Block a user