kdrug-inventory-system/test_lot_modal.html
시골약사 3f4b9c816a fix: 로트 배분 모달 필요량 0 표시 버그 수정
문제:
- 원산지 선택에서 "수동 배분" 선택 시 필요량이 0으로 표시
- loadOriginOptions 함수 호출 시점의 requiredQty를 그대로 사용

해결:
- 모달 열기 시점에 현재 행의 실제 필요량 재계산
- gramsPerCheop × cheopTotal로 실시간 계산
- 디버깅 로그 추가로 값 확인 가능

이제 첩수나 용량이 변경된 후에도 정확한 필요량이 모달에 표시됩니다.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-02-17 02:23:37 +00:00

72 lines
2.8 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<title>로트 배분 모달 테스트</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
</head>
<body>
<div class="container mt-5">
<h2>로트 배분 필요량 테스트</h2>
<div class="card mt-3">
<div class="card-body">
<h5 class="card-title">시나리오 테스트</h5>
<div class="row mt-3">
<div class="col-md-3">
<label>첩당 용량 (g)</label>
<input type="number" class="form-control" id="testGramsPerCheop" value="2.2" step="0.1">
</div>
<div class="col-md-3">
<label>총 첩수</label>
<input type="number" class="form-control" id="testCheopTotal" value="10" step="1">
</div>
<div class="col-md-3">
<label>계산된 필요량</label>
<input type="text" class="form-control" id="calculatedQty" readonly>
</div>
<div class="col-md-3">
<button class="btn btn-primary mt-4" onclick="calculateAndShow()">계산 및 확인</button>
</div>
</div>
<div id="result" class="mt-3"></div>
</div>
</div>
</div>
<script>
function calculateAndShow() {
const gramsPerCheop = parseFloat($('#testGramsPerCheop').val()) || 0;
const cheopTotal = parseFloat($('#testCheopTotal').val()) || 0;
const requiredQty = gramsPerCheop * cheopTotal;
$('#calculatedQty').val(requiredQty.toFixed(1) + 'g');
$('#result').html(`
<div class="alert alert-info">
<h6>계산 결과:</h6>
<ul>
<li>첩당 용량: ${gramsPerCheop}g</li>
<li>총 첩수: ${cheopTotal}첩</li>
<li><strong>필요량: ${requiredQty.toFixed(1)}g</strong></li>
</ul>
<p class="mb-0 mt-2">
<strong>테스트:</strong> 2.2g × 10첩 = 22g가 모달에 정상적으로 전달되어야 합니다.
</p>
</div>
`);
}
// 초기 계산
$(document).ready(function() {
calculateAndShow();
$('#testGramsPerCheop, #testCheopTotal').on('input', calculateAndShow);
});
</script>
</body>
</html>