@things-factory/tax-invoice 6.2.84 → 6.2.86

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/client/pages/tax-invoice/tax-invoice-detail-popup.ts +23 -6
  2. package/client/pages/tax-invoice/tax-invoice-list-page.ts +34 -7
  3. package/dist-client/pages/tax-invoice/tax-invoice-detail-popup.js +22 -5
  4. package/dist-client/pages/tax-invoice/tax-invoice-detail-popup.js.map +1 -1
  5. package/dist-client/pages/tax-invoice/tax-invoice-list-page.js +29 -4
  6. package/dist-client/pages/tax-invoice/tax-invoice-list-page.js.map +1 -1
  7. package/dist-client/tsconfig.tsbuildinfo +1 -1
  8. package/dist-server/service/tax-invoice/tax-invoice-mutation.js +12 -21
  9. package/dist-server/service/tax-invoice/tax-invoice-mutation.js.map +1 -1
  10. package/dist-server/service/tax-invoice/tax-invoice-query.js +1 -1
  11. package/dist-server/service/tax-invoice/tax-invoice-query.js.map +1 -1
  12. package/dist-server/service/tax-invoice/tax-invoice.js +0 -8
  13. package/dist-server/service/tax-invoice/tax-invoice.js.map +1 -1
  14. package/dist-server/service/tax-invoice-api/tax-invoice-api.js +0 -8
  15. package/dist-server/service/tax-invoice-api/tax-invoice-api.js.map +1 -1
  16. package/dist-server/service/tax-invoice-company/tax-invoice-company.js +0 -8
  17. package/dist-server/service/tax-invoice-company/tax-invoice-company.js.map +1 -1
  18. package/dist-server/service/tax-invoice-item/tax-invoice-item-type.js +0 -8
  19. package/dist-server/service/tax-invoice-item/tax-invoice-item-type.js.map +1 -1
  20. package/dist-server/service/tax-invoice-item/tax-invoice-item.js +3 -12
  21. package/dist-server/service/tax-invoice-item/tax-invoice-item.js.map +1 -1
  22. package/dist-server/tsconfig.tsbuildinfo +1 -1
  23. package/package.json +2 -2
  24. package/server/service/tax-invoice/tax-invoice-mutation.ts +14 -17
  25. package/server/service/tax-invoice/tax-invoice-query.ts +1 -1
  26. package/server/service/tax-invoice/tax-invoice.ts +0 -4
  27. package/server/service/tax-invoice-api/tax-invoice-api.ts +0 -4
  28. package/server/service/tax-invoice-company/tax-invoice-company.ts +0 -4
  29. package/server/service/tax-invoice-item/tax-invoice-item-type.ts +0 -6
  30. package/server/service/tax-invoice-item/tax-invoice-item.ts +3 -7
@@ -3,7 +3,7 @@ import '@operato/data-grist'
3
3
 
4
4
  import { CommonHeaderStyles, ScrollbarStyles } from '@operato/styles'
5
5
  import { css, html, LitElement } from 'lit'
6
- import { customElement, property, query, state } from 'lit/decorators.js'
6
+ import { customElement, property, state } from 'lit/decorators.js'
7
7
  import { client } from '@operato/graphql'
8
8
  import { i18next, localize } from '@operato/i18n'
9
9
  import gql from 'graphql-tag'
@@ -285,11 +285,15 @@ export class TaxInvoiceDetailPopup extends localize(i18next)(LitElement) {
285
285
  item =>
286
286
  html`
287
287
  <tr>
288
- <td>${item.issueDate}</td>
289
- <td>${item.supplyAmount}</td>
290
- <td>${item.taxAmount}</td>
291
- <td>${item.modificationReason}</td>
292
- <td>${item.remark0}</td>
288
+ <td>${item.supplyDate.split('-')[1]}</td>
289
+ <td>${item.supplyDate.split('-')[2]}</td>
290
+ <td>${item.itemName}</td>
291
+ <td>${item.specification}</td>
292
+ <td>${item.quantity}</td>
293
+ <td>${this._numberFormat(item.unitPrice)}</td>
294
+ <td>${this._numberFormat(item.supplyPrice)}</td>
295
+ <td>${this._numberFormat(item.taxPrice)}</td>
296
+ <td>${item.remark}</td>
293
297
  </tr>
294
298
  `
295
299
  )}
@@ -409,6 +413,19 @@ export class TaxInvoiceDetailPopup extends localize(i18next)(LitElement) {
409
413
  name
410
414
  }
411
415
  updatedAt
416
+
417
+ taxInvoiceItems {
418
+ id
419
+ sequence
420
+ supplyDate
421
+ itemName
422
+ specification
423
+ quantity
424
+ unitPrice
425
+ supplyPrice
426
+ taxPrice
427
+ remark
428
+ }
412
429
  }
413
430
  }
414
431
  `,
@@ -1,15 +1,15 @@
1
1
  import '@operato/data-grist'
2
2
 
3
3
  import { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'
4
- import { PageView, navigate, store } from '@operato/shell'
4
+ import { PageView } from '@operato/shell'
5
5
  import { css, html } from 'lit'
6
6
  import { customElement, property, query } from 'lit/decorators.js'
7
7
  import { ScopedElementsMixin } from '@open-wc/scoped-elements'
8
- import { ColumnConfig, DataGrist, FetchOption, SortersControl } from '@operato/data-grist'
8
+ import { DataGrist, FetchOption } from '@operato/data-grist'
9
9
  import { client } from '@operato/graphql'
10
10
  import { i18next, localize } from '@operato/i18n'
11
11
  import { notify, openPopup } from '@operato/layout'
12
- import { OxPopup, OxPrompt } from '@operato/popup'
12
+ import { OxPrompt } from '@operato/popup'
13
13
  import { isMobileDevice } from '@operato/utils'
14
14
  import gql from 'graphql-tag'
15
15
 
@@ -426,7 +426,7 @@ export class TaxInvoiceListPage extends localize(i18next)(ScopedElementsMixin(Pa
426
426
 
427
427
  const taxInvoice = {
428
428
  name: '설명' + num.repeat(3),
429
- category: 10,
429
+ category: '10',
430
430
  approvalNo: year + month + day + '-' + firstWordOfNum.repeat(8) + '-' + firstWordOfNum.repeat(8),
431
431
  issueDate: `${year}-${month}-${day}`,
432
432
  signatureDate: `${year}-${month}-${Number(day) + 1}`,
@@ -472,16 +472,43 @@ export class TaxInvoiceListPage extends localize(i18next)(ScopedElementsMixin(Pa
472
472
  taxAmount: taxAmount,
473
473
  totalAmount: supplyAmount + taxAmount
474
474
  }
475
+
476
+ const taxInvoiceItems = [
477
+ {
478
+ sequence: 1,
479
+ supplyDate: `${year}-${month}-${day}`,
480
+ itemName: '아이템01',
481
+ specification: 'EA',
482
+ quantity: 1,
483
+ unitPrice: 100000,
484
+ supplyPrice: 100000,
485
+ taxPrice: 10000,
486
+ remark: '아이템 비고 01'
487
+ },
488
+ {
489
+ sequence: 2,
490
+ supplyDate: `${year}-${month}-${Number(day) + 1}`,
491
+ itemName: '아이템02',
492
+ specification: 'EA',
493
+ quantity: 2,
494
+ unitPrice: 100000,
495
+ supplyPrice: 200000,
496
+ taxPrice: 20000,
497
+ remark: '아이템 비고 02'
498
+ }
499
+ ]
500
+
475
501
  const response = await client.mutate({
476
502
  mutation: gql`
477
- mutation CreateTaxInvoice($taxInvoice: NewTaxInvoice!) {
478
- createTaxInvoice(taxInvoice: $taxInvoice) {
503
+ mutation CreateTaxInvoice($taxInvoice: NewTaxInvoice!, $taxInvoiceItems: [NewTaxInvoiceItem!]!) {
504
+ createTaxInvoice(taxInvoice: $taxInvoice, taxInvoiceItems: $taxInvoiceItems) {
479
505
  id
480
506
  }
481
507
  }
482
508
  `,
483
509
  variables: {
484
- taxInvoice
510
+ taxInvoice,
511
+ taxInvoiceItems
485
512
  }
486
513
  })
487
514
 
@@ -155,11 +155,15 @@ let TaxInvoiceDetailPopup = class TaxInvoiceDetailPopup extends localize(i18next
155
155
 
156
156
  ${(_a = this.detail.taxInvoiceItems) === null || _a === void 0 ? void 0 : _a.map(item => html `
157
157
  <tr>
158
- <td>${item.issueDate}</td>
159
- <td>${item.supplyAmount}</td>
160
- <td>${item.taxAmount}</td>
161
- <td>${item.modificationReason}</td>
162
- <td>${item.remark0}</td>
158
+ <td>${item.supplyDate.split('-')[1]}</td>
159
+ <td>${item.supplyDate.split('-')[2]}</td>
160
+ <td>${item.itemName}</td>
161
+ <td>${item.specification}</td>
162
+ <td>${item.quantity}</td>
163
+ <td>${this._numberFormat(item.unitPrice)}</td>
164
+ <td>${this._numberFormat(item.supplyPrice)}</td>
165
+ <td>${this._numberFormat(item.taxPrice)}</td>
166
+ <td>${item.remark}</td>
163
167
  </tr>
164
168
  `)}
165
169
  </table>
@@ -276,6 +280,19 @@ let TaxInvoiceDetailPopup = class TaxInvoiceDetailPopup extends localize(i18next
276
280
  name
277
281
  }
278
282
  updatedAt
283
+
284
+ taxInvoiceItems {
285
+ id
286
+ sequence
287
+ supplyDate
288
+ itemName
289
+ specification
290
+ quantity
291
+ unitPrice
292
+ supplyPrice
293
+ taxPrice
294
+ remark
295
+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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2ET;YACD,SAAS,EAAE,EAAE,EAAE,EAAE;SAClB,CAAC,CAAA;QAEF,OAAO,QAAQ,CAAC,IAAI,CAAC,SAAS,IAAI,EAAE,CAAA;IACtC,CAAC;IAEO,aAAa,CAAC,KAAa;QACjC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IACnE,CAAC;;AAzZM,4BAAM,GAAG;IACd,eAAe;IACf,kBAAkB;IAClB,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA2HF;CACF,CAAA;AAED;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;2DAA0B;AACrD;IAAC,KAAK,EAAE;;qDAAiB;AAnId,qBAAqB;IADjC,aAAa,CAAC,0BAA0B,CAAC;GAC7B,qBAAqB,CA2ZjC;SA3ZY,qBAAqB","sourcesContent":["import '@material/mwc-icon'\nimport '@operato/data-grist'\n\nimport { CommonHeaderStyles, ScrollbarStyles } from '@operato/styles'\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport gql from 'graphql-tag'\nimport { INVOICE_TYPE } from './tax-invoice-list-page'\n\n@customElement('tax-invoice-detail-popup')\nexport class TaxInvoiceDetailPopup extends localize(i18next)(LitElement) {\n static styles = [\n ScrollbarStyles,\n CommonHeaderStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n background-color: var(--main-section-background-color);\n width: 100%;\n padding: 15px;\n font-size: 14px;\n overflow-y: scroll;\n }\n\n input {\n border: var(--border-dark-color);\n padding: var(--padding-narrow) var(--padding-default);\n max-width: 100px;\n font: var(--input-font);\n }\n\n table {\n border: solid;\n border-width: 2px 0;\n border-collapse: collapse;\n border-spacing: 0;\n }\n\n .title table {\n border-color: #d3dbe5;\n width: 100%;\n height: 33px;\n\n th {\n background-color: #e9edf6;\n }\n td {\n padding-left: 10px;\n }\n }\n\n div.body {\n margin-top: 15px;\n font-size: 14px;\n\n div.data {\n display: flex;\n margin-top: 5px;\n\n table {\n flex: 1;\n\n td,\n th {\n padding: 5px;\n }\n th.target {\n width: 25px;\n writing-mode: vertical-rl;\n }\n\n &.supplier {\n border-color: #f64843;\n\n td,\n th {\n background-color: #fef5f7;\n border: solid 1.5px #f5b1b1;\n }\n th.target {\n background-color: #fedbde;\n }\n }\n &.buyer {\n border-color: #007ed9;\n\n td,\n th {\n background-color: #f7f7ff;\n border: solid 1.5px #a7bcff;\n }\n th.target {\n background-color: #c6daf6;\n }\n }\n }\n }\n\n div.items,\n div.info,\n div.summary {\n margin-top: 15px;\n\n table {\n width: 100%;\n border-color: #000;\n border-width: 2px 0px 0px 0px;\n\n th {\n background-color: #e9edf5;\n }\n th,\n td {\n border: solid 1.5px #c4d2ff;\n padding: 5px;\n text-align: center;\n }\n }\n }\n\n div.summary {\n display: flex;\n\n & > table {\n flex: 6.7;\n }\n & > div {\n flex: 3.2;\n display: flex;\n justify-content: center;\n align-items: center;\n border: 1.5px solid #c4d2ff;\n border-top: 2px solid #000;\n }\n }\n }\n `\n ]\n\n @property({ type: String }) taxInvoiceId: string = ''\n @state() detail: any = {}\n\n render() {\n return html`\n <div class=\"title\">\n <table>\n <tr>\n <th>${i18next.t('field.approval no')}</th>\n <td>${this.detail.approvalNo}</td>\n </tr>\n </table>\n </div>\n\n <div class=\"body\">\n <div class=\"invoice-type\">* ${INVOICE_TYPE[this.detail.invoiceType]}</div>\n <div class=\"data\">\n <table class=\"supplier\">\n <colgroup>\n <col width=\"150px\" />\n <col width=\"18%\" />\n <col width=\"32%\" />\n <col width=\"18%\" />\n <col width=\"32%\" />\n </colgroup>\n <tr>\n <th rowspan=\"6\" class=\"target\">${i18next.t('field.tax invoice supplier')}</th>\n <th>${i18next.t('field.short business registration number')}</th>\n <td>${this.detail.supplierBusinessRegistrationNumber}</td>\n <th>${i18next.t('field.short branch identification')}</th>\n <td>${this.detail.supplierBranchIdentification}</td>\n </tr>\n <tr>\n <th>${i18next.t('field.short tax invoice business name')}</th>\n <td>${this.detail.supplierBusinessName}</td>\n <th>${i18next.t('field.short representative name')}</th>\n <td>${this.detail.supplierRepresentativeName}</td>\n </tr>\n <tr>\n <th>${i18next.t('field.address')}</th>\n <td colspan=\"3\">${this.detail.supplierAddress}</td>\n </tr>\n <tr>\n <th>${i18next.t('field.business type')}</th>\n <td>${this.detail.supplierBusinessType}</td>\n <th>${i18next.t('field.industry type')}</th>\n <td>${this.detail.supplierIndustryType}</td>\n </tr>\n <tr>\n <th rowspan=\"2\">${i18next.t('field.email')}</th>\n <td rowspan=\"2\" colspan=\"3\">${this.detail.supplierContactEmail}</td>\n </tr>\n <tr></tr>\n </table>\n\n <table class=\"buyer\">\n <tr>\n <th rowspan=\"6\" class=\"target\">${i18next.t('field.tax invoice buyer')}</th>\n <th>${i18next.t('field.short business registration number')}</th>\n <td>${this.detail.buyerBusinessRegistrationNumber}</td>\n <th>${i18next.t('field.short branch identification')}</th>\n <td>${this.detail.buyerBranchIdentification}</td>\n </tr>\n <tr>\n <th>${i18next.t('field.short tax invoice business name')}</th>\n <td>${this.detail.buyerBusinessName}</td>\n <th>${i18next.t('field.short representative name')}</th>\n <td>${this.detail.buyerRepresentativeName}</td>\n </tr>\n <tr>\n <th>${i18next.t('field.address')}</th>\n <td colspan=\"3\">${this.detail.buyerAddress}</td>\n </tr>\n <tr>\n <th>${i18next.t('field.business type')}</th>\n <td>${this.detail.buyerBusinessType}</td>\n <th>${i18next.t('field.industry type')}</th>\n <td>${this.detail.buyerIndustryType}</td>\n </tr>\n <tr>\n <th>${i18next.t('field.email')}</th>\n <td colspan=\"3\">${this.detail.buyer1stContactEmail}</td>\n </tr>\n <tr>\n <th>${i18next.t('field.email')}</th>\n <td colspan=\"3\">${this.detail.buyer2ndContactEmail}</td>\n </tr>\n </table>\n </div>\n\n <div class=\"info\">\n <table>\n <colgroup>\n <col width=\"15%\" />\n <col width=\"15%\" />\n <col width=\"15%\" />\n <col width=\"15%\" />\n <col width=\"40%\" />\n </colgroup>\n <tr>\n <th>${i18next.t('field.issue date')}</th>\n <th>${i18next.t('field.supply amount')}</th>\n <th>${i18next.t('field.tax amount')}</th>\n <th>${i18next.t('field.modification reason')}</th>\n <th>${i18next.t('field.remark0')}</th>\n </tr>\n <tr>\n <td>${this.detail.issueDate}</td>\n <td>${this._numberFormat(this.detail.supplyAmount)}</td>\n <td>${this._numberFormat(this.detail.taxAmount)}</td>\n <td>${this.detail.modificationReason}</td>\n <td>${this.detail.remark0}</td>\n </tr>\n </table>\n </div>\n\n <div class=\"items\">\n <table>\n <colgroup>\n <col width=\"4%\" />\n <col width=\"4%\" />\n <col width=\"15%\" />\n <col width=\"9%\" />\n <col width=\"9%\" />\n <col width=\"13%\" />\n <col width=\"13%\" />\n <col width=\"13%\" />\n <col width=\"20%\" />\n </colgroup>\n <tr>\n <th>${i18next.t('field.tax invoice month')}</th>\n <th>${i18next.t('field.tax invoice day')}</th>\n <th>${i18next.t('field.tax invoice item name')}</th>\n <th>${i18next.t('field.tax invoice ea')}</th>\n <th>${i18next.t('field.tax invoice quantity')}</th>\n <th>${i18next.t('field.tax invoice price')}</th>\n <th>${i18next.t('field.supply amount')}</th>\n <th>${i18next.t('field.tax amount')}</th>\n <th>${i18next.t('field.remark0')}</th>\n </tr>\n\n ${this.detail.taxInvoiceItems?.map(\n item =>\n html`\n <tr>\n <td>${item.issueDate}</td>\n <td>${item.supplyAmount}</td>\n <td>${item.taxAmount}</td>\n <td>${item.modificationReason}</td>\n <td>${item.remark0}</td>\n </tr>\n `\n )}\n </table>\n </div>\n\n <div class=\"summary\">\n <table>\n <colgroup>\n <col width=\"20%\" />\n <col width=\"20%\" />\n <col width=\"20%\" />\n <col width=\"20%\" />\n <col width=\"20%\" />\n </colgroup>\n <tr>\n <th>${i18next.t('field.total amount')}</th>\n <th>${i18next.t('field.tax invoice payment cash')}</th>\n <th>${i18next.t('field.tax invoice payment check')}</th>\n <th>${i18next.t('field.tax invoice payment promissory note')}</th>\n <th>${i18next.t('field.tax invoice payment accounts receivable')}</th>\n </tr>\n <tr>\n <td>${this._numberFormat(this.detail.totalAmount)}</td>\n <td>${this._numberFormat(this.detail.paymentAmountCash)}</td>\n <td>${this._numberFormat(this.detail.paymentAmountCheck)}</td>\n <td>${this._numberFormat(this.detail.paymentAmountPromissoryNote)}</td>\n <td>${this._numberFormat(this.detail.paymentAmountAccountsReceivable)}</td>\n </tr>\n </table>\n <div>${i18next.t('text.tax invoice description payment', { value: i18next.t(`text.tax invoice description purpose ${this.detail.purpose}`) })}</div>\n </div>\n </div>\n `\n }\n\n async updated(changed) {\n if (changed.has('taxInvoiceId')) {\n this.detail = await this.getTaxInvoiceDetailById(this.taxInvoiceId)\n }\n }\n\n private async getTaxInvoiceDetailById(id: string) {\n if (!id) return {}\n\n const response = await client.query({\n query: gql`\n query ($id: String!) {\n responses: taxInvoice(id: $id) {\n id\n name\n category\n approvalNo\n originalApprovalNo\n issueDate\n signatureDate\n invoiceType\n purpose\n revisedReason\n remark0\n remark1\n remark2\n supplierBusinessRegistrationCategory\n supplierBusinessRegistrationNumber\n supplierBranchIdentification\n supplierBusinessName\n supplierRepresentativeName\n supplierAddress\n supplierBusinessType\n supplierIndustryType\n supplierDepartment\n supplierContactName\n supplierContactPhone\n supplierContactEmail\n supplierContactCellPhone\n buyerBusinessRegistrationCategory\n buyerBusinessRegistrationNumber\n buyerBranchIdentification\n buyerBusinessName\n buyerRepresentativeName\n buyerAddress\n buyerBusinessType\n buyerIndustryType\n buyer1stDepartment\n buyer1stContactName\n buyer1stContactPhone\n buyer1stContactEmail\n buyer1stContactCellPhone\n buyer2ndDepartment\n buyer2ndContactName\n buyer2ndContactPhone\n buyer2ndContactEmail\n buyer2ndContactCellPhone\n agentBusinessRegistrationCategory\n agentBusinessRegistrationNumber\n agentBranchIdentification\n agentBusinessName\n agentRepresentativeName\n agentAddress\n agentBusinessType\n agentIndustryType\n agentDepartment\n agentContactName\n agentContactPhone\n agentContactEmail\n agentContactCellPhone\n paymentAmountCash\n paymentAmountCheck\n paymentAmountPromissoryNote\n paymentAmountAccountsReceivable\n supplyAmount\n taxAmount\n totalAmount\n createdAt\n updater {\n id\n name\n }\n updatedAt\n }\n }\n `,\n variables: { id }\n })\n\n return response.data.responses || {}\n }\n\n private _numberFormat(value: number): string {\n return !value ? '' : new Intl.NumberFormat('en-US').format(value)\n }\n}\n"]}
1
+ {"version":3,"file":"tax-invoice-detail-popup.js","sourceRoot":"","sources":["../../../client/pages/tax-invoice/tax-invoice-detail-popup.ts"],"names":[],"mappings":";AAAA,OAAO,oBAAoB,CAAA;AAC3B,OAAO,qBAAqB,CAAA;AAE5B,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACrE,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,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAG/C,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,QAAQ,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC;IAAjE;;QAkIuB,iBAAY,GAAW,EAAE,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AG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA2HF;CACF,CAAA;AAED;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;2DAA0B;AACrD;IAAC,KAAK,EAAE;;qDAAiB;AAnId,qBAAqB;IADjC,aAAa,CAAC,0BAA0B,CAAC;GAC7B,qBAAqB,CA4ajC;SA5aY,qBAAqB","sourcesContent":["import '@material/mwc-icon'\nimport '@operato/data-grist'\n\nimport { CommonHeaderStyles, ScrollbarStyles } from '@operato/styles'\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport gql from 'graphql-tag'\nimport { INVOICE_TYPE } from './tax-invoice-list-page'\n\n@customElement('tax-invoice-detail-popup')\nexport class TaxInvoiceDetailPopup extends localize(i18next)(LitElement) {\n static styles = [\n ScrollbarStyles,\n CommonHeaderStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n background-color: var(--main-section-background-color);\n width: 100%;\n padding: 15px;\n font-size: 14px;\n overflow-y: scroll;\n }\n\n input {\n border: var(--border-dark-color);\n padding: var(--padding-narrow) var(--padding-default);\n max-width: 100px;\n font: var(--input-font);\n }\n\n table {\n border: solid;\n border-width: 2px 0;\n border-collapse: collapse;\n border-spacing: 0;\n }\n\n .title table {\n border-color: #d3dbe5;\n width: 100%;\n height: 33px;\n\n th {\n background-color: #e9edf6;\n }\n td {\n padding-left: 10px;\n }\n }\n\n div.body {\n margin-top: 15px;\n font-size: 14px;\n\n div.data {\n display: flex;\n margin-top: 5px;\n\n table {\n flex: 1;\n\n td,\n th {\n padding: 5px;\n }\n th.target {\n width: 25px;\n writing-mode: vertical-rl;\n }\n\n &.supplier {\n border-color: #f64843;\n\n td,\n th {\n background-color: #fef5f7;\n border: solid 1.5px #f5b1b1;\n }\n th.target {\n background-color: #fedbde;\n }\n }\n &.buyer {\n border-color: #007ed9;\n\n td,\n th {\n background-color: #f7f7ff;\n border: solid 1.5px #a7bcff;\n }\n th.target {\n background-color: #c6daf6;\n }\n }\n }\n }\n\n div.items,\n div.info,\n div.summary {\n margin-top: 15px;\n\n table {\n width: 100%;\n border-color: #000;\n border-width: 2px 0px 0px 0px;\n\n th {\n background-color: #e9edf5;\n }\n th,\n td {\n border: solid 1.5px #c4d2ff;\n padding: 5px;\n text-align: center;\n }\n }\n }\n\n div.summary {\n display: flex;\n\n & > table {\n flex: 6.7;\n }\n & > div {\n flex: 3.2;\n display: flex;\n justify-content: center;\n align-items: center;\n border: 1.5px solid #c4d2ff;\n border-top: 2px solid #000;\n }\n }\n }\n `\n ]\n\n @property({ type: String }) taxInvoiceId: string = ''\n @state() detail: any = {}\n\n render() {\n return html`\n <div class=\"title\">\n <table>\n <tr>\n <th>${i18next.t('field.approval no')}</th>\n <td>${this.detail.approvalNo}</td>\n </tr>\n </table>\n </div>\n\n <div class=\"body\">\n <div class=\"invoice-type\">* ${INVOICE_TYPE[this.detail.invoiceType]}</div>\n <div class=\"data\">\n <table class=\"supplier\">\n <colgroup>\n <col width=\"150px\" />\n <col width=\"18%\" />\n <col width=\"32%\" />\n <col width=\"18%\" />\n <col width=\"32%\" />\n </colgroup>\n <tr>\n <th rowspan=\"6\" class=\"target\">${i18next.t('field.tax invoice supplier')}</th>\n <th>${i18next.t('field.short business registration number')}</th>\n <td>${this.detail.supplierBusinessRegistrationNumber}</td>\n <th>${i18next.t('field.short branch identification')}</th>\n <td>${this.detail.supplierBranchIdentification}</td>\n </tr>\n <tr>\n <th>${i18next.t('field.short tax invoice business name')}</th>\n <td>${this.detail.supplierBusinessName}</td>\n <th>${i18next.t('field.short representative name')}</th>\n <td>${this.detail.supplierRepresentativeName}</td>\n </tr>\n <tr>\n <th>${i18next.t('field.address')}</th>\n <td colspan=\"3\">${this.detail.supplierAddress}</td>\n </tr>\n <tr>\n <th>${i18next.t('field.business type')}</th>\n <td>${this.detail.supplierBusinessType}</td>\n <th>${i18next.t('field.industry type')}</th>\n <td>${this.detail.supplierIndustryType}</td>\n </tr>\n <tr>\n <th rowspan=\"2\">${i18next.t('field.email')}</th>\n <td rowspan=\"2\" colspan=\"3\">${this.detail.supplierContactEmail}</td>\n </tr>\n <tr></tr>\n </table>\n\n <table class=\"buyer\">\n <tr>\n <th rowspan=\"6\" class=\"target\">${i18next.t('field.tax invoice buyer')}</th>\n <th>${i18next.t('field.short business registration number')}</th>\n <td>${this.detail.buyerBusinessRegistrationNumber}</td>\n <th>${i18next.t('field.short branch identification')}</th>\n <td>${this.detail.buyerBranchIdentification}</td>\n </tr>\n <tr>\n <th>${i18next.t('field.short tax invoice business name')}</th>\n <td>${this.detail.buyerBusinessName}</td>\n <th>${i18next.t('field.short representative name')}</th>\n <td>${this.detail.buyerRepresentativeName}</td>\n </tr>\n <tr>\n <th>${i18next.t('field.address')}</th>\n <td colspan=\"3\">${this.detail.buyerAddress}</td>\n </tr>\n <tr>\n <th>${i18next.t('field.business type')}</th>\n <td>${this.detail.buyerBusinessType}</td>\n <th>${i18next.t('field.industry type')}</th>\n <td>${this.detail.buyerIndustryType}</td>\n </tr>\n <tr>\n <th>${i18next.t('field.email')}</th>\n <td colspan=\"3\">${this.detail.buyer1stContactEmail}</td>\n </tr>\n <tr>\n <th>${i18next.t('field.email')}</th>\n <td colspan=\"3\">${this.detail.buyer2ndContactEmail}</td>\n </tr>\n </table>\n </div>\n\n <div class=\"info\">\n <table>\n <colgroup>\n <col width=\"15%\" />\n <col width=\"15%\" />\n <col width=\"15%\" />\n <col width=\"15%\" />\n <col width=\"40%\" />\n </colgroup>\n <tr>\n <th>${i18next.t('field.issue date')}</th>\n <th>${i18next.t('field.supply amount')}</th>\n <th>${i18next.t('field.tax amount')}</th>\n <th>${i18next.t('field.modification reason')}</th>\n <th>${i18next.t('field.remark0')}</th>\n </tr>\n <tr>\n <td>${this.detail.issueDate}</td>\n <td>${this._numberFormat(this.detail.supplyAmount)}</td>\n <td>${this._numberFormat(this.detail.taxAmount)}</td>\n <td>${this.detail.modificationReason}</td>\n <td>${this.detail.remark0}</td>\n </tr>\n </table>\n </div>\n\n <div class=\"items\">\n <table>\n <colgroup>\n <col width=\"4%\" />\n <col width=\"4%\" />\n <col width=\"15%\" />\n <col width=\"9%\" />\n <col width=\"9%\" />\n <col width=\"13%\" />\n <col width=\"13%\" />\n <col width=\"13%\" />\n <col width=\"20%\" />\n </colgroup>\n <tr>\n <th>${i18next.t('field.tax invoice month')}</th>\n <th>${i18next.t('field.tax invoice day')}</th>\n <th>${i18next.t('field.tax invoice item name')}</th>\n <th>${i18next.t('field.tax invoice ea')}</th>\n <th>${i18next.t('field.tax invoice quantity')}</th>\n <th>${i18next.t('field.tax invoice price')}</th>\n <th>${i18next.t('field.supply amount')}</th>\n <th>${i18next.t('field.tax amount')}</th>\n <th>${i18next.t('field.remark0')}</th>\n </tr>\n\n ${this.detail.taxInvoiceItems?.map(\n item =>\n html`\n <tr>\n <td>${item.supplyDate.split('-')[1]}</td>\n <td>${item.supplyDate.split('-')[2]}</td>\n <td>${item.itemName}</td>\n <td>${item.specification}</td>\n <td>${item.quantity}</td>\n <td>${this._numberFormat(item.unitPrice)}</td>\n <td>${this._numberFormat(item.supplyPrice)}</td>\n <td>${this._numberFormat(item.taxPrice)}</td>\n <td>${item.remark}</td>\n </tr>\n `\n )}\n </table>\n </div>\n\n <div class=\"summary\">\n <table>\n <colgroup>\n <col width=\"20%\" />\n <col width=\"20%\" />\n <col width=\"20%\" />\n <col width=\"20%\" />\n <col width=\"20%\" />\n </colgroup>\n <tr>\n <th>${i18next.t('field.total amount')}</th>\n <th>${i18next.t('field.tax invoice payment cash')}</th>\n <th>${i18next.t('field.tax invoice payment check')}</th>\n <th>${i18next.t('field.tax invoice payment promissory note')}</th>\n <th>${i18next.t('field.tax invoice payment accounts receivable')}</th>\n </tr>\n <tr>\n <td>${this._numberFormat(this.detail.totalAmount)}</td>\n <td>${this._numberFormat(this.detail.paymentAmountCash)}</td>\n <td>${this._numberFormat(this.detail.paymentAmountCheck)}</td>\n <td>${this._numberFormat(this.detail.paymentAmountPromissoryNote)}</td>\n <td>${this._numberFormat(this.detail.paymentAmountAccountsReceivable)}</td>\n </tr>\n </table>\n <div>${i18next.t('text.tax invoice description payment', { value: i18next.t(`text.tax invoice description purpose ${this.detail.purpose}`) })}</div>\n </div>\n </div>\n `\n }\n\n async updated(changed) {\n if (changed.has('taxInvoiceId')) {\n this.detail = await this.getTaxInvoiceDetailById(this.taxInvoiceId)\n }\n }\n\n private async getTaxInvoiceDetailById(id: string) {\n if (!id) return {}\n\n const response = await client.query({\n query: gql`\n query ($id: String!) {\n responses: taxInvoice(id: $id) {\n id\n name\n category\n approvalNo\n originalApprovalNo\n issueDate\n signatureDate\n invoiceType\n purpose\n revisedReason\n remark0\n remark1\n remark2\n supplierBusinessRegistrationCategory\n supplierBusinessRegistrationNumber\n supplierBranchIdentification\n supplierBusinessName\n supplierRepresentativeName\n supplierAddress\n supplierBusinessType\n supplierIndustryType\n supplierDepartment\n supplierContactName\n supplierContactPhone\n supplierContactEmail\n supplierContactCellPhone\n buyerBusinessRegistrationCategory\n buyerBusinessRegistrationNumber\n buyerBranchIdentification\n buyerBusinessName\n buyerRepresentativeName\n buyerAddress\n buyerBusinessType\n buyerIndustryType\n buyer1stDepartment\n buyer1stContactName\n buyer1stContactPhone\n buyer1stContactEmail\n buyer1stContactCellPhone\n buyer2ndDepartment\n buyer2ndContactName\n buyer2ndContactPhone\n buyer2ndContactEmail\n buyer2ndContactCellPhone\n agentBusinessRegistrationCategory\n agentBusinessRegistrationNumber\n agentBranchIdentification\n agentBusinessName\n agentRepresentativeName\n agentAddress\n agentBusinessType\n agentIndustryType\n agentDepartment\n agentContactName\n agentContactPhone\n agentContactEmail\n agentContactCellPhone\n paymentAmountCash\n paymentAmountCheck\n paymentAmountPromissoryNote\n paymentAmountAccountsReceivable\n supplyAmount\n taxAmount\n totalAmount\n createdAt\n updater {\n id\n name\n }\n updatedAt\n\n taxInvoiceItems {\n id\n sequence\n supplyDate\n itemName\n specification\n quantity\n unitPrice\n supplyPrice\n taxPrice\n remark\n }\n }\n }\n `,\n variables: { id }\n })\n\n return response.data.responses || {}\n }\n\n private _numberFormat(value: number): string {\n return !value ? '' : new Intl.NumberFormat('en-US').format(value)\n }\n}\n"]}
@@ -385,7 +385,7 @@ let TaxInvoiceListPage = class TaxInvoiceListPage extends localize(i18next)(Scop
385
385
  const taxAmount = supplyAmount / 10;
386
386
  const taxInvoice = {
387
387
  name: '설명' + num.repeat(3),
388
- category: 10,
388
+ category: '10',
389
389
  approvalNo: year + month + day + '-' + firstWordOfNum.repeat(8) + '-' + firstWordOfNum.repeat(8),
390
390
  issueDate: `${year}-${month}-${day}`,
391
391
  signatureDate: `${year}-${month}-${Number(day) + 1}`,
@@ -429,16 +429,41 @@ let TaxInvoiceListPage = class TaxInvoiceListPage extends localize(i18next)(Scop
429
429
  taxAmount: taxAmount,
430
430
  totalAmount: supplyAmount + taxAmount
431
431
  };
432
+ const taxInvoiceItems = [
433
+ {
434
+ sequence: 1,
435
+ supplyDate: `${year}-${month}-${day}`,
436
+ itemName: '아이템01',
437
+ specification: 'EA',
438
+ quantity: 1,
439
+ unitPrice: 100000,
440
+ supplyPrice: 100000,
441
+ taxPrice: 10000,
442
+ remark: '아이템 비고 01'
443
+ },
444
+ {
445
+ sequence: 2,
446
+ supplyDate: `${year}-${month}-${Number(day) + 1}`,
447
+ itemName: '아이템02',
448
+ specification: 'EA',
449
+ quantity: 2,
450
+ unitPrice: 100000,
451
+ supplyPrice: 200000,
452
+ taxPrice: 20000,
453
+ remark: '아이템 비고 02'
454
+ }
455
+ ];
432
456
  const response = await client.mutate({
433
457
  mutation: gql `
434
- mutation CreateTaxInvoice($taxInvoice: NewTaxInvoice!) {
435
- createTaxInvoice(taxInvoice: $taxInvoice) {
458
+ mutation CreateTaxInvoice($taxInvoice: NewTaxInvoice!, $taxInvoiceItems: [NewTaxInvoiceItem!]!) {
459
+ createTaxInvoice(taxInvoice: $taxInvoice, taxInvoiceItems: $taxInvoiceItems) {
436
460
  id
437
461
  }
438
462
  }
439
463
  `,
440
464
  variables: {
441
- taxInvoice
465
+ taxInvoice,
466
+ taxInvoiceItems
442
467
  }
443
468
  });
444
469
  if (!response.errors) {
@@ -1 +1 @@
1
- {"version":3,"file":"tax-invoice-list-page.js","sourceRoot":"","sources":["../../../client/pages/tax-invoice/tax-invoice-list-page.ts"],"names":[],"mappings":";AAAA,OAAO,qBAAqB,CAAA;AAE5B,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACxF,OAAO,EAAE,QAAQ,EAAmB,MAAM,gBAAgB,CAAA;AAC1D,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAgB,SAAS,EAA+B,MAAM,qBAAqB,CAAA;AAC1F,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EAAW,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,OAAO,4BAA4B,CAAA;AAEnC,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,IAAI;IACV,IAA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AAe,CAAC,EAAU;QAChC,SAAS,CAAC,IAAI,CAAA,4CAA4C,EAAE,+BAA+B,EAAE;YAC3F,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,0BAA0B,CAAC;SAC7C,CAAC,CAAA;IACJ,CAAC;;AAndM,yBAAM,GAAG;IACd,eAAe;IACf,iBAAiB;IACjB,GAAG,CAAA;;;;;;;;;KASF;CACF,CAAA;AAED;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;uDAAiB;AAC5C;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;gDAAoE;AAE/F;IAAC,KAAK,CAAC,UAAU,CAAC;8BAAiB,SAAS;iDAAA;AAnBjC,kBAAkB;IAD9B,aAAa,CAAC,uBAAuB,CAAC;GAC1B,kBAAkB,CAqd9B;SArdY,kBAAkB","sourcesContent":["import '@operato/data-grist'\n\nimport { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'\nimport { PageView, navigate, store } from '@operato/shell'\nimport { css, html } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { ScopedElementsMixin } from '@open-wc/scoped-elements'\nimport { ColumnConfig, DataGrist, FetchOption, SortersControl } from '@operato/data-grist'\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { notify, openPopup } from '@operato/layout'\nimport { OxPopup, OxPrompt } from '@operato/popup'\nimport { isMobileDevice } from '@operato/utils'\nimport gql from 'graphql-tag'\n\nimport './tax-invoice-detail-popup'\n\nexport const CATEGORY = {\n '10': '매출',\n '20': '매입',\n '30': 'NTS'\n}\n\nexport const INVOICE_TYPE = {\n '0101': '일반 세금계산서',\n '0102': '영세율 세금계산서',\n '0103': '위수탁 세금계산서',\n '0105': '영세율 위수탁 세금계산서',\n '0201': '수정 일반 세금계산서',\n '0202': '수정 영세율 세금계산서',\n '0203': '수정 위수탁 세금계산서',\n '0204': '수정 수입 세금계산서',\n '0205': '수정 영세율 위수탁 세금계산서',\n '0301': '일반 계산서',\n '0303': '위수탁 계산서',\n '0304': '수입 계산서',\n '0401': '수정 일반 계산서',\n '0403': '수정 위수탁 계산서',\n '0404': '정 수입 계산서'\n}\n\nexport const PURPOSE = {\n '01': '영수',\n '02': '청구'\n}\n\n@customElement('tax-invoice-list-page')\nexport class TaxInvoiceListPage extends localize(i18next)(ScopedElementsMixin(PageView)) {\n static styles = [\n ScrollbarStyles,\n CommonGristStyles,\n css`\n :host {\n display: flex;\n\n width: 100%;\n\n --grid-record-emphasized-background-color: red;\n --grid-record-emphasized-color: yellow;\n }\n `\n ]\n\n @property({ type: Object }) gristConfig: any\n @property({ type: String }) mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'\n\n @query('ox-grist') private grist!: DataGrist\n\n get context() {\n return {\n title: i18next.t('title.tax invoice list'),\n help: 'tax-invoice/tax-invoice',\n actions: [\n {\n title: i18next.t('button.delete'),\n action: this._deleteTaxInvoice.bind(this),\n ...CommonButtonStyles.delete\n }\n ],\n exportable: {\n name: i18next.t('title.tax invoice list'),\n data: this.exportHandler.bind(this),\n accept: ['xlsx']\n }\n }\n }\n\n render() {\n const mode = 'GRID'\n\n return html`\n <ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>\n <div slot=\"headroom\">\n <div id=\"filters\">\n <ox-filters-form autofocus></ox-filters-form>\n </div>\n </div>\n </ox-grist>\n `\n // <button @click=${() => this.createTaxInvoice('3')}>생성</button>\n }\n\n async pageInitialized(lifecycle: any) {\n this.gristConfig = {\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n { type: 'gutter', gutterName: 'row-selector', multiple: true },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'reorder',\n handlers: {\n click: (columns, data, column, record, rowIndex) => {\n this.openDetailPopup(record.id)\n }\n }\n },\n {\n type: 'string',\n name: 'name',\n header: i18next.t('field.name'),\n record: {\n editable: true\n },\n filter: 'search',\n width: 150\n },\n {\n type: 'string',\n name: 'category',\n header: i18next.t('field.tax invoice category'),\n record: {\n renderer: value => CATEGORY[value],\n align: 'center'\n },\n width: 80\n },\n {\n type: 'date',\n name: 'issueDate',\n header: i18next.t('field.issue date'),\n record: {\n align: 'center'\n },\n filter: {\n type: 'date',\n operator: 'between'\n },\n width: 120\n },\n {\n type: 'date',\n name: 'signatureDate',\n header: i18next.t('field.signature date'),\n record: {\n align: 'center'\n },\n width: 120\n },\n {\n type: 'string',\n name: 'supplierBusinessRegistrationNumber',\n header: i18next.t('field.supplier business registration number'),\n record: {\n align: 'center'\n },\n width: 150\n },\n {\n type: 'string',\n name: 'supplierBusinessName',\n header: i18next.t('field.supplier business name'),\n record: {\n align: 'center'\n },\n width: 140\n },\n {\n type: 'string',\n name: 'supplierRepresentativeName',\n header: i18next.t('field.supplier representative name'),\n record: {\n align: 'center'\n },\n width: 120\n },\n {\n type: 'number',\n name: 'totalAmount',\n header: i18next.t('field.total amount'),\n record: {\n renderer: value => value && new Intl.NumberFormat('en-US').format(value),\n align: 'center'\n },\n width: 90\n },\n {\n type: 'number',\n name: 'supplyAmount',\n header: i18next.t('field.supply amount'),\n record: {\n renderer: value => value && new Intl.NumberFormat('en-US').format(value),\n align: 'center'\n },\n width: 90\n },\n {\n type: 'number',\n name: 'taxAmount',\n header: i18next.t('field.tax amount'),\n record: {\n renderer: value => value && new Intl.NumberFormat('en-US').format(value),\n align: 'center'\n },\n width: 90\n },\n {\n type: 'string',\n name: 'approvalNo',\n header: i18next.t('field.approval no'),\n record: {\n align: 'center'\n },\n width: 200\n },\n {\n type: 'string',\n name: 'invoiceType',\n header: i18next.t('field.invoice type'),\n record: {\n renderer: value => INVOICE_TYPE[value],\n align: 'center'\n },\n width: 130\n },\n {\n type: 'string',\n name: 'remark0',\n header: i18next.t('field.remark0'),\n record: {\n align: 'center'\n },\n width: 80\n },\n {\n type: 'string',\n name: 'purpose',\n header: i18next.t('field.purpose'),\n record: {\n renderer: value => PURPOSE[value],\n align: 'center'\n },\n width: 80\n },\n {\n type: 'string',\n name: 'supplierContactEmail',\n header: i18next.t('field.supplier contact email'),\n record: {\n align: 'center'\n },\n width: 140\n },\n {\n type: 'string',\n name: 'buyer1stContactEmail',\n header: i18next.t('field.buyer 1st contact email'),\n record: {\n align: 'center'\n },\n width: 140\n },\n {\n type: 'string',\n name: 'buyer2ndContactEmail',\n header: i18next.t('field.buyer 2nd contact email'),\n record: {\n align: 'center'\n },\n width: 140\n }\n ],\n rows: {\n selectable: {\n multiple: true\n },\n appendable: false\n },\n sorters: [\n {\n name: 'issueDate'\n }\n ]\n }\n }\n\n async pageUpdated(changes: any, lifecycle: any) {\n if (this.active) {\n // do something here when this page just became as active\n }\n }\n\n async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }: FetchOption) {\n const response = await client.query({\n query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {\n responses: taxInvoices(filters: $filters, pagination: $pagination, sortings: $sortings) {\n items {\n id\n name\n category\n issueDate\n signatureDate\n supplierBusinessRegistrationNumber\n supplierBusinessName\n supplierRepresentativeName\n totalAmount\n supplyAmount\n taxAmount\n approvalNo\n invoiceType\n remark0\n purpose\n supplierContactEmail\n buyer1stContactEmail\n buyer2ndContactEmail\n updater {\n id\n name\n }\n updatedAt\n }\n total\n }\n }\n `,\n variables: {\n filters,\n pagination: { page, limit },\n sortings\n }\n })\n\n return {\n total: response.data.responses.total || 0,\n records: response.data.responses.items || []\n }\n }\n\n async _deleteTaxInvoice() {\n if (\n await OxPrompt.open({\n title: i18next.t('text.are_you_sure'),\n text: i18next.t('text.sure_to_x', { x: i18next.t('text.delete') }),\n confirmButton: { text: i18next.t('button.confirm') },\n cancelButton: { text: i18next.t('button.cancel') }\n })\n ) {\n const ids = this.grist.selected.map(record => record.id)\n if (ids && ids.length > 0) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($ids: [String!]!) {\n deleteTaxInvoices(ids: $ids)\n }\n `,\n variables: {\n ids\n }\n })\n\n if (!response.errors) {\n this.grist.fetch()\n notify({\n message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') })\n })\n }\n }\n }\n }\n\n async _updateTaxInvoice() {\n let patches = this.grist.dirtyRecords\n if (patches && patches.length) {\n patches = patches.map(patch => {\n let patchField: any = patch.id ? { id: patch.id } : {}\n const dirtyFields = patch.__dirtyfields__\n for (let key in dirtyFields) {\n patchField[key] = dirtyFields[key].after\n }\n patchField.cuFlag = patch.__dirty__\n\n return patchField\n })\n\n const response = await client.mutate({\n mutation: gql`\n mutation ($patches: [TaxInvoicePatch!]!) {\n updateMultipleTaxInvoice(patches: $patches) {\n id\n }\n }\n `,\n variables: {\n patches\n }\n })\n\n if (!response.errors) {\n this.grist.fetch()\n notify({ message: i18next.t('text.info_x_successfully', { x: i18next.t('text.save') }) })\n } else {\n notify({ message: i18next.t('error.fail-save'), level: 'error' })\n }\n }\n }\n\n async createTaxInvoice(num: string) {\n const year = '2024'\n const month = '01'\n const day = '02'\n const firstWordOfNum = num.slice(0, 1)\n const firstWordOfNumNext = String(Number(num.slice(0, 1)) + 1).slice(0, 1)\n const supplyAmount = 1000000 * Number(firstWordOfNum)\n const taxAmount = supplyAmount / 10\n\n const taxInvoice = {\n name: '설명' + num.repeat(3),\n category: 10,\n approvalNo: year + month + day + '-' + firstWordOfNum.repeat(8) + '-' + firstWordOfNum.repeat(8),\n issueDate: `${year}-${month}-${day}`,\n signatureDate: `${year}-${month}-${Number(day) + 1}`,\n invoiceType: '0101',\n purpose: '02',\n remark0: '비고' + num.repeat(3),\n supplierBusinessRegistrationCategory: '01',\n supplierBusinessRegistrationNumber: `${firstWordOfNum.repeat(3)}-${firstWordOfNum.repeat(2)}-${firstWordOfNum.repeat(5)}`,\n supplierBusinessName: '공급자 회사명' + firstWordOfNum.repeat(3),\n supplierRepresentativeName: '공급자 대표자' + firstWordOfNum.repeat(3),\n supplierAddress: '공급자 주소' + firstWordOfNum.repeat(3),\n supplierBusinessType: '공급자 업태' + firstWordOfNum.repeat(3),\n supplierIndustryType: '공급자 업종' + firstWordOfNum.repeat(3),\n supplierDepartment: '공급자 담당 부서' + firstWordOfNum.repeat(3),\n supplierContactName: '공급자 담당자명' + firstWordOfNum.repeat(3),\n supplierContactPhone: `010-${firstWordOfNum.repeat(4)}-${firstWordOfNum.repeat(4)}`,\n supplierContactEmail: '공급자 담당자 이메일' + firstWordOfNum.repeat(3),\n supplierContactCellPhone: '공급자 핸드폰 번호' + firstWordOfNum.repeat(3),\n\n buyerBusinessRegistrationCategory: '01',\n buyerBusinessRegistrationNumber: `${firstWordOfNumNext.repeat(3)}-${firstWordOfNumNext.repeat(2)}-${firstWordOfNumNext.repeat(5)}`,\n buyerBusinessName: '공급자 회사명' + firstWordOfNum.repeat(3),\n buyerRepresentativeName: '공급자 대표자' + firstWordOfNum.repeat(3),\n buyerAddress: '공급자 주소' + firstWordOfNum.repeat(3),\n buyerBusinessType: '공급자 업태' + firstWordOfNum.repeat(3),\n buyerIndustryType: '공급자 업종' + firstWordOfNum.repeat(3),\n buyer1stDepartment: '공급자 담당 부서 1st' + firstWordOfNum.repeat(3),\n buyer1stContactName: '공급자 담당자명 1st' + firstWordOfNum.repeat(3),\n buyer1stContactPhone: `011-${firstWordOfNumNext.repeat(4)}-${firstWordOfNumNext.repeat(4)}`,\n buyer1stContactEmail: '공급자 담당자 이메일 1st' + firstWordOfNum.repeat(3),\n buyer1stContactCellPhone: '공급자 핸드폰 번호 1st' + firstWordOfNum.repeat(3),\n buyer2ndDepartment: '공급자 담당 부서 2nd' + firstWordOfNum.repeat(3),\n buyer2ndContactName: '공급자 담당자명 2nd' + firstWordOfNum.repeat(3),\n buyer2ndContactPhone: `022-${firstWordOfNumNext.repeat(4)}-${firstWordOfNumNext.repeat(4)}`,\n buyer2ndContactEmail: '공급자 담당자 이메일 2nd' + firstWordOfNum.repeat(3),\n buyer2ndContactCellPhone: '공급자 핸드폰 번호 2nd' + firstWordOfNum.repeat(3),\n\n paymentAmountCash: 0,\n paymentAmountCheck: 0,\n paymentAmountPromissoryNote: 0,\n paymentAmountAccountsReceivable: 0,\n supplyAmount: supplyAmount,\n taxAmount: taxAmount,\n totalAmount: supplyAmount + taxAmount\n }\n const response = await client.mutate({\n mutation: gql`\n mutation CreateTaxInvoice($taxInvoice: NewTaxInvoice!) {\n createTaxInvoice(taxInvoice: $taxInvoice) {\n id\n }\n }\n `,\n variables: {\n taxInvoice\n }\n })\n\n if (!response.errors) {\n this.grist.fetch()\n notify({\n message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') })\n })\n }\n }\n\n async exportHandler() {\n const exportTargets = this.grist.selected.length ? this.grist.selected : this.grist.dirtyData.records\n const targetFieldSet = new Set(['id', 'name'])\n\n return exportTargets.map(taxInvoice => {\n let tempObj = {}\n for (const field of targetFieldSet) {\n tempObj[field] = taxInvoice[field]\n }\n\n return tempObj\n })\n }\n\n private openDetailPopup(id: string) {\n openPopup(html` <tax-invoice-detail-popup .taxInvoiceId=${id}> </tax-invoice-detail-popup>`, {\n backdrop: true,\n size: 'large',\n title: i18next.t('title.tax invoice detail')\n })\n }\n}\n"]}
1
+ {"version":3,"file":"tax-invoice-list-page.js","sourceRoot":"","sources":["../../../client/pages/tax-invoice/tax-invoice-list-page.ts"],"names":[],"mappings":";AAAA,OAAO,qBAAqB,CAAA;AAE5B,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACxF,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAE,SAAS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OAAO,CAAC,CAAC,CAAC,0BAA0B,CAAC;SAC7C,CAAC,CAAA;IACJ,CAAC;;AA9eM,yBAAM,GAAG;IACd,eAAe;IACf,iBAAiB;IACjB,GAAG,CAAA;;;;;;;;;KASF;CACF,CAAA;AAED;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;uDAAiB;AAC5C;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;gDAAoE;AAE/F;IAAC,KAAK,CAAC,UAAU,CAAC;8BAAiB,SAAS;iDAAA;AAnBjC,kBAAkB;IAD9B,aAAa,CAAC,uBAAuB,CAAC;GAC1B,kBAAkB,CAgf9B;SAhfY,kBAAkB","sourcesContent":["import '@operato/data-grist'\n\nimport { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'\nimport { PageView } from '@operato/shell'\nimport { css, html } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { ScopedElementsMixin } from '@open-wc/scoped-elements'\nimport { DataGrist, FetchOption } from '@operato/data-grist'\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { notify, openPopup } from '@operato/layout'\nimport { OxPrompt } from '@operato/popup'\nimport { isMobileDevice } from '@operato/utils'\nimport gql from 'graphql-tag'\n\nimport './tax-invoice-detail-popup'\n\nexport const CATEGORY = {\n '10': '매출',\n '20': '매입',\n '30': 'NTS'\n}\n\nexport const INVOICE_TYPE = {\n '0101': '일반 세금계산서',\n '0102': '영세율 세금계산서',\n '0103': '위수탁 세금계산서',\n '0105': '영세율 위수탁 세금계산서',\n '0201': '수정 일반 세금계산서',\n '0202': '수정 영세율 세금계산서',\n '0203': '수정 위수탁 세금계산서',\n '0204': '수정 수입 세금계산서',\n '0205': '수정 영세율 위수탁 세금계산서',\n '0301': '일반 계산서',\n '0303': '위수탁 계산서',\n '0304': '수입 계산서',\n '0401': '수정 일반 계산서',\n '0403': '수정 위수탁 계산서',\n '0404': '정 수입 계산서'\n}\n\nexport const PURPOSE = {\n '01': '영수',\n '02': '청구'\n}\n\n@customElement('tax-invoice-list-page')\nexport class TaxInvoiceListPage extends localize(i18next)(ScopedElementsMixin(PageView)) {\n static styles = [\n ScrollbarStyles,\n CommonGristStyles,\n css`\n :host {\n display: flex;\n\n width: 100%;\n\n --grid-record-emphasized-background-color: red;\n --grid-record-emphasized-color: yellow;\n }\n `\n ]\n\n @property({ type: Object }) gristConfig: any\n @property({ type: String }) mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'\n\n @query('ox-grist') private grist!: DataGrist\n\n get context() {\n return {\n title: i18next.t('title.tax invoice list'),\n help: 'tax-invoice/tax-invoice',\n actions: [\n {\n title: i18next.t('button.delete'),\n action: this._deleteTaxInvoice.bind(this),\n ...CommonButtonStyles.delete\n }\n ],\n exportable: {\n name: i18next.t('title.tax invoice list'),\n data: this.exportHandler.bind(this),\n accept: ['xlsx']\n }\n }\n }\n\n render() {\n const mode = 'GRID'\n\n return html`\n <ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>\n <div slot=\"headroom\">\n <div id=\"filters\">\n <ox-filters-form autofocus></ox-filters-form>\n </div>\n </div>\n </ox-grist>\n `\n // <button @click=${() => this.createTaxInvoice('3')}>생성</button>\n }\n\n async pageInitialized(lifecycle: any) {\n this.gristConfig = {\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n { type: 'gutter', gutterName: 'row-selector', multiple: true },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'reorder',\n handlers: {\n click: (columns, data, column, record, rowIndex) => {\n this.openDetailPopup(record.id)\n }\n }\n },\n {\n type: 'string',\n name: 'name',\n header: i18next.t('field.name'),\n record: {\n editable: true\n },\n filter: 'search',\n width: 150\n },\n {\n type: 'string',\n name: 'category',\n header: i18next.t('field.tax invoice category'),\n record: {\n renderer: value => CATEGORY[value],\n align: 'center'\n },\n width: 80\n },\n {\n type: 'date',\n name: 'issueDate',\n header: i18next.t('field.issue date'),\n record: {\n align: 'center'\n },\n filter: {\n type: 'date',\n operator: 'between'\n },\n width: 120\n },\n {\n type: 'date',\n name: 'signatureDate',\n header: i18next.t('field.signature date'),\n record: {\n align: 'center'\n },\n width: 120\n },\n {\n type: 'string',\n name: 'supplierBusinessRegistrationNumber',\n header: i18next.t('field.supplier business registration number'),\n record: {\n align: 'center'\n },\n width: 150\n },\n {\n type: 'string',\n name: 'supplierBusinessName',\n header: i18next.t('field.supplier business name'),\n record: {\n align: 'center'\n },\n width: 140\n },\n {\n type: 'string',\n name: 'supplierRepresentativeName',\n header: i18next.t('field.supplier representative name'),\n record: {\n align: 'center'\n },\n width: 120\n },\n {\n type: 'number',\n name: 'totalAmount',\n header: i18next.t('field.total amount'),\n record: {\n renderer: value => value && new Intl.NumberFormat('en-US').format(value),\n align: 'center'\n },\n width: 90\n },\n {\n type: 'number',\n name: 'supplyAmount',\n header: i18next.t('field.supply amount'),\n record: {\n renderer: value => value && new Intl.NumberFormat('en-US').format(value),\n align: 'center'\n },\n width: 90\n },\n {\n type: 'number',\n name: 'taxAmount',\n header: i18next.t('field.tax amount'),\n record: {\n renderer: value => value && new Intl.NumberFormat('en-US').format(value),\n align: 'center'\n },\n width: 90\n },\n {\n type: 'string',\n name: 'approvalNo',\n header: i18next.t('field.approval no'),\n record: {\n align: 'center'\n },\n width: 200\n },\n {\n type: 'string',\n name: 'invoiceType',\n header: i18next.t('field.invoice type'),\n record: {\n renderer: value => INVOICE_TYPE[value],\n align: 'center'\n },\n width: 130\n },\n {\n type: 'string',\n name: 'remark0',\n header: i18next.t('field.remark0'),\n record: {\n align: 'center'\n },\n width: 80\n },\n {\n type: 'string',\n name: 'purpose',\n header: i18next.t('field.purpose'),\n record: {\n renderer: value => PURPOSE[value],\n align: 'center'\n },\n width: 80\n },\n {\n type: 'string',\n name: 'supplierContactEmail',\n header: i18next.t('field.supplier contact email'),\n record: {\n align: 'center'\n },\n width: 140\n },\n {\n type: 'string',\n name: 'buyer1stContactEmail',\n header: i18next.t('field.buyer 1st contact email'),\n record: {\n align: 'center'\n },\n width: 140\n },\n {\n type: 'string',\n name: 'buyer2ndContactEmail',\n header: i18next.t('field.buyer 2nd contact email'),\n record: {\n align: 'center'\n },\n width: 140\n }\n ],\n rows: {\n selectable: {\n multiple: true\n },\n appendable: false\n },\n sorters: [\n {\n name: 'issueDate'\n }\n ]\n }\n }\n\n async pageUpdated(changes: any, lifecycle: any) {\n if (this.active) {\n // do something here when this page just became as active\n }\n }\n\n async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }: FetchOption) {\n const response = await client.query({\n query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {\n responses: taxInvoices(filters: $filters, pagination: $pagination, sortings: $sortings) {\n items {\n id\n name\n category\n issueDate\n signatureDate\n supplierBusinessRegistrationNumber\n supplierBusinessName\n supplierRepresentativeName\n totalAmount\n supplyAmount\n taxAmount\n approvalNo\n invoiceType\n remark0\n purpose\n supplierContactEmail\n buyer1stContactEmail\n buyer2ndContactEmail\n updater {\n id\n name\n }\n updatedAt\n }\n total\n }\n }\n `,\n variables: {\n filters,\n pagination: { page, limit },\n sortings\n }\n })\n\n return {\n total: response.data.responses.total || 0,\n records: response.data.responses.items || []\n }\n }\n\n async _deleteTaxInvoice() {\n if (\n await OxPrompt.open({\n title: i18next.t('text.are_you_sure'),\n text: i18next.t('text.sure_to_x', { x: i18next.t('text.delete') }),\n confirmButton: { text: i18next.t('button.confirm') },\n cancelButton: { text: i18next.t('button.cancel') }\n })\n ) {\n const ids = this.grist.selected.map(record => record.id)\n if (ids && ids.length > 0) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($ids: [String!]!) {\n deleteTaxInvoices(ids: $ids)\n }\n `,\n variables: {\n ids\n }\n })\n\n if (!response.errors) {\n this.grist.fetch()\n notify({\n message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') })\n })\n }\n }\n }\n }\n\n async _updateTaxInvoice() {\n let patches = this.grist.dirtyRecords\n if (patches && patches.length) {\n patches = patches.map(patch => {\n let patchField: any = patch.id ? { id: patch.id } : {}\n const dirtyFields = patch.__dirtyfields__\n for (let key in dirtyFields) {\n patchField[key] = dirtyFields[key].after\n }\n patchField.cuFlag = patch.__dirty__\n\n return patchField\n })\n\n const response = await client.mutate({\n mutation: gql`\n mutation ($patches: [TaxInvoicePatch!]!) {\n updateMultipleTaxInvoice(patches: $patches) {\n id\n }\n }\n `,\n variables: {\n patches\n }\n })\n\n if (!response.errors) {\n this.grist.fetch()\n notify({ message: i18next.t('text.info_x_successfully', { x: i18next.t('text.save') }) })\n } else {\n notify({ message: i18next.t('error.fail-save'), level: 'error' })\n }\n }\n }\n\n async createTaxInvoice(num: string) {\n const year = '2024'\n const month = '01'\n const day = '02'\n const firstWordOfNum = num.slice(0, 1)\n const firstWordOfNumNext = String(Number(num.slice(0, 1)) + 1).slice(0, 1)\n const supplyAmount = 1000000 * Number(firstWordOfNum)\n const taxAmount = supplyAmount / 10\n\n const taxInvoice = {\n name: '설명' + num.repeat(3),\n category: '10',\n approvalNo: year + month + day + '-' + firstWordOfNum.repeat(8) + '-' + firstWordOfNum.repeat(8),\n issueDate: `${year}-${month}-${day}`,\n signatureDate: `${year}-${month}-${Number(day) + 1}`,\n invoiceType: '0101',\n purpose: '02',\n remark0: '비고' + num.repeat(3),\n supplierBusinessRegistrationCategory: '01',\n supplierBusinessRegistrationNumber: `${firstWordOfNum.repeat(3)}-${firstWordOfNum.repeat(2)}-${firstWordOfNum.repeat(5)}`,\n supplierBusinessName: '공급자 회사명' + firstWordOfNum.repeat(3),\n supplierRepresentativeName: '공급자 대표자' + firstWordOfNum.repeat(3),\n supplierAddress: '공급자 주소' + firstWordOfNum.repeat(3),\n supplierBusinessType: '공급자 업태' + firstWordOfNum.repeat(3),\n supplierIndustryType: '공급자 업종' + firstWordOfNum.repeat(3),\n supplierDepartment: '공급자 담당 부서' + firstWordOfNum.repeat(3),\n supplierContactName: '공급자 담당자명' + firstWordOfNum.repeat(3),\n supplierContactPhone: `010-${firstWordOfNum.repeat(4)}-${firstWordOfNum.repeat(4)}`,\n supplierContactEmail: '공급자 담당자 이메일' + firstWordOfNum.repeat(3),\n supplierContactCellPhone: '공급자 핸드폰 번호' + firstWordOfNum.repeat(3),\n\n buyerBusinessRegistrationCategory: '01',\n buyerBusinessRegistrationNumber: `${firstWordOfNumNext.repeat(3)}-${firstWordOfNumNext.repeat(2)}-${firstWordOfNumNext.repeat(5)}`,\n buyerBusinessName: '공급자 회사명' + firstWordOfNum.repeat(3),\n buyerRepresentativeName: '공급자 대표자' + firstWordOfNum.repeat(3),\n buyerAddress: '공급자 주소' + firstWordOfNum.repeat(3),\n buyerBusinessType: '공급자 업태' + firstWordOfNum.repeat(3),\n buyerIndustryType: '공급자 업종' + firstWordOfNum.repeat(3),\n buyer1stDepartment: '공급자 담당 부서 1st' + firstWordOfNum.repeat(3),\n buyer1stContactName: '공급자 담당자명 1st' + firstWordOfNum.repeat(3),\n buyer1stContactPhone: `011-${firstWordOfNumNext.repeat(4)}-${firstWordOfNumNext.repeat(4)}`,\n buyer1stContactEmail: '공급자 담당자 이메일 1st' + firstWordOfNum.repeat(3),\n buyer1stContactCellPhone: '공급자 핸드폰 번호 1st' + firstWordOfNum.repeat(3),\n buyer2ndDepartment: '공급자 담당 부서 2nd' + firstWordOfNum.repeat(3),\n buyer2ndContactName: '공급자 담당자명 2nd' + firstWordOfNum.repeat(3),\n buyer2ndContactPhone: `022-${firstWordOfNumNext.repeat(4)}-${firstWordOfNumNext.repeat(4)}`,\n buyer2ndContactEmail: '공급자 담당자 이메일 2nd' + firstWordOfNum.repeat(3),\n buyer2ndContactCellPhone: '공급자 핸드폰 번호 2nd' + firstWordOfNum.repeat(3),\n\n paymentAmountCash: 0,\n paymentAmountCheck: 0,\n paymentAmountPromissoryNote: 0,\n paymentAmountAccountsReceivable: 0,\n supplyAmount: supplyAmount,\n taxAmount: taxAmount,\n totalAmount: supplyAmount + taxAmount\n }\n\n const taxInvoiceItems = [\n {\n sequence: 1,\n supplyDate: `${year}-${month}-${day}`,\n itemName: '아이템01',\n specification: 'EA',\n quantity: 1,\n unitPrice: 100000,\n supplyPrice: 100000,\n taxPrice: 10000,\n remark: '아이템 비고 01'\n },\n {\n sequence: 2,\n supplyDate: `${year}-${month}-${Number(day) + 1}`,\n itemName: '아이템02',\n specification: 'EA',\n quantity: 2,\n unitPrice: 100000,\n supplyPrice: 200000,\n taxPrice: 20000,\n remark: '아이템 비고 02'\n }\n ]\n\n const response = await client.mutate({\n mutation: gql`\n mutation CreateTaxInvoice($taxInvoice: NewTaxInvoice!, $taxInvoiceItems: [NewTaxInvoiceItem!]!) {\n createTaxInvoice(taxInvoice: $taxInvoice, taxInvoiceItems: $taxInvoiceItems) {\n id\n }\n }\n `,\n variables: {\n taxInvoice,\n taxInvoiceItems\n }\n })\n\n if (!response.errors) {\n this.grist.fetch()\n notify({\n message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') })\n })\n }\n }\n\n async exportHandler() {\n const exportTargets = this.grist.selected.length ? this.grist.selected : this.grist.dirtyData.records\n const targetFieldSet = new Set(['id', 'name'])\n\n return exportTargets.map(taxInvoice => {\n let tempObj = {}\n for (const field of targetFieldSet) {\n tempObj[field] = taxInvoice[field]\n }\n\n return tempObj\n })\n }\n\n private openDetailPopup(id: string) {\n openPopup(html` <tax-invoice-detail-popup .taxInvoiceId=${id}> </tax-invoice-detail-popup>`, {\n backdrop: true,\n size: 'large',\n title: i18next.t('title.tax invoice detail')\n })\n }\n}\n"]}