@things-factory/tax-invoice 6.2.86 → 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.
Files changed (52) hide show
  1. package/client/pages/tax-invoice/tax-invoice-detail-popup.ts +12 -6
  2. package/client/pages/tax-invoice/tax-invoice-list-page.ts +147 -176
  3. package/client/pages/tax-invoice-api/tax-invoice-api-page.ts +6 -5
  4. package/client/pages/tax-invoice-company/tax-invoice-company-importer.ts +2 -2
  5. package/client/pages/tax-invoice-send/tax-invoice-send-page.ts +580 -0
  6. package/client/route.ts +4 -4
  7. package/dist-client/pages/tax-invoice/tax-invoice-detail-popup.js +18 -9
  8. package/dist-client/pages/tax-invoice/tax-invoice-detail-popup.js.map +1 -1
  9. package/dist-client/pages/tax-invoice/tax-invoice-list-page.d.ts +63 -23
  10. package/dist-client/pages/tax-invoice/tax-invoice-list-page.js +149 -168
  11. package/dist-client/pages/tax-invoice/tax-invoice-list-page.js.map +1 -1
  12. package/dist-client/pages/tax-invoice-api/tax-invoice-api-page.d.ts +1 -1
  13. package/dist-client/pages/tax-invoice-api/tax-invoice-api-page.js +6 -5
  14. package/dist-client/pages/tax-invoice-api/tax-invoice-api-page.js.map +1 -1
  15. package/dist-client/pages/tax-invoice-company/tax-invoice-company-importer.js +2 -2
  16. package/dist-client/pages/tax-invoice-company/tax-invoice-company-importer.js.map +1 -1
  17. package/dist-client/pages/tax-invoice-send/tax-invoice-send-page.d.ts +100 -0
  18. package/dist-client/pages/tax-invoice-send/tax-invoice-send-page.js +510 -0
  19. package/dist-client/pages/tax-invoice-send/tax-invoice-send-page.js.map +1 -0
  20. package/dist-client/route.d.ts +1 -1
  21. package/dist-client/route.js +3 -3
  22. package/dist-client/route.js.map +1 -1
  23. package/dist-client/tsconfig.tsbuildinfo +1 -1
  24. package/dist-server/service/tax-invoice/tax-invoice-mutation.js +132 -27
  25. package/dist-server/service/tax-invoice/tax-invoice-mutation.js.map +1 -1
  26. package/dist-server/service/tax-invoice/tax-invoice-query.js +24 -1
  27. package/dist-server/service/tax-invoice/tax-invoice-query.js.map +1 -1
  28. package/dist-server/service/tax-invoice/tax-invoice-type.js +22 -259
  29. package/dist-server/service/tax-invoice/tax-invoice-type.js.map +1 -1
  30. package/dist-server/service/tax-invoice/tax-invoice.js +22 -16
  31. package/dist-server/service/tax-invoice/tax-invoice.js.map +1 -1
  32. package/dist-server/service/tax-invoice-api/tax-invoice-api-type.js +5 -0
  33. package/dist-server/service/tax-invoice-api/tax-invoice-api-type.js.map +1 -1
  34. package/dist-server/service/tax-invoice-item/tax-invoice-item-query.js.map +1 -1
  35. package/dist-server/service/tax-invoice-item/tax-invoice-item-type.js +4 -4
  36. package/dist-server/service/tax-invoice-item/tax-invoice-item-type.js.map +1 -1
  37. package/dist-server/service/tax-invoice-item/tax-invoice-item.js +3 -3
  38. package/dist-server/service/tax-invoice-item/tax-invoice-item.js.map +1 -1
  39. package/dist-server/service/unipost-api/tax-invoice-inquiry.js +90 -0
  40. package/dist-server/service/unipost-api/tax-invoice-inquiry.js.map +1 -0
  41. package/dist-server/tsconfig.tsbuildinfo +1 -1
  42. package/package.json +5 -5
  43. package/server/service/tax-invoice/tax-invoice-mutation.ts +137 -36
  44. package/server/service/tax-invoice/tax-invoice-query.ts +21 -3
  45. package/server/service/tax-invoice/tax-invoice-type.ts +21 -199
  46. package/server/service/tax-invoice/tax-invoice.ts +38 -45
  47. package/server/service/tax-invoice-api/tax-invoice-api-type.ts +4 -0
  48. package/server/service/tax-invoice-item/tax-invoice-item-query.ts +1 -1
  49. package/server/service/tax-invoice-item/tax-invoice-item-type.ts +4 -7
  50. package/server/service/tax-invoice-item/tax-invoice-item.ts +3 -3
  51. package/server/service/unipost-api/tax-invoice-inquiry.ts +103 -0
  52. package/translations/ko.json +10 -1
@@ -1,4 +1,4 @@
1
- import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx, Directive } from 'type-graphql'
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: '공급년월일(YYYYMMDD)' })
13
- supplyDate: string
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: '공급년월일(YYYYMMDD)' })
46
- supplyDate: string
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: '공급년월일(YYYYMMDD)' })
36
- @Field({ nullable: false, description: '공급년월일(YYYYMMDD)' })
37
- supplyDate!: string
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: '품목명' })
@@ -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
+ }
@@ -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
  }