u
This commit is contained in:
@@ -23,6 +23,7 @@ class ManifestLines extends PureComponent {
|
||||
kind = 'delivery',
|
||||
lines,
|
||||
saving,
|
||||
partyId,
|
||||
linesColor,
|
||||
dirtyLineFields = {},
|
||||
shipments,
|
||||
@@ -68,7 +69,6 @@ class ManifestLines extends PureComponent {
|
||||
wide={wide}
|
||||
minHeight={280}
|
||||
color={linesColor}
|
||||
title="Artikel"
|
||||
sx={{
|
||||
...(wide >= 4 ? { gridColumn: { xs: '1 / -1', sm: '1 / -1', md: 'span 4' } } : {}),
|
||||
...(!hasArticles
|
||||
@@ -115,17 +115,7 @@ class ManifestLines extends PureComponent {
|
||||
}
|
||||
|
||||
if (!lines || lines.length === 0) {
|
||||
return (
|
||||
<TableRow>
|
||||
<TableCell
|
||||
colSpan={columns.length + 1}
|
||||
align="center"
|
||||
sx={{ py: 3, color: 'text.secondary', fontSize: '0.82rem' }}
|
||||
>
|
||||
Keine Positionen vorhanden
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
);
|
||||
return null;
|
||||
}
|
||||
|
||||
return lines.map((line, index) => {
|
||||
@@ -190,16 +180,24 @@ class ManifestLines extends PureComponent {
|
||||
>
|
||||
Zeile
|
||||
</Button>
|
||||
{onSearchArticle && (
|
||||
<Button
|
||||
size="small"
|
||||
startIcon={<SearchIcon />}
|
||||
disabled={saving}
|
||||
onClick={() => onSearchArticle(null)}
|
||||
>
|
||||
Artikel suchen
|
||||
</Button>
|
||||
)}
|
||||
{onSearchArticle && (() => {
|
||||
const searchArticleDisabled = saving || (kind === 'delivery' && !partyId);
|
||||
const searchArticleTitle =
|
||||
kind === 'delivery' && !partyId
|
||||
? 'Bitte zuerst einen Lieferanten auswählen'
|
||||
: undefined;
|
||||
return (
|
||||
<Button
|
||||
size="small"
|
||||
startIcon={<SearchIcon />}
|
||||
disabled={searchArticleDisabled}
|
||||
onClick={() => onSearchArticle(null)}
|
||||
title={searchArticleTitle}
|
||||
>
|
||||
Artikel suchen
|
||||
</Button>
|
||||
);
|
||||
})()}
|
||||
{(() => {
|
||||
const hasShippedLines = kind === 'order' && Array.isArray(shipments) && shipments.some((sh) => (sh.lines?.length || 0) > 0);
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user