@things-factory/tax-invoice 6.2.142 → 6.2.143

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.
@@ -146,7 +146,8 @@ export class TaxInvoiceSendPage extends localize(i18next)(ScopedElementsMixin(Pa
146
146
  input[type='date'] {
147
147
  width: auto;
148
148
  }
149
- input[readonly] {
149
+ input[readonly],
150
+ input:disabled {
150
151
  background-color: #eee;
151
152
  }
152
153
 
@@ -437,11 +438,19 @@ export class TaxInvoiceSendPage extends localize(i18next)(ScopedElementsMixin(Pa
437
438
  <th>${i18next.t('field.short invoice type')}</th>
438
439
  <td>
439
440
  ${Object.keys(SHORT_INVOICE_TYPE['TAX_INVOICE']).map(key => {
440
- const disabled: boolean = key !== InvoiceType.TAX_INVOICE
441
+ const disabled: boolean = key !== InvoiceType.TAX_INVOICE && key !== InvoiceType.SMALL_BUSINESS_TAX_INVOICE
441
442
  const checked: boolean = key === InvoiceType.TAX_INVOICE
442
443
  return html`
443
444
  <label for="${'tax_' + key}">${SHORT_INVOICE_TYPE['TAX_INVOICE'][key]}</label>
444
- <input type="radio" id="${'tax_' + key}" value="${key}" name="invoiceType" ?checked=${checked} ?disabled=${disabled} />
445
+ <input
446
+ type="radio"
447
+ id="${'tax_' + key}"
448
+ .value="${key}"
449
+ name="invoiceType"
450
+ ?checked=${checked}
451
+ ?disabled=${disabled}
452
+ @change=${this._onInputTaxInvoice}
453
+ />
445
454
  `
446
455
  })}
447
456
  </td>
@@ -612,24 +621,34 @@ export class TaxInvoiceSendPage extends localize(i18next)(ScopedElementsMixin(Pa
612
621
  <th>${i18next.t('field.delete')}</th>
613
622
  </tr>
614
623
 
615
- ${this.taxInvoiceItems.map(
616
- (item, idx) =>
617
- html`
618
- <tr>
619
- <input type="hidden" name="sequence" value=${item.sequence} />
620
- <td>${this.taxInvoice.issueDate.split('-')[1]}</td>
621
- <td><input type="text" numeric maxlength="2" name="supplyDate" @input=${e => this._onInputItem(e, idx)} /></td>
622
- <td><input type="text" name="itemName" .value=${item.itemName} @input=${e => this._onInputItem(e, idx)} /></td>
623
- <td><input type="text" name="specification" .value=${item.specification} @input=${e => this._onInputItem(e, idx)} /></td>
624
- <td><input type="text" numeric name="quantity" .value=${this._numberFormat(item.quantity)} @input=${e => this._onInputItem(e, idx)} /></td>
625
- <td><input type="text" numeric name="unitPrice" .value=${this._numberFormat(item.unitPrice)} @input=${e => this._onInputItem(e, idx)} /></td>
626
- <td><input type="text" readonly name="supplyPrice" .value=${this._numberFormat(item.supplyPrice)} @input=${e => this._onInputItem(e, idx)} /></td>
627
- <td><input type="text" readonly name="taxPrice" .value=${this._numberFormat(item.taxPrice)} @input=${e => this._onInputItem(e, idx)} /></td>
628
- <td><input type="text" name="remark" .value=${item.remark || ''} @input=${e => this._onInputItem(e, idx)} /></td>
629
- <td><button class="btn-delete" @click=${e => this._onRemoveInvoiceItem(e, item.sequence)}>삭제</button></td>
630
- </tr>
631
- `
632
- )}
624
+ ${this.taxInvoiceItems.map((item, idx) => {
625
+ const taxDisabled = this.taxInvoice.invoiceType === InvoiceType.SMALL_BUSINESS_TAX_INVOICE
626
+
627
+ return html`
628
+ <tr>
629
+ <input type="hidden" name="sequence" value=${item.sequence} />
630
+ <td>${this.taxInvoice.issueDate.split('-')[1]}</td>
631
+ <td><input type="text" numeric maxlength="2" name="supplyDate" @input=${e => this._onInputItem(e, idx)} /></td>
632
+ <td><input type="text" name="itemName" .value=${item.itemName} @input=${e => this._onInputItem(e, idx)} /></td>
633
+ <td><input type="text" name="specification" .value=${item.specification} @input=${e => this._onInputItem(e, idx)} /></td>
634
+ <td><input type="text" numeric name="quantity" .value=${this._numberFormat(item.quantity)} @input=${e => this._onInputItem(e, idx)} /></td>
635
+ <td><input type="text" numeric name="unitPrice" .value=${this._numberFormat(item.unitPrice)} @input=${e => this._onInputItem(e, idx)} /></td>
636
+ <td><input type="text" numeric name="supplyPrice" .value=${this._numberFormat(item.supplyPrice)} @input=${e => this._onInputItem(e, idx)} /></td>
637
+ <td>
638
+ <input
639
+ type="text"
640
+ numeric
641
+ name="taxPrice"
642
+ .value=${this._numberFormat(item.taxPrice)}
643
+ @input=${e => this._onInputItem(e, idx)}
644
+ .disabled=${taxDisabled}
645
+ />
646
+ </td>
647
+ <td><input type="text" name="remark" .value=${item.remark || ''} @input=${e => this._onInputItem(e, idx)} /></td>
648
+ <td><button class="btn-delete" @click=${e => this._onRemoveInvoiceItem(e, item.sequence)}>삭제</button></td>
649
+ </tr>
650
+ `
651
+ })}
633
652
  </table>
634
653
  </div>
635
654
 
@@ -750,6 +769,8 @@ export class TaxInvoiceSendPage extends localize(i18next)(ScopedElementsMixin(Pa
750
769
  taxInvoice.paymentAmountCheck = Number(taxInvoice.paymentAmountCheck || 0)
751
770
  taxInvoice.paymentAmountPromissoryNote = Number(taxInvoice.paymentAmountPromissoryNote || 0)
752
771
  taxInvoice.paymentAmountAccountsReceivable = Number(taxInvoice.paymentAmountAccountsReceivable || 0)
772
+ taxInvoice.supplyAmount = Number(taxInvoice.supplyAmount || 0)
773
+ taxInvoice.taxAmount = Number(taxInvoice.taxAmount || 0)
753
774
 
754
775
  // 공급받는자 필수 값 체크
755
776
  if (!this.buyer.buyerBusinessRegistrationNumber || !this.buyer.buyerBusinessName || !this.buyer.buyerRepresentativeName) {
@@ -817,27 +838,31 @@ export class TaxInvoiceSendPage extends localize(i18next)(ScopedElementsMixin(Pa
817
838
  return
818
839
  }
819
840
 
820
- this.taxInvoice[target.name] = target.value
841
+ // 세금이 없는 영세율이 선택 시 모든 아이템의 세금 0원으로 초기화
842
+ if (target.name === 'invoiceType' && target.value === InvoiceType.SMALL_BUSINESS_TAX_INVOICE) {
843
+ this.taxInvoiceItems = this.taxInvoiceItems.map(item => ({ ...item, taxPrice: 0 }))
844
+ }
821
845
 
822
- // 날짜 변경시에는 아이템 변경도 리 렌더가 필요해서 데이터 갱신
823
- if (target.name === 'issueDate') this.taxInvoice = { ...this.taxInvoice }
846
+ // 변경시에는 아이템 변경도 리 렌더가 필요해서 데이터 갱신
847
+ this.taxInvoice[target.name] = target.value
848
+ this.taxInvoice = { ...this.taxInvoice }
824
849
  }
825
850
  }
826
851
 
827
852
  // Input 요소의 값이 변경될 때 호출되는 콜백 함수
828
853
  private _onInputItem(e: InputEvent, idx: number) {
829
854
  const target = e.target as HTMLInputElement
830
- let inputVal = target.value
855
+ let inputVal: any = target.value
831
856
 
832
857
  // 숫자 타입은 다른 문자 입력 제거
833
858
  if (target.hasAttribute('numeric')) {
834
- inputVal = inputVal.replace(/\D/g, '')
859
+ inputVal = Number(inputVal.replace(/\D/g, ''))
835
860
  target.value = inputVal
836
861
  }
837
862
 
838
863
  // 공급일자 케이스 시 => 세금계산서의 작성일자의 YYYY-MM + 아이템의 입력된 DD
839
864
  if (target.name === 'supplyDate') {
840
- const itemDate = this.taxInvoice.issueDate.substring(0, 8) + inputVal.padStart(2, '0')
865
+ const itemDate = this.taxInvoice.issueDate.substring(0, 8) + inputVal.toString().padStart(2, '0')
841
866
  if (itemDate > this.taxInvoice.issueDate) {
842
867
  alert('품목의 일자는 작성일자보다 클 수 없습니다.')
843
868
  target.value = ''
@@ -845,15 +870,21 @@ export class TaxInvoiceSendPage extends localize(i18next)(ScopedElementsMixin(Pa
845
870
  inputVal = itemDate
846
871
  }
847
872
 
873
+ // 수량, 단가 수정시 공급가액/세액 자동 계산
848
874
  if (target.name == 'quantity' || target.name == 'unitPrice') {
849
875
  const supplyPrice = target.name == 'quantity' ? Number(inputVal) * this.taxInvoiceItems[idx]['unitPrice'] : Number(inputVal) * this.taxInvoiceItems[idx]['quantity']
850
876
  this.taxInvoiceItems[idx]['supplyPrice'] = supplyPrice
851
877
  this.taxInvoiceItems[idx]['taxPrice'] = Math.floor(supplyPrice / 10)
852
- this.taxInvoiceItems = [...this.taxInvoiceItems]
853
- this._setTaxInvoiceSummaryCalc()
854
878
  }
855
879
 
880
+ // 인풋에 값 넣기
856
881
  this.taxInvoiceItems[idx][target.name] = inputVal
882
+
883
+ // 아이템 금액에 관련된 필드 수정시 합계 계산
884
+ if (['quantity', 'unitPrice', 'supplyPrice', 'taxPrice'].includes(target.name)) {
885
+ this.taxInvoiceItems = [...this.taxInvoiceItems]
886
+ this._setTaxInvoiceSummaryCalc()
887
+ }
857
888
  }
858
889
 
859
890
  private async _openSupplierPopup() {
@@ -993,8 +1024,8 @@ export class TaxInvoiceSendPage extends localize(i18next)(ScopedElementsMixin(Pa
993
1024
  }
994
1025
 
995
1026
  private _setTaxInvoiceSummaryCalc() {
996
- const supplyPrice = this.taxInvoiceItems.reduce((prev, item) => prev + item.supplyPrice, 0)
997
- const taxPrice = this.taxInvoiceItems.reduce((prev, item) => prev + item.taxPrice, 0)
1027
+ const supplyPrice: number = this.taxInvoiceItems.reduce((prev, item) => prev + Number(item.supplyPrice), 0) || 0
1028
+ const taxPrice: number = this.taxInvoiceItems.reduce((prev, item) => prev + Number(item.taxPrice), 0) || 0
998
1029
 
999
1030
  this.taxInvoice = { ...this.taxInvoice, supplyAmount: supplyPrice, taxAmount: taxPrice, totalAmount: supplyPrice + taxPrice }
1000
1031
  }
@@ -96,11 +96,19 @@ let TaxInvoiceSendPage = class TaxInvoiceSendPage extends localize(i18next)(Scop
96
96
  <th>${i18next.t('field.short invoice type')}</th>
97
97
  <td>
98
98
  ${Object.keys(SHORT_INVOICE_TYPE['TAX_INVOICE']).map(key => {
99
- const disabled = key !== InvoiceType.TAX_INVOICE;
99
+ const disabled = key !== InvoiceType.TAX_INVOICE && key !== InvoiceType.SMALL_BUSINESS_TAX_INVOICE;
100
100
  const checked = key === InvoiceType.TAX_INVOICE;
101
101
  return html `
102
102
  <label for="${'tax_' + key}">${SHORT_INVOICE_TYPE['TAX_INVOICE'][key]}</label>
103
- <input type="radio" id="${'tax_' + key}" value="${key}" name="invoiceType" ?checked=${checked} ?disabled=${disabled} />
103
+ <input
104
+ type="radio"
105
+ id="${'tax_' + key}"
106
+ .value="${key}"
107
+ name="invoiceType"
108
+ ?checked=${checked}
109
+ ?disabled=${disabled}
110
+ @change=${this._onInputTaxInvoice}
111
+ />
104
112
  `;
105
113
  })}
106
114
  </td>
@@ -271,21 +279,33 @@ let TaxInvoiceSendPage = class TaxInvoiceSendPage extends localize(i18next)(Scop
271
279
  <th>${i18next.t('field.delete')}</th>
272
280
  </tr>
273
281
 
274
- ${this.taxInvoiceItems.map((item, idx) => html `
275
- <tr>
276
- <input type="hidden" name="sequence" value=${item.sequence} />
277
- <td>${this.taxInvoice.issueDate.split('-')[1]}</td>
278
- <td><input type="text" numeric maxlength="2" name="supplyDate" @input=${e => this._onInputItem(e, idx)} /></td>
279
- <td><input type="text" name="itemName" .value=${item.itemName} @input=${e => this._onInputItem(e, idx)} /></td>
280
- <td><input type="text" name="specification" .value=${item.specification} @input=${e => this._onInputItem(e, idx)} /></td>
281
- <td><input type="text" numeric name="quantity" .value=${this._numberFormat(item.quantity)} @input=${e => this._onInputItem(e, idx)} /></td>
282
- <td><input type="text" numeric name="unitPrice" .value=${this._numberFormat(item.unitPrice)} @input=${e => this._onInputItem(e, idx)} /></td>
283
- <td><input type="text" readonly name="supplyPrice" .value=${this._numberFormat(item.supplyPrice)} @input=${e => this._onInputItem(e, idx)} /></td>
284
- <td><input type="text" readonly name="taxPrice" .value=${this._numberFormat(item.taxPrice)} @input=${e => this._onInputItem(e, idx)} /></td>
285
- <td><input type="text" name="remark" .value=${item.remark || ''} @input=${e => this._onInputItem(e, idx)} /></td>
286
- <td><button class="btn-delete" @click=${e => this._onRemoveInvoiceItem(e, item.sequence)}>삭제</button></td>
287
- </tr>
288
- `)}
282
+ ${this.taxInvoiceItems.map((item, idx) => {
283
+ const taxDisabled = this.taxInvoice.invoiceType === InvoiceType.SMALL_BUSINESS_TAX_INVOICE;
284
+ return html `
285
+ <tr>
286
+ <input type="hidden" name="sequence" value=${item.sequence} />
287
+ <td>${this.taxInvoice.issueDate.split('-')[1]}</td>
288
+ <td><input type="text" numeric maxlength="2" name="supplyDate" @input=${e => this._onInputItem(e, idx)} /></td>
289
+ <td><input type="text" name="itemName" .value=${item.itemName} @input=${e => this._onInputItem(e, idx)} /></td>
290
+ <td><input type="text" name="specification" .value=${item.specification} @input=${e => this._onInputItem(e, idx)} /></td>
291
+ <td><input type="text" numeric name="quantity" .value=${this._numberFormat(item.quantity)} @input=${e => this._onInputItem(e, idx)} /></td>
292
+ <td><input type="text" numeric name="unitPrice" .value=${this._numberFormat(item.unitPrice)} @input=${e => this._onInputItem(e, idx)} /></td>
293
+ <td><input type="text" numeric name="supplyPrice" .value=${this._numberFormat(item.supplyPrice)} @input=${e => this._onInputItem(e, idx)} /></td>
294
+ <td>
295
+ <input
296
+ type="text"
297
+ numeric
298
+ name="taxPrice"
299
+ .value=${this._numberFormat(item.taxPrice)}
300
+ @input=${e => this._onInputItem(e, idx)}
301
+ .disabled=${taxDisabled}
302
+ />
303
+ </td>
304
+ <td><input type="text" name="remark" .value=${item.remark || ''} @input=${e => this._onInputItem(e, idx)} /></td>
305
+ <td><button class="btn-delete" @click=${e => this._onRemoveInvoiceItem(e, item.sequence)}>삭제</button></td>
306
+ </tr>
307
+ `;
308
+ })}
289
309
  </table>
290
310
  </div>
291
311
 
@@ -400,6 +420,8 @@ let TaxInvoiceSendPage = class TaxInvoiceSendPage extends localize(i18next)(Scop
400
420
  taxInvoice.paymentAmountCheck = Number(taxInvoice.paymentAmountCheck || 0);
401
421
  taxInvoice.paymentAmountPromissoryNote = Number(taxInvoice.paymentAmountPromissoryNote || 0);
402
422
  taxInvoice.paymentAmountAccountsReceivable = Number(taxInvoice.paymentAmountAccountsReceivable || 0);
423
+ taxInvoice.supplyAmount = Number(taxInvoice.supplyAmount || 0);
424
+ taxInvoice.taxAmount = Number(taxInvoice.taxAmount || 0);
403
425
  // 공급받는자 필수 값 체크
404
426
  if (!this.buyer.buyerBusinessRegistrationNumber || !this.buyer.buyerBusinessName || !this.buyer.buyerRepresentativeName) {
405
427
  alert('공급받는자 필수 값을 모두 입력해 주세요.');
@@ -458,10 +480,13 @@ let TaxInvoiceSendPage = class TaxInvoiceSendPage extends localize(i18next)(Scop
458
480
  alert('작성일자는 현재일까지 입력하시기 바랍니다.');
459
481
  return;
460
482
  }
483
+ // 세금이 없는 영세율이 선택 시 모든 아이템의 세금 0원으로 초기화
484
+ if (target.name === 'invoiceType' && target.value === InvoiceType.SMALL_BUSINESS_TAX_INVOICE) {
485
+ this.taxInvoiceItems = this.taxInvoiceItems.map(item => (Object.assign(Object.assign({}, item), { taxPrice: 0 })));
486
+ }
487
+ // 변경시에는 아이템 변경도 리 렌더가 필요해서 데이터 갱신
461
488
  this.taxInvoice[target.name] = target.value;
462
- // 날짜 변경시에는 아이템 변경도 리 렌더가 필요해서 데이터 갱신
463
- if (target.name === 'issueDate')
464
- this.taxInvoice = Object.assign({}, this.taxInvoice);
489
+ this.taxInvoice = Object.assign({}, this.taxInvoice);
465
490
  }
466
491
  }
467
492
  // Input 요소의 값이 변경될 때 호출되는 콜백 함수
@@ -470,26 +495,31 @@ let TaxInvoiceSendPage = class TaxInvoiceSendPage extends localize(i18next)(Scop
470
495
  let inputVal = target.value;
471
496
  // 숫자 타입은 다른 문자 입력 제거
472
497
  if (target.hasAttribute('numeric')) {
473
- inputVal = inputVal.replace(/\D/g, '');
498
+ inputVal = Number(inputVal.replace(/\D/g, ''));
474
499
  target.value = inputVal;
475
500
  }
476
501
  // 공급일자 케이스 시 => 세금계산서의 작성일자의 YYYY-MM + 아이템의 입력된 DD
477
502
  if (target.name === 'supplyDate') {
478
- const itemDate = this.taxInvoice.issueDate.substring(0, 8) + inputVal.padStart(2, '0');
503
+ const itemDate = this.taxInvoice.issueDate.substring(0, 8) + inputVal.toString().padStart(2, '0');
479
504
  if (itemDate > this.taxInvoice.issueDate) {
480
505
  alert('품목의 일자는 작성일자보다 클 수 없습니다.');
481
506
  target.value = '';
482
507
  }
483
508
  inputVal = itemDate;
484
509
  }
510
+ // 수량, 단가 수정시 공급가액/세액 자동 계산
485
511
  if (target.name == 'quantity' || target.name == 'unitPrice') {
486
512
  const supplyPrice = target.name == 'quantity' ? Number(inputVal) * this.taxInvoiceItems[idx]['unitPrice'] : Number(inputVal) * this.taxInvoiceItems[idx]['quantity'];
487
513
  this.taxInvoiceItems[idx]['supplyPrice'] = supplyPrice;
488
514
  this.taxInvoiceItems[idx]['taxPrice'] = Math.floor(supplyPrice / 10);
515
+ }
516
+ // 인풋에 값 넣기
517
+ this.taxInvoiceItems[idx][target.name] = inputVal;
518
+ // 아이템 금액에 관련된 필드 수정시 합계 계산
519
+ if (['quantity', 'unitPrice', 'supplyPrice', 'taxPrice'].includes(target.name)) {
489
520
  this.taxInvoiceItems = [...this.taxInvoiceItems];
490
521
  this._setTaxInvoiceSummaryCalc();
491
522
  }
492
- this.taxInvoiceItems[idx][target.name] = inputVal;
493
523
  }
494
524
  async _openSupplierPopup() {
495
525
  const response = await client.query({
@@ -613,8 +643,8 @@ let TaxInvoiceSendPage = class TaxInvoiceSendPage extends localize(i18next)(Scop
613
643
  this._setTaxInvoiceSummaryCalc();
614
644
  }
615
645
  _setTaxInvoiceSummaryCalc() {
616
- const supplyPrice = this.taxInvoiceItems.reduce((prev, item) => prev + item.supplyPrice, 0);
617
- const taxPrice = this.taxInvoiceItems.reduce((prev, item) => prev + item.taxPrice, 0);
646
+ const supplyPrice = this.taxInvoiceItems.reduce((prev, item) => prev + Number(item.supplyPrice), 0) || 0;
647
+ const taxPrice = this.taxInvoiceItems.reduce((prev, item) => prev + Number(item.taxPrice), 0) || 0;
618
648
  this.taxInvoice = Object.assign(Object.assign({}, this.taxInvoice), { supplyAmount: supplyPrice, taxAmount: taxPrice, totalAmount: supplyPrice + taxPrice });
619
649
  }
620
650
  };
@@ -661,7 +691,8 @@ TaxInvoiceSendPage.styles = [
661
691
  input[type='date'] {
662
692
  width: auto;
663
693
  }
664
- input[readonly] {
694
+ input[readonly],
695
+ input:disabled {
665
696
  background-color: #eee;
666
697
  }
667
698
 
@@ -1 +1 @@
1
- {"version":3,"file":"tax-invo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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAkQF;CACF,CAAA;AAWD;IAAC,KAAK,EAAE;;oDAMP;AACD;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;iDAK1B;AACD;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;sDAQ1B;AAYD;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;;2DAAwE;AAnTvF,kBAAkB;IAD9B,aAAa,CAAC,uBAAuB,CAAC;GAC1B,kBAAkB,CAg4B9B;SAh4BY,kBAAkB","sourcesContent":["import '@operato/data-grist'\n\nimport { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'\nimport { PageView } from '@operato/shell'\nimport { css, html } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { ScopedElementsMixin } from '@open-wc/scoped-elements'\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { notify } from '@operato/layout'\nimport gql from 'graphql-tag'\nimport { BUSINESS_REGISTRATION_CATEGORY, BusinessRegistrationCategory, Category, INVOICE_TYPE, InvoiceType, PURPOSE, Purpose } from '../tax-invoice/tax-invoice-list-page'\nimport { openPopup } from '@operato/layout'\nimport { CompanyListPopup } from './company-list-popup'\n\nconst SHORT_INVOICE_TYPE = {\n TAX_INVOICE: {\n [InvoiceType.TAX_INVOICE]: '일반',\n [InvoiceType.SMALL_BUSINESS_TAX_INVOICE]: '영세율',\n [InvoiceType.CONSIGNMENT_TAX_INVOICE]: '위수탁',\n [InvoiceType.SMALL_BUSINESS_CONSIGNMENT_TAX_INVOICE]: '위수탁영세율'\n },\n INVOICE: {\n [InvoiceType.INVOICE]: '일반',\n [InvoiceType.CONSIGNMENT_INVOICE]: '위수탁'\n // [InvoiceType.IMPORT_INVOICE]: INVOICE_TYPE[IMPORT_INVOICE],\n }\n}\n\nconst SHORT_BUSINESS_REGISTRATION_CATEGORY = {\n [BusinessRegistrationCategory.BUSINESS_REGISTRATION_NUMBER]: '사업자',\n [BusinessRegistrationCategory.RESIDENT_REGISTRATION_NUMBER]: '개인',\n [BusinessRegistrationCategory.FOREIGNER_REGISTRATION_NUMBER]: '외국인'\n}\n\nexport interface Supplier {\n supplierBusinessRegistrationCategory: string\n supplierBusinessRegistrationNumber: string\n supplierBranchIdentification?: string\n supplierBusinessName: string\n supplierRepresentativeName: string\n supplierAddress?: string\n supplierBusinessType?: string\n supplierIndustryType?: string\n supplierDepartment?: string\n supplierContactName?: string\n supplierContactPhone?: string\n supplierContactEmail?: string\n supplierContactCellPhone?: string\n}\ninterface Buyer {\n buyerBusinessRegistrationCategory: BusinessRegistrationCategory\n buyerBusinessRegistrationNumber: string\n buyerBranchIdentification?: string\n buyerBusinessName: string\n buyerRepresentativeName: string\n buyerAddress?: string\n buyerBusinessType?: string\n buyerIndustryType?: string\n buyer1stDepartment?: string\n buyer1stContactName?: string\n buyer1stContactPhone?: string\n buyer1stContactEmail?: string\n buyer1stContactCellPhone?: string\n buyer2ndDepartment?: string\n buyer2ndContactName?: string\n buyer2ndContactPhone?: string\n buyer2ndContactEmail?: string\n buyer2ndContactCellPhone?: string\n}\ninterface TaxInvoice {\n category: Category\n issueNo?: string\n approvalNo?: string\n originalApprovalNo?: string\n issueDate: string\n signatureDate?: string\n invoiceType: InvoiceType\n purpose: Purpose\n remark0?: string\n remark1?: string\n remark2?: string\n paymentAmountCash?: number\n paymentAmountCheck?: number\n paymentAmountPromissoryNote?: number\n paymentAmountAccountsReceivable?: number\n supplyAmount: number\n taxAmount?: number\n totalAmount: number\n // revisedReason?: RevisedReason\n}\ninterface TaxInvoiceItem {\n sequence: number\n supplyDate: string\n itemName: string\n specification: string\n quantity: number\n unitPrice: number\n supplyPrice: number\n taxPrice: number\n remark?: string\n}\n\n@customElement('tax-invoice-send-page')\nexport class TaxInvoiceSendPage extends localize(i18next)(ScopedElementsMixin(PageView)) {\n static styles = [\n ScrollbarStyles,\n CommonGristStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n overflow-x: hidden;\n\n width: 100%;\n min-width: 850px;\n padding: 0 40px 40px 40px;\n\n --grid-record-emphasized-background-color: red;\n --grid-record-emphasized-color: yellow;\n }\n\n .flex-row {\n display: flex;\n flex-direction: row;\n }\n .flex-column {\n display: flex;\n flex-direction: column;\n }\n\n input[type='text'],\n input[type='date'],\n input[type='number'] {\n width: 85%;\n max-width: calc(100% - 12px);\n height: 14px;\n margin: 0;\n padding: 4px 5px 5px;\n line-height: 14px;\n border: 1px solid #bbb;\n background: #fff;\n letter-spacing: 0.5px;\n }\n input[type='date'] {\n width: auto;\n }\n input[readonly] {\n background-color: #eee;\n }\n\n div.invoice-type {\n font-size: 18px;\n margin-top: 15px;\n }\n\n table {\n border: solid;\n border-width: 2px 0;\n border-collapse: collapse;\n border-spacing: 0;\n }\n\n .title table {\n border-color: #d3dbe5;\n width: 100%;\n height: 33px;\n margin-top: 10px;\n font-size: 12px;\n\n th {\n font-size: 13px;\n background-color: #e9edf6;\n min-width: 140px;\n }\n td {\n width: 50%;\n padding-left: 10px;\n\n & > * {\n vertical-align: middle;\n }\n & > input {\n margin: 0 5px 0 1px;\n }\n }\n }\n\n div.body {\n margin-top: 15px;\n font-size: 14px;\n\n div.data {\n display: flex;\n margin-top: 5px;\n\n table {\n flex: 1;\n\n td,\n th {\n padding: 5px;\n min-width: 60px;\n }\n td {\n padding-left: 8px;\n }\n th.target {\n width: 25px;\n writing-mode: vertical-rl;\n min-width: unset;\n }\n\n &.supplier {\n border-color: #f64843;\n\n td,\n th {\n background-color: #fef5f7;\n border: solid 1.5px #f5b1b1;\n }\n th.target {\n background-color: #fedbde;\n }\n }\n &.buyer {\n border-color: #007ed9;\n\n td,\n th {\n background-color: #f7f7ff;\n border: solid 1.5px #a7bcff;\n }\n th.target {\n background-color: #c6daf6;\n }\n }\n }\n }\n\n div.header {\n display: flex;\n\n span {\n flex: 1;\n }\n }\n\n div.info {\n margin-top: 15px;\n border: solid;\n border-color: #000;\n border-width: 2px 0px 0px 0px;\n\n div.flex-row div {\n border: solid #c4d2ff;\n border-width: 0px 1.5px 1.5px 1.5px;\n margin-right: -1px;\n padding: 5px;\n text-align: center;\n\n &.title {\n background-color: #e9edf5;\n font-weight: bold;\n flex: 1;\n }\n &.value {\n flex: 3;\n text-align: left;\n\n .desc {\n font-size: 11px;\n color: #c90000;\n }\n }\n }\n }\n\n div.items,\n div.summary {\n margin-top: 20px;\n\n table {\n width: 100%;\n border-color: #000;\n border-width: 2px 0px 0px 0px;\n\n th {\n background-color: #e9edf5;\n }\n th,\n td {\n border: solid 1.5px #c4d2ff;\n padding: 5px;\n text-align: center;\n }\n }\n }\n\n div.summary {\n display: flex;\n\n & > table {\n flex: 6.7;\n }\n & > div {\n flex: 3.2;\n display: flex;\n justify-content: center;\n align-items: center;\n border: 1.5px solid #c4d2ff;\n border-top: 2px solid #000;\n }\n\n span.type-wrapper {\n margin: 0 10px;\n\n & > div {\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 4px;\n\n input[type='radio' i] {\n margin: 0px;\n }\n }\n }\n }\n\n div.items {\n div.desc {\n font-weight: 400;\n font-size: 12px;\n margin-bottom: 5px;\n }\n div.desc-date {\n color: #005d98;\n }\n button {\n font-size: 13px;\n height: 25px;\n cursor: pointer;\n text-align: center;\n font-weight: 600;\n border-radius: 2px;\n border-color: #ccc;\n }\n .btn-add {\n color: #333;\n background-color: #f9f9f9;\n }\n .btn-delete {\n color: #fff;\n background-color: #5c636e;\n border: none;\n }\n }\n\n *[required]::before {\n content: '*';\n color: red;\n margin-right: 2px;\n }\n }\n `\n ]\n\n static get scopedElements() {\n return {\n 'company-list-popup': CompanyListPopup\n }\n }\n\n // 오늘 날짜 YYYY-MM-DD 형식으로 뽑기\n private today: string = new Intl.DateTimeFormat('fr-CA', { timeZone: 'Asia/Seoul' }).format(new Date())\n\n @state() supplier: Supplier = {\n supplierBusinessRegistrationCategory: '01',\n supplierBusinessRegistrationNumber: '',\n supplierBranchIdentification: '',\n supplierBusinessName: '',\n supplierRepresentativeName: ''\n }\n @property({ type: Object }) buyer: Buyer = {\n buyerBusinessRegistrationCategory: BusinessRegistrationCategory.BUSINESS_REGISTRATION_NUMBER,\n buyerBusinessRegistrationNumber: '',\n buyerBusinessName: '',\n buyerRepresentativeName: ''\n }\n @property({ type: Object }) taxInvoice: TaxInvoice = {\n invoiceType: InvoiceType.TAX_INVOICE,\n category: Category.EXPORT,\n issueDate: this.today,\n purpose: Purpose.INVOICE,\n supplyAmount: 0,\n taxAmount: 0,\n totalAmount: 0\n }\n\n private defaultTaxInvoiceItem = {\n sequence: new Date().getTime(), // 구분용 임시 값 (중복되면 안되니 생성 마다 넣어주기)\n supplyDate: '',\n itemName: '',\n specification: '',\n quantity: 0,\n unitPrice: 0,\n supplyPrice: 0,\n taxPrice: 0\n }\n @property({ type: Array }) taxInvoiceItems: TaxInvoiceItem[] = [{ ...this.defaultTaxInvoiceItem }]\n\n get context() {\n return {\n title: i18next.t('title.tax invoice send'),\n help: 'tax-invoice-send/tax-invoice-send',\n actions: [\n {\n title: i18next.t('button.tax invoice send'),\n action: this._sendTaxInvoice.bind(this),\n ...CommonButtonStyles.add\n }\n ]\n }\n }\n\n render() {\n return html`\n <div class=\"invoice-type\">\n * ${INVOICE_TYPE[this.taxInvoice?.invoiceType]} (${SHORT_BUSINESS_REGISTRATION_CATEGORY[this.buyer.buyerBusinessRegistrationCategory]})\n </div>\n\n <div class=\"title\">\n <table>\n <tr>\n <th>${i18next.t('field.short invoice type')}</th>\n <td>\n ${Object.keys(SHORT_INVOICE_TYPE['TAX_INVOICE']).map(key => {\n const disabled: boolean = key !== InvoiceType.TAX_INVOICE\n const checked: boolean = key === InvoiceType.TAX_INVOICE\n return html`\n <label for=\"${'tax_' + key}\">${SHORT_INVOICE_TYPE['TAX_INVOICE'][key]}</label>\n <input type=\"radio\" id=\"${'tax_' + key}\" value=\"${key}\" name=\"invoiceType\" ?checked=${checked} ?disabled=${disabled} />\n `\n })}\n </td>\n <th>${i18next.t('field.tax invoice buyer registration category')}</th>\n <td>\n ${Object.keys(BUSINESS_REGISTRATION_CATEGORY).map(key => {\n const disabled: boolean = key !== BusinessRegistrationCategory.BUSINESS_REGISTRATION_NUMBER\n const checked: boolean = key === BusinessRegistrationCategory.BUSINESS_REGISTRATION_NUMBER\n return html`\n <label for=\"${'tax_' + key}\">${BUSINESS_REGISTRATION_CATEGORY[key]}</label>\n <input type=\"radio\" id=\"${'tax_' + key}\" value=\"${key}\" name=\"buyerBusinessRegistrationCategory\" ?checked=${checked} ?disabled=${disabled} />\n `\n })}\n </td>\n </tr>\n </table>\n </div>\n\n <div class=\"body\">\n <div class=\"header\">\n <span><button @click=${this._openSupplierPopup}>공급처 선택</button></span>\n <span><button @click=${this._openBuyerPopup}>공급받는자 선택</button></span>\n </div>\n\n <div class=\"data\">\n <table class=\"supplier\">\n <colgroup>\n <col width=\"150px\" />\n <col width=\"18%\" />\n <col width=\"32%\" />\n <col width=\"18%\" />\n <col width=\"32%\" />\n </colgroup>\n <tr>\n <th rowspan=\"6\" class=\"target\">${i18next.t('field.tax invoice supplier')}</th>\n <th required>${i18next.t('field.short business registration number')}</th>\n <td>${this.supplier?.supplierBusinessRegistrationNumber.replace(/(\\S{3})(\\S{2})(\\S{5})/g, '$1-$2-$3')}</td>\n <th>${i18next.t('field.short branch identification')}</th>\n <td>${this.supplier?.supplierBranchIdentification}</td>\n </tr>\n <tr>\n <th required>${i18next.t('field.short tax invoice business name')}</th>\n <td><input type=\"text\" name=\"supplierBusinessName\" .value=${this.supplier?.supplierBusinessName || ''} @input=${this._onInputTaxInvoice} /></td>\n <th required>${i18next.t('field.tax invoice representative name')}</th>\n <td>\n <input type=\"text\" name=\"supplierRepresentativeName\" .value=${this.supplier?.supplierRepresentativeName || ''} @input=${this._onInputTaxInvoice} />\n </td>\n </tr>\n <tr>\n <th>${i18next.t('field.address')}</th>\n <td colspan=\"3\">${this.supplier?.supplierAddress}</td>\n </tr>\n <tr>\n <th>${i18next.t('field.business type')}</th>\n <td><input type=\"text\" name=\"supplierBusinessType\" .value=${this.supplier?.supplierBusinessType || ''} @input=${this._onInputTaxInvoice} /></td>\n <th>${i18next.t('field.industry type')}</th>\n <td><input type=\"text\" name=\"supplierIndustryType\" .value=${this.supplier?.supplierIndustryType || ''} @input=${this._onInputTaxInvoice} /></td>\n </tr>\n <tr>\n <th rowspan=\"2\">${i18next.t('field.email')}</th>\n <td rowspan=\"2\" colspan=\"3\">\n <input type=\"text\" name=\"supplierContactEmail\" .value=${this.supplier?.supplierContactEmail || ''} @input=${this._onInputTaxInvoice} />\n </td>\n </tr>\n <tr></tr>\n </table>\n\n <table class=\"buyer\">\n <colgroup>\n <col width=\"150px\" />\n <col width=\"18%\" />\n <col width=\"32%\" />\n <col width=\"18%\" />\n <col width=\"32%\" />\n </colgroup>\n <tr>\n <th rowspan=\"6\" class=\"target\">${i18next.t('field.tax invoice buyer')}</th>\n <th required>${i18next.t('field.short business registration number')}</th>\n <td>\n <input\n type=\"text\"\n maxlength=\"10\"\n name=\"buyerBusinessRegistrationNumber\"\n .value=${this.buyer?.buyerBusinessRegistrationNumber || ''}\n @input=${this._onInputTaxInvoice}\n />\n </td>\n <th>${i18next.t('field.short branch identification')}</th>\n <td><input type=\"text\" name=\"buyerBranchIdentification\" .value=${this.buyer?.buyerBranchIdentification || ''} @input=${this._onInputTaxInvoice} /></td>\n </tr>\n <tr>\n <th required>${i18next.t('field.short tax invoice business name')}</th>\n <td><input type=\"text\" name=\"buyerBusinessName\" .value=${this.buyer?.buyerBusinessName || ''} @input=${this._onInputTaxInvoice} /></td>\n <th required>${i18next.t('field.tax invoice representative name')}</th>\n <td><input type=\"text\" name=\"buyerRepresentativeName\" .value=${this.buyer?.buyerRepresentativeName || ''} @input=${this._onInputTaxInvoice} /></td>\n </tr>\n <tr>\n <th>${i18next.t('field.address')}</th>\n <td colspan=\"3\"><input type=\"text\" name=\"buyerAddress\" .value=${this.buyer?.buyerAddress || ''} @input=${this._onInputTaxInvoice} /></td>\n </tr>\n <tr>\n <th>${i18next.t('field.business type')}</th>\n <td><input type=\"text\" name=\"buyerBusinessType\" .value=${this.buyer?.buyerBusinessType || ''} @input=${this._onInputTaxInvoice} /></td>\n\n <th>${i18next.t('field.industry type')}</th>\n <td><input type=\"text\" name=\"buyerIndustryType\" .value=${this.buyer?.buyerIndustryType || ''} @input=${this._onInputTaxInvoice} /></td>\n </tr>\n <tr>\n <th>${i18next.t('field.email')}</th>\n <td colspan=\"3\"><input type=\"text\" name=\"buyer1stContactEmail\" .value=${this.buyer?.buyer1stContactEmail || ''} @input=${this._onInputTaxInvoice} /></td>\n </tr>\n <tr>\n <th>${i18next.t('field.email')}</th>\n <td colspan=\"3\"><input type=\"text\" name=\"buyer2ndContactEmail\" .value=${this.buyer?.buyer2ndContactEmail || ''} @input=${this._onInputTaxInvoice} /></td>\n </tr>\n </table>\n </div>\n\n <div class=\"info flex-column\">\n <div class=\"flex-row\">\n <div class=\"title\" required>${i18next.t('field.issue date')}</div>\n <div class=\"value\">\n <input type=\"date\" name=\"issueDate\" .value=${this.taxInvoice.issueDate} @input=${this._onInputTaxInvoice} />\n <span class=\"desc\">※ 작성일자는 공급 연월일을 의미함</span>\n </div>\n <div class=\"title\">${i18next.t('field.remark0')}</div>\n <div class=\"value\"><input type=\"text\" name=\"remark0\" .value=${this.taxInvoice?.remark0 || ''} @input=${this._onInputTaxInvoice} /></div>\n </div>\n <div class=\"flex-row\">\n <div class=\"title\">${i18next.t('field.total amount')}</div>\n <div class=\"value\">${this._numberFormat(this.taxInvoice?.totalAmount)}</div>\n <div class=\"title\">${i18next.t('field.supply amount')}</div>\n <div class=\"value\">${this._numberFormat(this.taxInvoice?.supplyAmount)}</div>\n <div class=\"title\">${i18next.t('field.tax amount')}</div>\n <div class=\"value\">${this._numberFormat(this.taxInvoice?.taxAmount)}</div>\n </div>\n </div>\n\n <div class=\"items\">\n <div class=\"desc desc-date\">\n ※ 아래 '품목'의 '월'은 상단 '작성일자'의 '월'이 자동 반영됩니다. 합계의 '계산' 버튼은 금액을 공급가액과 세액으로 계산할 수 있습니다.\n </div>\n <div class=\"desc\"><button class=\"btn-add\" @click=${this._onAddInvoiceItem}>품목추가</button> 품목은 최대 16개까지 추가, 삭제 가능</div>\n\n <table>\n <colgroup>\n <col width=\"5%\" />\n <col width=\"5%\" />\n <col width=\"14%\" />\n <col width=\"7%\" />\n <col width=\"7%\" />\n <col width=\"12%\" />\n <col width=\"12%\" />\n <col width=\"12%\" />\n <col width=\"16%\" />\n <col width=\"8%\" />\n </colgroup>\n <tr>\n <th>${i18next.t('field.tax invoice month')}</th>\n <th required>${i18next.t('field.tax invoice day')}</th>\n <th required>${i18next.t('field.tax invoice item name')}</th>\n <th>${i18next.t('field.tax invoice ea')}</th>\n <th required>${i18next.t('field.tax invoice quantity')}</th>\n <th required>${i18next.t('field.tax invoice price')}</th>\n <th>${i18next.t('field.supply amount')}</th>\n <th>${i18next.t('field.tax amount')}</th>\n <th>${i18next.t('field.remark0')}</th>\n <th>${i18next.t('field.delete')}</th>\n </tr>\n\n ${this.taxInvoiceItems.map(\n (item, idx) =>\n html`\n <tr>\n <input type=\"hidden\" name=\"sequence\" value=${item.sequence} />\n <td>${this.taxInvoice.issueDate.split('-')[1]}</td>\n <td><input type=\"text\" numeric maxlength=\"2\" name=\"supplyDate\" @input=${e => this._onInputItem(e, idx)} /></td>\n <td><input type=\"text\" name=\"itemName\" .value=${item.itemName} @input=${e => this._onInputItem(e, idx)} /></td>\n <td><input type=\"text\" name=\"specification\" .value=${item.specification} @input=${e => this._onInputItem(e, idx)} /></td>\n <td><input type=\"text\" numeric name=\"quantity\" .value=${this._numberFormat(item.quantity)} @input=${e => this._onInputItem(e, idx)} /></td>\n <td><input type=\"text\" numeric name=\"unitPrice\" .value=${this._numberFormat(item.unitPrice)} @input=${e => this._onInputItem(e, idx)} /></td>\n <td><input type=\"text\" readonly name=\"supplyPrice\" .value=${this._numberFormat(item.supplyPrice)} @input=${e => this._onInputItem(e, idx)} /></td>\n <td><input type=\"text\" readonly name=\"taxPrice\" .value=${this._numberFormat(item.taxPrice)} @input=${e => this._onInputItem(e, idx)} /></td>\n <td><input type=\"text\" name=\"remark\" .value=${item.remark || ''} @input=${e => this._onInputItem(e, idx)} /></td>\n <td><button class=\"btn-delete\" @click=${e => this._onRemoveInvoiceItem(e, item.sequence)}>삭제</button></td>\n </tr>\n `\n )}\n </table>\n </div>\n\n <div class=\"summary\">\n <table>\n <colgroup>\n <col width=\"25%\" />\n <col width=\"25%\" />\n <col width=\"25%\" />\n <col width=\"25%\" />\n </colgroup>\n <tr>\n <th>${i18next.t('field.tax invoice payment cash')}</th>\n <th>${i18next.t('field.tax invoice payment check')}</th>\n <th>${i18next.t('field.tax invoice payment promissory note')}</th>\n <th>${i18next.t('field.tax invoice payment accounts receivable')}</th>\n </tr>\n <tr>\n <td><input type=\"text\" numeric name=\"paymentAmountCash\" .value=${this.taxInvoice?.paymentAmountCash || ''} @input=${this._onInputTaxInvoice} /></td>\n <td><input type=\"text\" numeric name=\"paymentAmountCheck\" .value=${this.taxInvoice?.paymentAmountCheck || ''} @input=${this._onInputTaxInvoice} /></td>\n <td>\n <input\n type=\"text\"\n numeric\n name=\"paymentAmountPromissoryNote\"\n .value=${this.taxInvoice?.paymentAmountPromissoryNote || ''}\n @input=${this._onInputTaxInvoice}\n />\n </td>\n <td>\n <input\n type=\"text\"\n numeric\n name=\"paymentAmountAccountsReceivable\"\n .value=${this.taxInvoice?.paymentAmountAccountsReceivable || ''}\n @input=${this._onInputTaxInvoice}\n />\n </td>\n </tr>\n </table>\n <div>\n ${i18next.t('text.prev tax invoice description payment') + ' ('}\n <span class=\"type-wrapper\">\n <div>\n <input type=\"radio\" id=\"purpose_20\" name=\"purpose\" .value=${Purpose.INVOICE} @change=${this._onInputTaxInvoice} checked />\n <label for=\"purpose_20\">${PURPOSE[Purpose.INVOICE]}</label>\n </div>\n <div>\n <input type=\"radio\" id=\"purpose_10\" name=\"purpose\" .value=${Purpose.RECEIPT} @change=${this._onInputTaxInvoice} />\n <label for=\"purpose_10\">${PURPOSE[Purpose.RECEIPT]}</label>\n </div>\n </span>\n ${') ' + i18next.t('text.next tax invoice description payment')}\n </div>\n </div>\n </div>\n `\n }\n\n async pageInitialized(lifecycle: any) {\n this._fetchSupplier()\n }\n\n async _fetchSupplier() {\n const response = await client.query({\n query: gql`\n query taxInvoiceDefaultCompany {\n response: taxInvoiceDefaultCompany {\n businessRegistrationNumber\n branchIdentification\n businessName\n representativeName\n address\n businessType\n industryType\n department\n contactName\n contactPhone\n contactEmail\n contactCellPhone\n }\n }\n `\n })\n\n const supplier = response.data.response\n this.supplier = {\n supplierBusinessRegistrationCategory: supplier.businessRegistrationCategory,\n supplierBusinessRegistrationNumber: supplier.businessRegistrationNumber,\n supplierBranchIdentification: supplier.branchIdentification,\n supplierBusinessName: supplier.businessName,\n supplierRepresentativeName: supplier.representativeName,\n supplierAddress: supplier.address,\n supplierBusinessType: supplier.businessType,\n supplierIndustryType: supplier.industryType,\n supplierDepartment: supplier.department,\n supplierContactName: supplier.contactName,\n supplierContactPhone: supplier.contactPhone,\n supplierContactEmail: supplier.contactEmail,\n supplierContactCellPhone: supplier.contactCellPhone\n }\n }\n\n async pageUpdated(changes: any, lifecycle: any) {\n if (this.active) {\n // do something here when this page just became as active\n }\n }\n\n async _sendTaxInvoice(num: string) {\n // 아이템 시퀀스 재 할당 + 날짜, 품목, 규격, 수량이 없으면 필터\n let taxInvoiceItems = this.taxInvoiceItems.map((item, idx) => ({ ...item, sequence: idx + 1, quantity: Number(item.quantity), unitPrice: Number(item.unitPrice) }))\n taxInvoiceItems = taxInvoiceItems.filter(item => item.supplyDate && item.itemName && item.quantity && item.unitPrice)\n\n // taxInvoice 데이터 생성 및 타입 변환\n let taxInvoice = { ...this.taxInvoice, ...this.supplier, ...this.buyer }\n taxInvoice.paymentAmountCash = Number(taxInvoice.paymentAmountCash || 0)\n taxInvoice.paymentAmountCheck = Number(taxInvoice.paymentAmountCheck || 0)\n taxInvoice.paymentAmountPromissoryNote = Number(taxInvoice.paymentAmountPromissoryNote || 0)\n taxInvoice.paymentAmountAccountsReceivable = Number(taxInvoice.paymentAmountAccountsReceivable || 0)\n\n // 공급받는자 필수 값 체크\n if (!this.buyer.buyerBusinessRegistrationNumber || !this.buyer.buyerBusinessName || !this.buyer.buyerRepresentativeName) {\n alert('공급받는자 필수 값을 모두 입력해 주세요.')\n return\n }\n\n // 아이템 개수 체크\n if (taxInvoiceItems.length === 0) {\n alert('등록 가능한 아아템의 개수는 1개 이상이여야 합니다.')\n return\n }\n\n // 현금, 수표, 어음, 외상미수금의 합계 = 총 합계금액 체크\n const paymentAmount: number =\n taxInvoice.paymentAmountCash + taxInvoice.paymentAmountCheck + taxInvoice.paymentAmountPromissoryNote + taxInvoice.paymentAmountAccountsReceivable\n if (paymentAmount > 0 && paymentAmount !== taxInvoice.totalAmount) {\n alert('현금, 수표, 어음, 외상미수금의 합계는 총 합계금액과 동일해야 합니다.')\n return\n }\n\n const response = await client.mutate({\n mutation: gql`\n mutation SendTaxInvoicesByApi($taxInvoiceSendList: [TaxInvoiceSend!]!) {\n response: sendTaxInvoicesByApi(taxInvoiceSendList: $taxInvoiceSendList)\n }\n `,\n variables: {\n taxInvoiceSendList: [\n {\n taxInvoice,\n taxInvoiceItems\n }\n ]\n }\n })\n\n if (!response.errors) {\n notify({ message: i18next.t('text.success tax send') })\n }\n }\n\n private _numberFormat(value: number | undefined): string {\n return !value ? '' : new Intl.NumberFormat('en-US').format(value) || ''\n }\n\n // Input 요소의 값이 변경될 때 호출되는 콜백 함수\n private _onInputTaxInvoice(event: InputEvent) {\n const target = event.target as HTMLInputElement\n\n // 숫자 타입은 다른 문자 입력 제거\n if (target.hasAttribute('numeric')) {\n target.value = target.value.replace(/\\D/g, '')\n }\n\n if (target.name.startsWith('supplier')) {\n this.supplier[target.name] = target.value\n } else if (target.name.startsWith('buyer')) {\n this.buyer[target.name] = target.value\n } else {\n // 날짜 체크가 오늘 날짜를 넘어가면 값 변경 되면 안됨\n if (target.name === 'issueDate' && target.value > this.today) {\n target.value = this.taxInvoice['issueDate']\n alert('작성일자는 현재일까지 입력하시기 바랍니다.')\n return\n }\n\n this.taxInvoice[target.name] = target.value\n\n // 날짜 변경시에는 아이템 변경도 리 렌더가 필요해서 데이터 갱신\n if (target.name === 'issueDate') this.taxInvoice = { ...this.taxInvoice }\n }\n }\n\n // Input 요소의 값이 변경될 때 호출되는 콜백 함수\n private _onInputItem(e: InputEvent, idx: number) {\n const target = e.target as HTMLInputElement\n let inputVal = target.value\n\n // 숫자 타입은 다른 문자 입력 제거\n if (target.hasAttribute('numeric')) {\n inputVal = inputVal.replace(/\\D/g, '')\n target.value = inputVal\n }\n\n // 공급일자 케이스 시 => 세금계산서의 작성일자의 YYYY-MM + 아이템의 입력된 DD\n if (target.name === 'supplyDate') {\n const itemDate = this.taxInvoice.issueDate.substring(0, 8) + inputVal.padStart(2, '0')\n if (itemDate > this.taxInvoice.issueDate) {\n alert('품목의 일자는 작성일자보다 클 수 없습니다.')\n target.value = ''\n }\n inputVal = itemDate\n }\n\n if (target.name == 'quantity' || target.name == 'unitPrice') {\n const supplyPrice = target.name == 'quantity' ? Number(inputVal) * this.taxInvoiceItems[idx]['unitPrice'] : Number(inputVal) * this.taxInvoiceItems[idx]['quantity']\n this.taxInvoiceItems[idx]['supplyPrice'] = supplyPrice\n this.taxInvoiceItems[idx]['taxPrice'] = Math.floor(supplyPrice / 10)\n this.taxInvoiceItems = [...this.taxInvoiceItems]\n this._setTaxInvoiceSummaryCalc()\n }\n\n this.taxInvoiceItems[idx][target.name] = inputVal\n }\n\n private async _openSupplierPopup() {\n const response = await client.query({\n query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {\n responses: taxInvoiceApis(filters: $filters, pagination: $pagination, sortings: $sortings) {\n items {\n id\n name: provider\n businessRegistrationNumber\n branchIdentification\n businessName\n representativeName\n address\n businessType\n industryType\n department\n contactName\n contactPhone\n contactEmail\n contactCellPhone\n }\n }\n }\n `\n })\n\n const items = response.data.responses.items || []\n openPopup(\n html`\n <company-list-popup\n .companyList=${items}\n @selected=${e => {\n this.supplier = {\n supplierBusinessRegistrationCategory: BusinessRegistrationCategory.BUSINESS_REGISTRATION_NUMBER,\n supplierBusinessRegistrationNumber: e.detail.businessRegistrationNumber || '',\n supplierBranchIdentification: e.detail.branchIdentification || '',\n supplierBusinessName: e.detail.businessName || '',\n supplierRepresentativeName: e.detail.representativeName || '',\n supplierAddress: e.detail.address || '',\n supplierBusinessType: e.detail.businessType || '',\n supplierIndustryType: e.detail.industryType || '',\n supplierDepartment: e.detail.department || '',\n supplierContactName: e.detail.contactName || '',\n supplierContactPhone: e.detail.contactPhone || '',\n supplierContactEmail: e.detail.contactEmail || '',\n supplierContactCellPhone: e.detail.contactCellPhone || ''\n }\n\n history.back()\n }}\n >\n </company-list-popup>\n `,\n {\n backdrop: true,\n size: 'large',\n title: i18next.t('title.company list popup')\n }\n )\n }\n\n private async _openBuyerPopup() {\n const response = await client.query({\n query: gql`\n query TaxInvoiceBuyerList {\n responses: taxInvoiceBuyerList {\n id\n name\n businessRegistrationNumber\n branchIdentification\n businessName\n representativeName\n address\n businessType\n industryType\n department\n contactName\n contactPhone\n contactEmail\n contactCellPhone\n }\n }\n `\n })\n\n const items = response.data.responses || []\n openPopup(\n html`\n <company-list-popup\n .companyList=${items}\n @selected=${e => {\n this.buyer = {\n buyerBusinessRegistrationCategory: BusinessRegistrationCategory.BUSINESS_REGISTRATION_NUMBER,\n buyerBusinessRegistrationNumber: e.detail.businessRegistrationNumber || '',\n buyerBranchIdentification: e.detail.branchIdentification || '',\n buyerBusinessName: e.detail.businessName || '',\n buyerRepresentativeName: e.detail.representativeName || '',\n buyerAddress: e.detail.address || '',\n buyerBusinessType: e.detail.businessType || '',\n buyerIndustryType: e.detail.industryType || '',\n buyer1stDepartment: e.detail.department || '',\n buyer1stContactName: e.detail.contactName || '',\n buyer1stContactPhone: e.detail.contactPhone || '',\n buyer1stContactEmail: e.detail.contactEmail || '',\n buyer1stContactCellPhone: e.detail.contactCellPhone || ''\n }\n\n history.back()\n }}\n >\n </company-list-popup>\n `,\n {\n backdrop: true,\n size: 'large',\n title: i18next.t('title.company list popup')\n }\n )\n }\n\n private _onAddInvoiceItem(e: Event) {\n e.preventDefault()\n if (this.taxInvoiceItems.length >= 16) {\n alert('품목은 최대 16개까지 추가 가능합니다.')\n return\n }\n\n this.taxInvoiceItems = [...this.taxInvoiceItems, { ...this.defaultTaxInvoiceItem, sequence: new Date().getTime() }]\n }\n\n private _onRemoveInvoiceItem(e: Event, sequence: number) {\n e.preventDefault()\n this.taxInvoiceItems = [...this.taxInvoiceItems.filter(item => item.sequence != sequence)]\n this._setTaxInvoiceSummaryCalc()\n }\n\n private _setTaxInvoiceSummaryCalc() {\n const supplyPrice = this.taxInvoiceItems.reduce((prev, item) => prev + item.supplyPrice, 0)\n const taxPrice = this.taxInvoiceItems.reduce((prev, item) => prev + item.taxPrice, 0)\n\n this.taxInvoice = { ...this.taxInvoice, supplyAmount: supplyPrice, taxAmount: taxPrice, totalAmount: supplyPrice + taxPrice }\n }\n}\n"]}
1
+ {"version":3,"file":"tax-invoice-send-page.js","sourceRoot":"","sources":["../../../client/pages/tax-invoice-send/tax-invoice-send-page.ts"],"names":[],"mappings":";AAAA,OAAO,qBAAqB,CAAA;AAE5B,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACxF,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO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Q,GAAW,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAA;QAE1G,IAAI,CAAC,UAAU,mCAAQ,IAAI,CAAC,UAAU,KAAE,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,GAAG,QAAQ,GAAE,CAAA;IAC/H,CAAC;;AA75BM,yBAAM,GAAG;IACd,eAAe;IACf,iBAAiB;IACjB,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAmQF;CACF,CAAA;AAWD;IAAC,KAAK,EAAE;;oDAMP;AACD;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;iDAK1B;AACD;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;sDAQ1B;AAYD;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;;2DAAwE;AApTvF,kBAAkB;IAD9B,aAAa,CAAC,uBAAuB,CAAC;GAC1B,kBAAkB,CA+5B9B;SA/5BY,kBAAkB","sourcesContent":["import '@operato/data-grist'\n\nimport { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'\nimport { PageView } from '@operato/shell'\nimport { css, html } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { ScopedElementsMixin } from '@open-wc/scoped-elements'\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { notify } from '@operato/layout'\nimport gql from 'graphql-tag'\nimport { BUSINESS_REGISTRATION_CATEGORY, BusinessRegistrationCategory, Category, INVOICE_TYPE, InvoiceType, PURPOSE, Purpose } from '../tax-invoice/tax-invoice-list-page'\nimport { openPopup } from '@operato/layout'\nimport { CompanyListPopup } from './company-list-popup'\n\nconst SHORT_INVOICE_TYPE = {\n TAX_INVOICE: {\n [InvoiceType.TAX_INVOICE]: '일반',\n [InvoiceType.SMALL_BUSINESS_TAX_INVOICE]: '영세율',\n [InvoiceType.CONSIGNMENT_TAX_INVOICE]: '위수탁',\n [InvoiceType.SMALL_BUSINESS_CONSIGNMENT_TAX_INVOICE]: '위수탁영세율'\n },\n INVOICE: {\n [InvoiceType.INVOICE]: '일반',\n [InvoiceType.CONSIGNMENT_INVOICE]: '위수탁'\n // [InvoiceType.IMPORT_INVOICE]: INVOICE_TYPE[IMPORT_INVOICE],\n }\n}\n\nconst SHORT_BUSINESS_REGISTRATION_CATEGORY = {\n [BusinessRegistrationCategory.BUSINESS_REGISTRATION_NUMBER]: '사업자',\n [BusinessRegistrationCategory.RESIDENT_REGISTRATION_NUMBER]: '개인',\n [BusinessRegistrationCategory.FOREIGNER_REGISTRATION_NUMBER]: '외국인'\n}\n\nexport interface Supplier {\n supplierBusinessRegistrationCategory: string\n supplierBusinessRegistrationNumber: string\n supplierBranchIdentification?: string\n supplierBusinessName: string\n supplierRepresentativeName: string\n supplierAddress?: string\n supplierBusinessType?: string\n supplierIndustryType?: string\n supplierDepartment?: string\n supplierContactName?: string\n supplierContactPhone?: string\n supplierContactEmail?: string\n supplierContactCellPhone?: string\n}\ninterface Buyer {\n buyerBusinessRegistrationCategory: BusinessRegistrationCategory\n buyerBusinessRegistrationNumber: string\n buyerBranchIdentification?: string\n buyerBusinessName: string\n buyerRepresentativeName: string\n buyerAddress?: string\n buyerBusinessType?: string\n buyerIndustryType?: string\n buyer1stDepartment?: string\n buyer1stContactName?: string\n buyer1stContactPhone?: string\n buyer1stContactEmail?: string\n buyer1stContactCellPhone?: string\n buyer2ndDepartment?: string\n buyer2ndContactName?: string\n buyer2ndContactPhone?: string\n buyer2ndContactEmail?: string\n buyer2ndContactCellPhone?: string\n}\ninterface TaxInvoice {\n category: Category\n issueNo?: string\n approvalNo?: string\n originalApprovalNo?: string\n issueDate: string\n signatureDate?: string\n invoiceType: InvoiceType\n purpose: Purpose\n remark0?: string\n remark1?: string\n remark2?: string\n paymentAmountCash?: number\n paymentAmountCheck?: number\n paymentAmountPromissoryNote?: number\n paymentAmountAccountsReceivable?: number\n supplyAmount: number\n taxAmount?: number\n totalAmount: number\n // revisedReason?: RevisedReason\n}\ninterface TaxInvoiceItem {\n sequence: number\n supplyDate: string\n itemName: string\n specification: string\n quantity: number\n unitPrice: number\n supplyPrice: number\n taxPrice: number\n remark?: string\n}\n\n@customElement('tax-invoice-send-page')\nexport class TaxInvoiceSendPage extends localize(i18next)(ScopedElementsMixin(PageView)) {\n static styles = [\n ScrollbarStyles,\n CommonGristStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n overflow-x: hidden;\n\n width: 100%;\n min-width: 850px;\n padding: 0 40px 40px 40px;\n\n --grid-record-emphasized-background-color: red;\n --grid-record-emphasized-color: yellow;\n }\n\n .flex-row {\n display: flex;\n flex-direction: row;\n }\n .flex-column {\n display: flex;\n flex-direction: column;\n }\n\n input[type='text'],\n input[type='date'],\n input[type='number'] {\n width: 85%;\n max-width: calc(100% - 12px);\n height: 14px;\n margin: 0;\n padding: 4px 5px 5px;\n line-height: 14px;\n border: 1px solid #bbb;\n background: #fff;\n letter-spacing: 0.5px;\n }\n input[type='date'] {\n width: auto;\n }\n input[readonly],\n input:disabled {\n background-color: #eee;\n }\n\n div.invoice-type {\n font-size: 18px;\n margin-top: 15px;\n }\n\n table {\n border: solid;\n border-width: 2px 0;\n border-collapse: collapse;\n border-spacing: 0;\n }\n\n .title table {\n border-color: #d3dbe5;\n width: 100%;\n height: 33px;\n margin-top: 10px;\n font-size: 12px;\n\n th {\n font-size: 13px;\n background-color: #e9edf6;\n min-width: 140px;\n }\n td {\n width: 50%;\n padding-left: 10px;\n\n & > * {\n vertical-align: middle;\n }\n & > input {\n margin: 0 5px 0 1px;\n }\n }\n }\n\n div.body {\n margin-top: 15px;\n font-size: 14px;\n\n div.data {\n display: flex;\n margin-top: 5px;\n\n table {\n flex: 1;\n\n td,\n th {\n padding: 5px;\n min-width: 60px;\n }\n td {\n padding-left: 8px;\n }\n th.target {\n width: 25px;\n writing-mode: vertical-rl;\n min-width: unset;\n }\n\n &.supplier {\n border-color: #f64843;\n\n td,\n th {\n background-color: #fef5f7;\n border: solid 1.5px #f5b1b1;\n }\n th.target {\n background-color: #fedbde;\n }\n }\n &.buyer {\n border-color: #007ed9;\n\n td,\n th {\n background-color: #f7f7ff;\n border: solid 1.5px #a7bcff;\n }\n th.target {\n background-color: #c6daf6;\n }\n }\n }\n }\n\n div.header {\n display: flex;\n\n span {\n flex: 1;\n }\n }\n\n div.info {\n margin-top: 15px;\n border: solid;\n border-color: #000;\n border-width: 2px 0px 0px 0px;\n\n div.flex-row div {\n border: solid #c4d2ff;\n border-width: 0px 1.5px 1.5px 1.5px;\n margin-right: -1px;\n padding: 5px;\n text-align: center;\n\n &.title {\n background-color: #e9edf5;\n font-weight: bold;\n flex: 1;\n }\n &.value {\n flex: 3;\n text-align: left;\n\n .desc {\n font-size: 11px;\n color: #c90000;\n }\n }\n }\n }\n\n div.items,\n div.summary {\n margin-top: 20px;\n\n table {\n width: 100%;\n border-color: #000;\n border-width: 2px 0px 0px 0px;\n\n th {\n background-color: #e9edf5;\n }\n th,\n td {\n border: solid 1.5px #c4d2ff;\n padding: 5px;\n text-align: center;\n }\n }\n }\n\n div.summary {\n display: flex;\n\n & > table {\n flex: 6.7;\n }\n & > div {\n flex: 3.2;\n display: flex;\n justify-content: center;\n align-items: center;\n border: 1.5px solid #c4d2ff;\n border-top: 2px solid #000;\n }\n\n span.type-wrapper {\n margin: 0 10px;\n\n & > div {\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 4px;\n\n input[type='radio' i] {\n margin: 0px;\n }\n }\n }\n }\n\n div.items {\n div.desc {\n font-weight: 400;\n font-size: 12px;\n margin-bottom: 5px;\n }\n div.desc-date {\n color: #005d98;\n }\n button {\n font-size: 13px;\n height: 25px;\n cursor: pointer;\n text-align: center;\n font-weight: 600;\n border-radius: 2px;\n border-color: #ccc;\n }\n .btn-add {\n color: #333;\n background-color: #f9f9f9;\n }\n .btn-delete {\n color: #fff;\n background-color: #5c636e;\n border: none;\n }\n }\n\n *[required]::before {\n content: '*';\n color: red;\n margin-right: 2px;\n }\n }\n `\n ]\n\n static get scopedElements() {\n return {\n 'company-list-popup': CompanyListPopup\n }\n }\n\n // 오늘 날짜 YYYY-MM-DD 형식으로 뽑기\n private today: string = new Intl.DateTimeFormat('fr-CA', { timeZone: 'Asia/Seoul' }).format(new Date())\n\n @state() supplier: Supplier = {\n supplierBusinessRegistrationCategory: '01',\n supplierBusinessRegistrationNumber: '',\n supplierBranchIdentification: '',\n supplierBusinessName: '',\n supplierRepresentativeName: ''\n }\n @property({ type: Object }) buyer: Buyer = {\n buyerBusinessRegistrationCategory: BusinessRegistrationCategory.BUSINESS_REGISTRATION_NUMBER,\n buyerBusinessRegistrationNumber: '',\n buyerBusinessName: '',\n buyerRepresentativeName: ''\n }\n @property({ type: Object }) taxInvoice: TaxInvoice = {\n invoiceType: InvoiceType.TAX_INVOICE,\n category: Category.EXPORT,\n issueDate: this.today,\n purpose: Purpose.INVOICE,\n supplyAmount: 0,\n taxAmount: 0,\n totalAmount: 0\n }\n\n private defaultTaxInvoiceItem = {\n sequence: new Date().getTime(), // 구분용 임시 값 (중복되면 안되니 생성 마다 넣어주기)\n supplyDate: '',\n itemName: '',\n specification: '',\n quantity: 0,\n unitPrice: 0,\n supplyPrice: 0,\n taxPrice: 0\n }\n @property({ type: Array }) taxInvoiceItems: TaxInvoiceItem[] = [{ ...this.defaultTaxInvoiceItem }]\n\n get context() {\n return {\n title: i18next.t('title.tax invoice send'),\n help: 'tax-invoice-send/tax-invoice-send',\n actions: [\n {\n title: i18next.t('button.tax invoice send'),\n action: this._sendTaxInvoice.bind(this),\n ...CommonButtonStyles.add\n }\n ]\n }\n }\n\n render() {\n return html`\n <div class=\"invoice-type\">\n * ${INVOICE_TYPE[this.taxInvoice?.invoiceType]} (${SHORT_BUSINESS_REGISTRATION_CATEGORY[this.buyer.buyerBusinessRegistrationCategory]})\n </div>\n\n <div class=\"title\">\n <table>\n <tr>\n <th>${i18next.t('field.short invoice type')}</th>\n <td>\n ${Object.keys(SHORT_INVOICE_TYPE['TAX_INVOICE']).map(key => {\n const disabled: boolean = key !== InvoiceType.TAX_INVOICE && key !== InvoiceType.SMALL_BUSINESS_TAX_INVOICE\n const checked: boolean = key === InvoiceType.TAX_INVOICE\n return html`\n <label for=\"${'tax_' + key}\">${SHORT_INVOICE_TYPE['TAX_INVOICE'][key]}</label>\n <input\n type=\"radio\"\n id=\"${'tax_' + key}\"\n .value=\"${key}\"\n name=\"invoiceType\"\n ?checked=${checked}\n ?disabled=${disabled}\n @change=${this._onInputTaxInvoice}\n />\n `\n })}\n </td>\n <th>${i18next.t('field.tax invoice buyer registration category')}</th>\n <td>\n ${Object.keys(BUSINESS_REGISTRATION_CATEGORY).map(key => {\n const disabled: boolean = key !== BusinessRegistrationCategory.BUSINESS_REGISTRATION_NUMBER\n const checked: boolean = key === BusinessRegistrationCategory.BUSINESS_REGISTRATION_NUMBER\n return html`\n <label for=\"${'tax_' + key}\">${BUSINESS_REGISTRATION_CATEGORY[key]}</label>\n <input type=\"radio\" id=\"${'tax_' + key}\" value=\"${key}\" name=\"buyerBusinessRegistrationCategory\" ?checked=${checked} ?disabled=${disabled} />\n `\n })}\n </td>\n </tr>\n </table>\n </div>\n\n <div class=\"body\">\n <div class=\"header\">\n <span><button @click=${this._openSupplierPopup}>공급처 선택</button></span>\n <span><button @click=${this._openBuyerPopup}>공급받는자 선택</button></span>\n </div>\n\n <div class=\"data\">\n <table class=\"supplier\">\n <colgroup>\n <col width=\"150px\" />\n <col width=\"18%\" />\n <col width=\"32%\" />\n <col width=\"18%\" />\n <col width=\"32%\" />\n </colgroup>\n <tr>\n <th rowspan=\"6\" class=\"target\">${i18next.t('field.tax invoice supplier')}</th>\n <th required>${i18next.t('field.short business registration number')}</th>\n <td>${this.supplier?.supplierBusinessRegistrationNumber.replace(/(\\S{3})(\\S{2})(\\S{5})/g, '$1-$2-$3')}</td>\n <th>${i18next.t('field.short branch identification')}</th>\n <td>${this.supplier?.supplierBranchIdentification}</td>\n </tr>\n <tr>\n <th required>${i18next.t('field.short tax invoice business name')}</th>\n <td><input type=\"text\" name=\"supplierBusinessName\" .value=${this.supplier?.supplierBusinessName || ''} @input=${this._onInputTaxInvoice} /></td>\n <th required>${i18next.t('field.tax invoice representative name')}</th>\n <td>\n <input type=\"text\" name=\"supplierRepresentativeName\" .value=${this.supplier?.supplierRepresentativeName || ''} @input=${this._onInputTaxInvoice} />\n </td>\n </tr>\n <tr>\n <th>${i18next.t('field.address')}</th>\n <td colspan=\"3\">${this.supplier?.supplierAddress}</td>\n </tr>\n <tr>\n <th>${i18next.t('field.business type')}</th>\n <td><input type=\"text\" name=\"supplierBusinessType\" .value=${this.supplier?.supplierBusinessType || ''} @input=${this._onInputTaxInvoice} /></td>\n <th>${i18next.t('field.industry type')}</th>\n <td><input type=\"text\" name=\"supplierIndustryType\" .value=${this.supplier?.supplierIndustryType || ''} @input=${this._onInputTaxInvoice} /></td>\n </tr>\n <tr>\n <th rowspan=\"2\">${i18next.t('field.email')}</th>\n <td rowspan=\"2\" colspan=\"3\">\n <input type=\"text\" name=\"supplierContactEmail\" .value=${this.supplier?.supplierContactEmail || ''} @input=${this._onInputTaxInvoice} />\n </td>\n </tr>\n <tr></tr>\n </table>\n\n <table class=\"buyer\">\n <colgroup>\n <col width=\"150px\" />\n <col width=\"18%\" />\n <col width=\"32%\" />\n <col width=\"18%\" />\n <col width=\"32%\" />\n </colgroup>\n <tr>\n <th rowspan=\"6\" class=\"target\">${i18next.t('field.tax invoice buyer')}</th>\n <th required>${i18next.t('field.short business registration number')}</th>\n <td>\n <input\n type=\"text\"\n maxlength=\"10\"\n name=\"buyerBusinessRegistrationNumber\"\n .value=${this.buyer?.buyerBusinessRegistrationNumber || ''}\n @input=${this._onInputTaxInvoice}\n />\n </td>\n <th>${i18next.t('field.short branch identification')}</th>\n <td><input type=\"text\" name=\"buyerBranchIdentification\" .value=${this.buyer?.buyerBranchIdentification || ''} @input=${this._onInputTaxInvoice} /></td>\n </tr>\n <tr>\n <th required>${i18next.t('field.short tax invoice business name')}</th>\n <td><input type=\"text\" name=\"buyerBusinessName\" .value=${this.buyer?.buyerBusinessName || ''} @input=${this._onInputTaxInvoice} /></td>\n <th required>${i18next.t('field.tax invoice representative name')}</th>\n <td><input type=\"text\" name=\"buyerRepresentativeName\" .value=${this.buyer?.buyerRepresentativeName || ''} @input=${this._onInputTaxInvoice} /></td>\n </tr>\n <tr>\n <th>${i18next.t('field.address')}</th>\n <td colspan=\"3\"><input type=\"text\" name=\"buyerAddress\" .value=${this.buyer?.buyerAddress || ''} @input=${this._onInputTaxInvoice} /></td>\n </tr>\n <tr>\n <th>${i18next.t('field.business type')}</th>\n <td><input type=\"text\" name=\"buyerBusinessType\" .value=${this.buyer?.buyerBusinessType || ''} @input=${this._onInputTaxInvoice} /></td>\n\n <th>${i18next.t('field.industry type')}</th>\n <td><input type=\"text\" name=\"buyerIndustryType\" .value=${this.buyer?.buyerIndustryType || ''} @input=${this._onInputTaxInvoice} /></td>\n </tr>\n <tr>\n <th>${i18next.t('field.email')}</th>\n <td colspan=\"3\"><input type=\"text\" name=\"buyer1stContactEmail\" .value=${this.buyer?.buyer1stContactEmail || ''} @input=${this._onInputTaxInvoice} /></td>\n </tr>\n <tr>\n <th>${i18next.t('field.email')}</th>\n <td colspan=\"3\"><input type=\"text\" name=\"buyer2ndContactEmail\" .value=${this.buyer?.buyer2ndContactEmail || ''} @input=${this._onInputTaxInvoice} /></td>\n </tr>\n </table>\n </div>\n\n <div class=\"info flex-column\">\n <div class=\"flex-row\">\n <div class=\"title\" required>${i18next.t('field.issue date')}</div>\n <div class=\"value\">\n <input type=\"date\" name=\"issueDate\" .value=${this.taxInvoice.issueDate} @input=${this._onInputTaxInvoice} />\n <span class=\"desc\">※ 작성일자는 공급 연월일을 의미함</span>\n </div>\n <div class=\"title\">${i18next.t('field.remark0')}</div>\n <div class=\"value\"><input type=\"text\" name=\"remark0\" .value=${this.taxInvoice?.remark0 || ''} @input=${this._onInputTaxInvoice} /></div>\n </div>\n <div class=\"flex-row\">\n <div class=\"title\">${i18next.t('field.total amount')}</div>\n <div class=\"value\">${this._numberFormat(this.taxInvoice?.totalAmount)}</div>\n <div class=\"title\">${i18next.t('field.supply amount')}</div>\n <div class=\"value\">${this._numberFormat(this.taxInvoice?.supplyAmount)}</div>\n <div class=\"title\">${i18next.t('field.tax amount')}</div>\n <div class=\"value\">${this._numberFormat(this.taxInvoice?.taxAmount)}</div>\n </div>\n </div>\n\n <div class=\"items\">\n <div class=\"desc desc-date\">\n ※ 아래 '품목'의 '월'은 상단 '작성일자'의 '월'이 자동 반영됩니다. 합계의 '계산' 버튼은 금액을 공급가액과 세액으로 계산할 수 있습니다.\n </div>\n <div class=\"desc\"><button class=\"btn-add\" @click=${this._onAddInvoiceItem}>품목추가</button> 품목은 최대 16개까지 추가, 삭제 가능</div>\n\n <table>\n <colgroup>\n <col width=\"5%\" />\n <col width=\"5%\" />\n <col width=\"14%\" />\n <col width=\"7%\" />\n <col width=\"7%\" />\n <col width=\"12%\" />\n <col width=\"12%\" />\n <col width=\"12%\" />\n <col width=\"16%\" />\n <col width=\"8%\" />\n </colgroup>\n <tr>\n <th>${i18next.t('field.tax invoice month')}</th>\n <th required>${i18next.t('field.tax invoice day')}</th>\n <th required>${i18next.t('field.tax invoice item name')}</th>\n <th>${i18next.t('field.tax invoice ea')}</th>\n <th required>${i18next.t('field.tax invoice quantity')}</th>\n <th required>${i18next.t('field.tax invoice price')}</th>\n <th>${i18next.t('field.supply amount')}</th>\n <th>${i18next.t('field.tax amount')}</th>\n <th>${i18next.t('field.remark0')}</th>\n <th>${i18next.t('field.delete')}</th>\n </tr>\n\n ${this.taxInvoiceItems.map((item, idx) => {\n const taxDisabled = this.taxInvoice.invoiceType === InvoiceType.SMALL_BUSINESS_TAX_INVOICE\n\n return html`\n <tr>\n <input type=\"hidden\" name=\"sequence\" value=${item.sequence} />\n <td>${this.taxInvoice.issueDate.split('-')[1]}</td>\n <td><input type=\"text\" numeric maxlength=\"2\" name=\"supplyDate\" @input=${e => this._onInputItem(e, idx)} /></td>\n <td><input type=\"text\" name=\"itemName\" .value=${item.itemName} @input=${e => this._onInputItem(e, idx)} /></td>\n <td><input type=\"text\" name=\"specification\" .value=${item.specification} @input=${e => this._onInputItem(e, idx)} /></td>\n <td><input type=\"text\" numeric name=\"quantity\" .value=${this._numberFormat(item.quantity)} @input=${e => this._onInputItem(e, idx)} /></td>\n <td><input type=\"text\" numeric name=\"unitPrice\" .value=${this._numberFormat(item.unitPrice)} @input=${e => this._onInputItem(e, idx)} /></td>\n <td><input type=\"text\" numeric name=\"supplyPrice\" .value=${this._numberFormat(item.supplyPrice)} @input=${e => this._onInputItem(e, idx)} /></td>\n <td>\n <input\n type=\"text\"\n numeric\n name=\"taxPrice\"\n .value=${this._numberFormat(item.taxPrice)}\n @input=${e => this._onInputItem(e, idx)}\n .disabled=${taxDisabled}\n />\n </td>\n <td><input type=\"text\" name=\"remark\" .value=${item.remark || ''} @input=${e => this._onInputItem(e, idx)} /></td>\n <td><button class=\"btn-delete\" @click=${e => this._onRemoveInvoiceItem(e, item.sequence)}>삭제</button></td>\n </tr>\n `\n })}\n </table>\n </div>\n\n <div class=\"summary\">\n <table>\n <colgroup>\n <col width=\"25%\" />\n <col width=\"25%\" />\n <col width=\"25%\" />\n <col width=\"25%\" />\n </colgroup>\n <tr>\n <th>${i18next.t('field.tax invoice payment cash')}</th>\n <th>${i18next.t('field.tax invoice payment check')}</th>\n <th>${i18next.t('field.tax invoice payment promissory note')}</th>\n <th>${i18next.t('field.tax invoice payment accounts receivable')}</th>\n </tr>\n <tr>\n <td><input type=\"text\" numeric name=\"paymentAmountCash\" .value=${this.taxInvoice?.paymentAmountCash || ''} @input=${this._onInputTaxInvoice} /></td>\n <td><input type=\"text\" numeric name=\"paymentAmountCheck\" .value=${this.taxInvoice?.paymentAmountCheck || ''} @input=${this._onInputTaxInvoice} /></td>\n <td>\n <input\n type=\"text\"\n numeric\n name=\"paymentAmountPromissoryNote\"\n .value=${this.taxInvoice?.paymentAmountPromissoryNote || ''}\n @input=${this._onInputTaxInvoice}\n />\n </td>\n <td>\n <input\n type=\"text\"\n numeric\n name=\"paymentAmountAccountsReceivable\"\n .value=${this.taxInvoice?.paymentAmountAccountsReceivable || ''}\n @input=${this._onInputTaxInvoice}\n />\n </td>\n </tr>\n </table>\n <div>\n ${i18next.t('text.prev tax invoice description payment') + ' ('}\n <span class=\"type-wrapper\">\n <div>\n <input type=\"radio\" id=\"purpose_20\" name=\"purpose\" .value=${Purpose.INVOICE} @change=${this._onInputTaxInvoice} checked />\n <label for=\"purpose_20\">${PURPOSE[Purpose.INVOICE]}</label>\n </div>\n <div>\n <input type=\"radio\" id=\"purpose_10\" name=\"purpose\" .value=${Purpose.RECEIPT} @change=${this._onInputTaxInvoice} />\n <label for=\"purpose_10\">${PURPOSE[Purpose.RECEIPT]}</label>\n </div>\n </span>\n ${') ' + i18next.t('text.next tax invoice description payment')}\n </div>\n </div>\n </div>\n `\n }\n\n async pageInitialized(lifecycle: any) {\n this._fetchSupplier()\n }\n\n async _fetchSupplier() {\n const response = await client.query({\n query: gql`\n query taxInvoiceDefaultCompany {\n response: taxInvoiceDefaultCompany {\n businessRegistrationNumber\n branchIdentification\n businessName\n representativeName\n address\n businessType\n industryType\n department\n contactName\n contactPhone\n contactEmail\n contactCellPhone\n }\n }\n `\n })\n\n const supplier = response.data.response\n this.supplier = {\n supplierBusinessRegistrationCategory: supplier.businessRegistrationCategory,\n supplierBusinessRegistrationNumber: supplier.businessRegistrationNumber,\n supplierBranchIdentification: supplier.branchIdentification,\n supplierBusinessName: supplier.businessName,\n supplierRepresentativeName: supplier.representativeName,\n supplierAddress: supplier.address,\n supplierBusinessType: supplier.businessType,\n supplierIndustryType: supplier.industryType,\n supplierDepartment: supplier.department,\n supplierContactName: supplier.contactName,\n supplierContactPhone: supplier.contactPhone,\n supplierContactEmail: supplier.contactEmail,\n supplierContactCellPhone: supplier.contactCellPhone\n }\n }\n\n async pageUpdated(changes: any, lifecycle: any) {\n if (this.active) {\n // do something here when this page just became as active\n }\n }\n\n async _sendTaxInvoice(num: string) {\n // 아이템 시퀀스 재 할당 + 날짜, 품목, 규격, 수량이 없으면 필터\n let taxInvoiceItems = this.taxInvoiceItems.map((item, idx) => ({ ...item, sequence: idx + 1, quantity: Number(item.quantity), unitPrice: Number(item.unitPrice) }))\n taxInvoiceItems = taxInvoiceItems.filter(item => item.supplyDate && item.itemName && item.quantity && item.unitPrice)\n\n // taxInvoice 데이터 생성 및 타입 변환\n let taxInvoice = { ...this.taxInvoice, ...this.supplier, ...this.buyer }\n taxInvoice.paymentAmountCash = Number(taxInvoice.paymentAmountCash || 0)\n taxInvoice.paymentAmountCheck = Number(taxInvoice.paymentAmountCheck || 0)\n taxInvoice.paymentAmountPromissoryNote = Number(taxInvoice.paymentAmountPromissoryNote || 0)\n taxInvoice.paymentAmountAccountsReceivable = Number(taxInvoice.paymentAmountAccountsReceivable || 0)\n taxInvoice.supplyAmount = Number(taxInvoice.supplyAmount || 0)\n taxInvoice.taxAmount = Number(taxInvoice.taxAmount || 0)\n\n // 공급받는자 필수 값 체크\n if (!this.buyer.buyerBusinessRegistrationNumber || !this.buyer.buyerBusinessName || !this.buyer.buyerRepresentativeName) {\n alert('공급받는자 필수 값을 모두 입력해 주세요.')\n return\n }\n\n // 아이템 개수 체크\n if (taxInvoiceItems.length === 0) {\n alert('등록 가능한 아아템의 개수는 1개 이상이여야 합니다.')\n return\n }\n\n // 현금, 수표, 어음, 외상미수금의 합계 = 총 합계금액 체크\n const paymentAmount: number =\n taxInvoice.paymentAmountCash + taxInvoice.paymentAmountCheck + taxInvoice.paymentAmountPromissoryNote + taxInvoice.paymentAmountAccountsReceivable\n if (paymentAmount > 0 && paymentAmount !== taxInvoice.totalAmount) {\n alert('현금, 수표, 어음, 외상미수금의 합계는 총 합계금액과 동일해야 합니다.')\n return\n }\n\n const response = await client.mutate({\n mutation: gql`\n mutation SendTaxInvoicesByApi($taxInvoiceSendList: [TaxInvoiceSend!]!) {\n response: sendTaxInvoicesByApi(taxInvoiceSendList: $taxInvoiceSendList)\n }\n `,\n variables: {\n taxInvoiceSendList: [\n {\n taxInvoice,\n taxInvoiceItems\n }\n ]\n }\n })\n\n if (!response.errors) {\n notify({ message: i18next.t('text.success tax send') })\n }\n }\n\n private _numberFormat(value: number | undefined): string {\n return !value ? '' : new Intl.NumberFormat('en-US').format(value) || ''\n }\n\n // Input 요소의 값이 변경될 때 호출되는 콜백 함수\n private _onInputTaxInvoice(event: InputEvent) {\n const target = event.target as HTMLInputElement\n\n // 숫자 타입은 다른 문자 입력 제거\n if (target.hasAttribute('numeric')) {\n target.value = target.value.replace(/\\D/g, '')\n }\n\n if (target.name.startsWith('supplier')) {\n this.supplier[target.name] = target.value\n } else if (target.name.startsWith('buyer')) {\n this.buyer[target.name] = target.value\n } else {\n // 날짜 체크가 오늘 날짜를 넘어가면 값 변경 되면 안됨\n if (target.name === 'issueDate' && target.value > this.today) {\n target.value = this.taxInvoice['issueDate']\n alert('작성일자는 현재일까지 입력하시기 바랍니다.')\n return\n }\n\n // 세금이 없는 영세율이 선택 시 모든 아이템의 세금 0원으로 초기화\n if (target.name === 'invoiceType' && target.value === InvoiceType.SMALL_BUSINESS_TAX_INVOICE) {\n this.taxInvoiceItems = this.taxInvoiceItems.map(item => ({ ...item, taxPrice: 0 }))\n }\n\n // 변경시에는 아이템 변경도 리 렌더가 필요해서 데이터 갱신\n this.taxInvoice[target.name] = target.value\n this.taxInvoice = { ...this.taxInvoice }\n }\n }\n\n // Input 요소의 값이 변경될 때 호출되는 콜백 함수\n private _onInputItem(e: InputEvent, idx: number) {\n const target = e.target as HTMLInputElement\n let inputVal: any = target.value\n\n // 숫자 타입은 다른 문자 입력 제거\n if (target.hasAttribute('numeric')) {\n inputVal = Number(inputVal.replace(/\\D/g, ''))\n target.value = inputVal\n }\n\n // 공급일자 케이스 시 => 세금계산서의 작성일자의 YYYY-MM + 아이템의 입력된 DD\n if (target.name === 'supplyDate') {\n const itemDate = this.taxInvoice.issueDate.substring(0, 8) + inputVal.toString().padStart(2, '0')\n if (itemDate > this.taxInvoice.issueDate) {\n alert('품목의 일자는 작성일자보다 클 수 없습니다.')\n target.value = ''\n }\n inputVal = itemDate\n }\n\n // 수량, 단가 수정시 공급가액/세액 자동 계산\n if (target.name == 'quantity' || target.name == 'unitPrice') {\n const supplyPrice = target.name == 'quantity' ? Number(inputVal) * this.taxInvoiceItems[idx]['unitPrice'] : Number(inputVal) * this.taxInvoiceItems[idx]['quantity']\n this.taxInvoiceItems[idx]['supplyPrice'] = supplyPrice\n this.taxInvoiceItems[idx]['taxPrice'] = Math.floor(supplyPrice / 10)\n }\n\n // 인풋에 값 넣기\n this.taxInvoiceItems[idx][target.name] = inputVal\n\n // 아이템 금액에 관련된 필드 수정시 합계 계산\n if (['quantity', 'unitPrice', 'supplyPrice', 'taxPrice'].includes(target.name)) {\n this.taxInvoiceItems = [...this.taxInvoiceItems]\n this._setTaxInvoiceSummaryCalc()\n }\n }\n\n private async _openSupplierPopup() {\n const response = await client.query({\n query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {\n responses: taxInvoiceApis(filters: $filters, pagination: $pagination, sortings: $sortings) {\n items {\n id\n name: provider\n businessRegistrationNumber\n branchIdentification\n businessName\n representativeName\n address\n businessType\n industryType\n department\n contactName\n contactPhone\n contactEmail\n contactCellPhone\n }\n }\n }\n `\n })\n\n const items = response.data.responses.items || []\n openPopup(\n html`\n <company-list-popup\n .companyList=${items}\n @selected=${e => {\n this.supplier = {\n supplierBusinessRegistrationCategory: BusinessRegistrationCategory.BUSINESS_REGISTRATION_NUMBER,\n supplierBusinessRegistrationNumber: e.detail.businessRegistrationNumber || '',\n supplierBranchIdentification: e.detail.branchIdentification || '',\n supplierBusinessName: e.detail.businessName || '',\n supplierRepresentativeName: e.detail.representativeName || '',\n supplierAddress: e.detail.address || '',\n supplierBusinessType: e.detail.businessType || '',\n supplierIndustryType: e.detail.industryType || '',\n supplierDepartment: e.detail.department || '',\n supplierContactName: e.detail.contactName || '',\n supplierContactPhone: e.detail.contactPhone || '',\n supplierContactEmail: e.detail.contactEmail || '',\n supplierContactCellPhone: e.detail.contactCellPhone || ''\n }\n\n history.back()\n }}\n >\n </company-list-popup>\n `,\n {\n backdrop: true,\n size: 'large',\n title: i18next.t('title.company list popup')\n }\n )\n }\n\n private async _openBuyerPopup() {\n const response = await client.query({\n query: gql`\n query TaxInvoiceBuyerList {\n responses: taxInvoiceBuyerList {\n id\n name\n businessRegistrationNumber\n branchIdentification\n businessName\n representativeName\n address\n businessType\n industryType\n department\n contactName\n contactPhone\n contactEmail\n contactCellPhone\n }\n }\n `\n })\n\n const items = response.data.responses || []\n openPopup(\n html`\n <company-list-popup\n .companyList=${items}\n @selected=${e => {\n this.buyer = {\n buyerBusinessRegistrationCategory: BusinessRegistrationCategory.BUSINESS_REGISTRATION_NUMBER,\n buyerBusinessRegistrationNumber: e.detail.businessRegistrationNumber || '',\n buyerBranchIdentification: e.detail.branchIdentification || '',\n buyerBusinessName: e.detail.businessName || '',\n buyerRepresentativeName: e.detail.representativeName || '',\n buyerAddress: e.detail.address || '',\n buyerBusinessType: e.detail.businessType || '',\n buyerIndustryType: e.detail.industryType || '',\n buyer1stDepartment: e.detail.department || '',\n buyer1stContactName: e.detail.contactName || '',\n buyer1stContactPhone: e.detail.contactPhone || '',\n buyer1stContactEmail: e.detail.contactEmail || '',\n buyer1stContactCellPhone: e.detail.contactCellPhone || ''\n }\n\n history.back()\n }}\n >\n </company-list-popup>\n `,\n {\n backdrop: true,\n size: 'large',\n title: i18next.t('title.company list popup')\n }\n )\n }\n\n private _onAddInvoiceItem(e: Event) {\n e.preventDefault()\n if (this.taxInvoiceItems.length >= 16) {\n alert('품목은 최대 16개까지 추가 가능합니다.')\n return\n }\n\n this.taxInvoiceItems = [...this.taxInvoiceItems, { ...this.defaultTaxInvoiceItem, sequence: new Date().getTime() }]\n }\n\n private _onRemoveInvoiceItem(e: Event, sequence: number) {\n e.preventDefault()\n this.taxInvoiceItems = [...this.taxInvoiceItems.filter(item => item.sequence != sequence)]\n this._setTaxInvoiceSummaryCalc()\n }\n\n private _setTaxInvoiceSummaryCalc() {\n const supplyPrice: number = this.taxInvoiceItems.reduce((prev, item) => prev + Number(item.supplyPrice), 0) || 0\n const taxPrice: number = this.taxInvoiceItems.reduce((prev, item) => prev + Number(item.taxPrice), 0) || 0\n\n this.taxInvoice = { ...this.taxInvoice, supplyAmount: supplyPrice, taxAmount: taxPrice, totalAmount: supplyPrice + taxPrice }\n }\n}\n"]}