From d7585b3f2ea941ee807c1e87bbc833265a193c78 Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Mon, 15 Sep 2025 10:14:09 +0000
Subject: (최겸) 구매 일반계약 및 상세, PO 전달 구현
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../main/general-contracts-table-columns.tsx       | 31 +++++++++++++---------
 1 file changed, 19 insertions(+), 12 deletions(-)

(limited to 'lib/general-contracts/main/general-contracts-table-columns.tsx')

diff --git a/lib/general-contracts/main/general-contracts-table-columns.tsx b/lib/general-contracts/main/general-contracts-table-columns.tsx
index 394a2cf5..d7854ee6 100644
--- a/lib/general-contracts/main/general-contracts-table-columns.tsx
+++ b/lib/general-contracts/main/general-contracts-table-columns.tsx
@@ -46,6 +46,7 @@ export interface GeneralContractListItem {
   linkedBidNumber?: string
   lastUpdatedAt: string
   notes?: string
+  vendorId?: number
   vendorName?: string
   vendorCode?: string
   managerName?: string
@@ -188,13 +189,16 @@ const getSelectionMethodText = (method?: string) => {
 // 금액 포맷팅
 const formatCurrency = (amount: string | number | null | undefined, currency = 'KRW') => {
   if (!amount && amount !== 0) return '-'
-  
+
   const numAmount = typeof amount === 'string' ? parseFloat(amount) : amount
   if (isNaN(numAmount)) return '-'
-  
+
+  // 통화 코드가 null이거나 유효하지 않은 경우 기본값 사용
+  const safeCurrency = currency && typeof currency === 'string' ? currency : 'USD'
+
   return new Intl.NumberFormat('ko-KR', {
     style: 'currency',
-    currency: currency,
+    currency: safeCurrency,
     minimumFractionDigits: 0,
     maximumFractionDigits: 0,
   }).format(numAmount)
@@ -527,15 +531,18 @@ export function getGeneralContractsColumns({ setRowAction }: GetColumnsProps): C
             </Button>
           </DropdownMenuTrigger>
           <DropdownMenuContent align="end">
-            <DropdownMenuItem onClick={() => setRowAction({ row, type: "view" })}>
-              <Eye className="mr-2 h-4 w-4" />
-              상세보기
-            </DropdownMenuItem>
-            <DropdownMenuItem onClick={() => setRowAction({ row, type: "update" })}>
-              <Edit className="mr-2 h-4 w-4" />
-              수정
-            </DropdownMenuItem>
-            <DropdownMenuSeparator />
+            {row.original.status !== 'Contract Delete' && (
+              <>
+                <DropdownMenuItem onClick={() => setRowAction({ row, type: "view" })}>
+                  <Eye className="mr-2 h-4 w-4" />
+                  상세보기
+                </DropdownMenuItem>
+                <DropdownMenuItem onClick={() => setRowAction({ row, type: "update" })}>
+                  <Edit className="mr-2 h-4 w-4" />
+                  수정
+                </DropdownMenuItem>
+              </>
+            )}
           </DropdownMenuContent>
         </DropdownMenu>
       ),
-- 
cgit v1.2.3

