@things-factory/tax-invoice 7.0.0-alpha.1 → 7.0.0-alpha.19
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 +13 -1
- package/client/pages/tax-invoice/tax-invoice-list-page.ts +58 -37
- package/client/pages/tax-invoice-api/tax-invoice-api-page.ts +53 -78
- package/client/pages/tax-invoice-company/tax-invoice-company-list-page.ts +2 -67
- package/client/pages/{tax-invoice-company/tax-invoice-company-importer.ts → tax-invoice-send/company-list-popup.ts} +60 -46
- package/client/pages/tax-invoice-send/tax-invoice-send-page.ts +1001 -0
- package/client/route.ts +1 -1
- package/config/config.development.js +13 -0
- package/config/config.production.js +13 -0
- package/dist-client/pages/tax-invoice/tax-invoice-detail-popup.js +13 -1
- 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 +20 -6
- package/dist-client/pages/tax-invoice/tax-invoice-list-page.js +56 -35
- 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 -2
- package/dist-client/pages/tax-invoice-api/tax-invoice-api-page.js +49 -73
- 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-list-page.d.ts +0 -16
- package/dist-client/pages/tax-invoice-company/tax-invoice-company-list-page.js +3 -62
- package/dist-client/pages/tax-invoice-company/tax-invoice-company-list-page.js.map +1 -1
- package/dist-client/pages/tax-invoice-send/company-list-popup.d.ts +65 -0
- package/dist-client/pages/{tax-invoice-company/tax-invoice-company-importer.js → tax-invoice-send/company-list-popup.js} +66 -49
- package/dist-client/pages/tax-invoice-send/company-list-popup.js.map +1 -0
- package/dist-client/pages/tax-invoice-send/tax-invoice-send-page.d.ts +112 -0
- package/dist-client/pages/tax-invoice-send/tax-invoice-send-page.js +904 -0
- package/dist-client/pages/tax-invoice-send/tax-invoice-send-page.js.map +1 -0
- package/dist-client/route.js +1 -1
- 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 +10 -88
- package/dist-server/service/tax-invoice/tax-invoice-mutation.js.map +1 -1
- package/dist-server/service/tax-invoice/tax-invoice-query.js +23 -0
- package/dist-server/service/tax-invoice/tax-invoice-query.js.map +1 -1
- package/dist-server/service/tax-invoice/tax-invoice-type.js +14 -3
- package/dist-server/service/tax-invoice/tax-invoice-type.js.map +1 -1
- package/dist-server/service/tax-invoice/tax-invoice-util.js +93 -0
- package/dist-server/service/tax-invoice/tax-invoice-util.js.map +1 -0
- package/dist-server/service/tax-invoice/tax-invoice.js +7 -7
- package/dist-server/service/tax-invoice/tax-invoice.js.map +1 -1
- package/dist-server/service/tax-invoice-api/tax-invoice-api-mutation.js +168 -5
- package/dist-server/service/tax-invoice-api/tax-invoice-api-mutation.js.map +1 -1
- package/dist-server/service/tax-invoice-api/tax-invoice-api-query.js +2 -17
- package/dist-server/service/tax-invoice-api/tax-invoice-api-query.js.map +1 -1
- package/dist-server/service/tax-invoice-api/tax-invoice-api-type.js +20 -8
- 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 +8 -14
- package/dist-server/service/tax-invoice-api/tax-invoice-api.js.map +1 -1
- package/dist-server/service/tax-invoice-company/tax-invoice-company-query.js +41 -6
- package/dist-server/service/tax-invoice-company/tax-invoice-company-query.js.map +1 -1
- package/dist-server/service/tax-invoice-company/tax-invoice-company-type.js +55 -5
- package/dist-server/service/tax-invoice-company/tax-invoice-company-type.js.map +1 -1
- package/dist-server/service/tax-invoice-company/tax-invoice-company.js +1 -19
- package/dist-server/service/tax-invoice-company/tax-invoice-company.js.map +1 -1
- package/dist-server/service/tax-invoice-item/tax-invoice-item-type.js +2 -2
- package/dist-server/service/tax-invoice-item/tax-invoice-item-type.js.map +1 -1
- package/dist-server/service/unipost-api/tax-invoice-inquiry.js +11 -15
- package/dist-server/service/unipost-api/tax-invoice-inquiry.js.map +1 -1
- package/dist-server/service/unipost-api/tax-invoice-send.js +33 -0
- package/dist-server/service/unipost-api/tax-invoice-send.js.map +1 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -5
- package/server/service/tax-invoice/tax-invoice-mutation.ts +10 -89
- package/server/service/tax-invoice/tax-invoice-query.ts +20 -2
- package/server/service/tax-invoice/tax-invoice-type.ts +14 -2
- package/server/service/tax-invoice/tax-invoice-util.ts +223 -0
- package/server/service/tax-invoice/tax-invoice.ts +21 -21
- package/server/service/tax-invoice-api/tax-invoice-api-mutation.ts +188 -5
- package/server/service/tax-invoice-api/tax-invoice-api-query.ts +4 -15
- package/server/service/tax-invoice-api/tax-invoice-api-type.ts +13 -5
- package/server/service/tax-invoice-api/tax-invoice-api.ts +8 -26
- package/server/service/tax-invoice-company/tax-invoice-company-query.ts +35 -5
- package/server/service/tax-invoice-company/tax-invoice-company-type.ts +40 -4
- package/server/service/tax-invoice-company/tax-invoice-company.ts +0 -18
- package/server/service/tax-invoice-item/tax-invoice-item-type.ts +2 -2
- package/server/service/unipost-api/tax-invoice-inquiry.ts +11 -15
- package/server/service/unipost-api/tax-invoice-send.ts +32 -0
- package/translations/ko.json +9 -1
- package/dist-client/pages/tax-invoice-company/tax-invoice-company-importer.d.ts +0 -31
- package/dist-client/pages/tax-invoice-company/tax-invoice-company-importer.js.map +0 -1
|
@@ -66,10 +66,15 @@ export class TaxInvoiceDetailPopup extends localize(i18next)(LitElement) {
|
|
|
66
66
|
td,
|
|
67
67
|
th {
|
|
68
68
|
padding: 5px;
|
|
69
|
+
min-width: 60px;
|
|
70
|
+
}
|
|
71
|
+
td {
|
|
72
|
+
padding-left: 8px;
|
|
69
73
|
}
|
|
70
74
|
th.target {
|
|
71
75
|
width: 25px;
|
|
72
76
|
writing-mode: vertical-rl;
|
|
77
|
+
min-width: unset;
|
|
73
78
|
}
|
|
74
79
|
|
|
75
80
|
&.supplier {
|
|
@@ -149,7 +154,7 @@ export class TaxInvoiceDetailPopup extends localize(i18next)(LitElement) {
|
|
|
149
154
|
<table>
|
|
150
155
|
<tr>
|
|
151
156
|
<th>${i18next.t('field.approval no')}</th>
|
|
152
|
-
<td>${this.detail?.approvalNo?.replace(/(\
|
|
157
|
+
<td>${this.detail?.approvalNo?.replace(/(\S{8})(\S{8})(\S{8})/g, '$1-$2-$3')}</td>
|
|
153
158
|
</tr>
|
|
154
159
|
</table>
|
|
155
160
|
</div>
|
|
@@ -196,6 +201,13 @@ export class TaxInvoiceDetailPopup extends localize(i18next)(LitElement) {
|
|
|
196
201
|
</table>
|
|
197
202
|
|
|
198
203
|
<table class="buyer">
|
|
204
|
+
<colgroup>
|
|
205
|
+
<col width="150px" />
|
|
206
|
+
<col width="18%" />
|
|
207
|
+
<col width="32%" />
|
|
208
|
+
<col width="18%" />
|
|
209
|
+
<col width="32%" />
|
|
210
|
+
</colgroup>
|
|
199
211
|
<tr>
|
|
200
212
|
<th rowspan="6" class="target">${i18next.t('field.tax invoice buyer')}</th>
|
|
201
213
|
<th>${i18next.t('field.short business registration number')}</th>
|
|
@@ -16,9 +16,9 @@ import gql from 'graphql-tag'
|
|
|
16
16
|
import './tax-invoice-detail-popup'
|
|
17
17
|
|
|
18
18
|
export enum Category {
|
|
19
|
-
EXPORT = '10',
|
|
20
|
-
IMPORT = '20',
|
|
21
|
-
NTS = '30'
|
|
19
|
+
EXPORT = '10',
|
|
20
|
+
IMPORT = '20',
|
|
21
|
+
NTS = '30'
|
|
22
22
|
}
|
|
23
23
|
export const CATEGORY = {
|
|
24
24
|
[Category.EXPORT]: '매출',
|
|
@@ -44,26 +44,41 @@ export enum InvoiceType {
|
|
|
44
44
|
'REVISED_IMPORT_INVOICE' = '0404'
|
|
45
45
|
}
|
|
46
46
|
export const INVOICE_TYPE = {
|
|
47
|
-
[InvoiceType.TAX_INVOICE]: '일반
|
|
48
|
-
[InvoiceType.SMALL_BUSINESS_TAX_INVOICE]: '영세율
|
|
49
|
-
[InvoiceType.CONSIGNMENT_TAX_INVOICE]: '위수탁
|
|
50
|
-
[InvoiceType.SMALL_BUSINESS_CONSIGNMENT_TAX_INVOICE]: '영세율 위수탁
|
|
51
|
-
[InvoiceType.REVISED_TAX_INVOICE]: '수정 일반
|
|
52
|
-
[InvoiceType.REVISED_SMALL_BUSINESS_TAX_INVOICE]: '수정 영세율
|
|
53
|
-
[InvoiceType.REVISED_CONSIGNMENT_TAX_INVOICE]: '수정 위수탁
|
|
54
|
-
[InvoiceType.REVISED_IMPORT_TAX_INVOICE]: '수정 수입
|
|
55
|
-
[InvoiceType.REVISED_SMALL_BUSINESS_CONSIGNMENT_TAX_INVOICE]: '수정 영세율 위수탁
|
|
56
|
-
[InvoiceType.INVOICE]: '일반
|
|
57
|
-
[InvoiceType.CONSIGNMENT_INVOICE]: '위수탁
|
|
58
|
-
[InvoiceType.IMPORT_INVOICE]: '수입
|
|
59
|
-
[InvoiceType.REVISED_INVOICE]: '수정 일반
|
|
60
|
-
[InvoiceType.REVISED_CONSIGNMENT_INVOICE]: '수정 위수탁
|
|
61
|
-
[InvoiceType.REVISED_IMPORT_INVOICE]: '수정 수입
|
|
47
|
+
[InvoiceType.TAX_INVOICE]: '일반 전자세금계산서',
|
|
48
|
+
[InvoiceType.SMALL_BUSINESS_TAX_INVOICE]: '영세율 전자세금계산서',
|
|
49
|
+
[InvoiceType.CONSIGNMENT_TAX_INVOICE]: '위수탁 전자세금계산서',
|
|
50
|
+
[InvoiceType.SMALL_BUSINESS_CONSIGNMENT_TAX_INVOICE]: '영세율 위수탁 전자세금계산서',
|
|
51
|
+
[InvoiceType.REVISED_TAX_INVOICE]: '수정 일반 전자세금계산서',
|
|
52
|
+
[InvoiceType.REVISED_SMALL_BUSINESS_TAX_INVOICE]: '수정 영세율 전자세금계산서',
|
|
53
|
+
[InvoiceType.REVISED_CONSIGNMENT_TAX_INVOICE]: '수정 위수탁 전자세금계산서',
|
|
54
|
+
[InvoiceType.REVISED_IMPORT_TAX_INVOICE]: '수정 수입 전자세금계산서',
|
|
55
|
+
[InvoiceType.REVISED_SMALL_BUSINESS_CONSIGNMENT_TAX_INVOICE]: '수정 영세율 위수탁 전자세금계산서',
|
|
56
|
+
[InvoiceType.INVOICE]: '일반 전자계산서',
|
|
57
|
+
[InvoiceType.CONSIGNMENT_INVOICE]: '위수탁 전자계산서',
|
|
58
|
+
[InvoiceType.IMPORT_INVOICE]: '수입 전자계산서',
|
|
59
|
+
[InvoiceType.REVISED_INVOICE]: '수정 일반 전자계산서',
|
|
60
|
+
[InvoiceType.REVISED_CONSIGNMENT_INVOICE]: '수정 위수탁 전자계산서',
|
|
61
|
+
[InvoiceType.REVISED_IMPORT_INVOICE]: '수정 수입 전자계산서'
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
+
export enum Purpose {
|
|
65
|
+
RECEIPT = '01',
|
|
66
|
+
INVOICE = '02'
|
|
67
|
+
}
|
|
64
68
|
export const PURPOSE = {
|
|
65
|
-
|
|
66
|
-
|
|
69
|
+
[Purpose.RECEIPT]: '영수',
|
|
70
|
+
[Purpose.INVOICE]: '청구'
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export enum BusinessRegistrationCategory {
|
|
74
|
+
BUSINESS_REGISTRATION_NUMBER = '01', // 사업자등록번호
|
|
75
|
+
RESIDENT_REGISTRATION_NUMBER = '02', // 주민등록번호
|
|
76
|
+
FOREIGNER_REGISTRATION_NUMBER = '03' // 외국인등록번호
|
|
77
|
+
}
|
|
78
|
+
export const BUSINESS_REGISTRATION_CATEGORY = {
|
|
79
|
+
[BusinessRegistrationCategory.BUSINESS_REGISTRATION_NUMBER]: '사업자등록번호',
|
|
80
|
+
[BusinessRegistrationCategory.RESIDENT_REGISTRATION_NUMBER]: '주민등록번호',
|
|
81
|
+
[BusinessRegistrationCategory.FOREIGNER_REGISTRATION_NUMBER]: '외국인'
|
|
67
82
|
}
|
|
68
83
|
|
|
69
84
|
@customElement('tax-invoice-list-page')
|
|
@@ -97,6 +112,7 @@ export class TaxInvoiceListPage extends localize(i18next)(ScopedElementsMixin(Pa
|
|
|
97
112
|
align-items: center;
|
|
98
113
|
justify-content: center;
|
|
99
114
|
height: 35px;
|
|
115
|
+
font-weight: bold;
|
|
100
116
|
}
|
|
101
117
|
span.value {
|
|
102
118
|
padding-left: 10px;
|
|
@@ -109,7 +125,7 @@ export class TaxInvoiceListPage extends localize(i18next)(ScopedElementsMixin(Pa
|
|
|
109
125
|
]
|
|
110
126
|
|
|
111
127
|
@property({ type: Object }) gristConfig: any
|
|
112
|
-
@state() summary: {
|
|
128
|
+
@state() summary: { cnt: number; total_amount: number; supply_amount: number; tax_amount: number } | null = null
|
|
113
129
|
|
|
114
130
|
@query('ox-grist') private grist!: DataGrist
|
|
115
131
|
|
|
@@ -134,17 +150,18 @@ export class TaxInvoiceListPage extends localize(i18next)(ScopedElementsMixin(Pa
|
|
|
134
150
|
|
|
135
151
|
render() {
|
|
136
152
|
const mode = 'GRID'
|
|
153
|
+
const summary = this.summary
|
|
137
154
|
|
|
138
155
|
return html`
|
|
139
156
|
<div class="summary">
|
|
140
157
|
<span class="title">${i18next.t('field.summary total count')}</span>
|
|
141
|
-
<span class="value">${this._numberFormat(
|
|
158
|
+
<span class="value">${this._numberFormat(summary?.cnt)}</span>
|
|
142
159
|
<span class="title">${i18next.t('field.summary total amount')}</span>
|
|
143
|
-
<span class="value">${this._numberFormat(
|
|
160
|
+
<span class="value">${this._numberFormat(summary?.total_amount)}</span>
|
|
144
161
|
<span class="title">${i18next.t('field.summary supply amount')}</span>
|
|
145
|
-
<span class="value">${this._numberFormat(
|
|
162
|
+
<span class="value">${this._numberFormat(summary?.supply_amount)}</span>
|
|
146
163
|
<span class="title">${i18next.t('field.summary tax amount')}</span>
|
|
147
|
-
<span class="value">${this._numberFormat(
|
|
164
|
+
<span class="value">${this._numberFormat(summary?.tax_amount)}</span>
|
|
148
165
|
</div>
|
|
149
166
|
|
|
150
167
|
<ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
|
|
@@ -199,6 +216,10 @@ export class TaxInvoiceListPage extends localize(i18next)(ScopedElementsMixin(Pa
|
|
|
199
216
|
type: 'select',
|
|
200
217
|
value: Category.EXPORT,
|
|
201
218
|
options: () => [
|
|
219
|
+
{
|
|
220
|
+
display: '전체',
|
|
221
|
+
value: ''
|
|
222
|
+
},
|
|
202
223
|
{
|
|
203
224
|
display: '매출',
|
|
204
225
|
value: Category.EXPORT
|
|
@@ -297,7 +318,7 @@ export class TaxInvoiceListPage extends localize(i18next)(ScopedElementsMixin(Pa
|
|
|
297
318
|
header: i18next.t('field.approval no'),
|
|
298
319
|
record: {
|
|
299
320
|
align: 'center',
|
|
300
|
-
renderer: value => value.replace(/(\
|
|
321
|
+
renderer: value => value.replace(/(\S{8})(\S{8})(\S{8})/g, '$1-$2-$3')
|
|
301
322
|
},
|
|
302
323
|
width: 200
|
|
303
324
|
},
|
|
@@ -381,8 +402,8 @@ export class TaxInvoiceListPage extends localize(i18next)(ScopedElementsMixin(Pa
|
|
|
381
402
|
async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }: FetchOption) {
|
|
382
403
|
const response = await client.query({
|
|
383
404
|
query: gql`
|
|
384
|
-
query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
|
|
385
|
-
|
|
405
|
+
query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!], $summaryFilters: [Filter!]) {
|
|
406
|
+
taxInvoices(filters: $filters, pagination: $pagination, sortings: $sortings) {
|
|
386
407
|
items {
|
|
387
408
|
id
|
|
388
409
|
memo
|
|
@@ -410,25 +431,25 @@ export class TaxInvoiceListPage extends localize(i18next)(ScopedElementsMixin(Pa
|
|
|
410
431
|
}
|
|
411
432
|
total
|
|
412
433
|
}
|
|
434
|
+
taxInvoicesSummary(filters: $summaryFilters) {
|
|
435
|
+
summary
|
|
436
|
+
}
|
|
413
437
|
}
|
|
414
438
|
`,
|
|
415
439
|
variables: {
|
|
416
440
|
filters,
|
|
417
441
|
pagination: { page, limit },
|
|
418
|
-
sortings
|
|
442
|
+
sortings,
|
|
443
|
+
summaryFilters: filters
|
|
419
444
|
}
|
|
420
445
|
})
|
|
421
446
|
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
supply: response.data.responses.total || 0,
|
|
425
|
-
tax: response.data.responses.total || 0,
|
|
426
|
-
total: response.data.responses.total || 0
|
|
427
|
-
}
|
|
447
|
+
// 합계 필드 갱신
|
|
448
|
+
this.summary = response.data.taxInvoicesSummary.summary
|
|
428
449
|
|
|
429
450
|
return {
|
|
430
|
-
total: response.data.
|
|
431
|
-
records: response.data.
|
|
451
|
+
total: response.data.taxInvoices.total || 0,
|
|
452
|
+
records: response.data.taxInvoices.items || []
|
|
432
453
|
}
|
|
433
454
|
}
|
|
434
455
|
|
|
@@ -9,9 +9,9 @@ import { DataGrist, FetchOption } from '@operato/data-grist'
|
|
|
9
9
|
import { client } from '@operato/graphql'
|
|
10
10
|
import { i18next, localize } from '@operato/i18n'
|
|
11
11
|
import { notify } from '@operato/layout'
|
|
12
|
-
import { OxPrompt } from '@operato/popup'
|
|
13
12
|
import { isMobileDevice } from '@operato/utils'
|
|
14
13
|
import gql from 'graphql-tag'
|
|
14
|
+
import { OxPrompt } from '@operato/popup'
|
|
15
15
|
|
|
16
16
|
@customElement('tax-invoice-api-page')
|
|
17
17
|
export class TaxInvoiceApiPage extends localize(i18next)(ScopedElementsMixin(PageView)) {
|
|
@@ -27,6 +27,10 @@ export class TaxInvoiceApiPage extends localize(i18next)(ScopedElementsMixin(Pag
|
|
|
27
27
|
--grid-record-emphasized-background-color: red;
|
|
28
28
|
--grid-record-emphasized-color: yellow;
|
|
29
29
|
}
|
|
30
|
+
|
|
31
|
+
ox-grist {
|
|
32
|
+
margin-top: 15px;
|
|
33
|
+
}
|
|
30
34
|
`
|
|
31
35
|
]
|
|
32
36
|
|
|
@@ -47,7 +51,7 @@ export class TaxInvoiceApiPage extends localize(i18next)(ScopedElementsMixin(Pag
|
|
|
47
51
|
},
|
|
48
52
|
{
|
|
49
53
|
title: i18next.t('button.delete'),
|
|
50
|
-
action: this.
|
|
54
|
+
action: this._deleteTaxAuditResult.bind(this),
|
|
51
55
|
...CommonButtonStyles.delete
|
|
52
56
|
}
|
|
53
57
|
]
|
|
@@ -57,15 +61,7 @@ export class TaxInvoiceApiPage extends localize(i18next)(ScopedElementsMixin(Pag
|
|
|
57
61
|
render() {
|
|
58
62
|
const mode = this.mode || (isMobileDevice() ? 'CARD' : 'GRID')
|
|
59
63
|
|
|
60
|
-
return html`
|
|
61
|
-
<ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
|
|
62
|
-
<div slot="headroom">
|
|
63
|
-
<div id="filters">
|
|
64
|
-
<ox-filters-form autofocus></ox-filters-form>
|
|
65
|
-
</div>
|
|
66
|
-
</div>
|
|
67
|
-
</ox-grist>
|
|
68
|
-
`
|
|
64
|
+
return html` <ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}> </ox-grist> `
|
|
69
65
|
}
|
|
70
66
|
|
|
71
67
|
async pageInitialized(lifecycle: any) {
|
|
@@ -78,26 +74,23 @@ export class TaxInvoiceApiPage extends localize(i18next)(ScopedElementsMixin(Pag
|
|
|
78
74
|
{ type: 'gutter', gutterName: 'sequence' },
|
|
79
75
|
{ type: 'gutter', gutterName: 'row-selector', multiple: true },
|
|
80
76
|
{
|
|
81
|
-
type: '
|
|
82
|
-
name: '
|
|
83
|
-
header: i18next.t('field.
|
|
77
|
+
type: 'boolean',
|
|
78
|
+
name: 'isDefault',
|
|
79
|
+
header: i18next.t('field.is_default'),
|
|
84
80
|
record: {
|
|
85
81
|
editable: true,
|
|
86
|
-
|
|
82
|
+
align: 'center'
|
|
87
83
|
},
|
|
88
|
-
|
|
89
|
-
sortable: true,
|
|
90
|
-
width: 150
|
|
84
|
+
width: 70
|
|
91
85
|
},
|
|
92
86
|
{
|
|
93
87
|
type: 'string',
|
|
94
|
-
name: '
|
|
95
|
-
header: i18next.t('field.
|
|
88
|
+
name: 'provider',
|
|
89
|
+
header: i18next.t('field.provider'),
|
|
96
90
|
record: {
|
|
97
91
|
editable: true
|
|
98
92
|
},
|
|
99
|
-
|
|
100
|
-
width: 200
|
|
93
|
+
width: 150
|
|
101
94
|
},
|
|
102
95
|
{
|
|
103
96
|
type: 'string',
|
|
@@ -130,9 +123,7 @@ export class TaxInvoiceApiPage extends localize(i18next)(ScopedElementsMixin(Pag
|
|
|
130
123
|
type: 'string',
|
|
131
124
|
name: 'businessRegistrationNumber',
|
|
132
125
|
header: i18next.t('field.business registration number'),
|
|
133
|
-
record: {
|
|
134
|
-
editable: true
|
|
135
|
-
},
|
|
126
|
+
record: { editable: true },
|
|
136
127
|
width: 150
|
|
137
128
|
},
|
|
138
129
|
{
|
|
@@ -267,26 +258,10 @@ export class TaxInvoiceApiPage extends localize(i18next)(ScopedElementsMixin(Pag
|
|
|
267
258
|
},
|
|
268
259
|
width: 180
|
|
269
260
|
}
|
|
270
|
-
],
|
|
271
|
-
rows: {
|
|
272
|
-
selectable: {
|
|
273
|
-
multiple: true
|
|
274
|
-
}
|
|
275
|
-
},
|
|
276
|
-
sorters: [
|
|
277
|
-
{
|
|
278
|
-
name: 'name'
|
|
279
|
-
}
|
|
280
261
|
]
|
|
281
262
|
}
|
|
282
263
|
}
|
|
283
264
|
|
|
284
|
-
async pageUpdated(changes: any, lifecycle: any) {
|
|
285
|
-
if (this.active) {
|
|
286
|
-
this.grist.fetch()
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
|
|
290
265
|
async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }: FetchOption) {
|
|
291
266
|
const response = await client.query({
|
|
292
267
|
query: gql`
|
|
@@ -294,8 +269,8 @@ export class TaxInvoiceApiPage extends localize(i18next)(ScopedElementsMixin(Pag
|
|
|
294
269
|
responses: taxInvoiceApis(filters: $filters, pagination: $pagination, sortings: $sortings) {
|
|
295
270
|
items {
|
|
296
271
|
id
|
|
297
|
-
|
|
298
|
-
|
|
272
|
+
isDefault
|
|
273
|
+
provider
|
|
299
274
|
apiKey
|
|
300
275
|
apiAccountId
|
|
301
276
|
apiAccountPassword
|
|
@@ -335,38 +310,6 @@ export class TaxInvoiceApiPage extends localize(i18next)(ScopedElementsMixin(Pag
|
|
|
335
310
|
}
|
|
336
311
|
}
|
|
337
312
|
|
|
338
|
-
async _deleteTaxInvoiceApi() {
|
|
339
|
-
if (
|
|
340
|
-
await OxPrompt.open({
|
|
341
|
-
title: i18next.t('text.are_you_sure'),
|
|
342
|
-
text: i18next.t('text.sure_to_x', { x: i18next.t('text.delete') }),
|
|
343
|
-
confirmButton: { text: i18next.t('button.confirm') },
|
|
344
|
-
cancelButton: { text: i18next.t('button.cancel') }
|
|
345
|
-
})
|
|
346
|
-
) {
|
|
347
|
-
const ids = this.grist.selected.map(record => record.id)
|
|
348
|
-
if (ids && ids.length > 0) {
|
|
349
|
-
const response = await client.mutate({
|
|
350
|
-
mutation: gql`
|
|
351
|
-
mutation ($ids: [String!]!) {
|
|
352
|
-
deleteTaxInvoiceApis(ids: $ids)
|
|
353
|
-
}
|
|
354
|
-
`,
|
|
355
|
-
variables: {
|
|
356
|
-
ids
|
|
357
|
-
}
|
|
358
|
-
})
|
|
359
|
-
|
|
360
|
-
if (!response.errors) {
|
|
361
|
-
this.grist.fetch()
|
|
362
|
-
notify({
|
|
363
|
-
message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') })
|
|
364
|
-
})
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
|
|
370
313
|
async _updateTaxInvoiceApi() {
|
|
371
314
|
let patches = this.grist.dirtyRecords
|
|
372
315
|
if (patches && patches.length) {
|
|
@@ -374,7 +317,7 @@ export class TaxInvoiceApiPage extends localize(i18next)(ScopedElementsMixin(Pag
|
|
|
374
317
|
let patchField: any = patch.id ? { id: patch.id } : {}
|
|
375
318
|
const dirtyFields = patch.__dirtyfields__
|
|
376
319
|
for (let key in dirtyFields) {
|
|
377
|
-
patchField[key] =
|
|
320
|
+
patchField[key] = dirtyFields[key].after
|
|
378
321
|
}
|
|
379
322
|
patchField.cuFlag = patch.__dirty__
|
|
380
323
|
|
|
@@ -384,8 +327,8 @@ export class TaxInvoiceApiPage extends localize(i18next)(ScopedElementsMixin(Pag
|
|
|
384
327
|
const response = await client.mutate({
|
|
385
328
|
mutation: gql`
|
|
386
329
|
mutation ($patches: [TaxInvoiceApiPatch!]!) {
|
|
387
|
-
|
|
388
|
-
|
|
330
|
+
updateMultipleTaxInvoiceApi(patches: $patches) {
|
|
331
|
+
provider
|
|
389
332
|
}
|
|
390
333
|
}
|
|
391
334
|
`,
|
|
@@ -426,4 +369,36 @@ export class TaxInvoiceApiPage extends localize(i18next)(ScopedElementsMixin(Pag
|
|
|
426
369
|
|
|
427
370
|
return response.data?.attributeSet || {}
|
|
428
371
|
}
|
|
372
|
+
|
|
373
|
+
async _deleteTaxAuditResult() {
|
|
374
|
+
if (
|
|
375
|
+
await OxPrompt.open({
|
|
376
|
+
title: i18next.t('text.are_you_sure'),
|
|
377
|
+
text: i18next.t('text.sure_to_x', { x: i18next.t('text.delete') }),
|
|
378
|
+
confirmButton: { text: i18next.t('button.confirm') },
|
|
379
|
+
cancelButton: { text: i18next.t('button.cancel') }
|
|
380
|
+
})
|
|
381
|
+
) {
|
|
382
|
+
const ids = this.grist.selected.map(record => record.id)
|
|
383
|
+
if (ids && ids.length > 0) {
|
|
384
|
+
const response = await client.mutate({
|
|
385
|
+
mutation: gql`
|
|
386
|
+
mutation ($ids: [String!]!) {
|
|
387
|
+
deleteTaxInvoiceApis(ids: $ids)
|
|
388
|
+
}
|
|
389
|
+
`,
|
|
390
|
+
variables: {
|
|
391
|
+
ids
|
|
392
|
+
}
|
|
393
|
+
})
|
|
394
|
+
|
|
395
|
+
if (!response.errors) {
|
|
396
|
+
this.grist.fetch()
|
|
397
|
+
notify({
|
|
398
|
+
message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') })
|
|
399
|
+
})
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
}
|
|
429
404
|
}
|
|
@@ -12,16 +12,6 @@ import { notify, openPopup } from '@operato/layout'
|
|
|
12
12
|
import { OxPrompt } from '@operato/popup'
|
|
13
13
|
import { isMobileDevice } from '@operato/utils'
|
|
14
14
|
import gql from 'graphql-tag'
|
|
15
|
-
import { TaxInvoiceCompanyImporter } from './tax-invoice-company-importer'
|
|
16
|
-
|
|
17
|
-
export enum CompanyType {
|
|
18
|
-
SUPPLIER = 10, // 공급자
|
|
19
|
-
BUYER = 20 // 거래처
|
|
20
|
-
}
|
|
21
|
-
export const COMPANY_TYPE_LABEL = {
|
|
22
|
-
[CompanyType.SUPPLIER]: '공급자',
|
|
23
|
-
[CompanyType.BUYER]: '거래처'
|
|
24
|
-
}
|
|
25
15
|
|
|
26
16
|
@customElement('tax-invoice-company-list-page')
|
|
27
17
|
export class TaxInvoiceCompanyListPage extends localize(i18next)(ScopedElementsMixin(PageView)) {
|
|
@@ -40,12 +30,6 @@ export class TaxInvoiceCompanyListPage extends localize(i18next)(ScopedElementsM
|
|
|
40
30
|
`
|
|
41
31
|
]
|
|
42
32
|
|
|
43
|
-
static get scopedElements() {
|
|
44
|
-
return {
|
|
45
|
-
'tax-invoice-company-importer': TaxInvoiceCompanyImporter
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
33
|
@property({ type: Object }) gristConfig: any
|
|
50
34
|
@property({ type: String }) mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'
|
|
51
35
|
|
|
@@ -70,9 +54,6 @@ export class TaxInvoiceCompanyListPage extends localize(i18next)(ScopedElementsM
|
|
|
70
54
|
exportable: {
|
|
71
55
|
name: i18next.t('title.tax invoice company list'),
|
|
72
56
|
data: this.exportHandler.bind(this)
|
|
73
|
-
},
|
|
74
|
-
importable: {
|
|
75
|
-
handler: this.importHandler.bind(this)
|
|
76
57
|
}
|
|
77
58
|
}
|
|
78
59
|
}
|
|
@@ -122,27 +103,6 @@ export class TaxInvoiceCompanyListPage extends localize(i18next)(ScopedElementsM
|
|
|
122
103
|
filter: 'search',
|
|
123
104
|
width: 200
|
|
124
105
|
},
|
|
125
|
-
{
|
|
126
|
-
type: 'select',
|
|
127
|
-
name: 'type',
|
|
128
|
-
header: i18next.t('field.type'),
|
|
129
|
-
record: {
|
|
130
|
-
editable: true,
|
|
131
|
-
classifier: () => ({ emphasized: ['#D1E8FF', '#000'] }),
|
|
132
|
-
options: [
|
|
133
|
-
{},
|
|
134
|
-
{
|
|
135
|
-
display: i18next.t('text.company supplier'),
|
|
136
|
-
value: CompanyType.SUPPLIER
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
display: i18next.t('text.company buyer'),
|
|
140
|
-
value: CompanyType.BUYER
|
|
141
|
-
}
|
|
142
|
-
]
|
|
143
|
-
},
|
|
144
|
-
width: 100
|
|
145
|
-
},
|
|
146
106
|
{
|
|
147
107
|
type: 'string',
|
|
148
108
|
name: 'businessRegistrationNumber',
|
|
@@ -164,7 +124,7 @@ export class TaxInvoiceCompanyListPage extends localize(i18next)(ScopedElementsM
|
|
|
164
124
|
{
|
|
165
125
|
type: 'string',
|
|
166
126
|
name: 'businessName',
|
|
167
|
-
header: i18next.t('field.business name'),
|
|
127
|
+
header: i18next.t('field.tax invoice business name'),
|
|
168
128
|
record: {
|
|
169
129
|
editable: true
|
|
170
130
|
},
|
|
@@ -173,7 +133,7 @@ export class TaxInvoiceCompanyListPage extends localize(i18next)(ScopedElementsM
|
|
|
173
133
|
{
|
|
174
134
|
type: 'string',
|
|
175
135
|
name: 'representativeName',
|
|
176
|
-
header: i18next.t('field.representative name'),
|
|
136
|
+
header: i18next.t('field.tax invoice representative name'),
|
|
177
137
|
record: {
|
|
178
138
|
editable: true
|
|
179
139
|
},
|
|
@@ -313,7 +273,6 @@ export class TaxInvoiceCompanyListPage extends localize(i18next)(ScopedElementsM
|
|
|
313
273
|
id
|
|
314
274
|
name
|
|
315
275
|
description
|
|
316
|
-
type
|
|
317
276
|
businessRegistrationNumber
|
|
318
277
|
branchIdentification
|
|
319
278
|
businessName
|
|
@@ -445,7 +404,6 @@ export class TaxInvoiceCompanyListPage extends localize(i18next)(ScopedElementsM
|
|
|
445
404
|
'id',
|
|
446
405
|
'name',
|
|
447
406
|
'description',
|
|
448
|
-
'type',
|
|
449
407
|
'businessRegistrationNumber',
|
|
450
408
|
'branchIdentification',
|
|
451
409
|
'businessName',
|
|
@@ -470,27 +428,4 @@ export class TaxInvoiceCompanyListPage extends localize(i18next)(ScopedElementsM
|
|
|
470
428
|
return tempObj
|
|
471
429
|
})
|
|
472
430
|
}
|
|
473
|
-
|
|
474
|
-
async importHandler(records) {
|
|
475
|
-
const popup = openPopup(
|
|
476
|
-
html`
|
|
477
|
-
<tax-invoice-company-importer
|
|
478
|
-
.taxInvoiceCompanies=${records}
|
|
479
|
-
@imported=${() => {
|
|
480
|
-
history.back()
|
|
481
|
-
this.grist.fetch()
|
|
482
|
-
}}
|
|
483
|
-
></tax-invoice-company-importer>
|
|
484
|
-
`,
|
|
485
|
-
{
|
|
486
|
-
backdrop: true,
|
|
487
|
-
size: 'large',
|
|
488
|
-
title: i18next.t('title.import tax invoice company')
|
|
489
|
-
}
|
|
490
|
-
)
|
|
491
|
-
|
|
492
|
-
popup.onclosed = () => {
|
|
493
|
-
this.grist.fetch()
|
|
494
|
-
}
|
|
495
|
-
}
|
|
496
431
|
}
|