This commit is contained in:
seb
2026-10-15 11:17:04 +02:00
parent a90776bb8b
commit 657d184d1c
2 changed files with 54 additions and 27 deletions

View File

@@ -13,6 +13,7 @@ import CheckCircleOutlineOutlinedIcon from '@mui/icons-material/CheckCircleOutli
import { PanelTile } from 'dashgui/panels'; import { PanelTile } from 'dashgui/panels';
import { formatDate } from './manifestConfig'; import { formatDate } from './manifestConfig';
import { formatPrice } from '../../utils/price'; import { formatPrice } from '../../utils/price';
import { typeLabel, typeIcon } from './OrderPaymentList';
import { import {
GREEN_PANEL, GREEN_PANEL,
YELLOW_PANEL, YELLOW_PANEL,
@@ -220,29 +221,55 @@ export class OrderDocumentsTiles extends PureComponent {
{payments.length > 0 ? ( {payments.length > 0 ? (
<Stack spacing={1}> <Stack spacing={1}>
{payments.map((pay) => ( {payments.map((pay) => {
<Card const pType = pay.type || pay.paymentType || pay.payment_type;
key={pay.id} return (
variant="outlined" <Card
sx={{ key={pay.id}
p: 1, variant="outlined"
bgcolor: WHITE, onClick={this.handleOpenPayments}
display: 'flex', sx={{
justifyContent: 'space-between', p: 1.25,
alignItems: 'center', bgcolor: WHITE,
}} cursor: 'pointer',
> transition: 'all 0.15s ease',
<Stack direction="row" spacing={0.75} alignItems="center"> '&:hover': {
<CheckCircleOutlineOutlinedIcon sx={{ fontSize: 16, color: 'success.main' }} /> boxShadow: '0 2px 8px rgba(0,0,0,0.1)',
<Typography variant="caption" sx={{ fontWeight: 600 }}> borderColor: 'primary.main',
#{pay.id} },
</Typography> }}
</Stack> >
<Typography variant="caption" sx={{ fontWeight: 700, color: 'success.dark' }}> <Box sx={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', mb: 0.25 }}>
+{formatPrice(pay.amount)} <Stack direction="row" spacing={0.75} alignItems="center">
</Typography> <CheckCircleOutlineOutlinedIcon sx={{ fontSize: 16, color: 'success.main' }} />
</Card> <Typography variant="subtitle2" sx={{ fontWeight: 700, fontSize: '0.85rem' }}>
))} #{pay.id}
</Typography>
</Stack>
<Typography
variant="subtitle2"
sx={{ fontWeight: 700, color: 'success.dark', fontVariantNumeric: 'tabular-nums' }}
>
+{formatPrice(pay.amount)}
</Typography>
</Box>
<Box sx={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
<Stack direction="row" spacing={0.5} alignItems="center">
{typeIcon(pType, { fontSize: 15, color: 'text.secondary' })}
<Typography variant="caption" color="text.secondary" sx={{ fontWeight: 600 }}>
{typeLabel(pType)}
</Typography>
</Stack>
{pay.date ? (
<Typography variant="caption" color="text.secondary">
{formatDate(pay.date)}
</Typography>
) : null}
</Box>
</Card>
);
})}
</Stack> </Stack>
) : ( ) : (
<Box <Box

View File

@@ -44,7 +44,7 @@ import {
const cfg = manifestConfig('order'); const cfg = manifestConfig('order');
const PAYMENT_TYPES = [ export const PAYMENT_TYPES = [
{ value: 'transfer', label: 'Banküberweisung', icon: AccountBalanceIcon }, { value: 'transfer', label: 'Banküberweisung', icon: AccountBalanceIcon },
{ value: 'cash', label: 'Barzahlung', icon: PointOfSaleIcon }, { value: 'cash', label: 'Barzahlung', icon: PointOfSaleIcon },
{ value: 'card', label: 'EC- / Kreditkarte', icon: CreditCardIcon }, { value: 'card', label: 'EC- / Kreditkarte', icon: CreditCardIcon },
@@ -54,15 +54,15 @@ const PAYMENT_TYPES = [
{ value: 'other', label: 'Sonstige', icon: PaymentsIcon }, { value: 'other', label: 'Sonstige', icon: PaymentsIcon },
]; ];
function typeLabel(val) { export function typeLabel(val) {
const match = PAYMENT_TYPES.find((t) => t.value === val); const match = PAYMENT_TYPES.find((t) => t.value === val);
return match?.label || val || 'Zahlung'; return match?.label || val || 'Zahlung';
} }
function typeIcon(val) { export function typeIcon(val, sx = { fontSize: 18 }) {
const match = PAYMENT_TYPES.find((t) => t.value === val); const match = PAYMENT_TYPES.find((t) => t.value === val);
const IconComp = match?.icon || PaymentsIcon; const IconComp = match?.icon || PaymentsIcon;
return <IconComp sx={{ fontSize: 18 }} />; return <IconComp sx={sx} />;
} }
const rowSx = { const rowSx = {