Fix: BOM 시뮬레이터 UI 렌더링 버그 수정
- renderProcessItem: item.amount → item.total_price (품목별 금액 0원 표시 수정) - renderCostSummary: subtotals 객체에서 subtotal 값 추출 ([object Object] 표시 수정)
This commit is contained in:
@@ -1190,7 +1190,7 @@ function renderProcessGroups(groupedItems) {
|
||||
|
||||
// 공정별 품목 아이템 렌더링
|
||||
function renderProcessItem(item) {
|
||||
const price = item.amount || 0;
|
||||
const price = item.total_price || item.amount || 0;
|
||||
const qty = item.quantity || 0;
|
||||
const categoryNote = item.calculation_note || '';
|
||||
|
||||
@@ -1227,8 +1227,10 @@ function renderCostSummary(subtotals, grandTotal, finishedGoods) {
|
||||
subtotalsHtml = `
|
||||
<div class="space-y-2 mb-4">
|
||||
<div class="text-xs font-medium text-gray-500 uppercase">공정별 소계</div>
|
||||
${subtotalEntries.map(([process, amount]) => {
|
||||
${subtotalEntries.map(([process, data]) => {
|
||||
const label = processLabels[process] || process;
|
||||
// data는 객체 {name, count, subtotal} 또는 숫자일 수 있음
|
||||
const amount = typeof data === 'object' ? (data.subtotal || 0) : data;
|
||||
return `
|
||||
<div class="flex justify-between items-center py-1.5 px-2 bg-gray-50 rounded">
|
||||
<span class="text-gray-600">${label}</span>
|
||||
|
||||
Reference in New Issue
Block a user