summaryrefslogtreecommitdiff
path: root/lib/rfq-last
diff options
context:
space:
mode:
authorjoonhoekim <26rote@gmail.com>2025-11-17 12:05:43 +0900
committerjoonhoekim <26rote@gmail.com>2025-11-17 12:05:43 +0900
commit182dfce1ba5381389a0df05cd9d4a2ea541b229d (patch)
tree59054a73c8633c3208585146ce6a61f3493009bb /lib/rfq-last
parent91ae2e8b382e6945f713c66a68c5c3483d6ec5cf (diff)
(김준회) 오류 수정: PO 생성: toFixed 사용하는 값들의 타입 캐스팅 추가
Diffstat (limited to 'lib/rfq-last')
-rw-r--r--lib/rfq-last/contract-actions.ts7
1 files changed, 4 insertions, 3 deletions
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();