@things-factory/tax-invoice 6.2.86 → 7.0.0-alpha.1
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 +5 -6
- package/client/pages/tax-invoice/tax-invoice-list-page.ts +119 -169
- 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/route.ts +4 -4
- package/dist-client/pages/tax-invoice/tax-invoice-detail-popup.js +11 -9
- 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 +47 -21
- package/dist-client/pages/tax-invoice/tax-invoice-list-page.js +121 -161
- 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/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 +132 -27
- package/dist-server/service/tax-invoice/tax-invoice-mutation.js.map +1 -1
- package/dist-server/service/tax-invoice/tax-invoice-query.js +1 -1
- package/dist-server/service/tax-invoice/tax-invoice-query.js.map +1 -1
- package/dist-server/service/tax-invoice/tax-invoice-type.js +10 -258
- package/dist-server/service/tax-invoice/tax-invoice-type.js.map +1 -1
- package/dist-server/service/tax-invoice/tax-invoice.js +21 -15
- 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-item/tax-invoice-item-query.js.map +1 -1
- package/dist-server/service/tax-invoice-item/tax-invoice-item-type.js +4 -4
- 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 +3 -3
- 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 +7 -7
- package/server/service/tax-invoice/tax-invoice-mutation.ts +137 -36
- package/server/service/tax-invoice/tax-invoice-query.ts +1 -1
- package/server/service/tax-invoice/tax-invoice-type.ts +9 -199
- package/server/service/tax-invoice/tax-invoice.ts +23 -30
- package/server/service/tax-invoice-api/tax-invoice-api-type.ts +4 -0
- 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 -7
- package/server/service/tax-invoice-item/tax-invoice-item.ts +3 -3
- package/server/service/unipost-api/tax-invoice-inquiry.ts +103 -0
- package/translations/ko.json +9 -1
|
@@ -149,7 +149,7 @@ export class TaxInvoiceDetailPopup extends localize(i18next)(LitElement) {
|
|
|
149
149
|
<table>
|
|
150
150
|
<tr>
|
|
151
151
|
<th>${i18next.t('field.approval no')}</th>
|
|
152
|
-
<td>${this.detail
|
|
152
|
+
<td>${this.detail?.approvalNo?.replace(/(\d{8})(\d{8})(\d{8})/g, '$1-$2-$3')}</td>
|
|
153
153
|
</tr>
|
|
154
154
|
</table>
|
|
155
155
|
</div>
|
|
@@ -168,7 +168,7 @@ export class TaxInvoiceDetailPopup extends localize(i18next)(LitElement) {
|
|
|
168
168
|
<tr>
|
|
169
169
|
<th rowspan="6" class="target">${i18next.t('field.tax invoice supplier')}</th>
|
|
170
170
|
<th>${i18next.t('field.short business registration number')}</th>
|
|
171
|
-
<td>${this.detail
|
|
171
|
+
<td>${this.detail?.supplierBusinessRegistrationNumber?.replace(/(\d{3})(\d{2})(\d{5})/g, '$1-$2-$3')}</td>
|
|
172
172
|
<th>${i18next.t('field.short branch identification')}</th>
|
|
173
173
|
<td>${this.detail.supplierBranchIdentification}</td>
|
|
174
174
|
</tr>
|
|
@@ -199,7 +199,7 @@ export class TaxInvoiceDetailPopup extends localize(i18next)(LitElement) {
|
|
|
199
199
|
<tr>
|
|
200
200
|
<th rowspan="6" class="target">${i18next.t('field.tax invoice buyer')}</th>
|
|
201
201
|
<th>${i18next.t('field.short business registration number')}</th>
|
|
202
|
-
<td>${this.detail
|
|
202
|
+
<td>${this.detail?.buyerBusinessRegistrationNumber?.replace(/(\d{3})(\d{2})(\d{5})/g, '$1-$2-$3')}</td>
|
|
203
203
|
<th>${i18next.t('field.short branch identification')}</th>
|
|
204
204
|
<td>${this.detail.buyerBranchIdentification}</td>
|
|
205
205
|
</tr>
|
|
@@ -247,7 +247,7 @@ export class TaxInvoiceDetailPopup extends localize(i18next)(LitElement) {
|
|
|
247
247
|
<th>${i18next.t('field.remark0')}</th>
|
|
248
248
|
</tr>
|
|
249
249
|
<tr>
|
|
250
|
-
<td>${this.detail.issueDate}</td>
|
|
250
|
+
<td>${this.detail.issueDate?.split('T')[0]}</td>
|
|
251
251
|
<td>${this._numberFormat(this.detail.supplyAmount)}</td>
|
|
252
252
|
<td>${this._numberFormat(this.detail.taxAmount)}</td>
|
|
253
253
|
<td>${this.detail.modificationReason}</td>
|
|
@@ -286,7 +286,7 @@ export class TaxInvoiceDetailPopup extends localize(i18next)(LitElement) {
|
|
|
286
286
|
html`
|
|
287
287
|
<tr>
|
|
288
288
|
<td>${item.supplyDate.split('-')[1]}</td>
|
|
289
|
-
<td>${item.supplyDate.split('-')[2]}</td>
|
|
289
|
+
<td>${item.supplyDate.split('-')[2]?.split('T')[0]}</td>
|
|
290
290
|
<td>${item.itemName}</td>
|
|
291
291
|
<td>${item.specification}</td>
|
|
292
292
|
<td>${item.quantity}</td>
|
|
@@ -344,7 +344,6 @@ export class TaxInvoiceDetailPopup extends localize(i18next)(LitElement) {
|
|
|
344
344
|
query ($id: String!) {
|
|
345
345
|
responses: taxInvoice(id: $id) {
|
|
346
346
|
id
|
|
347
|
-
name
|
|
348
347
|
category
|
|
349
348
|
approvalNo
|
|
350
349
|
originalApprovalNo
|
|
@@ -3,7 +3,7 @@ import '@operato/data-grist'
|
|
|
3
3
|
import { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'
|
|
4
4
|
import { PageView } from '@operato/shell'
|
|
5
5
|
import { css, html } from 'lit'
|
|
6
|
-
import { customElement, property, query } from 'lit/decorators.js'
|
|
6
|
+
import { customElement, property, state, query } from 'lit/decorators.js'
|
|
7
7
|
import { ScopedElementsMixin } from '@open-wc/scoped-elements'
|
|
8
8
|
import { DataGrist, FetchOption } from '@operato/data-grist'
|
|
9
9
|
import { client } from '@operato/graphql'
|
|
@@ -15,28 +15,50 @@ import gql from 'graphql-tag'
|
|
|
15
15
|
|
|
16
16
|
import './tax-invoice-detail-popup'
|
|
17
17
|
|
|
18
|
+
export enum Category {
|
|
19
|
+
EXPORT = '10', // 매출
|
|
20
|
+
IMPORT = '20', // 매입
|
|
21
|
+
NTS = '30' // NTS
|
|
22
|
+
}
|
|
18
23
|
export const CATEGORY = {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
24
|
+
[Category.EXPORT]: '매출',
|
|
25
|
+
[Category.IMPORT]: '매입',
|
|
26
|
+
[Category.NTS]: 'NTS'
|
|
22
27
|
}
|
|
23
28
|
|
|
29
|
+
export enum InvoiceType {
|
|
30
|
+
'TAX_INVOICE' = '0101',
|
|
31
|
+
'SMALL_BUSINESS_TAX_INVOICE' = '0102',
|
|
32
|
+
'CONSIGNMENT_TAX_INVOICE' = '0103',
|
|
33
|
+
'SMALL_BUSINESS_CONSIGNMENT_TAX_INVOICE' = '0105',
|
|
34
|
+
'REVISED_TAX_INVOICE' = '0201',
|
|
35
|
+
'REVISED_SMALL_BUSINESS_TAX_INVOICE' = '0202',
|
|
36
|
+
'REVISED_CONSIGNMENT_TAX_INVOICE' = '0203',
|
|
37
|
+
'REVISED_IMPORT_TAX_INVOICE' = '0204',
|
|
38
|
+
'REVISED_SMALL_BUSINESS_CONSIGNMENT_TAX_INVOICE' = '0205',
|
|
39
|
+
'INVOICE' = '0301',
|
|
40
|
+
'CONSIGNMENT_INVOICE' = '0303',
|
|
41
|
+
'IMPORT_INVOICE' = '0304',
|
|
42
|
+
'REVISED_INVOICE' = '0401',
|
|
43
|
+
'REVISED_CONSIGNMENT_INVOICE' = '0403',
|
|
44
|
+
'REVISED_IMPORT_INVOICE' = '0404'
|
|
45
|
+
}
|
|
24
46
|
export const INVOICE_TYPE = {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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]: '수정 수입 계산서'
|
|
40
62
|
}
|
|
41
63
|
|
|
42
64
|
export const PURPOSE = {
|
|
@@ -52,17 +74,42 @@ export class TaxInvoiceListPage extends localize(i18next)(ScopedElementsMixin(Pa
|
|
|
52
74
|
css`
|
|
53
75
|
:host {
|
|
54
76
|
display: flex;
|
|
77
|
+
flex-direction: column;
|
|
55
78
|
|
|
56
79
|
width: 100%;
|
|
57
80
|
|
|
58
81
|
--grid-record-emphasized-background-color: red;
|
|
59
82
|
--grid-record-emphasized-color: yellow;
|
|
60
83
|
}
|
|
84
|
+
|
|
85
|
+
div.summary {
|
|
86
|
+
display: grid;
|
|
87
|
+
grid-template-columns: 0.7fr 1fr 0.7fr 1fr 0.7fr 1fr 0.7fr 1fr;
|
|
88
|
+
border: solid #d3dbe5;
|
|
89
|
+
border-width: 2px 0;
|
|
90
|
+
margin: 15px 40px;
|
|
91
|
+
align-content: center;
|
|
92
|
+
|
|
93
|
+
span.title {
|
|
94
|
+
background-color: #e9edf6;
|
|
95
|
+
text-align: center;
|
|
96
|
+
display: flex;
|
|
97
|
+
align-items: center;
|
|
98
|
+
justify-content: center;
|
|
99
|
+
height: 35px;
|
|
100
|
+
}
|
|
101
|
+
span.value {
|
|
102
|
+
padding-left: 10px;
|
|
103
|
+
display: flex;
|
|
104
|
+
align-items: center;
|
|
105
|
+
height: 35px;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
61
108
|
`
|
|
62
109
|
]
|
|
63
110
|
|
|
64
111
|
@property({ type: Object }) gristConfig: any
|
|
65
|
-
@
|
|
112
|
+
@state() summary: { count: number; total: number; supply: number; tax: number } | null = null
|
|
66
113
|
|
|
67
114
|
@query('ox-grist') private grist!: DataGrist
|
|
68
115
|
|
|
@@ -72,9 +119,9 @@ export class TaxInvoiceListPage extends localize(i18next)(ScopedElementsMixin(Pa
|
|
|
72
119
|
help: 'tax-invoice/tax-invoice',
|
|
73
120
|
actions: [
|
|
74
121
|
{
|
|
75
|
-
title: i18next.t('button.
|
|
76
|
-
action: this.
|
|
77
|
-
...CommonButtonStyles.
|
|
122
|
+
title: i18next.t('button.memo save'),
|
|
123
|
+
action: this._updateTaxInvoice.bind(this),
|
|
124
|
+
...CommonButtonStyles.save
|
|
78
125
|
}
|
|
79
126
|
],
|
|
80
127
|
exportable: {
|
|
@@ -89,6 +136,17 @@ export class TaxInvoiceListPage extends localize(i18next)(ScopedElementsMixin(Pa
|
|
|
89
136
|
const mode = 'GRID'
|
|
90
137
|
|
|
91
138
|
return html`
|
|
139
|
+
<div class="summary">
|
|
140
|
+
<span class="title">${i18next.t('field.summary total count')}</span>
|
|
141
|
+
<span class="value">${this._numberFormat(this.summary?.count)}</span>
|
|
142
|
+
<span class="title">${i18next.t('field.summary total amount')}</span>
|
|
143
|
+
<span class="value">${this._numberFormat(this.summary?.total)}</span>
|
|
144
|
+
<span class="title">${i18next.t('field.summary supply amount')}</span>
|
|
145
|
+
<span class="value">${this._numberFormat(this.summary?.supply)}</span>
|
|
146
|
+
<span class="title">${i18next.t('field.summary tax amount')}</span>
|
|
147
|
+
<span class="value">${this._numberFormat(this.summary?.tax)}</span>
|
|
148
|
+
</div>
|
|
149
|
+
|
|
92
150
|
<ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
|
|
93
151
|
<div slot="headroom">
|
|
94
152
|
<div id="filters">
|
|
@@ -97,7 +155,6 @@ export class TaxInvoiceListPage extends localize(i18next)(ScopedElementsMixin(Pa
|
|
|
97
155
|
</div>
|
|
98
156
|
</ox-grist>
|
|
99
157
|
`
|
|
100
|
-
// <button @click=${() => this.createTaxInvoice('3')}>생성</button>
|
|
101
158
|
}
|
|
102
159
|
|
|
103
160
|
async pageInitialized(lifecycle: any) {
|
|
@@ -117,8 +174,8 @@ export class TaxInvoiceListPage extends localize(i18next)(ScopedElementsMixin(Pa
|
|
|
117
174
|
},
|
|
118
175
|
{
|
|
119
176
|
type: 'string',
|
|
120
|
-
name: '
|
|
121
|
-
header: i18next.t('field.
|
|
177
|
+
name: 'memo',
|
|
178
|
+
header: i18next.t('field.memo'),
|
|
122
179
|
record: {
|
|
123
180
|
editable: true
|
|
124
181
|
},
|
|
@@ -131,8 +188,27 @@ export class TaxInvoiceListPage extends localize(i18next)(ScopedElementsMixin(Pa
|
|
|
131
188
|
header: i18next.t('field.tax invoice category'),
|
|
132
189
|
record: {
|
|
133
190
|
renderer: value => CATEGORY[value],
|
|
191
|
+
classifier: function (record, rowIndex) {
|
|
192
|
+
return {
|
|
193
|
+
emphasized: record.category === Category.EXPORT ? ['#c6daf6', 'black'] : ['#fedbde', 'black']
|
|
194
|
+
}
|
|
195
|
+
},
|
|
134
196
|
align: 'center'
|
|
135
197
|
},
|
|
198
|
+
filter: {
|
|
199
|
+
type: 'select',
|
|
200
|
+
value: Category.EXPORT,
|
|
201
|
+
options: () => [
|
|
202
|
+
{
|
|
203
|
+
display: '매출',
|
|
204
|
+
value: Category.EXPORT
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
display: '매입',
|
|
208
|
+
value: Category.IMPORT
|
|
209
|
+
}
|
|
210
|
+
]
|
|
211
|
+
},
|
|
136
212
|
width: 80
|
|
137
213
|
},
|
|
138
214
|
{
|
|
@@ -162,7 +238,8 @@ export class TaxInvoiceListPage extends localize(i18next)(ScopedElementsMixin(Pa
|
|
|
162
238
|
name: 'supplierBusinessRegistrationNumber',
|
|
163
239
|
header: i18next.t('field.supplier business registration number'),
|
|
164
240
|
record: {
|
|
165
|
-
align: 'center'
|
|
241
|
+
align: 'center',
|
|
242
|
+
renderer: value => value.replace(/(\d{3})(\d{2})(\d{5})/g, '$1-$2-$3')
|
|
166
243
|
},
|
|
167
244
|
width: 150
|
|
168
245
|
},
|
|
@@ -189,7 +266,7 @@ export class TaxInvoiceListPage extends localize(i18next)(ScopedElementsMixin(Pa
|
|
|
189
266
|
name: 'totalAmount',
|
|
190
267
|
header: i18next.t('field.total amount'),
|
|
191
268
|
record: {
|
|
192
|
-
renderer: value => value &&
|
|
269
|
+
renderer: value => value && this._numberFormat(value),
|
|
193
270
|
align: 'center'
|
|
194
271
|
},
|
|
195
272
|
width: 90
|
|
@@ -199,7 +276,7 @@ export class TaxInvoiceListPage extends localize(i18next)(ScopedElementsMixin(Pa
|
|
|
199
276
|
name: 'supplyAmount',
|
|
200
277
|
header: i18next.t('field.supply amount'),
|
|
201
278
|
record: {
|
|
202
|
-
renderer: value => value &&
|
|
279
|
+
renderer: value => value && this._numberFormat(value),
|
|
203
280
|
align: 'center'
|
|
204
281
|
},
|
|
205
282
|
width: 90
|
|
@@ -209,7 +286,7 @@ export class TaxInvoiceListPage extends localize(i18next)(ScopedElementsMixin(Pa
|
|
|
209
286
|
name: 'taxAmount',
|
|
210
287
|
header: i18next.t('field.tax amount'),
|
|
211
288
|
record: {
|
|
212
|
-
renderer: value => value &&
|
|
289
|
+
renderer: value => value && this._numberFormat(value),
|
|
213
290
|
align: 'center'
|
|
214
291
|
},
|
|
215
292
|
width: 90
|
|
@@ -219,7 +296,8 @@ export class TaxInvoiceListPage extends localize(i18next)(ScopedElementsMixin(Pa
|
|
|
219
296
|
name: 'approvalNo',
|
|
220
297
|
header: i18next.t('field.approval no'),
|
|
221
298
|
record: {
|
|
222
|
-
align: 'center'
|
|
299
|
+
align: 'center',
|
|
300
|
+
renderer: value => value.replace(/(\d{8})(\d{8})(\d{8})/g, '$1-$2-$3')
|
|
223
301
|
},
|
|
224
302
|
width: 200
|
|
225
303
|
},
|
|
@@ -307,7 +385,7 @@ export class TaxInvoiceListPage extends localize(i18next)(ScopedElementsMixin(Pa
|
|
|
307
385
|
responses: taxInvoices(filters: $filters, pagination: $pagination, sortings: $sortings) {
|
|
308
386
|
items {
|
|
309
387
|
id
|
|
310
|
-
|
|
388
|
+
memo
|
|
311
389
|
category
|
|
312
390
|
issueDate
|
|
313
391
|
signatureDate
|
|
@@ -341,44 +419,19 @@ export class TaxInvoiceListPage extends localize(i18next)(ScopedElementsMixin(Pa
|
|
|
341
419
|
}
|
|
342
420
|
})
|
|
343
421
|
|
|
422
|
+
this.summary = {
|
|
423
|
+
count: response.data.responses.total || 0,
|
|
424
|
+
supply: response.data.responses.total || 0,
|
|
425
|
+
tax: response.data.responses.total || 0,
|
|
426
|
+
total: response.data.responses.total || 0
|
|
427
|
+
}
|
|
428
|
+
|
|
344
429
|
return {
|
|
345
430
|
total: response.data.responses.total || 0,
|
|
346
431
|
records: response.data.responses.items || []
|
|
347
432
|
}
|
|
348
433
|
}
|
|
349
434
|
|
|
350
|
-
async _deleteTaxInvoice() {
|
|
351
|
-
if (
|
|
352
|
-
await OxPrompt.open({
|
|
353
|
-
title: i18next.t('text.are_you_sure'),
|
|
354
|
-
text: i18next.t('text.sure_to_x', { x: i18next.t('text.delete') }),
|
|
355
|
-
confirmButton: { text: i18next.t('button.confirm') },
|
|
356
|
-
cancelButton: { text: i18next.t('button.cancel') }
|
|
357
|
-
})
|
|
358
|
-
) {
|
|
359
|
-
const ids = this.grist.selected.map(record => record.id)
|
|
360
|
-
if (ids && ids.length > 0) {
|
|
361
|
-
const response = await client.mutate({
|
|
362
|
-
mutation: gql`
|
|
363
|
-
mutation ($ids: [String!]!) {
|
|
364
|
-
deleteTaxInvoices(ids: $ids)
|
|
365
|
-
}
|
|
366
|
-
`,
|
|
367
|
-
variables: {
|
|
368
|
-
ids
|
|
369
|
-
}
|
|
370
|
-
})
|
|
371
|
-
|
|
372
|
-
if (!response.errors) {
|
|
373
|
-
this.grist.fetch()
|
|
374
|
-
notify({
|
|
375
|
-
message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') })
|
|
376
|
-
})
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
|
|
382
435
|
async _updateTaxInvoice() {
|
|
383
436
|
let patches = this.grist.dirtyRecords
|
|
384
437
|
if (patches && patches.length) {
|
|
@@ -415,111 +468,6 @@ export class TaxInvoiceListPage extends localize(i18next)(ScopedElementsMixin(Pa
|
|
|
415
468
|
}
|
|
416
469
|
}
|
|
417
470
|
|
|
418
|
-
async createTaxInvoice(num: string) {
|
|
419
|
-
const year = '2024'
|
|
420
|
-
const month = '01'
|
|
421
|
-
const day = '02'
|
|
422
|
-
const firstWordOfNum = num.slice(0, 1)
|
|
423
|
-
const firstWordOfNumNext = String(Number(num.slice(0, 1)) + 1).slice(0, 1)
|
|
424
|
-
const supplyAmount = 1000000 * Number(firstWordOfNum)
|
|
425
|
-
const taxAmount = supplyAmount / 10
|
|
426
|
-
|
|
427
|
-
const taxInvoice = {
|
|
428
|
-
name: '설명' + num.repeat(3),
|
|
429
|
-
category: '10',
|
|
430
|
-
approvalNo: year + month + day + '-' + firstWordOfNum.repeat(8) + '-' + firstWordOfNum.repeat(8),
|
|
431
|
-
issueDate: `${year}-${month}-${day}`,
|
|
432
|
-
signatureDate: `${year}-${month}-${Number(day) + 1}`,
|
|
433
|
-
invoiceType: '0101',
|
|
434
|
-
purpose: '02',
|
|
435
|
-
remark0: '비고' + num.repeat(3),
|
|
436
|
-
supplierBusinessRegistrationCategory: '01',
|
|
437
|
-
supplierBusinessRegistrationNumber: `${firstWordOfNum.repeat(3)}-${firstWordOfNum.repeat(2)}-${firstWordOfNum.repeat(5)}`,
|
|
438
|
-
supplierBusinessName: '공급자 회사명' + firstWordOfNum.repeat(3),
|
|
439
|
-
supplierRepresentativeName: '공급자 대표자' + firstWordOfNum.repeat(3),
|
|
440
|
-
supplierAddress: '공급자 주소' + firstWordOfNum.repeat(3),
|
|
441
|
-
supplierBusinessType: '공급자 업태' + firstWordOfNum.repeat(3),
|
|
442
|
-
supplierIndustryType: '공급자 업종' + firstWordOfNum.repeat(3),
|
|
443
|
-
supplierDepartment: '공급자 담당 부서' + firstWordOfNum.repeat(3),
|
|
444
|
-
supplierContactName: '공급자 담당자명' + firstWordOfNum.repeat(3),
|
|
445
|
-
supplierContactPhone: `010-${firstWordOfNum.repeat(4)}-${firstWordOfNum.repeat(4)}`,
|
|
446
|
-
supplierContactEmail: '공급자 담당자 이메일' + firstWordOfNum.repeat(3),
|
|
447
|
-
supplierContactCellPhone: '공급자 핸드폰 번호' + firstWordOfNum.repeat(3),
|
|
448
|
-
|
|
449
|
-
buyerBusinessRegistrationCategory: '01',
|
|
450
|
-
buyerBusinessRegistrationNumber: `${firstWordOfNumNext.repeat(3)}-${firstWordOfNumNext.repeat(2)}-${firstWordOfNumNext.repeat(5)}`,
|
|
451
|
-
buyerBusinessName: '공급자 회사명' + firstWordOfNum.repeat(3),
|
|
452
|
-
buyerRepresentativeName: '공급자 대표자' + firstWordOfNum.repeat(3),
|
|
453
|
-
buyerAddress: '공급자 주소' + firstWordOfNum.repeat(3),
|
|
454
|
-
buyerBusinessType: '공급자 업태' + firstWordOfNum.repeat(3),
|
|
455
|
-
buyerIndustryType: '공급자 업종' + firstWordOfNum.repeat(3),
|
|
456
|
-
buyer1stDepartment: '공급자 담당 부서 1st' + firstWordOfNum.repeat(3),
|
|
457
|
-
buyer1stContactName: '공급자 담당자명 1st' + firstWordOfNum.repeat(3),
|
|
458
|
-
buyer1stContactPhone: `011-${firstWordOfNumNext.repeat(4)}-${firstWordOfNumNext.repeat(4)}`,
|
|
459
|
-
buyer1stContactEmail: '공급자 담당자 이메일 1st' + firstWordOfNum.repeat(3),
|
|
460
|
-
buyer1stContactCellPhone: '공급자 핸드폰 번호 1st' + firstWordOfNum.repeat(3),
|
|
461
|
-
buyer2ndDepartment: '공급자 담당 부서 2nd' + firstWordOfNum.repeat(3),
|
|
462
|
-
buyer2ndContactName: '공급자 담당자명 2nd' + firstWordOfNum.repeat(3),
|
|
463
|
-
buyer2ndContactPhone: `022-${firstWordOfNumNext.repeat(4)}-${firstWordOfNumNext.repeat(4)}`,
|
|
464
|
-
buyer2ndContactEmail: '공급자 담당자 이메일 2nd' + firstWordOfNum.repeat(3),
|
|
465
|
-
buyer2ndContactCellPhone: '공급자 핸드폰 번호 2nd' + firstWordOfNum.repeat(3),
|
|
466
|
-
|
|
467
|
-
paymentAmountCash: 0,
|
|
468
|
-
paymentAmountCheck: 0,
|
|
469
|
-
paymentAmountPromissoryNote: 0,
|
|
470
|
-
paymentAmountAccountsReceivable: 0,
|
|
471
|
-
supplyAmount: supplyAmount,
|
|
472
|
-
taxAmount: taxAmount,
|
|
473
|
-
totalAmount: supplyAmount + taxAmount
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
const taxInvoiceItems = [
|
|
477
|
-
{
|
|
478
|
-
sequence: 1,
|
|
479
|
-
supplyDate: `${year}-${month}-${day}`,
|
|
480
|
-
itemName: '아이템01',
|
|
481
|
-
specification: 'EA',
|
|
482
|
-
quantity: 1,
|
|
483
|
-
unitPrice: 100000,
|
|
484
|
-
supplyPrice: 100000,
|
|
485
|
-
taxPrice: 10000,
|
|
486
|
-
remark: '아이템 비고 01'
|
|
487
|
-
},
|
|
488
|
-
{
|
|
489
|
-
sequence: 2,
|
|
490
|
-
supplyDate: `${year}-${month}-${Number(day) + 1}`,
|
|
491
|
-
itemName: '아이템02',
|
|
492
|
-
specification: 'EA',
|
|
493
|
-
quantity: 2,
|
|
494
|
-
unitPrice: 100000,
|
|
495
|
-
supplyPrice: 200000,
|
|
496
|
-
taxPrice: 20000,
|
|
497
|
-
remark: '아이템 비고 02'
|
|
498
|
-
}
|
|
499
|
-
]
|
|
500
|
-
|
|
501
|
-
const response = await client.mutate({
|
|
502
|
-
mutation: gql`
|
|
503
|
-
mutation CreateTaxInvoice($taxInvoice: NewTaxInvoice!, $taxInvoiceItems: [NewTaxInvoiceItem!]!) {
|
|
504
|
-
createTaxInvoice(taxInvoice: $taxInvoice, taxInvoiceItems: $taxInvoiceItems) {
|
|
505
|
-
id
|
|
506
|
-
}
|
|
507
|
-
}
|
|
508
|
-
`,
|
|
509
|
-
variables: {
|
|
510
|
-
taxInvoice,
|
|
511
|
-
taxInvoiceItems
|
|
512
|
-
}
|
|
513
|
-
})
|
|
514
|
-
|
|
515
|
-
if (!response.errors) {
|
|
516
|
-
this.grist.fetch()
|
|
517
|
-
notify({
|
|
518
|
-
message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') })
|
|
519
|
-
})
|
|
520
|
-
}
|
|
521
|
-
}
|
|
522
|
-
|
|
523
471
|
async exportHandler() {
|
|
524
472
|
const exportTargets = this.grist.selected.length ? this.grist.selected : this.grist.dirtyData.records
|
|
525
473
|
const targetFieldSet = new Set(['id', 'name'])
|
|
@@ -541,4 +489,6 @@ export class TaxInvoiceListPage extends localize(i18next)(ScopedElementsMixin(Pa
|
|
|
541
489
|
title: i18next.t('title.tax invoice detail')
|
|
542
490
|
})
|
|
543
491
|
}
|
|
492
|
+
|
|
493
|
+
private _numberFormat = (num: number | undefined) => Intl.NumberFormat('en-US').format(num || 0)
|
|
544
494
|
}
|
|
@@ -147,7 +147,7 @@ export class TaxInvoiceApiPage extends localize(i18next)(ScopedElementsMixin(Pag
|
|
|
147
147
|
{
|
|
148
148
|
type: 'string',
|
|
149
149
|
name: 'businessName',
|
|
150
|
-
header: i18next.t('field.business name'),
|
|
150
|
+
header: i18next.t('field.tax invoice business name'),
|
|
151
151
|
record: {
|
|
152
152
|
editable: true
|
|
153
153
|
},
|
|
@@ -156,7 +156,7 @@ export class TaxInvoiceApiPage extends localize(i18next)(ScopedElementsMixin(Pag
|
|
|
156
156
|
{
|
|
157
157
|
type: 'string',
|
|
158
158
|
name: 'representativeName',
|
|
159
|
-
header: i18next.t('field.representative name'),
|
|
159
|
+
header: i18next.t('field.tax invoice representative name'),
|
|
160
160
|
record: {
|
|
161
161
|
editable: true
|
|
162
162
|
},
|
|
@@ -243,7 +243,7 @@ export class TaxInvoiceApiPage extends localize(i18next)(ScopedElementsMixin(Pag
|
|
|
243
243
|
options: async () => {
|
|
244
244
|
return {
|
|
245
245
|
objectified: true,
|
|
246
|
-
attributeSet: await this.
|
|
246
|
+
attributeSet: await this.getAttributeSetForEntity()
|
|
247
247
|
}
|
|
248
248
|
}
|
|
249
249
|
},
|
|
@@ -311,6 +311,7 @@ export class TaxInvoiceApiPage extends localize(i18next)(ScopedElementsMixin(Pag
|
|
|
311
311
|
contactPhone
|
|
312
312
|
contactEmail
|
|
313
313
|
contactCellPhone
|
|
314
|
+
attributes
|
|
314
315
|
updater {
|
|
315
316
|
id
|
|
316
317
|
name
|
|
@@ -402,11 +403,11 @@ export class TaxInvoiceApiPage extends localize(i18next)(ScopedElementsMixin(Pag
|
|
|
402
403
|
}
|
|
403
404
|
}
|
|
404
405
|
|
|
405
|
-
async
|
|
406
|
+
async getAttributeSetForEntity() {
|
|
406
407
|
const response = await client.query({
|
|
407
408
|
query: gql`
|
|
408
409
|
query {
|
|
409
|
-
attributeSet: attributeSetByEntity(entity: "
|
|
410
|
+
attributeSet: attributeSetByEntity(entity: "TaxInvoiceApi") {
|
|
410
411
|
entity
|
|
411
412
|
description
|
|
412
413
|
items {
|
|
@@ -76,13 +76,13 @@ export class TaxInvoiceCompanyImporter extends LitElement {
|
|
|
76
76
|
{
|
|
77
77
|
type: 'string',
|
|
78
78
|
name: 'businessName',
|
|
79
|
-
header: i18next.t('field.business name'),
|
|
79
|
+
header: i18next.t('field.tax invoice business name'),
|
|
80
80
|
width: 150
|
|
81
81
|
},
|
|
82
82
|
{
|
|
83
83
|
type: 'string',
|
|
84
84
|
name: 'representativeName',
|
|
85
|
-
header: i18next.t('field.representative name'),
|
|
85
|
+
header: i18next.t('field.tax invoice representative name'),
|
|
86
86
|
width: 150
|
|
87
87
|
},
|
|
88
88
|
{
|
package/client/route.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export default function route(page: string) {
|
|
2
2
|
switch (page) {
|
|
3
|
-
case 'tax-invoice-main':
|
|
4
|
-
import('./pages/main')
|
|
5
|
-
return page
|
|
6
|
-
|
|
7
3
|
case 'tax-invoice-list':
|
|
8
4
|
import('./pages/tax-invoice/tax-invoice-list-page')
|
|
9
5
|
return page
|
|
10
6
|
|
|
7
|
+
case 'tax-invoice-send':
|
|
8
|
+
// import('./pages/tax-invoice-send/tax-invoice-send-page')
|
|
9
|
+
return page
|
|
10
|
+
|
|
11
11
|
case 'tax-invoice-company-list':
|
|
12
12
|
import('./pages/tax-invoice-company/tax-invoice-company-list-page')
|
|
13
13
|
return page
|
|
@@ -15,13 +15,13 @@ let TaxInvoiceDetailPopup = class TaxInvoiceDetailPopup extends localize(i18next
|
|
|
15
15
|
this.detail = {};
|
|
16
16
|
}
|
|
17
17
|
render() {
|
|
18
|
-
var _a;
|
|
18
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
19
19
|
return html `
|
|
20
20
|
<div class="title">
|
|
21
21
|
<table>
|
|
22
22
|
<tr>
|
|
23
23
|
<th>${i18next.t('field.approval no')}</th>
|
|
24
|
-
<td>${this.detail.approvalNo}</td>
|
|
24
|
+
<td>${(_b = (_a = this.detail) === null || _a === void 0 ? void 0 : _a.approvalNo) === null || _b === void 0 ? void 0 : _b.replace(/(\d{8})(\d{8})(\d{8})/g, '$1-$2-$3')}</td>
|
|
25
25
|
</tr>
|
|
26
26
|
</table>
|
|
27
27
|
</div>
|
|
@@ -40,7 +40,7 @@ let TaxInvoiceDetailPopup = class TaxInvoiceDetailPopup extends localize(i18next
|
|
|
40
40
|
<tr>
|
|
41
41
|
<th rowspan="6" class="target">${i18next.t('field.tax invoice supplier')}</th>
|
|
42
42
|
<th>${i18next.t('field.short business registration number')}</th>
|
|
43
|
-
<td>${this.detail.supplierBusinessRegistrationNumber}</td>
|
|
43
|
+
<td>${(_d = (_c = this.detail) === null || _c === void 0 ? void 0 : _c.supplierBusinessRegistrationNumber) === null || _d === void 0 ? void 0 : _d.replace(/(\d{3})(\d{2})(\d{5})/g, '$1-$2-$3')}</td>
|
|
44
44
|
<th>${i18next.t('field.short branch identification')}</th>
|
|
45
45
|
<td>${this.detail.supplierBranchIdentification}</td>
|
|
46
46
|
</tr>
|
|
@@ -71,7 +71,7 @@ let TaxInvoiceDetailPopup = class TaxInvoiceDetailPopup extends localize(i18next
|
|
|
71
71
|
<tr>
|
|
72
72
|
<th rowspan="6" class="target">${i18next.t('field.tax invoice buyer')}</th>
|
|
73
73
|
<th>${i18next.t('field.short business registration number')}</th>
|
|
74
|
-
<td>${this.detail.buyerBusinessRegistrationNumber}</td>
|
|
74
|
+
<td>${(_f = (_e = this.detail) === null || _e === void 0 ? void 0 : _e.buyerBusinessRegistrationNumber) === null || _f === void 0 ? void 0 : _f.replace(/(\d{3})(\d{2})(\d{5})/g, '$1-$2-$3')}</td>
|
|
75
75
|
<th>${i18next.t('field.short branch identification')}</th>
|
|
76
76
|
<td>${this.detail.buyerBranchIdentification}</td>
|
|
77
77
|
</tr>
|
|
@@ -119,7 +119,7 @@ let TaxInvoiceDetailPopup = class TaxInvoiceDetailPopup extends localize(i18next
|
|
|
119
119
|
<th>${i18next.t('field.remark0')}</th>
|
|
120
120
|
</tr>
|
|
121
121
|
<tr>
|
|
122
|
-
<td>${this.detail.issueDate}</td>
|
|
122
|
+
<td>${(_g = this.detail.issueDate) === null || _g === void 0 ? void 0 : _g.split('T')[0]}</td>
|
|
123
123
|
<td>${this._numberFormat(this.detail.supplyAmount)}</td>
|
|
124
124
|
<td>${this._numberFormat(this.detail.taxAmount)}</td>
|
|
125
125
|
<td>${this.detail.modificationReason}</td>
|
|
@@ -153,10 +153,12 @@ let TaxInvoiceDetailPopup = class TaxInvoiceDetailPopup extends localize(i18next
|
|
|
153
153
|
<th>${i18next.t('field.remark0')}</th>
|
|
154
154
|
</tr>
|
|
155
155
|
|
|
156
|
-
${(
|
|
156
|
+
${(_h = this.detail.taxInvoiceItems) === null || _h === void 0 ? void 0 : _h.map(item => {
|
|
157
|
+
var _a;
|
|
158
|
+
return html `
|
|
157
159
|
<tr>
|
|
158
160
|
<td>${item.supplyDate.split('-')[1]}</td>
|
|
159
|
-
<td>${item.supplyDate.split('-')[2]}</td>
|
|
161
|
+
<td>${(_a = item.supplyDate.split('-')[2]) === null || _a === void 0 ? void 0 : _a.split('T')[0]}</td>
|
|
160
162
|
<td>${item.itemName}</td>
|
|
161
163
|
<td>${item.specification}</td>
|
|
162
164
|
<td>${item.quantity}</td>
|
|
@@ -165,7 +167,8 @@ let TaxInvoiceDetailPopup = class TaxInvoiceDetailPopup extends localize(i18next
|
|
|
165
167
|
<td>${this._numberFormat(item.taxPrice)}</td>
|
|
166
168
|
<td>${item.remark}</td>
|
|
167
169
|
</tr>
|
|
168
|
-
|
|
170
|
+
`;
|
|
171
|
+
})}
|
|
169
172
|
</table>
|
|
170
173
|
</div>
|
|
171
174
|
|
|
@@ -211,7 +214,6 @@ let TaxInvoiceDetailPopup = class TaxInvoiceDetailPopup extends localize(i18next
|
|
|
211
214
|
query ($id: String!) {
|
|
212
215
|
responses: taxInvoice(id: $id) {
|
|
213
216
|
id
|
|
214
|
-
name
|
|
215
217
|
category
|
|
216
218
|
approvalNo
|
|
217
219
|
originalApprovalNo
|