@things-factory/tax-invoice 8.0.0 → 9.0.0-beta.3

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 (51) hide show
  1. package/dist-client/tsconfig.tsbuildinfo +1 -1
  2. package/dist-server/tsconfig.tsbuildinfo +1 -1
  3. package/package.json +8 -8
  4. package/client/bootstrap.ts +0 -1
  5. package/client/index.ts +0 -0
  6. package/client/pages/main.ts +0 -25
  7. package/client/pages/tax-audit-result/tax-audit-result-importer.ts +0 -87
  8. package/client/pages/tax-audit-result/tax-audit-result-list-page.ts +0 -331
  9. package/client/pages/tax-invoice/tax-invoice-detail-popup.ts +0 -454
  10. package/client/pages/tax-invoice/tax-invoice-list-page.ts +0 -525
  11. package/client/pages/tax-invoice-api/tax-invoice-api-page.ts +0 -418
  12. package/client/pages/tax-invoice-company/tax-invoice-company-list-page.ts +0 -447
  13. package/client/pages/tax-invoice-send/company-list-popup.ts +0 -188
  14. package/client/pages/tax-invoice-send/tax-invoice-send-page.ts +0 -196
  15. package/client/pages/tax-invoice-send/tax-invoice-send.ts +0 -1181
  16. package/client/route.ts +0 -23
  17. package/client/tsconfig.json +0 -11
  18. package/server/index.ts +0 -2
  19. package/server/routes.ts +0 -28
  20. package/server/service/index.ts +0 -37
  21. package/server/service/tax-audit-result/event-subscriber.ts +0 -17
  22. package/server/service/tax-audit-result/index.ts +0 -9
  23. package/server/service/tax-audit-result/tax-audit-result-history.ts +0 -120
  24. package/server/service/tax-audit-result/tax-audit-result-mutation.ts +0 -198
  25. package/server/service/tax-audit-result/tax-audit-result-query.ts +0 -65
  26. package/server/service/tax-audit-result/tax-audit-result-type.ts +0 -61
  27. package/server/service/tax-audit-result/tax-audit-result.ts +0 -99
  28. package/server/service/tax-invoice/index.ts +0 -6
  29. package/server/service/tax-invoice/tax-invoice-mutation.ts +0 -138
  30. package/server/service/tax-invoice/tax-invoice-query.ts +0 -99
  31. package/server/service/tax-invoice/tax-invoice-type.ts +0 -236
  32. package/server/service/tax-invoice/tax-invoice-util.ts +0 -224
  33. package/server/service/tax-invoice/tax-invoice.ts +0 -393
  34. package/server/service/tax-invoice-api/index.ts +0 -6
  35. package/server/service/tax-invoice-api/tax-invoice-api-mutation.ts +0 -275
  36. package/server/service/tax-invoice-api/tax-invoice-api-query.ts +0 -40
  37. package/server/service/tax-invoice-api/tax-invoice-api-type.ts +0 -83
  38. package/server/service/tax-invoice-api/tax-invoice-api.ts +0 -128
  39. package/server/service/tax-invoice-company/index.ts +0 -6
  40. package/server/service/tax-invoice-company/tax-invoice-company-mutation.ts +0 -84
  41. package/server/service/tax-invoice-company/tax-invoice-company-query.ts +0 -86
  42. package/server/service/tax-invoice-company/tax-invoice-company-type.ts +0 -105
  43. package/server/service/tax-invoice-company/tax-invoice-company.ts +0 -128
  44. package/server/service/tax-invoice-item/index.ts +0 -6
  45. package/server/service/tax-invoice-item/tax-invoice-item-mutation.ts +0 -128
  46. package/server/service/tax-invoice-item/tax-invoice-item-query.ts +0 -60
  47. package/server/service/tax-invoice-item/tax-invoice-item-type.ts +0 -77
  48. package/server/service/tax-invoice-item/tax-invoice-item.ts +0 -95
  49. package/server/service/unipost-api/tax-invoice-inquiry.ts +0 -99
  50. package/server/service/unipost-api/tax-invoice-send.ts +0 -32
  51. package/server/tsconfig.json +0 -10
@@ -1,447 +0,0 @@
1
- import '@operato/data-grist'
2
-
3
- import { CommonButtonStyles, CommonHeaderStyles, 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 } from '@operato/layout'
12
- import { OxPrompt } from '@operato/popup'
13
- import { isMobileDevice } from '@operato/utils'
14
- import gql from 'graphql-tag'
15
-
16
- @customElement('tax-invoice-company-list-page')
17
- export class TaxInvoiceCompanyListPage extends localize(i18next)(ScopedElementsMixin(PageView)) {
18
- static styles = [
19
- ScrollbarStyles,
20
- CommonGristStyles,
21
- CommonHeaderStyles,
22
- css`
23
- :host {
24
- display: flex;
25
-
26
- width: 100%;
27
-
28
- --grid-record-emphasized-background-color: red;
29
- --grid-record-emphasized-color: yellow;
30
- }
31
-
32
- ox-grist {
33
- overflow-y: auto;
34
- flex: 1;
35
- }
36
-
37
- .header {
38
- grid-template-areas: 'filters actions';
39
- }
40
- `
41
- ]
42
-
43
- @property({ type: Object }) gristConfig: any
44
- @property({ type: String }) mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'
45
-
46
- @query('ox-grist') private grist!: DataGrist
47
-
48
- get context() {
49
- return {
50
- title: i18next.t('title.tax invoice company list'),
51
- search: {
52
- handler: (search: string) => {
53
- this.grist.searchText = search
54
- },
55
- value: this.grist?.searchText || ''
56
- },
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
- }
75
- }
76
-
77
- render() {
78
- const mode = this.mode || (isMobileDevice() ? 'CARD' : 'GRID')
79
-
80
- return html`
81
- <ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
82
- <div slot="headroom" class="header">
83
- <!-- <div class="filters">
84
- <ox-filters-form autofocus without-search></ox-filters-form>
85
- </div> -->
86
- </div>
87
- </ox-grist>
88
- `
89
- }
90
-
91
- async pageInitialized(lifecycle: any) {
92
- this.gristConfig = {
93
- list: {
94
- fields: ['name', 'description'],
95
- details: ['name', 'updatedAt']
96
- },
97
- columns: [
98
- { type: 'gutter', gutterName: 'sequence' },
99
- { type: 'gutter', gutterName: 'row-selector', multiple: true },
100
- {
101
- type: 'string',
102
- name: 'name',
103
- header: i18next.t('field.name'),
104
- record: {
105
- editable: true,
106
- classifier: () => ({ emphasized: ['#D1E8FF', '#000'] })
107
- },
108
- filter: 'search',
109
- sortable: true,
110
- width: 150
111
- },
112
- {
113
- type: 'string',
114
- name: 'description',
115
- header: i18next.t('field.description'),
116
- record: {
117
- editable: true
118
- },
119
- filter: 'search',
120
- width: 200
121
- },
122
- {
123
- type: 'string',
124
- name: 'businessRegistrationNumber',
125
- header: i18next.t('field.business registration number'),
126
- record: {
127
- editable: true
128
- },
129
- width: 150
130
- },
131
- {
132
- type: 'string',
133
- name: 'branchIdentification',
134
- header: i18next.t('field.branch identification'),
135
- record: {
136
- editable: true
137
- },
138
- width: 150
139
- },
140
- {
141
- type: 'string',
142
- name: 'businessName',
143
- header: i18next.t('field.tax invoice business name'),
144
- record: {
145
- editable: true
146
- },
147
- width: 150
148
- },
149
- {
150
- type: 'string',
151
- name: 'representativeName',
152
- header: i18next.t('field.tax invoice representative name'),
153
- record: {
154
- editable: true
155
- },
156
- width: 150
157
- },
158
- {
159
- type: 'string',
160
- name: 'address',
161
- header: i18next.t('field.address'),
162
- record: {
163
- editable: true
164
- },
165
- width: 200
166
- },
167
- {
168
- type: 'string',
169
- name: 'businessType',
170
- header: i18next.t('field.business type'),
171
- record: {
172
- editable: true
173
- },
174
- width: 100
175
- },
176
- {
177
- type: 'string',
178
- name: 'industryType',
179
- header: i18next.t('field.industry type'),
180
- record: {
181
- editable: true
182
- },
183
- width: 100
184
- },
185
- {
186
- type: 'string',
187
- name: 'department',
188
- header: i18next.t('field.department'),
189
- record: {
190
- editable: true
191
- },
192
- width: 150
193
- },
194
- {
195
- type: 'string',
196
- name: 'contactName',
197
- header: i18next.t('field.contact name'),
198
- record: {
199
- editable: true
200
- },
201
- width: 150
202
- },
203
- {
204
- type: 'string',
205
- name: 'contactPhone',
206
- header: i18next.t('field.contact phone'),
207
- record: {
208
- editable: true
209
- },
210
- width: 150
211
- },
212
- {
213
- type: 'string',
214
- name: 'contactEmail',
215
- header: i18next.t('field.contact email'),
216
- record: {
217
- editable: true
218
- },
219
- width: 150
220
- },
221
- {
222
- type: 'string',
223
- name: 'contactCellPhone',
224
- header: i18next.t('field.contact cell phone'),
225
- record: {
226
- editable: true
227
- },
228
- width: 150
229
- },
230
- {
231
- type: 'attributes',
232
- name: 'attributes',
233
- header: i18next.t('field.attributes'),
234
- record: {
235
- editable: true,
236
- options: async () => {
237
- return {
238
- objectified: true,
239
- attributeSet: await this.getAttributeSetForDomain()
240
- }
241
- }
242
- },
243
- width: 150
244
- },
245
- {
246
- type: 'resource-object',
247
- name: 'updater',
248
- header: i18next.t('field.updater'),
249
- record: {
250
- editable: false
251
- },
252
- width: 120
253
- },
254
- {
255
- type: 'datetime',
256
- name: 'updatedAt',
257
- header: i18next.t('field.updated_at'),
258
- record: {
259
- editable: false
260
- },
261
- width: 180
262
- }
263
- ],
264
- rows: {
265
- selectable: {
266
- multiple: true
267
- }
268
- },
269
- sorters: [
270
- {
271
- name: 'name'
272
- }
273
- ]
274
- }
275
- }
276
-
277
- async pageUpdated(changes: any, lifecycle: any) {
278
- if (this.active) {
279
- this.grist.fetch()
280
- }
281
- }
282
-
283
- async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }: FetchOption) {
284
- const response = await client.query({
285
- query: gql`
286
- query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
287
- responses: taxInvoiceCompanies(filters: $filters, pagination: $pagination, sortings: $sortings) {
288
- items {
289
- id
290
- name
291
- description
292
- businessRegistrationNumber
293
- branchIdentification
294
- businessName
295
- representativeName
296
- address
297
- businessType
298
- industryType
299
- department
300
- contactName
301
- contactPhone
302
- contactEmail
303
- contactCellPhone
304
- attributes
305
- updater {
306
- id
307
- name
308
- }
309
- updatedAt
310
- }
311
- total
312
- }
313
- }
314
- `,
315
- variables: {
316
- filters,
317
- pagination: { page, limit },
318
- sortings
319
- }
320
- })
321
-
322
- return {
323
- total: response.data.responses.total || 0,
324
- records: response.data.responses.items || []
325
- }
326
- }
327
-
328
- async _deleteTaxInvoiceCompany() {
329
- if (
330
- await OxPrompt.open({
331
- title: i18next.t('text.are_you_sure'),
332
- text: i18next.t('text.sure_to_x', { x: i18next.t('text.delete') }),
333
- confirmButton: { text: i18next.t('button.confirm') },
334
- cancelButton: { text: i18next.t('button.cancel') }
335
- })
336
- ) {
337
- const ids = this.grist.selected.map(record => record.id)
338
- if (ids && ids.length > 0) {
339
- const response = await client.mutate({
340
- mutation: gql`
341
- mutation ($ids: [String!]!) {
342
- deleteTaxInvoiceCompanies(ids: $ids)
343
- }
344
- `,
345
- variables: {
346
- ids
347
- }
348
- })
349
-
350
- if (!response.errors) {
351
- this.grist.fetch()
352
- notify({
353
- message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') })
354
- })
355
- }
356
- }
357
- }
358
- }
359
-
360
- async _updateTaxInvoiceCompany() {
361
- let patches = this.grist.dirtyRecords
362
- if (patches && patches.length) {
363
- patches = patches.map(patch => {
364
- let patchField: any = patch.id ? { id: patch.id } : {}
365
- const dirtyFields = patch.__dirtyfields__
366
- for (let key in dirtyFields) {
367
- patchField[key] = key === 'type' ? Number(dirtyFields[key].after) : dirtyFields[key].after
368
- }
369
- patchField.cuFlag = patch.__dirty__
370
-
371
- return patchField
372
- })
373
-
374
- const response = await client.mutate({
375
- mutation: gql`
376
- mutation ($patches: [TaxInvoiceCompanyPatch!]!) {
377
- updateMultipleTaxInvoiceCompany(patches: $patches) {
378
- name
379
- }
380
- }
381
- `,
382
- variables: {
383
- patches
384
- }
385
- })
386
-
387
- if (!response.errors) {
388
- this.grist.fetch()
389
- }
390
- }
391
- }
392
-
393
- async getAttributeSetForDomain() {
394
- const response = await client.query({
395
- query: gql`
396
- query {
397
- attributeSet: attributeSetByEntity(entity: "Domain") {
398
- entity
399
- description
400
- items {
401
- name
402
- description
403
- tag
404
- type
405
- active
406
- hidden
407
- options
408
- }
409
- }
410
- }
411
- `
412
- })
413
-
414
- return response.data?.attributeSet || {}
415
- }
416
-
417
- async exportHandler() {
418
- const exportTargets = this.grist.selected.length ? this.grist.selected : this.grist.dirtyData.records
419
- const targetFieldSet = new Set([
420
- 'id',
421
- 'name',
422
- 'description',
423
- 'businessRegistrationNumber',
424
- 'branchIdentification',
425
- 'businessName',
426
- 'representativeName',
427
- 'address',
428
- 'businessType',
429
- 'industryType',
430
- 'department',
431
- 'contactName',
432
- 'contactPhone',
433
- 'contactEmail',
434
- 'contactCellPhone',
435
- 'attributes'
436
- ])
437
-
438
- return exportTargets.map(taxInvoice => {
439
- let tempObj = {}
440
- for (const field of targetFieldSet) {
441
- tempObj[field] = taxInvoice[field]
442
- }
443
-
444
- return tempObj
445
- })
446
- }
447
- }
@@ -1,188 +0,0 @@
1
- import '@material/web/icon/icon.js'
2
- import '@operato/data-grist'
3
-
4
- import { css, html, LitElement } from 'lit'
5
- import { property, query } from 'lit/decorators.js'
6
- import { DataGrist } from '@operato/data-grist'
7
- import { i18next } from '@operato/i18n'
8
- import { CommonHeaderStyles } from '@operato/styles'
9
-
10
- export class CompanyListPopup extends LitElement {
11
- static styles = [
12
- CommonHeaderStyles,
13
- css`
14
- :host {
15
- display: flex;
16
- flex-direction: column;
17
-
18
- background-color: var(--md-sys-color-surface);
19
- }
20
-
21
- ox-grist {
22
- flex: 1;
23
- }
24
- `
25
- ]
26
-
27
- @query('ox-grist') private grist!: DataGrist
28
-
29
- @property({ type: Array }) companyList: any[] = []
30
- @property({ type: Object }) columns = {
31
- pagination: { infinite: true },
32
- columns: [
33
- { type: 'gutter', gutterName: 'sequence' },
34
- { type: 'gutter', gutterName: 'row-selector', multiple: false },
35
- {
36
- type: 'string',
37
- name: 'name',
38
- header: i18next.t('field.name'),
39
- record: {
40
- editable: false
41
- },
42
- filter: 'search',
43
- sortable: true,
44
- width: 150
45
- },
46
- {
47
- type: 'string',
48
- name: 'businessRegistrationNumber',
49
- header: i18next.t('field.business registration number'),
50
- record: {
51
- editable: false
52
- },
53
- width: 150
54
- },
55
- {
56
- type: 'string',
57
- name: 'branchIdentification',
58
- header: i18next.t('field.branch identification'),
59
- record: {
60
- editable: false
61
- },
62
- width: 150
63
- },
64
- {
65
- type: 'string',
66
- name: 'businessName',
67
- header: i18next.t('field.tax invoice business name'),
68
- record: {
69
- editable: false
70
- },
71
- width: 150
72
- },
73
- {
74
- type: 'string',
75
- name: 'representativeName',
76
- header: i18next.t('field.tax invoice representative name'),
77
- record: {
78
- editable: false
79
- },
80
- width: 150
81
- },
82
- {
83
- type: 'string',
84
- name: 'address',
85
- header: i18next.t('field.address'),
86
- record: {
87
- editable: false
88
- },
89
- width: 200
90
- },
91
- {
92
- type: 'string',
93
- name: 'businessType',
94
- header: i18next.t('field.business type'),
95
- record: {
96
- editable: false
97
- },
98
- width: 100
99
- },
100
- {
101
- type: 'string',
102
- name: 'industryType',
103
- header: i18next.t('field.industry type'),
104
- record: {
105
- editable: false
106
- },
107
- width: 100
108
- },
109
- {
110
- type: 'string',
111
- name: 'department',
112
- header: i18next.t('field.department'),
113
- record: {
114
- editable: false
115
- },
116
- width: 150
117
- },
118
- {
119
- type: 'string',
120
- name: 'contactName',
121
- header: i18next.t('field.contact name'),
122
- record: {
123
- editable: false
124
- },
125
- width: 150
126
- },
127
- {
128
- type: 'string',
129
- name: 'contactPhone',
130
- header: i18next.t('field.contact phone'),
131
- record: {
132
- editable: false
133
- },
134
- width: 150
135
- },
136
- {
137
- type: 'string',
138
- name: 'contactEmail',
139
- header: i18next.t('field.contact email'),
140
- record: {
141
- editable: false
142
- },
143
- width: 150
144
- },
145
- {
146
- type: 'string',
147
- name: 'contactCellPhone',
148
- header: i18next.t('field.contact cell phone'),
149
- record: {
150
- editable: false
151
- },
152
- width: 150
153
- }
154
- ],
155
- rows: {
156
- selectable: {
157
- multiple: false
158
- },
159
- handlers: {
160
- click: 'select-row-toggle'
161
- },
162
- appendable: false
163
- }
164
- }
165
-
166
- render() {
167
- return html`
168
- <ox-grist
169
- .mode=${'GRID'}
170
- .config=${this.columns}
171
- .data=${{
172
- records: this.companyList
173
- }}
174
- ></ox-grist>
175
-
176
- <div class="footer">
177
- <div filler></div>
178
- <button @click=${this.select.bind(this)} done>
179
- <md-icon>select_check_box</md-icon>${i18next.t('button.select')}
180
- </button>
181
- </div>
182
- `
183
- }
184
-
185
- async select() {
186
- this.dispatchEvent(new CustomEvent('selected', { detail: this.grist.selected[0] }))
187
- }
188
- }