diff --git a/agents/stock/workspace/scripts/behive_web.py b/agents/stock/workspace/scripts/behive_web.py index 38b959f..81956c6 100644 --- a/agents/stock/workspace/scripts/behive_web.py +++ b/agents/stock/workspace/scripts/behive_web.py @@ -9015,9 +9015,14 @@ window.openPinModal = openPinModal; var v=p*qty; value+=v; cost+=c; rv.push([r,v]); }); if(!cost) return; - // 비중 = 행 평가액 / 총평가액. consolidated 행에만 (계좌별 행은 계좌단위 비중이라 code 일괄갱신 X). + // 비중 = 행 평가액 / 총평가액. consolidated(:held) + 당일매매 중복행(바 키)에 적용. + // 둘 다 "전체 보유 비중"이라 같은 값. 계좌별 행(:held:계좌)은 분모 달라 제외(여기서 안 건드림). + // scope 한정 → 다른 소유자(본인/가희)의 동일 종목 교차오염 방지. if(value) rv.forEach(function(pair){ - var w=pair[0].querySelector('.rt-weight'); if(w) w.textContent=(pair[1]/value*100).toFixed(2); + var wtxt=(pair[1]/value*100).toFixed(2); + var w=pair[0].querySelector('.rt-weight'); if(w) w.textContent=wtxt; + // 당일매매 섹션 중복행(바 코드 키) — 같은 scope 안에서만 (계좌별 :held:계좌 는 exact match라 자동 제외) + scope.querySelectorAll('details.row[data-row-key="'+rowCode(pair[0])+'"] .rt-weight').forEach(function(d){ d.textContent=wtxt; }); }); var T={value:value, profit:value-cost, rate:(value/cost-1)*100, net:value+parseFloat(scope.getAttribute('data-rt-deposit')||'0'),