fix: 당일매매 중복행 비중도 실시간 갱신

updateScopes 비중 갱신을 consolidated(:held) + 당일매매 중복행(바 키)에 적용(같은 전체보유 비중).
계좌별 행(:held:계좌)은 exact match라 자동 제외, scope 한정으로 본인/가희 교차오염 방지.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
hyowons
2026-06-08 15:09:25 +09:00
parent 787834f93e
commit e01e0b8a62
+7 -2
View File
@@ -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'),