1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
|
import { Contract } from "@/db/schema/contract"
type VirtualColumns = 'esignStatus'
// Create a union type combining real and virtual columns
export interface PoColumnConfig {
id: keyof Contract | VirtualColumns
label: string
group?: string
excelHeader?: string
type?: string
customType?: string // Add this to the base interface
}
export const poColumnsConfig: PoColumnConfig[] = [
{
id: "id",
label: "ID",
excelHeader: "ID",
// group: "Key Info",
type: "number",
},
{
id: "projectId",
label: "Project ID",
excelHeader: "Project ID",
// group: "Key Info",
type: "number",
},
{
id: "vendorId",
label: "Vendor ID",
excelHeader: "Vendor ID",
// group: "Key Info",
type: "number",
},
{
id: "contractNo",
label: "Form Code",
excelHeader: "Form Code",
// group: "Basic Info",
type: "text",
},
{
id: "contractName",
label: "Contract Name",
excelHeader: "Contract Name",
// group: "Basic Info",
type: "text",
},
{
id: "status",
label: "Status",
excelHeader: "Status",
// group: "Basic Info",
type: "text",
},
{
id: "esignStatus", // db에 없는 가상 컬럼
label: "E-Sign Status",
excelHeader: "E-Sign Status",
// group: "Basic Info",
type: "custom", // 커스텀 렌더링이 필요함을 나타냄
customType: "esignStatus", // 구분이 필요한 경우 추가 필드
},
{
id: "startDate",
label: "Start Date",
excelHeader: "Start Date",
// group: "Dates",
type: "date",
},
{
id: "endDate",
label: "End Date",
excelHeader: "End Date",
// group: "Dates",
type: "date",
},
{
id: "paymentTerms",
label: "Payment Terms",
excelHeader: "Payment Terms",
// group: "PO Info",
type: "text",
},
{
id: "deliveryTerms",
label: "Delivery Terms",
excelHeader: "Delivery Terms",
// group: "PO Info",
type: "text",
},
{
id: "deliveryDate",
label: "Delivery Date",
excelHeader: "Delivery Date",
// group: "PO Info",
type: "date",
},
{
id: "deliveryLocation",
label: "Delivery Location",
excelHeader: "Delivery Location",
// group: "PO Info",
type: "text",
},
{
id: "currency",
label: "Currency",
excelHeader: "Currency",
// group: "Money",
type: "text",
},
{
id: "totalAmount",
label: "Total Amount",
excelHeader: "Total Amount",
// group: "Money",
type: "number",
},
{
id: "discount",
label: "Discount",
excelHeader: "Discount",
// group: "Money",
type: "number",
},
{
id: "tax",
label: "Tax",
excelHeader: "Tax",
// group: "Money",
type: "number",
},
{
id: "shippingFee",
label: "Shipping Fee",
excelHeader: "Shipping Fee",
// group: "Money",
type: "number",
},
{
id: "netTotal",
label: "Net Total",
excelHeader: "Net Total",
// group: "Money",
type: "number",
},
{
id: "partialShippingAllowed",
label: "Partial Shipping",
excelHeader: "Partial Shipping",
// group: "Options",
type: "boolean",
},
{
id: "partialPaymentAllowed",
label: "Partial Payment",
excelHeader: "Partial Payment",
// group: "Options",
type: "boolean",
},
{
id: "remarks",
label: "Remarks",
excelHeader: "Remarks",
// group: "Notes",
type: "text",
},
{
id: "version",
label: "Version",
excelHeader: "Version",
// group: "Versioning",
type: "number",
},
{
id: "createdAt",
label: "Created At",
excelHeader: "Created At",
// group: "System Info",
type: "date",
},
{
id: "updatedAt",
label: "Updated At",
excelHeader: "Updated At",
// group: "System Info",
type: "date",
},
]
|