summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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();