From dd831478a3ab5ac7182903d41aa4b3e47f28224f Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Mon, 15 Sep 2025 10:13:11 +0000
Subject: (최겸) 구매 입찰 테스트 및 수정사항 반영
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 lib/bidding/list/biddings-table.tsx | 25 +++++++++++++++++++++----
 1 file changed, 21 insertions(+), 4 deletions(-)

(limited to 'lib/bidding/list/biddings-table.tsx')

diff --git a/lib/bidding/list/biddings-table.tsx b/lib/bidding/list/biddings-table.tsx
index 3b60c69b..2a8f98c3 100644
--- a/lib/bidding/list/biddings-table.tsx
+++ b/lib/bidding/list/biddings-table.tsx
@@ -12,7 +12,7 @@ import { useDataTable } from "@/hooks/use-data-table"
 import { DataTable } from "@/components/data-table/data-table"
 import { DataTableAdvancedToolbar } from "@/components/data-table/data-table-advanced-toolbar"
 import { getBiddingsColumns } from "./biddings-table-columns"
-import { getBiddings, getBiddingStatusCounts } from "@/lib/bidding/service"
+import { getBiddings, getBiddingStatusCounts, getActivePaymentTerms, getActiveIncoterms, getBiddingTypeCounts, getBiddingManagerCounts, getBiddingMonthlyStats } from "@/lib/bidding/service"
 import { BiddingListItem } from "@/db/schema"
 import { BiddingsTableToolbarActions } from "./biddings-table-toolbar-actions"
 import {
@@ -28,13 +28,26 @@ interface BiddingsTableProps {
     promises: Promise<
         [
             Awaited<ReturnType<typeof getBiddings>>,
-            Awaited<ReturnType<typeof getBiddingStatusCounts>>
+            Awaited<ReturnType<typeof getBiddingStatusCounts>>,
+            Awaited<ReturnType<typeof getBiddingTypeCounts>>, // 추가
+            Awaited<ReturnType<typeof getBiddingManagerCounts>>, // 추가
+            Awaited<ReturnType<typeof getBiddingMonthlyStats>>, // 추가
+            Awaited<ReturnType<typeof getActivePaymentTerms>>,
+            Awaited<ReturnType<typeof getActiveIncoterms>>
         ]
     >
 }
 
 export function BiddingsTable({ promises }: BiddingsTableProps) {
-    const [{ data, pageCount }, statusCounts] = React.use(promises)
+    const [biddingsResult, statusCounts, typeCounts, managerCounts, monthlyStats, paymentTermsResult, incotermsResult] = React.use(promises)
+
+    // biddingsResult에서 data와 pageCount 추출
+    const { data, pageCount } = biddingsResult
+
+    const paymentTermsOptions = paymentTermsResult.success && 'data' in paymentTermsResult ? paymentTermsResult.data || [] : []
+    const incotermsOptions = incotermsResult.success && 'data' in incotermsResult ? incotermsResult.data || [] : []
+    console.log(paymentTermsOptions,"paymentTermsOptions")
+    console.log(incotermsOptions,"incotermsOptions")
     const [isCompact, setIsCompact] = React.useState<boolean>(false)
     const [specMeetingDialogOpen, setSpecMeetingDialogOpen] = React.useState(false)
     const [prDocumentsDialogOpen, setPrDocumentsDialogOpen] = React.useState(false)
@@ -164,7 +177,11 @@ export function BiddingsTable({ promises }: BiddingsTableProps) {
                     compactStorageKey="biddingsTableCompact"
                     onCompactChange={handleCompactChange}
                 >
-                    <BiddingsTableToolbarActions table={table} />
+                    <BiddingsTableToolbarActions
+                      table={table}
+                      paymentTermsOptions={paymentTermsOptions}
+                      incotermsOptions={incotermsOptions}
+                    />
                 </DataTableAdvancedToolbar>
             </DataTable>
 
-- 
cgit v1.2.3

