@things-factory/tax-invoice 6.2.86 → 6.2.90

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 (61) 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 +52 -114
  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 +3 -5
  13. package/dist-client/pages/tax-invoice-api/tax-invoice-api-page.js +52 -105
  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-mutation.js +13 -21
  33. package/dist-server/service/tax-invoice-api/tax-invoice-api-mutation.js.map +1 -1
  34. package/dist-server/service/tax-invoice-api/tax-invoice-api-query.js +4 -25
  35. package/dist-server/service/tax-invoice-api/tax-invoice-api-query.js.map +1 -1
  36. package/dist-server/service/tax-invoice-api/tax-invoice-api-type.js +5 -0
  37. package/dist-server/service/tax-invoice-api/tax-invoice-api-type.js.map +1 -1
  38. package/dist-server/service/tax-invoice-api/tax-invoice-api.js +7 -1
  39. package/dist-server/service/tax-invoice-api/tax-invoice-api.js.map +1 -1
  40. package/dist-server/service/tax-invoice-item/tax-invoice-item-query.js.map +1 -1
  41. package/dist-server/service/tax-invoice-item/tax-invoice-item-type.js +4 -4
  42. package/dist-server/service/tax-invoice-item/tax-invoice-item-type.js.map +1 -1
  43. package/dist-server/service/tax-invoice-item/tax-invoice-item.js +3 -3
  44. package/dist-server/service/tax-invoice-item/tax-invoice-item.js.map +1 -1
  45. package/dist-server/service/unipost-api/tax-invoice-inquiry.js +90 -0
  46. package/dist-server/service/unipost-api/tax-invoice-inquiry.js.map +1 -0
  47. package/dist-server/tsconfig.tsbuildinfo +1 -1
  48. package/package.json +5 -5
  49. package/server/service/tax-invoice/tax-invoice-mutation.ts +137 -36
  50. package/server/service/tax-invoice/tax-invoice-query.ts +21 -3
  51. package/server/service/tax-invoice/tax-invoice-type.ts +21 -199
  52. package/server/service/tax-invoice/tax-invoice.ts +38 -45
  53. package/server/service/tax-invoice-api/tax-invoice-api-mutation.ts +19 -33
  54. package/server/service/tax-invoice-api/tax-invoice-api-query.ts +4 -21
  55. package/server/service/tax-invoice-api/tax-invoice-api-type.ts +4 -0
  56. package/server/service/tax-invoice-api/tax-invoice-api.ts +7 -15
  57. package/server/service/tax-invoice-item/tax-invoice-item-query.ts +1 -1
  58. package/server/service/tax-invoice-item/tax-invoice-item-type.ts +4 -7
  59. package/server/service/tax-invoice-item/tax-invoice-item.ts +3 -3
  60. package/server/service/unipost-api/tax-invoice-inquiry.ts +103 -0
  61. package/translations/ko.json +10 -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.approvalNo}</td>
152
+ <td>${this.detail?.approvalNo?.replace(/(\S{8})(\S{8})(\S{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.supplierBusinessRegistrationNumber}</td>
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>
@@ -196,10 +196,17 @@ export class TaxInvoiceDetailPopup extends localize(i18next)(LitElement) {
196
196
  </table>
197
197
 
198
198
  <table class="buyer">
199
+ <colgroup>
200
+ <col width="150px" />
201
+ <col width="18%" />
202
+ <col width="32%" />
203
+ <col width="18%" />
204
+ <col width="32%" />
205
+ </colgroup>
199
206
  <tr>
200
207
  <th rowspan="6" class="target">${i18next.t('field.tax invoice buyer')}</th>
201
208
  <th>${i18next.t('field.short business registration number')}</th>
202
- <td>${this.detail.buyerBusinessRegistrationNumber}</td>
209
+ <td>${this.detail?.buyerBusinessRegistrationNumber?.replace(/(\d{3})(\d{2})(\d{5})/g, '$1-$2-$3')}</td>
203
210
  <th>${i18next.t('field.short branch identification')}</th>
204
211
  <td>${this.detail.buyerBranchIdentification}</td>
205
212
  </tr>
@@ -247,7 +254,7 @@ export class TaxInvoiceDetailPopup extends localize(i18next)(LitElement) {
247
254
  <th>${i18next.t('field.remark0')}</th>
248
255
  </tr>
249
256
  <tr>
250
- <td>${this.detail.issueDate}</td>
257
+ <td>${this.detail.issueDate?.split('T')[0]}</td>
251
258
  <td>${this._numberFormat(this.detail.supplyAmount)}</td>
252
259
  <td>${this._numberFormat(this.detail.taxAmount)}</td>
253
260
  <td>${this.detail.modificationReason}</td>
@@ -286,7 +293,7 @@ export class TaxInvoiceDetailPopup extends localize(i18next)(LitElement) {
286
293
  html`
287
294
  <tr>
288
295
  <td>${item.supplyDate.split('-')[1]}</td>
289
- <td>${item.supplyDate.split('-')[2]}</td>
296
+ <td>${item.supplyDate.split('-')[2]?.split('T')[0]}</td>
290
297
  <td>${item.itemName}</td>
291
298
  <td>${item.specification}</td>
292
299
  <td>${item.quantity}</td>
@@ -344,7 +351,6 @@ export class TaxInvoiceDetailPopup extends localize(i18next)(LitElement) {
344
351
  query ($id: String!) {
345
352
  responses: taxInvoice(id: $id) {
346
353
  id
347
- name
348
354
  category
349
355
  approvalNo
350
356
  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,33 +15,70 @@ 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'
22
+ }
18
23
  export const CATEGORY = {
19
- '10': '매출',
20
- '20': '매입',
21
- '30': 'NTS'
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
- '0101': '일반 세금계산서',
26
- '0102': '영세율 세금계산서',
27
- '0103': '위수탁 세금계산서',
28
- '0105': '영세율 위수탁 세금계산서',
29
- '0201': '수정 일반 세금계산서',
30
- '0202': '수정 영세율 세금계산서',
31
- '0203': '수정 위수탁 세금계산서',
32
- '0204': '수정 수입 세금계산서',
33
- '0205': '수정 영세율 위수탁 세금계산서',
34
- '0301': '일반 계산서',
35
- '0303': '위수탁 계산서',
36
- '0304': '수입 계산서',
37
- '0401': '수정 일반 계산서',
38
- '0403': '수정 위수탁 계산서',
39
- '0404': '정 수입 계산서'
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
 
64
+ export enum Purpose {
65
+ RECEIPT = '01',
66
+ INVOICE = '02'
67
+ }
42
68
  export const PURPOSE = {
43
- '01': '영수',
44
- '02': '청구'
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]: '외국인'
45
82
  }
46
83
 
47
84
  @customElement('tax-invoice-list-page')
@@ -52,17 +89,43 @@ export class TaxInvoiceListPage extends localize(i18next)(ScopedElementsMixin(Pa
52
89
  css`
53
90
  :host {
54
91
  display: flex;
92
+ flex-direction: column;
55
93
 
56
94
  width: 100%;
57
95
 
58
96
  --grid-record-emphasized-background-color: red;
59
97
  --grid-record-emphasized-color: yellow;
60
98
  }
99
+
100
+ div.summary {
101
+ display: grid;
102
+ grid-template-columns: 0.7fr 1fr 0.7fr 1fr 0.7fr 1fr 0.7fr 1fr;
103
+ border: solid #d3dbe5;
104
+ border-width: 2px 0;
105
+ margin: 15px 40px;
106
+ align-content: center;
107
+
108
+ span.title {
109
+ background-color: #e9edf6;
110
+ text-align: center;
111
+ display: flex;
112
+ align-items: center;
113
+ justify-content: center;
114
+ height: 35px;
115
+ font-weight: bold;
116
+ }
117
+ span.value {
118
+ padding-left: 10px;
119
+ display: flex;
120
+ align-items: center;
121
+ height: 35px;
122
+ }
123
+ }
61
124
  `
62
125
  ]
63
126
 
64
127
  @property({ type: Object }) gristConfig: any
65
- @property({ type: String }) mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'
128
+ @state() summary: { cnt: number; total_amount: number; supply_amount: number; tax_amount: number } | null = null
66
129
 
67
130
  @query('ox-grist') private grist!: DataGrist
68
131
 
@@ -72,9 +135,9 @@ export class TaxInvoiceListPage extends localize(i18next)(ScopedElementsMixin(Pa
72
135
  help: 'tax-invoice/tax-invoice',
73
136
  actions: [
74
137
  {
75
- title: i18next.t('button.delete'),
76
- action: this._deleteTaxInvoice.bind(this),
77
- ...CommonButtonStyles.delete
138
+ title: i18next.t('button.memo save'),
139
+ action: this._updateTaxInvoice.bind(this),
140
+ ...CommonButtonStyles.save
78
141
  }
79
142
  ],
80
143
  exportable: {
@@ -87,8 +150,20 @@ export class TaxInvoiceListPage extends localize(i18next)(ScopedElementsMixin(Pa
87
150
 
88
151
  render() {
89
152
  const mode = 'GRID'
153
+ const summary = this.summary
90
154
 
91
155
  return html`
156
+ <div class="summary">
157
+ <span class="title">${i18next.t('field.summary total count')}</span>
158
+ <span class="value">${this._numberFormat(summary?.cnt)}</span>
159
+ <span class="title">${i18next.t('field.summary total amount')}</span>
160
+ <span class="value">${this._numberFormat(summary?.total_amount)}</span>
161
+ <span class="title">${i18next.t('field.summary supply amount')}</span>
162
+ <span class="value">${this._numberFormat(summary?.supply_amount)}</span>
163
+ <span class="title">${i18next.t('field.summary tax amount')}</span>
164
+ <span class="value">${this._numberFormat(summary?.tax_amount)}</span>
165
+ </div>
166
+
92
167
  <ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
93
168
  <div slot="headroom">
94
169
  <div id="filters">
@@ -97,7 +172,6 @@ export class TaxInvoiceListPage extends localize(i18next)(ScopedElementsMixin(Pa
97
172
  </div>
98
173
  </ox-grist>
99
174
  `
100
- // <button @click=${() => this.createTaxInvoice('3')}>생성</button>
101
175
  }
102
176
 
103
177
  async pageInitialized(lifecycle: any) {
@@ -117,8 +191,8 @@ export class TaxInvoiceListPage extends localize(i18next)(ScopedElementsMixin(Pa
117
191
  },
118
192
  {
119
193
  type: 'string',
120
- name: 'name',
121
- header: i18next.t('field.name'),
194
+ name: 'memo',
195
+ header: i18next.t('field.memo'),
122
196
  record: {
123
197
  editable: true
124
198
  },
@@ -131,8 +205,31 @@ export class TaxInvoiceListPage extends localize(i18next)(ScopedElementsMixin(Pa
131
205
  header: i18next.t('field.tax invoice category'),
132
206
  record: {
133
207
  renderer: value => CATEGORY[value],
208
+ classifier: function (record, rowIndex) {
209
+ return {
210
+ emphasized: record.category === Category.EXPORT ? ['#c6daf6', 'black'] : ['#fedbde', 'black']
211
+ }
212
+ },
134
213
  align: 'center'
135
214
  },
215
+ filter: {
216
+ type: 'select',
217
+ value: Category.EXPORT,
218
+ options: () => [
219
+ {
220
+ display: '전체',
221
+ value: ''
222
+ },
223
+ {
224
+ display: '매출',
225
+ value: Category.EXPORT
226
+ },
227
+ {
228
+ display: '매입',
229
+ value: Category.IMPORT
230
+ }
231
+ ]
232
+ },
136
233
  width: 80
137
234
  },
138
235
  {
@@ -162,7 +259,8 @@ export class TaxInvoiceListPage extends localize(i18next)(ScopedElementsMixin(Pa
162
259
  name: 'supplierBusinessRegistrationNumber',
163
260
  header: i18next.t('field.supplier business registration number'),
164
261
  record: {
165
- align: 'center'
262
+ align: 'center',
263
+ renderer: value => value.replace(/(\d{3})(\d{2})(\d{5})/g, '$1-$2-$3')
166
264
  },
167
265
  width: 150
168
266
  },
@@ -189,7 +287,7 @@ export class TaxInvoiceListPage extends localize(i18next)(ScopedElementsMixin(Pa
189
287
  name: 'totalAmount',
190
288
  header: i18next.t('field.total amount'),
191
289
  record: {
192
- renderer: value => value && new Intl.NumberFormat('en-US').format(value),
290
+ renderer: value => value && this._numberFormat(value),
193
291
  align: 'center'
194
292
  },
195
293
  width: 90
@@ -199,7 +297,7 @@ export class TaxInvoiceListPage extends localize(i18next)(ScopedElementsMixin(Pa
199
297
  name: 'supplyAmount',
200
298
  header: i18next.t('field.supply amount'),
201
299
  record: {
202
- renderer: value => value && new Intl.NumberFormat('en-US').format(value),
300
+ renderer: value => value && this._numberFormat(value),
203
301
  align: 'center'
204
302
  },
205
303
  width: 90
@@ -209,7 +307,7 @@ export class TaxInvoiceListPage extends localize(i18next)(ScopedElementsMixin(Pa
209
307
  name: 'taxAmount',
210
308
  header: i18next.t('field.tax amount'),
211
309
  record: {
212
- renderer: value => value && new Intl.NumberFormat('en-US').format(value),
310
+ renderer: value => value && this._numberFormat(value),
213
311
  align: 'center'
214
312
  },
215
313
  width: 90
@@ -219,7 +317,8 @@ export class TaxInvoiceListPage extends localize(i18next)(ScopedElementsMixin(Pa
219
317
  name: 'approvalNo',
220
318
  header: i18next.t('field.approval no'),
221
319
  record: {
222
- align: 'center'
320
+ align: 'center',
321
+ renderer: value => value.replace(/(\S{8})(\S{8})(\S{8})/g, '$1-$2-$3')
223
322
  },
224
323
  width: 200
225
324
  },
@@ -303,11 +402,11 @@ export class TaxInvoiceListPage extends localize(i18next)(ScopedElementsMixin(Pa
303
402
  async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }: FetchOption) {
304
403
  const response = await client.query({
305
404
  query: gql`
306
- query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
307
- responses: taxInvoices(filters: $filters, pagination: $pagination, sortings: $sortings) {
405
+ query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!], $summaryFilters: [Filter!]) {
406
+ taxInvoices(filters: $filters, pagination: $pagination, sortings: $sortings) {
308
407
  items {
309
408
  id
310
- name
409
+ memo
311
410
  category
312
411
  issueDate
313
412
  signatureDate
@@ -332,50 +431,25 @@ export class TaxInvoiceListPage extends localize(i18next)(ScopedElementsMixin(Pa
332
431
  }
333
432
  total
334
433
  }
434
+ taxInvoicesSummary(filters: $summaryFilters) {
435
+ summary
436
+ }
335
437
  }
336
438
  `,
337
439
  variables: {
338
440
  filters,
339
441
  pagination: { page, limit },
340
- sortings
442
+ sortings,
443
+ summaryFilters: filters
341
444
  }
342
445
  })
343
446
 
344
- return {
345
- total: response.data.responses.total || 0,
346
- records: response.data.responses.items || []
347
- }
348
- }
349
-
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
- })
447
+ // 합계 필드 갱신
448
+ this.summary = response.data.taxInvoicesSummary.summary
371
449
 
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
- }
450
+ return {
451
+ total: response.data.taxInvoices.total || 0,
452
+ records: response.data.taxInvoices.items || []
379
453
  }
380
454
  }
381
455
 
@@ -415,111 +489,6 @@ export class TaxInvoiceListPage extends localize(i18next)(ScopedElementsMixin(Pa
415
489
  }
416
490
  }
417
491
 
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
492
  async exportHandler() {
524
493
  const exportTargets = this.grist.selected.length ? this.grist.selected : this.grist.dirtyData.records
525
494
  const targetFieldSet = new Set(['id', 'name'])
@@ -541,4 +510,6 @@ export class TaxInvoiceListPage extends localize(i18next)(ScopedElementsMixin(Pa
541
510
  title: i18next.t('title.tax invoice detail')
542
511
  })
543
512
  }
513
+
514
+ private _numberFormat = (num: number | undefined) => Intl.NumberFormat('en-US').format(num || 0)
544
515
  }