From 182dfce1ba5381389a0df05cd9d4a2ea541b229d Mon Sep 17 00:00:00 2001 From: joonhoekim <26rote@gmail.com> Date: Mon, 17 Nov 2025 12:05:43 +0900 Subject: (김준회) 오류 수정: PO 생성: toFixed 사용하는 값들의 타입 캐스팅 추가 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/rfq-last/contract-actions.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/rfq-last') diff --git a/lib/rfq-last/contract-actions.ts b/lib/rfq-last/contract-actions.ts index f28d7af9..7d1d0ddc 100644 --- a/lib/rfq-last/contract-actions.ts +++ b/lib/rfq-last/contract-actions.ts @@ -185,9 +185,10 @@ export async function createPO(params: CreatePOParams) { } // 가격 계산: SAP은 소수점을 포함한 문자열 형태로 받음 - const unitPrice = quoteItem?.unitPrice || 0; - const quantity = quoteItem?.quantity || item.quantity || 0; - const totalPrice = quoteItem?.totalPrice || (unitPrice * quantity); + // DB에서 가져온 값을 명시적으로 숫자로 변환 (문자열이나 Decimal 타입일 수 있음) + const unitPrice = Number(quoteItem?.unitPrice) || 0; + const quantity = Number(quoteItem?.quantity || item.quantity) || 0; + const totalPrice = Number(quoteItem?.totalPrice) || (unitPrice * quantity); // 납기일 계산 (우선순위: 견적 납기일 > PR 납기일 > 현재일자) let deliveryDate = getCurrentSAPDate(); -- cgit v1.2.3