@things-factory/tax-invoice 6.2.84 → 6.2.88
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 +34 -11
- package/client/pages/tax-invoice/tax-invoice-list-page.ts +150 -152
- 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/pages/tax-invoice-send/tax-invoice-send-page.ts +580 -0
- package/client/route.ts +4 -4
- package/dist-client/pages/tax-invoice/tax-invoice-detail-popup.js +39 -13
- 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 +63 -23
- package/dist-client/pages/tax-invoice/tax-invoice-list-page.js +149 -143
- 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/pages/tax-invoice-send/tax-invoice-send-page.d.ts +100 -0
- package/dist-client/pages/tax-invoice-send/tax-invoice-send-page.js +510 -0
- package/dist-client/pages/tax-invoice-send/tax-invoice-send-page.js.map +1 -0
- 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 +137 -41
- package/dist-server/service/tax-invoice/tax-invoice-mutation.js.map +1 -1
- package/dist-server/service/tax-invoice/tax-invoice-query.js +25 -2
- package/dist-server/service/tax-invoice/tax-invoice-query.js.map +1 -1
- package/dist-server/service/tax-invoice/tax-invoice-type.js +22 -259
- package/dist-server/service/tax-invoice/tax-invoice-type.js.map +1 -1
- package/dist-server/service/tax-invoice/tax-invoice.js +22 -24
- 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-api/tax-invoice-api.js +0 -8
- package/dist-server/service/tax-invoice-api/tax-invoice-api.js.map +1 -1
- package/dist-server/service/tax-invoice-company/tax-invoice-company.js +0 -8
- package/dist-server/service/tax-invoice-company/tax-invoice-company.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 -12
- 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 +6 -15
- 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 +5 -5
- package/server/service/tax-invoice/tax-invoice-mutation.ts +143 -45
- package/server/service/tax-invoice/tax-invoice-query.ts +22 -4
- package/server/service/tax-invoice/tax-invoice-type.ts +21 -199
- package/server/service/tax-invoice/tax-invoice.ts +38 -49
- package/server/service/tax-invoice-api/tax-invoice-api-type.ts +4 -0
- package/server/service/tax-invoice-api/tax-invoice-api.ts +0 -4
- package/server/service/tax-invoice-company/tax-invoice-company.ts +0 -4
- 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 -13
- package/server/service/tax-invoice-item/tax-invoice-item.ts +6 -10
- package/server/service/unipost-api/tax-invoice-inquiry.ts +103 -0
- package/translations/ko.json +10 -1
|
@@ -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
|
|
|
@@ -25,21 +13,21 @@ export enum Category {
|
|
|
25
13
|
}
|
|
26
14
|
// 세금계산서 종류
|
|
27
15
|
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' // 수정 수입
|
|
16
|
+
GENERAL_TAX_INVOICE = '0101', // 일반 전자세금계산서
|
|
17
|
+
ZERO_RATED_TAX_INVOICE = '0102', // 영세율 전자세금계산서
|
|
18
|
+
CONSIGNMENT_TAX_INVOICE = '0103', // 위수탁 전자세금계산서
|
|
19
|
+
IMPORT__RATED_CONSIGNMENT_TAX_INVOICE = '0105', // 영세율 위수탁 전자세금계산서
|
|
20
|
+
REVISED_GENERAL_TAX_INVOICE = '0201', // 수정 일반 전자세금계산서
|
|
21
|
+
REVISED_ZERORATED_TAX_INVOICE = '0202', // 수정 영세율 전자세금계산서
|
|
22
|
+
REVISED_CONSIGNMENT_TAX_INVOICE = '0203', // 수정 위수탁 전자세금계산서
|
|
23
|
+
REVISED_IMPORT_TAX_INVOICE = '0204', // 수정 수입 전자세금계산서
|
|
24
|
+
REVISED_ZERORATED_CONSIGNMENT_TAX_INVOICE = '0205', // 수정 영세율 위수탁 전자세금계산서
|
|
25
|
+
GENERAL_INVOICE = '0301', // 일반 전자계산서
|
|
26
|
+
CONSIGNMENT_INVOICE = '0303', // 위수탁 전자계산서
|
|
27
|
+
IMPORT_INVOICE = '0304', // 수입 전자계산서
|
|
28
|
+
REVISED_GENERAL_INVOICE = '0401', // 수정 일반 전자계산서
|
|
29
|
+
REVISED_CONSIGNMENT_INVOICE = '0403', // 수정 위수탁 전자계산서
|
|
30
|
+
REVISED_IMPORT_INVOICE = '0404' // 수정 수입 전자계산서
|
|
43
31
|
}
|
|
44
32
|
// 세금계산서 영수/청구 구분 지시자
|
|
45
33
|
export enum Purpose {
|
|
@@ -88,16 +76,13 @@ 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')
|
|
94
83
|
@Field(type => ID)
|
|
95
84
|
readonly id!: string
|
|
96
85
|
|
|
97
|
-
@VersionColumn()
|
|
98
|
-
@Field({ nullable: true })
|
|
99
|
-
version?: number = 1
|
|
100
|
-
|
|
101
86
|
@ManyToOne(type => Domain)
|
|
102
87
|
@Field({ nullable: true })
|
|
103
88
|
domain?: Domain
|
|
@@ -109,29 +94,33 @@ export class TaxInvoice {
|
|
|
109
94
|
@Field(type => [TaxInvoiceItem], { nullable: true })
|
|
110
95
|
taxInvoiceItems?: TaxInvoiceItem[]
|
|
111
96
|
|
|
112
|
-
@Column({ nullable: true, comment: '
|
|
113
|
-
@Field({ nullable: true, description: '
|
|
114
|
-
|
|
97
|
+
@Column({ nullable: true, comment: '메모' })
|
|
98
|
+
@Field({ nullable: true, description: '메모' })
|
|
99
|
+
memo?: string
|
|
115
100
|
|
|
116
101
|
@Column({ nullable: false, comment: '세금계산서 구분 (매출: 10, 매입: 20, NTS: 30)' })
|
|
117
102
|
@Field({ nullable: false, description: '세금계산서 구분 (매출: 10, 매입: 20, NTS: 30)' })
|
|
118
103
|
category!: Category
|
|
119
104
|
|
|
120
|
-
@Column({ nullable: true, comment: '
|
|
121
|
-
@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자리)' })
|
|
122
111
|
approvalNo?: string
|
|
123
112
|
|
|
124
113
|
@Column({ nullable: true, comment: '원 승인 번호 (계산서 수정시 원래의 승인 번호)' })
|
|
125
114
|
@Field({ nullable: true, description: '원 승인 번호 (계산서 수정시 원래의 승인 번호)' })
|
|
126
115
|
originalApprovalNo?: string
|
|
127
116
|
|
|
128
|
-
@Column({ nullable: false, comment: '세금계산서 작성 일자 (
|
|
129
|
-
@Field({ nullable: false, description: '세금계산서 작성 일자 (
|
|
130
|
-
issueDate!:
|
|
117
|
+
@Column({ nullable: false, comment: '세금계산서 작성 일자 (YYYY-MM-DD)' })
|
|
118
|
+
@Field({ nullable: false, description: '세금계산서 작성 일자 (YYYY-MM-DD)' })
|
|
119
|
+
issueDate!: Date
|
|
131
120
|
|
|
132
|
-
@Column({ nullable: true, comment: '세금계산서 전자 서명 일자 (
|
|
133
|
-
@Field({ nullable: true, description: '세금계산서 전자 서명 일자 (
|
|
134
|
-
signatureDate?:
|
|
121
|
+
@Column({ nullable: true, comment: '세금계산서 전자 서명 일자 (YYYY-MM-DD)' })
|
|
122
|
+
@Field({ nullable: true, description: '세금계산서 전자 서명 일자 (YYYY-MM-DD)' })
|
|
123
|
+
signatureDate?: Date
|
|
135
124
|
|
|
136
125
|
@Column({ nullable: false, comment: '세금계산서 종류 코드 (일반, 영세율, 위수탁)' })
|
|
137
126
|
@Field({ nullable: false, description: '세금계산서 종류 코드 (일반, 영세율, 위수탁)' })
|
|
@@ -157,9 +146,9 @@ export class TaxInvoice {
|
|
|
157
146
|
@Field({ nullable: true, description: '비고2' })
|
|
158
147
|
remark2?: string
|
|
159
148
|
|
|
160
|
-
@Column({ nullable:
|
|
161
|
-
@Field({ nullable:
|
|
162
|
-
supplierBusinessRegistrationCategory
|
|
149
|
+
@Column({ nullable: true, comment: '공급자 사업자등록번호 구분 코드' })
|
|
150
|
+
@Field({ nullable: true, description: '공급자 사업자등록번호 구분 코드' })
|
|
151
|
+
supplierBusinessRegistrationCategory?: BusinessRegistrationCategory
|
|
163
152
|
|
|
164
153
|
@Column({ nullable: false, comment: '공급자 사업자등록번호', transformer: encryptTransformer })
|
|
165
154
|
@Field({ nullable: false, description: '공급자 사업자등록번호' })
|
|
@@ -209,9 +198,9 @@ export class TaxInvoice {
|
|
|
209
198
|
@Field({ nullable: true, description: '공급자 담당자 핸드폰 번호' })
|
|
210
199
|
supplierContactCellPhone?: string
|
|
211
200
|
|
|
212
|
-
@Column({ nullable:
|
|
213
|
-
@Field({ nullable:
|
|
214
|
-
buyerBusinessRegistrationCategory
|
|
201
|
+
@Column({ nullable: true, comment: '공급받는자 사업자등록번호 구분 코드' })
|
|
202
|
+
@Field({ nullable: true, description: '공급받는자 사업자등록번호 구분 코드' })
|
|
203
|
+
buyerBusinessRegistrationCategory?: BusinessRegistrationCategory
|
|
215
204
|
|
|
216
205
|
@Column({ nullable: false, comment: '공급받는자 사업자등록번호', transformer: encryptTransformer })
|
|
217
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,19 +1,13 @@
|
|
|
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()
|
|
8
5
|
export class NewTaxInvoiceItem {
|
|
9
|
-
@Field({ nullable: false, description: '세금계산서 번호' })
|
|
10
|
-
taxInvoiceId: string
|
|
11
|
-
|
|
12
6
|
@Field(type => Int, { nullable: false, description: '아이템 일련번호' })
|
|
13
7
|
sequence: number
|
|
14
8
|
|
|
15
|
-
@Field({ nullable: false, description: '공급년월일(
|
|
16
|
-
supplyDate:
|
|
9
|
+
@Field({ nullable: false, description: '공급년월일(YYYY-MM-DD)' })
|
|
10
|
+
supplyDate: Date
|
|
17
11
|
|
|
18
12
|
@Field({ nullable: false, description: '품목명' })
|
|
19
13
|
itemName: string
|
|
@@ -42,14 +36,11 @@ export class TaxInvoiceItemPatch {
|
|
|
42
36
|
@Field(type => ID, { nullable: false })
|
|
43
37
|
id?: string
|
|
44
38
|
|
|
45
|
-
@Field({ nullable: false, description: '세금계산서 번호' })
|
|
46
|
-
taxInvoiceId: string
|
|
47
|
-
|
|
48
39
|
@Field(type => Int, { nullable: false, description: '아이템 일련번호' })
|
|
49
40
|
sequence: number
|
|
50
41
|
|
|
51
|
-
@Field({ nullable: false, description: '공급년월일(
|
|
52
|
-
supplyDate:
|
|
42
|
+
@Field({ nullable: false, description: '공급년월일(YYYY-MM-DD)' })
|
|
43
|
+
supplyDate: Date
|
|
53
44
|
|
|
54
45
|
@Field({ nullable: false, description: '품목명' })
|
|
55
46
|
itemName: string
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CreateDateColumn,
|
|
1
|
+
import { CreateDateColumn, DeleteDateColumn, Entity, Index, Column, JoinColumn, RelationId, ManyToOne, PrimaryGeneratedColumn } from 'typeorm'
|
|
2
2
|
import { ObjectType, Field, ID } from 'type-graphql'
|
|
3
3
|
|
|
4
4
|
import { Domain } from '@things-factory/shell'
|
|
@@ -7,17 +7,13 @@ import { TaxInvoice } from '../tax-invoice/tax-invoice'
|
|
|
7
7
|
|
|
8
8
|
@Entity()
|
|
9
9
|
@Index('ix_tax_invoice_item_0', (taxInvoiceItem: TaxInvoiceItem) => [taxInvoiceItem.domain, taxInvoiceItem.id, taxInvoiceItem.deletedAt], { unique: true })
|
|
10
|
-
|
|
10
|
+
@Index('ix_tax_invoice_item_1', (taxInvoiceItem: TaxInvoiceItem) => [taxInvoiceItem.taxInvoice])
|
|
11
11
|
@ObjectType({ description: 'Entity for TaxInvoiceItem' })
|
|
12
12
|
export class TaxInvoiceItem {
|
|
13
13
|
@PrimaryGeneratedColumn('uuid')
|
|
14
14
|
@Field(type => ID)
|
|
15
15
|
readonly id!: string
|
|
16
16
|
|
|
17
|
-
@VersionColumn()
|
|
18
|
-
@Field({ nullable: true })
|
|
19
|
-
version?: number = 1
|
|
20
|
-
|
|
21
17
|
@ManyToOne(type => Domain)
|
|
22
18
|
@Field({ nullable: true })
|
|
23
19
|
domain?: Domain
|
|
@@ -25,7 +21,7 @@ export class TaxInvoiceItem {
|
|
|
25
21
|
@RelationId((taxInvoiceItem: TaxInvoiceItem) => taxInvoiceItem.domain)
|
|
26
22
|
domainId?: string
|
|
27
23
|
|
|
28
|
-
@ManyToOne(type => TaxInvoice)
|
|
24
|
+
@ManyToOne(type => TaxInvoice, taxInvoice => taxInvoice.taxInvoiceItems)
|
|
29
25
|
@Field({ nullable: false })
|
|
30
26
|
taxInvoice!: TaxInvoice
|
|
31
27
|
|
|
@@ -36,9 +32,9 @@ export class TaxInvoiceItem {
|
|
|
36
32
|
@Field({ nullable: true, description: '아이템 일련번호' })
|
|
37
33
|
sequence?: number
|
|
38
34
|
|
|
39
|
-
@Column({ nullable: false, comment: '공급년월일(
|
|
40
|
-
@Field({ nullable: false, description: '공급년월일(
|
|
41
|
-
supplyDate!:
|
|
35
|
+
@Column({ nullable: false, comment: '공급년월일(YYYY-MM-DD)' })
|
|
36
|
+
@Field({ nullable: false, description: '공급년월일(YYYY-MM-DD)' })
|
|
37
|
+
supplyDate!: Date
|
|
42
38
|
|
|
43
39
|
@Column({ nullable: false, comment: '품목명' })
|
|
44
40
|
@Field({ nullable: false, description: '품목명' })
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { Category } from '../tax-invoice/tax-invoice'
|
|
2
|
+
// import getTestTaxInvoiceData from './test-data'
|
|
3
|
+
|
|
4
|
+
// 세금계산서 조회 API
|
|
5
|
+
const INQUIRY_URL = {
|
|
6
|
+
dev: 'https://inf1dev.unipost.co.kr:47523/unitax/rest/v3/hometax/searchbills',
|
|
7
|
+
prod: 'https://inf1.unipost.co.kr/unitax/rest/v3/hometax/searchbills'
|
|
8
|
+
}
|
|
9
|
+
// 세금계산서 조회 후 처리 결과 갱신
|
|
10
|
+
const CONFIRM_URL = {
|
|
11
|
+
dev: 'https://inf1dev.unipost.co.kr:47523/unitax/rest/v3/hometax/updateBills',
|
|
12
|
+
prod: 'https://inf1.unipost.co.kr/unitax/rest/v3/hometax/updateBills'
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export enum UnipostTaxType {
|
|
16
|
+
EXPORT = 'AR', // 매출
|
|
17
|
+
IMPORT = 'AP' // 매입
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface ConfirmData {
|
|
21
|
+
aid: string
|
|
22
|
+
tax_type: UnipostTaxType
|
|
23
|
+
tid_issueid: string
|
|
24
|
+
success: boolean
|
|
25
|
+
message: string
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export async function getTaxInvoiceByUniposApi(businessRegistrationNumber: string, aid: string, bearer: string) {
|
|
29
|
+
if (!businessRegistrationNumber || !aid || !bearer) {
|
|
30
|
+
throw new Error('no parameter in unipos api')
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const approvalNoList: Array<string> = []
|
|
34
|
+
const taxList = []
|
|
35
|
+
const taxTypeArr = [UnipostTaxType.EXPORT, UnipostTaxType.IMPORT]
|
|
36
|
+
|
|
37
|
+
// 매입, 매출 각각 요청
|
|
38
|
+
for (const taxType of taxTypeArr) {
|
|
39
|
+
const response = await _callTaxInvoiceInquiry(businessRegistrationNumber, aid, bearer, taxType)
|
|
40
|
+
|
|
41
|
+
// 성공 일시 세금 계산서 데이터 배열에 추가
|
|
42
|
+
if (response.status === 200) {
|
|
43
|
+
const category = taxType === 'AR' ? Category.EXPORT : Category.IMPORT
|
|
44
|
+
const taxData = await response.json()
|
|
45
|
+
|
|
46
|
+
if (taxData.success === true) {
|
|
47
|
+
for (let tax of taxData.tAliceEntry) {
|
|
48
|
+
approvalNoList.push(tax.tid_issueid)
|
|
49
|
+
taxList.push({ ...tax, category })
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// 테스트 코드
|
|
55
|
+
// const category = taxType === 'AR' ? Category.EXPORT : Category.IMPORT
|
|
56
|
+
// const taxData = getTestTaxInvoiceData(category)
|
|
57
|
+
// if (taxData.success === true) {
|
|
58
|
+
// for (let tax of taxData.tAliceEntry) {
|
|
59
|
+
// approvalNoList.push(tax.tid_issueid)
|
|
60
|
+
// taxList.push({ ...tax, category })
|
|
61
|
+
// }
|
|
62
|
+
// }
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return {
|
|
66
|
+
approvalNoList,
|
|
67
|
+
taxList
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
async function _callTaxInvoiceInquiry(businessRegistrationNumber: string, aid: string, bearer: string, taxType: UnipostTaxType) {
|
|
72
|
+
const response = await fetch(INQUIRY_URL.dev, {
|
|
73
|
+
method: 'POST',
|
|
74
|
+
headers: {
|
|
75
|
+
'Content-Type': 'application/json',
|
|
76
|
+
Authorization: 'Basic ' + bearer,
|
|
77
|
+
AID: aid,
|
|
78
|
+
COM_REGNO: businessRegistrationNumber
|
|
79
|
+
},
|
|
80
|
+
body: JSON.stringify({
|
|
81
|
+
aid,
|
|
82
|
+
tax_type: taxType,
|
|
83
|
+
biz_no: businessRegistrationNumber,
|
|
84
|
+
period: 30
|
|
85
|
+
})
|
|
86
|
+
})
|
|
87
|
+
|
|
88
|
+
return response
|
|
89
|
+
}
|
|
90
|
+
export async function callTaxInvoiceConfirm(businessRegistrationNumber: string, aid: string, bearer: string, confirmData: ConfirmData[]) {
|
|
91
|
+
const response = await fetch(CONFIRM_URL.dev, {
|
|
92
|
+
method: 'POST',
|
|
93
|
+
headers: {
|
|
94
|
+
'Content-Type': 'application/json',
|
|
95
|
+
Authorization: 'Basic ' + bearer,
|
|
96
|
+
AID: aid,
|
|
97
|
+
COM_REGNO: businessRegistrationNumber
|
|
98
|
+
},
|
|
99
|
+
body: JSON.stringify(confirmData)
|
|
100
|
+
})
|
|
101
|
+
|
|
102
|
+
return response
|
|
103
|
+
}
|
package/translations/ko.json
CHANGED
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
"title.tax invoice matching": "세금계산서 매칭",
|
|
10
10
|
"title.tax invoice api": "세금계산서 API 설정",
|
|
11
11
|
"title.tax invoice detail": "전자세금계산서 상세조회",
|
|
12
|
+
"button.memo save": "메모 저장",
|
|
13
|
+
"button.tax invoice send": "발급하기",
|
|
12
14
|
|
|
13
15
|
"text.company supplier": "공급사",
|
|
14
16
|
"text.company buyer": "거래처",
|
|
@@ -16,6 +18,7 @@
|
|
|
16
18
|
"text.tax invoice description purpose 01": "영수",
|
|
17
19
|
"text.tax invoice description purpose 02": "청구",
|
|
18
20
|
|
|
21
|
+
"field.memo": "메모",
|
|
19
22
|
"field.business registration number": "사업자등록번호",
|
|
20
23
|
"field.short business registration number": "등록번호",
|
|
21
24
|
"field.branch identification": "종사업장 식별 코드",
|
|
@@ -45,8 +48,13 @@
|
|
|
45
48
|
"field.total amount": "합계금액",
|
|
46
49
|
"field.supply amount": "공급가액",
|
|
47
50
|
"field.tax amount": "세액",
|
|
51
|
+
"field.summary total count": "총 건수",
|
|
52
|
+
"field.summary total amount": "총 합계금액",
|
|
53
|
+
"field.summary supply amount": "총 공급가액",
|
|
54
|
+
"field.summary tax amount": "총 세액",
|
|
48
55
|
"field.approval no": "승인번호",
|
|
49
56
|
"field.original approval no": "원 승인번호",
|
|
57
|
+
"field.short invoice type": "전자세금계산서 종류",
|
|
50
58
|
"field.invoice type": "전자세금계산서 종류",
|
|
51
59
|
"field.remark0": "비고",
|
|
52
60
|
"field.remark1": "비고1",
|
|
@@ -67,5 +75,6 @@
|
|
|
67
75
|
"field.tax invoice payment cash": "현금",
|
|
68
76
|
"field.tax invoice payment check": "수표",
|
|
69
77
|
"field.tax invoice payment promissory note": "어음",
|
|
70
|
-
"field.tax invoice payment accounts receivable": "외상 미수금"
|
|
78
|
+
"field.tax invoice payment accounts receivable": "외상 미수금",
|
|
79
|
+
"field.tax invoice buyer registration category": "공급받는자 구분"
|
|
71
80
|
}
|