Vorlage:BV-BgPreisIndex
Aus BogenWiki
(Unterschied zwischen Versionen)
Nugman (Diskussion | Beiträge) |
Nugman (Diskussion | Beiträge) |
||
(Der Versionsvergleich bezieht 20 dazwischenliegende Versionen mit ein.) | |||
Zeile 19: | Zeile 19: | ||
{ | { | ||
console.log('[OnBgLoad] Bogen.length='+Bogen.length); | console.log('[OnBgLoad] Bogen.length='+Bogen.length); | ||
- | BVBgList | + | var BVBgList = Bogen; |
- | + | ||
var aOptions = Param.Options.split(';'); | var aOptions = Param.Options.split(';'); | ||
var aGroupBy = []; | var aGroupBy = []; | ||
Zeile 58: | Zeile 57: | ||
sBN = '<a href="/bogenwiki/index.php?title=Bund MiNr. '+BVBgList[b].BogenNr+' groß">'+BVBgList[b].BogenNr+'</a>'; | sBN = '<a href="/bogenwiki/index.php?title=Bund MiNr. '+BVBgList[b].BogenNr+' groß">'+BVBgList[b].BogenNr+'</a>'; | ||
var sPreis = BVBgList[b].Eingang.Preis; | var sPreis = BVBgList[b].Eingang.Preis; | ||
- | + | console.log('BVGetBgFieldValue(BVBgList['+b+'],"Zustand") = '+BVGetBgFieldValue(BVBgList[b],'Zustand')); | |
- | + | if (!BVCheckPrice(sPreis,BVBgList[b].Eingang.Art,BVGetBgFieldValue(BVBgList[b],'EM.Art.Key'),BVGetBgFieldValue(BVBgList[b],'Erhaltung'),BVGetBgFieldValue(BVBgList[b],'Zustand'))) | |
- | + | sPreis = '<span style="color:silver;"><i>'+sPreis+'€</i></span>'; | |
- | if ( | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | sPreis = '<span style="color:silver;"><i>'+ | + | |
- | + | ||
sTabHTML += ' <tr style="background:#FCFCFC" valign=top>'+ | sTabHTML += ' <tr style="background:#FCFCFC" valign=top>'+ | ||
' <td><div style="'+sCellPadding+'">'+sBN+'</div></td>'+ | ' <td><div style="'+sCellPadding+'">'+sBN+'</div></td>'+ | ||
Zeile 123: | Zeile 72: | ||
if (eBgList) eBgList.innerHTML = sTabHTML; | if (eBgList) eBgList.innerHTML = sTabHTML; | ||
var eBgPreise = document.getElementById('BVBgPreise.'+Param.Gebiet+'.'+Param.Gebiet1+'.'+Param.KatNr); | var eBgPreise = document.getElementById('BVBgPreise.'+Param.Gebiet+'.'+Param.Gebiet1+'.'+Param.KatNr); | ||
+ | var BVBgPreise = BVCalcPriceIndex(Bogen,aGroupBy); | ||
+ | console.log('BVBgPreise.length = '+BVBgPreise.length); | ||
sTabHTML = '<table id="BVBgPreise.'+Param.Gebiet+'.'+Param.Gebiet1+'.'+Param.KatNr+'.Tab" style="background:silver" cellpadding=1 cellspacing=1>'+ | sTabHTML = '<table id="BVBgPreise.'+Param.Gebiet+'.'+Param.Gebiet1+'.'+Param.KatNr+'.Tab" style="background:silver" cellpadding=1 cellspacing=1>'+ | ||
' <tr style="background:#E0E0E0" valign=top>'; | ' <tr style="background:#E0E0E0" valign=top>'; | ||
Zeile 128: | Zeile 79: | ||
var aGroupByParts = aGroupBy[g].split('.'); | var aGroupByParts = aGroupBy[g].split('.'); | ||
var sGroupByText = aGroupByParts[0]; | var sGroupByText = aGroupByParts[0]; | ||
+ | if (aGroupByParts[0] == 'Erhaltung') sGroupByText = 'Erh.'; | ||
if (aGroupByParts[0] == 'Eingang') sGroupByText = aGroupByParts[1]; | if (aGroupByParts[0] == 'Eingang') sGroupByText = aGroupByParts[1]; | ||
if (aGroupByParts[0] == 'Ausgang') sGroupByText = aGroupByParts[1]; | if (aGroupByParts[0] == 'Ausgang') sGroupByText = aGroupByParts[1]; | ||
if (aGroupByParts[0] == 'BRS') sGroupByText = aGroupByParts[1]; | if (aGroupByParts[0] == 'BRS') sGroupByText = aGroupByParts[1]; | ||
- | if (aGroupByParts[0] == 'PF') sGroupByText = aGroupByParts[ | + | if (aGroupByParts[0] == 'PF') sGroupByText = aGroupByParts[0]; |
if (aGroupByParts[0] == 'EM') sGroupByText = aGroupByParts[1]; | if (aGroupByParts[0] == 'EM') sGroupByText = aGroupByParts[1]; | ||
- | sTabHTML += ' <td><div style="'+sCellPadding+'" | + | sTabHTML += ' <td><div style="'+sCellPadding+'">'+sGroupByText+'</div></td>'; |
} | } | ||
- | sTabHTML += ' <td align=center><div style="'+sCellPadding+'" | + | sTabHTML += ' <td align=center><div style="'+sCellPadding+'">Mittel</div></td>'+ |
- | ' <td align=center><div style="'+sCellPadding+'" | + | ' <td align=center><div style="'+sCellPadding+'">Median</div></td>'+ |
- | ' <td align=center><div style="'+sCellPadding+'" | + | ' <td align=center><div style="'+sCellPadding+'">Min - Max</div></td>'+ |
- | ' <td align=center><div style="'+sCellPadding+'" | + | ' <td align=center><div style="'+sCellPadding+'">Anz.</div></td>'+ |
' </tr>'; | ' </tr>'; | ||
if (BVBgPreise.length > 0) { | if (BVBgPreise.length > 0) { | ||
- | + | TotalCount = 0; | |
+ | TotalDateFrom = ''; | ||
+ | TotalDateTo = ''; | ||
+ | TotalEbayCount = 0; | ||
+ | TotalEbayDateFrom = ''; | ||
+ | TotalEbayDateTo = ''; | ||
+ | TotalAHCount = 0; | ||
+ | TotalAHDateFrom = ''; | ||
+ | TotalAHDateTo = ''; | ||
for (var p = 0; p < BVBgPreise.length; p++) { | for (var p = 0; p < BVBgPreise.length; p++) { | ||
- | var aGroupValues = BVBgPreise[p].GroupValue.split('::'); | + | console.log('BVBgPreise['+p+'].GroupValue = "'+BVBgPreise[p].GroupValue+'"'); |
- | + | if (BVBgPreise[p].GroupValue.indexOf('::') > 0) { | |
- | + | var aGroupValues = BVBgPreise[p].GroupValue.split('::'); | |
- | + | sTabHTML += ' <tr style="background:#FCFCFC" valign=top>'; | |
- | + | for (v = 0; v < aGroupValues.length-1; v++) { | |
- | + | var aGroupByParts = aGroupBy[v].split('.'); | |
- | + | var sGroupByValueText = aGroupValues[v]; | |
- | + | console.log('aGroupByParts['+v+']="'+aGroupByParts[v]+'"; aGroupValues['+v+']="'+aGroupValues[v]+'"'); | |
- | + | if (aGroupByParts[v] == 'Erhaltung') { | |
+ | switch (aGroupValues[v]) { | ||
+ | case 'Pf': sGroupByValueText = '<div style="padding-top:2px"><img src="/bogenwiki/images/Symbol_Pfr1T.png" width="27" height="14" alt="**" title="postfrisch"></div>'; break; | ||
+ | case 'Gs': sGroupByValueText = '<div style="padding-top:2px"><img src="/bogenwiki/images/Symbol_GesT1.png" width="13" height="14" alt="**" title="gestempelt"></div>'; break; | ||
+ | case 'Ug': sGroupByValueText = '<div style="padding-top:2px"><img src="/bogenwiki/images/Symbol_UgsT1.png" width="13" height="14" alt="**" title="ungebraucht"></div>'; break; | ||
+ | case 'Bt': sGroupByValueText = '<span title="Bogentasche">BT</span>'; break; | ||
+ | } | ||
+ | } | ||
+ | sTabHTML += ' <td><div style="'+sCellPadding+'">'+sGroupByValueText+'</div></td>'; | ||
+ | } | ||
+ | sTabHTML += ' <td align=right><div style="'+sCellPadding+'">'+BVBgPreise[p].Avg.toFixed(2).replace(/\./,',')+'€</div></td>'+ | ||
+ | ' <td align=right><div style="'+sCellPadding+'">'+BVBgPreise[p].Median.toFixed(2).replace(/\./,',')+'€</div></td>'+ | ||
+ | ' <td align=center><div style="'+sCellPadding+'">'+BVBgPreise[p].Min.toFixed(2).replace(/\./,',')+'€ - '+BVBgPreise[p].Max.toFixed(2).replace(/\./,',')+'€</div></td>'+ | ||
+ | ' <td align=center><div style="'+sCellPadding+'">'+BVBgPreise[p].Count+'</div></td>'+ | ||
+ | ' </tr>'; | ||
+ | } else { | ||
+ | switch (BVBgPreise[p].GroupValue) { | ||
+ | case '': | ||
+ | TotalCount = BVBgPreise[p].Count; | ||
+ | TotalDateFrom = BVBgPreise[p].DateFrom; | ||
+ | TotalDateTo = BVBgPreise[p].DateTo; | ||
+ | break; | ||
+ | case '[src:eb]': | ||
+ | TotalEbayCount = BVBgPreise[p].Count; | ||
+ | TotalEbayDateFrom = BVBgPreise[p].DateFrom; | ||
+ | TotalEbayDateTo = BVBgPreise[p].DateTo; | ||
+ | break; | ||
+ | case '[src:ah]': | ||
+ | TotalAHCount = BVBgPreise[p].Count; | ||
+ | TotalAHDateFrom = BVBgPreise[p].DateFrom; | ||
+ | TotalAHDateTo = BVBgPreise[p].DateTo; | ||
+ | break; | ||
+ | } | ||
+ | } | ||
} | } | ||
nColSpan = aGroupBy.length + 4; | nColSpan = aGroupBy.length + 4; | ||
sTabHTML += ' <tr style="background:#FCFCFC" valign=top>'+ | sTabHTML += ' <tr style="background:#FCFCFC" valign=top>'+ | ||
' <td align=left colspan='+nColSpan+'><div style="'+sCellPadding+'">'+ | ' <td align=left colspan='+nColSpan+'><div style="'+sCellPadding+'">'+ | ||
- | + | '<table id="BVBgPrStat.'+Param.Gebiet+'.'+Param.Gebiet1+'.'+Param.KatNr+'.Tab" style="background:transparent" cellpadding=0 cellspacing=0>'+ | |
- | + | '<tr style="background:transparent" valign=top>'+ | |
- | + | '<td colspan=3><b>Datenbasis:</b></td>'+ | |
+ | '</tr>'+ | ||
+ | '<tr style="background:transparent" valign=top>'+ | ||
+ | '<td>Gesamt: </td>'+ | ||
+ | '<td align=right>'+TotalCount+' </td>'+ | ||
+ | '<td>('+TotalDateFrom+' - '+TotalDateTo+')</td>'+ | ||
+ | '</tr>'+ | ||
+ | '<tr style="background:transparent" valign=top>'+ | ||
+ | '<td> davon ebay: </td>'+ | ||
+ | '<td align=right>'+TotalEbayCount+' </td>'+ | ||
+ | '<td>'+(TotalEbayCount>0 ? '('+TotalEbayDateFrom+' - '+TotalEbayDateTo+')' : ' ')+'</td>'+ | ||
+ | '</tr>'+ | ||
+ | '<tr style="background:transparent" valign=top>'+ | ||
+ | '<td> davon AH: </td>'+ | ||
+ | '<td align=right>'+TotalAHCount+' </td>'+ | ||
+ | '<td>'+(TotalAHCount>0 ? '('+TotalAHDateFrom+' - '+TotalAHDateTo+')' : ' ')+'</td>'+ | ||
+ | '</tr>'+ | ||
+ | '</table>'+ | ||
' </div></td>'+ | ' </div></td>'+ | ||
' </tr>'; | ' </tr>'; | ||
Zeile 170: | Zeile 180: | ||
sTabHTML += '</table>'; | sTabHTML += '</table>'; | ||
eBgPreise.innerHTML = sTabHTML; | eBgPreise.innerHTML = sTabHTML; | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
} | } | ||
</script></html> | </script></html> |
Aktuelle Version vom 18:16, 1. Dez. 2023
Template BV_BgPreisIndex: Invalid value for parameter Cmd ("empty")!!!