@things-factory/tax-invoice 8.0.74 → 8.0.78

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/tax-invoice",
3
- "version": "8.0.74",
3
+ "version": "8.0.78",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "dist-client/index.js",
6
6
  "things-factory": true,
@@ -29,10 +29,10 @@
29
29
  "dependencies": {
30
30
  "@operato/graphql": "^8.0.0",
31
31
  "@operato/shell": "^8.0.0",
32
- "@things-factory/auth-base": "^8.0.74",
32
+ "@things-factory/auth-base": "^8.0.75",
33
33
  "@things-factory/env": "^8.0.64",
34
34
  "@things-factory/export-ui-excel": "^8.0.64",
35
35
  "@things-factory/shell": "^8.0.64"
36
36
  },
37
- "gitHead": "52ffc383d8baed71dd99a2bc85f4253b3fe69977"
37
+ "gitHead": "28d6bf42a06e7b00b158199fbafe81c6ca54981f"
38
38
  }
@@ -99,10 +99,14 @@ export class TaxInvoiceQuery {
99
99
 
100
100
  @FieldResolver(type => Boolean)
101
101
  async isMatched(@Root() taxInvoice: TaxInvoice): Promise<boolean> {
102
- const binding = await getRepository('tax_invoice_binding').findOne({
103
- where: { taxInvoice: { id: taxInvoice.id } }
104
- })
105
-
106
- return !!binding
102
+ try {
103
+ const binding = await getRepository('tax_invoice_binding').findOne({
104
+ where: { taxInvoice: { id: taxInvoice.id } }
105
+ })
106
+
107
+ return !!binding
108
+ } catch (e) {
109
+ return false
110
+ }
107
111
  }
108
112
  }
@@ -64,7 +64,14 @@ export async function getTaxInvoiceByUniposApi(businessRegistrationNumber: strin
64
64
  }
65
65
  }
66
66
 
67
- async function _callTaxInvoiceInquiry(businessRegistrationNumber: string, aid: string, bearer: string, taxType: UnipostTaxType) {
67
+ async function _callTaxInvoiceInquiry(
68
+ businessRegistrationNumber: string,
69
+ aid: string,
70
+ bearer: string,
71
+ taxType: UnipostTaxType
72
+ ) {
73
+ businessRegistrationNumber = businessRegistrationNumber.replace(/-/g, '')
74
+
68
75
  const response = await fetch(INQUIRY_URL, {
69
76
  method: 'POST',
70
77
  headers: {
@@ -83,7 +90,14 @@ async function _callTaxInvoiceInquiry(businessRegistrationNumber: string, aid: s
83
90
 
84
91
  return response
85
92
  }
86
- export async function callTaxInvoiceConfirm(businessRegistrationNumber: string, aid: string, bearer: string, confirmData: ConfirmData[]) {
93
+ export async function callTaxInvoiceConfirm(
94
+ businessRegistrationNumber: string,
95
+ aid: string,
96
+ bearer: string,
97
+ confirmData: ConfirmData[]
98
+ ) {
99
+ businessRegistrationNumber = businessRegistrationNumber.replace(/-/g, '')
100
+
87
101
  const response = await fetch(CONFIRM_URL, {
88
102
  method: 'POST',
89
103
  headers: {
@@ -4,7 +4,12 @@ const UNITAX_CONFIG = config.get('unitax', {})
4
4
  // 세금계산서 발행 API
5
5
  const SEND_URL = UNITAX_CONFIG.SEND_URL || ''
6
6
 
7
- export async function sendTaxInvoiceByUniposApi(businessRegistrationNumber: string, aid: string, bearer: string, taxInvoiceSendList) {
7
+ export async function sendTaxInvoiceByUniposApi(
8
+ businessRegistrationNumber: string,
9
+ aid: string,
10
+ bearer: string,
11
+ taxInvoiceSendList
12
+ ) {
8
13
  if (!businessRegistrationNumber || !aid || !bearer || !taxInvoiceSendList) {
9
14
  throw new Error('no parameter in unipos api')
10
15
  }
@@ -14,7 +19,14 @@ export async function sendTaxInvoiceByUniposApi(businessRegistrationNumber: stri
14
19
  return response?.status === 200 ? await response.json() : false
15
20
  }
16
21
 
17
- async function _callTaxInvoiceSend(businessRegistrationNumber: string, aid: string, bearer: string, taxInvoiceSendList) {
22
+ async function _callTaxInvoiceSend(
23
+ businessRegistrationNumber: string,
24
+ aid: string,
25
+ bearer: string,
26
+ taxInvoiceSendList
27
+ ) {
28
+ businessRegistrationNumber = businessRegistrationNumber.replace(/-/g, '')
29
+
18
30
  try {
19
31
  return await fetch(SEND_URL, {
20
32
  method: 'POST',