This commit is contained in:
seb
2026-10-17 04:11:42 +02:00
parent 6df833b362
commit bd16df64a1
3 changed files with 44 additions and 90 deletions

View File

@@ -584,12 +584,28 @@ class ManifestFormLine extends PureComponent {
const primaryEan = Array.isArray(eans) ? eans[0] : eans;
const vkPrice = primaryPrice(cachedArticle);
const vkNetto = vkPrice?.net;
const vkNetto =
vkPrice?.net != null
? Number(vkPrice.net)
: cachedArticle.net != null
? Number(cachedArticle.net)
: cachedArticle.price != null
? Number(cachedArticle.price)
: null;
const vkTaxRate =
vkPrice?.taxRate ??
vkPrice?.taxrate ??
cachedArticle.taxrate ??
cachedArticle.taxRate ??
selectCompanyTaxrate() ??
19;
const vkBrutto = vkPrice
? priceBrutto(vkPrice) ??
(vkPrice.net != null && vkPrice.taxrate != null
? vkPrice.net * (1 + vkPrice.taxrate / 100)
: null)
(vkNetto != null && vkTaxRate != null
? Math.round((vkNetto * (1 + Number(vkTaxRate) / 100) + Number.EPSILON) * 100) / 100
: null)
: vkNetto != null
? Math.round((vkNetto * (1 + Number(vkTaxRate) / 100) + Number.EPSILON) * 100) / 100
: null;
const suppliers =
@@ -625,7 +641,7 @@ class ManifestFormLine extends PureComponent {
: null;
const hasPriceInfo =
vkNetto != null || vkBrutto != null || ekNetto != null || ekBrutto != null || kind === 'quote';
vkNetto != null || vkBrutto != null || ekNetto != null || ekBrutto != null || kind === 'quote' || kind === 'order';
return (
<Box
@@ -733,7 +749,7 @@ class ManifestFormLine extends PureComponent {
)}
{/* EK Netto, EK Brutto, VK Netto, VK Brutto */}
{!isOrder && hasPriceInfo && (
{hasPriceInfo && (
<Box
sx={{
display: 'flex',
@@ -784,26 +800,28 @@ class ManifestFormLine extends PureComponent {
</Tooltip>
{/* VK Netto */}
{vkNetto != null && (
<Typography
variant="caption"
fontWeight={600}
sx={{ color: 'text.secondary', fontSize: '0.72rem' }}
>
VK Netto: {formatPrice(vkNetto)}
</Typography>
)}
<Typography
variant="caption"
fontWeight={600}
sx={{
color: vkNetto != null ? 'text.secondary' : 'text.disabled',
fontSize: '0.72rem',
}}
>
VK Netto: {vkNetto != null ? formatPrice(vkNetto) : '—'}
</Typography>
{/* VK Brutto */}
{vkBrutto != null && (
<Typography
variant="caption"
fontWeight={600}
sx={{ color: 'primary.dark', fontSize: '0.72rem' }}
>
VK Brutto: {formatPrice(vkBrutto)}
</Typography>
)}
<Typography
variant="caption"
fontWeight={600}
sx={{
color: vkBrutto != null ? 'primary.dark' : 'text.disabled',
fontSize: '0.72rem',
}}
>
VK Brutto: {vkBrutto != null ? formatPrice(vkBrutto) : '—'}
</Typography>
</Box>
)}
</Box>