Refactor giftcard pages with currency standardization

Updates currency representation consistently to use 'DKK' instead of 'kr'
Standardizes number formatting across product, order, and pricing displays

Improves localization and visual consistency
This commit is contained in:
Janus C. H. Knudsen 2025-12-30 17:39:15 +01:00
parent a43b2efdca
commit 196129b74a
5 changed files with 3729 additions and 126 deletions

View file

@ -1020,19 +1020,10 @@
</select>
</swp-form-field>
<swp-form-row>
<swp-form-field>
<swp-form-label>Kredit limit</swp-form-label>
<input type="text" class="mono" value="50.000 kr" />
</swp-form-field>
<swp-form-field>
<swp-form-label>Valuta</swp-form-label>
<select>
<option selected>DKK</option>
<option>EUR</option>
</select>
</swp-form-field>
</swp-form-row>
<swp-form-field>
<swp-form-label>Kredit limit</swp-form-label>
<input type="text" class="mono" value="50.000 DKK" placeholder="f.eks. 50.000 DKK eller 5.000 EUR" />
</swp-form-field>
</swp-form-grid>
</swp-card-body>
</swp-card>
@ -1053,7 +1044,7 @@
<swp-stat-label>Produkter</swp-stat-label>
</swp-stat-box>
<swp-stat-box>
<swp-stat-value>145.230 kr</swp-stat-value>
<swp-stat-value>145.230 DKK</swp-stat-value>
<swp-stat-label>Indkøb i år</swp-stat-label>
</swp-stat-box>
<swp-stat-box>
@ -1085,23 +1076,23 @@
<swp-product-list>
<swp-product-item onclick="openDrawer('Redken Acidic Bonding Concentrate Serum 100ml', 'RDK-ABC-100', '884486532879', 'Hårpleje', '195,00', '379,00', 10, 32, '12.128')">
<swp-product-name>Redken Acidic Bonding Concentrate Serum 100ml</swp-product-name>
<swp-product-price>195 kr</swp-product-price>
<swp-product-price>195 DKK</swp-product-price>
</swp-product-item>
<swp-product-item onclick="openDrawer('Redken All Soft Shampoo 300ml', 'RDK-ALS-300', '884486456123', 'Hårpleje', '145,00', '249,00', 4, 18, '4.482')">
<swp-product-name>Redken All Soft Shampoo 300ml</swp-product-name>
<swp-product-price>145 kr</swp-product-price>
<swp-product-price>145 DKK</swp-product-price>
</swp-product-item>
<swp-product-item onclick="openDrawer('Redken Extreme Shampoo 300ml', 'RDK-EXT-300', '884486789012', 'Hårpleje', '145,00', '249,00', 8, 24, '5.976')">
<swp-product-name>Redken Extreme Shampoo 300ml</swp-product-name>
<swp-product-price>145 kr</swp-product-price>
<swp-product-price>145 DKK</swp-product-price>
</swp-product-item>
<swp-product-item onclick="openDrawer('Redken Color Extend Magnetics Shampoo 300ml', 'RDK-CEM-300', '884486345678', 'Hårpleje', '155,00', '269,00', 6, 15, '4.035')">
<swp-product-name>Redken Color Extend Magnetics Shampoo 300ml</swp-product-name>
<swp-product-price>155 kr</swp-product-price>
<swp-product-price>155 DKK</swp-product-price>
</swp-product-item>
<swp-product-item onclick="openDrawer('Redken One United 150ml', 'RDK-ONU-150', '884486901234', 'Styling', '175,00', '299,00', 12, 28, '8.372')">
<swp-product-name>Redken One United 150ml</swp-product-name>
<swp-product-price>175 kr</swp-product-price>
<swp-product-price>175 DKK</swp-product-price>
</swp-product-item>
</swp-product-list>
</swp-card-body>
@ -1141,7 +1132,7 @@
<span>15. december 2024</span>
<span class="mono">BGD-2024-0847</span>
<span class="right">12</span>
<span class="right mono">18.450 kr</span>
<span class="right mono">18.450 DKK</span>
<swp-status-badge class="delivered">Leveret</swp-status-badge>
<swp-row-arrow><svg viewBox="0 0 24 24"><path d="M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"/></svg></swp-row-arrow>
</swp-order-row>
@ -1149,7 +1140,7 @@
<span>28. november 2024</span>
<span class="mono">BGD-2024-0812</span>
<span class="right">8</span>
<span class="right mono">12.340 kr</span>
<span class="right mono">12.340 DKK</span>
<swp-status-badge class="delivered">Leveret</swp-status-badge>
<swp-row-arrow><svg viewBox="0 0 24 24"><path d="M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"/></svg></swp-row-arrow>
</swp-order-row>
@ -1157,7 +1148,7 @@
<span>10. november 2024</span>
<span class="mono">BGD-2024-0798</span>
<span class="right">15</span>
<span class="right mono">24.680 kr</span>
<span class="right mono">24.680 DKK</span>
<swp-status-badge class="delivered">Leveret</swp-status-badge>
<swp-row-arrow><svg viewBox="0 0 24 24"><path d="M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"/></svg></swp-row-arrow>
</swp-order-row>
@ -1165,7 +1156,7 @@
<span>22. oktober 2024</span>
<span class="mono">BGD-2024-0756</span>
<span class="right">6</span>
<span class="right mono">8.920 kr</span>
<span class="right mono">8.920 DKK</span>
<swp-status-badge class="cancelled">Annulleret</swp-status-badge>
<swp-row-arrow><svg viewBox="0 0 24 24"><path d="M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"/></svg></swp-row-arrow>
</swp-order-row>
@ -1173,7 +1164,7 @@
<span>5. oktober 2024</span>
<span class="mono">BGD-2024-0734</span>
<span class="right">20</span>
<span class="right mono">32.150 kr</span>
<span class="right mono">32.150 DKK</span>
<swp-status-badge class="delivered">Leveret</swp-status-badge>
<swp-row-arrow><svg viewBox="0 0 24 24"><path d="M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"/></svg></swp-row-arrow>
</swp-order-row>
@ -1215,15 +1206,15 @@
<swp-detail-drawer-grid>
<swp-detail-drawer-item>
<swp-detail-drawer-label>Indkøbspris (ekskl. moms)</swp-detail-drawer-label>
<swp-detail-drawer-value class="mono" id="drawerPurchasePrice">195,00 kr</swp-detail-drawer-value>
<swp-detail-drawer-value class="mono" id="drawerPurchasePrice">195,00 DKK</swp-detail-drawer-value>
</swp-detail-drawer-item>
<swp-detail-drawer-item>
<swp-detail-drawer-label>Salgspris (inkl. moms)</swp-detail-drawer-label>
<swp-detail-drawer-value class="mono" id="drawerSalePrice">379,00 kr</swp-detail-drawer-value>
<swp-detail-drawer-value class="mono" id="drawerSalePrice">379,00 DKK</swp-detail-drawer-value>
</swp-detail-drawer-item>
<swp-detail-drawer-item>
<swp-detail-drawer-label>Avance</swp-detail-drawer-label>
<swp-detail-drawer-value class="large green" id="drawerMargin">108,20 kr</swp-detail-drawer-value>
<swp-detail-drawer-value class="large green" id="drawerMargin">108,20 DKK</swp-detail-drawer-value>
</swp-detail-drawer-item>
<swp-detail-drawer-item>
<swp-detail-drawer-label>Avance %</swp-detail-drawer-label>
@ -1244,7 +1235,7 @@
<swp-detail-drawer-stat-label>Solgt</swp-detail-drawer-stat-label>
</swp-detail-drawer-stat>
<swp-detail-drawer-stat>
<swp-detail-drawer-stat-value id="drawerRevenue">12.128 kr</swp-detail-drawer-stat-value>
<swp-detail-drawer-stat-value id="drawerRevenue">12.128 DKK</swp-detail-drawer-stat-value>
<swp-detail-drawer-stat-label>Omsætning</swp-detail-drawer-stat-label>
</swp-detail-drawer-stat>
</swp-detail-drawer-stats>
@ -1285,13 +1276,13 @@
document.getElementById('drawerSku').textContent = sku;
document.getElementById('drawerEan').textContent = ean;
document.getElementById('drawerCategory').textContent = category;
document.getElementById('drawerPurchasePrice').textContent = purchasePrice + ' kr';
document.getElementById('drawerSalePrice').textContent = salePrice + ' kr';
document.getElementById('drawerMargin').textContent = margin.toFixed(2).replace('.', ',') + ' kr';
document.getElementById('drawerPurchasePrice').textContent = purchasePrice + ' DKK';
document.getElementById('drawerSalePrice').textContent = salePrice + ' DKK';
document.getElementById('drawerMargin').textContent = margin.toFixed(2).replace('.', ',') + ' DKK';
document.getElementById('drawerMarginPct').textContent = marginPct.toFixed(1).replace('.', ',') + '%';
document.getElementById('drawerStock').textContent = stock;
document.getElementById('drawerSold').textContent = sold;
document.getElementById('drawerRevenue').textContent = revenue + ' kr';
document.getElementById('drawerRevenue').textContent = revenue + ' DKK';
// Open drawer
document.getElementById('drawerOverlay').classList.add('open');
@ -1318,7 +1309,7 @@
name: 'Indkøb',
color: '#00897b',
type: 'bar',
unit: 'kr',
unit: 'DKK',
data: [
{ x: 'Jul', y: 18500 },
{ x: 'Aug', y: 22300 },