@things-factory/tax-invoice 7.0.1-alpha.81 → 7.0.1-alpha.86
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-send/tax-invoice-send-page.ts +43 -9
- package/client/pages/tax-invoice-send/tax-invoice-send.ts +272 -42
- package/dist-client/pages/tax-invoice-send/tax-invoice-send-page.js +32 -7
- package/dist-client/pages/tax-invoice-send/tax-invoice-send-page.js.map +1 -1
- package/dist-client/pages/tax-invoice-send/tax-invoice-send.js +257 -40
- package/dist-client/pages/tax-invoice-send/tax-invoice-send.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '@operato/data-grist'
|
|
2
2
|
|
|
3
3
|
import { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'
|
|
4
|
-
import { PageView } from '@operato/shell'
|
|
4
|
+
import { CustomAlert, PageView } from '@operato/shell'
|
|
5
5
|
import { css, html } from 'lit'
|
|
6
6
|
import { customElement, state } from 'lit/decorators.js'
|
|
7
7
|
import { ScopedElementsMixin } from '@open-wc/scoped-elements'
|
|
@@ -95,8 +95,15 @@ export class TaxInvoiceSendPage extends localize(i18next)(ScopedElementsMixin(Pa
|
|
|
95
95
|
|
|
96
96
|
async _sendTaxInvoice() {
|
|
97
97
|
// 아이템 시퀀스 재 할당 + 날짜, 품목, 규격, 수량이 없으면 필터
|
|
98
|
-
let taxInvoiceItems = this.taxInvoiceItems.map((item, idx) => ({
|
|
99
|
-
|
|
98
|
+
let taxInvoiceItems = this.taxInvoiceItems.map((item, idx) => ({
|
|
99
|
+
...item,
|
|
100
|
+
sequence: idx + 1,
|
|
101
|
+
quantity: Number(item.quantity),
|
|
102
|
+
unitPrice: Number(item.unitPrice)
|
|
103
|
+
}))
|
|
104
|
+
taxInvoiceItems = taxInvoiceItems.filter(
|
|
105
|
+
item => item.supplyDate && item.itemName && item.quantity && item.unitPrice
|
|
106
|
+
)
|
|
100
107
|
|
|
101
108
|
// taxInvoice 데이터 생성 및 타입 변환
|
|
102
109
|
let taxInvoice = { ...this.taxInvoice, ...this.supplier, ...this.buyer }
|
|
@@ -110,28 +117,55 @@ export class TaxInvoiceSendPage extends localize(i18next)(ScopedElementsMixin(Pa
|
|
|
110
117
|
taxInvoice.supplierBusinessRegistrationNumber = taxInvoice.supplierBusinessRegistrationNumber.replace(/-/gi, '')
|
|
111
118
|
|
|
112
119
|
// 공급받는자 필수 값 체크
|
|
113
|
-
if (
|
|
114
|
-
|
|
120
|
+
if (
|
|
121
|
+
!this.buyer.buyerBusinessRegistrationNumber ||
|
|
122
|
+
!this.buyer.buyerBusinessName ||
|
|
123
|
+
!this.buyer.buyerRepresentativeName
|
|
124
|
+
) {
|
|
125
|
+
await CustomAlert({
|
|
126
|
+
type: 'warning',
|
|
127
|
+
title: '공급받는자 필수 값을 모두 입력해 주세요.',
|
|
128
|
+
text: '공급받는자 필수 값을 모두 입력해 주세요.',
|
|
129
|
+
confirmButton: { text: i18next.t('button.confirm') }
|
|
130
|
+
})
|
|
115
131
|
return
|
|
116
132
|
}
|
|
117
133
|
|
|
118
134
|
// 아이템 개수 체크
|
|
119
135
|
if (taxInvoiceItems.length === 0) {
|
|
120
|
-
|
|
136
|
+
await CustomAlert({
|
|
137
|
+
type: 'warning',
|
|
138
|
+
title: '등록 가능한 아이템의 개수는 1개 이상이여야 합니다.',
|
|
139
|
+
text: '등록 가능한 아이템의 개수는 1개 이상이여야 합니다.',
|
|
140
|
+
confirmButton: { text: i18next.t('button.confirm') }
|
|
141
|
+
})
|
|
121
142
|
return
|
|
122
143
|
}
|
|
123
144
|
|
|
124
145
|
// 세금이 없는 타입인데 세금이 있는지 체크
|
|
125
146
|
if (taxInvoice.invoiceType === InvoiceType.SMALL_BUSINESS_TAX_INVOICE && taxInvoice.taxAmount > 0) {
|
|
126
|
-
|
|
147
|
+
await CustomAlert({
|
|
148
|
+
type: 'warning',
|
|
149
|
+
title: '세금이 0원이 아닙니다.',
|
|
150
|
+
text: '세금이 0원이 아닙니다.',
|
|
151
|
+
confirmButton: { text: i18next.t('button.confirm') }
|
|
152
|
+
})
|
|
127
153
|
return
|
|
128
154
|
}
|
|
129
155
|
|
|
130
156
|
// 현금, 수표, 어음, 외상미수금의 합계 = 총 합계금액 체크
|
|
131
157
|
const paymentAmount: number =
|
|
132
|
-
taxInvoice.paymentAmountCash +
|
|
158
|
+
taxInvoice.paymentAmountCash +
|
|
159
|
+
taxInvoice.paymentAmountCheck +
|
|
160
|
+
taxInvoice.paymentAmountPromissoryNote +
|
|
161
|
+
taxInvoice.paymentAmountAccountsReceivable
|
|
133
162
|
if (paymentAmount > 0 && paymentAmount !== taxInvoice.totalAmount) {
|
|
134
|
-
|
|
163
|
+
await CustomAlert({
|
|
164
|
+
type: 'warning',
|
|
165
|
+
title: '현금, 수표, 어음, 외상미수금의 합계는 총 합계금액과 동일해야 합니다.',
|
|
166
|
+
text: '현금, 수표, 어음, 외상미수금의 합계는 총 합계금액과 동일해야 합니다.',
|
|
167
|
+
confirmButton: { text: i18next.t('button.confirm') }
|
|
168
|
+
})
|
|
135
169
|
return
|
|
136
170
|
}
|
|
137
171
|
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
import '@operato/data-grist'
|
|
2
2
|
|
|
3
3
|
import { css, html, LitElement } from 'lit'
|
|
4
|
+
import { CustomAlert } from '@operato/shell'
|
|
4
5
|
import { CommonGristStyles, ScrollbarStyles } from '@operato/styles'
|
|
5
6
|
import { property, customElement } from 'lit/decorators.js'
|
|
6
7
|
import { client } from '@operato/graphql'
|
|
7
8
|
import { i18next, localize } from '@operato/i18n'
|
|
8
9
|
import gql from 'graphql-tag'
|
|
9
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
BUSINESS_REGISTRATION_CATEGORY,
|
|
12
|
+
BusinessRegistrationCategory,
|
|
13
|
+
Category,
|
|
14
|
+
INVOICE_TYPE,
|
|
15
|
+
InvoiceType,
|
|
16
|
+
PURPOSE,
|
|
17
|
+
Purpose
|
|
18
|
+
} from '../tax-invoice/tax-invoice-list-page'
|
|
10
19
|
import { openPopup } from '@operato/layout'
|
|
11
20
|
|
|
12
21
|
export const SHORT_INVOICE_TYPE = {
|
|
@@ -408,7 +417,8 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
|
|
|
408
417
|
render() {
|
|
409
418
|
return html`
|
|
410
419
|
<div class="invoice-type">
|
|
411
|
-
* ${INVOICE_TYPE[this.taxInvoice?.invoiceType]}
|
|
420
|
+
* ${INVOICE_TYPE[this.taxInvoice?.invoiceType]}
|
|
421
|
+
(${SHORT_BUSINESS_REGISTRATION_CATEGORY[this.buyer.buyerBusinessRegistrationCategory]})
|
|
412
422
|
</div>
|
|
413
423
|
|
|
414
424
|
<div class="title">
|
|
@@ -417,7 +427,8 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
|
|
|
417
427
|
<th>${i18next.t('field.short invoice type')}</th>
|
|
418
428
|
<td>
|
|
419
429
|
${Object.keys(SHORT_INVOICE_TYPE['TAX_INVOICE']).map(key => {
|
|
420
|
-
const disabled: boolean =
|
|
430
|
+
const disabled: boolean =
|
|
431
|
+
key !== InvoiceType.TAX_INVOICE && key !== InvoiceType.SMALL_BUSINESS_TAX_INVOICE
|
|
421
432
|
const checked: boolean = key === InvoiceType.TAX_INVOICE
|
|
422
433
|
return html`
|
|
423
434
|
<label for="${'tax_' + key}">${SHORT_INVOICE_TYPE['TAX_INVOICE'][key]}</label>
|
|
@@ -440,7 +451,14 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
|
|
|
440
451
|
const checked: boolean = key === BusinessRegistrationCategory.BUSINESS_REGISTRATION_NUMBER
|
|
441
452
|
return html`
|
|
442
453
|
<label for="${'tax_' + key}">${BUSINESS_REGISTRATION_CATEGORY[key]}</label>
|
|
443
|
-
<input
|
|
454
|
+
<input
|
|
455
|
+
type="radio"
|
|
456
|
+
id="${'tax_' + key}"
|
|
457
|
+
value="${key}"
|
|
458
|
+
name="buyerBusinessRegistrationCategory"
|
|
459
|
+
?checked=${checked}
|
|
460
|
+
?disabled=${disabled}
|
|
461
|
+
/>
|
|
444
462
|
`
|
|
445
463
|
})}
|
|
446
464
|
</td>
|
|
@@ -466,16 +484,30 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
|
|
|
466
484
|
<tr>
|
|
467
485
|
<th rowspan="6" class="target">${i18next.t('field.tax invoice supplier')}</th>
|
|
468
486
|
<th required>${i18next.t('field.short business registration number')}</th>
|
|
469
|
-
<td
|
|
487
|
+
<td>
|
|
488
|
+
${this.supplier?.supplierBusinessRegistrationNumber?.replace(/(\S{3})(\S{2})(\S{5})/g, '$1-$2-$3')}
|
|
489
|
+
</td>
|
|
470
490
|
<th>${i18next.t('field.short branch identification')}</th>
|
|
471
491
|
<td>${this.supplier?.supplierBranchIdentification}</td>
|
|
472
492
|
</tr>
|
|
473
493
|
<tr>
|
|
474
494
|
<th required>${i18next.t('field.short tax invoice business name')}</th>
|
|
475
|
-
<td
|
|
495
|
+
<td>
|
|
496
|
+
<input
|
|
497
|
+
type="text"
|
|
498
|
+
name="supplierBusinessName"
|
|
499
|
+
.value=${this.supplier?.supplierBusinessName || ''}
|
|
500
|
+
@input=${this._onInputTaxInvoice}
|
|
501
|
+
/>
|
|
502
|
+
</td>
|
|
476
503
|
<th required>${i18next.t('field.tax invoice representative name')}</th>
|
|
477
504
|
<td>
|
|
478
|
-
<input
|
|
505
|
+
<input
|
|
506
|
+
type="text"
|
|
507
|
+
name="supplierRepresentativeName"
|
|
508
|
+
.value=${this.supplier?.supplierRepresentativeName || ''}
|
|
509
|
+
@input=${this._onInputTaxInvoice}
|
|
510
|
+
/>
|
|
479
511
|
</td>
|
|
480
512
|
</tr>
|
|
481
513
|
<tr>
|
|
@@ -484,14 +516,33 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
|
|
|
484
516
|
</tr>
|
|
485
517
|
<tr>
|
|
486
518
|
<th>${i18next.t('field.business type')}</th>
|
|
487
|
-
<td
|
|
519
|
+
<td>
|
|
520
|
+
<input
|
|
521
|
+
type="text"
|
|
522
|
+
name="supplierBusinessType"
|
|
523
|
+
.value=${this.supplier?.supplierBusinessType || ''}
|
|
524
|
+
@input=${this._onInputTaxInvoice}
|
|
525
|
+
/>
|
|
526
|
+
</td>
|
|
488
527
|
<th>${i18next.t('field.industry type')}</th>
|
|
489
|
-
<td
|
|
528
|
+
<td>
|
|
529
|
+
<input
|
|
530
|
+
type="text"
|
|
531
|
+
name="supplierIndustryType"
|
|
532
|
+
.value=${this.supplier?.supplierIndustryType || ''}
|
|
533
|
+
@input=${this._onInputTaxInvoice}
|
|
534
|
+
/>
|
|
535
|
+
</td>
|
|
490
536
|
</tr>
|
|
491
537
|
<tr>
|
|
492
538
|
<th rowspan="2">${i18next.t('field.email')}</th>
|
|
493
539
|
<td rowspan="2" colspan="3">
|
|
494
|
-
<input
|
|
540
|
+
<input
|
|
541
|
+
type="text"
|
|
542
|
+
name="supplierContactEmail"
|
|
543
|
+
.value=${this.supplier?.supplierContactEmail || ''}
|
|
544
|
+
@input=${this._onInputTaxInvoice}
|
|
545
|
+
/>
|
|
495
546
|
</td>
|
|
496
547
|
</tr>
|
|
497
548
|
<tr></tr>
|
|
@@ -518,32 +569,88 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
|
|
|
518
569
|
/>
|
|
519
570
|
</td>
|
|
520
571
|
<th>${i18next.t('field.short branch identification')}</th>
|
|
521
|
-
<td
|
|
572
|
+
<td>
|
|
573
|
+
<input
|
|
574
|
+
type="text"
|
|
575
|
+
name="buyerBranchIdentification"
|
|
576
|
+
.value=${this.buyer?.buyerBranchIdentification || ''}
|
|
577
|
+
@input=${this._onInputTaxInvoice}
|
|
578
|
+
/>
|
|
579
|
+
</td>
|
|
522
580
|
</tr>
|
|
523
581
|
<tr>
|
|
524
582
|
<th required>${i18next.t('field.short tax invoice business name')}</th>
|
|
525
|
-
<td
|
|
583
|
+
<td>
|
|
584
|
+
<input
|
|
585
|
+
type="text"
|
|
586
|
+
name="buyerBusinessName"
|
|
587
|
+
.value=${this.buyer?.buyerBusinessName || ''}
|
|
588
|
+
@input=${this._onInputTaxInvoice}
|
|
589
|
+
/>
|
|
590
|
+
</td>
|
|
526
591
|
<th required>${i18next.t('field.tax invoice representative name')}</th>
|
|
527
|
-
<td
|
|
592
|
+
<td>
|
|
593
|
+
<input
|
|
594
|
+
type="text"
|
|
595
|
+
name="buyerRepresentativeName"
|
|
596
|
+
.value=${this.buyer?.buyerRepresentativeName || ''}
|
|
597
|
+
@input=${this._onInputTaxInvoice}
|
|
598
|
+
/>
|
|
599
|
+
</td>
|
|
528
600
|
</tr>
|
|
529
601
|
<tr>
|
|
530
602
|
<th>${i18next.t('field.address')}</th>
|
|
531
|
-
<td colspan="3"
|
|
603
|
+
<td colspan="3">
|
|
604
|
+
<input
|
|
605
|
+
type="text"
|
|
606
|
+
name="buyerAddress"
|
|
607
|
+
.value=${this.buyer?.buyerAddress || ''}
|
|
608
|
+
@input=${this._onInputTaxInvoice}
|
|
609
|
+
/>
|
|
610
|
+
</td>
|
|
532
611
|
</tr>
|
|
533
612
|
<tr>
|
|
534
613
|
<th>${i18next.t('field.business type')}</th>
|
|
535
|
-
<td
|
|
614
|
+
<td>
|
|
615
|
+
<input
|
|
616
|
+
type="text"
|
|
617
|
+
name="buyerBusinessType"
|
|
618
|
+
.value=${this.buyer?.buyerBusinessType || ''}
|
|
619
|
+
@input=${this._onInputTaxInvoice}
|
|
620
|
+
/>
|
|
621
|
+
</td>
|
|
536
622
|
|
|
537
623
|
<th>${i18next.t('field.industry type')}</th>
|
|
538
|
-
<td
|
|
624
|
+
<td>
|
|
625
|
+
<input
|
|
626
|
+
type="text"
|
|
627
|
+
name="buyerIndustryType"
|
|
628
|
+
.value=${this.buyer?.buyerIndustryType || ''}
|
|
629
|
+
@input=${this._onInputTaxInvoice}
|
|
630
|
+
/>
|
|
631
|
+
</td>
|
|
539
632
|
</tr>
|
|
540
633
|
<tr>
|
|
541
634
|
<th>${i18next.t('field.email')}</th>
|
|
542
|
-
<td colspan="3"
|
|
635
|
+
<td colspan="3">
|
|
636
|
+
<input
|
|
637
|
+
type="text"
|
|
638
|
+
name="buyer1stContactEmail"
|
|
639
|
+
.value=${this.buyer?.buyer1stContactEmail || ''}
|
|
640
|
+
@input=${this._onInputTaxInvoice}
|
|
641
|
+
/>
|
|
642
|
+
</td>
|
|
543
643
|
</tr>
|
|
544
644
|
<tr>
|
|
545
645
|
<th>${i18next.t('field.email')}</th>
|
|
546
|
-
<td colspan="3"
|
|
646
|
+
<td colspan="3">
|
|
647
|
+
<input
|
|
648
|
+
type="text"
|
|
649
|
+
name="buyer2ndContactEmail"
|
|
650
|
+
.value=${this.buyer?.buyer2ndContactEmail || ''}
|
|
651
|
+
@input=${this._onInputTaxInvoice}
|
|
652
|
+
/>
|
|
653
|
+
</td>
|
|
547
654
|
</tr>
|
|
548
655
|
</table>
|
|
549
656
|
</div>
|
|
@@ -552,11 +659,23 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
|
|
|
552
659
|
<div class="flex-row">
|
|
553
660
|
<div class="title" required>${i18next.t('field.issue date')}</div>
|
|
554
661
|
<div class="value">
|
|
555
|
-
<input
|
|
662
|
+
<input
|
|
663
|
+
type="date"
|
|
664
|
+
name="issueDate"
|
|
665
|
+
.value=${this.taxInvoice.issueDate}
|
|
666
|
+
@input=${this._onInputTaxInvoice}
|
|
667
|
+
/>
|
|
556
668
|
<span class="desc">※ 작성일자는 공급 연월일을 의미함</span>
|
|
557
669
|
</div>
|
|
558
670
|
<div class="title">${i18next.t('field.remark0')}</div>
|
|
559
|
-
<div class="value"
|
|
671
|
+
<div class="value">
|
|
672
|
+
<input
|
|
673
|
+
type="text"
|
|
674
|
+
name="remark0"
|
|
675
|
+
.value=${this.taxInvoice?.remark0 || ''}
|
|
676
|
+
@input=${this._onInputTaxInvoice}
|
|
677
|
+
/>
|
|
678
|
+
</div>
|
|
560
679
|
</div>
|
|
561
680
|
<div class="flex-row">
|
|
562
681
|
<div class="title">${i18next.t('field.total amount')}</div>
|
|
@@ -570,9 +689,13 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
|
|
|
570
689
|
|
|
571
690
|
<div class="items">
|
|
572
691
|
<div class="desc desc-date">
|
|
573
|
-
※ 아래 '품목'의 '월'은 상단 '작성일자'의 '월'이 자동 반영됩니다. 합계의 '계산' 버튼은 금액을 공급가액과
|
|
692
|
+
※ 아래 '품목'의 '월'은 상단 '작성일자'의 '월'이 자동 반영됩니다. 합계의 '계산' 버튼은 금액을 공급가액과
|
|
693
|
+
세액으로 계산할 수 있습니다.
|
|
694
|
+
</div>
|
|
695
|
+
<div class="desc">
|
|
696
|
+
<button class="btn-add" @click=${this._onAddInvoiceItem}>품목추가</button> 품목은 최대 16개까지 추가, 삭제
|
|
697
|
+
가능
|
|
574
698
|
</div>
|
|
575
|
-
<div class="desc"><button class="btn-add" @click=${this._onAddInvoiceItem}>품목추가</button> 품목은 최대 16개까지 추가, 삭제 가능</div>
|
|
576
699
|
|
|
577
700
|
<table>
|
|
578
701
|
<colgroup>
|
|
@@ -605,12 +728,58 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
|
|
|
605
728
|
<tr>
|
|
606
729
|
<input type="hidden" name="sequence" value=${item.sequence} />
|
|
607
730
|
<td>${this.taxInvoice.issueDate.split('-')[1]}</td>
|
|
608
|
-
<td
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
731
|
+
<td>
|
|
732
|
+
<input
|
|
733
|
+
type="text"
|
|
734
|
+
numeric
|
|
735
|
+
maxlength="2"
|
|
736
|
+
name="supplyDate"
|
|
737
|
+
@input=${e => this._onInputItem(e, idx)}
|
|
738
|
+
/>
|
|
739
|
+
</td>
|
|
740
|
+
<td>
|
|
741
|
+
<input
|
|
742
|
+
type="text"
|
|
743
|
+
name="itemName"
|
|
744
|
+
.value=${item.itemName}
|
|
745
|
+
@input=${e => this._onInputItem(e, idx)}
|
|
746
|
+
/>
|
|
747
|
+
</td>
|
|
748
|
+
<td>
|
|
749
|
+
<input
|
|
750
|
+
type="text"
|
|
751
|
+
name="specification"
|
|
752
|
+
.value=${item.specification}
|
|
753
|
+
@input=${e => this._onInputItem(e, idx)}
|
|
754
|
+
/>
|
|
755
|
+
</td>
|
|
756
|
+
<td>
|
|
757
|
+
<input
|
|
758
|
+
type="text"
|
|
759
|
+
numeric
|
|
760
|
+
name="quantity"
|
|
761
|
+
.value=${this._numberFormat(item.quantity)}
|
|
762
|
+
@input=${e => this._onInputItem(e, idx)}
|
|
763
|
+
/>
|
|
764
|
+
</td>
|
|
765
|
+
<td>
|
|
766
|
+
<input
|
|
767
|
+
type="text"
|
|
768
|
+
numeric
|
|
769
|
+
name="unitPrice"
|
|
770
|
+
.value=${this._numberFormat(item.unitPrice)}
|
|
771
|
+
@input=${e => this._onInputItem(e, idx)}
|
|
772
|
+
/>
|
|
773
|
+
</td>
|
|
774
|
+
<td>
|
|
775
|
+
<input
|
|
776
|
+
type="text"
|
|
777
|
+
numeric
|
|
778
|
+
name="supplyPrice"
|
|
779
|
+
.value=${this._numberFormat(item.supplyPrice)}
|
|
780
|
+
@input=${e => this._onInputItem(e, idx)}
|
|
781
|
+
/>
|
|
782
|
+
</td>
|
|
614
783
|
<td>
|
|
615
784
|
<input
|
|
616
785
|
type="text"
|
|
@@ -621,8 +790,17 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
|
|
|
621
790
|
.disabled=${this.isTaxFree}
|
|
622
791
|
/>
|
|
623
792
|
</td>
|
|
624
|
-
<td
|
|
625
|
-
|
|
793
|
+
<td>
|
|
794
|
+
<input
|
|
795
|
+
type="text"
|
|
796
|
+
name="remark"
|
|
797
|
+
.value=${item.remark || ''}
|
|
798
|
+
@input=${e => this._onInputItem(e, idx)}
|
|
799
|
+
/>
|
|
800
|
+
</td>
|
|
801
|
+
<td>
|
|
802
|
+
<button class="btn-delete" @click=${e => this._onRemoveInvoiceItem(e, item.sequence)}>삭제</button>
|
|
803
|
+
</td>
|
|
626
804
|
</tr>
|
|
627
805
|
`
|
|
628
806
|
)}
|
|
@@ -644,8 +822,24 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
|
|
|
644
822
|
<th>${i18next.t('field.tax invoice payment accounts receivable')}</th>
|
|
645
823
|
</tr>
|
|
646
824
|
<tr>
|
|
647
|
-
<td
|
|
648
|
-
|
|
825
|
+
<td>
|
|
826
|
+
<input
|
|
827
|
+
type="text"
|
|
828
|
+
numeric
|
|
829
|
+
name="paymentAmountCash"
|
|
830
|
+
.value=${this.taxInvoice?.paymentAmountCash || ''}
|
|
831
|
+
@input=${this._onInputTaxInvoice}
|
|
832
|
+
/>
|
|
833
|
+
</td>
|
|
834
|
+
<td>
|
|
835
|
+
<input
|
|
836
|
+
type="text"
|
|
837
|
+
numeric
|
|
838
|
+
name="paymentAmountCheck"
|
|
839
|
+
.value=${this.taxInvoice?.paymentAmountCheck || ''}
|
|
840
|
+
@input=${this._onInputTaxInvoice}
|
|
841
|
+
/>
|
|
842
|
+
</td>
|
|
649
843
|
<td>
|
|
650
844
|
<input
|
|
651
845
|
type="text"
|
|
@@ -670,11 +864,24 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
|
|
|
670
864
|
${i18next.t('text.prev tax invoice description payment') + ' ('}
|
|
671
865
|
<span class="type-wrapper">
|
|
672
866
|
<div>
|
|
673
|
-
<input
|
|
867
|
+
<input
|
|
868
|
+
type="radio"
|
|
869
|
+
id="purpose_20"
|
|
870
|
+
name="purpose"
|
|
871
|
+
.value=${Purpose.INVOICE}
|
|
872
|
+
@change=${this._onInputTaxInvoice}
|
|
873
|
+
checked
|
|
874
|
+
/>
|
|
674
875
|
<label for="purpose_20">${PURPOSE[Purpose.INVOICE]}</label>
|
|
675
876
|
</div>
|
|
676
877
|
<div>
|
|
677
|
-
<input
|
|
878
|
+
<input
|
|
879
|
+
type="radio"
|
|
880
|
+
id="purpose_10"
|
|
881
|
+
name="purpose"
|
|
882
|
+
.value=${Purpose.RECEIPT}
|
|
883
|
+
@change=${this._onInputTaxInvoice}
|
|
884
|
+
/>
|
|
678
885
|
<label for="purpose_10">${PURPOSE[Purpose.RECEIPT]}</label>
|
|
679
886
|
</div>
|
|
680
887
|
</span>
|
|
@@ -734,7 +941,7 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
|
|
|
734
941
|
}
|
|
735
942
|
|
|
736
943
|
// Input 요소의 값이 변경될 때 호출되는 콜백 함수
|
|
737
|
-
private _onInputTaxInvoice(event: InputEvent) {
|
|
944
|
+
private async _onInputTaxInvoice(event: InputEvent) {
|
|
738
945
|
const target = event.target as HTMLInputElement
|
|
739
946
|
|
|
740
947
|
// 숫자 타입은 다른 문자 입력 제거
|
|
@@ -750,7 +957,13 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
|
|
|
750
957
|
// 날짜 체크가 오늘 날짜를 넘어가면 값 변경 되면 안됨
|
|
751
958
|
if (target.name === 'issueDate' && target.value > this.today) {
|
|
752
959
|
target.value = this.taxInvoice['issueDate']
|
|
753
|
-
|
|
960
|
+
|
|
961
|
+
await CustomAlert({
|
|
962
|
+
type: 'warning',
|
|
963
|
+
title: '작성일자는 현재일까지 입력하시기 바랍니다.',
|
|
964
|
+
text: '작성일자는 현재일까지 입력하시기 바랍니다.',
|
|
965
|
+
confirmButton: { text: i18next.t('button.confirm') }
|
|
966
|
+
})
|
|
754
967
|
return
|
|
755
968
|
}
|
|
756
969
|
|
|
@@ -768,7 +981,7 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
|
|
|
768
981
|
}
|
|
769
982
|
|
|
770
983
|
// Input 요소의 값이 변경될 때 호출되는 콜백 함수
|
|
771
|
-
private _onInputItem(e: InputEvent, idx: number) {
|
|
984
|
+
private async _onInputItem(e: InputEvent, idx: number) {
|
|
772
985
|
const target = e.target as HTMLInputElement
|
|
773
986
|
let inputVal: any = target.value
|
|
774
987
|
|
|
@@ -782,7 +995,13 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
|
|
|
782
995
|
if (target.name === 'supplyDate') {
|
|
783
996
|
const itemDate = this.taxInvoice.issueDate.substring(0, 8) + inputVal.toString().padStart(2, '0')
|
|
784
997
|
if (itemDate > this.taxInvoice.issueDate) {
|
|
785
|
-
|
|
998
|
+
await CustomAlert({
|
|
999
|
+
type: 'warning',
|
|
1000
|
+
title: '품목의 일자는 작성일자보다 클 수 없습니다.',
|
|
1001
|
+
text: '품목의 일자는 작성일자보다 클 수 없습니다.',
|
|
1002
|
+
confirmButton: { text: i18next.t('button.confirm') }
|
|
1003
|
+
})
|
|
1004
|
+
|
|
786
1005
|
target.value = ''
|
|
787
1006
|
}
|
|
788
1007
|
inputVal = itemDate
|
|
@@ -790,7 +1009,10 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
|
|
|
790
1009
|
|
|
791
1010
|
// 수량, 단가 수정시 공급가액/세액 자동 계산
|
|
792
1011
|
if (target.name == 'quantity' || target.name == 'unitPrice') {
|
|
793
|
-
const supplyPrice =
|
|
1012
|
+
const supplyPrice =
|
|
1013
|
+
target.name == 'quantity'
|
|
1014
|
+
? Number(inputVal) * this.taxInvoiceItems[idx]['unitPrice']
|
|
1015
|
+
: Number(inputVal) * this.taxInvoiceItems[idx]['quantity']
|
|
794
1016
|
this.taxInvoiceItems[idx]['supplyPrice'] = supplyPrice
|
|
795
1017
|
this.taxInvoiceItems[idx]['taxPrice'] = this.isTaxFree ? 0 : Math.floor(supplyPrice / 10)
|
|
796
1018
|
}
|
|
@@ -925,10 +1147,16 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
|
|
|
925
1147
|
)
|
|
926
1148
|
}
|
|
927
1149
|
|
|
928
|
-
private _onAddInvoiceItem(e: Event) {
|
|
1150
|
+
private async _onAddInvoiceItem(e: Event) {
|
|
929
1151
|
e.preventDefault()
|
|
930
1152
|
if (this.taxInvoiceItems.length >= 16) {
|
|
931
|
-
|
|
1153
|
+
await CustomAlert({
|
|
1154
|
+
type: 'warning',
|
|
1155
|
+
title: '품목은 최대 16개까지 추가 가능합니다.',
|
|
1156
|
+
text: '품목은 최대 16개까지 추가 가능합니다.',
|
|
1157
|
+
confirmButton: { text: i18next.t('button.confirm') }
|
|
1158
|
+
})
|
|
1159
|
+
|
|
932
1160
|
return
|
|
933
1161
|
}
|
|
934
1162
|
|
|
@@ -943,7 +1171,9 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
|
|
|
943
1171
|
|
|
944
1172
|
private _setTaxInvoiceSummaryCalc() {
|
|
945
1173
|
const supplyPrice: number = this.taxInvoiceItems.reduce((prev, item) => prev + Number(item.supplyPrice), 0) || 0
|
|
946
|
-
const taxPrice: number = this.isTaxFree
|
|
1174
|
+
const taxPrice: number = this.isTaxFree
|
|
1175
|
+
? 0
|
|
1176
|
+
: this.taxInvoiceItems.reduce((prev, item) => prev + Number(item.taxPrice), 0) || 0
|
|
947
1177
|
const totalAmount: number = supplyPrice + taxPrice
|
|
948
1178
|
|
|
949
1179
|
this.taxInvoice = { ...this.taxInvoice, supplyAmount: supplyPrice, taxAmount: taxPrice, totalAmount: totalAmount }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __decorate, __metadata } from "tslib";
|
|
2
2
|
import '@operato/data-grist';
|
|
3
3
|
import { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles';
|
|
4
|
-
import { PageView } from '@operato/shell';
|
|
4
|
+
import { CustomAlert, PageView } from '@operato/shell';
|
|
5
5
|
import { css, html } from 'lit';
|
|
6
6
|
import { customElement, state } from 'lit/decorators.js';
|
|
7
7
|
import { ScopedElementsMixin } from '@open-wc/scoped-elements';
|
|
@@ -86,24 +86,49 @@ let TaxInvoiceSendPage = class TaxInvoiceSendPage extends localize(i18next)(Scop
|
|
|
86
86
|
taxInvoice.buyerBusinessRegistrationNumber = taxInvoice.buyerBusinessRegistrationNumber.replace(/-/gi, '');
|
|
87
87
|
taxInvoice.supplierBusinessRegistrationNumber = taxInvoice.supplierBusinessRegistrationNumber.replace(/-/gi, '');
|
|
88
88
|
// 공급받는자 필수 값 체크
|
|
89
|
-
if (!this.buyer.buyerBusinessRegistrationNumber ||
|
|
90
|
-
|
|
89
|
+
if (!this.buyer.buyerBusinessRegistrationNumber ||
|
|
90
|
+
!this.buyer.buyerBusinessName ||
|
|
91
|
+
!this.buyer.buyerRepresentativeName) {
|
|
92
|
+
await CustomAlert({
|
|
93
|
+
type: 'warning',
|
|
94
|
+
title: '공급받는자 필수 값을 모두 입력해 주세요.',
|
|
95
|
+
text: '공급받는자 필수 값을 모두 입력해 주세요.',
|
|
96
|
+
confirmButton: { text: i18next.t('button.confirm') }
|
|
97
|
+
});
|
|
91
98
|
return;
|
|
92
99
|
}
|
|
93
100
|
// 아이템 개수 체크
|
|
94
101
|
if (taxInvoiceItems.length === 0) {
|
|
95
|
-
|
|
102
|
+
await CustomAlert({
|
|
103
|
+
type: 'warning',
|
|
104
|
+
title: '등록 가능한 아이템의 개수는 1개 이상이여야 합니다.',
|
|
105
|
+
text: '등록 가능한 아이템의 개수는 1개 이상이여야 합니다.',
|
|
106
|
+
confirmButton: { text: i18next.t('button.confirm') }
|
|
107
|
+
});
|
|
96
108
|
return;
|
|
97
109
|
}
|
|
98
110
|
// 세금이 없는 타입인데 세금이 있는지 체크
|
|
99
111
|
if (taxInvoice.invoiceType === InvoiceType.SMALL_BUSINESS_TAX_INVOICE && taxInvoice.taxAmount > 0) {
|
|
100
|
-
|
|
112
|
+
await CustomAlert({
|
|
113
|
+
type: 'warning',
|
|
114
|
+
title: '세금이 0원이 아닙니다.',
|
|
115
|
+
text: '세금이 0원이 아닙니다.',
|
|
116
|
+
confirmButton: { text: i18next.t('button.confirm') }
|
|
117
|
+
});
|
|
101
118
|
return;
|
|
102
119
|
}
|
|
103
120
|
// 현금, 수표, 어음, 외상미수금의 합계 = 총 합계금액 체크
|
|
104
|
-
const paymentAmount = taxInvoice.paymentAmountCash +
|
|
121
|
+
const paymentAmount = taxInvoice.paymentAmountCash +
|
|
122
|
+
taxInvoice.paymentAmountCheck +
|
|
123
|
+
taxInvoice.paymentAmountPromissoryNote +
|
|
124
|
+
taxInvoice.paymentAmountAccountsReceivable;
|
|
105
125
|
if (paymentAmount > 0 && paymentAmount !== taxInvoice.totalAmount) {
|
|
106
|
-
|
|
126
|
+
await CustomAlert({
|
|
127
|
+
type: 'warning',
|
|
128
|
+
title: '현금, 수표, 어음, 외상미수금의 합계는 총 합계금액과 동일해야 합니다.',
|
|
129
|
+
text: '현금, 수표, 어음, 외상미수금의 합계는 총 합계금액과 동일해야 합니다.',
|
|
130
|
+
confirmButton: { text: i18next.t('button.confirm') }
|
|
131
|
+
});
|
|
107
132
|
return;
|
|
108
133
|
}
|
|
109
134
|
const response = await client.mutate({
|