Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -819,7 +819,6 @@ export function LocationDetailPanel({
|
||||
unitPrice: updatedGrandTotal,
|
||||
totalPrice: updatedGrandTotal * location.quantity,
|
||||
});
|
||||
console.log(`[품목 추가] ${item.code} - ${item.name} → ${categoryLabel} (${categoryCode}), 단가: ${unitPrice}`);
|
||||
}}
|
||||
tabLabel={detailTabs.find((t) => t.value === activeTab)?.label}
|
||||
/>
|
||||
|
||||
@@ -56,12 +56,10 @@ export function QuotePreviewModal({
|
||||
const vatIncluded = quoteData.vatType === 'included';
|
||||
|
||||
const handleDuplicate = () => {
|
||||
console.log('[테스트] 복제');
|
||||
onDuplicate?.();
|
||||
};
|
||||
|
||||
const handleEdit = () => {
|
||||
console.log('[테스트] 수정');
|
||||
onEdit?.();
|
||||
};
|
||||
|
||||
|
||||
@@ -323,15 +323,6 @@ export function QuoteRegistration({
|
||||
|
||||
// editingQuote가 변경되면 formData 업데이트 및 calculationResults 초기화
|
||||
useEffect(() => {
|
||||
console.log('[QuoteRegistration] useEffect editingQuote:', JSON.stringify({
|
||||
hasEditingQuote: !!editingQuote,
|
||||
itemCount: editingQuote?.items?.length,
|
||||
item0: editingQuote?.items?.[0] ? {
|
||||
quantity: editingQuote.items[0].quantity,
|
||||
wingSize: editingQuote.items[0].wingSize,
|
||||
inspectionFee: editingQuote.items[0].inspectionFee,
|
||||
} : null,
|
||||
}, null, 2));
|
||||
if (editingQuote) {
|
||||
setFormData(editingQuote);
|
||||
// 수정 모드 진입 시 이전 산출 결과 초기화
|
||||
@@ -449,10 +440,6 @@ export function QuoteRegistration({
|
||||
field: keyof QuoteFormData,
|
||||
value: string | QuoteItem[]
|
||||
) => {
|
||||
// DEBUG: manager, contact, remarks 필드 변경 추적
|
||||
if (field === 'manager' || field === 'contact' || field === 'remarks') {
|
||||
console.log(`[handleFieldChange] ${field} 변경:`, value);
|
||||
}
|
||||
setFormData({ ...formData, [field]: value });
|
||||
if (errors[field]) {
|
||||
setErrors((prev) => {
|
||||
@@ -617,11 +604,6 @@ export function QuoteRegistration({
|
||||
};
|
||||
|
||||
// 렌더링 직전 디버그 로그
|
||||
console.log('[QuoteRegistration] 렌더링 직전 formData.items[0]:', JSON.stringify({
|
||||
quantity: formData.items[0]?.quantity,
|
||||
wingSize: formData.items[0]?.wingSize,
|
||||
inspectionFee: formData.items[0]?.inspectionFee,
|
||||
}, null, 2));
|
||||
|
||||
// 폼 콘텐츠 렌더링
|
||||
const renderFormContent = useCallback(
|
||||
|
||||
@@ -222,7 +222,6 @@ export function QuoteRegistrationV2({
|
||||
useDevFill("quoteV2", useCallback(() => {
|
||||
// BOM이 있는 제품만 필터링
|
||||
const productsWithBom = finishedGoods.filter((fg) => fg.has_bom === true || (fg.bom && Array.isArray(fg.bom) && fg.bom.length > 0));
|
||||
console.log(`[DevFill] BOM 있는 제품: ${productsWithBom.length}개 / 전체: ${finishedGoods.length}개`);
|
||||
|
||||
// 랜덤 개소 생성 함수
|
||||
const createRandomLocation = (index: number): LocationItem => {
|
||||
@@ -611,12 +610,6 @@ export function QuoteRegistrationV2({
|
||||
const apiData = result.data as BomBulkResponse;
|
||||
const bomResponseItems = apiData.items || [];
|
||||
|
||||
console.log('[QuoteRegistrationV2] BOM 계산 결과:', {
|
||||
success: apiData.success,
|
||||
summary: apiData.summary,
|
||||
itemsCount: bomResponseItems.length,
|
||||
firstItem: bomResponseItems[0],
|
||||
});
|
||||
|
||||
// 결과 반영 (수동 추가 품목 보존)
|
||||
const updatedLocations = formData.locations.map((loc, index) => {
|
||||
@@ -638,13 +631,6 @@ export function QuoteRegistrationV2({
|
||||
const mergedItems = [...(bomResult.items || []), ...manualItems];
|
||||
const mergedGrandTotal = bomResult.grand_total + manualTotal;
|
||||
|
||||
console.log(`[QuoteRegistrationV2] Location ${index} bomResult:`, {
|
||||
items: bomResult.items?.length,
|
||||
manualItems: manualItems.length,
|
||||
mergedItems: mergedItems.length,
|
||||
subtotals: bomResult.subtotals,
|
||||
grand_total: mergedGrandTotal,
|
||||
});
|
||||
|
||||
return {
|
||||
...loc,
|
||||
|
||||
@@ -488,10 +488,6 @@ export function transformQuoteToFormData(quote: Quote): QuoteFormData {
|
||||
const amountPerItem = Math.round(totalBomAmount / itemCount);
|
||||
|
||||
// 디버깅 로그
|
||||
console.log('[transformQuoteToFormData] quote.calculationInputs:', JSON.stringify(quote.calculationInputs, null, 2));
|
||||
console.log('[transformQuoteToFormData] calcInputs:', JSON.stringify(calcInputs, null, 2));
|
||||
console.log('[transformQuoteToFormData] quote.items.length:', quote.items.length);
|
||||
console.log('[transformQuoteToFormData] totalBomAmount:', totalBomAmount, 'amountPerItem:', amountPerItem);
|
||||
|
||||
return {
|
||||
id: quote.id,
|
||||
@@ -588,7 +584,6 @@ export function transformApiDataToFormData(apiData: QuoteApiData): QuoteFormData
|
||||
const itemCount = calcInputs.length || 1;
|
||||
const amountPerItem = Math.round(totalBomAmount / itemCount);
|
||||
|
||||
console.log('[transformApiDataToFormData] totalBomAmount:', totalBomAmount, 'itemCount:', itemCount, 'amountPerItem:', amountPerItem);
|
||||
|
||||
return {
|
||||
id: String(apiData.id),
|
||||
@@ -1135,23 +1130,6 @@ export function transformFormDataToApi(formData: QuoteFormData): Record<string,
|
||||
items: itemsData,
|
||||
};
|
||||
|
||||
// 디버그: 전송되는 데이터 확인
|
||||
console.log('[transformFormDataToApi] 전송 데이터:', JSON.stringify({
|
||||
author: result.author,
|
||||
manager: result.manager,
|
||||
contact: result.contact,
|
||||
site_name: result.site_name,
|
||||
completion_date: result.completion_date,
|
||||
remarks: result.remarks,
|
||||
quantity: result.quantity,
|
||||
items_count: result.items?.length,
|
||||
items_sample: result.items?.slice(0, 3).map(i => ({
|
||||
item_name: i.item_name,
|
||||
quantity: i.quantity,
|
||||
base_quantity: i.base_quantity,
|
||||
calculated_quantity: i.calculated_quantity,
|
||||
})),
|
||||
}, null, 2));
|
||||
|
||||
return result;
|
||||
}
|
||||
Reference in New Issue
Block a user