@things-factory/tax-invoice 6.2.84

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.
Files changed (151) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/assets/images/hatiolab-logo.png +0 -0
  3. package/client/bootstrap.ts +0 -0
  4. package/client/index.ts +0 -0
  5. package/client/pages/main.ts +25 -0
  6. package/client/pages/tax-audit-result/tax-audit-result-importer.ts +97 -0
  7. package/client/pages/tax-audit-result/tax-audit-result-list-page.ts +355 -0
  8. package/client/pages/tax-invoice/tax-invoice-detail-popup.ts +424 -0
  9. package/client/pages/tax-invoice/tax-invoice-list-page.ts +517 -0
  10. package/client/pages/tax-invoice-api/tax-invoice-api-page.ts +428 -0
  11. package/client/pages/tax-invoice-company/tax-invoice-company-importer.ts +175 -0
  12. package/client/pages/tax-invoice-company/tax-invoice-company-list-page.ts +496 -0
  13. package/client/route.ts +23 -0
  14. package/client/tsconfig.json +11 -0
  15. package/dist-client/bootstrap.d.ts +0 -0
  16. package/dist-client/bootstrap.js +2 -0
  17. package/dist-client/bootstrap.js.map +1 -0
  18. package/dist-client/index.d.ts +0 -0
  19. package/dist-client/index.js +2 -0
  20. package/dist-client/index.js.map +1 -0
  21. package/dist-client/pages/main.d.ts +1 -0
  22. package/dist-client/pages/main.js +27 -0
  23. package/dist-client/pages/main.js.map +1 -0
  24. package/dist-client/pages/tax-audit-result/tax-audit-result-importer.d.ts +22 -0
  25. package/dist-client/pages/tax-audit-result/tax-audit-result-importer.js +100 -0
  26. package/dist-client/pages/tax-audit-result/tax-audit-result-importer.js.map +1 -0
  27. package/dist-client/pages/tax-audit-result/tax-audit-result-list-page.d.ts +62 -0
  28. package/dist-client/pages/tax-audit-result/tax-audit-result-list-page.js +331 -0
  29. package/dist-client/pages/tax-audit-result/tax-audit-result-list-page.js.map +1 -0
  30. package/dist-client/pages/tax-invoice/tax-invoice-detail-popup.d.ts +14 -0
  31. package/dist-client/pages/tax-invoice/tax-invoice-detail-popup.js +430 -0
  32. package/dist-client/pages/tax-invoice/tax-invoice-detail-popup.js.map +1 -0
  33. package/dist-client/pages/tax-invoice/tax-invoice-list-page.d.ts +70 -0
  34. package/dist-client/pages/tax-invoice/tax-invoice-list-page.js +500 -0
  35. package/dist-client/pages/tax-invoice/tax-invoice-list-page.js.map +1 -0
  36. package/dist-client/pages/tax-invoice-api/tax-invoice-api-page.d.ts +36 -0
  37. package/dist-client/pages/tax-invoice-api/tax-invoice-api-page.js +419 -0
  38. package/dist-client/pages/tax-invoice-api/tax-invoice-api-page.js.map +1 -0
  39. package/dist-client/pages/tax-invoice-company/tax-invoice-company-importer.d.ts +31 -0
  40. package/dist-client/pages/tax-invoice-company/tax-invoice-company-importer.js +182 -0
  41. package/dist-client/pages/tax-invoice-company/tax-invoice-company-importer.js.map +1 -0
  42. package/dist-client/pages/tax-invoice-company/tax-invoice-company-list-page.d.ts +57 -0
  43. package/dist-client/pages/tax-invoice-company/tax-invoice-company-list-page.js +477 -0
  44. package/dist-client/pages/tax-invoice-company/tax-invoice-company-list-page.js.map +1 -0
  45. package/dist-client/route.d.ts +1 -0
  46. package/dist-client/route.js +20 -0
  47. package/dist-client/route.js.map +1 -0
  48. package/dist-client/tsconfig.tsbuildinfo +1 -0
  49. package/dist-server/index.js +6 -0
  50. package/dist-server/index.js.map +1 -0
  51. package/dist-server/routes.js +25 -0
  52. package/dist-server/routes.js.map +1 -0
  53. package/dist-server/service/index.js +37 -0
  54. package/dist-server/service/index.js.map +1 -0
  55. package/dist-server/service/tax-audit-result/event-subscriber.js +21 -0
  56. package/dist-server/service/tax-audit-result/event-subscriber.js.map +1 -0
  57. package/dist-server/service/tax-audit-result/index.js +12 -0
  58. package/dist-server/service/tax-audit-result/index.js.map +1 -0
  59. package/dist-server/service/tax-audit-result/tax-audit-result-history.js +123 -0
  60. package/dist-server/service/tax-audit-result/tax-audit-result-history.js.map +1 -0
  61. package/dist-server/service/tax-audit-result/tax-audit-result-mutation.js +168 -0
  62. package/dist-server/service/tax-audit-result/tax-audit-result-mutation.js.map +1 -0
  63. package/dist-server/service/tax-audit-result/tax-audit-result-query.js +97 -0
  64. package/dist-server/service/tax-audit-result/tax-audit-result-query.js.map +1 -0
  65. package/dist-server/service/tax-audit-result/tax-audit-result-type.js +86 -0
  66. package/dist-server/service/tax-audit-result/tax-audit-result-type.js.map +1 -0
  67. package/dist-server/service/tax-audit-result/tax-audit-result.js +110 -0
  68. package/dist-server/service/tax-audit-result/tax-audit-result.js.map +1 -0
  69. package/dist-server/service/tax-invoice/index.js +9 -0
  70. package/dist-server/service/tax-invoice/index.js.map +1 -0
  71. package/dist-server/service/tax-invoice/tax-invoice-mutation.js +127 -0
  72. package/dist-server/service/tax-invoice/tax-invoice-mutation.js.map +1 -0
  73. package/dist-server/service/tax-invoice/tax-invoice-query.js +90 -0
  74. package/dist-server/service/tax-invoice/tax-invoice-query.js.map +1 -0
  75. package/dist-server/service/tax-invoice/tax-invoice-type.js +553 -0
  76. package/dist-server/service/tax-invoice/tax-invoice-type.js.map +1 -0
  77. package/dist-server/service/tax-invoice/tax-invoice.js +465 -0
  78. package/dist-server/service/tax-invoice/tax-invoice.js.map +1 -0
  79. package/dist-server/service/tax-invoice-api/index.js +9 -0
  80. package/dist-server/service/tax-invoice-api/index.js.map +1 -0
  81. package/dist-server/service/tax-invoice-api/tax-invoice-api-mutation.js +64 -0
  82. package/dist-server/service/tax-invoice-api/tax-invoice-api-mutation.js.map +1 -0
  83. package/dist-server/service/tax-invoice-api/tax-invoice-api-query.js +79 -0
  84. package/dist-server/service/tax-invoice-api/tax-invoice-api-query.js.map +1 -0
  85. package/dist-server/service/tax-invoice-api/tax-invoice-api-type.js +103 -0
  86. package/dist-server/service/tax-invoice-api/tax-invoice-api-type.js.map +1 -0
  87. package/dist-server/service/tax-invoice-api/tax-invoice-api.js +163 -0
  88. package/dist-server/service/tax-invoice-api/tax-invoice-api.js.map +1 -0
  89. package/dist-server/service/tax-invoice-company/index.js +9 -0
  90. package/dist-server/service/tax-invoice-company/index.js.map +1 -0
  91. package/dist-server/service/tax-invoice-company/tax-invoice-company-mutation.js +80 -0
  92. package/dist-server/service/tax-invoice-company/tax-invoice-company-mutation.js.map +1 -0
  93. package/dist-server/service/tax-invoice-company/tax-invoice-company-query.js +89 -0
  94. package/dist-server/service/tax-invoice-company/tax-invoice-company-query.js.map +1 -0
  95. package/dist-server/service/tax-invoice-company/tax-invoice-company-type.js +100 -0
  96. package/dist-server/service/tax-invoice-company/tax-invoice-company-type.js.map +1 -0
  97. package/dist-server/service/tax-invoice-company/tax-invoice-company.js +166 -0
  98. package/dist-server/service/tax-invoice-company/tax-invoice-company.js.map +1 -0
  99. package/dist-server/service/tax-invoice-item/index.js +9 -0
  100. package/dist-server/service/tax-invoice-item/index.js.map +1 -0
  101. package/dist-server/service/tax-invoice-item/tax-invoice-item-mutation.js +127 -0
  102. package/dist-server/service/tax-invoice-item/tax-invoice-item-mutation.js.map +1 -0
  103. package/dist-server/service/tax-invoice-item/tax-invoice-item-query.js +87 -0
  104. package/dist-server/service/tax-invoice-item/tax-invoice-item-query.js.map +1 -0
  105. package/dist-server/service/tax-invoice-item/tax-invoice-item-type.js +121 -0
  106. package/dist-server/service/tax-invoice-item/tax-invoice-item-type.js.map +1 -0
  107. package/dist-server/service/tax-invoice-item/tax-invoice-item.js +115 -0
  108. package/dist-server/service/tax-invoice-item/tax-invoice-item.js.map +1 -0
  109. package/dist-server/tsconfig.tsbuildinfo +1 -0
  110. package/helps/tax-invoice/tax-audit-result.md +160 -0
  111. package/helps/tax-invoice/tax-invoice-api.md +160 -0
  112. package/helps/tax-invoice/tax-invoice-send.md +160 -0
  113. package/helps/tax-invoice/tax-invoice.md +160 -0
  114. package/package.json +37 -0
  115. package/server/index.ts +2 -0
  116. package/server/routes.ts +28 -0
  117. package/server/service/index.ts +36 -0
  118. package/server/service/tax-audit-result/event-subscriber.ts +17 -0
  119. package/server/service/tax-audit-result/index.ts +9 -0
  120. package/server/service/tax-audit-result/tax-audit-result-history.ts +110 -0
  121. package/server/service/tax-audit-result/tax-audit-result-mutation.ts +198 -0
  122. package/server/service/tax-audit-result/tax-audit-result-query.ts +62 -0
  123. package/server/service/tax-audit-result/tax-audit-result-type.ts +61 -0
  124. package/server/service/tax-audit-result/tax-audit-result.ts +95 -0
  125. package/server/service/tax-invoice/index.ts +6 -0
  126. package/server/service/tax-invoice/tax-invoice-mutation.ts +122 -0
  127. package/server/service/tax-invoice/tax-invoice-query.ts +54 -0
  128. package/server/service/tax-invoice/tax-invoice-type.ts +411 -0
  129. package/server/service/tax-invoice/tax-invoice.ts +389 -0
  130. package/server/service/tax-invoice-api/index.ts +6 -0
  131. package/server/service/tax-invoice-api/tax-invoice-api-mutation.ts +67 -0
  132. package/server/service/tax-invoice-api/tax-invoice-api-query.ts +48 -0
  133. package/server/service/tax-invoice-api/tax-invoice-api-type.ts +71 -0
  134. package/server/service/tax-invoice-api/tax-invoice-api.ts +137 -0
  135. package/server/service/tax-invoice-company/index.ts +6 -0
  136. package/server/service/tax-invoice-company/tax-invoice-company-mutation.ts +84 -0
  137. package/server/service/tax-invoice-company/tax-invoice-company-query.ts +53 -0
  138. package/server/service/tax-invoice-company/tax-invoice-company-type.ts +69 -0
  139. package/server/service/tax-invoice-company/tax-invoice-company.ts +142 -0
  140. package/server/service/tax-invoice-item/index.ts +6 -0
  141. package/server/service/tax-invoice-item/tax-invoice-item-mutation.ts +128 -0
  142. package/server/service/tax-invoice-item/tax-invoice-item-query.ts +57 -0
  143. package/server/service/tax-invoice-item/tax-invoice-item-type.ts +86 -0
  144. package/server/service/tax-invoice-item/tax-invoice-item.ts +85 -0
  145. package/server/tsconfig.json +10 -0
  146. package/things-factory.config.js +23 -0
  147. package/translations/en.json +1 -0
  148. package/translations/ja.json +1 -0
  149. package/translations/ko.json +71 -0
  150. package/translations/ms.json +1 -0
  151. package/translations/zh.json +1 -0
@@ -0,0 +1,389 @@
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'
14
+ import { ObjectType, Field, ID, registerEnumType } from 'type-graphql'
15
+ import { encryptTransformer } from '@things-factory/shell'
16
+
17
+ import { Domain } from '@things-factory/shell'
18
+ import { User } from '@things-factory/auth-base'
19
+ import { TaxInvoiceItem } from '../tax-invoice-item/tax-invoice-item'
20
+
21
+ export enum Category {
22
+ EXPORT = '10', // 매출
23
+ IMPORT = '20', // 매입
24
+ NTS = '30' // NTS
25
+ }
26
+ // 세금계산서 종류
27
+ export enum InvoiceType {
28
+ GENERAL_TAX_INVOICE = '0101', // 일반 세금계산서
29
+ ZERO_RATED_TAX_INVOICE = '0102', // 영세율 세금계산서
30
+ CONSIGNMENT_TAX_INVOICE = '0103', // 위수탁 세금계산서
31
+ IMPORT__RATED_CONSIGNMENT_TAX_INVOICE = '0105', // 영세율 위수탁 세금계산서
32
+ REVISED_GENERAL_TAX_INVOICE = '0201', // 수정 일반 세금계산서
33
+ REVISED_ZERORATED_TAX_INVOICE = '0202', // 수정 영세율 세금계산서
34
+ REVISED_CONSIGNMENT_TAX_INVOICE = '0203', // 수정 위수탁 세금계산서
35
+ REVISED_IMPORT_TAX_INVOICE = '0204', // 수정 수입 세금계산서
36
+ REVISED_ZERORATED_CONSIGNMENT_TAX_INVOICE = '0205', // 수정 영세율 위수탁 세금계산서
37
+ GENERAL_INVOICE = '0301', // 일반 계산서
38
+ CONSIGNMENT_INVOICE = '0303', // 위수탁 계산서
39
+ IMPORT_INVOICE = '0304', // 수입 계산서
40
+ REVISED_GENERAL_INVOICE = '0401', // 수정 일반 계산서
41
+ REVISED_CONSIGNMENT_INVOICE = '0403', // 수정 위수탁 계산서
42
+ REVISED_IMPORT_INVOICE = '0404' // 수정 수입 계산서
43
+ }
44
+ // 세금계산서 영수/청구 구분 지시자
45
+ export enum Purpose {
46
+ RECEIPT = '01', // 영수
47
+ BILLING = '02' // 청구
48
+ }
49
+ // 세금계산서 수정사유 코드
50
+ export enum RevisedReason {
51
+ ENTRY_ERROR_CORRECTION = '01', // 기재사항 착오·정정
52
+ SUPPLY_VALUE_CHANGE = '02', // 공급가액 변동
53
+ REVERSAL_ENTRY = '03', // 환입
54
+ CONTRACT_CANCELLATION = '04', // 계약의 해제
55
+ POST_FACTO_DOMESTIC_LC_ISSUANCE = '05', // 내국신용장 사후 개설
56
+ ERROR_BASED_DUPLICATE_ISSUANCE = '06' // 착오에 의한 이중발급
57
+ }
58
+ // 세금계산서 공급받는자 사업자등록번호 구분코드
59
+ export enum BusinessRegistrationCategory {
60
+ BUSINESS_REGISTRATION_NUMBER = '01', // 사업자등록번호
61
+ RESIDENT_REGISTRATION_NUMBER = '02', // 주민등록번호
62
+ FOREIGNER_REGISTRATION_NUMBER = '03' // 외국인등록번호
63
+ }
64
+
65
+ registerEnumType(Category, {
66
+ name: 'Category',
67
+ description: 'category'
68
+ })
69
+ registerEnumType(InvoiceType, {
70
+ name: 'InvoiceType',
71
+ description: 'invoice type'
72
+ })
73
+ registerEnumType(Purpose, {
74
+ name: 'Purpose',
75
+ description: 'purpose'
76
+ })
77
+ registerEnumType(RevisedReason, {
78
+ name: 'RevisedReason',
79
+ description: 'revised reason'
80
+ })
81
+ registerEnumType(BusinessRegistrationCategory, {
82
+ name: 'BusinessRegistrationCategory',
83
+ description: 'business registration category'
84
+ })
85
+
86
+ @Entity()
87
+ @Index('ix_tax_invoice_0', (taxInvoice: TaxInvoice) => [taxInvoice.domain, taxInvoice.id, taxInvoice.deletedAt], {
88
+ unique: true
89
+ })
90
+ @Index('ix_tax_invoice_1', (taxInvoice: TaxInvoice) => [taxInvoice.domain, taxInvoice.issueDate])
91
+ @ObjectType({ description: 'Entity for TaxInvoice' })
92
+ export class TaxInvoice {
93
+ @PrimaryGeneratedColumn('uuid')
94
+ @Field(type => ID)
95
+ readonly id!: string
96
+
97
+ @VersionColumn()
98
+ @Field({ nullable: true })
99
+ version?: number = 1
100
+
101
+ @ManyToOne(type => Domain)
102
+ @Field({ nullable: true })
103
+ domain?: Domain
104
+
105
+ @RelationId((taxInvoice: TaxInvoice) => taxInvoice.domain)
106
+ domainId?: string
107
+
108
+ @OneToMany(type => TaxInvoiceItem, taxInvoiceItem => taxInvoiceItem.taxInvoice)
109
+ @Field(type => [TaxInvoiceItem], { nullable: true })
110
+ taxInvoiceItems?: TaxInvoiceItem[]
111
+
112
+ @Column({ nullable: true, comment: '이름' })
113
+ @Field({ nullable: true, description: '이름' })
114
+ name?: string
115
+
116
+ @Column({ nullable: false, comment: '세금계산서 구분 (매출: 10, 매입: 20, NTS: 30)' })
117
+ @Field({ nullable: false, description: '세금계산서 구분 (매출: 10, 매입: 20, NTS: 30)' })
118
+ category!: Category
119
+
120
+ @Column({ nullable: true, comment: '승인 번호' })
121
+ @Field({ nullable: true, description: '승인 번호' })
122
+ approvalNo?: string
123
+
124
+ @Column({ nullable: true, comment: '원 승인 번호 (계산서 수정시 원래의 승인 번호)' })
125
+ @Field({ nullable: true, description: '원 승인 번호 (계산서 수정시 원래의 승인 번호)' })
126
+ originalApprovalNo?: string
127
+
128
+ @Column({ nullable: false, comment: '세금계산서 작성 일자 (YYYYMMDD)' })
129
+ @Field({ nullable: false, description: '세금계산서 작성 일자 (YYYYMMDD)' })
130
+ issueDate!: string
131
+
132
+ @Column({ nullable: true, comment: '세금계산서 전자 서명 일자 (YYYYMMDD)' })
133
+ @Field({ nullable: true, description: '세금계산서 전자 서명 일자 (YYYYMMDD)' })
134
+ signatureDate?: string
135
+
136
+ @Column({ nullable: false, comment: '세금계산서 종류 코드 (일반, 영세율, 위수탁)' })
137
+ @Field({ nullable: false, description: '세금계산서 종류 코드 (일반, 영세율, 위수탁)' })
138
+ invoiceType!: InvoiceType
139
+
140
+ @Column({ nullable: false, comment: '세금계산서의 영수/청구 구분 지시자 코드' })
141
+ @Field({ nullable: false, description: '세금계산서의 영수/청구 구분 지시자 코드' })
142
+ purpose!: Purpose
143
+
144
+ @Column({ nullable: true, comment: '수정 사유 코드' })
145
+ @Field({ nullable: true, description: '수정 사유 코드' })
146
+ revisedReason?: RevisedReason
147
+
148
+ @Column({ nullable: true, comment: '비고0' })
149
+ @Field({ nullable: true, description: '비고0' })
150
+ remark0?: string
151
+
152
+ @Column({ nullable: true, comment: '비고1' })
153
+ @Field({ nullable: true, description: '비고1' })
154
+ remark1?: string
155
+
156
+ @Column({ nullable: true, comment: '비고2' })
157
+ @Field({ nullable: true, description: '비고2' })
158
+ remark2?: string
159
+
160
+ @Column({ nullable: false, comment: '공급자 사업자등록번호 구분 코드' })
161
+ @Field({ nullable: false, description: '공급자 사업자등록번호 구분 코드' })
162
+ supplierBusinessRegistrationCategory!: BusinessRegistrationCategory
163
+
164
+ @Column({ nullable: false, comment: '공급자 사업자등록번호', transformer: encryptTransformer })
165
+ @Field({ nullable: false, description: '공급자 사업자등록번호' })
166
+ supplierBusinessRegistrationNumber!: string
167
+
168
+ @Column({ nullable: true, comment: '종사업장 식별 코드' })
169
+ @Field({ nullable: true, description: '종사업장 식별 코드' })
170
+ supplierBranchIdentification?: string
171
+
172
+ @Column({ nullable: false, comment: '공급자 사업자명' })
173
+ @Field({ nullable: false, description: '공급자 사업자명' })
174
+ supplierBusinessName!: string
175
+
176
+ @Column({ nullable: false, comment: '공급자 대표자명' })
177
+ @Field({ nullable: false, description: '공급자 대표자명' })
178
+ supplierRepresentativeName!: string
179
+
180
+ @Column({ nullable: true, comment: '공급자 주소', transformer: encryptTransformer })
181
+ @Field({ nullable: true, description: '공급자 주소' })
182
+ supplierAddress?: string
183
+
184
+ @Column({ nullable: true, comment: '공급자 업태' })
185
+ @Field({ nullable: true, description: '공급자 업태' })
186
+ supplierBusinessType?: string
187
+
188
+ @Column({ nullable: true, comment: '공급자 업종' })
189
+ @Field({ nullable: true, description: '공급자 업종' })
190
+ supplierIndustryType?: string
191
+
192
+ @Column({ nullable: true, comment: '공급자 담당 부서' })
193
+ @Field({ nullable: true, description: '공급자 담당 부서' })
194
+ supplierDepartment?: string
195
+
196
+ @Column({ nullable: true, comment: '공급자 담당자명', transformer: encryptTransformer })
197
+ @Field({ nullable: true, description: '공급자 담당자명' })
198
+ supplierContactName?: string
199
+
200
+ @Column({ nullable: true, comment: '공급자 담당자 전화번호', transformer: encryptTransformer })
201
+ @Field({ nullable: true, description: '공급자 담당자 전화번호' })
202
+ supplierContactPhone?: string
203
+
204
+ @Column({ nullable: true, comment: '공급자 담당자 이메일', transformer: encryptTransformer })
205
+ @Field({ nullable: true, description: '공급자 담당자 이메일' })
206
+ supplierContactEmail?: string
207
+
208
+ @Column({ nullable: true, comment: '공급자 담당자 핸드폰 번호', transformer: encryptTransformer })
209
+ @Field({ nullable: true, description: '공급자 담당자 핸드폰 번호' })
210
+ supplierContactCellPhone?: string
211
+
212
+ @Column({ nullable: false, comment: '공급받는자 사업자등록번호 구분 코드' })
213
+ @Field({ nullable: false, description: '공급받는자 사업자등록번호 구분 코드' })
214
+ buyerBusinessRegistrationCategory!: BusinessRegistrationCategory
215
+
216
+ @Column({ nullable: false, comment: '공급받는자 사업자등록번호', transformer: encryptTransformer })
217
+ @Field({ nullable: false, description: '공급받는자 사업자등록번호' })
218
+ buyerBusinessRegistrationNumber!: string
219
+
220
+ @Column({ nullable: true, comment: '공급받는자 종사업장 식별 코드' })
221
+ @Field({ nullable: true, description: '공급받는자 종사업장 식별 코드' })
222
+ buyerBranchIdentification?: string
223
+
224
+ @Column({ nullable: false, comment: '공급받는자 사업자명' })
225
+ @Field({ nullable: false, description: '공급받는자 사업자명' })
226
+ buyerBusinessName!: string
227
+
228
+ @Column({ nullable: false, comment: '공급받는자 대표자명' })
229
+ @Field({ nullable: false, description: '공급받는자 대표자명' })
230
+ buyerRepresentativeName!: string
231
+
232
+ @Column({ nullable: true, comment: '공급받는자 주소', transformer: encryptTransformer })
233
+ @Field({ nullable: true, description: '공급받는자 주소' })
234
+ buyerAddress?: string
235
+
236
+ @Column({ nullable: true, comment: '공급받는자 업태' })
237
+ @Field({ nullable: true, description: '공급받는자 업태' })
238
+ buyerBusinessType?: string
239
+
240
+ @Column({ nullable: true, comment: '공급받는자 업종' })
241
+ @Field({ nullable: true, description: '공급받는자 업종' })
242
+ buyerIndustryType?: string
243
+
244
+ @Column({ nullable: true, comment: '공급받는자 1st 담당부서' })
245
+ @Field({ nullable: true, description: '공급받는자 1st 담당부서' })
246
+ buyer1stDepartment?: string
247
+
248
+ @Column({ nullable: true, comment: '공급받는자 1st 담당자명', transformer: encryptTransformer })
249
+ @Field({ nullable: true, description: '공급받는자 1st 담당자명' })
250
+ buyer1stContactName?: string
251
+
252
+ @Column({ nullable: true, comment: '공급받는자 1st 담당자 전화번호', transformer: encryptTransformer })
253
+ @Field({ nullable: true, description: '공급받는자 1st 담당자 전화번호' })
254
+ buyer1stContactPhone?: string
255
+
256
+ @Column({ nullable: true, comment: '공급받는자 1st 담당자 이메일', transformer: encryptTransformer })
257
+ @Field({ nullable: true, description: '공급받는자 1st 담당자 이메일' })
258
+ buyer1stContactEmail?: string
259
+
260
+ @Column({ nullable: true, comment: '공급받는자 1st 담당자 핸드폰번호', transformer: encryptTransformer })
261
+ @Field({ nullable: true, description: '공급받는자 1st 담당자 핸드폰번호' })
262
+ buyer1stContactCellPhone?: string
263
+
264
+ @Column({ nullable: true, comment: '공급받는자 2nd 담당부서' })
265
+ @Field({ nullable: true, description: '공급받는자 2nd 담당부서' })
266
+ buyer2ndDepartment?: string
267
+
268
+ @Column({ nullable: true, comment: '공급받는자 2nd 담당자명', transformer: encryptTransformer })
269
+ @Field({ nullable: true, description: '공급받는자 2nd 담당자명' })
270
+ buyer2ndContactName?: string
271
+
272
+ @Column({ nullable: true, comment: '공급받는자 2nd 담당자 전화번호', transformer: encryptTransformer })
273
+ @Field({ nullable: true, description: '공급받는자 2nd 담당자 전화번호' })
274
+ buyer2ndContactPhone?: string
275
+
276
+ @Column({ nullable: true, comment: '공급받는자 2nd 담당자 이메일', transformer: encryptTransformer })
277
+ @Field({ nullable: true, description: '공급받는자 2nd 담당자 이메일' })
278
+ buyer2ndContactEmail?: string
279
+
280
+ @Column({ nullable: true, comment: '공급받는자 2nd 담당자 핸드폰번호', transformer: encryptTransformer })
281
+ @Field({ nullable: true, description: '공급받는자 2nd 담당자 핸드폰번호' })
282
+ buyer2ndContactCellPhone?: string
283
+
284
+ @Column({ nullable: true, comment: '수탁사업자 사업자등록번호 구분 코드' })
285
+ @Field({ nullable: true, description: '수탁사업자 사업자등록번호 구분 코드' })
286
+ agentBusinessRegistrationCategory?: BusinessRegistrationCategory
287
+
288
+ @Column({ nullable: true, comment: '수탁사업자 사업자등록번호 (nnnnnnnnnn)', transformer: encryptTransformer })
289
+ @Field({ nullable: true, description: '수탁사업자 사업자등록번호 (nnnnnnnnnn)' })
290
+ agentBusinessRegistrationNumber?: string
291
+
292
+ @Column({ nullable: true, comment: '수탁사업자 종사업장 식별코드' })
293
+ @Field({ nullable: true, description: '수탁사업자 종사업장 식별코드' })
294
+ agentBranchIdentification?: string
295
+
296
+ @Column({ nullable: true, comment: '수탁사업자 사업자명' })
297
+ @Field({ nullable: true, description: '수탁사업자 사업자명' })
298
+ agentBusinessName?: string
299
+
300
+ @Column({ nullable: true, comment: '수탁사업자 대표자명' })
301
+ @Field({ nullable: true, description: '수탁사업자 대표자명' })
302
+ agentRepresentativeName?: string
303
+
304
+ @Column({ nullable: true, comment: '수탁사업자 주소', transformer: encryptTransformer })
305
+ @Field({ nullable: true, description: '수탁사업자 주소' })
306
+ agentAddress?: string
307
+
308
+ @Column({ nullable: true, comment: '수탁사업자 업태' })
309
+ @Field({ nullable: true, description: '수탁사업자 업태' })
310
+ agentBusinessType?: string
311
+
312
+ @Column({ nullable: true, comment: '수탁사업자 업종' })
313
+ @Field({ nullable: true, description: '수탁사업자 업종' })
314
+ agentIndustryType?: string
315
+
316
+ @Column({ nullable: true, comment: '수탁사업자 담당부서' })
317
+ @Field({ nullable: true, description: '수탁사업자 담당부서' })
318
+ agentDepartment?: string
319
+
320
+ @Column({ nullable: true, comment: '수탁사업자 담당자명', transformer: encryptTransformer })
321
+ @Field({ nullable: true, description: '수탁사업자 담당자명' })
322
+ agentContactName?: string
323
+
324
+ @Column({ nullable: true, comment: '수탁사업자 담당자 전화번호', transformer: encryptTransformer })
325
+ @Field({ nullable: true, description: '수탁사업자 담당자 전화번호' })
326
+ agentContactPhone?: string
327
+
328
+ @Column({ nullable: true, comment: '수탁사업자 담당자 이메일', transformer: encryptTransformer })
329
+ @Field({ nullable: true, description: '수탁사업자 담당자 이메일' })
330
+ agentContactEmail?: string
331
+
332
+ @Column({ nullable: true, comment: '수탁사업자 담당자 핸드폰번호', transformer: encryptTransformer })
333
+ @Field({ nullable: true, description: '수탁사업자 담당자 핸드폰번호' })
334
+ agentContactCellPhone?: string
335
+
336
+ @Column({ nullable: true, comment: '결제 금액 - 현금' })
337
+ @Field({ nullable: true, description: '결제 금액 - 현금' })
338
+ paymentAmountCash?: number
339
+
340
+ @Column({ nullable: true, comment: '결제 금액 - 수표' })
341
+ @Field({ nullable: true, description: '결제 금액 - 수표' })
342
+ paymentAmountCheck?: number
343
+
344
+ @Column({ nullable: true, comment: '결제 금액 - 어음' })
345
+ @Field({ nullable: true, description: '결제 금액 - 어음' })
346
+ paymentAmountPromissoryNote?: number
347
+
348
+ @Column({ nullable: true, comment: '결제 금액 - 외상 미수금' })
349
+ @Field({ nullable: true, description: '결제 금액 - 외상 미수금' })
350
+ paymentAmountAccountsReceivable?: number
351
+
352
+ @Column({ nullable: false, comment: '공급 가액' })
353
+ @Field({ nullable: false, description: '공급 가액' })
354
+ supplyAmount!: number
355
+
356
+ @Column({ nullable: true, comment: '세액' })
357
+ @Field({ nullable: true, description: '세액' })
358
+ taxAmount?: number
359
+
360
+ @Column({ nullable: false, comment: '총액 = 공급 가액 + 세액' })
361
+ @Field({ nullable: false, description: '총액 = 공급 가액 + 세액' })
362
+ totalAmount!: number
363
+
364
+ @CreateDateColumn()
365
+ @Field({ nullable: true })
366
+ createdAt?: Date
367
+
368
+ @UpdateDateColumn()
369
+ @Field({ nullable: true })
370
+ updatedAt?: Date
371
+
372
+ @DeleteDateColumn()
373
+ @Field({ nullable: true })
374
+ deletedAt?: Date
375
+
376
+ @ManyToOne(type => User, { nullable: true })
377
+ @Field(type => User, { nullable: true })
378
+ creator?: User
379
+
380
+ @RelationId((taxInvoice: TaxInvoice) => taxInvoice.creator)
381
+ creatorId?: string
382
+
383
+ @ManyToOne(type => User, { nullable: true })
384
+ @Field(type => User, { nullable: true })
385
+ updater?: User
386
+
387
+ @RelationId((taxInvoice: TaxInvoice) => taxInvoice.updater)
388
+ updaterId?: string
389
+ }
@@ -0,0 +1,6 @@
1
+ import { TaxInvoiceApi } from './tax-invoice-api'
2
+ import { TaxInvoiceApiQuery } from './tax-invoice-api-query'
3
+ import { TaxInvoiceApiMutation } from './tax-invoice-api-mutation'
4
+
5
+ export const entities = [TaxInvoiceApi]
6
+ export const resolvers = [TaxInvoiceApiQuery, TaxInvoiceApiMutation]
@@ -0,0 +1,67 @@
1
+ import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'
2
+ import { In } from 'typeorm'
3
+
4
+ import { TaxInvoiceApi } from './tax-invoice-api'
5
+ import { TaxInvoiceApiPatch } from './tax-invoice-api-type'
6
+
7
+ @Resolver(TaxInvoiceApi)
8
+ export class TaxInvoiceApiMutation {
9
+ @Directive('@transaction')
10
+ @Mutation(returns => [TaxInvoiceApi], { description: 'To modify multiple Tax Invoice Api information' })
11
+ async updateMultipleTaxInvoiceApis(
12
+ @Arg('patches', type => [TaxInvoiceApiPatch]) patches: TaxInvoiceApiPatch[],
13
+ @Ctx() context: ResolverContext
14
+ ): Promise<TaxInvoiceApi[]> {
15
+ const { domain, user, tx } = context.state
16
+
17
+ let results = []
18
+ const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')
19
+ const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')
20
+ const taxInvoiceApiRepo = tx.getRepository(TaxInvoiceApi)
21
+
22
+ if (_createRecords.length > 0) {
23
+ for (let i = 0; i < _createRecords.length; i++) {
24
+ const newRecord = _createRecords[i]
25
+
26
+ const result = await taxInvoiceApiRepo.save({
27
+ ...newRecord,
28
+ domain,
29
+ creator: user,
30
+ updater: user
31
+ })
32
+
33
+ results.push({ ...result, cuFlag: '+' })
34
+ }
35
+ }
36
+
37
+ if (_updateRecords.length > 0) {
38
+ for (let i = 0; i < _updateRecords.length; i++) {
39
+ const updateRecord = _updateRecords[i]
40
+ const taxInvoiceApi = await taxInvoiceApiRepo.findOneBy({ id: updateRecord.id })
41
+
42
+ const result = await taxInvoiceApiRepo.save({
43
+ ...taxInvoiceApi,
44
+ ...updateRecord,
45
+ updater: user
46
+ })
47
+
48
+ results.push({ ...result, cuFlag: 'M' })
49
+ }
50
+ }
51
+
52
+ return results
53
+ }
54
+
55
+ @Directive('@transaction')
56
+ @Mutation(returns => Boolean, { description: 'To delete multiple Tax Invoice Api' })
57
+ async deleteTaxInvoiceApis(@Arg('ids', type => [String]) ids: string[], @Ctx() context: ResolverContext): Promise<boolean> {
58
+ const { domain, tx } = context.state
59
+
60
+ await tx.getRepository(TaxInvoiceApi).delete({
61
+ domain: { id: domain.id },
62
+ id: In(ids)
63
+ })
64
+
65
+ return true
66
+ }
67
+ }
@@ -0,0 +1,48 @@
1
+ import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx } from 'type-graphql'
2
+ import { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'
3
+ import { User } from '@things-factory/auth-base'
4
+ import { TaxInvoiceApi } from './tax-invoice-api'
5
+ import { TaxInvoiceApiList } from './tax-invoice-api-type'
6
+
7
+ @Resolver(TaxInvoiceApi)
8
+ export class TaxInvoiceApiQuery {
9
+ @Query(returns => TaxInvoiceApi!, { nullable: true, description: 'To fetch a Tax Invoice Api' })
10
+ async taxInvoiceApi(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<TaxInvoiceApi> {
11
+ const { domain } = context.state
12
+
13
+ return await getRepository(TaxInvoiceApi).findOne({
14
+ where: { domain: { id: domain.id }, id }
15
+ })
16
+ }
17
+
18
+ @Query(returns => TaxInvoiceApiList, { description: 'To fetch multiple Tax Invoice Api' })
19
+ async taxInvoiceApis(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<TaxInvoiceApiList> {
20
+ const { domain } = context.state
21
+
22
+ const queryBuilder = getQueryBuilderFromListParams({
23
+ domain,
24
+ params,
25
+ repository: await getRepository(TaxInvoiceApi),
26
+ searchables: ['name', 'description']
27
+ })
28
+
29
+ const [items, total] = await queryBuilder.getManyAndCount()
30
+
31
+ return { items, total }
32
+ }
33
+
34
+ @FieldResolver(type => Domain)
35
+ async domain(@Root() taxInvoiceApi: TaxInvoiceApi): Promise<Domain> {
36
+ return taxInvoiceApi.domainId && (await getRepository(Domain).findOneBy({ id: taxInvoiceApi.domainId }))
37
+ }
38
+
39
+ @FieldResolver(type => User)
40
+ async updater(@Root() taxInvoiceApi: TaxInvoiceApi): Promise<User> {
41
+ return taxInvoiceApi.updaterId && (await getRepository(User).findOneBy({ id: taxInvoiceApi.updaterId }))
42
+ }
43
+
44
+ @FieldResolver(type => User)
45
+ async creator(@Root() taxInvoiceApi: TaxInvoiceApi): Promise<User> {
46
+ return taxInvoiceApi.creatorId && (await getRepository(User).findOneBy({ id: taxInvoiceApi.creatorId }))
47
+ }
48
+ }
@@ -0,0 +1,71 @@
1
+ import { ObjectType, Field, InputType, Int, ID } from 'type-graphql'
2
+ import { TaxInvoiceApi } from './tax-invoice-api'
3
+
4
+ @InputType()
5
+ export class TaxInvoiceApiPatch {
6
+ @Field(type => ID, { nullable: true })
7
+ id?: string
8
+
9
+ @Field({ nullable: true })
10
+ name?: string
11
+
12
+ @Field({ nullable: true })
13
+ description?: string
14
+
15
+ @Field({ nullable: true })
16
+ apiKey?: string
17
+
18
+ @Field({ nullable: true })
19
+ apiAccountId?: string
20
+
21
+ @Field({ nullable: true })
22
+ apiAccountPassword?: string
23
+
24
+ @Field({ nullable: true })
25
+ businessRegistrationNumber?: string
26
+
27
+ @Field({ nullable: true })
28
+ branchIdentification?: string
29
+
30
+ @Field({ nullable: true })
31
+ businessName?: string
32
+
33
+ @Field({ nullable: true })
34
+ representativeName?: string
35
+
36
+ @Field({ nullable: true })
37
+ address?: string
38
+
39
+ @Field({ nullable: true })
40
+ businessType?: string
41
+
42
+ @Field({ nullable: true })
43
+ industryType?: string
44
+
45
+ @Field({ nullable: true })
46
+ department?: string
47
+
48
+ @Field({ nullable: true })
49
+ contactName?: string
50
+
51
+ @Field({ nullable: true })
52
+ contactPhone?: string
53
+
54
+ @Field({ nullable: true })
55
+ contactEmail?: string
56
+
57
+ @Field({ nullable: true })
58
+ contactCellPhone?: string
59
+
60
+ @Field({ nullable: true })
61
+ cuFlag?: string
62
+ }
63
+
64
+ @ObjectType()
65
+ export class TaxInvoiceApiList {
66
+ @Field(type => [TaxInvoiceApi])
67
+ items: TaxInvoiceApi[]
68
+
69
+ @Field(type => Int)
70
+ total: number
71
+ }