From e01e0b8a6239857447bf15c3525a7370ec8d9e35 Mon Sep 17 00:00:00 2001 From: hyowons Date: Mon, 8 Jun 2026 15:09:25 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EB=8B=B9=EC=9D=BC=EB=A7=A4=EB=A7=A4=20?= =?UTF-8?q?=EC=A4=91=EB=B3=B5=ED=96=89=20=EB=B9=84=EC=A4=91=EB=8F=84=20?= =?UTF-8?q?=EC=8B=A4=EC=8B=9C=EA=B0=84=20=EA=B0=B1=EC=8B=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updateScopes 비중 갱신을 consolidated(:held) + 당일매매 중복행(바 키)에 적용(같은 전체보유 비중). 계좌별 행(:held:계좌)은 exact match라 자동 제외, scope 한정으로 본인/가희 교차오염 방지. Co-Authored-By: Claude Opus 4.8 --- agents/stock/workspace/scripts/behive_web.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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'),