@things-factory/tax-invoice 6.2.86 → 7.0.0-alpha.1
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.
- package/client/pages/tax-invoice/tax-invoice-detail-popup.ts +5 -6
- package/client/pages/tax-invoice/tax-invoice-list-page.ts +119 -169
- package/client/pages/tax-invoice-api/tax-invoice-api-page.ts +6 -5
- package/client/pages/tax-invoice-company/tax-invoice-company-importer.ts +2 -2
- package/client/route.ts +4 -4
- package/dist-client/pages/tax-invoice/tax-invoice-detail-popup.js +11 -9
- package/dist-client/pages/tax-invoice/tax-invoice-detail-popup.js.map +1 -1
- package/dist-client/pages/tax-invoice/tax-invoice-list-page.d.ts +47 -21
- package/dist-client/pages/tax-invoice/tax-invoice-list-page.js +121 -161
- package/dist-client/pages/tax-invoice/tax-invoice-list-page.js.map +1 -1
- package/dist-client/pages/tax-invoice-api/tax-invoice-api-page.d.ts +1 -1
- package/dist-client/pages/tax-invoice-api/tax-invoice-api-page.js +6 -5
- package/dist-client/pages/tax-invoice-api/tax-invoice-api-page.js.map +1 -1
- package/dist-client/pages/tax-invoice-company/tax-invoice-company-importer.js +2 -2
- package/dist-client/pages/tax-invoice-company/tax-invoice-company-importer.js.map +1 -1
- package/dist-client/route.d.ts +1 -1
- package/dist-client/route.js +3 -3
- package/dist-client/route.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/service/tax-invoice/tax-invoice-mutation.js +132 -27
- package/dist-server/service/tax-invoice/tax-invoice-mutation.js.map +1 -1
- package/dist-server/service/tax-invoice/tax-invoice-query.js +1 -1
- package/dist-server/service/tax-invoice/tax-invoice-query.js.map +1 -1
- package/dist-server/service/tax-invoice/tax-invoice-type.js +10 -258
- package/dist-server/service/tax-invoice/tax-invoice-type.js.map +1 -1
- package/dist-server/service/tax-invoice/tax-invoice.js +21 -15
- package/dist-server/service/tax-invoice/tax-invoice.js.map +1 -1
- package/dist-server/service/tax-invoice-api/tax-invoice-api-type.js +5 -0
- package/dist-server/service/tax-invoice-api/tax-invoice-api-type.js.map +1 -1
- package/dist-server/service/tax-invoice-item/tax-invoice-item-query.js.map +1 -1
- package/dist-server/service/tax-invoice-item/tax-invoice-item-type.js +4 -4
- package/dist-server/service/tax-invoice-item/tax-invoice-item-type.js.map +1 -1
- package/dist-server/service/tax-invoice-item/tax-invoice-item.js +3 -3
- package/dist-server/service/tax-invoice-item/tax-invoice-item.js.map +1 -1
- package/dist-server/service/unipost-api/tax-invoice-inquiry.js +90 -0
- package/dist-server/service/unipost-api/tax-invoice-inquiry.js.map +1 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/server/service/tax-invoice/tax-invoice-mutation.ts +137 -36
- package/server/service/tax-invoice/tax-invoice-query.ts +1 -1
- package/server/service/tax-invoice/tax-invoice-type.ts +9 -199
- package/server/service/tax-invoice/tax-invoice.ts +23 -30
- package/server/service/tax-invoice-api/tax-invoice-api-type.ts +4 -0
- package/server/service/tax-invoice-item/tax-invoice-item-query.ts +1 -1
- package/server/service/tax-invoice-item/tax-invoice-item-type.ts +4 -7
- package/server/service/tax-invoice-item/tax-invoice-item.ts +3 -3
- package/server/service/unipost-api/tax-invoice-inquiry.ts +103 -0
- package/translations/ko.json +9 -1
|
@@ -1 +1 @@
|
|
|
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,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AO,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;;AA1aM,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,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"]}
|
|
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,Q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;;;;OAuFT;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;;AAzaM,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,CA2ajC;SA3aY,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?.replace(/(\\d{8})(\\d{8})(\\d{8})/g, '$1-$2-$3')}</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?.replace(/(\\d{3})(\\d{2})(\\d{5})/g, '$1-$2-$3')}</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?.replace(/(\\d{3})(\\d{2})(\\d{5})/g, '$1-$2-$3')}</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?.split('T')[0]}</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]?.split('T')[0]}</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 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"]}
|
|
@@ -2,27 +2,49 @@ import '@operato/data-grist';
|
|
|
2
2
|
import { PageView } from '@operato/shell';
|
|
3
3
|
import { FetchOption } from '@operato/data-grist';
|
|
4
4
|
import './tax-invoice-detail-popup';
|
|
5
|
+
export declare enum Category {
|
|
6
|
+
EXPORT = "10",
|
|
7
|
+
IMPORT = "20",
|
|
8
|
+
NTS = "30"
|
|
9
|
+
}
|
|
5
10
|
export declare const CATEGORY: {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
11
|
+
10: string;
|
|
12
|
+
20: string;
|
|
13
|
+
30: string;
|
|
9
14
|
};
|
|
15
|
+
export declare enum InvoiceType {
|
|
16
|
+
'TAX_INVOICE' = "0101",
|
|
17
|
+
'SMALL_BUSINESS_TAX_INVOICE' = "0102",
|
|
18
|
+
'CONSIGNMENT_TAX_INVOICE' = "0103",
|
|
19
|
+
'SMALL_BUSINESS_CONSIGNMENT_TAX_INVOICE' = "0105",
|
|
20
|
+
'REVISED_TAX_INVOICE' = "0201",
|
|
21
|
+
'REVISED_SMALL_BUSINESS_TAX_INVOICE' = "0202",
|
|
22
|
+
'REVISED_CONSIGNMENT_TAX_INVOICE' = "0203",
|
|
23
|
+
'REVISED_IMPORT_TAX_INVOICE' = "0204",
|
|
24
|
+
'REVISED_SMALL_BUSINESS_CONSIGNMENT_TAX_INVOICE' = "0205",
|
|
25
|
+
'INVOICE' = "0301",
|
|
26
|
+
'CONSIGNMENT_INVOICE' = "0303",
|
|
27
|
+
'IMPORT_INVOICE' = "0304",
|
|
28
|
+
'REVISED_INVOICE' = "0401",
|
|
29
|
+
'REVISED_CONSIGNMENT_INVOICE' = "0403",
|
|
30
|
+
'REVISED_IMPORT_INVOICE' = "0404"
|
|
31
|
+
}
|
|
10
32
|
export declare const INVOICE_TYPE: {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
33
|
+
"0101": string;
|
|
34
|
+
"0102": string;
|
|
35
|
+
"0103": string;
|
|
36
|
+
"0105": string;
|
|
37
|
+
"0201": string;
|
|
38
|
+
"0202": string;
|
|
39
|
+
"0203": string;
|
|
40
|
+
"0204": string;
|
|
41
|
+
"0205": string;
|
|
42
|
+
"0301": string;
|
|
43
|
+
"0303": string;
|
|
44
|
+
"0304": string;
|
|
45
|
+
"0401": string;
|
|
46
|
+
"0403": string;
|
|
47
|
+
"0404": string;
|
|
26
48
|
};
|
|
27
49
|
export declare const PURPOSE: {
|
|
28
50
|
'01': string;
|
|
@@ -32,7 +54,12 @@ declare const TaxInvoiceListPage_base: (new (...args: any[]) => import("lit").Li
|
|
|
32
54
|
export declare class TaxInvoiceListPage extends TaxInvoiceListPage_base {
|
|
33
55
|
static styles: import("lit").CSSResult[];
|
|
34
56
|
gristConfig: any;
|
|
35
|
-
|
|
57
|
+
summary: {
|
|
58
|
+
count: number;
|
|
59
|
+
total: number;
|
|
60
|
+
supply: number;
|
|
61
|
+
tax: number;
|
|
62
|
+
} | null;
|
|
36
63
|
private grist;
|
|
37
64
|
get context(): {
|
|
38
65
|
title: string;
|
|
@@ -61,10 +88,9 @@ export declare class TaxInvoiceListPage extends TaxInvoiceListPage_base {
|
|
|
61
88
|
total: any;
|
|
62
89
|
records: any;
|
|
63
90
|
}>;
|
|
64
|
-
_deleteTaxInvoice(): Promise<void>;
|
|
65
91
|
_updateTaxInvoice(): Promise<void>;
|
|
66
|
-
createTaxInvoice(num: string): Promise<void>;
|
|
67
92
|
exportHandler(): Promise<{}[]>;
|
|
68
93
|
private openDetailPopup;
|
|
94
|
+
private _numberFormat;
|
|
69
95
|
}
|
|
70
96
|
export {};
|
|
@@ -3,37 +3,59 @@ import '@operato/data-grist';
|
|
|
3
3
|
import { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles';
|
|
4
4
|
import { PageView } from '@operato/shell';
|
|
5
5
|
import { css, html } from 'lit';
|
|
6
|
-
import { customElement, property, query } from 'lit/decorators.js';
|
|
6
|
+
import { customElement, property, state, query } from 'lit/decorators.js';
|
|
7
7
|
import { ScopedElementsMixin } from '@open-wc/scoped-elements';
|
|
8
8
|
import { DataGrist } 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 { OxPrompt } from '@operato/popup';
|
|
13
|
-
import { isMobileDevice } from '@operato/utils';
|
|
14
12
|
import gql from 'graphql-tag';
|
|
15
13
|
import './tax-invoice-detail-popup';
|
|
14
|
+
export var Category;
|
|
15
|
+
(function (Category) {
|
|
16
|
+
Category["EXPORT"] = "10";
|
|
17
|
+
Category["IMPORT"] = "20";
|
|
18
|
+
Category["NTS"] = "30"; // NTS
|
|
19
|
+
})(Category || (Category = {}));
|
|
16
20
|
export const CATEGORY = {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
21
|
+
[Category.EXPORT]: '매출',
|
|
22
|
+
[Category.IMPORT]: '매입',
|
|
23
|
+
[Category.NTS]: 'NTS'
|
|
20
24
|
};
|
|
25
|
+
export var InvoiceType;
|
|
26
|
+
(function (InvoiceType) {
|
|
27
|
+
InvoiceType["TAX_INVOICE"] = "0101";
|
|
28
|
+
InvoiceType["SMALL_BUSINESS_TAX_INVOICE"] = "0102";
|
|
29
|
+
InvoiceType["CONSIGNMENT_TAX_INVOICE"] = "0103";
|
|
30
|
+
InvoiceType["SMALL_BUSINESS_CONSIGNMENT_TAX_INVOICE"] = "0105";
|
|
31
|
+
InvoiceType["REVISED_TAX_INVOICE"] = "0201";
|
|
32
|
+
InvoiceType["REVISED_SMALL_BUSINESS_TAX_INVOICE"] = "0202";
|
|
33
|
+
InvoiceType["REVISED_CONSIGNMENT_TAX_INVOICE"] = "0203";
|
|
34
|
+
InvoiceType["REVISED_IMPORT_TAX_INVOICE"] = "0204";
|
|
35
|
+
InvoiceType["REVISED_SMALL_BUSINESS_CONSIGNMENT_TAX_INVOICE"] = "0205";
|
|
36
|
+
InvoiceType["INVOICE"] = "0301";
|
|
37
|
+
InvoiceType["CONSIGNMENT_INVOICE"] = "0303";
|
|
38
|
+
InvoiceType["IMPORT_INVOICE"] = "0304";
|
|
39
|
+
InvoiceType["REVISED_INVOICE"] = "0401";
|
|
40
|
+
InvoiceType["REVISED_CONSIGNMENT_INVOICE"] = "0403";
|
|
41
|
+
InvoiceType["REVISED_IMPORT_INVOICE"] = "0404";
|
|
42
|
+
})(InvoiceType || (InvoiceType = {}));
|
|
21
43
|
export const INVOICE_TYPE = {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
44
|
+
[InvoiceType.TAX_INVOICE]: '일반 세금계산서',
|
|
45
|
+
[InvoiceType.SMALL_BUSINESS_TAX_INVOICE]: '영세율 세금계산서',
|
|
46
|
+
[InvoiceType.CONSIGNMENT_TAX_INVOICE]: '위수탁 세금계산서',
|
|
47
|
+
[InvoiceType.SMALL_BUSINESS_CONSIGNMENT_TAX_INVOICE]: '영세율 위수탁 세금계산서',
|
|
48
|
+
[InvoiceType.REVISED_TAX_INVOICE]: '수정 일반 세금계산서',
|
|
49
|
+
[InvoiceType.REVISED_SMALL_BUSINESS_TAX_INVOICE]: '수정 영세율 세금계산서',
|
|
50
|
+
[InvoiceType.REVISED_CONSIGNMENT_TAX_INVOICE]: '수정 위수탁 세금계산서',
|
|
51
|
+
[InvoiceType.REVISED_IMPORT_TAX_INVOICE]: '수정 수입 세금계산서',
|
|
52
|
+
[InvoiceType.REVISED_SMALL_BUSINESS_CONSIGNMENT_TAX_INVOICE]: '수정 영세율 위수탁 세금계산서',
|
|
53
|
+
[InvoiceType.INVOICE]: '일반 계산서',
|
|
54
|
+
[InvoiceType.CONSIGNMENT_INVOICE]: '위수탁 계산서',
|
|
55
|
+
[InvoiceType.IMPORT_INVOICE]: '수입 계산서',
|
|
56
|
+
[InvoiceType.REVISED_INVOICE]: '수정 일반 계산서',
|
|
57
|
+
[InvoiceType.REVISED_CONSIGNMENT_INVOICE]: '수정 위수탁 계산서',
|
|
58
|
+
[InvoiceType.REVISED_IMPORT_INVOICE]: '수정 수입 계산서'
|
|
37
59
|
};
|
|
38
60
|
export const PURPOSE = {
|
|
39
61
|
'01': '영수',
|
|
@@ -42,14 +64,15 @@ export const PURPOSE = {
|
|
|
42
64
|
let TaxInvoiceListPage = class TaxInvoiceListPage extends localize(i18next)(ScopedElementsMixin(PageView)) {
|
|
43
65
|
constructor() {
|
|
44
66
|
super(...arguments);
|
|
45
|
-
this.
|
|
67
|
+
this.summary = null;
|
|
68
|
+
this._numberFormat = (num) => Intl.NumberFormat('en-US').format(num || 0);
|
|
46
69
|
}
|
|
47
70
|
get context() {
|
|
48
71
|
return {
|
|
49
72
|
title: i18next.t('title.tax invoice list'),
|
|
50
73
|
help: 'tax-invoice/tax-invoice',
|
|
51
74
|
actions: [
|
|
52
|
-
Object.assign({ title: i18next.t('button.
|
|
75
|
+
Object.assign({ title: i18next.t('button.memo save'), action: this._updateTaxInvoice.bind(this) }, CommonButtonStyles.save)
|
|
53
76
|
],
|
|
54
77
|
exportable: {
|
|
55
78
|
name: i18next.t('title.tax invoice list'),
|
|
@@ -59,8 +82,20 @@ let TaxInvoiceListPage = class TaxInvoiceListPage extends localize(i18next)(Scop
|
|
|
59
82
|
};
|
|
60
83
|
}
|
|
61
84
|
render() {
|
|
85
|
+
var _a, _b, _c, _d;
|
|
62
86
|
const mode = 'GRID';
|
|
63
87
|
return html `
|
|
88
|
+
<div class="summary">
|
|
89
|
+
<span class="title">${i18next.t('field.summary total count')}</span>
|
|
90
|
+
<span class="value">${this._numberFormat((_a = this.summary) === null || _a === void 0 ? void 0 : _a.count)}</span>
|
|
91
|
+
<span class="title">${i18next.t('field.summary total amount')}</span>
|
|
92
|
+
<span class="value">${this._numberFormat((_b = this.summary) === null || _b === void 0 ? void 0 : _b.total)}</span>
|
|
93
|
+
<span class="title">${i18next.t('field.summary supply amount')}</span>
|
|
94
|
+
<span class="value">${this._numberFormat((_c = this.summary) === null || _c === void 0 ? void 0 : _c.supply)}</span>
|
|
95
|
+
<span class="title">${i18next.t('field.summary tax amount')}</span>
|
|
96
|
+
<span class="value">${this._numberFormat((_d = this.summary) === null || _d === void 0 ? void 0 : _d.tax)}</span>
|
|
97
|
+
</div>
|
|
98
|
+
|
|
64
99
|
<ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
|
|
65
100
|
<div slot="headroom">
|
|
66
101
|
<div id="filters">
|
|
@@ -69,7 +104,6 @@ let TaxInvoiceListPage = class TaxInvoiceListPage extends localize(i18next)(Scop
|
|
|
69
104
|
</div>
|
|
70
105
|
</ox-grist>
|
|
71
106
|
`;
|
|
72
|
-
// <button @click=${() => this.createTaxInvoice('3')}>생성</button>
|
|
73
107
|
}
|
|
74
108
|
async pageInitialized(lifecycle) {
|
|
75
109
|
this.gristConfig = {
|
|
@@ -88,8 +122,8 @@ let TaxInvoiceListPage = class TaxInvoiceListPage extends localize(i18next)(Scop
|
|
|
88
122
|
},
|
|
89
123
|
{
|
|
90
124
|
type: 'string',
|
|
91
|
-
name: '
|
|
92
|
-
header: i18next.t('field.
|
|
125
|
+
name: 'memo',
|
|
126
|
+
header: i18next.t('field.memo'),
|
|
93
127
|
record: {
|
|
94
128
|
editable: true
|
|
95
129
|
},
|
|
@@ -102,8 +136,27 @@ let TaxInvoiceListPage = class TaxInvoiceListPage extends localize(i18next)(Scop
|
|
|
102
136
|
header: i18next.t('field.tax invoice category'),
|
|
103
137
|
record: {
|
|
104
138
|
renderer: value => CATEGORY[value],
|
|
139
|
+
classifier: function (record, rowIndex) {
|
|
140
|
+
return {
|
|
141
|
+
emphasized: record.category === Category.EXPORT ? ['#c6daf6', 'black'] : ['#fedbde', 'black']
|
|
142
|
+
};
|
|
143
|
+
},
|
|
105
144
|
align: 'center'
|
|
106
145
|
},
|
|
146
|
+
filter: {
|
|
147
|
+
type: 'select',
|
|
148
|
+
value: Category.EXPORT,
|
|
149
|
+
options: () => [
|
|
150
|
+
{
|
|
151
|
+
display: '매출',
|
|
152
|
+
value: Category.EXPORT
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
display: '매입',
|
|
156
|
+
value: Category.IMPORT
|
|
157
|
+
}
|
|
158
|
+
]
|
|
159
|
+
},
|
|
107
160
|
width: 80
|
|
108
161
|
},
|
|
109
162
|
{
|
|
@@ -133,7 +186,8 @@ let TaxInvoiceListPage = class TaxInvoiceListPage extends localize(i18next)(Scop
|
|
|
133
186
|
name: 'supplierBusinessRegistrationNumber',
|
|
134
187
|
header: i18next.t('field.supplier business registration number'),
|
|
135
188
|
record: {
|
|
136
|
-
align: 'center'
|
|
189
|
+
align: 'center',
|
|
190
|
+
renderer: value => value.replace(/(\d{3})(\d{2})(\d{5})/g, '$1-$2-$3')
|
|
137
191
|
},
|
|
138
192
|
width: 150
|
|
139
193
|
},
|
|
@@ -160,7 +214,7 @@ let TaxInvoiceListPage = class TaxInvoiceListPage extends localize(i18next)(Scop
|
|
|
160
214
|
name: 'totalAmount',
|
|
161
215
|
header: i18next.t('field.total amount'),
|
|
162
216
|
record: {
|
|
163
|
-
renderer: value => value &&
|
|
217
|
+
renderer: value => value && this._numberFormat(value),
|
|
164
218
|
align: 'center'
|
|
165
219
|
},
|
|
166
220
|
width: 90
|
|
@@ -170,7 +224,7 @@ let TaxInvoiceListPage = class TaxInvoiceListPage extends localize(i18next)(Scop
|
|
|
170
224
|
name: 'supplyAmount',
|
|
171
225
|
header: i18next.t('field.supply amount'),
|
|
172
226
|
record: {
|
|
173
|
-
renderer: value => value &&
|
|
227
|
+
renderer: value => value && this._numberFormat(value),
|
|
174
228
|
align: 'center'
|
|
175
229
|
},
|
|
176
230
|
width: 90
|
|
@@ -180,7 +234,7 @@ let TaxInvoiceListPage = class TaxInvoiceListPage extends localize(i18next)(Scop
|
|
|
180
234
|
name: 'taxAmount',
|
|
181
235
|
header: i18next.t('field.tax amount'),
|
|
182
236
|
record: {
|
|
183
|
-
renderer: value => value &&
|
|
237
|
+
renderer: value => value && this._numberFormat(value),
|
|
184
238
|
align: 'center'
|
|
185
239
|
},
|
|
186
240
|
width: 90
|
|
@@ -190,7 +244,8 @@ let TaxInvoiceListPage = class TaxInvoiceListPage extends localize(i18next)(Scop
|
|
|
190
244
|
name: 'approvalNo',
|
|
191
245
|
header: i18next.t('field.approval no'),
|
|
192
246
|
record: {
|
|
193
|
-
align: 'center'
|
|
247
|
+
align: 'center',
|
|
248
|
+
renderer: value => value.replace(/(\d{8})(\d{8})(\d{8})/g, '$1-$2-$3')
|
|
194
249
|
},
|
|
195
250
|
width: 200
|
|
196
251
|
},
|
|
@@ -276,7 +331,7 @@ let TaxInvoiceListPage = class TaxInvoiceListPage extends localize(i18next)(Scop
|
|
|
276
331
|
responses: taxInvoices(filters: $filters, pagination: $pagination, sortings: $sortings) {
|
|
277
332
|
items {
|
|
278
333
|
id
|
|
279
|
-
|
|
334
|
+
memo
|
|
280
335
|
category
|
|
281
336
|
issueDate
|
|
282
337
|
signatureDate
|
|
@@ -309,39 +364,17 @@ let TaxInvoiceListPage = class TaxInvoiceListPage extends localize(i18next)(Scop
|
|
|
309
364
|
sortings
|
|
310
365
|
}
|
|
311
366
|
});
|
|
367
|
+
this.summary = {
|
|
368
|
+
count: response.data.responses.total || 0,
|
|
369
|
+
supply: response.data.responses.total || 0,
|
|
370
|
+
tax: response.data.responses.total || 0,
|
|
371
|
+
total: response.data.responses.total || 0
|
|
372
|
+
};
|
|
312
373
|
return {
|
|
313
374
|
total: response.data.responses.total || 0,
|
|
314
375
|
records: response.data.responses.items || []
|
|
315
376
|
};
|
|
316
377
|
}
|
|
317
|
-
async _deleteTaxInvoice() {
|
|
318
|
-
if (await OxPrompt.open({
|
|
319
|
-
title: i18next.t('text.are_you_sure'),
|
|
320
|
-
text: i18next.t('text.sure_to_x', { x: i18next.t('text.delete') }),
|
|
321
|
-
confirmButton: { text: i18next.t('button.confirm') },
|
|
322
|
-
cancelButton: { text: i18next.t('button.cancel') }
|
|
323
|
-
})) {
|
|
324
|
-
const ids = this.grist.selected.map(record => record.id);
|
|
325
|
-
if (ids && ids.length > 0) {
|
|
326
|
-
const response = await client.mutate({
|
|
327
|
-
mutation: gql `
|
|
328
|
-
mutation ($ids: [String!]!) {
|
|
329
|
-
deleteTaxInvoices(ids: $ids)
|
|
330
|
-
}
|
|
331
|
-
`,
|
|
332
|
-
variables: {
|
|
333
|
-
ids
|
|
334
|
-
}
|
|
335
|
-
});
|
|
336
|
-
if (!response.errors) {
|
|
337
|
-
this.grist.fetch();
|
|
338
|
-
notify({
|
|
339
|
-
message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') })
|
|
340
|
-
});
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
378
|
async _updateTaxInvoice() {
|
|
346
379
|
let patches = this.grist.dirtyRecords;
|
|
347
380
|
if (patches && patches.length) {
|
|
@@ -375,104 +408,6 @@ let TaxInvoiceListPage = class TaxInvoiceListPage extends localize(i18next)(Scop
|
|
|
375
408
|
}
|
|
376
409
|
}
|
|
377
410
|
}
|
|
378
|
-
async createTaxInvoice(num) {
|
|
379
|
-
const year = '2024';
|
|
380
|
-
const month = '01';
|
|
381
|
-
const day = '02';
|
|
382
|
-
const firstWordOfNum = num.slice(0, 1);
|
|
383
|
-
const firstWordOfNumNext = String(Number(num.slice(0, 1)) + 1).slice(0, 1);
|
|
384
|
-
const supplyAmount = 1000000 * Number(firstWordOfNum);
|
|
385
|
-
const taxAmount = supplyAmount / 10;
|
|
386
|
-
const taxInvoice = {
|
|
387
|
-
name: '설명' + num.repeat(3),
|
|
388
|
-
category: '10',
|
|
389
|
-
approvalNo: year + month + day + '-' + firstWordOfNum.repeat(8) + '-' + firstWordOfNum.repeat(8),
|
|
390
|
-
issueDate: `${year}-${month}-${day}`,
|
|
391
|
-
signatureDate: `${year}-${month}-${Number(day) + 1}`,
|
|
392
|
-
invoiceType: '0101',
|
|
393
|
-
purpose: '02',
|
|
394
|
-
remark0: '비고' + num.repeat(3),
|
|
395
|
-
supplierBusinessRegistrationCategory: '01',
|
|
396
|
-
supplierBusinessRegistrationNumber: `${firstWordOfNum.repeat(3)}-${firstWordOfNum.repeat(2)}-${firstWordOfNum.repeat(5)}`,
|
|
397
|
-
supplierBusinessName: '공급자 회사명' + firstWordOfNum.repeat(3),
|
|
398
|
-
supplierRepresentativeName: '공급자 대표자' + firstWordOfNum.repeat(3),
|
|
399
|
-
supplierAddress: '공급자 주소' + firstWordOfNum.repeat(3),
|
|
400
|
-
supplierBusinessType: '공급자 업태' + firstWordOfNum.repeat(3),
|
|
401
|
-
supplierIndustryType: '공급자 업종' + firstWordOfNum.repeat(3),
|
|
402
|
-
supplierDepartment: '공급자 담당 부서' + firstWordOfNum.repeat(3),
|
|
403
|
-
supplierContactName: '공급자 담당자명' + firstWordOfNum.repeat(3),
|
|
404
|
-
supplierContactPhone: `010-${firstWordOfNum.repeat(4)}-${firstWordOfNum.repeat(4)}`,
|
|
405
|
-
supplierContactEmail: '공급자 담당자 이메일' + firstWordOfNum.repeat(3),
|
|
406
|
-
supplierContactCellPhone: '공급자 핸드폰 번호' + firstWordOfNum.repeat(3),
|
|
407
|
-
buyerBusinessRegistrationCategory: '01',
|
|
408
|
-
buyerBusinessRegistrationNumber: `${firstWordOfNumNext.repeat(3)}-${firstWordOfNumNext.repeat(2)}-${firstWordOfNumNext.repeat(5)}`,
|
|
409
|
-
buyerBusinessName: '공급자 회사명' + firstWordOfNum.repeat(3),
|
|
410
|
-
buyerRepresentativeName: '공급자 대표자' + firstWordOfNum.repeat(3),
|
|
411
|
-
buyerAddress: '공급자 주소' + firstWordOfNum.repeat(3),
|
|
412
|
-
buyerBusinessType: '공급자 업태' + firstWordOfNum.repeat(3),
|
|
413
|
-
buyerIndustryType: '공급자 업종' + firstWordOfNum.repeat(3),
|
|
414
|
-
buyer1stDepartment: '공급자 담당 부서 1st' + firstWordOfNum.repeat(3),
|
|
415
|
-
buyer1stContactName: '공급자 담당자명 1st' + firstWordOfNum.repeat(3),
|
|
416
|
-
buyer1stContactPhone: `011-${firstWordOfNumNext.repeat(4)}-${firstWordOfNumNext.repeat(4)}`,
|
|
417
|
-
buyer1stContactEmail: '공급자 담당자 이메일 1st' + firstWordOfNum.repeat(3),
|
|
418
|
-
buyer1stContactCellPhone: '공급자 핸드폰 번호 1st' + firstWordOfNum.repeat(3),
|
|
419
|
-
buyer2ndDepartment: '공급자 담당 부서 2nd' + firstWordOfNum.repeat(3),
|
|
420
|
-
buyer2ndContactName: '공급자 담당자명 2nd' + firstWordOfNum.repeat(3),
|
|
421
|
-
buyer2ndContactPhone: `022-${firstWordOfNumNext.repeat(4)}-${firstWordOfNumNext.repeat(4)}`,
|
|
422
|
-
buyer2ndContactEmail: '공급자 담당자 이메일 2nd' + firstWordOfNum.repeat(3),
|
|
423
|
-
buyer2ndContactCellPhone: '공급자 핸드폰 번호 2nd' + firstWordOfNum.repeat(3),
|
|
424
|
-
paymentAmountCash: 0,
|
|
425
|
-
paymentAmountCheck: 0,
|
|
426
|
-
paymentAmountPromissoryNote: 0,
|
|
427
|
-
paymentAmountAccountsReceivable: 0,
|
|
428
|
-
supplyAmount: supplyAmount,
|
|
429
|
-
taxAmount: taxAmount,
|
|
430
|
-
totalAmount: supplyAmount + taxAmount
|
|
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
|
-
];
|
|
456
|
-
const response = await client.mutate({
|
|
457
|
-
mutation: gql `
|
|
458
|
-
mutation CreateTaxInvoice($taxInvoice: NewTaxInvoice!, $taxInvoiceItems: [NewTaxInvoiceItem!]!) {
|
|
459
|
-
createTaxInvoice(taxInvoice: $taxInvoice, taxInvoiceItems: $taxInvoiceItems) {
|
|
460
|
-
id
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
|
-
`,
|
|
464
|
-
variables: {
|
|
465
|
-
taxInvoice,
|
|
466
|
-
taxInvoiceItems
|
|
467
|
-
}
|
|
468
|
-
});
|
|
469
|
-
if (!response.errors) {
|
|
470
|
-
this.grist.fetch();
|
|
471
|
-
notify({
|
|
472
|
-
message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') })
|
|
473
|
-
});
|
|
474
|
-
}
|
|
475
|
-
}
|
|
476
411
|
async exportHandler() {
|
|
477
412
|
const exportTargets = this.grist.selected.length ? this.grist.selected : this.grist.dirtyData.records;
|
|
478
413
|
const targetFieldSet = new Set(['id', 'name']);
|
|
@@ -498,12 +433,37 @@ TaxInvoiceListPage.styles = [
|
|
|
498
433
|
css `
|
|
499
434
|
:host {
|
|
500
435
|
display: flex;
|
|
436
|
+
flex-direction: column;
|
|
501
437
|
|
|
502
438
|
width: 100%;
|
|
503
439
|
|
|
504
440
|
--grid-record-emphasized-background-color: red;
|
|
505
441
|
--grid-record-emphasized-color: yellow;
|
|
506
442
|
}
|
|
443
|
+
|
|
444
|
+
div.summary {
|
|
445
|
+
display: grid;
|
|
446
|
+
grid-template-columns: 0.7fr 1fr 0.7fr 1fr 0.7fr 1fr 0.7fr 1fr;
|
|
447
|
+
border: solid #d3dbe5;
|
|
448
|
+
border-width: 2px 0;
|
|
449
|
+
margin: 15px 40px;
|
|
450
|
+
align-content: center;
|
|
451
|
+
|
|
452
|
+
span.title {
|
|
453
|
+
background-color: #e9edf6;
|
|
454
|
+
text-align: center;
|
|
455
|
+
display: flex;
|
|
456
|
+
align-items: center;
|
|
457
|
+
justify-content: center;
|
|
458
|
+
height: 35px;
|
|
459
|
+
}
|
|
460
|
+
span.value {
|
|
461
|
+
padding-left: 10px;
|
|
462
|
+
display: flex;
|
|
463
|
+
align-items: center;
|
|
464
|
+
height: 35px;
|
|
465
|
+
}
|
|
466
|
+
}
|
|
507
467
|
`
|
|
508
468
|
];
|
|
509
469
|
__decorate([
|
|
@@ -511,9 +471,9 @@ __decorate([
|
|
|
511
471
|
__metadata("design:type", Object)
|
|
512
472
|
], TaxInvoiceListPage.prototype, "gristConfig", void 0);
|
|
513
473
|
__decorate([
|
|
514
|
-
|
|
515
|
-
__metadata("design:type",
|
|
516
|
-
], TaxInvoiceListPage.prototype, "
|
|
474
|
+
state(),
|
|
475
|
+
__metadata("design:type", Object)
|
|
476
|
+
], TaxInvoiceListPage.prototype, "summary", void 0);
|
|
517
477
|
__decorate([
|
|
518
478
|
query('ox-grist'),
|
|
519
479
|
__metadata("design:type", DataGrist)
|