From 79cfa7ea8f21ae227dbb2843ae536fe876ba7c55 Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Thu, 27 Nov 2025 03:08:50 +0000
Subject: (최겸) 구매 입찰 수정
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../detail/general-contract-basic-info.tsx         | 66 ++++++++++++++++------
 1 file changed, 48 insertions(+), 18 deletions(-)

(limited to 'lib/general-contracts/detail/general-contract-basic-info.tsx')

diff --git a/lib/general-contracts/detail/general-contract-basic-info.tsx b/lib/general-contracts/detail/general-contract-basic-info.tsx
index fc147b59..b0378912 100644
--- a/lib/general-contracts/detail/general-contract-basic-info.tsx
+++ b/lib/general-contracts/detail/general-contract-basic-info.tsx
@@ -26,6 +26,26 @@ interface ContractBasicInfoProps {
   contractId: number
 }
 
+interface PaymentBeforeDelivery {
+  apBond?: boolean
+  apBondPercent?: string
+  drawingSubmission?: boolean
+  drawingSubmissionPercent?: string
+  materialPurchase?: boolean
+  materialPurchasePercent?: string
+  additionalCondition?: boolean
+  additionalConditionPercent?: string
+}
+
+interface PaymentAfterDelivery {
+  commissioning?: boolean
+  commissioningPercent?: string
+  finalDocument?: boolean
+  finalDocumentPercent?: string
+  other?: boolean
+  otherText?: string
+}
+
 export function ContractBasicInfo({ contractId }: ContractBasicInfoProps) {
   const session = useSession()
   const [isLoading, setIsLoading] = useState(false)
@@ -59,10 +79,10 @@ export function ContractBasicInfo({ contractId }: ContractBasicInfoProps) {
     linkedBidNumber: '',
     notes: '',
     // 개별 JSON 필드들 (스키마에 맞게)
-    paymentBeforeDelivery: {},
+    paymentBeforeDelivery: {} as PaymentBeforeDelivery,
     paymentDelivery: '', // varchar 타입
     paymentDeliveryAdditionalText: '',
-    paymentAfterDelivery: {},
+    paymentAfterDelivery: {} as PaymentAfterDelivery,
     paymentTerm: '',
     taxType: '',
     liquidatedDamages: false,
@@ -314,7 +334,7 @@ export function ContractBasicInfo({ contractId }: ContractBasicInfoProps) {
       if (formData.contractScope !== '단가' && formData.contractScope !== '물량(실적)' && !formData.currency) {
         validationErrors.push('계약통화')
       }
-      if (!formData.paymentTerm) validationErrors.push('지불조건')
+      // if (!formData.paymentTerm) validationErrors.push('지불조건')
       if (!formData.taxType) validationErrors.push('세금조건')
       
       if (validationErrors.length > 0) {
@@ -1132,10 +1152,11 @@ export function ContractBasicInfo({ contractId }: ContractBasicInfoProps) {
                 </div>
               </div>
 
-              {/* 지불조건 */}
+              {/* 지불조건 -> 세금조건 (지불조건 삭제됨) */}
               <div className="space-y-2">
-                <Label className="text-sm font-medium">지불조건</Label>
+                <Label className="text-sm font-medium">세금조건</Label>
                 <div className="space-y-2">
+                  {/* 지불조건 필드 삭제됨
                   <div className="space-y-1">
                     <Label htmlFor="paymentTerm" className="text-xs">지불조건 *</Label>
                     <Select
@@ -1160,6 +1181,7 @@ export function ContractBasicInfo({ contractId }: ContractBasicInfoProps) {
                       </SelectContent>
                     </Select>
                   </div>
+                  */}
                   <div className="space-y-1">
                     <Label htmlFor="taxType" className="text-xs">세금조건 *</Label>
                     <Select
@@ -1196,19 +1218,27 @@ export function ContractBasicInfo({ contractId }: ContractBasicInfoProps) {
                       }))}
                       className="rounded w-4 h-4"
                     />
-                    <Label htmlFor="liquidatedDamages" className="text-xs">지체상금</Label>
-                    <Input
-                      type="number"
-                      min="0"
-                      placeholder="%"
-                      className="w-16 h-6 text-xs"
-                      value={formData.liquidatedDamagesPercent || ''}
-                      onChange={(e) => setFormData(prev => ({
-                        ...prev,
-                        liquidatedDamagesPercent: e.target.value
-                      }))}
-                      disabled={!formData.liquidatedDamages}
-                    />
+                    <div className="flex flex-col">
+                      <Label htmlFor="liquidatedDamages" className="text-xs">지체상금 (최대 징수 가능 비율)</Label>
+                      <span className="text-[10px] text-muted-foreground">
+                        * 일반적인 계약조건: 지체일수당 계약금액의 0.3%, 최대치 10%
+                      </span>
+                    </div>
+                    <div className="flex items-center gap-1">
+                      <Input
+                        type="number"
+                        min="0"
+                        placeholder=""
+                        className="w-16 h-6 text-xs text-right"
+                        value={formData.liquidatedDamagesPercent || ''}
+                        onChange={(e) => setFormData(prev => ({
+                          ...prev,
+                          liquidatedDamagesPercent: e.target.value
+                        }))}
+                        disabled={!formData.liquidatedDamages}
+                      />
+                      <span className="text-xs">%</span>
+                    </div>
                   </div>
                 </div>
               </div>
-- 
cgit v1.2.3

