@things-factory/tax-invoice 9.0.0-beta.8 → 9.0.2

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 (53) hide show
  1. package/dist-client/pages/tax-audit-result/tax-audit-result-importer.d.ts +1 -1
  2. package/dist-client/pages/tax-audit-result/tax-audit-result-importer.js +16 -17
  3. package/dist-client/pages/tax-audit-result/tax-audit-result-importer.js.map +1 -1
  4. package/dist-client/pages/tax-audit-result/tax-audit-result-list-page.d.ts +1 -1
  5. package/dist-client/pages/tax-audit-result/tax-audit-result-list-page.js +34 -26
  6. package/dist-client/pages/tax-audit-result/tax-audit-result-list-page.js.map +1 -1
  7. package/dist-client/pages/tax-invoice/tax-invoice-detail-popup.d.ts +1 -1
  8. package/dist-client/pages/tax-invoice/tax-invoice-detail-popup.js +140 -144
  9. package/dist-client/pages/tax-invoice/tax-invoice-detail-popup.js.map +1 -1
  10. package/dist-client/pages/tax-invoice/tax-invoice-list-page.d.ts +1 -1
  11. package/dist-client/pages/tax-invoice/tax-invoice-list-page.js +59 -55
  12. package/dist-client/pages/tax-invoice/tax-invoice-list-page.js.map +1 -1
  13. package/dist-client/pages/tax-invoice-api/tax-invoice-api-page.d.ts +1 -1
  14. package/dist-client/pages/tax-invoice-api/tax-invoice-api-page.js +35 -28
  15. package/dist-client/pages/tax-invoice-api/tax-invoice-api-page.js.map +1 -1
  16. package/dist-client/pages/tax-invoice-company/tax-invoice-company-list-page.d.ts +1 -1
  17. package/dist-client/pages/tax-invoice-company/tax-invoice-company-list-page.js +36 -30
  18. package/dist-client/pages/tax-invoice-company/tax-invoice-company-list-page.js.map +1 -1
  19. package/dist-client/pages/tax-invoice-send/company-list-popup.d.ts +1 -1
  20. package/dist-client/pages/tax-invoice-send/company-list-popup.js +15 -15
  21. package/dist-client/pages/tax-invoice-send/company-list-popup.js.map +1 -1
  22. package/dist-client/pages/tax-invoice-send/tax-invoice-send-page.d.ts +1 -1
  23. package/dist-client/pages/tax-invoice-send/tax-invoice-send-page.js +23 -14
  24. package/dist-client/pages/tax-invoice-send/tax-invoice-send-page.js.map +1 -1
  25. package/dist-client/pages/tax-invoice-send/tax-invoice-send.d.ts +1 -1
  26. package/dist-client/pages/tax-invoice-send/tax-invoice-send.js +509 -510
  27. package/dist-client/pages/tax-invoice-send/tax-invoice-send.js.map +1 -1
  28. package/dist-client/tsconfig.tsbuildinfo +1 -1
  29. package/dist-server/service/tax-audit-result/tax-audit-result-mutation.js +25 -7
  30. package/dist-server/service/tax-audit-result/tax-audit-result-mutation.js.map +1 -1
  31. package/dist-server/service/tax-audit-result/tax-audit-result-query.js +1 -1
  32. package/dist-server/service/tax-audit-result/tax-audit-result-query.js.map +1 -1
  33. package/dist-server/service/tax-invoice/tax-invoice-mutation.js +14 -5
  34. package/dist-server/service/tax-invoice/tax-invoice-mutation.js.map +1 -1
  35. package/dist-server/service/tax-invoice/tax-invoice-query.js +2 -3
  36. package/dist-server/service/tax-invoice/tax-invoice-query.js.map +1 -1
  37. package/dist-server/service/tax-invoice-api/tax-invoice-api-mutation.js +23 -10
  38. package/dist-server/service/tax-invoice-api/tax-invoice-api-mutation.js.map +1 -1
  39. package/dist-server/service/tax-invoice-company/tax-invoice-company-mutation.js +14 -5
  40. package/dist-server/service/tax-invoice-company/tax-invoice-company-mutation.js.map +1 -1
  41. package/dist-server/service/tax-invoice-company/tax-invoice-company-query.js +1 -1
  42. package/dist-server/service/tax-invoice-company/tax-invoice-company-query.js.map +1 -1
  43. package/dist-server/service/tax-invoice-item/tax-invoice-item-mutation.js +25 -7
  44. package/dist-server/service/tax-invoice-item/tax-invoice-item-mutation.js.map +1 -1
  45. package/dist-server/service/tax-invoice-item/tax-invoice-item-query.js +1 -1
  46. package/dist-server/service/tax-invoice-item/tax-invoice-item-query.js.map +1 -1
  47. package/dist-server/service/unipost-api/tax-invoice-inquiry.d.ts +2 -1
  48. package/dist-server/service/unipost-api/tax-invoice-inquiry.js +5 -3
  49. package/dist-server/service/unipost-api/tax-invoice-inquiry.js.map +1 -1
  50. package/dist-server/service/unipost-api/tax-invoice-send.js +4 -2
  51. package/dist-server/service/unipost-api/tax-invoice-send.js.map +1 -1
  52. package/dist-server/tsconfig.tsbuildinfo +1 -1
  53. package/package.json +8 -8
@@ -68,13 +68,276 @@ let TaxInvoiceSend = class TaxInvoiceSend extends localize(i18next)(LitElement)
68
68
  this.supplier = this.defaultSupplier;
69
69
  this.buyer = this.defaultBuyer;
70
70
  this.taxInvoice = this.defaultTaxInvoice;
71
- this.taxInvoiceItems = [Object.assign({}, this.defaultTaxInvoiceItem)];
71
+ this.taxInvoiceItems = [{ ...this.defaultTaxInvoiceItem }];
72
72
  }
73
+ static { this.styles = [
74
+ ScrollbarStyles,
75
+ CommonGristStyles,
76
+ css `
77
+ :host {
78
+ display: flex;
79
+ flex-direction: column;
80
+ overflow-y: auto;
81
+ overflow-x: hidden;
82
+
83
+ width: 100%;
84
+ min-width: 850px;
85
+ padding: 0 40px 40px 40px;
86
+
87
+ --grid-record-emphasized-background-color: red;
88
+ --grid-record-emphasized-color: yellow;
89
+ }
90
+
91
+ .flex-row {
92
+ display: flex;
93
+ flex-direction: row;
94
+ }
95
+ .flex-column {
96
+ display: flex;
97
+ flex-direction: column;
98
+ }
99
+
100
+ input[type='text'],
101
+ input[type='date'],
102
+ input[type='number'] {
103
+ width: 85%;
104
+ max-width: calc(100% - 12px);
105
+ height: 14px;
106
+ margin: 0;
107
+ padding: 4px 5px 5px;
108
+ line-height: 14px;
109
+ border: 1px solid #bbb;
110
+ background: #fff;
111
+ letter-spacing: 0.5px;
112
+ }
113
+ input[type='date'] {
114
+ width: auto;
115
+ }
116
+ input[readonly],
117
+ input:disabled {
118
+ background-color: #eee;
119
+ }
120
+
121
+ div.invoice-type {
122
+ font-size: 18px;
123
+ margin-top: 15px;
124
+ }
125
+
126
+ table {
127
+ border: solid;
128
+ border-width: 2px 0;
129
+ border-collapse: collapse;
130
+ border-spacing: 0;
131
+ }
132
+
133
+ .title table {
134
+ border-color: #d3dbe5;
135
+ width: 100%;
136
+ height: 33px;
137
+ margin-top: 10px;
138
+ font-size: 12px;
139
+
140
+ th {
141
+ font-size: 13px;
142
+ background-color: #e9edf6;
143
+ min-width: 140px;
144
+ }
145
+ td {
146
+ width: 50%;
147
+ padding-left: 10px;
148
+
149
+ & > * {
150
+ vertical-align: middle;
151
+ }
152
+ & > input {
153
+ margin: 0 5px 0 1px;
154
+ }
155
+ }
156
+ }
157
+
158
+ div.body {
159
+ margin-top: 15px;
160
+ font-size: 14px;
161
+
162
+ div.data {
163
+ display: flex;
164
+ margin-top: 5px;
165
+
166
+ table {
167
+ flex: 1;
168
+
169
+ td,
170
+ th {
171
+ padding: 5px;
172
+ min-width: 60px;
173
+ }
174
+ td {
175
+ padding-left: 8px;
176
+ }
177
+ th.target {
178
+ width: 25px;
179
+ writing-mode: vertical-rl;
180
+ min-width: unset;
181
+ }
182
+
183
+ &.supplier {
184
+ border-color: #f64843;
185
+
186
+ td,
187
+ th {
188
+ background-color: #fef5f7;
189
+ border: solid 1.5px #f5b1b1;
190
+ }
191
+ th.target {
192
+ background-color: #fedbde;
193
+ }
194
+ }
195
+ &.buyer {
196
+ border-color: #007ed9;
197
+
198
+ td,
199
+ th {
200
+ background-color: #f7f7ff;
201
+ border: solid 1.5px #a7bcff;
202
+ }
203
+ th.target {
204
+ background-color: #c6daf6;
205
+ }
206
+ }
207
+ }
208
+ }
209
+
210
+ div.header {
211
+ display: flex;
212
+
213
+ span {
214
+ flex: 1;
215
+ }
216
+ }
217
+
218
+ div.info {
219
+ margin-top: 15px;
220
+ border: solid;
221
+ border-color: #000;
222
+ border-width: 2px 0px 0px 0px;
223
+
224
+ div.flex-row div {
225
+ border: solid #c4d2ff;
226
+ border-width: 0px 1.5px 1.5px 1.5px;
227
+ margin-right: -1px;
228
+ padding: 5px;
229
+ text-align: center;
230
+
231
+ &.title {
232
+ background-color: #e9edf5;
233
+ font-weight: bold;
234
+ flex: 1;
235
+ }
236
+ &.value {
237
+ flex: 3;
238
+ text-align: left;
239
+
240
+ .desc {
241
+ font-size: 11px;
242
+ color: #c90000;
243
+ }
244
+ }
245
+ }
246
+ }
247
+
248
+ div.items,
249
+ div.summary {
250
+ margin-top: 20px;
251
+
252
+ table {
253
+ width: 100%;
254
+ border-color: #000;
255
+ border-width: 2px 0px 0px 0px;
256
+
257
+ th {
258
+ background-color: #e9edf5;
259
+ }
260
+ th,
261
+ td {
262
+ border: solid 1.5px #c4d2ff;
263
+ padding: 5px;
264
+ text-align: center;
265
+ }
266
+ }
267
+ }
268
+
269
+ div.summary {
270
+ display: flex;
271
+
272
+ & > table {
273
+ flex: 6.7;
274
+ }
275
+ & > div {
276
+ flex: 3.2;
277
+ display: flex;
278
+ justify-content: center;
279
+ align-items: center;
280
+ border: 1.5px solid #c4d2ff;
281
+ border-top: 2px solid #000;
282
+ }
283
+
284
+ span.type-wrapper {
285
+ margin: 0 10px;
286
+
287
+ & > div {
288
+ display: flex;
289
+ justify-content: center;
290
+ align-items: center;
291
+ gap: 4px;
292
+
293
+ input[type='radio' i] {
294
+ margin: 0px;
295
+ }
296
+ }
297
+ }
298
+ }
299
+
300
+ div.items {
301
+ div.desc {
302
+ font-weight: 400;
303
+ font-size: 12px;
304
+ margin-bottom: 5px;
305
+ }
306
+ div.desc-date {
307
+ color: #005d98;
308
+ }
309
+ button {
310
+ font-size: 13px;
311
+ height: 25px;
312
+ cursor: pointer;
313
+ text-align: center;
314
+ font-weight: 600;
315
+ border-radius: 2px;
316
+ border-color: #ccc;
317
+ }
318
+ .btn-add {
319
+ color: #333;
320
+ background-color: #f9f9f9;
321
+ }
322
+ .btn-delete {
323
+ color: #fff;
324
+ background-color: #5c636e;
325
+ border: none;
326
+ }
327
+ }
328
+
329
+ *[required]::before {
330
+ content: '*';
331
+ color: red;
332
+ margin-right: 2px;
333
+ }
334
+ }
335
+ `
336
+ ]; }
73
337
  render() {
74
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2;
75
338
  return html `
76
339
  <div class="invoice-type">
77
- * ${INVOICE_TYPE[(_a = this.taxInvoice) === null || _a === void 0 ? void 0 : _a.invoiceType]}
340
+ * ${INVOICE_TYPE[this.taxInvoice?.invoiceType]}
78
341
  (${SHORT_BUSINESS_REGISTRATION_CATEGORY[this.buyer.buyerBusinessRegistrationCategory]})
79
342
  </div>
80
343
 
@@ -141,10 +404,10 @@ let TaxInvoiceSend = class TaxInvoiceSend extends localize(i18next)(LitElement)
141
404
  <th rowspan="6" class="target">${i18next.t('field.tax invoice supplier')}</th>
142
405
  <th required>${i18next.t('field.short business registration number')}</th>
143
406
  <td>
144
- ${(_c = (_b = this.supplier) === null || _b === void 0 ? void 0 : _b.supplierBusinessRegistrationNumber) === null || _c === void 0 ? void 0 : _c.replace(/(\S{3})(\S{2})(\S{5})/g, '$1-$2-$3')}
407
+ ${this.supplier?.supplierBusinessRegistrationNumber?.replace(/(\S{3})(\S{2})(\S{5})/g, '$1-$2-$3')}
145
408
  </td>
146
409
  <th>${i18next.t('field.short branch identification')}</th>
147
- <td>${(_d = this.supplier) === null || _d === void 0 ? void 0 : _d.supplierBranchIdentification}</td>
410
+ <td>${this.supplier?.supplierBranchIdentification}</td>
148
411
  </tr>
149
412
  <tr>
150
413
  <th required>${i18next.t('field.short tax invoice business name')}</th>
@@ -152,7 +415,7 @@ let TaxInvoiceSend = class TaxInvoiceSend extends localize(i18next)(LitElement)
152
415
  <input
153
416
  type="text"
154
417
  name="supplierBusinessName"
155
- .value=${((_e = this.supplier) === null || _e === void 0 ? void 0 : _e.supplierBusinessName) || ''}
418
+ .value=${this.supplier?.supplierBusinessName || ''}
156
419
  @input=${this._onInputTaxInvoice}
157
420
  />
158
421
  </td>
@@ -161,14 +424,14 @@ let TaxInvoiceSend = class TaxInvoiceSend extends localize(i18next)(LitElement)
161
424
  <input
162
425
  type="text"
163
426
  name="supplierRepresentativeName"
164
- .value=${((_f = this.supplier) === null || _f === void 0 ? void 0 : _f.supplierRepresentativeName) || ''}
427
+ .value=${this.supplier?.supplierRepresentativeName || ''}
165
428
  @input=${this._onInputTaxInvoice}
166
429
  />
167
430
  </td>
168
431
  </tr>
169
432
  <tr>
170
433
  <th>${i18next.t('field.address')}</th>
171
- <td colspan="3">${(_g = this.supplier) === null || _g === void 0 ? void 0 : _g.supplierAddress}</td>
434
+ <td colspan="3">${this.supplier?.supplierAddress}</td>
172
435
  </tr>
173
436
  <tr>
174
437
  <th>${i18next.t('field.business type')}</th>
@@ -176,7 +439,7 @@ let TaxInvoiceSend = class TaxInvoiceSend extends localize(i18next)(LitElement)
176
439
  <input
177
440
  type="text"
178
441
  name="supplierBusinessType"
179
- .value=${((_h = this.supplier) === null || _h === void 0 ? void 0 : _h.supplierBusinessType) || ''}
442
+ .value=${this.supplier?.supplierBusinessType || ''}
180
443
  @input=${this._onInputTaxInvoice}
181
444
  />
182
445
  </td>
@@ -185,7 +448,7 @@ let TaxInvoiceSend = class TaxInvoiceSend extends localize(i18next)(LitElement)
185
448
  <input
186
449
  type="text"
187
450
  name="supplierIndustryType"
188
- .value=${((_j = this.supplier) === null || _j === void 0 ? void 0 : _j.supplierIndustryType) || ''}
451
+ .value=${this.supplier?.supplierIndustryType || ''}
189
452
  @input=${this._onInputTaxInvoice}
190
453
  />
191
454
  </td>
@@ -196,7 +459,7 @@ let TaxInvoiceSend = class TaxInvoiceSend extends localize(i18next)(LitElement)
196
459
  <input
197
460
  type="text"
198
461
  name="supplierContactEmail"
199
- .value=${((_k = this.supplier) === null || _k === void 0 ? void 0 : _k.supplierContactEmail) || ''}
462
+ .value=${this.supplier?.supplierContactEmail || ''}
200
463
  @input=${this._onInputTaxInvoice}
201
464
  />
202
465
  </td>
@@ -220,7 +483,7 @@ let TaxInvoiceSend = class TaxInvoiceSend extends localize(i18next)(LitElement)
220
483
  type="text"
221
484
  maxlength="10"
222
485
  name="buyerBusinessRegistrationNumber"
223
- .value=${((_l = this.buyer) === null || _l === void 0 ? void 0 : _l.buyerBusinessRegistrationNumber) || ''}
486
+ .value=${this.buyer?.buyerBusinessRegistrationNumber || ''}
224
487
  @input=${this._onInputTaxInvoice}
225
488
  />
226
489
  </td>
@@ -229,7 +492,7 @@ let TaxInvoiceSend = class TaxInvoiceSend extends localize(i18next)(LitElement)
229
492
  <input
230
493
  type="text"
231
494
  name="buyerBranchIdentification"
232
- .value=${((_m = this.buyer) === null || _m === void 0 ? void 0 : _m.buyerBranchIdentification) || ''}
495
+ .value=${this.buyer?.buyerBranchIdentification || ''}
233
496
  @input=${this._onInputTaxInvoice}
234
497
  />
235
498
  </td>
@@ -240,7 +503,7 @@ let TaxInvoiceSend = class TaxInvoiceSend extends localize(i18next)(LitElement)
240
503
  <input
241
504
  type="text"
242
505
  name="buyerBusinessName"
243
- .value=${((_o = this.buyer) === null || _o === void 0 ? void 0 : _o.buyerBusinessName) || ''}
506
+ .value=${this.buyer?.buyerBusinessName || ''}
244
507
  @input=${this._onInputTaxInvoice}
245
508
  />
246
509
  </td>
@@ -249,7 +512,7 @@ let TaxInvoiceSend = class TaxInvoiceSend extends localize(i18next)(LitElement)
249
512
  <input
250
513
  type="text"
251
514
  name="buyerRepresentativeName"
252
- .value=${((_p = this.buyer) === null || _p === void 0 ? void 0 : _p.buyerRepresentativeName) || ''}
515
+ .value=${this.buyer?.buyerRepresentativeName || ''}
253
516
  @input=${this._onInputTaxInvoice}
254
517
  />
255
518
  </td>
@@ -260,7 +523,7 @@ let TaxInvoiceSend = class TaxInvoiceSend extends localize(i18next)(LitElement)
260
523
  <input
261
524
  type="text"
262
525
  name="buyerAddress"
263
- .value=${((_q = this.buyer) === null || _q === void 0 ? void 0 : _q.buyerAddress) || ''}
526
+ .value=${this.buyer?.buyerAddress || ''}
264
527
  @input=${this._onInputTaxInvoice}
265
528
  />
266
529
  </td>
@@ -271,7 +534,7 @@ let TaxInvoiceSend = class TaxInvoiceSend extends localize(i18next)(LitElement)
271
534
  <input
272
535
  type="text"
273
536
  name="buyerBusinessType"
274
- .value=${((_r = this.buyer) === null || _r === void 0 ? void 0 : _r.buyerBusinessType) || ''}
537
+ .value=${this.buyer?.buyerBusinessType || ''}
275
538
  @input=${this._onInputTaxInvoice}
276
539
  />
277
540
  </td>
@@ -281,7 +544,7 @@ let TaxInvoiceSend = class TaxInvoiceSend extends localize(i18next)(LitElement)
281
544
  <input
282
545
  type="text"
283
546
  name="buyerIndustryType"
284
- .value=${((_s = this.buyer) === null || _s === void 0 ? void 0 : _s.buyerIndustryType) || ''}
547
+ .value=${this.buyer?.buyerIndustryType || ''}
285
548
  @input=${this._onInputTaxInvoice}
286
549
  />
287
550
  </td>
@@ -292,7 +555,7 @@ let TaxInvoiceSend = class TaxInvoiceSend extends localize(i18next)(LitElement)
292
555
  <input
293
556
  type="text"
294
557
  name="buyer1stContactEmail"
295
- .value=${((_t = this.buyer) === null || _t === void 0 ? void 0 : _t.buyer1stContactEmail) || ''}
558
+ .value=${this.buyer?.buyer1stContactEmail || ''}
296
559
  @input=${this._onInputTaxInvoice}
297
560
  />
298
561
  </td>
@@ -303,7 +566,7 @@ let TaxInvoiceSend = class TaxInvoiceSend extends localize(i18next)(LitElement)
303
566
  <input
304
567
  type="text"
305
568
  name="buyer2ndContactEmail"
306
- .value=${((_u = this.buyer) === null || _u === void 0 ? void 0 : _u.buyer2ndContactEmail) || ''}
569
+ .value=${this.buyer?.buyer2ndContactEmail || ''}
307
570
  @input=${this._onInputTaxInvoice}
308
571
  />
309
572
  </td>
@@ -328,18 +591,18 @@ let TaxInvoiceSend = class TaxInvoiceSend extends localize(i18next)(LitElement)
328
591
  <input
329
592
  type="text"
330
593
  name="remark0"
331
- .value=${((_v = this.taxInvoice) === null || _v === void 0 ? void 0 : _v.remark0) || ''}
594
+ .value=${this.taxInvoice?.remark0 || ''}
332
595
  @input=${this._onInputTaxInvoice}
333
596
  />
334
597
  </div>
335
598
  </div>
336
599
  <div class="flex-row">
337
600
  <div class="title">${i18next.t('field.total amount')}</div>
338
- <div class="value">${this._numberFormat((_w = this.taxInvoice) === null || _w === void 0 ? void 0 : _w.totalAmount)}</div>
601
+ <div class="value">${this._numberFormat(this.taxInvoice?.totalAmount)}</div>
339
602
  <div class="title">${i18next.t('field.supply amount')}</div>
340
- <div class="value">${this._numberFormat((_x = this.taxInvoice) === null || _x === void 0 ? void 0 : _x.supplyAmount)}</div>
603
+ <div class="value">${this._numberFormat(this.taxInvoice?.supplyAmount)}</div>
341
604
  <div class="title">${i18next.t('field.tax amount')}</div>
342
- <div class="value">${this._numberFormat((_y = this.taxInvoice) === null || _y === void 0 ? void 0 : _y.taxAmount)}</div>
605
+ <div class="value">${this._numberFormat(this.taxInvoice?.taxAmount)}</div>
343
606
  </div>
344
607
  </div>
345
608
 
@@ -481,7 +744,7 @@ let TaxInvoiceSend = class TaxInvoiceSend extends localize(i18next)(LitElement)
481
744
  type="text"
482
745
  numeric
483
746
  name="paymentAmountCash"
484
- .value=${((_z = this.taxInvoice) === null || _z === void 0 ? void 0 : _z.paymentAmountCash) || ''}
747
+ .value=${this.taxInvoice?.paymentAmountCash || ''}
485
748
  @input=${this._onInputTaxInvoice}
486
749
  />
487
750
  </td>
@@ -490,7 +753,7 @@ let TaxInvoiceSend = class TaxInvoiceSend extends localize(i18next)(LitElement)
490
753
  type="text"
491
754
  numeric
492
755
  name="paymentAmountCheck"
493
- .value=${((_0 = this.taxInvoice) === null || _0 === void 0 ? void 0 : _0.paymentAmountCheck) || ''}
756
+ .value=${this.taxInvoice?.paymentAmountCheck || ''}
494
757
  @input=${this._onInputTaxInvoice}
495
758
  />
496
759
  </td>
@@ -499,7 +762,7 @@ let TaxInvoiceSend = class TaxInvoiceSend extends localize(i18next)(LitElement)
499
762
  type="text"
500
763
  numeric
501
764
  name="paymentAmountPromissoryNote"
502
- .value=${((_1 = this.taxInvoice) === null || _1 === void 0 ? void 0 : _1.paymentAmountPromissoryNote) || ''}
765
+ .value=${this.taxInvoice?.paymentAmountPromissoryNote || ''}
503
766
  @input=${this._onInputTaxInvoice}
504
767
  />
505
768
  </td>
@@ -508,7 +771,7 @@ let TaxInvoiceSend = class TaxInvoiceSend extends localize(i18next)(LitElement)
508
771
  type="text"
509
772
  numeric
510
773
  name="paymentAmountAccountsReceivable"
511
- .value=${((_2 = this.taxInvoice) === null || _2 === void 0 ? void 0 : _2.paymentAmountAccountsReceivable) || ''}
774
+ .value=${this.taxInvoice?.paymentAmountAccountsReceivable || ''}
512
775
  @input=${this._onInputTaxInvoice}
513
776
  />
514
777
  </td>
@@ -550,182 +813,9 @@ let TaxInvoiceSend = class TaxInvoiceSend extends localize(i18next)(LitElement)
550
813
  }
551
814
  async _fetchSupplier() {
552
815
  const response = await client.query({
553
- query: gql `
554
- query taxInvoiceDefaultCompany {
555
- response: taxInvoiceDefaultCompany {
556
- businessRegistrationNumber
557
- branchIdentification
558
- businessName
559
- representativeName
560
- address
561
- businessType
562
- industryType
563
- department
564
- contactName
565
- contactPhone
566
- contactEmail
567
- contactCellPhone
568
- }
569
- }
570
- `
571
- });
572
- const supplier = response.data.response;
573
- this.supplier = {
574
- supplierBusinessRegistrationCategory: supplier.businessRegistrationCategory,
575
- supplierBusinessRegistrationNumber: supplier.businessRegistrationNumber,
576
- supplierBranchIdentification: supplier.branchIdentification,
577
- supplierBusinessName: supplier.businessName,
578
- supplierRepresentativeName: supplier.representativeName,
579
- supplierAddress: supplier.address,
580
- supplierBusinessType: supplier.businessType,
581
- supplierIndustryType: supplier.industryType,
582
- supplierDepartment: supplier.department,
583
- supplierContactName: supplier.contactName,
584
- supplierContactPhone: supplier.contactPhone,
585
- supplierContactEmail: supplier.contactEmail,
586
- supplierContactCellPhone: supplier.contactCellPhone
587
- };
588
- }
589
- _numberFormat(value) {
590
- return !value ? '' : new Intl.NumberFormat('en-US').format(value) || '';
591
- }
592
- // Input 요소의 값이 변경될 때 호출되는 콜백 함수
593
- async _onInputTaxInvoice(event) {
594
- const target = event.target;
595
- // 숫자 타입은 다른 문자 입력 제거
596
- if (target.hasAttribute('numeric')) {
597
- target.value = target.value.replace(/\D/g, '');
598
- }
599
- if (target.name.startsWith('supplier')) {
600
- this.supplier[target.name] = target.value;
601
- }
602
- else if (target.name.startsWith('buyer')) {
603
- this.buyer[target.name] = target.value;
604
- }
605
- else {
606
- // 날짜 체크가 오늘 날짜를 넘어가면 값 변경 되면 안됨
607
- if (target.name === 'issueDate' && target.value > this.today) {
608
- target.value = this.taxInvoice['issueDate'];
609
- await CustomAlert({
610
- type: 'warning',
611
- title: '작성일자는 현재일까지 입력하시기 바랍니다.',
612
- text: '작성일자는 현재일까지 입력하시기 바랍니다.',
613
- confirmButton: { text: i18next.t('button.confirm') }
614
- });
615
- return;
616
- }
617
- // 세금이 없는 영세율이 선택 시 모든 아이템의 세금 0원으로 초기화
618
- if (target.name === 'invoiceType' && target.value === InvoiceType.SMALL_BUSINESS_TAX_INVOICE) {
619
- this.isTaxFree = true;
620
- this.taxInvoice = Object.assign(Object.assign({}, this.taxInvoice), { taxAmount: 0 });
621
- this.taxInvoiceItems = this.taxInvoiceItems.map(item => (Object.assign(Object.assign({}, item), { taxPrice: 0 })));
622
- }
623
- // 변경시에는 아이템 변경도 리 렌더가 필요해서 데이터 갱신
624
- this.taxInvoice[target.name] = target.value;
625
- this.taxInvoice = Object.assign({}, this.taxInvoice);
626
- }
627
- }
628
- // Input 요소의 값이 변경될 때 호출되는 콜백 함수
629
- async _onInputItem(e, idx) {
630
- const target = e.target;
631
- let inputVal = target.value;
632
- // 숫자 타입은 다른 문자 입력 제거
633
- if (target.hasAttribute('numeric')) {
634
- inputVal = Number(inputVal.replace(/\D/g, ''));
635
- target.value = inputVal;
636
- }
637
- // 공급일자 케이스 시 => 세금계산서의 작성일자의 YYYY-MM + 아이템의 입력된 DD
638
- if (target.name === 'supplyDate') {
639
- const itemDate = this.taxInvoice.issueDate.substring(0, 8) + inputVal.toString().padStart(2, '0');
640
- if (itemDate > this.taxInvoice.issueDate) {
641
- await CustomAlert({
642
- type: 'warning',
643
- title: '품목의 일자는 작성일자보다 클 수 없습니다.',
644
- text: '품목의 일자는 작성일자보다 클 수 없습니다.',
645
- confirmButton: { text: i18next.t('button.confirm') }
646
- });
647
- target.value = '';
648
- }
649
- inputVal = itemDate;
650
- }
651
- // 수량, 단가 수정시 공급가액/세액 자동 계산
652
- if (target.name == 'quantity' || target.name == 'unitPrice') {
653
- const supplyPrice = target.name == 'quantity'
654
- ? Number(inputVal) * this.taxInvoiceItems[idx]['unitPrice']
655
- : Number(inputVal) * this.taxInvoiceItems[idx]['quantity'];
656
- this.taxInvoiceItems[idx]['supplyPrice'] = supplyPrice;
657
- this.taxInvoiceItems[idx]['taxPrice'] = this.isTaxFree ? 0 : Math.floor(supplyPrice / 10);
658
- }
659
- // 인풋에 값 넣기
660
- this.taxInvoiceItems[idx][target.name] = inputVal;
661
- // 아이템 금액에 관련된 필드 수정시 합계 계산
662
- if (['quantity', 'unitPrice', 'supplyPrice', 'taxPrice'].includes(target.name)) {
663
- this.taxInvoiceItems = [...this.taxInvoiceItems];
664
- this._setTaxInvoiceSummaryCalc();
665
- }
666
- }
667
- async _openSupplierPopup() {
668
- const response = await client.query({
669
- query: gql `
670
- query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
671
- responses: taxInvoiceApis(filters: $filters, pagination: $pagination, sortings: $sortings) {
672
- items {
673
- id
674
- name: provider
675
- businessRegistrationNumber
676
- branchIdentification
677
- businessName
678
- representativeName
679
- address
680
- businessType
681
- industryType
682
- department
683
- contactName
684
- contactPhone
685
- contactEmail
686
- contactCellPhone
687
- }
688
- }
689
- }
690
- `
691
- });
692
- const items = response.data.responses.items || [];
693
- openPopup(html `
694
- <company-list-popup
695
- .companyList=${items}
696
- @selected=${e => {
697
- this.supplier = {
698
- supplierBusinessRegistrationCategory: BusinessRegistrationCategory.BUSINESS_REGISTRATION_NUMBER,
699
- supplierBusinessRegistrationNumber: e.detail.businessRegistrationNumber || '',
700
- supplierBranchIdentification: e.detail.branchIdentification || '',
701
- supplierBusinessName: e.detail.businessName || '',
702
- supplierRepresentativeName: e.detail.representativeName || '',
703
- supplierAddress: e.detail.address || '',
704
- supplierBusinessType: e.detail.businessType || '',
705
- supplierIndustryType: e.detail.industryType || '',
706
- supplierDepartment: e.detail.department || '',
707
- supplierContactName: e.detail.contactName || '',
708
- supplierContactPhone: e.detail.contactPhone || '',
709
- supplierContactEmail: e.detail.contactEmail || '',
710
- supplierContactCellPhone: e.detail.contactCellPhone || ''
711
- };
712
- history.back();
713
- }}
714
- >
715
- </company-list-popup>
716
- `, {
717
- backdrop: true,
718
- size: 'large',
719
- title: i18next.t('title.company list popup')
720
- });
721
- }
722
- async _openBuyerPopup() {
723
- const response = await client.query({
724
- query: gql `
725
- query TaxInvoiceBuyerList {
726
- responses: taxInvoiceBuyerList {
727
- id
728
- name
816
+ query: gql `
817
+ query taxInvoiceDefaultCompany {
818
+ response: taxInvoiceDefaultCompany {
729
819
  businessRegistrationNumber
730
820
  branchIdentification
731
821
  businessName
@@ -742,327 +832,236 @@ let TaxInvoiceSend = class TaxInvoiceSend extends localize(i18next)(LitElement)
742
832
  }
743
833
  `
744
834
  });
745
- const items = response.data.responses || [];
746
- openPopup(html `
747
- <company-list-popup
748
- .companyList=${items}
749
- @selected=${e => {
750
- this.buyer = {
751
- buyerBusinessRegistrationCategory: BusinessRegistrationCategory.BUSINESS_REGISTRATION_NUMBER,
752
- buyerBusinessRegistrationNumber: e.detail.businessRegistrationNumber || '',
753
- buyerBranchIdentification: e.detail.branchIdentification || '',
754
- buyerBusinessName: e.detail.businessName || '',
755
- buyerRepresentativeName: e.detail.representativeName || '',
756
- buyerAddress: e.detail.address || '',
757
- buyerBusinessType: e.detail.businessType || '',
758
- buyerIndustryType: e.detail.industryType || '',
759
- buyer1stDepartment: e.detail.department || '',
760
- buyer1stContactName: e.detail.contactName || '',
761
- buyer1stContactPhone: e.detail.contactPhone || '',
762
- buyer1stContactEmail: e.detail.contactEmail || '',
763
- buyer1stContactCellPhone: e.detail.contactCellPhone || ''
764
- };
765
- history.back();
766
- }}
767
- >
768
- </company-list-popup>
769
- `, {
770
- backdrop: true,
771
- size: 'large',
772
- title: i18next.t('title.company list popup')
773
- });
774
- }
775
- async _onAddInvoiceItem(e) {
776
- e.preventDefault();
777
- if (this.taxInvoiceItems.length >= 16) {
778
- await CustomAlert({
779
- type: 'warning',
780
- title: '품목은 최대 16개까지 추가 가능합니다.',
781
- text: '품목은 최대 16개까지 추가 가능합니다.',
782
- confirmButton: { text: i18next.t('button.confirm') }
783
- });
784
- return;
785
- }
786
- this.taxInvoiceItems = [...this.taxInvoiceItems, Object.assign(Object.assign({}, this.defaultTaxInvoiceItem), { sequence: new Date().getTime() })];
787
- }
788
- _onRemoveInvoiceItem(e, sequence) {
789
- e.preventDefault();
790
- this.taxInvoiceItems = [...this.taxInvoiceItems.filter(item => item.sequence != sequence)];
791
- this._setTaxInvoiceSummaryCalc();
835
+ const supplier = response.data.response;
836
+ this.supplier = {
837
+ supplierBusinessRegistrationCategory: supplier.businessRegistrationCategory,
838
+ supplierBusinessRegistrationNumber: supplier.businessRegistrationNumber,
839
+ supplierBranchIdentification: supplier.branchIdentification,
840
+ supplierBusinessName: supplier.businessName,
841
+ supplierRepresentativeName: supplier.representativeName,
842
+ supplierAddress: supplier.address,
843
+ supplierBusinessType: supplier.businessType,
844
+ supplierIndustryType: supplier.industryType,
845
+ supplierDepartment: supplier.department,
846
+ supplierContactName: supplier.contactName,
847
+ supplierContactPhone: supplier.contactPhone,
848
+ supplierContactEmail: supplier.contactEmail,
849
+ supplierContactCellPhone: supplier.contactCellPhone
850
+ };
792
851
  }
793
- _setTaxInvoiceSummaryCalc() {
794
- const supplyPrice = this.taxInvoiceItems.reduce((prev, item) => prev + Number(item.supplyPrice), 0) || 0;
795
- const taxPrice = this.isTaxFree
796
- ? 0
797
- : this.taxInvoiceItems.reduce((prev, item) => prev + Number(item.taxPrice), 0) || 0;
798
- const totalAmount = supplyPrice + taxPrice;
799
- this.taxInvoice = Object.assign(Object.assign({}, this.taxInvoice), { supplyAmount: supplyPrice, taxAmount: taxPrice, totalAmount: totalAmount });
852
+ _numberFormat(value) {
853
+ return !value ? '' : new Intl.NumberFormat('en-US').format(value) || '';
800
854
  }
801
- };
802
- TaxInvoiceSend.styles = [
803
- ScrollbarStyles,
804
- CommonGristStyles,
805
- css `
806
- :host {
807
- display: flex;
808
- flex-direction: column;
809
- overflow-y: auto;
810
- overflow-x: hidden;
811
-
812
- width: 100%;
813
- min-width: 850px;
814
- padding: 0 40px 40px 40px;
815
-
816
- --grid-record-emphasized-background-color: red;
817
- --grid-record-emphasized-color: yellow;
818
- }
819
-
820
- .flex-row {
821
- display: flex;
822
- flex-direction: row;
823
- }
824
- .flex-column {
825
- display: flex;
826
- flex-direction: column;
827
- }
828
-
829
- input[type='text'],
830
- input[type='date'],
831
- input[type='number'] {
832
- width: 85%;
833
- max-width: calc(100% - 12px);
834
- height: 14px;
835
- margin: 0;
836
- padding: 4px 5px 5px;
837
- line-height: 14px;
838
- border: 1px solid #bbb;
839
- background: #fff;
840
- letter-spacing: 0.5px;
841
- }
842
- input[type='date'] {
843
- width: auto;
844
- }
845
- input[readonly],
846
- input:disabled {
847
- background-color: #eee;
848
- }
849
-
850
- div.invoice-type {
851
- font-size: 18px;
852
- margin-top: 15px;
853
- }
854
-
855
- table {
856
- border: solid;
857
- border-width: 2px 0;
858
- border-collapse: collapse;
859
- border-spacing: 0;
860
- }
861
-
862
- .title table {
863
- border-color: #d3dbe5;
864
- width: 100%;
865
- height: 33px;
866
- margin-top: 10px;
867
- font-size: 12px;
868
-
869
- th {
870
- font-size: 13px;
871
- background-color: #e9edf6;
872
- min-width: 140px;
873
- }
874
- td {
875
- width: 50%;
876
- padding-left: 10px;
877
-
878
- & > * {
879
- vertical-align: middle;
880
- }
881
- & > input {
882
- margin: 0 5px 0 1px;
883
- }
855
+ // Input 요소의 값이 변경될 때 호출되는 콜백 함수
856
+ async _onInputTaxInvoice(event) {
857
+ const target = event.target;
858
+ // 숫자 타입은 다른 문자 입력 제거
859
+ if (target.hasAttribute('numeric')) {
860
+ target.value = target.value.replace(/\D/g, '');
884
861
  }
885
- }
886
-
887
- div.body {
888
- margin-top: 15px;
889
- font-size: 14px;
890
-
891
- div.data {
892
- display: flex;
893
- margin-top: 5px;
894
-
895
- table {
896
- flex: 1;
897
-
898
- td,
899
- th {
900
- padding: 5px;
901
- min-width: 60px;
902
- }
903
- td {
904
- padding-left: 8px;
905
- }
906
- th.target {
907
- width: 25px;
908
- writing-mode: vertical-rl;
909
- min-width: unset;
910
- }
911
-
912
- &.supplier {
913
- border-color: #f64843;
914
-
915
- td,
916
- th {
917
- background-color: #fef5f7;
918
- border: solid 1.5px #f5b1b1;
919
- }
920
- th.target {
921
- background-color: #fedbde;
922
- }
923
- }
924
- &.buyer {
925
- border-color: #007ed9;
926
-
927
- td,
928
- th {
929
- background-color: #f7f7ff;
930
- border: solid 1.5px #a7bcff;
931
- }
932
- th.target {
933
- background-color: #c6daf6;
934
- }
935
- }
936
- }
862
+ if (target.name.startsWith('supplier')) {
863
+ this.supplier[target.name] = target.value;
937
864
  }
938
-
939
- div.header {
940
- display: flex;
941
-
942
- span {
943
- flex: 1;
944
- }
865
+ else if (target.name.startsWith('buyer')) {
866
+ this.buyer[target.name] = target.value;
945
867
  }
946
-
947
- div.info {
948
- margin-top: 15px;
949
- border: solid;
950
- border-color: #000;
951
- border-width: 2px 0px 0px 0px;
952
-
953
- div.flex-row div {
954
- border: solid #c4d2ff;
955
- border-width: 0px 1.5px 1.5px 1.5px;
956
- margin-right: -1px;
957
- padding: 5px;
958
- text-align: center;
959
-
960
- &.title {
961
- background-color: #e9edf5;
962
- font-weight: bold;
963
- flex: 1;
964
- }
965
- &.value {
966
- flex: 3;
967
- text-align: left;
968
-
969
- .desc {
970
- font-size: 11px;
971
- color: #c90000;
972
- }
868
+ else {
869
+ // 날짜 체크가 오늘 날짜를 넘어가면 값 변경 되면 안됨
870
+ if (target.name === 'issueDate' && target.value > this.today) {
871
+ target.value = this.taxInvoice['issueDate'];
872
+ await CustomAlert({
873
+ type: 'warning',
874
+ title: '작성일자는 현재일까지 입력하시기 바랍니다.',
875
+ text: '작성일자는 현재일까지 입력하시기 바랍니다.',
876
+ confirmButton: { text: i18next.t('button.confirm') }
877
+ });
878
+ return;
973
879
  }
974
- }
975
- }
976
-
977
- div.items,
978
- div.summary {
979
- margin-top: 20px;
980
-
981
- table {
982
- width: 100%;
983
- border-color: #000;
984
- border-width: 2px 0px 0px 0px;
985
-
986
- th {
987
- background-color: #e9edf5;
880
+ // 세금이 없는 영세율이 선택 시 모든 아이템의 세금 0원으로 초기화
881
+ if (target.name === 'invoiceType' && target.value === InvoiceType.SMALL_BUSINESS_TAX_INVOICE) {
882
+ this.isTaxFree = true;
883
+ this.taxInvoice = { ...this.taxInvoice, taxAmount: 0 };
884
+ this.taxInvoiceItems = this.taxInvoiceItems.map(item => ({ ...item, taxPrice: 0 }));
988
885
  }
989
- th,
990
- td {
991
- border: solid 1.5px #c4d2ff;
992
- padding: 5px;
993
- text-align: center;
886
+ // 변경시에는 아이템 변경도 리 렌더가 필요해서 데이터 갱신
887
+ this.taxInvoice[target.name] = target.value;
888
+ this.taxInvoice = { ...this.taxInvoice };
889
+ }
890
+ }
891
+ // Input 요소의 값이 변경될 때 호출되는 콜백 함수
892
+ async _onInputItem(e, idx) {
893
+ const target = e.target;
894
+ let inputVal = target.value;
895
+ // 숫자 타입은 다른 문자 입력 제거
896
+ if (target.hasAttribute('numeric')) {
897
+ inputVal = Number(inputVal.replace(/\D/g, ''));
898
+ target.value = inputVal;
899
+ }
900
+ // 공급일자 케이스 시 => 세금계산서의 작성일자의 YYYY-MM + 아이템의 입력된 DD
901
+ if (target.name === 'supplyDate') {
902
+ const itemDate = this.taxInvoice.issueDate.substring(0, 8) + inputVal.toString().padStart(2, '0');
903
+ if (itemDate > this.taxInvoice.issueDate) {
904
+ await CustomAlert({
905
+ type: 'warning',
906
+ title: '품목의 일자는 작성일자보다 클 수 없습니다.',
907
+ text: '품목의 일자는 작성일자보다 클 수 없습니다.',
908
+ confirmButton: { text: i18next.t('button.confirm') }
909
+ });
910
+ target.value = '';
994
911
  }
995
- }
912
+ inputVal = itemDate;
996
913
  }
997
-
998
- div.summary {
999
- display: flex;
1000
-
1001
- & > table {
1002
- flex: 6.7;
1003
- }
1004
- & > div {
1005
- flex: 3.2;
1006
- display: flex;
1007
- justify-content: center;
1008
- align-items: center;
1009
- border: 1.5px solid #c4d2ff;
1010
- border-top: 2px solid #000;
1011
- }
1012
-
1013
- span.type-wrapper {
1014
- margin: 0 10px;
1015
-
1016
- & > div {
1017
- display: flex;
1018
- justify-content: center;
1019
- align-items: center;
1020
- gap: 4px;
1021
-
1022
- input[type='radio' i] {
1023
- margin: 0px;
1024
- }
914
+ // 수량, 단가 수정시 공급가액/세액 자동 계산
915
+ if (target.name == 'quantity' || target.name == 'unitPrice') {
916
+ const supplyPrice = target.name == 'quantity'
917
+ ? Number(inputVal) * this.taxInvoiceItems[idx]['unitPrice']
918
+ : Number(inputVal) * this.taxInvoiceItems[idx]['quantity'];
919
+ this.taxInvoiceItems[idx]['supplyPrice'] = supplyPrice;
920
+ this.taxInvoiceItems[idx]['taxPrice'] = this.isTaxFree ? 0 : Math.floor(supplyPrice / 10);
921
+ }
922
+ // 인풋에 값 넣기
923
+ this.taxInvoiceItems[idx][target.name] = inputVal;
924
+ // 아이템 금액에 관련된 필드 수정시 합계 계산
925
+ if (['quantity', 'unitPrice', 'supplyPrice', 'taxPrice'].includes(target.name)) {
926
+ this.taxInvoiceItems = [...this.taxInvoiceItems];
927
+ this._setTaxInvoiceSummaryCalc();
928
+ }
929
+ }
930
+ async _openSupplierPopup() {
931
+ const response = await client.query({
932
+ query: gql `
933
+ query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
934
+ responses: taxInvoiceApis(filters: $filters, pagination: $pagination, sortings: $sortings) {
935
+ items {
936
+ id
937
+ name: provider
938
+ businessRegistrationNumber
939
+ branchIdentification
940
+ businessName
941
+ representativeName
942
+ address
943
+ businessType
944
+ industryType
945
+ department
946
+ contactName
947
+ contactPhone
948
+ contactEmail
949
+ contactCellPhone
1025
950
  }
1026
951
  }
1027
952
  }
1028
-
1029
- div.items {
1030
- div.desc {
1031
- font-weight: 400;
1032
- font-size: 12px;
1033
- margin-bottom: 5px;
1034
- }
1035
- div.desc-date {
1036
- color: #005d98;
1037
- }
1038
- button {
1039
- font-size: 13px;
1040
- height: 25px;
1041
- cursor: pointer;
1042
- text-align: center;
1043
- font-weight: 600;
1044
- border-radius: 2px;
1045
- border-color: #ccc;
1046
- }
1047
- .btn-add {
1048
- color: #333;
1049
- background-color: #f9f9f9;
1050
- }
1051
- .btn-delete {
1052
- color: #fff;
1053
- background-color: #5c636e;
1054
- border: none;
953
+ `
954
+ });
955
+ const items = response.data.responses.items || [];
956
+ openPopup(html `
957
+ <company-list-popup
958
+ .companyList=${items}
959
+ @selected=${e => {
960
+ this.supplier = {
961
+ supplierBusinessRegistrationCategory: BusinessRegistrationCategory.BUSINESS_REGISTRATION_NUMBER,
962
+ supplierBusinessRegistrationNumber: e.detail.businessRegistrationNumber || '',
963
+ supplierBranchIdentification: e.detail.branchIdentification || '',
964
+ supplierBusinessName: e.detail.businessName || '',
965
+ supplierRepresentativeName: e.detail.representativeName || '',
966
+ supplierAddress: e.detail.address || '',
967
+ supplierBusinessType: e.detail.businessType || '',
968
+ supplierIndustryType: e.detail.industryType || '',
969
+ supplierDepartment: e.detail.department || '',
970
+ supplierContactName: e.detail.contactName || '',
971
+ supplierContactPhone: e.detail.contactPhone || '',
972
+ supplierContactEmail: e.detail.contactEmail || '',
973
+ supplierContactCellPhone: e.detail.contactCellPhone || ''
974
+ };
975
+ history.back();
976
+ }}
977
+ >
978
+ </company-list-popup>
979
+ `, {
980
+ backdrop: true,
981
+ size: 'large',
982
+ title: i18next.t('title.company list popup')
983
+ });
984
+ }
985
+ async _openBuyerPopup() {
986
+ const response = await client.query({
987
+ query: gql `
988
+ query TaxInvoiceBuyerList {
989
+ responses: taxInvoiceBuyerList {
990
+ id
991
+ name
992
+ businessRegistrationNumber
993
+ branchIdentification
994
+ businessName
995
+ representativeName
996
+ address
997
+ businessType
998
+ industryType
999
+ department
1000
+ contactName
1001
+ contactPhone
1002
+ contactEmail
1003
+ contactCellPhone
1055
1004
  }
1056
1005
  }
1057
-
1058
- *[required]::before {
1059
- content: '*';
1060
- color: red;
1061
- margin-right: 2px;
1006
+ `
1007
+ });
1008
+ const items = response.data.responses || [];
1009
+ openPopup(html `
1010
+ <company-list-popup
1011
+ .companyList=${items}
1012
+ @selected=${e => {
1013
+ this.buyer = {
1014
+ buyerBusinessRegistrationCategory: BusinessRegistrationCategory.BUSINESS_REGISTRATION_NUMBER,
1015
+ buyerBusinessRegistrationNumber: e.detail.businessRegistrationNumber || '',
1016
+ buyerBranchIdentification: e.detail.branchIdentification || '',
1017
+ buyerBusinessName: e.detail.businessName || '',
1018
+ buyerRepresentativeName: e.detail.representativeName || '',
1019
+ buyerAddress: e.detail.address || '',
1020
+ buyerBusinessType: e.detail.businessType || '',
1021
+ buyerIndustryType: e.detail.industryType || '',
1022
+ buyer1stDepartment: e.detail.department || '',
1023
+ buyer1stContactName: e.detail.contactName || '',
1024
+ buyer1stContactPhone: e.detail.contactPhone || '',
1025
+ buyer1stContactEmail: e.detail.contactEmail || '',
1026
+ buyer1stContactCellPhone: e.detail.contactCellPhone || ''
1027
+ };
1028
+ history.back();
1029
+ }}
1030
+ >
1031
+ </company-list-popup>
1032
+ `, {
1033
+ backdrop: true,
1034
+ size: 'large',
1035
+ title: i18next.t('title.company list popup')
1036
+ });
1037
+ }
1038
+ async _onAddInvoiceItem(e) {
1039
+ e.preventDefault();
1040
+ if (this.taxInvoiceItems.length >= 16) {
1041
+ await CustomAlert({
1042
+ type: 'warning',
1043
+ title: '품목은 최대 16개까지 추가 가능합니다.',
1044
+ text: '품목은 최대 16개까지 추가 가능합니다.',
1045
+ confirmButton: { text: i18next.t('button.confirm') }
1046
+ });
1047
+ return;
1062
1048
  }
1063
- }
1064
- `
1065
- ];
1049
+ this.taxInvoiceItems = [...this.taxInvoiceItems, { ...this.defaultTaxInvoiceItem, sequence: new Date().getTime() }];
1050
+ }
1051
+ _onRemoveInvoiceItem(e, sequence) {
1052
+ e.preventDefault();
1053
+ this.taxInvoiceItems = [...this.taxInvoiceItems.filter(item => item.sequence != sequence)];
1054
+ this._setTaxInvoiceSummaryCalc();
1055
+ }
1056
+ _setTaxInvoiceSummaryCalc() {
1057
+ const supplyPrice = this.taxInvoiceItems.reduce((prev, item) => prev + Number(item.supplyPrice), 0) || 0;
1058
+ const taxPrice = this.isTaxFree
1059
+ ? 0
1060
+ : this.taxInvoiceItems.reduce((prev, item) => prev + Number(item.taxPrice), 0) || 0;
1061
+ const totalAmount = supplyPrice + taxPrice;
1062
+ this.taxInvoice = { ...this.taxInvoice, supplyAmount: supplyPrice, taxAmount: taxPrice, totalAmount: totalAmount };
1063
+ }
1064
+ };
1066
1065
  __decorate([
1067
1066
  property({ type: Object }),
1068
1067
  __metadata("design:type", Object)