Compare commits
No commits in common. "e7fda0497e8a38a91c4c6e5c93b0206862c34488" and "113393b3132184da630a88d5a15f0b8cf947a319" have entirely different histories.
e7fda0497e
...
113393b313
@ -34,8 +34,7 @@ const ChangeCalculatorPage: React.FC = () => {
|
||||
useEffect(() => {
|
||||
const total = moneyItems.reduce((sum, item) => sum + item.value * item.count, 0);
|
||||
setCustomerTotal(total);
|
||||
// Allow negative values when customer hasn't paid enough
|
||||
setChangeAmount(total - cartTotal);
|
||||
setChangeAmount(Math.max(0, total - cartTotal));
|
||||
}, [moneyItems, cartTotal]);
|
||||
|
||||
const handleDenominationClick = (index: number) => {
|
||||
@ -91,14 +90,7 @@ const ChangeCalculatorPage: React.FC = () => {
|
||||
</div>
|
||||
<div className="total-item highlight">
|
||||
<span>Restgeld:</span>
|
||||
<span
|
||||
style={{
|
||||
color: changeAmount < 0 ? '#ff0000' : 'inherit',
|
||||
fontWeight: changeAmount < 0 ? 'bold' : 'inherit'
|
||||
}}
|
||||
>
|
||||
{changeAmount.toFixed(2)} €
|
||||
</span>
|
||||
<span>{changeAmount.toFixed(2)} €</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@ -39,6 +39,7 @@ const HomePage: React.FC = () => {
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<h2 className="section-title">{activeTab === 'food' ? 'Essen' : 'Getränke'}</h2>
|
||||
<ProductList
|
||||
products={productsData[activeTab]}
|
||||
category={activeTab}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user