u
This commit is contained in:
@@ -5,7 +5,6 @@ import WarehouseIcon from '@mui/icons-material/Warehouse';
|
|||||||
import EditOutlinedIcon from '@mui/icons-material/EditOutlined';
|
import EditOutlinedIcon from '@mui/icons-material/EditOutlined';
|
||||||
import LocalShippingOutlinedIcon from '@mui/icons-material/LocalShippingOutlined';
|
import LocalShippingOutlinedIcon from '@mui/icons-material/LocalShippingOutlined';
|
||||||
import Tooltip from '@mui/material/Tooltip';
|
import Tooltip from '@mui/material/Tooltip';
|
||||||
import Chip from '@mui/material/Chip';
|
|
||||||
import { PanelTile } from 'dashgui/panels';
|
import { PanelTile } from 'dashgui/panels';
|
||||||
import { formatStock } from '../searchFormat';
|
import { formatStock } from '../searchFormat';
|
||||||
import ArticleStockAdjustDialog from '../ArticleStockAdjustDialog';
|
import ArticleStockAdjustDialog from '../ArticleStockAdjustDialog';
|
||||||
@@ -145,40 +144,6 @@ export default class ArticleViewStock extends PureComponent {
|
|||||||
this.setState({ adjustOpen: false });
|
this.setState({ adjustOpen: false });
|
||||||
}
|
}
|
||||||
|
|
||||||
renderIncomingChip(totalIncoming, incomingItems, unit) {
|
|
||||||
const tooltipText = `${formatStock(totalIncoming)}${unit ? ` ${unit}` : ''} im Zulauf aus ${
|
|
||||||
incomingItems.length === 1
|
|
||||||
? 'einer offenen Lieferung'
|
|
||||||
: `${incomingItems.length} offenen Lieferungen`
|
|
||||||
}`;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Tooltip title={tooltipText} arrow placement="top-start">
|
|
||||||
<Chip
|
|
||||||
size="small"
|
|
||||||
icon={
|
|
||||||
<LocalShippingOutlinedIcon
|
|
||||||
sx={{ fontSize: '14px !important', transform: 'scaleX(-1)' }}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
label={`+${formatStock(totalIncoming)}${unit ? ` ${unit}` : ''} im Zulauf`}
|
|
||||||
onClick={(e) => e.stopPropagation()}
|
|
||||||
sx={{
|
|
||||||
fontWeight: 600,
|
|
||||||
fontSize: '0.75rem',
|
|
||||||
height: 22,
|
|
||||||
backgroundColor: VEIL_PANEL,
|
|
||||||
cursor: 'default',
|
|
||||||
'& .MuiChip-icon': {
|
|
||||||
color: 'text.secondary',
|
|
||||||
ml: '6px',
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</Tooltip>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { article: articleData } = this.props;
|
const { article: articleData } = this.props;
|
||||||
const { adjustOpen } = this.state;
|
const { adjustOpen } = this.state;
|
||||||
@@ -280,8 +245,8 @@ export default class ArticleViewStock extends PureComponent {
|
|||||||
</Typography>
|
</Typography>
|
||||||
|
|
||||||
{isParent ? (
|
{isParent ? (
|
||||||
|
anyVariantTracksStock || totalVariantsStock > 0 ? (
|
||||||
<Box sx={{ my: 0.75 }}>
|
<Box sx={{ my: 0.75 }}>
|
||||||
{anyVariantTracksStock || totalVariantsStock > 0 ? (
|
|
||||||
<Typography
|
<Typography
|
||||||
component="div"
|
component="div"
|
||||||
sx={{
|
sx={{
|
||||||
@@ -293,17 +258,11 @@ export default class ArticleViewStock extends PureComponent {
|
|||||||
>
|
>
|
||||||
Alle Varianten zusammen: {formatStock(totalVariantsStock)}
|
Alle Varianten zusammen: {formatStock(totalVariantsStock)}
|
||||||
</Typography>
|
</Typography>
|
||||||
) : null}
|
|
||||||
{hasIncoming ? (
|
|
||||||
<Box sx={{ mt: 0.75 }}>
|
|
||||||
{this.renderIncomingChip(totalIncoming, incomingItems, unit)}
|
|
||||||
</Box>
|
|
||||||
) : null}
|
|
||||||
</Box>
|
</Box>
|
||||||
|
) : null
|
||||||
) : isStueckliste ? (
|
) : isStueckliste ? (
|
||||||
<Box sx={{ my: 0.5 }}>
|
|
||||||
<Tooltip title="Virtueller Bestand – Anpassung erfolgt an den einzelnen Komponenten" arrow placement="top-start">
|
<Tooltip title="Virtueller Bestand – Anpassung erfolgt an den einzelnen Komponenten" arrow placement="top-start">
|
||||||
<Box>
|
<Box sx={{ my: 0.5 }}>
|
||||||
<Box sx={{ display: 'inline-flex', alignItems: 'baseline', gap: 0.75 }}>
|
<Box sx={{ display: 'inline-flex', alignItems: 'baseline', gap: 0.75 }}>
|
||||||
<Typography
|
<Typography
|
||||||
component="div"
|
component="div"
|
||||||
@@ -336,14 +295,7 @@ export default class ArticleViewStock extends PureComponent {
|
|||||||
</Typography>
|
</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
{hasIncoming ? (
|
|
||||||
<Box sx={{ mt: 0.75 }}>
|
|
||||||
{this.renderIncomingChip(totalIncoming, incomingItems, unit)}
|
|
||||||
</Box>
|
|
||||||
) : null}
|
|
||||||
</Box>
|
|
||||||
) : isTrackStock ? (
|
) : isTrackStock ? (
|
||||||
<Box sx={{ my: 0.5 }}>
|
|
||||||
<Tooltip title="Klicken, um Bestand anzupassen" arrow placement="top-start">
|
<Tooltip title="Klicken, um Bestand anzupassen" arrow placement="top-start">
|
||||||
<Box
|
<Box
|
||||||
onClick={this.handleOpenAdjust}
|
onClick={this.handleOpenAdjust}
|
||||||
@@ -351,6 +303,7 @@ export default class ArticleViewStock extends PureComponent {
|
|||||||
display: 'inline-flex',
|
display: 'inline-flex',
|
||||||
alignItems: 'baseline',
|
alignItems: 'baseline',
|
||||||
gap: 0.75,
|
gap: 0.75,
|
||||||
|
my: 0.5,
|
||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
borderRadius: 1,
|
borderRadius: 1,
|
||||||
px: 0.5,
|
px: 0.5,
|
||||||
@@ -384,17 +337,11 @@ export default class ArticleViewStock extends PureComponent {
|
|||||||
) : null}
|
) : null}
|
||||||
</Box>
|
</Box>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
{hasIncoming ? (
|
|
||||||
<Box sx={{ mt: 0.75 }}>
|
|
||||||
{this.renderIncomingChip(totalIncoming, incomingItems, unit)}
|
|
||||||
</Box>
|
|
||||||
) : null}
|
|
||||||
</Box>
|
|
||||||
) : (
|
) : (
|
||||||
<Box sx={{ my: 0.75 }}>
|
|
||||||
<Box
|
<Box
|
||||||
onClick={this.handleOpenAdjust}
|
onClick={this.handleOpenAdjust}
|
||||||
sx={{
|
sx={{
|
||||||
|
my: 0.75,
|
||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
borderRadius: 1,
|
borderRadius: 1,
|
||||||
px: 0.5,
|
px: 0.5,
|
||||||
@@ -424,12 +371,6 @@ export default class ArticleViewStock extends PureComponent {
|
|||||||
Bestand wird nicht überwacht
|
Bestand wird nicht überwacht
|
||||||
</Typography>
|
</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
{hasIncoming ? (
|
|
||||||
<Box sx={{ mt: 0.75 }}>
|
|
||||||
{this.renderIncomingChip(totalIncoming, incomingItems, unit)}
|
|
||||||
</Box>
|
|
||||||
) : null}
|
|
||||||
</Box>
|
|
||||||
)}
|
)}
|
||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user