From 12cbc70c65a8588b85af3d90b527e16a0a9f8e21 Mon Sep 17 00:00:00 2001
From: joonhoekim <26rote@gmail.com>
Date: Sun, 2 Nov 2025 18:15:09 +0900
Subject: (김준회) 공통: 숫자 , 구분 (3자리) 공통함수 추가 및 PO 금액 컬럼들에
 적용, currency 정보에 따라 표기하도록 분기 처리
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 components/contract/contract-items-card.tsx | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

(limited to 'components/contract/contract-items-card.tsx')

diff --git a/components/contract/contract-items-card.tsx b/components/contract/contract-items-card.tsx
index 0d43f979..5bf5a927 100644
--- a/components/contract/contract-items-card.tsx
+++ b/components/contract/contract-items-card.tsx
@@ -1,5 +1,5 @@
 import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"
-import { formatCurrency } from "@/lib/utils"
+import { formatCurrency, formatNumber } from "@/lib/utils"
 
 interface ContractItem {
   materialNo?: string
@@ -13,10 +13,10 @@ interface ContractItem {
 
 interface ContractItemsCardProps {
   items: ContractItem[]
-  currency?: string
+  currency?: string | null
 }
 
-export function ContractItemsCard({ items, currency = "KRW" }: ContractItemsCardProps) {
+export function ContractItemsCard({ items, currency }: ContractItemsCardProps) {
   if (!items || items.length === 0) {
     return null
   }
@@ -50,18 +50,22 @@ export function ContractItemsCard({ items, currency = "KRW" }: ContractItemsCard
                   </td>
                   <td className="px-4 py-3 text-right font-mono">
                     {item.unitPrice
-                      ? formatCurrency(
-                          parseFloat(item.unitPrice.toString()),
-                          currency
-                        )
+                      ? currency
+                        ? formatCurrency(
+                            parseFloat(item.unitPrice.toString()),
+                            currency
+                          )
+                        : formatNumber(parseFloat(item.unitPrice.toString()))
                       : "-"}
                   </td>
                   <td className="px-4 py-3 text-right font-mono font-medium">
                     {item.contractAmount
-                      ? formatCurrency(
-                          parseFloat(item.contractAmount.toString()),
-                          currency
-                        )
+                      ? currency
+                        ? formatCurrency(
+                            parseFloat(item.contractAmount.toString()),
+                            currency
+                          )
+                        : formatNumber(parseFloat(item.contractAmount.toString()))
                       : "-"}
                   </td>
                 </tr>
-- 
cgit v1.2.3

