@things-factory/tax-invoice 6.2.86 → 7.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/pages/tax-invoice/tax-invoice-detail-popup.ts +5 -6
- package/client/pages/tax-invoice/tax-invoice-list-page.ts +119 -169
- package/client/pages/tax-invoice-api/tax-invoice-api-page.ts +6 -5
- package/client/pages/tax-invoice-company/tax-invoice-company-importer.ts +2 -2
- package/client/route.ts +4 -4
- package/dist-client/pages/tax-invoice/tax-invoice-detail-popup.js +11 -9
- package/dist-client/pages/tax-invoice/tax-invoice-detail-popup.js.map +1 -1
- package/dist-client/pages/tax-invoice/tax-invoice-list-page.d.ts +47 -21
- package/dist-client/pages/tax-invoice/tax-invoice-list-page.js +121 -161
- package/dist-client/pages/tax-invoice/tax-invoice-list-page.js.map +1 -1
- package/dist-client/pages/tax-invoice-api/tax-invoice-api-page.d.ts +1 -1
- package/dist-client/pages/tax-invoice-api/tax-invoice-api-page.js +6 -5
- package/dist-client/pages/tax-invoice-api/tax-invoice-api-page.js.map +1 -1
- package/dist-client/pages/tax-invoice-company/tax-invoice-company-importer.js +2 -2
- package/dist-client/pages/tax-invoice-company/tax-invoice-company-importer.js.map +1 -1
- package/dist-client/route.d.ts +1 -1
- package/dist-client/route.js +3 -3
- package/dist-client/route.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/service/tax-invoice/tax-invoice-mutation.js +132 -27
- package/dist-server/service/tax-invoice/tax-invoice-mutation.js.map +1 -1
- package/dist-server/service/tax-invoice/tax-invoice-query.js +1 -1
- package/dist-server/service/tax-invoice/tax-invoice-query.js.map +1 -1
- package/dist-server/service/tax-invoice/tax-invoice-type.js +10 -258
- package/dist-server/service/tax-invoice/tax-invoice-type.js.map +1 -1
- package/dist-server/service/tax-invoice/tax-invoice.js +21 -15
- package/dist-server/service/tax-invoice/tax-invoice.js.map +1 -1
- package/dist-server/service/tax-invoice-api/tax-invoice-api-type.js +5 -0
- package/dist-server/service/tax-invoice-api/tax-invoice-api-type.js.map +1 -1
- package/dist-server/service/tax-invoice-item/tax-invoice-item-query.js.map +1 -1
- package/dist-server/service/tax-invoice-item/tax-invoice-item-type.js +4 -4
- package/dist-server/service/tax-invoice-item/tax-invoice-item-type.js.map +1 -1
- package/dist-server/service/tax-invoice-item/tax-invoice-item.js +3 -3
- package/dist-server/service/tax-invoice-item/tax-invoice-item.js.map +1 -1
- package/dist-server/service/unipost-api/tax-invoice-inquiry.js +90 -0
- package/dist-server/service/unipost-api/tax-invoice-inquiry.js.map +1 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/server/service/tax-invoice/tax-invoice-mutation.ts +137 -36
- package/server/service/tax-invoice/tax-invoice-query.ts +1 -1
- package/server/service/tax-invoice/tax-invoice-type.ts +9 -199
- package/server/service/tax-invoice/tax-invoice.ts +23 -30
- package/server/service/tax-invoice-api/tax-invoice-api-type.ts +4 -0
- package/server/service/tax-invoice-item/tax-invoice-item-query.ts +1 -1
- package/server/service/tax-invoice-item/tax-invoice-item-type.ts +4 -7
- package/server/service/tax-invoice-item/tax-invoice-item.ts +3 -3
- package/server/service/unipost-api/tax-invoice-inquiry.ts +103 -0
- package/translations/ko.json +9 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/tax-invoice",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0-alpha.1",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "dist-client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
"migration:create": "node ../../node_modules/typeorm/cli.js migration:create -d ./server/migrations"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@operato/graphql": "^
|
|
31
|
-
"@operato/shell": "^
|
|
32
|
-
"@things-factory/auth-base": "^
|
|
33
|
-
"@things-factory/export-ui-excel": "^
|
|
34
|
-
"@things-factory/shell": "^
|
|
30
|
+
"@operato/graphql": "^2.0.0-alpha.0",
|
|
31
|
+
"@operato/shell": "^2.0.0-alpha.0",
|
|
32
|
+
"@things-factory/auth-base": "^7.0.0-alpha.1",
|
|
33
|
+
"@things-factory/export-ui-excel": "^7.0.0-alpha.1",
|
|
34
|
+
"@things-factory/shell": "^7.0.0-alpha.1"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "778315d165d7f15e147583a45d5079c3d7cbce38"
|
|
37
37
|
}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'
|
|
2
2
|
import { In } from 'typeorm'
|
|
3
3
|
|
|
4
|
-
import { TaxInvoice } from './tax-invoice'
|
|
4
|
+
import { Category, TaxInvoice } from './tax-invoice'
|
|
5
5
|
import { NewTaxInvoice, TaxInvoicePatch } from './tax-invoice-type'
|
|
6
6
|
import { NewTaxInvoiceItem } from '../tax-invoice-item/tax-invoice-item-type'
|
|
7
7
|
import { TaxInvoiceItem } from '../tax-invoice-item/tax-invoice-item'
|
|
8
|
+
import { TaxInvoiceApi } from '../tax-invoice-api/tax-invoice-api'
|
|
9
|
+
import { AttributeSet } from '@things-factory/shell/dist-server/service/attribute-set/attribute-set'
|
|
10
|
+
import { ConfirmData, UnipostTaxType, callTaxInvoiceConfirm, getTaxInvoiceByUniposApi } from '../unipost-api/tax-invoice-inquiry'
|
|
8
11
|
|
|
9
12
|
@Resolver(TaxInvoice)
|
|
10
13
|
export class TaxInvoiceMutation {
|
|
@@ -32,50 +35,16 @@ export class TaxInvoiceMutation {
|
|
|
32
35
|
return newTaxInvoice
|
|
33
36
|
}
|
|
34
37
|
|
|
35
|
-
|
|
36
|
-
@Mutation(returns => TaxInvoice, { description: 'To modify TaxInvoice information' })
|
|
37
|
-
async updateTaxInvoice(@Arg('id') id: string, @Arg('patch') patch: TaxInvoicePatch, @Ctx() context: ResolverContext): Promise<TaxInvoice> {
|
|
38
|
-
const { domain, user, tx } = context.state
|
|
39
|
-
|
|
40
|
-
const repository = tx.getRepository(TaxInvoice)
|
|
41
|
-
const taxInvoice = await repository.findOne({
|
|
42
|
-
where: { domain: { id: domain.id }, id }
|
|
43
|
-
})
|
|
44
|
-
|
|
45
|
-
const result = await repository.save({
|
|
46
|
-
...taxInvoice,
|
|
47
|
-
...patch,
|
|
48
|
-
updater: user
|
|
49
|
-
})
|
|
50
|
-
|
|
51
|
-
return result
|
|
52
|
-
}
|
|
53
|
-
|
|
38
|
+
// 그리드에서 메모 수정용 으로만
|
|
54
39
|
@Directive('@transaction')
|
|
55
40
|
@Mutation(returns => [TaxInvoice], { description: "To modify multiple TaxInvoices' information" })
|
|
56
41
|
async updateMultipleTaxInvoice(@Arg('patches', type => [TaxInvoicePatch]) patches: TaxInvoicePatch[], @Ctx() context: ResolverContext): Promise<TaxInvoice[]> {
|
|
57
42
|
const { domain, user, tx } = context.state
|
|
58
43
|
|
|
59
44
|
let results = []
|
|
60
|
-
const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')
|
|
61
45
|
const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')
|
|
62
46
|
const taxInvoiceRepo = tx.getRepository(TaxInvoice)
|
|
63
47
|
|
|
64
|
-
if (_createRecords.length > 0) {
|
|
65
|
-
for (let i = 0; i < _createRecords.length; i++) {
|
|
66
|
-
const newRecord = _createRecords[i]
|
|
67
|
-
|
|
68
|
-
const result = await taxInvoiceRepo.save({
|
|
69
|
-
...newRecord,
|
|
70
|
-
domain,
|
|
71
|
-
creator: user,
|
|
72
|
-
updater: user
|
|
73
|
-
})
|
|
74
|
-
|
|
75
|
-
results.push({ ...result, cuFlag: '+' })
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
48
|
if (_updateRecords.length > 0) {
|
|
80
49
|
for (let i = 0; i < _updateRecords.length; i++) {
|
|
81
50
|
const updateRecord = _updateRecords[i]
|
|
@@ -116,4 +85,136 @@ export class TaxInvoiceMutation {
|
|
|
116
85
|
|
|
117
86
|
return true
|
|
118
87
|
}
|
|
88
|
+
|
|
89
|
+
@Directive('@transaction')
|
|
90
|
+
@Mutation(returns => Boolean, { description: 'create tax invoice data by API' })
|
|
91
|
+
async fetchTaxInvoiceByApi(@Ctx() context: ResolverContext): Promise<boolean> {
|
|
92
|
+
const { domain, user, tx } = context.state
|
|
93
|
+
const taxInvoiceApiRepo = tx.getRepository(TaxInvoiceApi)
|
|
94
|
+
const taxInvoiceRepo = tx.getRepository(TaxInvoice)
|
|
95
|
+
const insertedData: ConfirmData[] = [] // API 호출 후 결과 회신용
|
|
96
|
+
|
|
97
|
+
const apiInfo = (await taxInvoiceApiRepo.find()).at(0)
|
|
98
|
+
const businessRegistrationNumber = apiInfo.businessRegistrationNumber
|
|
99
|
+
const { aid = '', bearer = '' } = apiInfo?.attributes
|
|
100
|
+
|
|
101
|
+
// API 호출하여 세금계산서 데이터 가져옴
|
|
102
|
+
const { approvalNoList, taxList } = await getTaxInvoiceByUniposApi(businessRegistrationNumber, aid, bearer)
|
|
103
|
+
|
|
104
|
+
// 이미 있는 데이터 아이디 검색
|
|
105
|
+
const existingTaxInvoice = await taxInvoiceRepo.find({
|
|
106
|
+
select: ['approvalNo'],
|
|
107
|
+
where: { approvalNo: In(approvalNoList) }
|
|
108
|
+
})
|
|
109
|
+
const existingIds = existingTaxInvoice.map(taxInvoice => taxInvoice.approvalNo)
|
|
110
|
+
|
|
111
|
+
// 매입, 매출 for문
|
|
112
|
+
for (let tax of taxList) {
|
|
113
|
+
// 있는지 없는지 확인
|
|
114
|
+
if (existingIds.includes(tax.tid_issueid)) continue
|
|
115
|
+
|
|
116
|
+
// 세금계산서 데이터 객체 생성
|
|
117
|
+
const newTaxInvoice: NewTaxInvoice = {
|
|
118
|
+
issueNo: tax.exd_id,
|
|
119
|
+
approvalNo: tax.tid_issueid,
|
|
120
|
+
originalApprovalNo: tax.tid_originalissueid,
|
|
121
|
+
issueDate: this._dateFormat(tax.tid_issuedatetime),
|
|
122
|
+
signatureDate: this._dateFormat(tax.exd_issuedatetime),
|
|
123
|
+
invoiceType: tax.tid_typecode,
|
|
124
|
+
purpose: tax.tid_purposecode,
|
|
125
|
+
revisedReason: tax.tid_amendcode,
|
|
126
|
+
remark0: tax.tid_desc0,
|
|
127
|
+
remark1: tax.tid_desc1,
|
|
128
|
+
remark2: tax.tid_desc2,
|
|
129
|
+
category: tax.category,
|
|
130
|
+
supplierBusinessRegistrationCategory: tax.tit_alice_specorg_biztypecode,
|
|
131
|
+
supplierBusinessRegistrationNumber: tax.tit_alice_id,
|
|
132
|
+
supplierBranchIdentification: tax.tit_alice_specorg_taxregid,
|
|
133
|
+
supplierBusinessName: tax.tit_alice_name,
|
|
134
|
+
supplierRepresentativeName: tax.tit_alice_specperson_name,
|
|
135
|
+
supplierAddress: tax.tit_alice_specaddr_lineone,
|
|
136
|
+
supplierBusinessType: tax.tit_alice_typecode,
|
|
137
|
+
supplierIndustryType: tax.tit_alice_classcode,
|
|
138
|
+
supplierDepartment: tax.tit_alice_defcont_deptname,
|
|
139
|
+
supplierContactName: tax.tit_alice_defcont_personname,
|
|
140
|
+
supplierContactPhone: tax.tit_alice_defcont_telcomm,
|
|
141
|
+
supplierContactEmail: tax.tit_alice_defcont_uricomm,
|
|
142
|
+
supplierContactCellPhone: tax.tit_alice_defcont_cellphone,
|
|
143
|
+
buyerBusinessRegistrationCategory: tax.tit_bob_specorg_biztypecode,
|
|
144
|
+
buyerBusinessRegistrationNumber: tax.tit_bob_id,
|
|
145
|
+
buyerBranchIdentification: tax.tit_bob_specorg_taxregid,
|
|
146
|
+
buyerBusinessName: tax.tit_bob_name,
|
|
147
|
+
buyerRepresentativeName: tax.tit_bob_specperson_name,
|
|
148
|
+
buyerAddress: tax.tit_bob_specaddr_lineone,
|
|
149
|
+
buyerBusinessType: tax.tit_bob_typecode,
|
|
150
|
+
buyerIndustryType: tax.tit_bob_classcode,
|
|
151
|
+
buyer1stDepartment: tax.tit_bob_1stdefcont_deptname,
|
|
152
|
+
buyer1stContactName: tax.tit_bob_1stdefcont_personname,
|
|
153
|
+
buyer1stContactPhone: tax.tit_bob_1stdefcont_telcomm,
|
|
154
|
+
buyer1stContactEmail: tax.tit_bob_1stdefcont_uricomm,
|
|
155
|
+
buyer1stContactCellPhone: tax.tit_bob_1stdefcont_cellphone,
|
|
156
|
+
buyer2ndDepartment: tax.tit_bob_2nddefcont_deptname,
|
|
157
|
+
buyer2ndContactName: tax.tit_bob_2nddefcont_personname,
|
|
158
|
+
buyer2ndContactPhone: tax.tit_bob_2nddefcont_telcomm,
|
|
159
|
+
buyer2ndContactEmail: tax.tit_bob_2nddefcont_uricomm,
|
|
160
|
+
buyer2ndContactCellPhone: tax.tit_bob_2nddefcont_cellphone,
|
|
161
|
+
agentBusinessRegistrationCategory: tax.tit_broker_specorg_biztypecode,
|
|
162
|
+
agentBusinessRegistrationNumber: tax.tit_broker_id,
|
|
163
|
+
agentBranchIdentification: tax.tit_broker_specorg_taxregid,
|
|
164
|
+
agentBusinessName: tax.tit_broker_name,
|
|
165
|
+
agentRepresentativeName: tax.tit_broker_specperson_name,
|
|
166
|
+
agentAddress: tax.tit_broker_specaddr_lineone,
|
|
167
|
+
agentBusinessType: tax.tit_broker_typecode,
|
|
168
|
+
agentIndustryType: tax.tit_broker_classcode,
|
|
169
|
+
agentDepartment: tax.tit_broker_defcont_deptname,
|
|
170
|
+
agentContactName: tax.tit_broker_defcont_personname,
|
|
171
|
+
agentContactPhone: tax.tit_broker_defcont_telcomm,
|
|
172
|
+
agentContactEmail: tax.tit_broker_defcont_uricomm,
|
|
173
|
+
agentContactCellPhone: tax.tit_broker_defcont_cellphone,
|
|
174
|
+
paymentAmountCash: tax.tit_specpay_paidamount10,
|
|
175
|
+
paymentAmountCheck: tax.tit_specpay_paidamount20,
|
|
176
|
+
paymentAmountPromissoryNote: tax.tit_specpay_paidamount30,
|
|
177
|
+
paymentAmountAccountsReceivable: tax.tit_specpay_paidamount40,
|
|
178
|
+
supplyAmount: tax.tit_specsum_chargeamount,
|
|
179
|
+
taxAmount: tax.tit_specsum_taxamount,
|
|
180
|
+
totalAmount: tax.tit_specsum_grandamount
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// 세금계산서 아이템 데이터 객체 생성
|
|
184
|
+
const newTaxInvoiceItem: NewTaxInvoiceItem[] = []
|
|
185
|
+
for (let item of tax.tAliceItemList) {
|
|
186
|
+
newTaxInvoiceItem.push({
|
|
187
|
+
sequence: item.tii_seqnumeric,
|
|
188
|
+
supplyDate: this._dateFormat(item.tii_purchaseexpirydatetime),
|
|
189
|
+
itemName: item.tii_nametext,
|
|
190
|
+
specification: item.tii_informationtext,
|
|
191
|
+
quantity: item.tii_chargeableunitquantity,
|
|
192
|
+
unitPrice: item.tii_unitprice_unitamount,
|
|
193
|
+
supplyPrice: item.tii_invoiceamount,
|
|
194
|
+
taxPrice: item.tii_totaltax_calcamount,
|
|
195
|
+
remark: item.tii_descriptiontext
|
|
196
|
+
})
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
// Insert
|
|
200
|
+
this.createTaxInvoice(newTaxInvoice, newTaxInvoiceItem, context)
|
|
201
|
+
|
|
202
|
+
// API 결과 회신 데이터 생성
|
|
203
|
+
insertedData.push({
|
|
204
|
+
aid: aid,
|
|
205
|
+
tax_type: tax.category == Category.EXPORT ? UnipostTaxType.EXPORT : UnipostTaxType.IMPORT,
|
|
206
|
+
tid_issueid: tax.tid_issueid,
|
|
207
|
+
success: true,
|
|
208
|
+
message: ''
|
|
209
|
+
})
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
// 유니 포스트에 조회 후 결과 회신 API 호출
|
|
213
|
+
callTaxInvoiceConfirm(businessRegistrationNumber, aid, bearer, insertedData)
|
|
214
|
+
|
|
215
|
+
return true
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
// YYYYMMDD => YYYY-MM-DD
|
|
219
|
+
private _dateFormat = date => date.replace(/(\d{4})(\d{2})(\d{2})/g, '$1-$2-$3')
|
|
119
220
|
}
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
import type { FileUpload } from 'graphql-upload/GraphQLUpload.js'
|
|
2
|
-
import GraphQLUpload from 'graphql-upload/GraphQLUpload.js'
|
|
3
1
|
import { ObjectType, Field, InputType, Int, ID } from 'type-graphql'
|
|
4
|
-
|
|
5
2
|
import { BusinessRegistrationCategory, Category, InvoiceType, Purpose, RevisedReason, TaxInvoice } from './tax-invoice'
|
|
6
|
-
import { TaxInvoiceItem } from '../tax-invoice-item/tax-invoice-item'
|
|
7
3
|
|
|
8
4
|
@InputType()
|
|
9
5
|
export class NewTaxInvoice {
|
|
10
6
|
@Field({ nullable: true })
|
|
11
|
-
|
|
7
|
+
memo?: string
|
|
12
8
|
|
|
13
9
|
@Field({ nullable: true })
|
|
14
10
|
apiRefId?: string
|
|
@@ -16,6 +12,9 @@ export class NewTaxInvoice {
|
|
|
16
12
|
@Field({ nullable: false })
|
|
17
13
|
category: Category
|
|
18
14
|
|
|
15
|
+
@Field({ nullable: true })
|
|
16
|
+
issueNo?: string
|
|
17
|
+
|
|
19
18
|
@Field({ nullable: true })
|
|
20
19
|
approvalNo?: string
|
|
21
20
|
|
|
@@ -23,10 +22,10 @@ export class NewTaxInvoice {
|
|
|
23
22
|
originalApprovalNo?: string
|
|
24
23
|
|
|
25
24
|
@Field({ nullable: false })
|
|
26
|
-
issueDate:
|
|
25
|
+
issueDate: Date
|
|
27
26
|
|
|
28
27
|
@Field({ nullable: true })
|
|
29
|
-
signatureDate:
|
|
28
|
+
signatureDate: Date
|
|
30
29
|
|
|
31
30
|
@Field({ nullable: false })
|
|
32
31
|
invoiceType: InvoiceType
|
|
@@ -46,7 +45,7 @@ export class NewTaxInvoice {
|
|
|
46
45
|
@Field({ nullable: true })
|
|
47
46
|
remark2?: string
|
|
48
47
|
|
|
49
|
-
@Field({ nullable:
|
|
48
|
+
@Field({ nullable: true })
|
|
50
49
|
supplierBusinessRegistrationCategory: BusinessRegistrationCategory
|
|
51
50
|
|
|
52
51
|
@Field({ nullable: false })
|
|
@@ -85,7 +84,7 @@ export class NewTaxInvoice {
|
|
|
85
84
|
@Field({ nullable: true })
|
|
86
85
|
supplierContactCellPhone?: string
|
|
87
86
|
|
|
88
|
-
@Field({ nullable:
|
|
87
|
+
@Field({ nullable: true })
|
|
89
88
|
buyerBusinessRegistrationCategory: BusinessRegistrationCategory
|
|
90
89
|
|
|
91
90
|
@Field({ nullable: false })
|
|
@@ -206,196 +205,7 @@ export class TaxInvoicePatch {
|
|
|
206
205
|
id?: string
|
|
207
206
|
|
|
208
207
|
@Field({ nullable: true })
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
@Field({ nullable: true })
|
|
212
|
-
apiRefId?: string
|
|
213
|
-
|
|
214
|
-
@Field({ nullable: false })
|
|
215
|
-
category: Category
|
|
216
|
-
|
|
217
|
-
@Field({ nullable: true })
|
|
218
|
-
approvalNo?: string
|
|
219
|
-
|
|
220
|
-
@Field({ nullable: true })
|
|
221
|
-
originalApprovalNo?: string
|
|
222
|
-
|
|
223
|
-
@Field({ nullable: false })
|
|
224
|
-
issueDate: string
|
|
225
|
-
|
|
226
|
-
@Field({ nullable: true })
|
|
227
|
-
signatureDate: string
|
|
228
|
-
|
|
229
|
-
@Field({ nullable: false })
|
|
230
|
-
invoiceType: InvoiceType
|
|
231
|
-
|
|
232
|
-
@Field({ nullable: false })
|
|
233
|
-
purpose: Purpose
|
|
234
|
-
|
|
235
|
-
@Field({ nullable: true })
|
|
236
|
-
revisedReason?: RevisedReason
|
|
237
|
-
|
|
238
|
-
@Field({ nullable: true })
|
|
239
|
-
remark0?: string
|
|
240
|
-
|
|
241
|
-
@Field({ nullable: true })
|
|
242
|
-
remark1?: string
|
|
243
|
-
|
|
244
|
-
@Field({ nullable: true })
|
|
245
|
-
remark2?: string
|
|
246
|
-
|
|
247
|
-
@Field({ nullable: false })
|
|
248
|
-
supplierBusinessRegistrationCategory: BusinessRegistrationCategory
|
|
249
|
-
|
|
250
|
-
@Field({ nullable: false })
|
|
251
|
-
supplierBusinessRegistrationNumber: string
|
|
252
|
-
|
|
253
|
-
@Field({ nullable: true })
|
|
254
|
-
supplierBranchIdentification?: string
|
|
255
|
-
|
|
256
|
-
@Field({ nullable: false })
|
|
257
|
-
supplierBusinessName: string
|
|
258
|
-
|
|
259
|
-
@Field({ nullable: false })
|
|
260
|
-
supplierRepresentativeName: string
|
|
261
|
-
|
|
262
|
-
@Field({ nullable: true })
|
|
263
|
-
supplierAddress?: string
|
|
264
|
-
|
|
265
|
-
@Field({ nullable: true })
|
|
266
|
-
supplierBusinessType?: string
|
|
267
|
-
|
|
268
|
-
@Field({ nullable: true })
|
|
269
|
-
supplierIndustryType?: string
|
|
270
|
-
|
|
271
|
-
@Field({ nullable: true })
|
|
272
|
-
supplierDepartment?: string
|
|
273
|
-
|
|
274
|
-
@Field({ nullable: true })
|
|
275
|
-
supplierContactName?: string
|
|
276
|
-
|
|
277
|
-
@Field({ nullable: true })
|
|
278
|
-
supplierContactPhone?: string
|
|
279
|
-
|
|
280
|
-
@Field({ nullable: true })
|
|
281
|
-
supplierContactEmail?: string
|
|
282
|
-
|
|
283
|
-
@Field({ nullable: true })
|
|
284
|
-
supplierContactCellPhone?: string
|
|
285
|
-
|
|
286
|
-
@Field({ nullable: false })
|
|
287
|
-
buyerBusinessRegistrationCategory: BusinessRegistrationCategory
|
|
288
|
-
|
|
289
|
-
@Field({ nullable: false })
|
|
290
|
-
buyerBusinessRegistrationNumber: string
|
|
291
|
-
|
|
292
|
-
@Field({ nullable: true })
|
|
293
|
-
buyerBranchIdentification?: string
|
|
294
|
-
|
|
295
|
-
@Field({ nullable: false })
|
|
296
|
-
buyerBusinessName: string
|
|
297
|
-
|
|
298
|
-
@Field({ nullable: false })
|
|
299
|
-
buyerRepresentativeName: string
|
|
300
|
-
|
|
301
|
-
@Field({ nullable: true })
|
|
302
|
-
buyerAddress?: string
|
|
303
|
-
|
|
304
|
-
@Field({ nullable: true })
|
|
305
|
-
buyerBusinessType?: string
|
|
306
|
-
|
|
307
|
-
@Field({ nullable: true })
|
|
308
|
-
buyerIndustryType?: string
|
|
309
|
-
|
|
310
|
-
@Field({ nullable: true })
|
|
311
|
-
buyer1stDepartment?: string
|
|
312
|
-
|
|
313
|
-
@Field({ nullable: true })
|
|
314
|
-
buyer1stContactName?: string
|
|
315
|
-
|
|
316
|
-
@Field({ nullable: true })
|
|
317
|
-
buyer1stContactPhone?: string
|
|
318
|
-
|
|
319
|
-
@Field({ nullable: true })
|
|
320
|
-
buyer1stContactEmail?: string
|
|
321
|
-
|
|
322
|
-
@Field({ nullable: true })
|
|
323
|
-
buyer1stContactCellPhone?: string
|
|
324
|
-
|
|
325
|
-
@Field({ nullable: true })
|
|
326
|
-
buyer2ndDepartment?: string
|
|
327
|
-
|
|
328
|
-
@Field({ nullable: true })
|
|
329
|
-
buyer2ndContactName?: string
|
|
330
|
-
|
|
331
|
-
@Field({ nullable: true })
|
|
332
|
-
buyer2ndContactPhone?: string
|
|
333
|
-
|
|
334
|
-
@Field({ nullable: true })
|
|
335
|
-
buyer2ndContactEmail?: string
|
|
336
|
-
|
|
337
|
-
@Field({ nullable: true })
|
|
338
|
-
buyer2ndContactCellPhone?: string
|
|
339
|
-
|
|
340
|
-
@Field({ nullable: true })
|
|
341
|
-
agentBusinessRegistrationCategory: BusinessRegistrationCategory
|
|
342
|
-
|
|
343
|
-
@Field({ nullable: true })
|
|
344
|
-
agentBusinessRegistrationNumber?: string
|
|
345
|
-
|
|
346
|
-
@Field({ nullable: true })
|
|
347
|
-
agentBranchIdentification?: string
|
|
348
|
-
|
|
349
|
-
@Field({ nullable: true })
|
|
350
|
-
agentBusinessName?: string
|
|
351
|
-
|
|
352
|
-
@Field({ nullable: true })
|
|
353
|
-
agentRepresentativeName?: string
|
|
354
|
-
|
|
355
|
-
@Field({ nullable: true })
|
|
356
|
-
agentAddress?: string
|
|
357
|
-
|
|
358
|
-
@Field({ nullable: true })
|
|
359
|
-
agentBusinessType?: string
|
|
360
|
-
|
|
361
|
-
@Field({ nullable: true })
|
|
362
|
-
agentIndustryType?: string
|
|
363
|
-
|
|
364
|
-
@Field({ nullable: true })
|
|
365
|
-
agentDepartment?: string
|
|
366
|
-
|
|
367
|
-
@Field({ nullable: true })
|
|
368
|
-
agentContactName?: string
|
|
369
|
-
|
|
370
|
-
@Field({ nullable: true })
|
|
371
|
-
agentContactPhone?: string
|
|
372
|
-
|
|
373
|
-
@Field({ nullable: true })
|
|
374
|
-
agentContactEmail?: string
|
|
375
|
-
|
|
376
|
-
@Field({ nullable: true })
|
|
377
|
-
agentContactCellPhone?: string
|
|
378
|
-
|
|
379
|
-
@Field(type => Int, { nullable: true })
|
|
380
|
-
paymentAmountCash?: number
|
|
381
|
-
|
|
382
|
-
@Field(type => Int, { nullable: true })
|
|
383
|
-
paymentAmountCheck?: number
|
|
384
|
-
|
|
385
|
-
@Field(type => Int, { nullable: true })
|
|
386
|
-
paymentAmountPromissoryNote?: number
|
|
387
|
-
|
|
388
|
-
@Field(type => Int, { nullable: true })
|
|
389
|
-
paymentAmountAccountsReceivable?: number
|
|
390
|
-
|
|
391
|
-
@Field(type => Int, { nullable: false })
|
|
392
|
-
supplyAmount: number
|
|
393
|
-
|
|
394
|
-
@Field(type => Int, { nullable: true })
|
|
395
|
-
taxAmount: number
|
|
396
|
-
|
|
397
|
-
@Field(type => Int, { nullable: false })
|
|
398
|
-
totalAmount: number
|
|
208
|
+
memo?: string
|
|
399
209
|
|
|
400
210
|
@Field({ nullable: true })
|
|
401
211
|
cuFlag?: string
|
|
@@ -1,16 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CreateDateColumn,
|
|
3
|
-
UpdateDateColumn,
|
|
4
|
-
DeleteDateColumn,
|
|
5
|
-
Entity,
|
|
6
|
-
Index,
|
|
7
|
-
Column,
|
|
8
|
-
RelationId,
|
|
9
|
-
ManyToOne,
|
|
10
|
-
OneToMany,
|
|
11
|
-
PrimaryGeneratedColumn,
|
|
12
|
-
VersionColumn
|
|
13
|
-
} from 'typeorm'
|
|
1
|
+
import { CreateDateColumn, UpdateDateColumn, DeleteDateColumn, Entity, Index, Column, RelationId, ManyToOne, OneToMany, PrimaryGeneratedColumn } from 'typeorm'
|
|
14
2
|
import { ObjectType, Field, ID, registerEnumType } from 'type-graphql'
|
|
15
3
|
import { encryptTransformer } from '@things-factory/shell'
|
|
16
4
|
|
|
@@ -88,6 +76,7 @@ registerEnumType(BusinessRegistrationCategory, {
|
|
|
88
76
|
unique: true
|
|
89
77
|
})
|
|
90
78
|
@Index('ix_tax_invoice_1', (taxInvoice: TaxInvoice) => [taxInvoice.domain, taxInvoice.issueDate])
|
|
79
|
+
@Index('ix_approval_no', (taxInvoice: TaxInvoice) => [taxInvoice.domain, taxInvoice.approvalNo], { unique: true })
|
|
91
80
|
@ObjectType({ description: 'Entity for TaxInvoice' })
|
|
92
81
|
export class TaxInvoice {
|
|
93
82
|
@PrimaryGeneratedColumn('uuid')
|
|
@@ -105,29 +94,33 @@ export class TaxInvoice {
|
|
|
105
94
|
@Field(type => [TaxInvoiceItem], { nullable: true })
|
|
106
95
|
taxInvoiceItems?: TaxInvoiceItem[]
|
|
107
96
|
|
|
108
|
-
@Column({ nullable: true, comment: '
|
|
109
|
-
@Field({ nullable: true, description: '
|
|
110
|
-
|
|
97
|
+
@Column({ nullable: true, comment: '메모' })
|
|
98
|
+
@Field({ nullable: true, description: '메모' })
|
|
99
|
+
memo?: string
|
|
111
100
|
|
|
112
101
|
@Column({ nullable: false, comment: '세금계산서 구분 (매출: 10, 매입: 20, NTS: 30)' })
|
|
113
102
|
@Field({ nullable: false, description: '세금계산서 구분 (매출: 10, 매입: 20, NTS: 30)' })
|
|
114
103
|
category!: Category
|
|
115
104
|
|
|
116
|
-
@Column({ nullable: true, comment: '
|
|
117
|
-
@Field({ nullable: true, description: '
|
|
105
|
+
@Column({ nullable: true, comment: '연동 번호 (작성 시 번호, 승인번호와 동일)' })
|
|
106
|
+
@Field({ nullable: true, description: '연동 번호 (작성 시 번호, 승인번호와 동일)' })
|
|
107
|
+
issueNo?: string
|
|
108
|
+
|
|
109
|
+
@Column({ nullable: true, comment: '승인 번호 (숫자만 24자리)' })
|
|
110
|
+
@Field({ nullable: true, description: '승인 번호 (숫자만 24자리)' })
|
|
118
111
|
approvalNo?: string
|
|
119
112
|
|
|
120
113
|
@Column({ nullable: true, comment: '원 승인 번호 (계산서 수정시 원래의 승인 번호)' })
|
|
121
114
|
@Field({ nullable: true, description: '원 승인 번호 (계산서 수정시 원래의 승인 번호)' })
|
|
122
115
|
originalApprovalNo?: string
|
|
123
116
|
|
|
124
|
-
@Column({ nullable: false, comment: '세금계산서 작성 일자 (
|
|
125
|
-
@Field({ nullable: false, description: '세금계산서 작성 일자 (
|
|
126
|
-
issueDate!:
|
|
117
|
+
@Column({ nullable: false, comment: '세금계산서 작성 일자 (YYYY-MM-DD)' })
|
|
118
|
+
@Field({ nullable: false, description: '세금계산서 작성 일자 (YYYY-MM-DD)' })
|
|
119
|
+
issueDate!: Date
|
|
127
120
|
|
|
128
|
-
@Column({ nullable: true, comment: '세금계산서 전자 서명 일자 (
|
|
129
|
-
@Field({ nullable: true, description: '세금계산서 전자 서명 일자 (
|
|
130
|
-
signatureDate?:
|
|
121
|
+
@Column({ nullable: true, comment: '세금계산서 전자 서명 일자 (YYYY-MM-DD)' })
|
|
122
|
+
@Field({ nullable: true, description: '세금계산서 전자 서명 일자 (YYYY-MM-DD)' })
|
|
123
|
+
signatureDate?: Date
|
|
131
124
|
|
|
132
125
|
@Column({ nullable: false, comment: '세금계산서 종류 코드 (일반, 영세율, 위수탁)' })
|
|
133
126
|
@Field({ nullable: false, description: '세금계산서 종류 코드 (일반, 영세율, 위수탁)' })
|
|
@@ -153,9 +146,9 @@ export class TaxInvoice {
|
|
|
153
146
|
@Field({ nullable: true, description: '비고2' })
|
|
154
147
|
remark2?: string
|
|
155
148
|
|
|
156
|
-
@Column({ nullable:
|
|
157
|
-
@Field({ nullable:
|
|
158
|
-
supplierBusinessRegistrationCategory
|
|
149
|
+
@Column({ nullable: true, comment: '공급자 사업자등록번호 구분 코드' })
|
|
150
|
+
@Field({ nullable: true, description: '공급자 사업자등록번호 구분 코드' })
|
|
151
|
+
supplierBusinessRegistrationCategory?: BusinessRegistrationCategory
|
|
159
152
|
|
|
160
153
|
@Column({ nullable: false, comment: '공급자 사업자등록번호', transformer: encryptTransformer })
|
|
161
154
|
@Field({ nullable: false, description: '공급자 사업자등록번호' })
|
|
@@ -205,9 +198,9 @@ export class TaxInvoice {
|
|
|
205
198
|
@Field({ nullable: true, description: '공급자 담당자 핸드폰 번호' })
|
|
206
199
|
supplierContactCellPhone?: string
|
|
207
200
|
|
|
208
|
-
@Column({ nullable:
|
|
209
|
-
@Field({ nullable:
|
|
210
|
-
buyerBusinessRegistrationCategory
|
|
201
|
+
@Column({ nullable: true, comment: '공급받는자 사업자등록번호 구분 코드' })
|
|
202
|
+
@Field({ nullable: true, description: '공급받는자 사업자등록번호 구분 코드' })
|
|
203
|
+
buyerBusinessRegistrationCategory?: BusinessRegistrationCategory
|
|
211
204
|
|
|
212
205
|
@Column({ nullable: false, comment: '공급받는자 사업자등록번호', transformer: encryptTransformer })
|
|
213
206
|
@Field({ nullable: false, description: '공급받는자 사업자등록번호' })
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ObjectType, Field, InputType, Int, ID } from 'type-graphql'
|
|
2
2
|
import { TaxInvoiceApi } from './tax-invoice-api'
|
|
3
|
+
import { ScalarObject } from '@things-factory/shell'
|
|
3
4
|
|
|
4
5
|
@InputType()
|
|
5
6
|
export class TaxInvoiceApiPatch {
|
|
@@ -57,6 +58,9 @@ export class TaxInvoiceApiPatch {
|
|
|
57
58
|
@Field({ nullable: true })
|
|
58
59
|
contactCellPhone?: string
|
|
59
60
|
|
|
61
|
+
@Field(type => ScalarObject, { nullable: true })
|
|
62
|
+
attributes?: any
|
|
63
|
+
|
|
60
64
|
@Field({ nullable: true })
|
|
61
65
|
cuFlag?: string
|
|
62
66
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx
|
|
1
|
+
import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx } from 'type-graphql'
|
|
2
2
|
import { Attachment } from '@things-factory/attachment-base'
|
|
3
3
|
import { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'
|
|
4
4
|
import { User } from '@things-factory/auth-base'
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import type { FileUpload } from 'graphql-upload/GraphQLUpload.js'
|
|
2
|
-
import GraphQLUpload from 'graphql-upload/GraphQLUpload.js'
|
|
3
1
|
import { ObjectType, Field, InputType, Int, ID } from 'type-graphql'
|
|
4
|
-
|
|
5
2
|
import { TaxInvoiceItem } from './tax-invoice-item'
|
|
6
3
|
|
|
7
4
|
@InputType()
|
|
@@ -9,8 +6,8 @@ export class NewTaxInvoiceItem {
|
|
|
9
6
|
@Field(type => Int, { nullable: false, description: '아이템 일련번호' })
|
|
10
7
|
sequence: number
|
|
11
8
|
|
|
12
|
-
@Field({ nullable: false, description: '공급년월일(
|
|
13
|
-
supplyDate:
|
|
9
|
+
@Field({ nullable: false, description: '공급년월일(YYYY-MM-DD)' })
|
|
10
|
+
supplyDate: Date
|
|
14
11
|
|
|
15
12
|
@Field({ nullable: false, description: '품목명' })
|
|
16
13
|
itemName: string
|
|
@@ -42,8 +39,8 @@ export class TaxInvoiceItemPatch {
|
|
|
42
39
|
@Field(type => Int, { nullable: false, description: '아이템 일련번호' })
|
|
43
40
|
sequence: number
|
|
44
41
|
|
|
45
|
-
@Field({ nullable: false, description: '공급년월일(
|
|
46
|
-
supplyDate:
|
|
42
|
+
@Field({ nullable: false, description: '공급년월일(YYYY-MM-DD)' })
|
|
43
|
+
supplyDate: Date
|
|
47
44
|
|
|
48
45
|
@Field({ nullable: false, description: '품목명' })
|
|
49
46
|
itemName: string
|
|
@@ -32,9 +32,9 @@ export class TaxInvoiceItem {
|
|
|
32
32
|
@Field({ nullable: true, description: '아이템 일련번호' })
|
|
33
33
|
sequence?: number
|
|
34
34
|
|
|
35
|
-
@Column({ nullable: false, comment: '공급년월일(
|
|
36
|
-
@Field({ nullable: false, description: '공급년월일(
|
|
37
|
-
supplyDate!:
|
|
35
|
+
@Column({ nullable: false, comment: '공급년월일(YYYY-MM-DD)' })
|
|
36
|
+
@Field({ nullable: false, description: '공급년월일(YYYY-MM-DD)' })
|
|
37
|
+
supplyDate!: Date
|
|
38
38
|
|
|
39
39
|
@Column({ nullable: false, comment: '품목명' })
|
|
40
40
|
@Field({ nullable: false, description: '품목명' })
|