fix(detail-panel): show Flexoptix price in competitor comparison + fix 800.00G->800G
This commit is contained in:
parent
0d3edd6ea9
commit
261135c544
@ -4622,11 +4622,14 @@ async function openTxDetail(id) {
|
||||
h += '<div style="font-size:0.72rem;color:#888;margin-bottom:0.5rem">Gleiche Spezifikationsklasse — andere Part Number</div>';
|
||||
comparPrices.forEach(function(p) {
|
||||
// Calculate price delta (EUR-normalized)
|
||||
var myEur = null;
|
||||
var refPrice = directPrices.length > 0 ? directPrices[0] : null;
|
||||
if (refPrice) {
|
||||
var ra = parseFloat(refPrice.price), rc = (refPrice.currency||'USD').toUpperCase();
|
||||
myEur = rc === 'EUR' ? ra : rc === 'USD' ? ra * 0.92 : ra;
|
||||
// Use Flexoptix own verified EUR price as reference for comparison
|
||||
var myEur = t.price_verified_eur ? parseFloat(t.price_verified_eur) : null;
|
||||
if (!myEur) {
|
||||
var refPrice = directPrices.length > 0 ? directPrices[0] : null;
|
||||
if (refPrice) {
|
||||
var ra = parseFloat(refPrice.price), rc = (refPrice.currency||'USD').toUpperCase();
|
||||
myEur = rc === 'EUR' ? ra : rc === 'USD' ? ra * 0.92 : ra;
|
||||
}
|
||||
}
|
||||
var compEur = null;
|
||||
var ca = parseFloat(p.price), cc = (p.currency||'USD').toUpperCase();
|
||||
@ -4654,8 +4657,8 @@ async function openTxDetail(id) {
|
||||
+ '<td style="color:' + compColor + ';font-size:0.7rem;padding:2px 0">' + esc(compVal || '—') + '</td></tr>';
|
||||
}
|
||||
|
||||
var mySpeed = t.speed_gbps >= 1000 ? (t.speed_gbps / 1000).toFixed(1).replace('.0','') + 'T' : t.speed_gbps + 'G';
|
||||
var compSpeed = p.comp_speed_gbps ? (p.comp_speed_gbps >= 1000 ? (p.comp_speed_gbps/1000).toFixed(1).replace('.0','')+'T' : p.comp_speed_gbps+'G') : null;
|
||||
var mySpeed = fmtSpd(t.speed_gbps);
|
||||
var compSpeed = p.comp_speed_gbps ? fmtSpd(p.comp_speed_gbps) : null;
|
||||
|
||||
h += '<div style="border:1px solid var(--border);border-radius:8px;margin-bottom:0.6rem;overflow:hidden">';
|
||||
|
||||
@ -4676,7 +4679,8 @@ async function openTxDetail(id) {
|
||||
if (savBadge) {
|
||||
h += '<div style="padding:0.3rem 0.75rem;background:rgba(255,255,255,0.02);border-bottom:1px solid var(--border);display:flex;align-items:center;gap:0.5rem">';
|
||||
h += savBadge;
|
||||
h += '<span style="font-size:0.68rem;color:#666">vs. Flexoptix Listenpreis</span>';
|
||||
var fxPriceLabel = myEur ? 'EUR ' + myEur.toLocaleString('de-DE',{minimumFractionDigits:2,maximumFractionDigits:2}) : null;
|
||||
h += '<span style="font-size:0.68rem;color:#666">vs. Flexoptix Listenpreis' + (fxPriceLabel ? ' (' + fxPriceLabel + ')' : '') + '</span>';
|
||||
h += '</div>';
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user