From a8674e6b91fb4d356c311fad0251878de154da53 Mon Sep 17 00:00:00 2001 From: dujinkim Date: Mon, 24 Nov 2025 11:16:32 +0000 Subject: (최겸) 구매 입찰 수정(폐찰, 낙찰 결재 기능 추가 등) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/bidding/ProjectSelectorBid.tsx | 27 +- .../bidding/create/bidding-create-dialog.tsx | 8 +- .../bidding/manage/bidding-basic-info-editor.tsx | 22 +- .../bidding/manage/bidding-companies-editor.tsx | 27 +- .../manage/bidding-detail-vendor-create-dialog.tsx | 30 ++- components/bidding/manage/bidding-items-editor.tsx | 271 ++++++++++++++++++--- .../bidding/manage/create-pre-quote-rfq-dialog.tsx | 62 +++-- components/bidding/price-adjustment-dialog.tsx | 23 +- .../selectors/cost-center/cost-center-selector.tsx | 26 -- .../selectors/cost-center/cost-center-service.ts | 40 +-- .../cost-center/cost-center-single-selector.tsx | 24 +- .../selectors/gl-account/gl-account-selector.tsx | 20 +- .../selectors/gl-account/gl-account-service.ts | 32 +-- .../gl-account/gl-account-single-selector.tsx | 14 +- .../procurement-item-selector-dialog-single.tsx | 2 +- .../selectors/wbs-code/wbs-code-selector.tsx | 37 +-- .../common/selectors/wbs-code/wbs-code-service.ts | 48 +--- .../wbs-code/wbs-code-single-selector.tsx | 40 +-- 18 files changed, 439 insertions(+), 314 deletions(-) (limited to 'components') diff --git a/components/bidding/ProjectSelectorBid.tsx b/components/bidding/ProjectSelectorBid.tsx index de9e435e..0fc567b3 100644 --- a/components/bidding/ProjectSelectorBid.tsx +++ b/components/bidding/ProjectSelectorBid.tsx @@ -1,7 +1,7 @@ "use client" import * as React from "react" -import { Check, ChevronsUpDown, X } from "lucide-react" +import { Check, ChevronsUpDown } from "lucide-react" import { Button } from "@/components/ui/button" import { Popover, PopoverTrigger, PopoverContent } from "@/components/ui/popover" import { Command, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem } from "@/components/ui/command" @@ -10,7 +10,7 @@ import { getProjects, type Project } from "@/lib/rfqs/service" interface ProjectSelectorProps { selectedProjectId?: number | null; - onProjectSelect: (project: Project) => void; + onProjectSelect: (project: Project | null) => void; placeholder?: string; filterType?: string; // 옵션으로 필터 타입 지정 가능 } @@ -76,7 +76,7 @@ export function ProjectSelector({ // 이미 선택된 프로젝트를 다시 선택하면 선택 해제 if (selectedProject?.id === project.id) { setSelectedProject(null); - onProjectSelect(null as any); // 선택 해제를 위해 null 전달 + onProjectSelect(null); // 선택 해제를 위해 null 전달 setOpen(false); return; } @@ -86,12 +86,6 @@ export function ProjectSelector({ setOpen(false); }; - // 프로젝트 선택 해제 - const handleClearSelection = (e: React.MouseEvent) => { - e.stopPropagation(); // Popover가 열리지 않도록 방지 - setSelectedProject(null); - onProjectSelect(null as any); // 선택 해제를 위해 null 전달 - }; return ( @@ -106,20 +100,7 @@ export function ProjectSelector({ {isLoading ? ( "프로젝트 로딩 중..." ) : selectedProject ? ( -
- {selectedProject.projectCode} -
- - -
-
+ {selectedProject.projectCode} ) : (
{placeholder} diff --git a/components/bidding/create/bidding-create-dialog.tsx b/components/bidding/create/bidding-create-dialog.tsx index 9b0a6f66..498d8d1c 100644 --- a/components/bidding/create/bidding-create-dialog.tsx +++ b/components/bidding/create/bidding-create-dialog.tsx @@ -618,7 +618,7 @@ export function BiddingCreateDialog({ form, onSuccess }: BiddingCreateDialogProp {/* 4행: 하도급법적용여부, SHI 지급조건 */}
- {/* ( @@ -637,13 +637,13 @@ export function BiddingCreateDialog({ form, onSuccess }: BiddingCreateDialogProp }} /> - 연동제 적용 요건 + 하도급법 적용여부
)} - /> */} + /> - 구매조직 + 구매조직 * @@ -1019,7 +1019,7 @@ export function BiddingBasicInfoEditor({ biddingId, readonly = false }: BiddingB
- {/* 4행: 계약 납품일, 연동제 적용 가능 */} + {/* 4행: 계약 납품일, 하도급법 적용여부 */}
계약 납품일 @@ -1034,6 +1034,24 @@ export function BiddingBasicInfoEditor({ biddingId, readonly = false }: BiddingB }} />
+
+ 하도급법 적용여부 +
+ { + setBiddingConditions(prev => ({ + ...prev, + isPriceAdjustmentApplicable: checked + })) + }} + id="price-adjustment" + /> + + {biddingConditions.isPriceAdjustmentApplicable ? "적용" : "미적용"} + +
+
{/* 5행: 스페어파트 옵션 */} diff --git a/components/bidding/manage/bidding-companies-editor.tsx b/components/bidding/manage/bidding-companies-editor.tsx index a5ce1349..da566c82 100644 --- a/components/bidding/manage/bidding-companies-editor.tsx +++ b/components/bidding/manage/bidding-companies-editor.tsx @@ -49,6 +49,7 @@ interface QuotationVendor { currency: string invitationStatus: string isPriceAdjustmentApplicableQuestion?: boolean + businessSize?: string | null } interface BiddingCompaniesEditorProps { @@ -106,17 +107,18 @@ export function BiddingCompaniesEditor({ biddingId, readonly = false }: BiddingC try { const result = await getBiddingVendors(biddingId) if (result.success && result.data) { - const vendorsList = result.data.map(v => ({ - ...v, - companyId: v.companyId || undefined, - vendorName: v.vendorName || '', - vendorCode: v.vendorCode || '', - contactPerson: v.contactPerson ?? undefined, - contactEmail: v.contactEmail ?? undefined, - contactPhone: v.contactPhone ?? undefined, - quotationAmount: v.quotationAmount ? parseFloat(v.quotationAmount) : undefined, - isPriceAdjustmentApplicableQuestion: v.isPriceAdjustmentApplicableQuestion ?? false, - })) + const vendorsList = result.data.map(v => ({ + ...v, + companyId: v.companyId || undefined, + vendorName: v.vendorName || '', + vendorCode: v.vendorCode || '', + contactPerson: v.contactPerson ?? undefined, + contactEmail: v.contactEmail ?? undefined, + contactPhone: v.contactPhone ?? undefined, + quotationAmount: v.quotationAmount ? parseFloat(v.quotationAmount) : undefined, + isPriceAdjustmentApplicableQuestion: v.isPriceAdjustmentApplicableQuestion ?? false, + businessSize: v.businessSize ?? undefined, + })) setVendors(vendorsList) // 각 업체별 첫 번째 담당자 정보 로드 @@ -161,6 +163,7 @@ export function BiddingCompaniesEditor({ biddingId, readonly = false }: BiddingC currency: v.currency || 'KRW', invitationStatus: v.invitationStatus, isPriceAdjustmentApplicableQuestion: v.isPriceAdjustmentApplicableQuestion ?? false, + businessSize: v.businessSize ?? undefined, })) setVendors(vendorsList) @@ -503,6 +506,7 @@ export function BiddingCompaniesEditor({ biddingId, readonly = false }: BiddingC 선택 업체명 업체코드 + 기업규모 담당자 이름 담당자 이메일 담당자 연락처 @@ -526,6 +530,7 @@ export function BiddingCompaniesEditor({ biddingId, readonly = false }: BiddingC {vendor.vendorName} {vendor.vendorCode} + {vendor.businessSize || '-'} {vendor.companyId && vendorFirstContacts.has(vendor.companyId) ? vendorFirstContacts.get(vendor.companyId)!.contactName diff --git a/components/bidding/manage/bidding-detail-vendor-create-dialog.tsx b/components/bidding/manage/bidding-detail-vendor-create-dialog.tsx index de813121..0dd9f0eb 100644 --- a/components/bidding/manage/bidding-detail-vendor-create-dialog.tsx +++ b/components/bidding/manage/bidding-detail-vendor-create-dialog.tsx @@ -28,7 +28,7 @@ import { import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs' import { ChevronsUpDown, Loader2, X, Plus } from 'lucide-react' import { createBiddingDetailVendor } from '@/lib/bidding/detail/service' -import { searchVendorsForBidding } from '@/lib/bidding/service' +import { searchVendorsForBidding, getVendorsBusinessSize } from '@/lib/bidding/service' import { useToast } from '@/hooks/use-toast' import { useTransition } from 'react' import { Badge } from '@/components/ui/badge' @@ -68,6 +68,9 @@ export function BiddingDetailVendorCreateDialog({ const [selectedVendorsWithQuestion, setSelectedVendorsWithQuestion] = React.useState([]) const [vendorOpen, setVendorOpen] = React.useState(false) + // Business size 정보 캐싱 + const [businessSizeMap, setBusinessSizeMap] = React.useState>({}) + // 벤더 로드 const loadVendors = React.useCallback(async () => { try { @@ -204,6 +207,28 @@ export function BiddingDetailVendorCreateDialog({ const selectedVendors = selectedVendorsWithQuestion.map(item => item.vendor) + // 선택된 vendor들의 businessSize 정보를 useMemo로 캐싱 + const loadBusinessSize = React.useMemo(() => { + const selectedVendorIds = selectedVendors.map(v => v.id) + if (selectedVendorIds.length === 0) return + + // 이미 로드된 vendor들은 제외 + const newVendorIds = selectedVendorIds.filter(id => !(id in businessSizeMap)) + + if (newVendorIds.length > 0) { + getVendorsBusinessSize(newVendorIds).then(result => { + setBusinessSizeMap(prev => ({ ...prev, ...result })) + }).catch(error => { + console.error('Failed to load business size:', error) + }) + } + }, [selectedVendors, businessSizeMap]) + + // selectedVendors가 변경될 때마다 businessSize 로드 + React.useEffect(() => { + loadBusinessSize + }, [loadBusinessSize]) + return ( @@ -382,6 +407,9 @@ export function BiddingDetailVendorCreateDialog({ > 연동제 적용요건 문의 + + 기업규모: {businessSizeMap[item.vendor.id] || '미정'} + ))} diff --git a/components/bidding/manage/bidding-items-editor.tsx b/components/bidding/manage/bidding-items-editor.tsx index f0287ae4..208cf040 100644 --- a/components/bidding/manage/bidding-items-editor.tsx +++ b/components/bidding/manage/bidding-items-editor.tsx @@ -441,8 +441,8 @@ export function BiddingItemsEditor({ biddingId, readonly = false }: BiddingItems materialGroupInfo: null, materialNumber: null, materialInfo: null, - priceUnit: null, - purchaseUnit: '1', + priceUnit: 1, + purchaseUnit: 'EA', materialWeight: null, wbsCode: null, wbsName: null, @@ -495,8 +495,8 @@ export function BiddingItemsEditor({ biddingId, readonly = false }: BiddingItems prev.map((item) => { if (item.id === id) { const updatedItem = { ...item, ...updates } - // 내정단가, 수량, 중량, 구매단위가 변경되면 내정금액 재계산 - if (updates.targetUnitPrice || updates.quantity || updates.totalWeight || updates.purchaseUnit) { + // 내정단가, 수량, 중량, 가격단위가 변경되면 내정금액 재계산 + if (updates.targetUnitPrice || updates.quantity || updates.totalWeight || updates.priceUnit) { updatedItem.targetAmount = calculateTargetAmount(updatedItem) } return updatedItem @@ -533,20 +533,66 @@ export function BiddingItemsEditor({ biddingId, readonly = false }: BiddingItems const calculateTargetAmount = (item: PRItemInfo): string => { const unitPrice = parseFloat(item.targetUnitPrice?.replace(/,/g, '') || '0') || 0 - const purchaseUnit = parseFloat(item.purchaseUnit || '1') || 1 + const priceUnit = parseFloat(item.priceUnit || '1') || 1 let amount = 0 if (quantityWeightMode === 'quantity') { const quantity = parseFloat(item.quantity || '0') || 0 - amount = (quantity / purchaseUnit) * unitPrice + amount = (quantity / priceUnit) * unitPrice } else { const weight = parseFloat(item.totalWeight || '0') || 0 - amount = (weight / purchaseUnit) * unitPrice + amount = (weight / priceUnit) * unitPrice } return Math.floor(amount).toString() } + // 합계 계산 함수들 + const calculateTotals = () => { + let quantityTotal = 0 + let weightTotal = 0 + let targetAmountTotal = 0 + let budgetAmountTotal = 0 + let actualAmountTotal = 0 + + items.forEach((item) => { + // 수량 합계 + if (item.quantity) { + quantityTotal += parseFloat(item.quantity) || 0 + } + + // 중량 합계 + if (item.totalWeight) { + weightTotal += parseFloat(item.totalWeight) || 0 + } + + // 내정금액 합계 + if (item.targetAmount) { + targetAmountTotal += parseFloat(item.targetAmount.replace(/,/g, '')) || 0 + } + + // 예산금액 합계 + if (item.budgetAmount) { + budgetAmountTotal += parseFloat(item.budgetAmount.replace(/,/g, '')) || 0 + } + + // 실적금액 합계 + if (item.actualAmount) { + actualAmountTotal += parseFloat(item.actualAmount.replace(/,/g, '')) || 0 + } + }) + + return { + quantityTotal, + weightTotal, + targetAmountTotal, + budgetAmountTotal, + actualAmountTotal, + } + } + + const totals = calculateTotals() + if (isLoading) { return (
@@ -572,14 +618,16 @@ export function BiddingItemsEditor({ biddingId, readonly = false }: BiddingItems 프로젝트코드 프로젝트명 - PR 번호 + 자재그룹코드 * 자재그룹명 * 자재코드 자재명 - 수량 - 단위 + 수량(중량) * + 단위 * + 가격단위 구매단위 + 자재순중량 내정단가 내정금액 내정통화 @@ -587,19 +635,120 @@ export function BiddingItemsEditor({ biddingId, readonly = false }: BiddingItems 예산통화 실적금액 실적통화 + 납품요청일 * WBS코드 WBS명 코스트센터코드 코스트센터명 GL계정코드 GL계정명 - 납품요청일 * + PR 번호 액션 + {/* 합계 행 */} + + + 합계 + + + - + + + - + + + - + + + - + + + - + + + - + + + - + + + + {quantityWeightMode === 'quantity' + ? `${formatNumberWithCommas(totals.quantityTotal.toString())}` + : `${formatNumberWithCommas(totals.weightTotal.toString())}` + } + + + + + {quantityWeightMode === 'quantity' + ? `${items[0]?.quantityUnit || 'EA'}` + : `${items[0]?.weightUnit || 'KG'}` + } + + + + - + + + - + + + - + + + - + + + {formatNumberWithCommas(totals.targetAmountTotal.toString())} + + + - + + + {formatNumberWithCommas(totals.budgetAmountTotal.toString())} + + + - + + + {formatNumberWithCommas(totals.actualAmountTotal.toString())} + + + - + + + - + + + - + + + - + + + - + + + - + + + - + + + - + + + - + + + - + + {items.map((item, index) => ( @@ -617,10 +766,17 @@ export function BiddingItemsEditor({ biddingId, readonly = false }: BiddingItems { - updatePRItem(item.id, { - projectId: project.id, - projectInfo: project.projectName - }) + if (project) { + updatePRItem(item.id, { + projectId: project.id, + projectInfo: project.projectName + }) + } else { + updatePRItem(item.id, { + projectId: null, + projectInfo: null + }) + } }} placeholder="프로젝트 선택" /> @@ -633,14 +789,7 @@ export function BiddingItemsEditor({ biddingId, readonly = false }: BiddingItems className="h-8 text-xs bg-muted/50" /> - - - + {biddingType !== 'equipment' ? ( updatePRItem(item.id, { quantity: e.target.value })} className="h-8 text-xs" + required /> ) : ( updatePRItem(item.id, { totalWeight: e.target.value })} className="h-8 text-xs" + required /> )} @@ -762,6 +913,7 @@ export function BiddingItemsEditor({ biddingId, readonly = false }: BiddingItems updatePRItem(item.id, { weightUnit: value })} + required > @@ -797,9 +950,42 @@ export function BiddingItemsEditor({ biddingId, readonly = false }: BiddingItems type="number" min="1" step="1" - placeholder="구매단위" - value={item.purchaseUnit || ''} - onChange={(e) => updatePRItem(item.id, { purchaseUnit: e.target.value })} + placeholder="가격단위" + value={item.priceUnit || ''} + onChange={(e) => updatePRItem(item.id, { priceUnit: e.target.value })} + className="h-8 text-xs" + /> + + + + + + updatePRItem(item.id, { materialWeight: e.target.value })} className="h-8 text-xs" /> @@ -887,10 +1073,24 @@ export function BiddingItemsEditor({ biddingId, readonly = false }: BiddingItems + + updatePRItem(item.id, { requestedDeliveryDate: e.target.value })} + className="h-8 text-xs" + required + /> +
diff --git a/components/common/selectors/cost-center/cost-center-selector.tsx b/components/common/selectors/cost-center/cost-center-selector.tsx index 3aad5787..f87b6928 100644 --- a/components/common/selectors/cost-center/cost-center-selector.tsx +++ b/components/common/selectors/cost-center/cost-center-selector.tsx @@ -77,11 +77,6 @@ export function CostCenterSelector({ const [globalFilter, setGlobalFilter] = useState('') const [isPending, startTransition] = useTransition() - // 날짜 포맷 함수 (YYYYMMDD -> YYYY-MM-DD) - const formatDate = (dateStr: string) => { - if (!dateStr || dateStr.length !== 8) return dateStr - return `${dateStr.substring(0, 4)}-${dateStr.substring(4, 6)}-${dateStr.substring(6, 8)}` - } // Cost Center 선택 핸들러 const handleCodeSelect = useCallback(async (code: CostCenter) => { @@ -117,27 +112,6 @@ export function CostCenterSelector({
{row.getValue('KTEXT')}
), }, - { - accessorKey: 'LTEXT', - header: '설명', - cell: ({ row }) => ( -
{row.getValue('LTEXT')}
- ), - }, - { - accessorKey: 'DATAB', - header: '시작일', - cell: ({ row }) => ( -
{formatDate(row.getValue('DATAB'))}
- ), - }, - { - accessorKey: 'DATBI', - header: '종료일', - cell: ({ row }) => ( -
{formatDate(row.getValue('DATBI'))}
- ), - }, { id: 'actions', header: '선택', diff --git a/components/common/selectors/cost-center/cost-center-service.ts b/components/common/selectors/cost-center/cost-center-service.ts index 844215f0..1e7e43f5 100644 --- a/components/common/selectors/cost-center/cost-center-service.ts +++ b/components/common/selectors/cost-center/cost-center-service.ts @@ -5,19 +5,16 @@ import { oracleKnex } from '@/lib/oracle-db/db' // Cost Center 타입 정의 export interface CostCenter { KOSTL: string // Cost Center 코드 - DATAB: string // 시작일 - DATBI: string // 종료일 KTEXT: string // 단축 텍스트 - LTEXT: string // 긴 텍스트 } // 테스트 환경용 폴백 데이터 const FALLBACK_TEST_DATA: CostCenter[] = [ - { KOSTL: 'D6023930', DATAB: '20230101', DATBI: '99991231', KTEXT: '구매팀', LTEXT: '구매팀 Cost Center(테스트데이터 - 오라클 페칭 실패시)' }, - { KOSTL: 'D6023931', DATAB: '20230101', DATBI: '99991231', KTEXT: '자재팀', LTEXT: '자재팀 Cost Center(테스트데이터 - 오라클 페칭 실패시)' }, - { KOSTL: 'D6023932', DATAB: '20230101', DATBI: '99991231', KTEXT: '조달팀', LTEXT: '조달팀 Cost Center(테스트데이터 - 오라클 페칭 실패시)' }, - { KOSTL: 'D6023933', DATAB: '20230101', DATBI: '99991231', KTEXT: '구매1팀', LTEXT: '구매1팀 Cost Center(테스트데이터 - 오라클 페칭 실패시)' }, - { KOSTL: 'D6023934', DATAB: '20230101', DATBI: '99991231', KTEXT: '구매2팀', LTEXT: '구매2팀 Cost Center(테스트데이터 - 오라클 페칭 실패시)' }, + { KOSTL: 'D6023930', KTEXT: '구매팀(테스트데이터 - 오라클 페칭 실패시)' }, + { KOSTL: 'D6023931', KTEXT: '자재팀(테스트데이터 - 오라클 페칭 실패시)' }, + { KOSTL: 'D6023932', KTEXT: '조달팀(테스트데이터 - 오라클 페칭 실패시)' }, + { KOSTL: 'D6023933', KTEXT: '구매1팀(테스트데이터 - 오라클 페칭 실패시)' }, + { KOSTL: 'D6023934', KTEXT: '구매2팀(테스트데이터 - 오라클 페칭 실패시)' }, ] /** @@ -35,19 +32,11 @@ export async function getCostCenters(): Promise<{ console.log('📋 [getCostCenters] Oracle 쿼리 시작...') const result = await oracleKnex.raw(` - SELECT - KOSTL, - DATAB, - DATBI, - KTEXT, - LTEXT - FROM CMCTB_COSTCENTER - WHERE ROWNUM < 100 - AND NVL(BKZKP,' ') = ' ' - AND TO_CHAR(SYSDATE,'YYYYMMDD') BETWEEN DATAB AND DATBI - AND KOKRS = 'H100' - ORDER BY KOSTL + SELECT KOSTL , KTEXT FROM CMCTB_COSTCENTER + WHERE TO_CHAR(SYSDATE,'YYYYMMDD') BETWEEN DATAB AND DATBI AND ROWNUM < 10 `) + // KOSTL -> CONTCENTER + // KTEXT -> CONTCENTER명 // Oracle raw query의 결과는 rows 배열에 들어있음 const rows = (result.rows || result) as Array> @@ -56,17 +45,12 @@ export async function getCostCenters(): Promise<{ // null 값 필터링 const cleanedResult = rows - .filter((item) => - item.KOSTL && - item.DATAB && - item.DATBI + .filter((item) => + item.KOSTL ) .map((item) => ({ KOSTL: String(item.KOSTL), - DATAB: String(item.DATAB), - DATBI: String(item.DATBI), - KTEXT: String(item.KTEXT || ''), - LTEXT: String(item.LTEXT || '') + KTEXT: String(item.KTEXT || '') })) console.log(`✅ [getCostCenters] 필터링 후 ${cleanedResult.length}건`) diff --git a/components/common/selectors/cost-center/cost-center-single-selector.tsx b/components/common/selectors/cost-center/cost-center-single-selector.tsx index e09f782b..952fab3f 100644 --- a/components/common/selectors/cost-center/cost-center-single-selector.tsx +++ b/components/common/selectors/cost-center/cost-center-single-selector.tsx @@ -133,27 +133,6 @@ export function CostCenterSingleSelector({
{row.getValue('KTEXT')}
), }, - { - accessorKey: 'LTEXT', - header: '설명', - cell: ({ row }) => ( -
{row.getValue('LTEXT')}
- ), - }, - { - accessorKey: 'DATAB', - header: '시작일', - cell: ({ row }) => ( -
{formatDate(row.getValue('DATAB'))}
- ), - }, - { - accessorKey: 'DATBI', - header: '종료일', - cell: ({ row }) => ( -
{formatDate(row.getValue('DATBI'))}
- ), - }, { id: 'actions', header: '선택', @@ -283,7 +262,6 @@ export function CostCenterSingleSelector({
[{currentSelectedCode.KOSTL}] {currentSelectedCode.KTEXT} - - {currentSelectedCode.LTEXT}
)} @@ -291,7 +269,7 @@ export function CostCenterSingleSelector({
handleSearchChange(e.target.value)} className="flex-1" diff --git a/components/common/selectors/gl-account/gl-account-selector.tsx b/components/common/selectors/gl-account/gl-account-selector.tsx index 7e47a072..63eeede8 100644 --- a/components/common/selectors/gl-account/gl-account-selector.tsx +++ b/components/common/selectors/gl-account/gl-account-selector.tsx @@ -5,9 +5,8 @@ * * @description * - 오라클에서 GL 계정들을 조회 - * - SAKNR: 계정(G/L) - * - FIPEX: 세부계정 - * - TEXT1: 계정명 + * - GL: 계정 + * - GL명: 계정명 */ import { useState, useCallback, useMemo, useTransition } from 'react' @@ -52,7 +51,6 @@ export interface GlAccountSelectorProps { export interface GlAccountItem { saknr: string // 계정(G/L) - fipex: string // 세부계정 text1: string // 계정명 displayText: string // 표시용 텍스트 } @@ -76,7 +74,7 @@ export function GlAccountSelector({ // GL 계정 선택 핸들러 const handleCodeSelect = useCallback(async (code: GlAccount) => { // 이미 선택된 계정을 다시 선택하면 선택 해제 - if (selectedCode && selectedCode.SAKNR === code.SAKNR && selectedCode.FIPEX === code.FIPEX) { + if (selectedCode && selectedCode.SAKNR === code.SAKNR) { onCodeSelect(undefined as any) // 선택 해제를 위해 undefined 전달 setOpen(false) return @@ -100,13 +98,6 @@ export function GlAccountSelector({
{row.getValue('SAKNR')}
), }, - { - accessorKey: 'FIPEX', - header: '세부계정', - cell: ({ row }) => ( -
{row.getValue('FIPEX')}
- ), - }, { accessorKey: 'TEXT1', header: '계정명', @@ -206,7 +197,6 @@ export function GlAccountSelector({ {selectedCode ? (
[{selectedCode.SAKNR}] - {selectedCode.FIPEX} {selectedCode.TEXT1}
[{currentSelectedCode.SAKNR}] - {currentSelectedCode.FIPEX} - - {currentSelectedCode.TEXT1} + {currentSelectedCode.TEXT1}
)} @@ -271,7 +263,7 @@ export function GlAccountSingleSelector({
handleSearchChange(e.target.value)} className="flex-1" diff --git a/components/common/selectors/procurement-item/procurement-item-selector-dialog-single.tsx b/components/common/selectors/procurement-item/procurement-item-selector-dialog-single.tsx index 90d4975b..84fd85ff 100644 --- a/components/common/selectors/procurement-item/procurement-item-selector-dialog-single.tsx +++ b/components/common/selectors/procurement-item/procurement-item-selector-dialog-single.tsx @@ -131,7 +131,7 @@ export function ProcurementItemSelectorDialogSingle({
- [{currentSelectedCode.PROJ_NO}] - {currentSelectedCode.WBS_ELMT} + [{currentSelectedCode.WBS_ELMT}] {currentSelectedCode.WBS_ELMT_NM}
@@ -278,7 +261,7 @@ export function WbsCodeSingleSelector({
handleSearchChange(e.target.value)} className="flex-1" @@ -311,8 +294,7 @@ export function WbsCodeSingleSelector({ {table.getRowModel().rows?.length ? ( table.getRowModel().rows.map((row) => { - const isRowSelected = currentSelectedCode?.WBS_ELMT === row.original.WBS_ELMT && - currentSelectedCode?.PROJ_NO === row.original.PROJ_NO + const isRowSelected = currentSelectedCode?.WBS_ELMT === row.original.WBS_ELMT return (