fix: [quotes] BomCalculationResult 프로퍼티명 수정 (materials → items, snake_case)
This commit is contained in:
@@ -41,18 +41,18 @@ export function QuoteCalculationReport({
|
|||||||
return sum + locTotal;
|
return sum + locTotal;
|
||||||
}, 0) || 0;
|
}, 0) || 0;
|
||||||
|
|
||||||
// 소요자재 내역 - BOM 자재 목록 (locations[].bomResult.materials)에서 가져옴
|
// 소요자재 내역 - BOM 자재 목록 (locations[].bomResult.items)에서 가져옴
|
||||||
const materialItems = (quote.locations || []).flatMap(loc =>
|
const materialItems = (quote.locations || []).flatMap(loc =>
|
||||||
(loc.bomResult?.materials || [])
|
(loc.bomResult?.items || [])
|
||||||
).map((material, index) => ({
|
).map((material, index) => ({
|
||||||
no: index + 1,
|
no: index + 1,
|
||||||
itemCode: material.itemCode || '-',
|
itemCode: material.item_code || '-',
|
||||||
name: material.itemName || '-',
|
name: material.item_name || '-',
|
||||||
spec: material.specification || '-',
|
spec: material.specification || '-',
|
||||||
quantity: Math.floor(material.quantity || 1),
|
quantity: Math.floor(material.quantity || 1),
|
||||||
unit: material.unit || 'EA',
|
unit: material.unit || 'EA',
|
||||||
unitPrice: material.unitPrice || 0,
|
unitPrice: material.unit_price || 0,
|
||||||
totalPrice: material.totalPrice || 0,
|
totalPrice: material.total_price || 0,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user