@things-factory/tax-invoice 6.2.84 → 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 (58) hide show
  1. package/client/pages/tax-invoice/tax-invoice-detail-popup.ts +34 -11
  2. package/client/pages/tax-invoice/tax-invoice-list-page.ts +150 -152
  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 +39 -13
  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 -143
  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 +137 -41
  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 +25 -2
  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 -24
  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-api/tax-invoice-api.js +0 -8
  35. package/dist-server/service/tax-invoice-api/tax-invoice-api.js.map +1 -1
  36. package/dist-server/service/tax-invoice-company/tax-invoice-company.js +0 -8
  37. package/dist-server/service/tax-invoice-company/tax-invoice-company.js.map +1 -1
  38. package/dist-server/service/tax-invoice-item/tax-invoice-item-query.js.map +1 -1
  39. package/dist-server/service/tax-invoice-item/tax-invoice-item-type.js +4 -12
  40. package/dist-server/service/tax-invoice-item/tax-invoice-item-type.js.map +1 -1
  41. package/dist-server/service/tax-invoice-item/tax-invoice-item.js +6 -15
  42. package/dist-server/service/tax-invoice-item/tax-invoice-item.js.map +1 -1
  43. package/dist-server/service/unipost-api/tax-invoice-inquiry.js +90 -0
  44. package/dist-server/service/unipost-api/tax-invoice-inquiry.js.map +1 -0
  45. package/dist-server/tsconfig.tsbuildinfo +1 -1
  46. package/package.json +5 -5
  47. package/server/service/tax-invoice/tax-invoice-mutation.ts +143 -45
  48. package/server/service/tax-invoice/tax-invoice-query.ts +22 -4
  49. package/server/service/tax-invoice/tax-invoice-type.ts +21 -199
  50. package/server/service/tax-invoice/tax-invoice.ts +38 -49
  51. package/server/service/tax-invoice-api/tax-invoice-api-type.ts +4 -0
  52. package/server/service/tax-invoice-api/tax-invoice-api.ts +0 -4
  53. package/server/service/tax-invoice-company/tax-invoice-company.ts +0 -4
  54. package/server/service/tax-invoice-item/tax-invoice-item-query.ts +1 -1
  55. package/server/service/tax-invoice-item/tax-invoice-item-type.ts +4 -13
  56. package/server/service/tax-invoice-item/tax-invoice-item.ts +6 -10
  57. package/server/service/unipost-api/tax-invoice-inquiry.ts +103 -0
  58. package/translations/ko.json +10 -1
@@ -0,0 +1,580 @@
1
+ import '@operato/data-grist'
2
+
3
+ import { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'
4
+ import { PageView } from '@operato/shell'
5
+ import { css, html } from 'lit'
6
+ import { customElement, property, query, state } from 'lit/decorators.js'
7
+ import { ScopedElementsMixin } from '@open-wc/scoped-elements'
8
+ import { client } from '@operato/graphql'
9
+ import { i18next, localize } from '@operato/i18n'
10
+ import { notify } from '@operato/layout'
11
+ import gql from 'graphql-tag'
12
+ import { BUSINESS_REGISTRATION_CATEGORY, BusinessRegistrationCategory, Category, INVOICE_TYPE, InvoiceType, Purpose } from '../tax-invoice/tax-invoice-list-page'
13
+
14
+ const SHORT_INVOICE_TYPE = {
15
+ TAX_INVOICE: {
16
+ [InvoiceType.TAX_INVOICE]: '일반',
17
+ [InvoiceType.SMALL_BUSINESS_TAX_INVOICE]: '영세율',
18
+ [InvoiceType.CONSIGNMENT_TAX_INVOICE]: '위수탁',
19
+ [InvoiceType.SMALL_BUSINESS_CONSIGNMENT_TAX_INVOICE]: '위수탁영세율'
20
+ },
21
+ INVOICE: {
22
+ [InvoiceType.INVOICE]: '일반',
23
+ [InvoiceType.CONSIGNMENT_INVOICE]: '위수탁'
24
+ // [InvoiceType.IMPORT_INVOICE]: INVOICE_TYPE[IMPORT_INVOICE],
25
+ }
26
+ }
27
+
28
+ const SHORT_BUSINESS_REGISTRATION_CATEGORY = {
29
+ [BusinessRegistrationCategory.BUSINESS_REGISTRATION_NUMBER]: '사업자',
30
+ [BusinessRegistrationCategory.RESIDENT_REGISTRATION_NUMBER]: '개인',
31
+ [BusinessRegistrationCategory.FOREIGNER_REGISTRATION_NUMBER]: '외국인'
32
+ }
33
+
34
+ interface Supplier {
35
+ supplierBusinessRegistrationNumber: string
36
+ supplierBranchIdentification?: string
37
+ supplierBusinessName: string
38
+ supplierRepresentativeName: string
39
+ supplierAddress?: string
40
+ supplierBusinessType?: string
41
+ supplierIndustryType?: string
42
+ supplierDepartment?: string
43
+ supplierContactName?: string
44
+ supplierContactPhone?: string
45
+ supplierContactEmail?: string
46
+ supplierContactCellPhone?: string
47
+ }
48
+ interface Buyer {
49
+ buyerBusinessRegistrationCategory: BusinessRegistrationCategory
50
+ buyerBusinessRegistrationNumber: string
51
+ buyerBranchIdentification?: string
52
+ buyerBusinessName: string
53
+ buyerRepresentativeName: string
54
+ buyerAddress?: string
55
+ buyerBusinessType?: string
56
+ buyerIndustryType?: string
57
+ buyer1stDepartment?: string
58
+ buyer1stContactName?: string
59
+ buyer1stContactPhone?: string
60
+ buyer1stContactEmail?: string
61
+ buyer1stContactCellPhone?: string
62
+ buyer2ndDepartment?: string
63
+ buyer2ndContactName?: string
64
+ buyer2ndContactPhone?: string
65
+ buyer2ndContactEmail?: string
66
+ buyer2ndContactCellPhone?: string
67
+ }
68
+ interface TaxInvoice {
69
+ category: Category
70
+ issueNo?: string
71
+ approvalNo?: string
72
+ originalApprovalNo?: string
73
+ issueDate: Date | null
74
+ signatureDate?: Date
75
+ invoiceType: InvoiceType
76
+ purpose: Purpose
77
+ remark0?: string
78
+ remark1?: string
79
+ remark2?: string
80
+ paymentAmountCash?: number
81
+ paymentAmountCheck?: number
82
+ paymentAmountPromissoryNote?: number
83
+ paymentAmountAccountsReceivable?: number
84
+ supplyAmount: number
85
+ taxAmount?: number
86
+ totalAmount: number
87
+ taxInvoiceItems?: TaxInvoiceItem[]
88
+ // revisedReason?: RevisedReason
89
+ }
90
+ interface TaxInvoiceItem {
91
+ sequence?: number
92
+ supplyDate: Date
93
+ itemName: string
94
+ specification: string
95
+ quantity: number
96
+ unitPrice: number
97
+ supplyPrice: number
98
+ taxPrice: number
99
+ remark?: string
100
+ }
101
+
102
+ @customElement('tax-invoice-send-page')
103
+ export class TaxInvoiceSendPage extends localize(i18next)(ScopedElementsMixin(PageView)) {
104
+ static styles = [
105
+ ScrollbarStyles,
106
+ CommonGristStyles,
107
+ css`
108
+ :host {
109
+ display: flex;
110
+ flex-direction: column;
111
+
112
+ width: 100%;
113
+ min-width: 850px;
114
+ margin: 0 40px;
115
+
116
+ --grid-record-emphasized-background-color: red;
117
+ --grid-record-emphasized-color: yellow;
118
+ }
119
+
120
+ div.invoice-type {
121
+ font-size: 18px;
122
+ margin-top: 15px;
123
+ }
124
+
125
+ table {
126
+ border: solid;
127
+ border-width: 2px 0;
128
+ border-collapse: collapse;
129
+ border-spacing: 0;
130
+
131
+ input[type='text'] {
132
+ height: 14px;
133
+ margin: 0;
134
+ padding: 4px 5px 5px;
135
+ line-height: 14px;
136
+ border: 1px solid #bbb;
137
+ background: #fff;
138
+ letter-spacing: 0.5px;
139
+ }
140
+ }
141
+
142
+ .title table {
143
+ border-color: #d3dbe5;
144
+ width: 100%;
145
+ height: 33px;
146
+ margin-top: 10px;
147
+ font-size: 12px;
148
+
149
+ th {
150
+ font-size: 13px;
151
+ background-color: #e9edf6;
152
+ min-width: 140px;
153
+ }
154
+ td {
155
+ width: 50%;
156
+ padding-left: 10px;
157
+
158
+ & > * {
159
+ vertical-align: middle;
160
+ }
161
+ & > input {
162
+ margin: 0 5px 0 1px;
163
+ }
164
+ }
165
+ }
166
+
167
+ div.body {
168
+ margin-top: 15px;
169
+ font-size: 14px;
170
+
171
+ div.data {
172
+ display: flex;
173
+ margin-top: 5px;
174
+
175
+ table {
176
+ flex: 1;
177
+
178
+ td,
179
+ th {
180
+ padding: 5px;
181
+ }
182
+ th.target {
183
+ width: 25px;
184
+ writing-mode: vertical-rl;
185
+ }
186
+
187
+ &.supplier {
188
+ border-color: #f64843;
189
+
190
+ td,
191
+ th {
192
+ background-color: #fef5f7;
193
+ border: solid 1.5px #f5b1b1;
194
+ }
195
+ th.target {
196
+ background-color: #fedbde;
197
+ }
198
+ }
199
+ &.buyer {
200
+ border-color: #007ed9;
201
+
202
+ td,
203
+ th {
204
+ background-color: #f7f7ff;
205
+ border: solid 1.5px #a7bcff;
206
+ }
207
+ th.target {
208
+ background-color: #c6daf6;
209
+ }
210
+ }
211
+ }
212
+ }
213
+
214
+ div.items,
215
+ div.info,
216
+ div.summary {
217
+ margin-top: 15px;
218
+
219
+ table {
220
+ width: 100%;
221
+ border-color: #000;
222
+ border-width: 2px 0px 0px 0px;
223
+
224
+ th {
225
+ background-color: #e9edf5;
226
+ }
227
+ th,
228
+ td {
229
+ border: solid 1.5px #c4d2ff;
230
+ padding: 5px;
231
+ text-align: center;
232
+ }
233
+ }
234
+ }
235
+
236
+ div.summary {
237
+ display: flex;
238
+
239
+ & > table {
240
+ flex: 6.7;
241
+ }
242
+ & > div {
243
+ flex: 3.2;
244
+ display: flex;
245
+ justify-content: center;
246
+ align-items: center;
247
+ border: 1.5px solid #c4d2ff;
248
+ border-top: 2px solid #000;
249
+ }
250
+ }
251
+ }
252
+ `
253
+ ]
254
+
255
+ @query('form[name="tax-invoice-form"]') private taxInvoiceForm!: HTMLFormElement
256
+
257
+ @state() supplier: Supplier = {
258
+ supplierBusinessRegistrationNumber: '',
259
+ supplierBusinessName: '',
260
+ supplierRepresentativeName: ''
261
+ }
262
+ @property() buyer: Buyer = {
263
+ buyerBusinessRegistrationCategory: BusinessRegistrationCategory.BUSINESS_REGISTRATION_NUMBER,
264
+ buyerBusinessRegistrationNumber: '',
265
+ buyerBusinessName: '',
266
+ buyerRepresentativeName: ''
267
+ }
268
+ @property() taxInvoice: TaxInvoice = {
269
+ invoiceType: InvoiceType.TAX_INVOICE,
270
+ category: Category.EXPORT,
271
+ issueDate: null,
272
+ purpose: Purpose.RECEIPT,
273
+ supplyAmount: 0,
274
+ totalAmount: 0
275
+ }
276
+
277
+ get context() {
278
+ return {
279
+ title: i18next.t('title.tax invoice send'),
280
+ help: 'tax-invoice-send/tax-invoice-send',
281
+ actions: [
282
+ {
283
+ title: i18next.t('button.tax invoice send'),
284
+ action: this._sendTaxInvoice.bind(this),
285
+ ...CommonButtonStyles.add
286
+ }
287
+ ]
288
+ }
289
+ }
290
+
291
+ render() {
292
+ return html`
293
+ <div class="invoice-type">
294
+ * ${INVOICE_TYPE[this.taxInvoice?.invoiceType]} (${SHORT_BUSINESS_REGISTRATION_CATEGORY[this.buyer.buyerBusinessRegistrationCategory]})
295
+ </div>
296
+
297
+ <div class="title">
298
+ <table>
299
+ <tr>
300
+ <th>${i18next.t('field.short invoice type')}</th>
301
+ <td>
302
+ ${Object.keys(SHORT_INVOICE_TYPE['TAX_INVOICE']).map(key => {
303
+ const disabled: boolean = key !== InvoiceType.TAX_INVOICE
304
+ const checked: boolean = key === InvoiceType.TAX_INVOICE
305
+ return html`
306
+ <label for="${'tax_' + key}">${SHORT_INVOICE_TYPE['TAX_INVOICE'][key]}</label>
307
+ <input type="radio" id="${'tax_' + key}" value="${key}" name="taxInvoice" ?checked=${checked} ?disabled=${disabled} />
308
+ `
309
+ })}
310
+ </td>
311
+ <th>${i18next.t('field.tax invoice buyer registration category')}</th>
312
+ <td>
313
+ ${Object.keys(BUSINESS_REGISTRATION_CATEGORY).map(key => {
314
+ const disabled: boolean = key !== BusinessRegistrationCategory.BUSINESS_REGISTRATION_NUMBER
315
+ const checked: boolean = key === BusinessRegistrationCategory.BUSINESS_REGISTRATION_NUMBER
316
+ return html`
317
+ <label for="${'tax_' + key}">${BUSINESS_REGISTRATION_CATEGORY[key]}</label>
318
+ <input type="radio" id="${'tax_' + key}" value="${key}" name="buyerBusinessRegistrationCategory" ?checked=${checked} ?disabled=${disabled} />
319
+ `
320
+ })}
321
+ </td>
322
+ </tr>
323
+ </table>
324
+ </div>
325
+
326
+ <div class="body">
327
+ <form id="tax-invoice-form">
328
+ <div class="data">
329
+ <table class="supplier">
330
+ <colgroup>
331
+ <col width="150px" />
332
+ <col width="18%" />
333
+ <col width="32%" />
334
+ <col width="18%" />
335
+ <col width="32%" />
336
+ </colgroup>
337
+ <tr>
338
+ <th rowspan="6" class="target">${i18next.t('field.tax invoice supplier')}</th>
339
+ <th>${i18next.t('field.short business registration number')}</th>
340
+ <td><input type="text" name="supplierBusinessRegistrationNumber" .value=${this.supplier?.supplierBusinessRegistrationNumber || ''} readonly /></td>
341
+ <th>${i18next.t('field.short branch identification')}</th>
342
+ <td><input type="text" name="supplierBranchIdentification" .value=${this.supplier?.supplierBranchIdentification || ''} readonly /></td>
343
+ </tr>
344
+ <tr>
345
+ <th>${i18next.t('field.short tax invoice business name')}</th>
346
+ <td><input type="text" name="supplierBusinessName" .value=${this.supplier?.supplierBusinessName || ''} @input=${this._onInputTaxInvoice} /></td>
347
+ <th>${i18next.t('field.short representative name')}</th>
348
+ <td>${this.supplier?.supplierRepresentativeName}</td>
349
+ </tr>
350
+ <tr>
351
+ <th>${i18next.t('field.address')}</th>
352
+ <td colspan="3">${this.supplier?.supplierAddress}</td>
353
+ </tr>
354
+ <tr>
355
+ <th>${i18next.t('field.business type')}</th>
356
+ <td>${this.supplier?.supplierBusinessType}</td>
357
+ <th>${i18next.t('field.industry type')}</th>
358
+ <td>${this.supplier?.supplierIndustryType}</td>
359
+ </tr>
360
+ <tr>
361
+ <th rowspan="2">${i18next.t('field.email')}</th>
362
+ <td rowspan="2" colspan="3">${this.supplier?.supplierContactEmail}</td>
363
+ </tr>
364
+ <tr></tr>
365
+ </table>
366
+
367
+ <table class="buyer">
368
+ <colgroup>
369
+ <col width="150px" />
370
+ <col width="18%" />
371
+ <col width="32%" />
372
+ <col width="18%" />
373
+ <col width="32%" />
374
+ </colgroup>
375
+ <tr>
376
+ <th rowspan="6" class="target">${i18next.t('field.tax invoice buyer')}</th>
377
+ <th>${i18next.t('field.short business registration number')}</th>
378
+ <td>${this.buyer?.buyerBusinessRegistrationNumber}</td>
379
+ <th>${i18next.t('field.short branch identification')}</th>
380
+ <td>${this.buyer?.buyerBranchIdentification}</td>
381
+ </tr>
382
+ <tr>
383
+ <th>${i18next.t('field.short tax invoice business name')}</th>
384
+ <td>${this.buyer?.buyerBusinessName}</td>
385
+ <th>${i18next.t('field.short representative name')}</th>
386
+ <td>${this.buyer?.buyerRepresentativeName}</td>
387
+ </tr>
388
+ <tr>
389
+ <th>${i18next.t('field.address')}</th>
390
+ <td colspan="3">${this.buyer?.buyerAddress}</td>
391
+ </tr>
392
+ <tr>
393
+ <th>${i18next.t('field.business type')}</th>
394
+ <td>${this.buyer?.buyerBusinessType}</td>
395
+ <th>${i18next.t('field.industry type')}</th>
396
+ <td>${this.buyer?.buyerIndustryType}</td>
397
+ </tr>
398
+ <tr>
399
+ <th>${i18next.t('field.email')}</th>
400
+ <td colspan="3">${this.buyer?.buyer1stContactEmail}</td>
401
+ </tr>
402
+ <tr>
403
+ <th>${i18next.t('field.email')}</th>
404
+ <td colspan="3">${this.buyer?.buyer2ndContactEmail}</td>
405
+ </tr>
406
+ </table>
407
+ </div>
408
+
409
+ <div class="info">
410
+ <table>
411
+ <colgroup>
412
+ <col width="15%" />
413
+ <col width="15%" />
414
+ <col width="15%" />
415
+ <col width="40%" />
416
+ </colgroup>
417
+ <tr>
418
+ <th>${i18next.t('field.issue date')}</th>
419
+ <th>${i18next.t('field.supply amount')}</th>
420
+ <th>${i18next.t('field.tax amount')}</th>
421
+ <th>${i18next.t('field.remark0')}</th>
422
+ </tr>
423
+ <tr>
424
+ <td>${this.taxInvoice?.issueDate}</td>
425
+ <td>${this._numberFormat(this.taxInvoice?.supplyAmount)}</td>
426
+ <td>${this._numberFormat(this.taxInvoice?.taxAmount)}</td>
427
+ <td>${this.taxInvoice?.remark0}</td>
428
+ </tr>
429
+ </table>
430
+ </div>
431
+
432
+ <div class="items">
433
+ <table>
434
+ <colgroup>
435
+ <col width="4%" />
436
+ <col width="4%" />
437
+ <col width="15%" />
438
+ <col width="9%" />
439
+ <col width="9%" />
440
+ <col width="13%" />
441
+ <col width="13%" />
442
+ <col width="13%" />
443
+ <col width="20%" />
444
+ </colgroup>
445
+ <tr>
446
+ <th>${i18next.t('field.tax invoice month')}</th>
447
+ <th>${i18next.t('field.tax invoice day')}</th>
448
+ <th>${i18next.t('field.tax invoice item name')}</th>
449
+ <th>${i18next.t('field.tax invoice ea')}</th>
450
+ <th>${i18next.t('field.tax invoice quantity')}</th>
451
+ <th>${i18next.t('field.tax invoice price')}</th>
452
+ <th>${i18next.t('field.supply amount')}</th>
453
+ <th>${i18next.t('field.tax amount')}</th>
454
+ <th>${i18next.t('field.remark0')}</th>
455
+ </tr>
456
+
457
+ ${this.taxInvoice?.taxInvoiceItems?.map(
458
+ item =>
459
+ html`
460
+ <tr>
461
+ <td>${item.supplyDate}</td>
462
+ <td>${item.supplyDate}</td>
463
+ <td>${item.itemName}</td>
464
+ <td>${item.specification}</td>
465
+ <td>${item.quantity}</td>
466
+ <td>${this._numberFormat(item.unitPrice)}</td>
467
+ <td>${this._numberFormat(item.supplyPrice)}</td>
468
+ <td>${this._numberFormat(item.taxPrice)}</td>
469
+ <td>${item.remark}</td>
470
+ </tr>
471
+ `
472
+ )}
473
+ </table>
474
+ </div>
475
+
476
+ <div class="summary">
477
+ <table>
478
+ <colgroup>
479
+ <col width="20%" />
480
+ <col width="20%" />
481
+ <col width="20%" />
482
+ <col width="20%" />
483
+ <col width="20%" />
484
+ </colgroup>
485
+ <tr>
486
+ <th>${i18next.t('field.total amount')}</th>
487
+ <th>${i18next.t('field.tax invoice payment cash')}</th>
488
+ <th>${i18next.t('field.tax invoice payment check')}</th>
489
+ <th>${i18next.t('field.tax invoice payment promissory note')}</th>
490
+ <th>${i18next.t('field.tax invoice payment accounts receivable')}</th>
491
+ </tr>
492
+ <tr>
493
+ <td>${this._numberFormat(this.taxInvoice?.totalAmount)}</td>
494
+ <td>${this._numberFormat(this.taxInvoice?.paymentAmountCash)}</td>
495
+ <td>${this._numberFormat(this.taxInvoice?.paymentAmountCheck)}</td>
496
+ <td>${this._numberFormat(this.taxInvoice?.paymentAmountPromissoryNote)}</td>
497
+ <td>${this._numberFormat(this.taxInvoice?.paymentAmountAccountsReceivable)}</td>
498
+ </tr>
499
+ </table>
500
+ <div>${i18next.t('text.tax invoice description payment', { value: i18next.t(`text.tax invoice description purpose ${this.taxInvoice?.purpose}`) })}</div>
501
+ </div>
502
+ </form>
503
+ </div>
504
+ `
505
+ }
506
+
507
+ async pageInitialized(lifecycle: any) {
508
+ this._fetchSupplier()
509
+ }
510
+
511
+ async _fetchSupplier() {
512
+ const response = await client.query({
513
+ query: gql`
514
+ query TaxInvoiceApi() {
515
+ taxInvoiceApi() {
516
+ businessRegistrationNumber
517
+ branchIdentification
518
+ businessName
519
+ representativeName
520
+ address
521
+ businessType
522
+ industryType
523
+ department
524
+ contactName
525
+ contactPhone
526
+ contactEmail
527
+ contactCellPhone
528
+ }
529
+ }
530
+ `
531
+ })
532
+
533
+ console.log('response.data.responses : ', response.data.responses)
534
+
535
+ this.supplier = response.data.responses
536
+ }
537
+
538
+ async pageUpdated(changes: any, lifecycle: any) {
539
+ if (this.active) {
540
+ // do something here when this page just became as active
541
+ }
542
+ }
543
+
544
+ async _sendTaxInvoice(num: string) {
545
+ console.log(this.taxInvoiceForm)
546
+ console.log(this.supplier)
547
+
548
+ return
549
+
550
+ const response = await client.mutate({
551
+ mutation: gql`
552
+ mutation SendTaxInvoiceByApi($taxInvoice: NewTaxInvoice!, $taxInvoiceItems: [NewTaxInvoiceItem!]!) {
553
+ sendTaxInvoiceByApi(taxInvoice: $taxInvoice, taxInvoiceItems: $taxInvoiceItems) {
554
+ id
555
+ }
556
+ }
557
+ `,
558
+ variables: {
559
+ // taxInvoice,
560
+ // taxInvoiceItems
561
+ }
562
+ })
563
+
564
+ if (!response.errors) {
565
+ notify({
566
+ message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') })
567
+ })
568
+ }
569
+ }
570
+
571
+ private _numberFormat(value: number | undefined): string {
572
+ return !value ? '' : new Intl.NumberFormat('en-US').format(value)
573
+ }
574
+
575
+ // Input 요소의 값이 변경될 때 호출되는 콜백 함수
576
+ private _onInputTaxInvoice(event: InputEvent) {
577
+ const target = event.target as HTMLInputElement
578
+ this.supplier[target.name] = target.value
579
+ }
580
+ }
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