This commit is contained in:
seb
2026-10-07 11:40:55 +02:00
parent a2c18841c1
commit 22115cb583
6 changed files with 446 additions and 47 deletions

View File

@@ -4,7 +4,8 @@ import Box from '@mui/material/Box';
import ButtonBase from '@mui/material/ButtonBase';
import Typography from '@mui/material/Typography';
import { TILE_SIZE, Tile, tileBaseSx } from 'dashgui/tiles';
import { formatPrice } from '../../utils/price';
import { formatPrice, getArticleGross } from '../../utils/price';
import companyAutomat from '../../automats/companyAutomat';
import { articleSku } from '../article/articleRoute';
import {
getThumbHashDataUrl,
@@ -289,6 +290,7 @@ export class ArticleTile extends Tile {
if (!article) return null;
const sku = articleSku(article);
const brand = article.brand;
const grossPrice = getArticleGross(article, companyAutomat.state.current?.taxrate);
return (
<>
{brand?.name ? (
@@ -310,9 +312,9 @@ export class ArticleTile extends Tile {
{sku}
</Typography>
) : null}
{article.net != null && (
{grossPrice != null && (
<Typography variant="caption" fontWeight={600}>
{formatPrice(article.net)}
{formatPrice(grossPrice)}
</Typography>
)}
</>
@@ -353,6 +355,7 @@ export class ArticleTile extends Tile {
const hasPhoto = this.hasPhoto();
const { article, label, sx, disabled } = this.props;
const sku = articleSku(article);
const grossPrice = getArticleGross(article, companyAutomat.state.current?.taxrate);
return (
<ButtonBase
@@ -451,7 +454,7 @@ export class ArticleTile extends Tile {
{sku}
</Typography>
) : null}
{article.net != null && (
{grossPrice != null && (
<Typography
variant="caption"
fontWeight={600}
@@ -461,7 +464,7 @@ export class ArticleTile extends Tile {
textShadow: TEXT_GLOW_DARK,
}}
>
{formatPrice(article.net)}
{formatPrice(grossPrice)}
</Typography>
)}
</Box>