@things-factory/tax-invoice 6.2.96 → 6.2.98

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 (30) hide show
  1. package/client/pages/tax-invoice-send/tax-invoice-send-page.ts +294 -246
  2. package/dist-client/pages/tax-invoice-send/tax-invoice-send-page.d.ts +1 -1
  3. package/dist-client/pages/tax-invoice-send/tax-invoice-send-page.js +286 -244
  4. package/dist-client/pages/tax-invoice-send/tax-invoice-send-page.js.map +1 -1
  5. package/dist-client/tsconfig.tsbuildinfo +1 -1
  6. package/dist-server/service/tax-invoice/tax-invoice-mutation.js +6 -6
  7. package/dist-server/service/tax-invoice/tax-invoice-mutation.js.map +1 -1
  8. package/dist-server/service/tax-invoice/tax-invoice-type.js +2 -2
  9. package/dist-server/service/tax-invoice/tax-invoice-type.js.map +1 -1
  10. package/dist-server/service/tax-invoice-api/tax-invoice-api-mutation.js +146 -0
  11. package/dist-server/service/tax-invoice-api/tax-invoice-api-mutation.js.map +1 -1
  12. package/dist-server/service/tax-invoice-api/tax-invoice-api-type.js +17 -1
  13. package/dist-server/service/tax-invoice-api/tax-invoice-api-type.js.map +1 -1
  14. package/dist-server/service/tax-invoice-item/tax-invoice-item-type.js +2 -2
  15. package/dist-server/service/tax-invoice-item/tax-invoice-item-type.js.map +1 -1
  16. package/dist-server/service/unipost-api/tax-invoice-inquiry.js +5 -5
  17. package/dist-server/service/unipost-api/tax-invoice-inquiry.js.map +1 -1
  18. package/dist-server/service/unipost-api/tax-invoice-send.js +38 -0
  19. package/dist-server/service/unipost-api/tax-invoice-send.js.map +1 -0
  20. package/dist-server/tsconfig.tsbuildinfo +1 -1
  21. package/package.json +2 -2
  22. package/server/service/tax-invoice/tax-invoice-mutation.ts +6 -6
  23. package/server/service/tax-invoice/tax-invoice-type.ts +2 -2
  24. package/server/service/tax-invoice-api/tax-invoice-api-mutation.ts +161 -1
  25. package/server/service/tax-invoice-api/tax-invoice-api-type.ts +11 -0
  26. package/server/service/tax-invoice-item/tax-invoice-item-type.ts +2 -2
  27. package/server/service/unipost-api/tax-invoice-inquiry.ts +5 -5
  28. package/server/service/unipost-api/tax-invoice-send.ts +42 -0
  29. package/dist-server/service/unipost-api/test-data.js +0 -3812
  30. package/dist-server/service/unipost-api/test-data.js.map +0 -1
@@ -10,7 +10,6 @@ import { i18next, localize } from '@operato/i18n'
10
10
  import { notify } from '@operato/layout'
11
11
  import gql from 'graphql-tag'
12
12
  import { BUSINESS_REGISTRATION_CATEGORY, BusinessRegistrationCategory, Category, INVOICE_TYPE, InvoiceType, PURPOSE, Purpose } from '../tax-invoice/tax-invoice-list-page'
13
- import { keyed } from 'lit/directives/keyed.js'
14
13
 
15
14
  const SHORT_INVOICE_TYPE = {
16
15
  TAX_INVOICE: {
@@ -33,6 +32,7 @@ const SHORT_BUSINESS_REGISTRATION_CATEGORY = {
33
32
  }
34
33
 
35
34
  interface Supplier {
35
+ supplierBusinessRegistrationCategory: string
36
36
  supplierBusinessRegistrationNumber: string
37
37
  supplierBranchIdentification?: string
38
38
  supplierBusinessName: string
@@ -113,8 +113,7 @@ export class TaxInvoiceSendPage extends localize(i18next)(ScopedElementsMixin(Pa
113
113
 
114
114
  width: 100%;
115
115
  min-width: 850px;
116
- margin: 0 40px;
117
- padding-bottom: 40px;
116
+ padding: 0 40px 40px 40px;
118
117
 
119
118
  --grid-record-emphasized-background-color: red;
120
119
  --grid-record-emphasized-color: yellow;
@@ -303,6 +302,21 @@ export class TaxInvoiceSendPage extends localize(i18next)(ScopedElementsMixin(Pa
303
302
  border: 1.5px solid #c4d2ff;
304
303
  border-top: 2px solid #000;
305
304
  }
305
+
306
+ span.type-wrapper {
307
+ margin: 0 10px;
308
+
309
+ & > div {
310
+ display: flex;
311
+ justify-content: center;
312
+ align-items: center;
313
+ gap: 4px;
314
+
315
+ input[type='radio' i] {
316
+ margin: 0px;
317
+ }
318
+ }
319
+ }
306
320
  }
307
321
 
308
322
  div.items {
@@ -343,19 +357,11 @@ export class TaxInvoiceSendPage extends localize(i18next)(ScopedElementsMixin(Pa
343
357
  `
344
358
  ]
345
359
 
346
- private today: string = new Intl.DateTimeFormat('ko-KR', {
347
- timeZone: 'Asia/Seoul',
348
- year: 'numeric',
349
- month: '2-digit',
350
- day: '2-digit'
351
- })
352
- .format(new Date())
353
- .replace(/[.\s]/g, '')
354
- .replace(/(\d{4})(\d{2})(\d{2})/g, '$1-$2-$3')
355
-
356
- @query('form[name="tax-invoice-form"]') private taxInvoiceForm!: HTMLFormElement
360
+ // 오늘 날짜 YYYY-MM-DD 형식으로 뽑기
361
+ private today: string = new Intl.DateTimeFormat('fr-CA', { timeZone: 'Asia/Seoul' }).format(new Date())
357
362
 
358
363
  @state() supplier: Supplier = {
364
+ supplierBusinessRegistrationCategory: '01',
359
365
  supplierBusinessRegistrationNumber: '',
360
366
  supplierBranchIdentification: '',
361
367
  supplierBusinessName: '',
@@ -419,7 +425,7 @@ export class TaxInvoiceSendPage extends localize(i18next)(ScopedElementsMixin(Pa
419
425
  const checked: boolean = key === InvoiceType.TAX_INVOICE
420
426
  return html`
421
427
  <label for="${'tax_' + key}">${SHORT_INVOICE_TYPE['TAX_INVOICE'][key]}</label>
422
- <input type="radio" id="${'tax_' + key}" value="${key}" name="taxInvoice" ?checked=${checked} ?disabled=${disabled} />
428
+ <input type="radio" id="${'tax_' + key}" value="${key}" name="invoiceType" ?checked=${checked} ?disabled=${disabled} />
423
429
  `
424
430
  })}
425
431
  </td>
@@ -439,226 +445,225 @@ export class TaxInvoiceSendPage extends localize(i18next)(ScopedElementsMixin(Pa
439
445
  </div>
440
446
 
441
447
  <div class="body">
442
- <form id="tax-invoice-form">
443
- <div class="data">
444
- <table class="supplier">
445
- <colgroup>
446
- <col width="150px" />
447
- <col width="18%" />
448
- <col width="32%" />
449
- <col width="18%" />
450
- <col width="32%" />
451
- </colgroup>
452
- <tr>
453
- <th rowspan="6" class="target">${i18next.t('field.tax invoice supplier')}</th>
454
- <th required>${i18next.t('field.short business registration number')}</th>
455
- <td>${this.supplier?.supplierBusinessRegistrationNumber.replace(/(\S{3})(\S{2})(\S{5})/g, '$1-$2-$3')}</td>
456
- <th>${i18next.t('field.short branch identification')}</th>
457
- <td>${this.supplier?.supplierBranchIdentification}</td>
458
- </tr>
459
- <tr>
460
- <th required>${i18next.t('field.short tax invoice business name')}</th>
461
- <td><input type="text" name="supplierBusinessName" .value=${this.supplier?.supplierBusinessName || ''} @input=${this._onInputTaxInvoice} /></td>
462
- <th required>${i18next.t('field.tax invoice representative name')}</th>
463
- <td>
464
- <input type="text" name="supplierRepresentativeName" .value=${this.supplier?.supplierRepresentativeName || ''} @input=${this._onInputTaxInvoice} />
465
- </td>
466
- </tr>
467
- <tr>
468
- <th>${i18next.t('field.address')}</th>
469
- <td colspan="3">${this.supplier?.supplierAddress}</td>
470
- </tr>
471
- <tr>
472
- <th>${i18next.t('field.business type')}</th>
473
- <td><input type="text" name="supplierBusinessType" .value=${this.supplier?.supplierBusinessType || ''} @input=${this._onInputTaxInvoice} /></td>
474
- <th>${i18next.t('field.industry type')}</th>
475
- <td><input type="text" name="supplierIndustryType" .value=${this.supplier?.supplierIndustryType || ''} @input=${this._onInputTaxInvoice} /></td>
476
- </tr>
477
- <tr>
478
- <th rowspan="2">${i18next.t('field.email')}</th>
479
- <td rowspan="2" colspan="3">
480
- <input type="text" name="supplierContactEmail" .value=${this.supplier?.supplierContactEmail || ''} @input=${this._onInputTaxInvoice} />
481
- </td>
482
- </tr>
483
- <tr></tr>
484
- </table>
485
-
486
- <table class="buyer">
487
- <colgroup>
488
- <col width="150px" />
489
- <col width="18%" />
490
- <col width="32%" />
491
- <col width="18%" />
492
- <col width="32%" />
493
- </colgroup>
494
- <tr>
495
- <th rowspan="6" class="target">${i18next.t('field.tax invoice buyer')}</th>
496
- <th required>${i18next.t('field.short business registration number')}</th>
497
- <td>
498
- <input
499
- type="text"
500
- name="buyerBusinessRegistrationNumber"
501
- .value=${this.buyer?.buyerBusinessRegistrationNumber || ''}
502
- @input=${this._onInputTaxInvoice}
503
- />
504
- </td>
505
- <th>${i18next.t('field.short branch identification')}</th>
506
- <td><input type="text" name="buyerBranchIdentification" .value=${this.buyer?.buyerBranchIdentification || ''} @input=${this._onInputTaxInvoice} /></td>
507
- </tr>
508
- <tr>
509
- <th required>${i18next.t('field.short tax invoice business name')}</th>
510
- <td><input type="text" name="buyerBusinessName" .value=${this.buyer?.buyerBusinessName || ''} @input=${this._onInputTaxInvoice} /></td>
511
- <th required>${i18next.t('field.tax invoice representative name')}</th>
512
- <td><input type="text" name="buyerRepresentativeName" .value=${this.buyer?.buyerRepresentativeName || ''} @input=${this._onInputTaxInvoice} /></td>
513
- </tr>
514
- <tr>
515
- <th>${i18next.t('field.address')}</th>
516
- <td colspan="3"><input type="text" name="buyerAddress" .value=${this.buyer?.buyerAddress || ''} @input=${this._onInputTaxInvoice} /></td>
517
- </tr>
518
- <tr>
519
- <th>${i18next.t('field.business type')}</th>
520
- <td><input type="text" name="buyerBusinessType" .value=${this.buyer?.buyerBusinessType || ''} @input=${this._onInputTaxInvoice} /></td>
521
-
522
- <th>${i18next.t('field.industry type')}</th>
523
- <td><input type="text" name="buyerIndustryType" .value=${this.buyer?.buyerIndustryType || ''} @input=${this._onInputTaxInvoice} /></td>
524
- </tr>
525
- <tr>
526
- <th>${i18next.t('field.email')}</th>
527
- <td colspan="3"><input type="text" name="buyer1stContactEmail" .value=${this.buyer?.buyer1stContactEmail || ''} @input=${this._onInputTaxInvoice} /></td>
528
- </tr>
529
- <tr>
530
- <th>${i18next.t('field.email')}</th>
531
- <td colspan="3"><input type="text" name="buyer2ndContactEmail" .value=${this.buyer?.buyer2ndContactEmail || ''} @input=${this._onInputTaxInvoice} /></td>
532
- </tr>
533
- </table>
534
- </div>
535
-
536
- <div class="info flex-column">
537
- <div class="flex-row">
538
- <div class="title" required>${i18next.t('field.issue date')}</div>
539
- <div class="value">
540
- <input type="date" name="issueDate" .value=${this.taxInvoice.issueDate} @input=${this._onInputTaxInvoice} />
541
- <span class="desc">※ 작성일자는 공급 연월일을 의미함</span>
542
- </div>
543
- <div class="title">${i18next.t('field.remark0')}</div>
544
- <div class="value"><input type="text" name="remark0" .value=${this.taxInvoice?.remark0 || ''} @input=${this._onInputTaxInvoice} /></div>
545
- </div>
546
- <div class="flex-row">
547
- <div class="title">${i18next.t('field.total amount')}</div>
548
- <div class="value">${this._numberFormat(this.taxInvoice?.totalAmount)}</div>
549
- <div class="title">${i18next.t('field.supply amount')}</div>
550
- <div class="value">${this._numberFormat(this.taxInvoice?.supplyAmount)}</div>
551
- <div class="title">${i18next.t('field.tax amount')}</div>
552
- <div class="value">${this._numberFormat(this.taxInvoice?.taxAmount)}</div>
448
+ <div class="data">
449
+ <table class="supplier">
450
+ <colgroup>
451
+ <col width="150px" />
452
+ <col width="18%" />
453
+ <col width="32%" />
454
+ <col width="18%" />
455
+ <col width="32%" />
456
+ </colgroup>
457
+ <tr>
458
+ <th rowspan="6" class="target">${i18next.t('field.tax invoice supplier')}</th>
459
+ <th required>${i18next.t('field.short business registration number')}</th>
460
+ <td>${this.supplier?.supplierBusinessRegistrationNumber.replace(/(\S{3})(\S{2})(\S{5})/g, '$1-$2-$3')}</td>
461
+ <th>${i18next.t('field.short branch identification')}</th>
462
+ <td>${this.supplier?.supplierBranchIdentification}</td>
463
+ </tr>
464
+ <tr>
465
+ <th required>${i18next.t('field.short tax invoice business name')}</th>
466
+ <td><input type="text" name="supplierBusinessName" .value=${this.supplier?.supplierBusinessName || ''} @input=${this._onInputTaxInvoice} /></td>
467
+ <th required>${i18next.t('field.tax invoice representative name')}</th>
468
+ <td>
469
+ <input type="text" name="supplierRepresentativeName" .value=${this.supplier?.supplierRepresentativeName || ''} @input=${this._onInputTaxInvoice} />
470
+ </td>
471
+ </tr>
472
+ <tr>
473
+ <th>${i18next.t('field.address')}</th>
474
+ <td colspan="3">${this.supplier?.supplierAddress}</td>
475
+ </tr>
476
+ <tr>
477
+ <th>${i18next.t('field.business type')}</th>
478
+ <td><input type="text" name="supplierBusinessType" .value=${this.supplier?.supplierBusinessType || ''} @input=${this._onInputTaxInvoice} /></td>
479
+ <th>${i18next.t('field.industry type')}</th>
480
+ <td><input type="text" name="supplierIndustryType" .value=${this.supplier?.supplierIndustryType || ''} @input=${this._onInputTaxInvoice} /></td>
481
+ </tr>
482
+ <tr>
483
+ <th rowspan="2">${i18next.t('field.email')}</th>
484
+ <td rowspan="2" colspan="3">
485
+ <input type="text" name="supplierContactEmail" .value=${this.supplier?.supplierContactEmail || ''} @input=${this._onInputTaxInvoice} />
486
+ </td>
487
+ </tr>
488
+ <tr></tr>
489
+ </table>
490
+
491
+ <table class="buyer">
492
+ <colgroup>
493
+ <col width="150px" />
494
+ <col width="18%" />
495
+ <col width="32%" />
496
+ <col width="18%" />
497
+ <col width="32%" />
498
+ </colgroup>
499
+ <tr>
500
+ <th rowspan="6" class="target">${i18next.t('field.tax invoice buyer')}</th>
501
+ <th required>${i18next.t('field.short business registration number')}</th>
502
+ <td>
503
+ <input
504
+ type="text"
505
+ maxlength="10"
506
+ name="buyerBusinessRegistrationNumber"
507
+ .value=${this.buyer?.buyerBusinessRegistrationNumber || ''}
508
+ @input=${this._onInputTaxInvoice}
509
+ />
510
+ </td>
511
+ <th>${i18next.t('field.short branch identification')}</th>
512
+ <td><input type="text" name="buyerBranchIdentification" .value=${this.buyer?.buyerBranchIdentification || ''} @input=${this._onInputTaxInvoice} /></td>
513
+ </tr>
514
+ <tr>
515
+ <th required>${i18next.t('field.short tax invoice business name')}</th>
516
+ <td><input type="text" name="buyerBusinessName" .value=${this.buyer?.buyerBusinessName || ''} @input=${this._onInputTaxInvoice} /></td>
517
+ <th required>${i18next.t('field.tax invoice representative name')}</th>
518
+ <td><input type="text" name="buyerRepresentativeName" .value=${this.buyer?.buyerRepresentativeName || ''} @input=${this._onInputTaxInvoice} /></td>
519
+ </tr>
520
+ <tr>
521
+ <th>${i18next.t('field.address')}</th>
522
+ <td colspan="3"><input type="text" name="buyerAddress" .value=${this.buyer?.buyerAddress || ''} @input=${this._onInputTaxInvoice} /></td>
523
+ </tr>
524
+ <tr>
525
+ <th>${i18next.t('field.business type')}</th>
526
+ <td><input type="text" name="buyerBusinessType" .value=${this.buyer?.buyerBusinessType || ''} @input=${this._onInputTaxInvoice} /></td>
527
+
528
+ <th>${i18next.t('field.industry type')}</th>
529
+ <td><input type="text" name="buyerIndustryType" .value=${this.buyer?.buyerIndustryType || ''} @input=${this._onInputTaxInvoice} /></td>
530
+ </tr>
531
+ <tr>
532
+ <th>${i18next.t('field.email')}</th>
533
+ <td colspan="3"><input type="text" name="buyer1stContactEmail" .value=${this.buyer?.buyer1stContactEmail || ''} @input=${this._onInputTaxInvoice} /></td>
534
+ </tr>
535
+ <tr>
536
+ <th>${i18next.t('field.email')}</th>
537
+ <td colspan="3"><input type="text" name="buyer2ndContactEmail" .value=${this.buyer?.buyer2ndContactEmail || ''} @input=${this._onInputTaxInvoice} /></td>
538
+ </tr>
539
+ </table>
540
+ </div>
541
+
542
+ <div class="info flex-column">
543
+ <div class="flex-row">
544
+ <div class="title" required>${i18next.t('field.issue date')}</div>
545
+ <div class="value">
546
+ <input type="date" name="issueDate" .value=${this.taxInvoice.issueDate} @input=${this._onInputTaxInvoice} />
547
+ <span class="desc">※ 작성일자는 공급 연월일을 의미함</span>
553
548
  </div>
549
+ <div class="title">${i18next.t('field.remark0')}</div>
550
+ <div class="value"><input type="text" name="remark0" .value=${this.taxInvoice?.remark0 || ''} @input=${this._onInputTaxInvoice} /></div>
554
551
  </div>
555
-
556
- <div class="items">
557
- <div class="desc desc-date">
558
- ※ 아래 '품목'의 '월'은 상단 '작성일자'의 '월'이 자동 반영됩니다. 합계의 '계산' 버튼은 금액을 공급가액과 세액으로 계산할 수 있습니다.
559
- </div>
560
- <div class="desc"><button class="btn-add" @click=${this._onAddInvoiceItem}>품목추가</button> 품목은 최대 16개까지 추가, 삭제 가능</div>
561
-
562
- <table>
563
- <colgroup>
564
- <col width="5%" />
565
- <col width="5%" />
566
- <col width="14%" />
567
- <col width="7%" />
568
- <col width="7%" />
569
- <col width="12%" />
570
- <col width="12%" />
571
- <col width="12%" />
572
- <col width="16%" />
573
- <col width="8%" />
574
- </colgroup>
575
- <tr>
576
- <th>${i18next.t('field.tax invoice month')}</th>
577
- <th>${i18next.t('field.tax invoice day')}</th>
578
- <th>${i18next.t('field.tax invoice item name')}</th>
579
- <th>${i18next.t('field.tax invoice ea')}</th>
580
- <th>${i18next.t('field.tax invoice quantity')}</th>
581
- <th>${i18next.t('field.tax invoice price')}</th>
582
- <th>${i18next.t('field.supply amount')}</th>
583
- <th>${i18next.t('field.tax amount')}</th>
584
- <th>${i18next.t('field.remark0')}</th>
585
- <th>${i18next.t('field.delete')}</th>
586
- </tr>
587
-
588
- ${this.taxInvoiceItems.map(
589
- (item, idx) =>
590
- html`
591
- <tr>
592
- <input type="hidden" name="sequence" value=${item.sequence} />
593
- <td>${this.taxInvoice.issueDate.split('-')[1]}</td>
594
- <td><input type="text" numeric maxlength="2" name="supplyDate" @input=${e => this._onInputItem(e, idx)} /></td>
595
- <td><input type="text" name="itemName" .value=${item.itemName} @input=${e => this._onInputItem(e, idx)} /></td>
596
- <td><input type="text" name="specification" .value=${item.specification} @input=${e => this._onInputItem(e, idx)} /></td>
597
- <td><input type="text" numeric name="quantity" .value=${this._numberFormat(item.quantity)} @input=${e => this._onInputItem(e, idx)} /></td>
598
- <td><input type="text" numeric name="unitPrice" .value=${this._numberFormat(item.unitPrice)} @input=${e => this._onInputItem(e, idx)} /></td>
599
- <td><input type="text" readonly name="supplyPrice" .value=${this._numberFormat(item.supplyPrice)} @input=${e => this._onInputItem(e, idx)} /></td>
600
- <td><input type="text" readonly name="taxPrice" .value=${this._numberFormat(item.taxPrice)} @input=${e => this._onInputItem(e, idx)} /></td>
601
- <td><input type="text" name="remark" .value=${item.remark || ''} @input=${e => this._onInputItem(e, idx)} /></td>
602
- <td><button class="btn-delete" @click=${e => this._onRemoveInvoiceItem(e, item.sequence)}>삭제</button></td>
603
- </tr>
604
- `
605
- )}
606
- </table>
552
+ <div class="flex-row">
553
+ <div class="title">${i18next.t('field.total amount')}</div>
554
+ <div class="value">${this._numberFormat(this.taxInvoice?.totalAmount)}</div>
555
+ <div class="title">${i18next.t('field.supply amount')}</div>
556
+ <div class="value">${this._numberFormat(this.taxInvoice?.supplyAmount)}</div>
557
+ <div class="title">${i18next.t('field.tax amount')}</div>
558
+ <div class="value">${this._numberFormat(this.taxInvoice?.taxAmount)}</div>
607
559
  </div>
560
+ </div>
608
561
 
609
- <div class="summary">
610
- <table>
611
- <colgroup>
612
- <col width="25%" />
613
- <col width="25%" />
614
- <col width="25%" />
615
- <col width="25%" />
616
- </colgroup>
617
- <tr>
618
- <th>${i18next.t('field.tax invoice payment cash')}</th>
619
- <th>${i18next.t('field.tax invoice payment check')}</th>
620
- <th>${i18next.t('field.tax invoice payment promissory note')}</th>
621
- <th>${i18next.t('field.tax invoice payment accounts receivable')}</th>
622
- </tr>
623
- <tr>
624
- <td><input type="text" numeric name="paymentAmountCash" .value=${this.taxInvoice?.paymentAmountCash} @input=${this._onInputTaxInvoice} /></td>
625
- <td><input type="text" numeric name="paymentAmountCheck" .value=${this.taxInvoice?.paymentAmountCheck} @input=${this._onInputTaxInvoice} /></td>
626
- <td>
627
- <input
628
- type="text"
629
- numeric
630
- name="paymentAmountPromissoryNote"
631
- .value=${this.taxInvoice?.paymentAmountPromissoryNote}
632
- @input=${this._onInputTaxInvoice}
633
- />
634
- </td>
635
- <td>
636
- <input
637
- type="text"
638
- numeric
639
- name="paymentAmountAccountsReceivable"
640
- .value=${this.taxInvoice?.paymentAmountAccountsReceivable}
641
- @input=${this._onInputTaxInvoice}
642
- />
643
- </td>
644
- </tr>
645
- </table>
646
- <div>
647
- ${i18next.t('text.prev tax invoice description payment') + ' ('}
648
- <span style="margin:0 10px">
649
- <div>
650
- <input type="radio" id="purpose_20" name="purpose" .value=${Purpose.INVOICE} @change=${this._onInputTaxInvoice} checked />
651
- <label for="purpose_20">${PURPOSE[Purpose.INVOICE]}</label>
652
- </div>
653
- <div>
654
- <input type="radio" id="purpose_10" name="purpose" .value=${Purpose.RECEIPT} @change=${this._onInputTaxInvoice} />
655
- <label for="purpose_10">${PURPOSE[Purpose.RECEIPT]}</label>
656
- </div>
657
- </span>
658
- ${') ' + i18next.t('text.next tax invoice description payment')}
659
- </div>
562
+ <div class="items">
563
+ <div class="desc desc-date">
564
+ ※ 아래 '품목'의 '월'은 상단 '작성일자'의 '월'이 자동 반영됩니다. 합계의 '계산' 버튼은 금액을 공급가액과 세액으로 계산할 수 있습니다.
565
+ </div>
566
+ <div class="desc"><button class="btn-add" @click=${this._onAddInvoiceItem}>품목추가</button> 품목은 최대 16개까지 추가, 삭제 가능</div>
567
+
568
+ <table>
569
+ <colgroup>
570
+ <col width="5%" />
571
+ <col width="5%" />
572
+ <col width="14%" />
573
+ <col width="7%" />
574
+ <col width="7%" />
575
+ <col width="12%" />
576
+ <col width="12%" />
577
+ <col width="12%" />
578
+ <col width="16%" />
579
+ <col width="8%" />
580
+ </colgroup>
581
+ <tr>
582
+ <th>${i18next.t('field.tax invoice month')}</th>
583
+ <th required>${i18next.t('field.tax invoice day')}</th>
584
+ <th required>${i18next.t('field.tax invoice item name')}</th>
585
+ <th>${i18next.t('field.tax invoice ea')}</th>
586
+ <th required>${i18next.t('field.tax invoice quantity')}</th>
587
+ <th required>${i18next.t('field.tax invoice price')}</th>
588
+ <th>${i18next.t('field.supply amount')}</th>
589
+ <th>${i18next.t('field.tax amount')}</th>
590
+ <th>${i18next.t('field.remark0')}</th>
591
+ <th>${i18next.t('field.delete')}</th>
592
+ </tr>
593
+
594
+ ${this.taxInvoiceItems.map(
595
+ (item, idx) =>
596
+ html`
597
+ <tr>
598
+ <input type="hidden" name="sequence" value=${item.sequence} />
599
+ <td>${this.taxInvoice.issueDate.split('-')[1]}</td>
600
+ <td><input type="text" numeric maxlength="2" name="supplyDate" @input=${e => this._onInputItem(e, idx)} /></td>
601
+ <td><input type="text" name="itemName" .value=${item.itemName} @input=${e => this._onInputItem(e, idx)} /></td>
602
+ <td><input type="text" name="specification" .value=${item.specification} @input=${e => this._onInputItem(e, idx)} /></td>
603
+ <td><input type="text" numeric name="quantity" .value=${this._numberFormat(item.quantity)} @input=${e => this._onInputItem(e, idx)} /></td>
604
+ <td><input type="text" numeric name="unitPrice" .value=${this._numberFormat(item.unitPrice)} @input=${e => this._onInputItem(e, idx)} /></td>
605
+ <td><input type="text" readonly name="supplyPrice" .value=${this._numberFormat(item.supplyPrice)} @input=${e => this._onInputItem(e, idx)} /></td>
606
+ <td><input type="text" readonly name="taxPrice" .value=${this._numberFormat(item.taxPrice)} @input=${e => this._onInputItem(e, idx)} /></td>
607
+ <td><input type="text" name="remark" .value=${item.remark || ''} @input=${e => this._onInputItem(e, idx)} /></td>
608
+ <td><button class="btn-delete" @click=${e => this._onRemoveInvoiceItem(e, item.sequence)}>삭제</button></td>
609
+ </tr>
610
+ `
611
+ )}
612
+ </table>
613
+ </div>
614
+
615
+ <div class="summary">
616
+ <table>
617
+ <colgroup>
618
+ <col width="25%" />
619
+ <col width="25%" />
620
+ <col width="25%" />
621
+ <col width="25%" />
622
+ </colgroup>
623
+ <tr>
624
+ <th>${i18next.t('field.tax invoice payment cash')}</th>
625
+ <th>${i18next.t('field.tax invoice payment check')}</th>
626
+ <th>${i18next.t('field.tax invoice payment promissory note')}</th>
627
+ <th>${i18next.t('field.tax invoice payment accounts receivable')}</th>
628
+ </tr>
629
+ <tr>
630
+ <td><input type="text" numeric name="paymentAmountCash" .value=${this.taxInvoice?.paymentAmountCash || ''} @input=${this._onInputTaxInvoice} /></td>
631
+ <td><input type="text" numeric name="paymentAmountCheck" .value=${this.taxInvoice?.paymentAmountCheck || ''} @input=${this._onInputTaxInvoice} /></td>
632
+ <td>
633
+ <input
634
+ type="text"
635
+ numeric
636
+ name="paymentAmountPromissoryNote"
637
+ .value=${this.taxInvoice?.paymentAmountPromissoryNote || ''}
638
+ @input=${this._onInputTaxInvoice}
639
+ />
640
+ </td>
641
+ <td>
642
+ <input
643
+ type="text"
644
+ numeric
645
+ name="paymentAmountAccountsReceivable"
646
+ .value=${this.taxInvoice?.paymentAmountAccountsReceivable || ''}
647
+ @input=${this._onInputTaxInvoice}
648
+ />
649
+ </td>
650
+ </tr>
651
+ </table>
652
+ <div>
653
+ ${i18next.t('text.prev tax invoice description payment') + ' ('}
654
+ <span class="type-wrapper">
655
+ <div>
656
+ <input type="radio" id="purpose_20" name="purpose" .value=${Purpose.INVOICE} @change=${this._onInputTaxInvoice} checked />
657
+ <label for="purpose_20">${PURPOSE[Purpose.INVOICE]}</label>
658
+ </div>
659
+ <div>
660
+ <input type="radio" id="purpose_10" name="purpose" .value=${Purpose.RECEIPT} @change=${this._onInputTaxInvoice} />
661
+ <label for="purpose_10">${PURPOSE[Purpose.RECEIPT]}</label>
662
+ </div>
663
+ </span>
664
+ ${') ' + i18next.t('text.next tax invoice description payment')}
660
665
  </div>
661
- </form>
666
+ </div>
662
667
  </div>
663
668
  `
664
669
  }
@@ -691,6 +696,7 @@ export class TaxInvoiceSendPage extends localize(i18next)(ScopedElementsMixin(Pa
691
696
 
692
697
  const supplier = response.data.response
693
698
  this.supplier = {
699
+ supplierBusinessRegistrationCategory: supplier.businessRegistrationCategory,
694
700
  supplierBusinessRegistrationNumber: supplier.businessRegistrationNumber,
695
701
  supplierBranchIdentification: supplier.branchIdentification,
696
702
  supplierBusinessName: supplier.businessName,
@@ -713,35 +719,57 @@ export class TaxInvoiceSendPage extends localize(i18next)(ScopedElementsMixin(Pa
713
719
  }
714
720
 
715
721
  async _sendTaxInvoice(num: string) {
716
- this.taxInvoiceItems = this.taxInvoiceItems.map((item, idx) => ({ ...item, sequence: idx + 1 }))
717
-
718
- console.log('taxInvoice : ', this.taxInvoice)
719
- console.log('taxInvoiceItems : ', this.taxInvoiceItems)
720
- // console.log('supplier : ', this.supplier)
721
- // console.log('buyer : ', this.buyer)
722
+ // 아이템 시퀀스 재 할당 + 날짜, 품목, 규격, 수량이 없으면 필터
723
+ let taxInvoiceItems = this.taxInvoiceItems.map((item, idx) => ({ ...item, sequence: idx + 1, quantity: Number(item.quantity), unitPrice: Number(item.unitPrice) }))
724
+ taxInvoiceItems = taxInvoiceItems.filter(item => item.supplyDate && item.itemName && item.quantity && item.unitPrice)
725
+
726
+ // taxInvoice 데이터 생성 및 타입 변환
727
+ let taxInvoice = { ...this.taxInvoice, ...this.supplier, ...this.buyer }
728
+ taxInvoice.paymentAmountCash = Number(taxInvoice.paymentAmountCash || 0)
729
+ taxInvoice.paymentAmountCheck = Number(taxInvoice.paymentAmountCheck || 0)
730
+ taxInvoice.paymentAmountPromissoryNote = Number(taxInvoice.paymentAmountPromissoryNote || 0)
731
+ taxInvoice.paymentAmountAccountsReceivable = Number(taxInvoice.paymentAmountAccountsReceivable || 0)
732
+
733
+ // 공급받는자 필수 값 체크
734
+ if (!this.buyer.buyerBusinessRegistrationNumber || !this.buyer.buyerBusinessName || !this.buyer.buyerRepresentativeName) {
735
+ alert('공급받는자 필수 값을 모두 입력해 주세요.')
736
+ return
737
+ }
722
738
 
723
- // TODO 현금,수표 합계 == 총 합계금액 체크
739
+ // 아이템 개수 체크
740
+ if (taxInvoiceItems.length === 0) {
741
+ alert('등록 가능한 아아템의 개수는 1개 이상이여야 합니다.')
742
+ return
743
+ }
724
744
 
725
- return
745
+ // 현금, 수표, 어음, 외상미수금의 합계 = 총 합계금액 체크
746
+ const paymentAmount: number =
747
+ taxInvoice.paymentAmountCash + taxInvoice.paymentAmountCheck + taxInvoice.paymentAmountPromissoryNote + taxInvoice.paymentAmountAccountsReceivable
748
+ if (paymentAmount > 0 && paymentAmount !== taxInvoice.totalAmount) {
749
+ alert('현금, 수표, 어음, 외상미수금의 합계는 총 합계금액과 동일해야 합니다.')
750
+ return
751
+ }
726
752
 
727
753
  const response = await client.mutate({
728
754
  mutation: gql`
729
- mutation SendTaxInvoiceByApi($taxInvoice: NewTaxInvoice!, $taxInvoiceItems: [NewTaxInvoiceItem!]!) {
730
- sendTaxInvoiceByApi(taxInvoice: $taxInvoice, taxInvoiceItems: $taxInvoiceItems) {
755
+ mutation SendTaxInvoicesByApi($taxInvoiceSendList: [TaxInvoiceSend!]!) {
756
+ sendTaxInvoicesByApi(taxInvoiceSendList: $taxInvoiceSendList) {
731
757
  id
732
758
  }
733
759
  }
734
760
  `,
735
761
  variables: {
736
- // taxInvoice,
737
- // taxInvoiceItems
762
+ taxInvoiceSendList: [
763
+ {
764
+ taxInvoice,
765
+ taxInvoiceItems
766
+ }
767
+ ]
738
768
  }
739
769
  })
740
770
 
741
771
  if (!response.errors) {
742
- notify({
743
- message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') })
744
- })
772
+ notify({ message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') }) })
745
773
  }
746
774
  }
747
775
 
@@ -753,12 +781,27 @@ export class TaxInvoiceSendPage extends localize(i18next)(ScopedElementsMixin(Pa
753
781
  private _onInputTaxInvoice(event: InputEvent) {
754
782
  const target = event.target as HTMLInputElement
755
783
 
784
+ // 숫자 타입은 다른 문자 입력 제거
785
+ if (target.hasAttribute('numeric')) {
786
+ target.value = target.value.replace(/\D/g, '')
787
+ }
788
+
756
789
  if (target.name.startsWith('supplier')) {
757
790
  this.supplier[target.name] = target.value
758
791
  } else if (target.name.startsWith('buyer')) {
759
792
  this.buyer[target.name] = target.value
760
793
  } else {
794
+ // 날짜 체크가 오늘 날짜를 넘어가면 값 변경 되면 안됨
795
+ if (target.name === 'issueDate' && target.value > this.today) {
796
+ target.value = this.taxInvoice['issueDate']
797
+ alert('작성일자는 현재일까지 입력하시기 바랍니다.')
798
+ return
799
+ }
800
+
761
801
  this.taxInvoice[target.name] = target.value
802
+
803
+ // 날짜 변경시에는 아이템 변경도 리 렌더가 필요해서 데이터 갱신
804
+ if (target.name === 'issueDate') this.taxInvoice = { ...this.taxInvoice }
762
805
  }
763
806
  }
764
807
 
@@ -775,7 +818,12 @@ export class TaxInvoiceSendPage extends localize(i18next)(ScopedElementsMixin(Pa
775
818
 
776
819
  // 공급일자 케이스 시 => 세금계산서의 작성일자의 YYYY-MM + 아이템의 입력된 DD
777
820
  if (target.name === 'supplyDate') {
778
- inputVal = this.taxInvoice.issueDate.substring(0, 8) + inputVal.padStart(2, '0')
821
+ const itemDate = this.taxInvoice.issueDate.substring(0, 8) + inputVal.padStart(2, '0')
822
+ if (itemDate > this.taxInvoice.issueDate) {
823
+ alert('품목의 일자는 작성일자보다 클 수 없습니다.')
824
+ target.value = ''
825
+ }
826
+ inputVal = itemDate
779
827
  }
780
828
 
781
829
  if (target.name == 'quantity' || target.name == 'unitPrice') {