@things-factory/tax-invoice 6.2.96 → 6.2.101
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-send/tax-invoice-send-page.ts +294 -246
- package/dist-client/pages/tax-invoice-send/tax-invoice-send-page.d.ts +1 -1
- package/dist-client/pages/tax-invoice-send/tax-invoice-send-page.js +286 -244
- package/dist-client/pages/tax-invoice-send/tax-invoice-send-page.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/service/tax-invoice/tax-invoice-mutation.js +6 -6
- package/dist-server/service/tax-invoice/tax-invoice-mutation.js.map +1 -1
- package/dist-server/service/tax-invoice/tax-invoice-type.js +2 -2
- package/dist-server/service/tax-invoice/tax-invoice-type.js.map +1 -1
- package/dist-server/service/tax-invoice-api/tax-invoice-api-mutation.js +146 -0
- package/dist-server/service/tax-invoice-api/tax-invoice-api-mutation.js.map +1 -1
- package/dist-server/service/tax-invoice-api/tax-invoice-api-type.js +17 -1
- 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-type.js +2 -2
- package/dist-server/service/tax-invoice-item/tax-invoice-item-type.js.map +1 -1
- package/dist-server/service/unipost-api/tax-invoice-inquiry.js +5 -5
- package/dist-server/service/unipost-api/tax-invoice-inquiry.js.map +1 -1
- package/dist-server/service/unipost-api/tax-invoice-send.js +38 -0
- package/dist-server/service/unipost-api/tax-invoice-send.js.map +1 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/server/service/tax-invoice/tax-invoice-mutation.ts +6 -6
- package/server/service/tax-invoice/tax-invoice-type.ts +2 -2
- package/server/service/tax-invoice-api/tax-invoice-api-mutation.ts +161 -1
- package/server/service/tax-invoice-api/tax-invoice-api-type.ts +11 -0
- package/server/service/tax-invoice-item/tax-invoice-item-type.ts +2 -2
- package/server/service/unipost-api/tax-invoice-inquiry.ts +5 -5
- package/server/service/unipost-api/tax-invoice-send.ts +42 -0
- package/dist-server/service/unipost-api/test-data.js +0 -3812
- package/dist-server/service/unipost-api/test-data.js.map +0 -1
|
@@ -3,7 +3,7 @@ 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,
|
|
6
|
+
import { customElement, property, state } from 'lit/decorators.js';
|
|
7
7
|
import { ScopedElementsMixin } from '@open-wc/scoped-elements';
|
|
8
8
|
import { client } from '@operato/graphql';
|
|
9
9
|
import { i18next, localize } from '@operato/i18n';
|
|
@@ -31,16 +31,10 @@ const SHORT_BUSINESS_REGISTRATION_CATEGORY = {
|
|
|
31
31
|
let TaxInvoiceSendPage = class TaxInvoiceSendPage extends localize(i18next)(ScopedElementsMixin(PageView)) {
|
|
32
32
|
constructor() {
|
|
33
33
|
super(...arguments);
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
year: 'numeric',
|
|
37
|
-
month: '2-digit',
|
|
38
|
-
day: '2-digit'
|
|
39
|
-
})
|
|
40
|
-
.format(new Date())
|
|
41
|
-
.replace(/[.\s]/g, '')
|
|
42
|
-
.replace(/(\d{4})(\d{2})(\d{2})/g, '$1-$2-$3');
|
|
34
|
+
// 오늘 날짜 YYYY-MM-DD 형식으로 뽑기
|
|
35
|
+
this.today = new Intl.DateTimeFormat('fr-CA', { timeZone: 'Asia/Seoul' }).format(new Date());
|
|
43
36
|
this.supplier = {
|
|
37
|
+
supplierBusinessRegistrationCategory: '01',
|
|
44
38
|
supplierBusinessRegistrationNumber: '',
|
|
45
39
|
supplierBranchIdentification: '',
|
|
46
40
|
supplierBusinessName: '',
|
|
@@ -99,7 +93,7 @@ let TaxInvoiceSendPage = class TaxInvoiceSendPage extends localize(i18next)(Scop
|
|
|
99
93
|
const checked = key === InvoiceType.TAX_INVOICE;
|
|
100
94
|
return html `
|
|
101
95
|
<label for="${'tax_' + key}">${SHORT_INVOICE_TYPE['TAX_INVOICE'][key]}</label>
|
|
102
|
-
<input type="radio" id="${'tax_' + key}" value="${key}" name="
|
|
96
|
+
<input type="radio" id="${'tax_' + key}" value="${key}" name="invoiceType" ?checked=${checked} ?disabled=${disabled} />
|
|
103
97
|
`;
|
|
104
98
|
})}
|
|
105
99
|
</td>
|
|
@@ -119,223 +113,222 @@ let TaxInvoiceSendPage = class TaxInvoiceSendPage extends localize(i18next)(Scop
|
|
|
119
113
|
</div>
|
|
120
114
|
|
|
121
115
|
<div class="body">
|
|
122
|
-
<
|
|
123
|
-
<
|
|
124
|
-
<
|
|
125
|
-
<
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
<
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
<
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
<
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
<
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
<
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
<
|
|
158
|
-
|
|
159
|
-
<
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
<
|
|
167
|
-
<
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
<
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
<
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
</div>
|
|
223
|
-
<div class="title">${i18next.t('field.remark0')}</div>
|
|
224
|
-
<div class="value"><input type="text" name="remark0" .value=${((_u = this.taxInvoice) === null || _u === void 0 ? void 0 : _u.remark0) || ''} @input=${this._onInputTaxInvoice} /></div>
|
|
225
|
-
</div>
|
|
226
|
-
<div class="flex-row">
|
|
227
|
-
<div class="title">${i18next.t('field.total amount')}</div>
|
|
228
|
-
<div class="value">${this._numberFormat((_v = this.taxInvoice) === null || _v === void 0 ? void 0 : _v.totalAmount)}</div>
|
|
229
|
-
<div class="title">${i18next.t('field.supply amount')}</div>
|
|
230
|
-
<div class="value">${this._numberFormat((_w = this.taxInvoice) === null || _w === void 0 ? void 0 : _w.supplyAmount)}</div>
|
|
231
|
-
<div class="title">${i18next.t('field.tax amount')}</div>
|
|
232
|
-
<div class="value">${this._numberFormat((_x = this.taxInvoice) === null || _x === void 0 ? void 0 : _x.taxAmount)}</div>
|
|
116
|
+
<div class="data">
|
|
117
|
+
<table class="supplier">
|
|
118
|
+
<colgroup>
|
|
119
|
+
<col width="150px" />
|
|
120
|
+
<col width="18%" />
|
|
121
|
+
<col width="32%" />
|
|
122
|
+
<col width="18%" />
|
|
123
|
+
<col width="32%" />
|
|
124
|
+
</colgroup>
|
|
125
|
+
<tr>
|
|
126
|
+
<th rowspan="6" class="target">${i18next.t('field.tax invoice supplier')}</th>
|
|
127
|
+
<th required>${i18next.t('field.short business registration number')}</th>
|
|
128
|
+
<td>${(_b = this.supplier) === null || _b === void 0 ? void 0 : _b.supplierBusinessRegistrationNumber.replace(/(\S{3})(\S{2})(\S{5})/g, '$1-$2-$3')}</td>
|
|
129
|
+
<th>${i18next.t('field.short branch identification')}</th>
|
|
130
|
+
<td>${(_c = this.supplier) === null || _c === void 0 ? void 0 : _c.supplierBranchIdentification}</td>
|
|
131
|
+
</tr>
|
|
132
|
+
<tr>
|
|
133
|
+
<th required>${i18next.t('field.short tax invoice business name')}</th>
|
|
134
|
+
<td><input type="text" name="supplierBusinessName" .value=${((_d = this.supplier) === null || _d === void 0 ? void 0 : _d.supplierBusinessName) || ''} @input=${this._onInputTaxInvoice} /></td>
|
|
135
|
+
<th required>${i18next.t('field.tax invoice representative name')}</th>
|
|
136
|
+
<td>
|
|
137
|
+
<input type="text" name="supplierRepresentativeName" .value=${((_e = this.supplier) === null || _e === void 0 ? void 0 : _e.supplierRepresentativeName) || ''} @input=${this._onInputTaxInvoice} />
|
|
138
|
+
</td>
|
|
139
|
+
</tr>
|
|
140
|
+
<tr>
|
|
141
|
+
<th>${i18next.t('field.address')}</th>
|
|
142
|
+
<td colspan="3">${(_f = this.supplier) === null || _f === void 0 ? void 0 : _f.supplierAddress}</td>
|
|
143
|
+
</tr>
|
|
144
|
+
<tr>
|
|
145
|
+
<th>${i18next.t('field.business type')}</th>
|
|
146
|
+
<td><input type="text" name="supplierBusinessType" .value=${((_g = this.supplier) === null || _g === void 0 ? void 0 : _g.supplierBusinessType) || ''} @input=${this._onInputTaxInvoice} /></td>
|
|
147
|
+
<th>${i18next.t('field.industry type')}</th>
|
|
148
|
+
<td><input type="text" name="supplierIndustryType" .value=${((_h = this.supplier) === null || _h === void 0 ? void 0 : _h.supplierIndustryType) || ''} @input=${this._onInputTaxInvoice} /></td>
|
|
149
|
+
</tr>
|
|
150
|
+
<tr>
|
|
151
|
+
<th rowspan="2">${i18next.t('field.email')}</th>
|
|
152
|
+
<td rowspan="2" colspan="3">
|
|
153
|
+
<input type="text" name="supplierContactEmail" .value=${((_j = this.supplier) === null || _j === void 0 ? void 0 : _j.supplierContactEmail) || ''} @input=${this._onInputTaxInvoice} />
|
|
154
|
+
</td>
|
|
155
|
+
</tr>
|
|
156
|
+
<tr></tr>
|
|
157
|
+
</table>
|
|
158
|
+
|
|
159
|
+
<table class="buyer">
|
|
160
|
+
<colgroup>
|
|
161
|
+
<col width="150px" />
|
|
162
|
+
<col width="18%" />
|
|
163
|
+
<col width="32%" />
|
|
164
|
+
<col width="18%" />
|
|
165
|
+
<col width="32%" />
|
|
166
|
+
</colgroup>
|
|
167
|
+
<tr>
|
|
168
|
+
<th rowspan="6" class="target">${i18next.t('field.tax invoice buyer')}</th>
|
|
169
|
+
<th required>${i18next.t('field.short business registration number')}</th>
|
|
170
|
+
<td>
|
|
171
|
+
<input
|
|
172
|
+
type="text"
|
|
173
|
+
maxlength="10"
|
|
174
|
+
name="buyerBusinessRegistrationNumber"
|
|
175
|
+
.value=${((_k = this.buyer) === null || _k === void 0 ? void 0 : _k.buyerBusinessRegistrationNumber) || ''}
|
|
176
|
+
@input=${this._onInputTaxInvoice}
|
|
177
|
+
/>
|
|
178
|
+
</td>
|
|
179
|
+
<th>${i18next.t('field.short branch identification')}</th>
|
|
180
|
+
<td><input type="text" name="buyerBranchIdentification" .value=${((_l = this.buyer) === null || _l === void 0 ? void 0 : _l.buyerBranchIdentification) || ''} @input=${this._onInputTaxInvoice} /></td>
|
|
181
|
+
</tr>
|
|
182
|
+
<tr>
|
|
183
|
+
<th required>${i18next.t('field.short tax invoice business name')}</th>
|
|
184
|
+
<td><input type="text" name="buyerBusinessName" .value=${((_m = this.buyer) === null || _m === void 0 ? void 0 : _m.buyerBusinessName) || ''} @input=${this._onInputTaxInvoice} /></td>
|
|
185
|
+
<th required>${i18next.t('field.tax invoice representative name')}</th>
|
|
186
|
+
<td><input type="text" name="buyerRepresentativeName" .value=${((_o = this.buyer) === null || _o === void 0 ? void 0 : _o.buyerRepresentativeName) || ''} @input=${this._onInputTaxInvoice} /></td>
|
|
187
|
+
</tr>
|
|
188
|
+
<tr>
|
|
189
|
+
<th>${i18next.t('field.address')}</th>
|
|
190
|
+
<td colspan="3"><input type="text" name="buyerAddress" .value=${((_p = this.buyer) === null || _p === void 0 ? void 0 : _p.buyerAddress) || ''} @input=${this._onInputTaxInvoice} /></td>
|
|
191
|
+
</tr>
|
|
192
|
+
<tr>
|
|
193
|
+
<th>${i18next.t('field.business type')}</th>
|
|
194
|
+
<td><input type="text" name="buyerBusinessType" .value=${((_q = this.buyer) === null || _q === void 0 ? void 0 : _q.buyerBusinessType) || ''} @input=${this._onInputTaxInvoice} /></td>
|
|
195
|
+
|
|
196
|
+
<th>${i18next.t('field.industry type')}</th>
|
|
197
|
+
<td><input type="text" name="buyerIndustryType" .value=${((_r = this.buyer) === null || _r === void 0 ? void 0 : _r.buyerIndustryType) || ''} @input=${this._onInputTaxInvoice} /></td>
|
|
198
|
+
</tr>
|
|
199
|
+
<tr>
|
|
200
|
+
<th>${i18next.t('field.email')}</th>
|
|
201
|
+
<td colspan="3"><input type="text" name="buyer1stContactEmail" .value=${((_s = this.buyer) === null || _s === void 0 ? void 0 : _s.buyer1stContactEmail) || ''} @input=${this._onInputTaxInvoice} /></td>
|
|
202
|
+
</tr>
|
|
203
|
+
<tr>
|
|
204
|
+
<th>${i18next.t('field.email')}</th>
|
|
205
|
+
<td colspan="3"><input type="text" name="buyer2ndContactEmail" .value=${((_t = this.buyer) === null || _t === void 0 ? void 0 : _t.buyer2ndContactEmail) || ''} @input=${this._onInputTaxInvoice} /></td>
|
|
206
|
+
</tr>
|
|
207
|
+
</table>
|
|
208
|
+
</div>
|
|
209
|
+
|
|
210
|
+
<div class="info flex-column">
|
|
211
|
+
<div class="flex-row">
|
|
212
|
+
<div class="title" required>${i18next.t('field.issue date')}</div>
|
|
213
|
+
<div class="value">
|
|
214
|
+
<input type="date" name="issueDate" .value=${this.taxInvoice.issueDate} @input=${this._onInputTaxInvoice} />
|
|
215
|
+
<span class="desc">※ 작성일자는 공급 연월일을 의미함</span>
|
|
233
216
|
</div>
|
|
217
|
+
<div class="title">${i18next.t('field.remark0')}</div>
|
|
218
|
+
<div class="value"><input type="text" name="remark0" .value=${((_u = this.taxInvoice) === null || _u === void 0 ? void 0 : _u.remark0) || ''} @input=${this._onInputTaxInvoice} /></div>
|
|
234
219
|
</div>
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
<div class="
|
|
238
|
-
|
|
239
|
-
</div>
|
|
240
|
-
<div class="
|
|
241
|
-
|
|
242
|
-
<table>
|
|
243
|
-
<colgroup>
|
|
244
|
-
<col width="5%" />
|
|
245
|
-
<col width="5%" />
|
|
246
|
-
<col width="14%" />
|
|
247
|
-
<col width="7%" />
|
|
248
|
-
<col width="7%" />
|
|
249
|
-
<col width="12%" />
|
|
250
|
-
<col width="12%" />
|
|
251
|
-
<col width="12%" />
|
|
252
|
-
<col width="16%" />
|
|
253
|
-
<col width="8%" />
|
|
254
|
-
</colgroup>
|
|
255
|
-
<tr>
|
|
256
|
-
<th>${i18next.t('field.tax invoice month')}</th>
|
|
257
|
-
<th>${i18next.t('field.tax invoice day')}</th>
|
|
258
|
-
<th>${i18next.t('field.tax invoice item name')}</th>
|
|
259
|
-
<th>${i18next.t('field.tax invoice ea')}</th>
|
|
260
|
-
<th>${i18next.t('field.tax invoice quantity')}</th>
|
|
261
|
-
<th>${i18next.t('field.tax invoice price')}</th>
|
|
262
|
-
<th>${i18next.t('field.supply amount')}</th>
|
|
263
|
-
<th>${i18next.t('field.tax amount')}</th>
|
|
264
|
-
<th>${i18next.t('field.remark0')}</th>
|
|
265
|
-
<th>${i18next.t('field.delete')}</th>
|
|
266
|
-
</tr>
|
|
267
|
-
|
|
268
|
-
${this.taxInvoiceItems.map((item, idx) => html `
|
|
269
|
-
<tr>
|
|
270
|
-
<input type="hidden" name="sequence" value=${item.sequence} />
|
|
271
|
-
<td>${this.taxInvoice.issueDate.split('-')[1]}</td>
|
|
272
|
-
<td><input type="text" numeric maxlength="2" name="supplyDate" @input=${e => this._onInputItem(e, idx)} /></td>
|
|
273
|
-
<td><input type="text" name="itemName" .value=${item.itemName} @input=${e => this._onInputItem(e, idx)} /></td>
|
|
274
|
-
<td><input type="text" name="specification" .value=${item.specification} @input=${e => this._onInputItem(e, idx)} /></td>
|
|
275
|
-
<td><input type="text" numeric name="quantity" .value=${this._numberFormat(item.quantity)} @input=${e => this._onInputItem(e, idx)} /></td>
|
|
276
|
-
<td><input type="text" numeric name="unitPrice" .value=${this._numberFormat(item.unitPrice)} @input=${e => this._onInputItem(e, idx)} /></td>
|
|
277
|
-
<td><input type="text" readonly name="supplyPrice" .value=${this._numberFormat(item.supplyPrice)} @input=${e => this._onInputItem(e, idx)} /></td>
|
|
278
|
-
<td><input type="text" readonly name="taxPrice" .value=${this._numberFormat(item.taxPrice)} @input=${e => this._onInputItem(e, idx)} /></td>
|
|
279
|
-
<td><input type="text" name="remark" .value=${item.remark || ''} @input=${e => this._onInputItem(e, idx)} /></td>
|
|
280
|
-
<td><button class="btn-delete" @click=${e => this._onRemoveInvoiceItem(e, item.sequence)}>삭제</button></td>
|
|
281
|
-
</tr>
|
|
282
|
-
`)}
|
|
283
|
-
</table>
|
|
220
|
+
<div class="flex-row">
|
|
221
|
+
<div class="title">${i18next.t('field.total amount')}</div>
|
|
222
|
+
<div class="value">${this._numberFormat((_v = this.taxInvoice) === null || _v === void 0 ? void 0 : _v.totalAmount)}</div>
|
|
223
|
+
<div class="title">${i18next.t('field.supply amount')}</div>
|
|
224
|
+
<div class="value">${this._numberFormat((_w = this.taxInvoice) === null || _w === void 0 ? void 0 : _w.supplyAmount)}</div>
|
|
225
|
+
<div class="title">${i18next.t('field.tax amount')}</div>
|
|
226
|
+
<div class="value">${this._numberFormat((_x = this.taxInvoice) === null || _x === void 0 ? void 0 : _x.taxAmount)}</div>
|
|
284
227
|
</div>
|
|
228
|
+
</div>
|
|
285
229
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
<col width="25%" />
|
|
290
|
-
<col width="25%" />
|
|
291
|
-
<col width="25%" />
|
|
292
|
-
<col width="25%" />
|
|
293
|
-
</colgroup>
|
|
294
|
-
<tr>
|
|
295
|
-
<th>${i18next.t('field.tax invoice payment cash')}</th>
|
|
296
|
-
<th>${i18next.t('field.tax invoice payment check')}</th>
|
|
297
|
-
<th>${i18next.t('field.tax invoice payment promissory note')}</th>
|
|
298
|
-
<th>${i18next.t('field.tax invoice payment accounts receivable')}</th>
|
|
299
|
-
</tr>
|
|
300
|
-
<tr>
|
|
301
|
-
<td><input type="text" numeric name="paymentAmountCash" .value=${(_y = this.taxInvoice) === null || _y === void 0 ? void 0 : _y.paymentAmountCash} @input=${this._onInputTaxInvoice} /></td>
|
|
302
|
-
<td><input type="text" numeric name="paymentAmountCheck" .value=${(_z = this.taxInvoice) === null || _z === void 0 ? void 0 : _z.paymentAmountCheck} @input=${this._onInputTaxInvoice} /></td>
|
|
303
|
-
<td>
|
|
304
|
-
<input
|
|
305
|
-
type="text"
|
|
306
|
-
numeric
|
|
307
|
-
name="paymentAmountPromissoryNote"
|
|
308
|
-
.value=${(_0 = this.taxInvoice) === null || _0 === void 0 ? void 0 : _0.paymentAmountPromissoryNote}
|
|
309
|
-
@input=${this._onInputTaxInvoice}
|
|
310
|
-
/>
|
|
311
|
-
</td>
|
|
312
|
-
<td>
|
|
313
|
-
<input
|
|
314
|
-
type="text"
|
|
315
|
-
numeric
|
|
316
|
-
name="paymentAmountAccountsReceivable"
|
|
317
|
-
.value=${(_1 = this.taxInvoice) === null || _1 === void 0 ? void 0 : _1.paymentAmountAccountsReceivable}
|
|
318
|
-
@input=${this._onInputTaxInvoice}
|
|
319
|
-
/>
|
|
320
|
-
</td>
|
|
321
|
-
</tr>
|
|
322
|
-
</table>
|
|
323
|
-
<div>
|
|
324
|
-
${i18next.t('text.prev tax invoice description payment') + ' ('}
|
|
325
|
-
<span style="margin:0 10px">
|
|
326
|
-
<div>
|
|
327
|
-
<input type="radio" id="purpose_20" name="purpose" .value=${Purpose.INVOICE} @change=${this._onInputTaxInvoice} checked />
|
|
328
|
-
<label for="purpose_20">${PURPOSE[Purpose.INVOICE]}</label>
|
|
329
|
-
</div>
|
|
330
|
-
<div>
|
|
331
|
-
<input type="radio" id="purpose_10" name="purpose" .value=${Purpose.RECEIPT} @change=${this._onInputTaxInvoice} />
|
|
332
|
-
<label for="purpose_10">${PURPOSE[Purpose.RECEIPT]}</label>
|
|
333
|
-
</div>
|
|
334
|
-
</span>
|
|
335
|
-
${') ' + i18next.t('text.next tax invoice description payment')}
|
|
336
|
-
</div>
|
|
230
|
+
<div class="items">
|
|
231
|
+
<div class="desc desc-date">
|
|
232
|
+
※ 아래 '품목'의 '월'은 상단 '작성일자'의 '월'이 자동 반영됩니다. 합계의 '계산' 버튼은 금액을 공급가액과 세액으로 계산할 수 있습니다.
|
|
337
233
|
</div>
|
|
338
|
-
|
|
234
|
+
<div class="desc"><button class="btn-add" @click=${this._onAddInvoiceItem}>품목추가</button> 품목은 최대 16개까지 추가, 삭제 가능</div>
|
|
235
|
+
|
|
236
|
+
<table>
|
|
237
|
+
<colgroup>
|
|
238
|
+
<col width="5%" />
|
|
239
|
+
<col width="5%" />
|
|
240
|
+
<col width="14%" />
|
|
241
|
+
<col width="7%" />
|
|
242
|
+
<col width="7%" />
|
|
243
|
+
<col width="12%" />
|
|
244
|
+
<col width="12%" />
|
|
245
|
+
<col width="12%" />
|
|
246
|
+
<col width="16%" />
|
|
247
|
+
<col width="8%" />
|
|
248
|
+
</colgroup>
|
|
249
|
+
<tr>
|
|
250
|
+
<th>${i18next.t('field.tax invoice month')}</th>
|
|
251
|
+
<th required>${i18next.t('field.tax invoice day')}</th>
|
|
252
|
+
<th required>${i18next.t('field.tax invoice item name')}</th>
|
|
253
|
+
<th>${i18next.t('field.tax invoice ea')}</th>
|
|
254
|
+
<th required>${i18next.t('field.tax invoice quantity')}</th>
|
|
255
|
+
<th required>${i18next.t('field.tax invoice price')}</th>
|
|
256
|
+
<th>${i18next.t('field.supply amount')}</th>
|
|
257
|
+
<th>${i18next.t('field.tax amount')}</th>
|
|
258
|
+
<th>${i18next.t('field.remark0')}</th>
|
|
259
|
+
<th>${i18next.t('field.delete')}</th>
|
|
260
|
+
</tr>
|
|
261
|
+
|
|
262
|
+
${this.taxInvoiceItems.map((item, idx) => html `
|
|
263
|
+
<tr>
|
|
264
|
+
<input type="hidden" name="sequence" value=${item.sequence} />
|
|
265
|
+
<td>${this.taxInvoice.issueDate.split('-')[1]}</td>
|
|
266
|
+
<td><input type="text" numeric maxlength="2" name="supplyDate" @input=${e => this._onInputItem(e, idx)} /></td>
|
|
267
|
+
<td><input type="text" name="itemName" .value=${item.itemName} @input=${e => this._onInputItem(e, idx)} /></td>
|
|
268
|
+
<td><input type="text" name="specification" .value=${item.specification} @input=${e => this._onInputItem(e, idx)} /></td>
|
|
269
|
+
<td><input type="text" numeric name="quantity" .value=${this._numberFormat(item.quantity)} @input=${e => this._onInputItem(e, idx)} /></td>
|
|
270
|
+
<td><input type="text" numeric name="unitPrice" .value=${this._numberFormat(item.unitPrice)} @input=${e => this._onInputItem(e, idx)} /></td>
|
|
271
|
+
<td><input type="text" readonly name="supplyPrice" .value=${this._numberFormat(item.supplyPrice)} @input=${e => this._onInputItem(e, idx)} /></td>
|
|
272
|
+
<td><input type="text" readonly name="taxPrice" .value=${this._numberFormat(item.taxPrice)} @input=${e => this._onInputItem(e, idx)} /></td>
|
|
273
|
+
<td><input type="text" name="remark" .value=${item.remark || ''} @input=${e => this._onInputItem(e, idx)} /></td>
|
|
274
|
+
<td><button class="btn-delete" @click=${e => this._onRemoveInvoiceItem(e, item.sequence)}>삭제</button></td>
|
|
275
|
+
</tr>
|
|
276
|
+
`)}
|
|
277
|
+
</table>
|
|
278
|
+
</div>
|
|
279
|
+
|
|
280
|
+
<div class="summary">
|
|
281
|
+
<table>
|
|
282
|
+
<colgroup>
|
|
283
|
+
<col width="25%" />
|
|
284
|
+
<col width="25%" />
|
|
285
|
+
<col width="25%" />
|
|
286
|
+
<col width="25%" />
|
|
287
|
+
</colgroup>
|
|
288
|
+
<tr>
|
|
289
|
+
<th>${i18next.t('field.tax invoice payment cash')}</th>
|
|
290
|
+
<th>${i18next.t('field.tax invoice payment check')}</th>
|
|
291
|
+
<th>${i18next.t('field.tax invoice payment promissory note')}</th>
|
|
292
|
+
<th>${i18next.t('field.tax invoice payment accounts receivable')}</th>
|
|
293
|
+
</tr>
|
|
294
|
+
<tr>
|
|
295
|
+
<td><input type="text" numeric name="paymentAmountCash" .value=${((_y = this.taxInvoice) === null || _y === void 0 ? void 0 : _y.paymentAmountCash) || ''} @input=${this._onInputTaxInvoice} /></td>
|
|
296
|
+
<td><input type="text" numeric name="paymentAmountCheck" .value=${((_z = this.taxInvoice) === null || _z === void 0 ? void 0 : _z.paymentAmountCheck) || ''} @input=${this._onInputTaxInvoice} /></td>
|
|
297
|
+
<td>
|
|
298
|
+
<input
|
|
299
|
+
type="text"
|
|
300
|
+
numeric
|
|
301
|
+
name="paymentAmountPromissoryNote"
|
|
302
|
+
.value=${((_0 = this.taxInvoice) === null || _0 === void 0 ? void 0 : _0.paymentAmountPromissoryNote) || ''}
|
|
303
|
+
@input=${this._onInputTaxInvoice}
|
|
304
|
+
/>
|
|
305
|
+
</td>
|
|
306
|
+
<td>
|
|
307
|
+
<input
|
|
308
|
+
type="text"
|
|
309
|
+
numeric
|
|
310
|
+
name="paymentAmountAccountsReceivable"
|
|
311
|
+
.value=${((_1 = this.taxInvoice) === null || _1 === void 0 ? void 0 : _1.paymentAmountAccountsReceivable) || ''}
|
|
312
|
+
@input=${this._onInputTaxInvoice}
|
|
313
|
+
/>
|
|
314
|
+
</td>
|
|
315
|
+
</tr>
|
|
316
|
+
</table>
|
|
317
|
+
<div>
|
|
318
|
+
${i18next.t('text.prev tax invoice description payment') + ' ('}
|
|
319
|
+
<span class="type-wrapper">
|
|
320
|
+
<div>
|
|
321
|
+
<input type="radio" id="purpose_20" name="purpose" .value=${Purpose.INVOICE} @change=${this._onInputTaxInvoice} checked />
|
|
322
|
+
<label for="purpose_20">${PURPOSE[Purpose.INVOICE]}</label>
|
|
323
|
+
</div>
|
|
324
|
+
<div>
|
|
325
|
+
<input type="radio" id="purpose_10" name="purpose" .value=${Purpose.RECEIPT} @change=${this._onInputTaxInvoice} />
|
|
326
|
+
<label for="purpose_10">${PURPOSE[Purpose.RECEIPT]}</label>
|
|
327
|
+
</div>
|
|
328
|
+
</span>
|
|
329
|
+
${') ' + i18next.t('text.next tax invoice description payment')}
|
|
330
|
+
</div>
|
|
331
|
+
</div>
|
|
339
332
|
</div>
|
|
340
333
|
`;
|
|
341
334
|
}
|
|
@@ -365,6 +358,7 @@ let TaxInvoiceSendPage = class TaxInvoiceSendPage extends localize(i18next)(Scop
|
|
|
365
358
|
});
|
|
366
359
|
const supplier = response.data.response;
|
|
367
360
|
this.supplier = {
|
|
361
|
+
supplierBusinessRegistrationCategory: supplier.businessRegistrationCategory,
|
|
368
362
|
supplierBusinessRegistrationNumber: supplier.businessRegistrationNumber,
|
|
369
363
|
supplierBranchIdentification: supplier.branchIdentification,
|
|
370
364
|
supplierBusinessName: supplier.businessName,
|
|
@@ -385,30 +379,50 @@ let TaxInvoiceSendPage = class TaxInvoiceSendPage extends localize(i18next)(Scop
|
|
|
385
379
|
}
|
|
386
380
|
}
|
|
387
381
|
async _sendTaxInvoice(num) {
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
//
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
382
|
+
// 아이템 시퀀스 재 할당 + 날짜, 품목, 규격, 수량이 없으면 필터
|
|
383
|
+
let taxInvoiceItems = this.taxInvoiceItems.map((item, idx) => (Object.assign(Object.assign({}, item), { sequence: idx + 1, quantity: Number(item.quantity), unitPrice: Number(item.unitPrice) })));
|
|
384
|
+
taxInvoiceItems = taxInvoiceItems.filter(item => item.supplyDate && item.itemName && item.quantity && item.unitPrice);
|
|
385
|
+
// taxInvoice 데이터 생성 및 타입 변환
|
|
386
|
+
let taxInvoice = Object.assign(Object.assign(Object.assign({}, this.taxInvoice), this.supplier), this.buyer);
|
|
387
|
+
taxInvoice.paymentAmountCash = Number(taxInvoice.paymentAmountCash || 0);
|
|
388
|
+
taxInvoice.paymentAmountCheck = Number(taxInvoice.paymentAmountCheck || 0);
|
|
389
|
+
taxInvoice.paymentAmountPromissoryNote = Number(taxInvoice.paymentAmountPromissoryNote || 0);
|
|
390
|
+
taxInvoice.paymentAmountAccountsReceivable = Number(taxInvoice.paymentAmountAccountsReceivable || 0);
|
|
391
|
+
// 공급받는자 필수 값 체크
|
|
392
|
+
if (!this.buyer.buyerBusinessRegistrationNumber || !this.buyer.buyerBusinessName || !this.buyer.buyerRepresentativeName) {
|
|
393
|
+
alert('공급받는자 필수 값을 모두 입력해 주세요.');
|
|
394
|
+
return;
|
|
395
|
+
}
|
|
396
|
+
// 아이템 개수 체크
|
|
397
|
+
if (taxInvoiceItems.length === 0) {
|
|
398
|
+
alert('등록 가능한 아아템의 개수는 1개 이상이여야 합니다.');
|
|
399
|
+
return;
|
|
400
|
+
}
|
|
401
|
+
// 현금, 수표, 어음, 외상미수금의 합계 = 총 합계금액 체크
|
|
402
|
+
const paymentAmount = taxInvoice.paymentAmountCash + taxInvoice.paymentAmountCheck + taxInvoice.paymentAmountPromissoryNote + taxInvoice.paymentAmountAccountsReceivable;
|
|
403
|
+
if (paymentAmount > 0 && paymentAmount !== taxInvoice.totalAmount) {
|
|
404
|
+
alert('현금, 수표, 어음, 외상미수금의 합계는 총 합계금액과 동일해야 합니다.');
|
|
405
|
+
return;
|
|
406
|
+
}
|
|
395
407
|
const response = await client.mutate({
|
|
396
408
|
mutation: gql `
|
|
397
|
-
mutation
|
|
398
|
-
|
|
409
|
+
mutation SendTaxInvoicesByApi($taxInvoiceSendList: [TaxInvoiceSend!]!) {
|
|
410
|
+
sendTaxInvoicesByApi(taxInvoiceSendList: $taxInvoiceSendList) {
|
|
399
411
|
id
|
|
400
412
|
}
|
|
401
413
|
}
|
|
402
414
|
`,
|
|
403
415
|
variables: {
|
|
404
|
-
|
|
405
|
-
|
|
416
|
+
taxInvoiceSendList: [
|
|
417
|
+
{
|
|
418
|
+
taxInvoice,
|
|
419
|
+
taxInvoiceItems
|
|
420
|
+
}
|
|
421
|
+
]
|
|
406
422
|
}
|
|
407
423
|
});
|
|
408
424
|
if (!response.errors) {
|
|
409
|
-
notify({
|
|
410
|
-
message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') })
|
|
411
|
-
});
|
|
425
|
+
notify({ message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') }) });
|
|
412
426
|
}
|
|
413
427
|
}
|
|
414
428
|
_numberFormat(value) {
|
|
@@ -417,6 +431,10 @@ let TaxInvoiceSendPage = class TaxInvoiceSendPage extends localize(i18next)(Scop
|
|
|
417
431
|
// Input 요소의 값이 변경될 때 호출되는 콜백 함수
|
|
418
432
|
_onInputTaxInvoice(event) {
|
|
419
433
|
const target = event.target;
|
|
434
|
+
// 숫자 타입은 다른 문자 입력 제거
|
|
435
|
+
if (target.hasAttribute('numeric')) {
|
|
436
|
+
target.value = target.value.replace(/\D/g, '');
|
|
437
|
+
}
|
|
420
438
|
if (target.name.startsWith('supplier')) {
|
|
421
439
|
this.supplier[target.name] = target.value;
|
|
422
440
|
}
|
|
@@ -424,7 +442,16 @@ let TaxInvoiceSendPage = class TaxInvoiceSendPage extends localize(i18next)(Scop
|
|
|
424
442
|
this.buyer[target.name] = target.value;
|
|
425
443
|
}
|
|
426
444
|
else {
|
|
445
|
+
// 날짜 체크가 오늘 날짜를 넘어가면 값 변경 되면 안됨
|
|
446
|
+
if (target.name === 'issueDate' && target.value > this.today) {
|
|
447
|
+
target.value = this.taxInvoice['issueDate'];
|
|
448
|
+
alert('작성일자는 현재일까지 입력하시기 바랍니다.');
|
|
449
|
+
return;
|
|
450
|
+
}
|
|
427
451
|
this.taxInvoice[target.name] = target.value;
|
|
452
|
+
// 날짜 변경시에는 아이템 변경도 리 렌더가 필요해서 데이터 갱신
|
|
453
|
+
if (target.name === 'issueDate')
|
|
454
|
+
this.taxInvoice = Object.assign({}, this.taxInvoice);
|
|
428
455
|
}
|
|
429
456
|
}
|
|
430
457
|
// Input 요소의 값이 변경될 때 호출되는 콜백 함수
|
|
@@ -438,7 +465,12 @@ let TaxInvoiceSendPage = class TaxInvoiceSendPage extends localize(i18next)(Scop
|
|
|
438
465
|
}
|
|
439
466
|
// 공급일자 케이스 시 => 세금계산서의 작성일자의 YYYY-MM + 아이템의 입력된 DD
|
|
440
467
|
if (target.name === 'supplyDate') {
|
|
441
|
-
|
|
468
|
+
const itemDate = this.taxInvoice.issueDate.substring(0, 8) + inputVal.padStart(2, '0');
|
|
469
|
+
if (itemDate > this.taxInvoice.issueDate) {
|
|
470
|
+
alert('품목의 일자는 작성일자보다 클 수 없습니다.');
|
|
471
|
+
target.value = '';
|
|
472
|
+
}
|
|
473
|
+
inputVal = itemDate;
|
|
442
474
|
}
|
|
443
475
|
if (target.name == 'quantity' || target.name == 'unitPrice') {
|
|
444
476
|
const supplyPrice = target.name == 'quantity' ? Number(inputVal) * this.taxInvoiceItems[idx]['unitPrice'] : Number(inputVal) * this.taxInvoiceItems[idx]['quantity'];
|
|
@@ -480,8 +512,7 @@ TaxInvoiceSendPage.styles = [
|
|
|
480
512
|
|
|
481
513
|
width: 100%;
|
|
482
514
|
min-width: 850px;
|
|
483
|
-
|
|
484
|
-
padding-bottom: 40px;
|
|
515
|
+
padding: 0 40px 40px 40px;
|
|
485
516
|
|
|
486
517
|
--grid-record-emphasized-background-color: red;
|
|
487
518
|
--grid-record-emphasized-color: yellow;
|
|
@@ -670,6 +701,21 @@ TaxInvoiceSendPage.styles = [
|
|
|
670
701
|
border: 1.5px solid #c4d2ff;
|
|
671
702
|
border-top: 2px solid #000;
|
|
672
703
|
}
|
|
704
|
+
|
|
705
|
+
span.type-wrapper {
|
|
706
|
+
margin: 0 10px;
|
|
707
|
+
|
|
708
|
+
& > div {
|
|
709
|
+
display: flex;
|
|
710
|
+
justify-content: center;
|
|
711
|
+
align-items: center;
|
|
712
|
+
gap: 4px;
|
|
713
|
+
|
|
714
|
+
input[type='radio' i] {
|
|
715
|
+
margin: 0px;
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
}
|
|
673
719
|
}
|
|
674
720
|
|
|
675
721
|
div.items {
|
|
@@ -709,10 +755,6 @@ TaxInvoiceSendPage.styles = [
|
|
|
709
755
|
}
|
|
710
756
|
`
|
|
711
757
|
];
|
|
712
|
-
__decorate([
|
|
713
|
-
query('form[name="tax-invoice-form"]'),
|
|
714
|
-
__metadata("design:type", HTMLFormElement)
|
|
715
|
-
], TaxInvoiceSendPage.prototype, "taxInvoiceForm", void 0);
|
|
716
758
|
__decorate([
|
|
717
759
|
state(),
|
|
718
760
|
__metadata("design:type", Object)
|