@things-factory/tax-invoice 6.2.84

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 (151) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/assets/images/hatiolab-logo.png +0 -0
  3. package/client/bootstrap.ts +0 -0
  4. package/client/index.ts +0 -0
  5. package/client/pages/main.ts +25 -0
  6. package/client/pages/tax-audit-result/tax-audit-result-importer.ts +97 -0
  7. package/client/pages/tax-audit-result/tax-audit-result-list-page.ts +355 -0
  8. package/client/pages/tax-invoice/tax-invoice-detail-popup.ts +424 -0
  9. package/client/pages/tax-invoice/tax-invoice-list-page.ts +517 -0
  10. package/client/pages/tax-invoice-api/tax-invoice-api-page.ts +428 -0
  11. package/client/pages/tax-invoice-company/tax-invoice-company-importer.ts +175 -0
  12. package/client/pages/tax-invoice-company/tax-invoice-company-list-page.ts +496 -0
  13. package/client/route.ts +23 -0
  14. package/client/tsconfig.json +11 -0
  15. package/dist-client/bootstrap.d.ts +0 -0
  16. package/dist-client/bootstrap.js +2 -0
  17. package/dist-client/bootstrap.js.map +1 -0
  18. package/dist-client/index.d.ts +0 -0
  19. package/dist-client/index.js +2 -0
  20. package/dist-client/index.js.map +1 -0
  21. package/dist-client/pages/main.d.ts +1 -0
  22. package/dist-client/pages/main.js +27 -0
  23. package/dist-client/pages/main.js.map +1 -0
  24. package/dist-client/pages/tax-audit-result/tax-audit-result-importer.d.ts +22 -0
  25. package/dist-client/pages/tax-audit-result/tax-audit-result-importer.js +100 -0
  26. package/dist-client/pages/tax-audit-result/tax-audit-result-importer.js.map +1 -0
  27. package/dist-client/pages/tax-audit-result/tax-audit-result-list-page.d.ts +62 -0
  28. package/dist-client/pages/tax-audit-result/tax-audit-result-list-page.js +331 -0
  29. package/dist-client/pages/tax-audit-result/tax-audit-result-list-page.js.map +1 -0
  30. package/dist-client/pages/tax-invoice/tax-invoice-detail-popup.d.ts +14 -0
  31. package/dist-client/pages/tax-invoice/tax-invoice-detail-popup.js +430 -0
  32. package/dist-client/pages/tax-invoice/tax-invoice-detail-popup.js.map +1 -0
  33. package/dist-client/pages/tax-invoice/tax-invoice-list-page.d.ts +70 -0
  34. package/dist-client/pages/tax-invoice/tax-invoice-list-page.js +500 -0
  35. package/dist-client/pages/tax-invoice/tax-invoice-list-page.js.map +1 -0
  36. package/dist-client/pages/tax-invoice-api/tax-invoice-api-page.d.ts +36 -0
  37. package/dist-client/pages/tax-invoice-api/tax-invoice-api-page.js +419 -0
  38. package/dist-client/pages/tax-invoice-api/tax-invoice-api-page.js.map +1 -0
  39. package/dist-client/pages/tax-invoice-company/tax-invoice-company-importer.d.ts +31 -0
  40. package/dist-client/pages/tax-invoice-company/tax-invoice-company-importer.js +182 -0
  41. package/dist-client/pages/tax-invoice-company/tax-invoice-company-importer.js.map +1 -0
  42. package/dist-client/pages/tax-invoice-company/tax-invoice-company-list-page.d.ts +57 -0
  43. package/dist-client/pages/tax-invoice-company/tax-invoice-company-list-page.js +477 -0
  44. package/dist-client/pages/tax-invoice-company/tax-invoice-company-list-page.js.map +1 -0
  45. package/dist-client/route.d.ts +1 -0
  46. package/dist-client/route.js +20 -0
  47. package/dist-client/route.js.map +1 -0
  48. package/dist-client/tsconfig.tsbuildinfo +1 -0
  49. package/dist-server/index.js +6 -0
  50. package/dist-server/index.js.map +1 -0
  51. package/dist-server/routes.js +25 -0
  52. package/dist-server/routes.js.map +1 -0
  53. package/dist-server/service/index.js +37 -0
  54. package/dist-server/service/index.js.map +1 -0
  55. package/dist-server/service/tax-audit-result/event-subscriber.js +21 -0
  56. package/dist-server/service/tax-audit-result/event-subscriber.js.map +1 -0
  57. package/dist-server/service/tax-audit-result/index.js +12 -0
  58. package/dist-server/service/tax-audit-result/index.js.map +1 -0
  59. package/dist-server/service/tax-audit-result/tax-audit-result-history.js +123 -0
  60. package/dist-server/service/tax-audit-result/tax-audit-result-history.js.map +1 -0
  61. package/dist-server/service/tax-audit-result/tax-audit-result-mutation.js +168 -0
  62. package/dist-server/service/tax-audit-result/tax-audit-result-mutation.js.map +1 -0
  63. package/dist-server/service/tax-audit-result/tax-audit-result-query.js +97 -0
  64. package/dist-server/service/tax-audit-result/tax-audit-result-query.js.map +1 -0
  65. package/dist-server/service/tax-audit-result/tax-audit-result-type.js +86 -0
  66. package/dist-server/service/tax-audit-result/tax-audit-result-type.js.map +1 -0
  67. package/dist-server/service/tax-audit-result/tax-audit-result.js +110 -0
  68. package/dist-server/service/tax-audit-result/tax-audit-result.js.map +1 -0
  69. package/dist-server/service/tax-invoice/index.js +9 -0
  70. package/dist-server/service/tax-invoice/index.js.map +1 -0
  71. package/dist-server/service/tax-invoice/tax-invoice-mutation.js +127 -0
  72. package/dist-server/service/tax-invoice/tax-invoice-mutation.js.map +1 -0
  73. package/dist-server/service/tax-invoice/tax-invoice-query.js +90 -0
  74. package/dist-server/service/tax-invoice/tax-invoice-query.js.map +1 -0
  75. package/dist-server/service/tax-invoice/tax-invoice-type.js +553 -0
  76. package/dist-server/service/tax-invoice/tax-invoice-type.js.map +1 -0
  77. package/dist-server/service/tax-invoice/tax-invoice.js +465 -0
  78. package/dist-server/service/tax-invoice/tax-invoice.js.map +1 -0
  79. package/dist-server/service/tax-invoice-api/index.js +9 -0
  80. package/dist-server/service/tax-invoice-api/index.js.map +1 -0
  81. package/dist-server/service/tax-invoice-api/tax-invoice-api-mutation.js +64 -0
  82. package/dist-server/service/tax-invoice-api/tax-invoice-api-mutation.js.map +1 -0
  83. package/dist-server/service/tax-invoice-api/tax-invoice-api-query.js +79 -0
  84. package/dist-server/service/tax-invoice-api/tax-invoice-api-query.js.map +1 -0
  85. package/dist-server/service/tax-invoice-api/tax-invoice-api-type.js +103 -0
  86. package/dist-server/service/tax-invoice-api/tax-invoice-api-type.js.map +1 -0
  87. package/dist-server/service/tax-invoice-api/tax-invoice-api.js +163 -0
  88. package/dist-server/service/tax-invoice-api/tax-invoice-api.js.map +1 -0
  89. package/dist-server/service/tax-invoice-company/index.js +9 -0
  90. package/dist-server/service/tax-invoice-company/index.js.map +1 -0
  91. package/dist-server/service/tax-invoice-company/tax-invoice-company-mutation.js +80 -0
  92. package/dist-server/service/tax-invoice-company/tax-invoice-company-mutation.js.map +1 -0
  93. package/dist-server/service/tax-invoice-company/tax-invoice-company-query.js +89 -0
  94. package/dist-server/service/tax-invoice-company/tax-invoice-company-query.js.map +1 -0
  95. package/dist-server/service/tax-invoice-company/tax-invoice-company-type.js +100 -0
  96. package/dist-server/service/tax-invoice-company/tax-invoice-company-type.js.map +1 -0
  97. package/dist-server/service/tax-invoice-company/tax-invoice-company.js +166 -0
  98. package/dist-server/service/tax-invoice-company/tax-invoice-company.js.map +1 -0
  99. package/dist-server/service/tax-invoice-item/index.js +9 -0
  100. package/dist-server/service/tax-invoice-item/index.js.map +1 -0
  101. package/dist-server/service/tax-invoice-item/tax-invoice-item-mutation.js +127 -0
  102. package/dist-server/service/tax-invoice-item/tax-invoice-item-mutation.js.map +1 -0
  103. package/dist-server/service/tax-invoice-item/tax-invoice-item-query.js +87 -0
  104. package/dist-server/service/tax-invoice-item/tax-invoice-item-query.js.map +1 -0
  105. package/dist-server/service/tax-invoice-item/tax-invoice-item-type.js +121 -0
  106. package/dist-server/service/tax-invoice-item/tax-invoice-item-type.js.map +1 -0
  107. package/dist-server/service/tax-invoice-item/tax-invoice-item.js +115 -0
  108. package/dist-server/service/tax-invoice-item/tax-invoice-item.js.map +1 -0
  109. package/dist-server/tsconfig.tsbuildinfo +1 -0
  110. package/helps/tax-invoice/tax-audit-result.md +160 -0
  111. package/helps/tax-invoice/tax-invoice-api.md +160 -0
  112. package/helps/tax-invoice/tax-invoice-send.md +160 -0
  113. package/helps/tax-invoice/tax-invoice.md +160 -0
  114. package/package.json +37 -0
  115. package/server/index.ts +2 -0
  116. package/server/routes.ts +28 -0
  117. package/server/service/index.ts +36 -0
  118. package/server/service/tax-audit-result/event-subscriber.ts +17 -0
  119. package/server/service/tax-audit-result/index.ts +9 -0
  120. package/server/service/tax-audit-result/tax-audit-result-history.ts +110 -0
  121. package/server/service/tax-audit-result/tax-audit-result-mutation.ts +198 -0
  122. package/server/service/tax-audit-result/tax-audit-result-query.ts +62 -0
  123. package/server/service/tax-audit-result/tax-audit-result-type.ts +61 -0
  124. package/server/service/tax-audit-result/tax-audit-result.ts +95 -0
  125. package/server/service/tax-invoice/index.ts +6 -0
  126. package/server/service/tax-invoice/tax-invoice-mutation.ts +122 -0
  127. package/server/service/tax-invoice/tax-invoice-query.ts +54 -0
  128. package/server/service/tax-invoice/tax-invoice-type.ts +411 -0
  129. package/server/service/tax-invoice/tax-invoice.ts +389 -0
  130. package/server/service/tax-invoice-api/index.ts +6 -0
  131. package/server/service/tax-invoice-api/tax-invoice-api-mutation.ts +67 -0
  132. package/server/service/tax-invoice-api/tax-invoice-api-query.ts +48 -0
  133. package/server/service/tax-invoice-api/tax-invoice-api-type.ts +71 -0
  134. package/server/service/tax-invoice-api/tax-invoice-api.ts +137 -0
  135. package/server/service/tax-invoice-company/index.ts +6 -0
  136. package/server/service/tax-invoice-company/tax-invoice-company-mutation.ts +84 -0
  137. package/server/service/tax-invoice-company/tax-invoice-company-query.ts +53 -0
  138. package/server/service/tax-invoice-company/tax-invoice-company-type.ts +69 -0
  139. package/server/service/tax-invoice-company/tax-invoice-company.ts +142 -0
  140. package/server/service/tax-invoice-item/index.ts +6 -0
  141. package/server/service/tax-invoice-item/tax-invoice-item-mutation.ts +128 -0
  142. package/server/service/tax-invoice-item/tax-invoice-item-query.ts +57 -0
  143. package/server/service/tax-invoice-item/tax-invoice-item-type.ts +86 -0
  144. package/server/service/tax-invoice-item/tax-invoice-item.ts +85 -0
  145. package/server/tsconfig.json +10 -0
  146. package/things-factory.config.js +23 -0
  147. package/translations/en.json +1 -0
  148. package/translations/ja.json +1 -0
  149. package/translations/ko.json +71 -0
  150. package/translations/ms.json +1 -0
  151. package/translations/zh.json +1 -0
@@ -0,0 +1,496 @@
1
+ import '@operato/data-grist'
2
+
3
+ import { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'
4
+ import { PageView } from '@operato/shell'
5
+ import { css, html } from 'lit'
6
+ import { customElement, property, query } from 'lit/decorators.js'
7
+ import { ScopedElementsMixin } from '@open-wc/scoped-elements'
8
+ import { DataGrist, FetchOption } from '@operato/data-grist'
9
+ import { client } from '@operato/graphql'
10
+ import { i18next, localize } from '@operato/i18n'
11
+ import { notify, openPopup } from '@operato/layout'
12
+ import { OxPrompt } from '@operato/popup'
13
+ import { isMobileDevice } from '@operato/utils'
14
+ import gql from 'graphql-tag'
15
+ import { TaxInvoiceCompanyImporter } from './tax-invoice-company-importer'
16
+
17
+ export enum CompanyType {
18
+ SUPPLIER = 10, // 공급자
19
+ BUYER = 20 // 거래처
20
+ }
21
+ export const COMPANY_TYPE_LABEL = {
22
+ [CompanyType.SUPPLIER]: '공급자',
23
+ [CompanyType.BUYER]: '거래처'
24
+ }
25
+
26
+ @customElement('tax-invoice-company-list-page')
27
+ export class TaxInvoiceCompanyListPage extends localize(i18next)(ScopedElementsMixin(PageView)) {
28
+ static styles = [
29
+ ScrollbarStyles,
30
+ CommonGristStyles,
31
+ css`
32
+ :host {
33
+ display: flex;
34
+
35
+ width: 100%;
36
+
37
+ --grid-record-emphasized-background-color: red;
38
+ --grid-record-emphasized-color: yellow;
39
+ }
40
+ `
41
+ ]
42
+
43
+ static get scopedElements() {
44
+ return {
45
+ 'tax-invoice-company-importer': TaxInvoiceCompanyImporter
46
+ }
47
+ }
48
+
49
+ @property({ type: Object }) gristConfig: any
50
+ @property({ type: String }) mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'
51
+
52
+ @query('ox-grist') private grist!: DataGrist
53
+
54
+ get context() {
55
+ return {
56
+ title: i18next.t('title.tax invoice company list'),
57
+ help: 'tax-invoice-company/tax-invoice-company',
58
+ actions: [
59
+ {
60
+ title: i18next.t('button.save'),
61
+ action: this._updateTaxInvoiceCompany.bind(this),
62
+ ...CommonButtonStyles.save
63
+ },
64
+ {
65
+ title: i18next.t('button.delete'),
66
+ action: this._deleteTaxInvoiceCompany.bind(this),
67
+ ...CommonButtonStyles.delete
68
+ }
69
+ ],
70
+ exportable: {
71
+ name: i18next.t('title.tax invoice company list'),
72
+ data: this.exportHandler.bind(this)
73
+ },
74
+ importable: {
75
+ handler: this.importHandler.bind(this)
76
+ }
77
+ }
78
+ }
79
+
80
+ render() {
81
+ const mode = this.mode || (isMobileDevice() ? 'CARD' : 'GRID')
82
+
83
+ return html`
84
+ <ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
85
+ <div slot="headroom">
86
+ <div id="filters">
87
+ <ox-filters-form autofocus></ox-filters-form>
88
+ </div>
89
+ </div>
90
+ </ox-grist>
91
+ `
92
+ }
93
+
94
+ async pageInitialized(lifecycle: any) {
95
+ this.gristConfig = {
96
+ list: {
97
+ fields: ['name', 'description'],
98
+ details: ['name', 'updatedAt']
99
+ },
100
+ columns: [
101
+ { type: 'gutter', gutterName: 'sequence' },
102
+ { type: 'gutter', gutterName: 'row-selector', multiple: true },
103
+ {
104
+ type: 'string',
105
+ name: 'name',
106
+ header: i18next.t('field.name'),
107
+ record: {
108
+ editable: true,
109
+ classifier: () => ({ emphasized: ['#D1E8FF', '#000'] })
110
+ },
111
+ filter: 'search',
112
+ sortable: true,
113
+ width: 150
114
+ },
115
+ {
116
+ type: 'string',
117
+ name: 'description',
118
+ header: i18next.t('field.description'),
119
+ record: {
120
+ editable: true
121
+ },
122
+ filter: 'search',
123
+ width: 200
124
+ },
125
+ {
126
+ type: 'select',
127
+ name: 'type',
128
+ header: i18next.t('field.type'),
129
+ record: {
130
+ editable: true,
131
+ classifier: () => ({ emphasized: ['#D1E8FF', '#000'] }),
132
+ options: [
133
+ {},
134
+ {
135
+ display: i18next.t('text.company supplier'),
136
+ value: CompanyType.SUPPLIER
137
+ },
138
+ {
139
+ display: i18next.t('text.company buyer'),
140
+ value: CompanyType.BUYER
141
+ }
142
+ ]
143
+ },
144
+ width: 100
145
+ },
146
+ {
147
+ type: 'string',
148
+ name: 'businessRegistrationNumber',
149
+ header: i18next.t('field.business registration number'),
150
+ record: {
151
+ editable: true
152
+ },
153
+ width: 150
154
+ },
155
+ {
156
+ type: 'string',
157
+ name: 'branchIdentification',
158
+ header: i18next.t('field.branch identification'),
159
+ record: {
160
+ editable: true
161
+ },
162
+ width: 150
163
+ },
164
+ {
165
+ type: 'string',
166
+ name: 'businessName',
167
+ header: i18next.t('field.business name'),
168
+ record: {
169
+ editable: true
170
+ },
171
+ width: 150
172
+ },
173
+ {
174
+ type: 'string',
175
+ name: 'representativeName',
176
+ header: i18next.t('field.representative name'),
177
+ record: {
178
+ editable: true
179
+ },
180
+ width: 150
181
+ },
182
+ {
183
+ type: 'string',
184
+ name: 'address',
185
+ header: i18next.t('field.address'),
186
+ record: {
187
+ editable: true
188
+ },
189
+ width: 200
190
+ },
191
+ {
192
+ type: 'string',
193
+ name: 'businessType',
194
+ header: i18next.t('field.business type'),
195
+ record: {
196
+ editable: true
197
+ },
198
+ width: 100
199
+ },
200
+ {
201
+ type: 'string',
202
+ name: 'industryType',
203
+ header: i18next.t('field.industry type'),
204
+ record: {
205
+ editable: true
206
+ },
207
+ width: 100
208
+ },
209
+ {
210
+ type: 'string',
211
+ name: 'department',
212
+ header: i18next.t('field.department'),
213
+ record: {
214
+ editable: true
215
+ },
216
+ width: 150
217
+ },
218
+ {
219
+ type: 'string',
220
+ name: 'contactName',
221
+ header: i18next.t('field.contact name'),
222
+ record: {
223
+ editable: true
224
+ },
225
+ width: 150
226
+ },
227
+ {
228
+ type: 'string',
229
+ name: 'contactPhone',
230
+ header: i18next.t('field.contact phone'),
231
+ record: {
232
+ editable: true
233
+ },
234
+ width: 150
235
+ },
236
+ {
237
+ type: 'string',
238
+ name: 'contactEmail',
239
+ header: i18next.t('field.contact email'),
240
+ record: {
241
+ editable: true
242
+ },
243
+ width: 150
244
+ },
245
+ {
246
+ type: 'string',
247
+ name: 'contactCellPhone',
248
+ header: i18next.t('field.contact cell phone'),
249
+ record: {
250
+ editable: true
251
+ },
252
+ width: 150
253
+ },
254
+ {
255
+ type: 'attributes',
256
+ name: 'attributes',
257
+ header: i18next.t('field.attributes'),
258
+ record: {
259
+ editable: true,
260
+ options: async () => {
261
+ return {
262
+ objectified: true,
263
+ attributeSet: await this.getAttributeSetForDomain()
264
+ }
265
+ }
266
+ },
267
+ width: 150
268
+ },
269
+ {
270
+ type: 'resource-object',
271
+ name: 'updater',
272
+ header: i18next.t('field.updater'),
273
+ record: {
274
+ editable: false
275
+ },
276
+ width: 120
277
+ },
278
+ {
279
+ type: 'datetime',
280
+ name: 'updatedAt',
281
+ header: i18next.t('field.updated_at'),
282
+ record: {
283
+ editable: false
284
+ },
285
+ width: 180
286
+ }
287
+ ],
288
+ rows: {
289
+ selectable: {
290
+ multiple: true
291
+ }
292
+ },
293
+ sorters: [
294
+ {
295
+ name: 'name'
296
+ }
297
+ ]
298
+ }
299
+ }
300
+
301
+ async pageUpdated(changes: any, lifecycle: any) {
302
+ if (this.active) {
303
+ this.grist.fetch()
304
+ }
305
+ }
306
+
307
+ async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }: FetchOption) {
308
+ const response = await client.query({
309
+ query: gql`
310
+ query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
311
+ responses: taxInvoiceCompanies(filters: $filters, pagination: $pagination, sortings: $sortings) {
312
+ items {
313
+ id
314
+ name
315
+ description
316
+ type
317
+ businessRegistrationNumber
318
+ branchIdentification
319
+ businessName
320
+ representativeName
321
+ address
322
+ businessType
323
+ industryType
324
+ department
325
+ contactName
326
+ contactPhone
327
+ contactEmail
328
+ contactCellPhone
329
+ attributes
330
+ updater {
331
+ id
332
+ name
333
+ }
334
+ updatedAt
335
+ }
336
+ total
337
+ }
338
+ }
339
+ `,
340
+ variables: {
341
+ filters,
342
+ pagination: { page, limit },
343
+ sortings
344
+ }
345
+ })
346
+
347
+ return {
348
+ total: response.data.responses.total || 0,
349
+ records: response.data.responses.items || []
350
+ }
351
+ }
352
+
353
+ async _deleteTaxInvoiceCompany() {
354
+ if (
355
+ await OxPrompt.open({
356
+ title: i18next.t('text.are_you_sure'),
357
+ text: i18next.t('text.sure_to_x', { x: i18next.t('text.delete') }),
358
+ confirmButton: { text: i18next.t('button.confirm') },
359
+ cancelButton: { text: i18next.t('button.cancel') }
360
+ })
361
+ ) {
362
+ const ids = this.grist.selected.map(record => record.id)
363
+ if (ids && ids.length > 0) {
364
+ const response = await client.mutate({
365
+ mutation: gql`
366
+ mutation ($ids: [String!]!) {
367
+ deleteTaxInvoiceCompanies(ids: $ids)
368
+ }
369
+ `,
370
+ variables: {
371
+ ids
372
+ }
373
+ })
374
+
375
+ if (!response.errors) {
376
+ this.grist.fetch()
377
+ notify({
378
+ message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') })
379
+ })
380
+ }
381
+ }
382
+ }
383
+ }
384
+
385
+ async _updateTaxInvoiceCompany() {
386
+ let patches = this.grist.dirtyRecords
387
+ if (patches && patches.length) {
388
+ patches = patches.map(patch => {
389
+ let patchField: any = patch.id ? { id: patch.id } : {}
390
+ const dirtyFields = patch.__dirtyfields__
391
+ for (let key in dirtyFields) {
392
+ patchField[key] = key === 'type' ? Number(dirtyFields[key].after) : dirtyFields[key].after
393
+ }
394
+ patchField.cuFlag = patch.__dirty__
395
+
396
+ return patchField
397
+ })
398
+
399
+ const response = await client.mutate({
400
+ mutation: gql`
401
+ mutation ($patches: [TaxInvoiceCompanyPatch!]!) {
402
+ updateMultipleTaxInvoiceCompany(patches: $patches) {
403
+ name
404
+ }
405
+ }
406
+ `,
407
+ variables: {
408
+ patches
409
+ }
410
+ })
411
+
412
+ if (!response.errors) {
413
+ this.grist.fetch()
414
+ }
415
+ }
416
+ }
417
+
418
+ async getAttributeSetForDomain() {
419
+ const response = await client.query({
420
+ query: gql`
421
+ query {
422
+ attributeSet: attributeSetByEntity(entity: "Domain") {
423
+ entity
424
+ description
425
+ items {
426
+ name
427
+ description
428
+ tag
429
+ type
430
+ active
431
+ hidden
432
+ options
433
+ }
434
+ }
435
+ }
436
+ `
437
+ })
438
+
439
+ return response.data?.attributeSet || {}
440
+ }
441
+
442
+ async exportHandler() {
443
+ const exportTargets = this.grist.selected.length ? this.grist.selected : this.grist.dirtyData.records
444
+ const targetFieldSet = new Set([
445
+ 'id',
446
+ 'name',
447
+ 'description',
448
+ 'type',
449
+ 'businessRegistrationNumber',
450
+ 'branchIdentification',
451
+ 'businessName',
452
+ 'representativeName',
453
+ 'address',
454
+ 'businessType',
455
+ 'industryType',
456
+ 'department',
457
+ 'contactName',
458
+ 'contactPhone',
459
+ 'contactEmail',
460
+ 'contactCellPhone',
461
+ 'attributes'
462
+ ])
463
+
464
+ return exportTargets.map(taxInvoice => {
465
+ let tempObj = {}
466
+ for (const field of targetFieldSet) {
467
+ tempObj[field] = taxInvoice[field]
468
+ }
469
+
470
+ return tempObj
471
+ })
472
+ }
473
+
474
+ async importHandler(records) {
475
+ const popup = openPopup(
476
+ html`
477
+ <tax-invoice-company-importer
478
+ .taxInvoiceCompanies=${records}
479
+ @imported=${() => {
480
+ history.back()
481
+ this.grist.fetch()
482
+ }}
483
+ ></tax-invoice-company-importer>
484
+ `,
485
+ {
486
+ backdrop: true,
487
+ size: 'large',
488
+ title: i18next.t('title.import tax invoice company')
489
+ }
490
+ )
491
+
492
+ popup.onclosed = () => {
493
+ this.grist.fetch()
494
+ }
495
+ }
496
+ }
@@ -0,0 +1,23 @@
1
+ export default function route(page: string) {
2
+ switch (page) {
3
+ case 'tax-invoice-main':
4
+ import('./pages/main')
5
+ return page
6
+
7
+ case 'tax-invoice-list':
8
+ import('./pages/tax-invoice/tax-invoice-list-page')
9
+ return page
10
+
11
+ case 'tax-invoice-company-list':
12
+ import('./pages/tax-invoice-company/tax-invoice-company-list-page')
13
+ return page
14
+
15
+ case 'tax-invoice-api':
16
+ import('./pages/tax-invoice-api/tax-invoice-api-page')
17
+ return page
18
+
19
+ case 'tax-audit-result-list':
20
+ import('./pages/tax-audit-result/tax-audit-result-list-page')
21
+ return page
22
+ }
23
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "extends": "../../tsconfig-base.json",
3
+ "compilerOptions": {
4
+ "strict": true,
5
+ "declaration": true,
6
+ "module": "esnext",
7
+ "outDir": "../dist-client",
8
+ "baseUrl": "./"
9
+ },
10
+ "include": ["./**/*"]
11
+ }
File without changes
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=bootstrap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../client/bootstrap.ts"],"names":[],"mappings":"","sourcesContent":[""]}
File without changes
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../client/index.ts"],"names":[],"mappings":"","sourcesContent":[""]}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,27 @@
1
+ import { __decorate, __metadata } from "tslib";
2
+ import { html } from 'lit';
3
+ import { customElement, property } from 'lit/decorators.js';
4
+ import { connect } from 'pwa-helpers/connect-mixin.js';
5
+ import { store, PageView } from '@operato/shell';
6
+ const logo = new URL('/assets/images/hatiolab-logo.png', import.meta.url).href;
7
+ let TaxInvoiceMain = class TaxInvoiceMain extends connect(store)(PageView) {
8
+ render() {
9
+ return html `
10
+ <section>
11
+ <h2>TaxInvoice</h2>
12
+ <img src=${logo}>
13
+ </section>
14
+ `;
15
+ }
16
+ stateChanged(state) {
17
+ this.taxInvoice = state.taxInvoice.state_main;
18
+ }
19
+ };
20
+ __decorate([
21
+ property({ type: String }),
22
+ __metadata("design:type", String)
23
+ ], TaxInvoiceMain.prototype, "taxInvoice", void 0);
24
+ TaxInvoiceMain = __decorate([
25
+ customElement('tax-invoice-main')
26
+ ], TaxInvoiceMain);
27
+ //# sourceMappingURL=main.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.js","sourceRoot":"","sources":["../../client/pages/main.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC1B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAA;AACtD,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAEhD,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,kCAAkC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAG9E,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC;IAGnD,MAAM;QACJ,OAAO,IAAI,CAAA;;;mBAGI,IAAI;;KAElB,CAAA;IACH,CAAC;IAED,YAAY,CAAC,KAAK;QAChB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC,UAAU,CAAA;IAC/C,CAAC;CACF,CAAA;AAdC;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;kDAAoB;AAD3C,cAAc;IADnB,aAAa,CAAC,kBAAkB,CAAC;GAC5B,cAAc,CAenB","sourcesContent":["import { html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { connect } from 'pwa-helpers/connect-mixin.js'\nimport { store, PageView } from '@operato/shell'\n\nconst logo = new URL('/assets/images/hatiolab-logo.png', import.meta.url).href\n\n@customElement('tax-invoice-main')\nclass TaxInvoiceMain extends connect(store)(PageView) {\n @property({ type: String }) taxInvoice?: string\n\n render() {\n return html`\n <section>\n <h2>TaxInvoice</h2>\n <img src=${logo}>\n </section>\n `\n }\n\n stateChanged(state) {\n this.taxInvoice = state.taxInvoice.state_main\n }\n}\n\n"]}
@@ -0,0 +1,22 @@
1
+ import '@operato/data-grist';
2
+ import { LitElement } from 'lit';
3
+ export declare class TaxAuditResultImporter extends LitElement {
4
+ static styles: import("lit").CSSResult[];
5
+ taxAuditResults: any[];
6
+ columns: {
7
+ list: {
8
+ fields: string[];
9
+ };
10
+ pagination: {
11
+ infinite: boolean;
12
+ };
13
+ columns: {
14
+ type: string;
15
+ name: string;
16
+ header: string;
17
+ width: number;
18
+ }[];
19
+ };
20
+ render(): import("lit-html").TemplateResult<1>;
21
+ save(): Promise<void>;
22
+ }