@things-factory/tax-invoice 8.0.66 → 8.0.67

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/client/index.ts +10 -0
  2. package/client/pages/tax-invoice-send/company-list-popup.ts +2 -1
  3. package/client/pages/tax-invoice-send/tax-invoice-send-page.ts +2 -7
  4. package/client/pages/tax-invoice-send/tax-invoice-send.ts +92 -20
  5. package/dist-client/index.d.ts +1 -0
  6. package/dist-client/index.js +1 -1
  7. package/dist-client/index.js.map +1 -1
  8. package/dist-client/pages/tax-invoice-send/company-list-popup.js +7 -3
  9. package/dist-client/pages/tax-invoice-send/company-list-popup.js.map +1 -1
  10. package/dist-client/pages/tax-invoice-send/tax-invoice-send-page.js +2 -7
  11. package/dist-client/pages/tax-invoice-send/tax-invoice-send-page.js.map +1 -1
  12. package/dist-client/pages/tax-invoice-send/tax-invoice-send.d.ts +1 -0
  13. package/dist-client/pages/tax-invoice-send/tax-invoice-send.js +119 -48
  14. package/dist-client/pages/tax-invoice-send/tax-invoice-send.js.map +1 -1
  15. package/dist-client/tsconfig.tsbuildinfo +1 -1
  16. package/dist-server/service/index.d.ts +2 -2
  17. package/dist-server/service/tax-invoice/tax-invoice-query.js +1 -1
  18. package/dist-server/service/tax-invoice/tax-invoice-query.js.map +1 -1
  19. package/dist-server/service/tax-invoice/tax-invoice.d.ts +1 -0
  20. package/dist-server/service/tax-invoice/tax-invoice.js +5 -0
  21. package/dist-server/service/tax-invoice/tax-invoice.js.map +1 -1
  22. package/dist-server/service/tax-invoice-api/index.d.ts +1 -1
  23. package/dist-server/service/tax-invoice-api/tax-invoice-api-mutation.d.ts +2 -0
  24. package/dist-server/service/tax-invoice-api/tax-invoice-api-mutation.js +14 -4
  25. package/dist-server/service/tax-invoice-api/tax-invoice-api-mutation.js.map +1 -1
  26. package/dist-server/tsconfig.tsbuildinfo +1 -1
  27. package/package.json +2 -2
  28. package/server/service/tax-invoice/tax-invoice-query.ts +1 -1
  29. package/server/service/tax-invoice/tax-invoice.ts +4 -0
  30. package/server/service/tax-invoice-api/tax-invoice-api-mutation.ts +30 -7
package/client/index.ts CHANGED
@@ -0,0 +1,10 @@
1
+ export {
2
+ Category,
3
+ InvoiceType,
4
+ Purpose,
5
+ BusinessRegistrationCategory,
6
+ CATEGORY,
7
+ INVOICE_TYPE,
8
+ PURPOSE,
9
+ BUSINESS_REGISTRATION_CATEGORY
10
+ } from './pages/tax-invoice/tax-invoice-list-page'
@@ -2,11 +2,12 @@ import '@material/web/icon/icon.js'
2
2
  import '@operato/data-grist'
3
3
 
4
4
  import { css, html, LitElement } from 'lit'
5
- import { property, query } from 'lit/decorators.js'
5
+ import { customElement, property, query } from 'lit/decorators.js'
6
6
  import { DataGrist } from '@operato/data-grist'
7
7
  import { i18next } from '@operato/i18n'
8
8
  import { CommonHeaderStyles } from '@operato/styles'
9
9
 
10
+ @customElement('company-list-popup')
10
11
  export class CompanyListPopup extends LitElement {
11
12
  static styles = [
12
13
  CommonHeaderStyles,
@@ -90,7 +90,7 @@ export class TaxInvoiceSendPage extends localize(i18next)(ScopedElementsMixin(Pa
90
90
  }
91
91
 
92
92
  render() {
93
- return html` <tax-invoice-send></tax-invoice-send> `
93
+ return html` <tax-invoice-send .editMode=${true}></tax-invoice-send> `
94
94
  }
95
95
 
96
96
  async _sendTaxInvoice() {
@@ -176,12 +176,7 @@ export class TaxInvoiceSendPage extends localize(i18next)(ScopedElementsMixin(Pa
176
176
  }
177
177
  `,
178
178
  variables: {
179
- taxInvoiceSendList: [
180
- {
181
- taxInvoice,
182
- taxInvoiceItems
183
- }
184
- ]
179
+ taxInvoiceSendList: [{ taxInvoice, taxInvoiceItems }]
185
180
  }
186
181
  })
187
182
 
@@ -155,6 +155,16 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
155
155
  input:disabled {
156
156
  background-color: #eee;
157
157
  }
158
+ input[type='radio'] {
159
+ cursor: pointer;
160
+ }
161
+ input[type='radio']:disabled {
162
+ cursor: default;
163
+ }
164
+ input[type='radio'] + label,
165
+ label + input[type='radio'] {
166
+ cursor: pointer;
167
+ }
158
168
 
159
169
  div.invoice-type {
160
170
  font-size: 18px;
@@ -190,6 +200,17 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
190
200
  & > input {
191
201
  margin: 0 5px 0 1px;
192
202
  }
203
+ & .radio-wrapper {
204
+ display: inline-flex;
205
+ align-items: center;
206
+ gap: 4px;
207
+ margin-right: 6px;
208
+ cursor: pointer;
209
+
210
+ input[type='radio'] {
211
+ margin: 0;
212
+ }
213
+ }
193
214
  }
194
215
  }
195
216
 
@@ -321,6 +342,7 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
321
342
 
322
343
  span.type-wrapper {
323
344
  margin: 0 10px;
345
+ cursor: pointer;
324
346
 
325
347
  & > div {
326
348
  display: flex;
@@ -409,17 +431,22 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
409
431
  taxPrice: 0
410
432
  }
411
433
 
434
+ @property({ type: Boolean }) editMode: boolean = true
412
435
  @property({ type: Object }) supplier: Supplier = this.defaultSupplier
413
436
  @property({ type: Object }) buyer: Buyer = this.defaultBuyer
414
437
  @property({ type: Object }) taxInvoice: TaxInvoice = this.defaultTaxInvoice
415
438
  @property({ type: Array }) taxInvoiceItems: TaxInvoiceItem[] = [{ ...this.defaultTaxInvoiceItem }]
416
439
 
417
440
  render() {
441
+ const invoiceTypeKey = this.taxInvoice?.invoiceType || InvoiceType.TAX_INVOICE
442
+ const invoiceTypeLabel = INVOICE_TYPE[invoiceTypeKey] || ''
443
+ const buyerRegCategoryKey =
444
+ this.buyer?.buyerBusinessRegistrationCategory || BusinessRegistrationCategory.BUSINESS_REGISTRATION_NUMBER
445
+ const buyerRegCategoryLabel = SHORT_BUSINESS_REGISTRATION_CATEGORY[buyerRegCategoryKey] || ''
446
+ const readOnly = !this.editMode
447
+
418
448
  return html`
419
- <div class="invoice-type">
420
- * ${INVOICE_TYPE[this.taxInvoice?.invoiceType]}
421
- (${SHORT_BUSINESS_REGISTRATION_CATEGORY[this.buyer.buyerBusinessRegistrationCategory]})
422
- </div>
449
+ <div class="invoice-type">* ${invoiceTypeLabel} (${buyerRegCategoryLabel})</div>
423
450
 
424
451
  <div class="title">
425
452
  <table>
@@ -431,16 +458,18 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
431
458
  key !== InvoiceType.TAX_INVOICE && key !== InvoiceType.SMALL_BUSINESS_TAX_INVOICE
432
459
  const checked: boolean = key === InvoiceType.TAX_INVOICE
433
460
  return html`
434
- <label for="${'tax_' + key}">${SHORT_INVOICE_TYPE['TAX_INVOICE'][key]}</label>
435
- <input
436
- type="radio"
437
- id="${'tax_' + key}"
438
- .value="${key}"
439
- name="invoiceType"
440
- ?checked=${checked}
441
- ?disabled=${disabled}
442
- @change=${this._onInputTaxInvoice}
443
- />
461
+ <span class="radio-wrapper">
462
+ <label for="${'tax_' + key}">${SHORT_INVOICE_TYPE['TAX_INVOICE'][key]}</label>
463
+ <input
464
+ type="radio"
465
+ id="${'tax_' + key}"
466
+ .value="${key}"
467
+ name="invoiceType"
468
+ ?checked=${checked}
469
+ ?disabled=${disabled || readOnly}
470
+ @change=${this._onInputTaxInvoice}
471
+ />
472
+ </span>
444
473
  `
445
474
  })}
446
475
  </td>
@@ -457,7 +486,7 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
457
486
  value="${key}"
458
487
  name="buyerBusinessRegistrationCategory"
459
488
  ?checked=${checked}
460
- ?disabled=${disabled}
489
+ ?disabled=${disabled || readOnly}
461
490
  />
462
491
  `
463
492
  })}
@@ -469,7 +498,7 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
469
498
  <div class="body">
470
499
  <div class="header">
471
500
  <span><button @click=${this._openSupplierPopup}>공급처 선택</button></span>
472
- <span><button @click=${this._openBuyerPopup}>공급받는자 선택</button></span>
501
+ <span><button @click=${this._openBuyerPopup} ?disabled=${readOnly}>공급받는자 선택</button></span>
473
502
  </div>
474
503
 
475
504
  <div class="data">
@@ -566,6 +595,7 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
566
595
  name="buyerBusinessRegistrationNumber"
567
596
  .value=${this.buyer?.buyerBusinessRegistrationNumber || ''}
568
597
  @input=${this._onInputTaxInvoice}
598
+ ?disabled=${readOnly}
569
599
  />
570
600
  </td>
571
601
  <th>${i18next.t('field.short branch identification')}</th>
@@ -575,6 +605,7 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
575
605
  name="buyerBranchIdentification"
576
606
  .value=${this.buyer?.buyerBranchIdentification || ''}
577
607
  @input=${this._onInputTaxInvoice}
608
+ ?disabled=${readOnly}
578
609
  />
579
610
  </td>
580
611
  </tr>
@@ -586,6 +617,7 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
586
617
  name="buyerBusinessName"
587
618
  .value=${this.buyer?.buyerBusinessName || ''}
588
619
  @input=${this._onInputTaxInvoice}
620
+ ?disabled=${readOnly}
589
621
  />
590
622
  </td>
591
623
  <th required>${i18next.t('field.tax invoice representative name')}</th>
@@ -595,6 +627,7 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
595
627
  name="buyerRepresentativeName"
596
628
  .value=${this.buyer?.buyerRepresentativeName || ''}
597
629
  @input=${this._onInputTaxInvoice}
630
+ ?disabled=${readOnly}
598
631
  />
599
632
  </td>
600
633
  </tr>
@@ -606,6 +639,7 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
606
639
  name="buyerAddress"
607
640
  .value=${this.buyer?.buyerAddress || ''}
608
641
  @input=${this._onInputTaxInvoice}
642
+ ?disabled=${readOnly}
609
643
  />
610
644
  </td>
611
645
  </tr>
@@ -617,6 +651,7 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
617
651
  name="buyerBusinessType"
618
652
  .value=${this.buyer?.buyerBusinessType || ''}
619
653
  @input=${this._onInputTaxInvoice}
654
+ ?disabled=${readOnly}
620
655
  />
621
656
  </td>
622
657
 
@@ -627,6 +662,7 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
627
662
  name="buyerIndustryType"
628
663
  .value=${this.buyer?.buyerIndustryType || ''}
629
664
  @input=${this._onInputTaxInvoice}
665
+ ?disabled=${readOnly}
630
666
  />
631
667
  </td>
632
668
  </tr>
@@ -638,6 +674,7 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
638
674
  name="buyer1stContactEmail"
639
675
  .value=${this.buyer?.buyer1stContactEmail || ''}
640
676
  @input=${this._onInputTaxInvoice}
677
+ ?disabled=${readOnly}
641
678
  />
642
679
  </td>
643
680
  </tr>
@@ -649,6 +686,7 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
649
686
  name="buyer2ndContactEmail"
650
687
  .value=${this.buyer?.buyer2ndContactEmail || ''}
651
688
  @input=${this._onInputTaxInvoice}
689
+ ?disabled=${readOnly}
652
690
  />
653
691
  </td>
654
692
  </tr>
@@ -664,6 +702,7 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
664
702
  name="issueDate"
665
703
  .value=${this.taxInvoice.issueDate}
666
704
  @input=${this._onInputTaxInvoice}
705
+ ?disabled=${readOnly}
667
706
  />
668
707
  <span class="desc">※ 작성일자는 공급 연월일을 의미함</span>
669
708
  </div>
@@ -674,6 +713,7 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
674
713
  name="remark0"
675
714
  .value=${this.taxInvoice?.remark0 || ''}
676
715
  @input=${this._onInputTaxInvoice}
716
+ ?disabled=${readOnly}
677
717
  />
678
718
  </div>
679
719
  </div>
@@ -693,8 +733,8 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
693
733
  세액으로 계산할 수 있습니다.
694
734
  </div>
695
735
  <div class="desc">
696
- <button class="btn-add" @click=${this._onAddInvoiceItem}>품목추가</button> 품목은 최대 16개까지 추가, 삭제
697
- 가능
736
+ <button class="btn-add" @click=${this._onAddInvoiceItem} ?disabled=${readOnly}>품목추가</button> 품목은 최대
737
+ 16개까지 추가, 삭제 가능
698
738
  </div>
699
739
 
700
740
  <table>
@@ -734,7 +774,9 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
734
774
  numeric
735
775
  maxlength="2"
736
776
  name="supplyDate"
777
+ .value=${item.supplyDate?.split('-')?.[2] || ''}
737
778
  @input=${e => this._onInputItem(e, idx)}
779
+ ?disabled=${readOnly}
738
780
  />
739
781
  </td>
740
782
  <td>
@@ -743,6 +785,7 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
743
785
  name="itemName"
744
786
  .value=${item.itemName}
745
787
  @input=${e => this._onInputItem(e, idx)}
788
+ ?disabled=${readOnly}
746
789
  />
747
790
  </td>
748
791
  <td>
@@ -751,6 +794,7 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
751
794
  name="specification"
752
795
  .value=${item.specification}
753
796
  @input=${e => this._onInputItem(e, idx)}
797
+ ?disabled=${readOnly}
754
798
  />
755
799
  </td>
756
800
  <td>
@@ -760,6 +804,7 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
760
804
  name="quantity"
761
805
  .value=${this._numberFormat(item.quantity)}
762
806
  @input=${e => this._onInputItem(e, idx)}
807
+ ?disabled=${readOnly}
763
808
  />
764
809
  </td>
765
810
  <td>
@@ -769,6 +814,7 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
769
814
  name="unitPrice"
770
815
  .value=${this._numberFormat(item.unitPrice)}
771
816
  @input=${e => this._onInputItem(e, idx)}
817
+ ?disabled=${readOnly}
772
818
  />
773
819
  </td>
774
820
  <td>
@@ -778,6 +824,7 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
778
824
  name="supplyPrice"
779
825
  .value=${this._numberFormat(item.supplyPrice)}
780
826
  @input=${e => this._onInputItem(e, idx)}
827
+ ?disabled=${readOnly}
781
828
  />
782
829
  </td>
783
830
  <td>
@@ -787,7 +834,7 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
787
834
  name="taxPrice"
788
835
  .value=${this._numberFormat(item.taxPrice)}
789
836
  @input=${e => this._onInputItem(e, idx)}
790
- .disabled=${this.isTaxFree}
837
+ ?disabled=${this.isTaxFree || readOnly}
791
838
  />
792
839
  </td>
793
840
  <td>
@@ -796,10 +843,17 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
796
843
  name="remark"
797
844
  .value=${item.remark || ''}
798
845
  @input=${e => this._onInputItem(e, idx)}
846
+ ?disabled=${readOnly}
799
847
  />
800
848
  </td>
801
849
  <td>
802
- <button class="btn-delete" @click=${e => this._onRemoveInvoiceItem(e, item.sequence)}>삭제</button>
850
+ <button
851
+ class="btn-delete"
852
+ @click=${e => this._onRemoveInvoiceItem(e, item.sequence)}
853
+ ?disabled=${readOnly}
854
+ >
855
+ 삭제
856
+ </button>
803
857
  </td>
804
858
  </tr>
805
859
  `
@@ -871,6 +925,7 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
871
925
  .value=${Purpose.INVOICE}
872
926
  @change=${this._onInputTaxInvoice}
873
927
  checked
928
+ ?disabled=${readOnly}
874
929
  />
875
930
  <label for="purpose_20">${PURPOSE[Purpose.INVOICE]}</label>
876
931
  </div>
@@ -881,6 +936,7 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
881
936
  name="purpose"
882
937
  .value=${Purpose.RECEIPT}
883
938
  @change=${this._onInputTaxInvoice}
939
+ ?disabled=${readOnly}
884
940
  />
885
941
  <label for="purpose_10">${PURPOSE[Purpose.RECEIPT]}</label>
886
942
  </div>
@@ -1075,6 +1131,14 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
1075
1131
  supplierContactCellPhone: e.detail.contactCellPhone || ''
1076
1132
  }
1077
1133
 
1134
+ this.dispatchEvent(
1135
+ new CustomEvent('supplier-selected', {
1136
+ detail: { supplier: this.supplier },
1137
+ bubbles: true,
1138
+ composed: true
1139
+ })
1140
+ )
1141
+
1078
1142
  history.back()
1079
1143
  }}
1080
1144
  >
@@ -1134,6 +1198,14 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
1134
1198
  buyer1stContactCellPhone: e.detail.contactCellPhone || ''
1135
1199
  }
1136
1200
 
1201
+ this.dispatchEvent(
1202
+ new CustomEvent('buyer-selected', {
1203
+ detail: { buyer: this.buyer },
1204
+ bubbles: true,
1205
+ composed: true
1206
+ })
1207
+ )
1208
+
1137
1209
  history.back()
1138
1210
  }}
1139
1211
  >
@@ -0,0 +1 @@
1
+ export { Category, InvoiceType, Purpose, BusinessRegistrationCategory, CATEGORY, INVOICE_TYPE, PURPOSE, BUSINESS_REGISTRATION_CATEGORY } from './pages/tax-invoice/tax-invoice-list-page';
@@ -1,2 +1,2 @@
1
- "use strict";
1
+ export { Category, InvoiceType, Purpose, BusinessRegistrationCategory, CATEGORY, INVOICE_TYPE, PURPOSE, BUSINESS_REGISTRATION_CATEGORY } from './pages/tax-invoice/tax-invoice-list-page';
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../client/index.ts"],"names":[],"mappings":"","sourcesContent":[""]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,WAAW,EACX,OAAO,EACP,4BAA4B,EAC5B,QAAQ,EACR,YAAY,EACZ,OAAO,EACP,8BAA8B,EAC/B,MAAM,2CAA2C,CAAA","sourcesContent":["export {\n Category,\n InvoiceType,\n Purpose,\n BusinessRegistrationCategory,\n CATEGORY,\n INVOICE_TYPE,\n PURPOSE,\n BUSINESS_REGISTRATION_CATEGORY\n} from './pages/tax-invoice/tax-invoice-list-page'\n"]}
@@ -2,11 +2,11 @@ import { __decorate, __metadata } from "tslib";
2
2
  import '@material/web/icon/icon.js';
3
3
  import '@operato/data-grist';
4
4
  import { css, html, LitElement } from 'lit';
5
- import { property, query } from 'lit/decorators.js';
5
+ import { customElement, property, query } from 'lit/decorators.js';
6
6
  import { DataGrist } from '@operato/data-grist';
7
7
  import { i18next } from '@operato/i18n';
8
8
  import { CommonHeaderStyles } from '@operato/styles';
9
- export class CompanyListPopup extends LitElement {
9
+ let CompanyListPopup = class CompanyListPopup extends LitElement {
10
10
  constructor() {
11
11
  super(...arguments);
12
12
  this.companyList = [];
@@ -167,7 +167,7 @@ export class CompanyListPopup extends LitElement {
167
167
  async select() {
168
168
  this.dispatchEvent(new CustomEvent('selected', { detail: this.grist.selected[0] }));
169
169
  }
170
- }
170
+ };
171
171
  CompanyListPopup.styles = [
172
172
  CommonHeaderStyles,
173
173
  css `
@@ -195,4 +195,8 @@ __decorate([
195
195
  property({ type: Object }),
196
196
  __metadata("design:type", Object)
197
197
  ], CompanyListPopup.prototype, "columns", void 0);
198
+ CompanyListPopup = __decorate([
199
+ customElement('company-list-popup')
200
+ ], CompanyListPopup);
201
+ export { CompanyListPopup };
198
202
  //# sourceMappingURL=company-list-popup.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"company-list-popup.js","sourceRoot":"","sources":["../../../client/pages/tax-invoice-send/company-list-popup.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,qBAAqB,CAAA;AAE5B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAEpD,MAAM,OAAO,gBAAiB,SAAQ,UAAU;IAAhD;;QAmB6B,gBAAW,GAAU,EAAE,CAAA;QACtB,YAAO,GAAG;YACpC,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;YAC9B,OAAO,EAAE;gBACP,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EA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{ property, query } from 'lit/decorators.js'\nimport { DataGrist } from '@operato/data-grist'\nimport { i18next } from '@operato/i18n'\nimport { CommonHeaderStyles } from '@operato/styles'\n\nexport class CompanyListPopup extends LitElement {\n static styles = [\n CommonHeaderStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n background-color: var(--md-sys-color-surface);\n }\n\n ox-grist {\n flex: 1;\n }\n `\n ]\n\n @query('ox-grist') private grist!: DataGrist\n\n @property({ type: Array }) companyList: any[] = []\n @property({ type: Object }) columns = {\n pagination: { infinite: true },\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n { type: 'gutter', gutterName: 'row-selector', multiple: false },\n {\n type: 'string',\n name: 'name',\n header: i18next.t('field.name'),\n record: {\n editable: false\n },\n filter: 'search',\n sortable: true,\n width: 150\n },\n {\n type: 'string',\n name: 'businessRegistrationNumber',\n header: i18next.t('field.business registration number'),\n record: {\n editable: false\n },\n width: 150\n },\n {\n type: 'string',\n name: 'branchIdentification',\n header: i18next.t('field.branch identification'),\n record: {\n editable: false\n },\n width: 150\n },\n {\n type: 'string',\n name: 'businessName',\n header: i18next.t('field.tax invoice business name'),\n record: {\n editable: false\n },\n width: 150\n },\n {\n type: 'string',\n name: 'representativeName',\n header: i18next.t('field.tax invoice representative name'),\n record: {\n editable: false\n },\n width: 150\n },\n {\n type: 'string',\n name: 'address',\n header: i18next.t('field.address'),\n record: {\n editable: false\n },\n width: 200\n },\n {\n type: 'string',\n name: 'businessType',\n header: i18next.t('field.business type'),\n record: {\n editable: false\n },\n width: 100\n },\n {\n type: 'string',\n name: 'industryType',\n header: i18next.t('field.industry type'),\n record: {\n editable: false\n },\n width: 100\n },\n {\n type: 'string',\n name: 'department',\n header: i18next.t('field.department'),\n record: {\n editable: false\n },\n width: 150\n },\n {\n type: 'string',\n name: 'contactName',\n header: i18next.t('field.contact name'),\n record: {\n editable: false\n },\n width: 150\n },\n {\n type: 'string',\n name: 'contactPhone',\n header: i18next.t('field.contact phone'),\n record: {\n editable: false\n },\n width: 150\n },\n {\n type: 'string',\n name: 'contactEmail',\n header: i18next.t('field.contact email'),\n record: {\n editable: false\n },\n width: 150\n },\n {\n type: 'string',\n name: 'contactCellPhone',\n header: i18next.t('field.contact cell phone'),\n record: {\n editable: false\n },\n width: 150\n }\n ],\n rows: {\n selectable: {\n multiple: false\n },\n handlers: {\n click: 'select-row-toggle'\n },\n appendable: false\n }\n }\n\n render() {\n return html`\n <ox-grist\n .mode=${'GRID'}\n .config=${this.columns}\n .data=${{\n records: this.companyList\n }}\n ></ox-grist>\n\n <div class=\"footer\">\n <div filler></div>\n <button @click=${this.select.bind(this)} done>\n <md-icon>select_check_box</md-icon>${i18next.t('button.select')}\n </button>\n </div>\n `\n }\n\n async select() {\n this.dispatchEvent(new CustomEvent('selected', { detail: this.grist.selected[0] }))\n }\n}\n"]}
1
+ {"version":3,"file":"company-list-popup.js","sourceRoot":"","sources":["../../../client/pages/tax-invoice-send/company-list-popup.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,qBAAqB,CAAA;AAE5B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAG7C,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,UAAU;IAAzC;;QAmBsB,gBAAW,GAAU,EAAE,CAAA;QACtB,YAAO,GAAG;YACpC,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;YAC9B,OAAO,EAAE;gBACP,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE;gBAC1C,EAAE,IAAI,E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grist'\n\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { DataGrist } from '@operato/data-grist'\nimport { i18next } from '@operato/i18n'\nimport { CommonHeaderStyles } from '@operato/styles'\n\n@customElement('company-list-popup')\nexport class CompanyListPopup extends LitElement {\n static styles = [\n CommonHeaderStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n background-color: var(--md-sys-color-surface);\n }\n\n ox-grist {\n flex: 1;\n }\n `\n ]\n\n @query('ox-grist') private grist!: DataGrist\n\n @property({ type: Array }) companyList: any[] = []\n @property({ type: Object }) columns = {\n pagination: { infinite: true },\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n { type: 'gutter', gutterName: 'row-selector', multiple: false },\n {\n type: 'string',\n name: 'name',\n header: i18next.t('field.name'),\n record: {\n editable: false\n },\n filter: 'search',\n sortable: true,\n width: 150\n },\n {\n type: 'string',\n name: 'businessRegistrationNumber',\n header: i18next.t('field.business registration number'),\n record: {\n editable: false\n },\n width: 150\n },\n {\n type: 'string',\n name: 'branchIdentification',\n header: i18next.t('field.branch identification'),\n record: {\n editable: false\n },\n width: 150\n },\n {\n type: 'string',\n name: 'businessName',\n header: i18next.t('field.tax invoice business name'),\n record: {\n editable: false\n },\n width: 150\n },\n {\n type: 'string',\n name: 'representativeName',\n header: i18next.t('field.tax invoice representative name'),\n record: {\n editable: false\n },\n width: 150\n },\n {\n type: 'string',\n name: 'address',\n header: i18next.t('field.address'),\n record: {\n editable: false\n },\n width: 200\n },\n {\n type: 'string',\n name: 'businessType',\n header: i18next.t('field.business type'),\n record: {\n editable: false\n },\n width: 100\n },\n {\n type: 'string',\n name: 'industryType',\n header: i18next.t('field.industry type'),\n record: {\n editable: false\n },\n width: 100\n },\n {\n type: 'string',\n name: 'department',\n header: i18next.t('field.department'),\n record: {\n editable: false\n },\n width: 150\n },\n {\n type: 'string',\n name: 'contactName',\n header: i18next.t('field.contact name'),\n record: {\n editable: false\n },\n width: 150\n },\n {\n type: 'string',\n name: 'contactPhone',\n header: i18next.t('field.contact phone'),\n record: {\n editable: false\n },\n width: 150\n },\n {\n type: 'string',\n name: 'contactEmail',\n header: i18next.t('field.contact email'),\n record: {\n editable: false\n },\n width: 150\n },\n {\n type: 'string',\n name: 'contactCellPhone',\n header: i18next.t('field.contact cell phone'),\n record: {\n editable: false\n },\n width: 150\n }\n ],\n rows: {\n selectable: {\n multiple: false\n },\n handlers: {\n click: 'select-row-toggle'\n },\n appendable: false\n }\n }\n\n render() {\n return html`\n <ox-grist\n .mode=${'GRID'}\n .config=${this.columns}\n .data=${{\n records: this.companyList\n }}\n ></ox-grist>\n\n <div class=\"footer\">\n <div filler></div>\n <button @click=${this.select.bind(this)} done>\n <md-icon>select_check_box</md-icon>${i18next.t('button.select')}\n </button>\n </div>\n `\n }\n\n async select() {\n this.dispatchEvent(new CustomEvent('selected', { detail: this.grist.selected[0] }))\n }\n}\n"]}
@@ -69,7 +69,7 @@ let TaxInvoiceSendPage = class TaxInvoiceSendPage extends localize(i18next)(Scop
69
69
  };
70
70
  }
71
71
  render() {
72
- return html ` <tax-invoice-send></tax-invoice-send> `;
72
+ return html ` <tax-invoice-send .editMode=${true}></tax-invoice-send> `;
73
73
  }
74
74
  async _sendTaxInvoice() {
75
75
  // 아이템 시퀀스 재 할당 + 날짜, 품목, 규격, 수량이 없으면 필터
@@ -138,12 +138,7 @@ let TaxInvoiceSendPage = class TaxInvoiceSendPage extends localize(i18next)(Scop
138
138
  }
139
139
  `,
140
140
  variables: {
141
- taxInvoiceSendList: [
142
- {
143
- taxInvoice,
144
- taxInvoiceItems
145
- }
146
- ]
141
+ taxInvoiceSendList: [{ taxInvoice, taxInvoiceItems }]
147
142
  }
148
143
  });
149
144
  if (!response.errors) {
@@ -1 +1 @@
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,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a,CAAC,uBAAuB,CAAC;GAC1B,kBAAkB,CAkL9B","sourcesContent":["import '@operato/data-grist'\n\nimport { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'\nimport { CustomAlert, PageView } from '@operato/shell'\nimport { css, html } from 'lit'\nimport { customElement, 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 { BusinessRegistrationCategory, Category, InvoiceType, Purpose } from '../tax-invoice/tax-invoice-list-page'\nimport { CompanyListPopup } from './company-list-popup'\nimport { Supplier, Buyer, TaxInvoice, TaxInvoiceItem } from './tax-invoice-send'\nimport './tax-invoice-send'\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 }\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 private defaultSupplier = {\n supplierBusinessRegistrationCategory: '01',\n supplierBusinessRegistrationNumber: '',\n supplierBranchIdentification: '',\n supplierBusinessName: '',\n supplierRepresentativeName: ''\n }\n @state() supplier: Supplier = this.defaultSupplier\n\n private defaultBuyer = {\n buyerBusinessRegistrationCategory: BusinessRegistrationCategory.BUSINESS_REGISTRATION_NUMBER,\n buyerBusinessRegistrationNumber: '',\n buyerBusinessName: '',\n buyerRepresentativeName: ''\n }\n @state() buyer: Buyer = this.defaultBuyer\n\n private defaultTaxInvoice = {\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 @state() taxInvoice: TaxInvoice = this.defaultTaxInvoice\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 @state() 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` <tax-invoice-send></tax-invoice-send> `\n }\n\n async _sendTaxInvoice() {\n // 아이템 시퀀스 재 할당 + 날짜, 품목, 규격, 수량이 없으면 필터\n let taxInvoiceItems = this.taxInvoiceItems.map((item, idx) => ({\n ...item,\n sequence: idx + 1,\n quantity: Number(item.quantity),\n unitPrice: Number(item.unitPrice)\n }))\n taxInvoiceItems = taxInvoiceItems.filter(\n item => item.supplyDate && item.itemName && item.quantity && item.unitPrice\n )\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 taxInvoice.buyerBusinessRegistrationNumber = taxInvoice.buyerBusinessRegistrationNumber.replace(/-/gi, '')\n taxInvoice.supplierBusinessRegistrationNumber = taxInvoice.supplierBusinessRegistrationNumber.replace(/-/gi, '')\n\n // 공급받는자 필수 값 체크\n if (\n !this.buyer.buyerBusinessRegistrationNumber ||\n !this.buyer.buyerBusinessName ||\n !this.buyer.buyerRepresentativeName\n ) {\n await CustomAlert({\n type: 'warning',\n title: '공급받는자 필수 값을 모두 입력해 주세요.',\n text: '공급받는자 필수 값을 모두 입력해 주세요.',\n confirmButton: { text: i18next.t('button.confirm') }\n })\n return\n }\n\n // 아이템 개수 체크\n if (taxInvoiceItems.length === 0) {\n await CustomAlert({\n type: 'warning',\n title: '등록 가능한 아이템의 개수는 1개 이상이여야 합니다.',\n text: '등록 가능한 아이템의 개수는 1개 이상이여야 합니다.',\n confirmButton: { text: i18next.t('button.confirm') }\n })\n return\n }\n\n // 세금이 없는 타입인데 세금이 있는지 체크\n if (taxInvoice.invoiceType === InvoiceType.SMALL_BUSINESS_TAX_INVOICE && taxInvoice.taxAmount > 0) {\n await CustomAlert({\n type: 'warning',\n title: '세금이 0원이 아닙니다.',\n text: '세금이 0원이 아닙니다.',\n confirmButton: { text: i18next.t('button.confirm') }\n })\n return\n }\n\n // 현금, 수표, 어음, 외상미수금의 합계 = 총 합계금액 체크\n const paymentAmount: number =\n taxInvoice.paymentAmountCash +\n taxInvoice.paymentAmountCheck +\n taxInvoice.paymentAmountPromissoryNote +\n taxInvoice.paymentAmountAccountsReceivable\n if (paymentAmount > 0 && paymentAmount !== taxInvoice.totalAmount) {\n await CustomAlert({\n type: 'warning',\n title: '현금, 수표, 어음, 외상미수금의 합계는 총 합계금액과 동일해야 합니다.',\n text: '현금, 수표, 어음, 외상미수금의 합계는 총 합계금액과 동일해야 합니다.',\n confirmButton: { text: i18next.t('button.confirm') }\n })\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 this.taxInvoice = this.defaultTaxInvoice\n this.supplier = this.defaultSupplier\n this.buyer = this.defaultBuyer\n this.taxInvoiceItems = [{ ...this.defaultTaxInvoiceItem }]\n }\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,WAAW,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACtD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,4BAA4B,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAA;AACnH,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAEvD,OAAO,oBAAoB,CAAA;AAGpB,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,QAAQ,CAAC,OAAO,CAAC,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IAAjF;;QAiBL,2BAA2B;QACnB,UAAK,GAAW,IAAI,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,EAAE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;YAC9B,IAAI,CAAC,eAAe,GAAG,mBAAM,IAAI,CAAC,qBAAqB,EAAG,CAAA;QAC5D,CAAC;IACH,CAAC;;AA3KM,yBAAM,GAAG;IACd,eAAe;IACf,iBAAiB;IACjB,GAAG,CAAA;;;;KAIF;CACF,AARY,CAQZ;AAkBQ;IAAR,KAAK,EAAE;;oDAA0C;AAQzC;IAAR,KAAK,EAAE;;iDAAiC;AAWhC;IAAR,KAAK,EAAE;;sDAAgD;AAY/C;IAAR,KAAK,EAAE;;2DAAwE;AA1DrE,kBAAkB;IAD9B,aAAa,CAAC,uBAAuB,CAAC;GAC1B,kBAAkB,CA6K9B","sourcesContent":["import '@operato/data-grist'\n\nimport { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'\nimport { CustomAlert, PageView } from '@operato/shell'\nimport { css, html } from 'lit'\nimport { customElement, 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 { BusinessRegistrationCategory, Category, InvoiceType, Purpose } from '../tax-invoice/tax-invoice-list-page'\nimport { CompanyListPopup } from './company-list-popup'\nimport { Supplier, Buyer, TaxInvoice, TaxInvoiceItem } from './tax-invoice-send'\nimport './tax-invoice-send'\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 }\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 private defaultSupplier = {\n supplierBusinessRegistrationCategory: '01',\n supplierBusinessRegistrationNumber: '',\n supplierBranchIdentification: '',\n supplierBusinessName: '',\n supplierRepresentativeName: ''\n }\n @state() supplier: Supplier = this.defaultSupplier\n\n private defaultBuyer = {\n buyerBusinessRegistrationCategory: BusinessRegistrationCategory.BUSINESS_REGISTRATION_NUMBER,\n buyerBusinessRegistrationNumber: '',\n buyerBusinessName: '',\n buyerRepresentativeName: ''\n }\n @state() buyer: Buyer = this.defaultBuyer\n\n private defaultTaxInvoice = {\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 @state() taxInvoice: TaxInvoice = this.defaultTaxInvoice\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 @state() 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` <tax-invoice-send .editMode=${true}></tax-invoice-send> `\n }\n\n async _sendTaxInvoice() {\n // 아이템 시퀀스 재 할당 + 날짜, 품목, 규격, 수량이 없으면 필터\n let taxInvoiceItems = this.taxInvoiceItems.map((item, idx) => ({\n ...item,\n sequence: idx + 1,\n quantity: Number(item.quantity),\n unitPrice: Number(item.unitPrice)\n }))\n taxInvoiceItems = taxInvoiceItems.filter(\n item => item.supplyDate && item.itemName && item.quantity && item.unitPrice\n )\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 taxInvoice.buyerBusinessRegistrationNumber = taxInvoice.buyerBusinessRegistrationNumber.replace(/-/gi, '')\n taxInvoice.supplierBusinessRegistrationNumber = taxInvoice.supplierBusinessRegistrationNumber.replace(/-/gi, '')\n\n // 공급받는자 필수 값 체크\n if (\n !this.buyer.buyerBusinessRegistrationNumber ||\n !this.buyer.buyerBusinessName ||\n !this.buyer.buyerRepresentativeName\n ) {\n await CustomAlert({\n type: 'warning',\n title: '공급받는자 필수 값을 모두 입력해 주세요.',\n text: '공급받는자 필수 값을 모두 입력해 주세요.',\n confirmButton: { text: i18next.t('button.confirm') }\n })\n return\n }\n\n // 아이템 개수 체크\n if (taxInvoiceItems.length === 0) {\n await CustomAlert({\n type: 'warning',\n title: '등록 가능한 아이템의 개수는 1개 이상이여야 합니다.',\n text: '등록 가능한 아이템의 개수는 1개 이상이여야 합니다.',\n confirmButton: { text: i18next.t('button.confirm') }\n })\n return\n }\n\n // 세금이 없는 타입인데 세금이 있는지 체크\n if (taxInvoice.invoiceType === InvoiceType.SMALL_BUSINESS_TAX_INVOICE && taxInvoice.taxAmount > 0) {\n await CustomAlert({\n type: 'warning',\n title: '세금이 0원이 아닙니다.',\n text: '세금이 0원이 아닙니다.',\n confirmButton: { text: i18next.t('button.confirm') }\n })\n return\n }\n\n // 현금, 수표, 어음, 외상미수금의 합계 = 총 합계금액 체크\n const paymentAmount: number =\n taxInvoice.paymentAmountCash +\n taxInvoice.paymentAmountCheck +\n taxInvoice.paymentAmountPromissoryNote +\n taxInvoice.paymentAmountAccountsReceivable\n if (paymentAmount > 0 && paymentAmount !== taxInvoice.totalAmount) {\n await CustomAlert({\n type: 'warning',\n title: '현금, 수표, 어음, 외상미수금의 합계는 총 합계금액과 동일해야 합니다.',\n text: '현금, 수표, 어음, 외상미수금의 합계는 총 합계금액과 동일해야 합니다.',\n confirmButton: { text: i18next.t('button.confirm') }\n })\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: [{ taxInvoice, taxInvoiceItems }]\n }\n })\n\n if (!response.errors) {\n notify({ message: i18next.t('text.success tax send') })\n this.taxInvoice = this.defaultTaxInvoice\n this.supplier = this.defaultSupplier\n this.buyer = this.defaultBuyer\n this.taxInvoiceItems = [{ ...this.defaultTaxInvoiceItem }]\n }\n }\n}\n"]}
@@ -93,6 +93,7 @@ export declare class TaxInvoiceSend extends TaxInvoiceSend_base {
93
93
  private defaultBuyer;
94
94
  private defaultTaxInvoice;
95
95
  private defaultTaxInvoiceItem;
96
+ editMode: boolean;
96
97
  supplier: Supplier;
97
98
  buyer: Buyer;
98
99
  taxInvoice: TaxInvoice;