@things-factory/tax-invoice 8.0.66 → 8.0.69

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 +102 -21
  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 +129 -49
  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
  })}
@@ -468,8 +497,8 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
468
497
 
469
498
  <div class="body">
470
499
  <div class="header">
471
- <span><button @click=${this._openSupplierPopup}>공급처 선택</button></span>
472
- <span><button @click=${this._openBuyerPopup}>공급받는자 선택</button></span>
500
+ <span><button @click=${this._openSupplierPopup} ?disabled=${readOnly}>공급처 선택</button></span>
501
+ <span><button @click=${this._openBuyerPopup} ?disabled=${readOnly}>공급받는자 선택</button></span>
473
502
  </div>
474
503
 
475
504
  <div class="data">
@@ -498,6 +527,7 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
498
527
  name="supplierBusinessName"
499
528
  .value=${this.supplier?.supplierBusinessName || ''}
500
529
  @input=${this._onInputTaxInvoice}
530
+ ?disabled=${readOnly}
501
531
  />
502
532
  </td>
503
533
  <th required>${i18next.t('field.tax invoice representative name')}</th>
@@ -507,6 +537,7 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
507
537
  name="supplierRepresentativeName"
508
538
  .value=${this.supplier?.supplierRepresentativeName || ''}
509
539
  @input=${this._onInputTaxInvoice}
540
+ ?disabled=${readOnly}
510
541
  />
511
542
  </td>
512
543
  </tr>
@@ -522,6 +553,7 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
522
553
  name="supplierBusinessType"
523
554
  .value=${this.supplier?.supplierBusinessType || ''}
524
555
  @input=${this._onInputTaxInvoice}
556
+ ?disabled=${readOnly}
525
557
  />
526
558
  </td>
527
559
  <th>${i18next.t('field.industry type')}</th>
@@ -531,6 +563,7 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
531
563
  name="supplierIndustryType"
532
564
  .value=${this.supplier?.supplierIndustryType || ''}
533
565
  @input=${this._onInputTaxInvoice}
566
+ ?disabled=${readOnly}
534
567
  />
535
568
  </td>
536
569
  </tr>
@@ -542,6 +575,7 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
542
575
  name="supplierContactEmail"
543
576
  .value=${this.supplier?.supplierContactEmail || ''}
544
577
  @input=${this._onInputTaxInvoice}
578
+ ?disabled=${readOnly}
545
579
  />
546
580
  </td>
547
581
  </tr>
@@ -566,6 +600,7 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
566
600
  name="buyerBusinessRegistrationNumber"
567
601
  .value=${this.buyer?.buyerBusinessRegistrationNumber || ''}
568
602
  @input=${this._onInputTaxInvoice}
603
+ ?disabled=${readOnly}
569
604
  />
570
605
  </td>
571
606
  <th>${i18next.t('field.short branch identification')}</th>
@@ -575,6 +610,7 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
575
610
  name="buyerBranchIdentification"
576
611
  .value=${this.buyer?.buyerBranchIdentification || ''}
577
612
  @input=${this._onInputTaxInvoice}
613
+ ?disabled=${readOnly}
578
614
  />
579
615
  </td>
580
616
  </tr>
@@ -586,6 +622,7 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
586
622
  name="buyerBusinessName"
587
623
  .value=${this.buyer?.buyerBusinessName || ''}
588
624
  @input=${this._onInputTaxInvoice}
625
+ ?disabled=${readOnly}
589
626
  />
590
627
  </td>
591
628
  <th required>${i18next.t('field.tax invoice representative name')}</th>
@@ -595,6 +632,7 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
595
632
  name="buyerRepresentativeName"
596
633
  .value=${this.buyer?.buyerRepresentativeName || ''}
597
634
  @input=${this._onInputTaxInvoice}
635
+ ?disabled=${readOnly}
598
636
  />
599
637
  </td>
600
638
  </tr>
@@ -606,6 +644,7 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
606
644
  name="buyerAddress"
607
645
  .value=${this.buyer?.buyerAddress || ''}
608
646
  @input=${this._onInputTaxInvoice}
647
+ ?disabled=${readOnly}
609
648
  />
610
649
  </td>
611
650
  </tr>
@@ -617,6 +656,7 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
617
656
  name="buyerBusinessType"
618
657
  .value=${this.buyer?.buyerBusinessType || ''}
619
658
  @input=${this._onInputTaxInvoice}
659
+ ?disabled=${readOnly}
620
660
  />
621
661
  </td>
622
662
 
@@ -627,6 +667,7 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
627
667
  name="buyerIndustryType"
628
668
  .value=${this.buyer?.buyerIndustryType || ''}
629
669
  @input=${this._onInputTaxInvoice}
670
+ ?disabled=${readOnly}
630
671
  />
631
672
  </td>
632
673
  </tr>
@@ -638,6 +679,7 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
638
679
  name="buyer1stContactEmail"
639
680
  .value=${this.buyer?.buyer1stContactEmail || ''}
640
681
  @input=${this._onInputTaxInvoice}
682
+ ?disabled=${readOnly}
641
683
  />
642
684
  </td>
643
685
  </tr>
@@ -649,6 +691,7 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
649
691
  name="buyer2ndContactEmail"
650
692
  .value=${this.buyer?.buyer2ndContactEmail || ''}
651
693
  @input=${this._onInputTaxInvoice}
694
+ ?disabled=${readOnly}
652
695
  />
653
696
  </td>
654
697
  </tr>
@@ -664,6 +707,7 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
664
707
  name="issueDate"
665
708
  .value=${this.taxInvoice.issueDate}
666
709
  @input=${this._onInputTaxInvoice}
710
+ ?disabled=${readOnly}
667
711
  />
668
712
  <span class="desc">※ 작성일자는 공급 연월일을 의미함</span>
669
713
  </div>
@@ -674,6 +718,7 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
674
718
  name="remark0"
675
719
  .value=${this.taxInvoice?.remark0 || ''}
676
720
  @input=${this._onInputTaxInvoice}
721
+ ?disabled=${readOnly}
677
722
  />
678
723
  </div>
679
724
  </div>
@@ -693,8 +738,8 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
693
738
  세액으로 계산할 수 있습니다.
694
739
  </div>
695
740
  <div class="desc">
696
- <button class="btn-add" @click=${this._onAddInvoiceItem}>품목추가</button> 품목은 최대 16개까지 추가, 삭제
697
- 가능
741
+ <button class="btn-add" @click=${this._onAddInvoiceItem} ?disabled=${readOnly}>품목추가</button> 품목은 최대
742
+ 16개까지 추가, 삭제 가능
698
743
  </div>
699
744
 
700
745
  <table>
@@ -734,7 +779,9 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
734
779
  numeric
735
780
  maxlength="2"
736
781
  name="supplyDate"
782
+ .value=${item.supplyDate?.split('-')?.[2] || ''}
737
783
  @input=${e => this._onInputItem(e, idx)}
784
+ ?disabled=${readOnly}
738
785
  />
739
786
  </td>
740
787
  <td>
@@ -743,6 +790,7 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
743
790
  name="itemName"
744
791
  .value=${item.itemName}
745
792
  @input=${e => this._onInputItem(e, idx)}
793
+ ?disabled=${readOnly}
746
794
  />
747
795
  </td>
748
796
  <td>
@@ -751,6 +799,7 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
751
799
  name="specification"
752
800
  .value=${item.specification}
753
801
  @input=${e => this._onInputItem(e, idx)}
802
+ ?disabled=${readOnly}
754
803
  />
755
804
  </td>
756
805
  <td>
@@ -760,6 +809,7 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
760
809
  name="quantity"
761
810
  .value=${this._numberFormat(item.quantity)}
762
811
  @input=${e => this._onInputItem(e, idx)}
812
+ ?disabled=${readOnly}
763
813
  />
764
814
  </td>
765
815
  <td>
@@ -769,6 +819,7 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
769
819
  name="unitPrice"
770
820
  .value=${this._numberFormat(item.unitPrice)}
771
821
  @input=${e => this._onInputItem(e, idx)}
822
+ ?disabled=${readOnly}
772
823
  />
773
824
  </td>
774
825
  <td>
@@ -778,6 +829,7 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
778
829
  name="supplyPrice"
779
830
  .value=${this._numberFormat(item.supplyPrice)}
780
831
  @input=${e => this._onInputItem(e, idx)}
832
+ ?disabled=${readOnly}
781
833
  />
782
834
  </td>
783
835
  <td>
@@ -787,7 +839,7 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
787
839
  name="taxPrice"
788
840
  .value=${this._numberFormat(item.taxPrice)}
789
841
  @input=${e => this._onInputItem(e, idx)}
790
- .disabled=${this.isTaxFree}
842
+ ?disabled=${this.isTaxFree || readOnly}
791
843
  />
792
844
  </td>
793
845
  <td>
@@ -796,10 +848,17 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
796
848
  name="remark"
797
849
  .value=${item.remark || ''}
798
850
  @input=${e => this._onInputItem(e, idx)}
851
+ ?disabled=${readOnly}
799
852
  />
800
853
  </td>
801
854
  <td>
802
- <button class="btn-delete" @click=${e => this._onRemoveInvoiceItem(e, item.sequence)}>삭제</button>
855
+ <button
856
+ class="btn-delete"
857
+ @click=${e => this._onRemoveInvoiceItem(e, item.sequence)}
858
+ ?disabled=${readOnly}
859
+ >
860
+ 삭제
861
+ </button>
803
862
  </td>
804
863
  </tr>
805
864
  `
@@ -829,6 +888,7 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
829
888
  name="paymentAmountCash"
830
889
  .value=${this.taxInvoice?.paymentAmountCash || ''}
831
890
  @input=${this._onInputTaxInvoice}
891
+ ?disabled=${readOnly}
832
892
  />
833
893
  </td>
834
894
  <td>
@@ -838,6 +898,7 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
838
898
  name="paymentAmountCheck"
839
899
  .value=${this.taxInvoice?.paymentAmountCheck || ''}
840
900
  @input=${this._onInputTaxInvoice}
901
+ ?disabled=${readOnly}
841
902
  />
842
903
  </td>
843
904
  <td>
@@ -847,6 +908,7 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
847
908
  name="paymentAmountPromissoryNote"
848
909
  .value=${this.taxInvoice?.paymentAmountPromissoryNote || ''}
849
910
  @input=${this._onInputTaxInvoice}
911
+ ?disabled=${readOnly}
850
912
  />
851
913
  </td>
852
914
  <td>
@@ -856,6 +918,7 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
856
918
  name="paymentAmountAccountsReceivable"
857
919
  .value=${this.taxInvoice?.paymentAmountAccountsReceivable || ''}
858
920
  @input=${this._onInputTaxInvoice}
921
+ ?disabled=${readOnly}
859
922
  />
860
923
  </td>
861
924
  </tr>
@@ -871,6 +934,7 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
871
934
  .value=${Purpose.INVOICE}
872
935
  @change=${this._onInputTaxInvoice}
873
936
  checked
937
+ ?disabled=${readOnly}
874
938
  />
875
939
  <label for="purpose_20">${PURPOSE[Purpose.INVOICE]}</label>
876
940
  </div>
@@ -881,6 +945,7 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
881
945
  name="purpose"
882
946
  .value=${Purpose.RECEIPT}
883
947
  @change=${this._onInputTaxInvoice}
948
+ ?disabled=${readOnly}
884
949
  />
885
950
  <label for="purpose_10">${PURPOSE[Purpose.RECEIPT]}</label>
886
951
  </div>
@@ -1075,6 +1140,14 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
1075
1140
  supplierContactCellPhone: e.detail.contactCellPhone || ''
1076
1141
  }
1077
1142
 
1143
+ this.dispatchEvent(
1144
+ new CustomEvent('supplier-selected', {
1145
+ detail: { supplier: this.supplier },
1146
+ bubbles: true,
1147
+ composed: true
1148
+ })
1149
+ )
1150
+
1078
1151
  history.back()
1079
1152
  }}
1080
1153
  >
@@ -1134,6 +1207,14 @@ export class TaxInvoiceSend extends localize(i18next)(LitElement) {
1134
1207
  buyer1stContactCellPhone: e.detail.contactCellPhone || ''
1135
1208
  }
1136
1209
 
1210
+ this.dispatchEvent(
1211
+ new CustomEvent('buyer-selected', {
1212
+ detail: { buyer: this.buyer },
1213
+ bubbles: true,
1214
+ composed: true
1215
+ })
1216
+ )
1217
+
1137
1218
  history.back()
1138
1219
  }}
1139
1220
  >
@@ -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","s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,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;;;KAGpE,CAAA;IACH,CAAC;IAED,KAAK,CAAC,MAAM;QACV,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,UAAU,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IACrF,CAAC;;AAhLM,uBAAM,GAAG;IACd,kBAAkB;IAClB,GAAG,CAAA;;;;;;;;;;;KAWF;CACF,AAdY,CAcZ;AAE0B;IAA1B,KAAK,CAAC,UAAU,CAAC;8BAAiB,SAAS;+CAAA;AAEjB;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;;qDAAwB;AACtB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;iDAsI1B","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@operato/data-grist'\n\nimport { css, html, LitElement } from 'lit'\nimport { 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":";AAA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;;KAGpE,CAAA;IACH,CAAC;IAED,KAAK,CAAC,MAAM;QACV,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,UAAU,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IACrF,CAAC;;AAhLM,uBAAM,GAAG;IACd,kBAAkB;IAClB,GAAG,CAAA;;;;;;;;;;;KAWF;CACF,AAdY,CAcZ;AAE0B;IAA1B,KAAK,CAAC,UAAU,CAAC;8BAAiB,SAAS;+CAAA;AAEjB;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;;qDAAwB;AACtB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;iDAsI1B;AA1JU,gBAAgB;IAD5B,aAAa,CAAC,oBAAoB,CAAC;GACvB,gBAAgB,CAkL5B","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@operato/data-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,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,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E,CAAC;YACrB,MAAM,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,uBAAuB,CAAC,EAAE,CAAC,CAAA;YACvD,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,iBAAiB,CAAA;YACxC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,eAAe,CAAA;YACpC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,YAAY,CAAA;YAC9B,IAAI,CAAC,eAAe,GAAG,mBAAM,IAAI,CAAC,qBAAqB,EAAG,CAAA;QAC5D,CAAC;IACH,CAAC;;AAhLM,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,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,OA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,aAAa,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,gBAAgB,CAAC,EAAE;aACrD,CAAC,CAAA;YACF,OAAM;QACR,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;YACnC,QAAQ,EAAE,GAAG,CAAA;;;;OAIZ;YACD,SAAS,EAAE;gBACT,kBAAkB,EAAE,CAAC,EAAE,UAAU,EAAE,eAAe,EAAE,CAAC;aACtD;SACF,CAAC,CAAA;QAEF,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;YACrB,MAAM,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,uBAAuB,CAAC,EAAE,CAAC,CAAA;YACvD,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,iBAAiB,CAAA;YACxC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,eAAe,CAAA;YACpC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,YAAY,CAAA;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;