@things-factory/tax-invoice 6.2.86 → 6.2.90

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 (61) hide show
  1. package/client/pages/tax-invoice/tax-invoice-detail-popup.ts +12 -6
  2. package/client/pages/tax-invoice/tax-invoice-list-page.ts +147 -176
  3. package/client/pages/tax-invoice-api/tax-invoice-api-page.ts +52 -114
  4. package/client/pages/tax-invoice-company/tax-invoice-company-importer.ts +2 -2
  5. package/client/pages/tax-invoice-send/tax-invoice-send-page.ts +580 -0
  6. package/client/route.ts +4 -4
  7. package/dist-client/pages/tax-invoice/tax-invoice-detail-popup.js +18 -9
  8. package/dist-client/pages/tax-invoice/tax-invoice-detail-popup.js.map +1 -1
  9. package/dist-client/pages/tax-invoice/tax-invoice-list-page.d.ts +63 -23
  10. package/dist-client/pages/tax-invoice/tax-invoice-list-page.js +149 -168
  11. package/dist-client/pages/tax-invoice/tax-invoice-list-page.js.map +1 -1
  12. package/dist-client/pages/tax-invoice-api/tax-invoice-api-page.d.ts +3 -5
  13. package/dist-client/pages/tax-invoice-api/tax-invoice-api-page.js +52 -105
  14. package/dist-client/pages/tax-invoice-api/tax-invoice-api-page.js.map +1 -1
  15. package/dist-client/pages/tax-invoice-company/tax-invoice-company-importer.js +2 -2
  16. package/dist-client/pages/tax-invoice-company/tax-invoice-company-importer.js.map +1 -1
  17. package/dist-client/pages/tax-invoice-send/tax-invoice-send-page.d.ts +100 -0
  18. package/dist-client/pages/tax-invoice-send/tax-invoice-send-page.js +510 -0
  19. package/dist-client/pages/tax-invoice-send/tax-invoice-send-page.js.map +1 -0
  20. package/dist-client/route.d.ts +1 -1
  21. package/dist-client/route.js +3 -3
  22. package/dist-client/route.js.map +1 -1
  23. package/dist-client/tsconfig.tsbuildinfo +1 -1
  24. package/dist-server/service/tax-invoice/tax-invoice-mutation.js +132 -27
  25. package/dist-server/service/tax-invoice/tax-invoice-mutation.js.map +1 -1
  26. package/dist-server/service/tax-invoice/tax-invoice-query.js +24 -1
  27. package/dist-server/service/tax-invoice/tax-invoice-query.js.map +1 -1
  28. package/dist-server/service/tax-invoice/tax-invoice-type.js +22 -259
  29. package/dist-server/service/tax-invoice/tax-invoice-type.js.map +1 -1
  30. package/dist-server/service/tax-invoice/tax-invoice.js +22 -16
  31. package/dist-server/service/tax-invoice/tax-invoice.js.map +1 -1
  32. package/dist-server/service/tax-invoice-api/tax-invoice-api-mutation.js +13 -21
  33. package/dist-server/service/tax-invoice-api/tax-invoice-api-mutation.js.map +1 -1
  34. package/dist-server/service/tax-invoice-api/tax-invoice-api-query.js +4 -25
  35. package/dist-server/service/tax-invoice-api/tax-invoice-api-query.js.map +1 -1
  36. package/dist-server/service/tax-invoice-api/tax-invoice-api-type.js +5 -0
  37. package/dist-server/service/tax-invoice-api/tax-invoice-api-type.js.map +1 -1
  38. package/dist-server/service/tax-invoice-api/tax-invoice-api.js +7 -1
  39. package/dist-server/service/tax-invoice-api/tax-invoice-api.js.map +1 -1
  40. package/dist-server/service/tax-invoice-item/tax-invoice-item-query.js.map +1 -1
  41. package/dist-server/service/tax-invoice-item/tax-invoice-item-type.js +4 -4
  42. package/dist-server/service/tax-invoice-item/tax-invoice-item-type.js.map +1 -1
  43. package/dist-server/service/tax-invoice-item/tax-invoice-item.js +3 -3
  44. package/dist-server/service/tax-invoice-item/tax-invoice-item.js.map +1 -1
  45. package/dist-server/service/unipost-api/tax-invoice-inquiry.js +90 -0
  46. package/dist-server/service/unipost-api/tax-invoice-inquiry.js.map +1 -0
  47. package/dist-server/tsconfig.tsbuildinfo +1 -1
  48. package/package.json +5 -5
  49. package/server/service/tax-invoice/tax-invoice-mutation.ts +137 -36
  50. package/server/service/tax-invoice/tax-invoice-query.ts +21 -3
  51. package/server/service/tax-invoice/tax-invoice-type.ts +21 -199
  52. package/server/service/tax-invoice/tax-invoice.ts +38 -45
  53. package/server/service/tax-invoice-api/tax-invoice-api-mutation.ts +19 -33
  54. package/server/service/tax-invoice-api/tax-invoice-api-query.ts +4 -21
  55. package/server/service/tax-invoice-api/tax-invoice-api-type.ts +4 -0
  56. package/server/service/tax-invoice-api/tax-invoice-api.ts +7 -15
  57. package/server/service/tax-invoice-item/tax-invoice-item-query.ts +1 -1
  58. package/server/service/tax-invoice-item/tax-invoice-item-type.ts +4 -7
  59. package/server/service/tax-invoice-item/tax-invoice-item.ts +3 -3
  60. package/server/service/unipost-api/tax-invoice-inquiry.ts +103 -0
  61. package/translations/ko.json +10 -1
@@ -9,7 +9,6 @@ import { DataGrist, FetchOption } from '@operato/data-grist'
9
9
  import { client } from '@operato/graphql'
10
10
  import { i18next, localize } from '@operato/i18n'
11
11
  import { notify } from '@operato/layout'
12
- import { OxPrompt } from '@operato/popup'
13
12
  import { isMobileDevice } from '@operato/utils'
14
13
  import gql from 'graphql-tag'
15
14
 
@@ -27,6 +26,10 @@ export class TaxInvoiceApiPage extends localize(i18next)(ScopedElementsMixin(Pag
27
26
  --grid-record-emphasized-background-color: red;
28
27
  --grid-record-emphasized-color: yellow;
29
28
  }
29
+
30
+ ox-grist {
31
+ margin-top: 15px;
32
+ }
30
33
  `
31
34
  ]
32
35
 
@@ -44,11 +47,6 @@ export class TaxInvoiceApiPage extends localize(i18next)(ScopedElementsMixin(Pag
44
47
  title: i18next.t('button.save'),
45
48
  action: this._updateTaxInvoiceApi.bind(this),
46
49
  ...CommonButtonStyles.save
47
- },
48
- {
49
- title: i18next.t('button.delete'),
50
- action: this._deleteTaxInvoiceApi.bind(this),
51
- ...CommonButtonStyles.delete
52
50
  }
53
51
  ]
54
52
  }
@@ -57,15 +55,7 @@ export class TaxInvoiceApiPage extends localize(i18next)(ScopedElementsMixin(Pag
57
55
  render() {
58
56
  const mode = this.mode || (isMobileDevice() ? 'CARD' : 'GRID')
59
57
 
60
- return html`
61
- <ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
62
- <div slot="headroom">
63
- <div id="filters">
64
- <ox-filters-form autofocus></ox-filters-form>
65
- </div>
66
- </div>
67
- </ox-grist>
68
- `
58
+ return html` <ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}> </ox-grist> `
69
59
  }
70
60
 
71
61
  async pageInitialized(lifecycle: any) {
@@ -85,7 +75,6 @@ export class TaxInvoiceApiPage extends localize(i18next)(ScopedElementsMixin(Pag
85
75
  editable: true,
86
76
  classifier: () => ({ emphasized: ['#D1E8FF', '#000'] })
87
77
  },
88
- filter: 'search',
89
78
  sortable: true,
90
79
  width: 150
91
80
  },
@@ -147,7 +136,7 @@ export class TaxInvoiceApiPage extends localize(i18next)(ScopedElementsMixin(Pag
147
136
  {
148
137
  type: 'string',
149
138
  name: 'businessName',
150
- header: i18next.t('field.business name'),
139
+ header: i18next.t('field.tax invoice business name'),
151
140
  record: {
152
141
  editable: true
153
142
  },
@@ -156,7 +145,7 @@ export class TaxInvoiceApiPage extends localize(i18next)(ScopedElementsMixin(Pag
156
145
  {
157
146
  type: 'string',
158
147
  name: 'representativeName',
159
- header: i18next.t('field.representative name'),
148
+ header: i18next.t('field.tax invoice representative name'),
160
149
  record: {
161
150
  editable: true
162
151
  },
@@ -243,7 +232,7 @@ export class TaxInvoiceApiPage extends localize(i18next)(ScopedElementsMixin(Pag
243
232
  options: async () => {
244
233
  return {
245
234
  objectified: true,
246
- attributeSet: await this.getAttributeSetForDomain()
235
+ attributeSet: await this.getAttributeSetForEntity()
247
236
  }
248
237
  }
249
238
  },
@@ -271,125 +260,74 @@ export class TaxInvoiceApiPage extends localize(i18next)(ScopedElementsMixin(Pag
271
260
  rows: {
272
261
  selectable: {
273
262
  multiple: true
274
- }
275
- },
276
- sorters: [
277
- {
278
- name: 'name'
279
- }
280
- ]
281
- }
282
- }
283
-
284
- async pageUpdated(changes: any, lifecycle: any) {
285
- if (this.active) {
286
- this.grist.fetch()
263
+ },
264
+ appendable: false
265
+ }
287
266
  }
288
267
  }
289
268
 
290
269
  async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }: FetchOption) {
291
270
  const response = await client.query({
292
271
  query: gql`
293
- query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
294
- responses: taxInvoiceApis(filters: $filters, pagination: $pagination, sortings: $sortings) {
295
- items {
272
+ query TaxInvoiceApi {
273
+ response: taxInvoiceApi {
274
+ id
275
+ name
276
+ description
277
+ apiKey
278
+ apiAccountId
279
+ apiAccountPassword
280
+ businessRegistrationNumber
281
+ branchIdentification
282
+ businessName
283
+ representativeName
284
+ address
285
+ businessType
286
+ industryType
287
+ department
288
+ contactName
289
+ contactPhone
290
+ contactEmail
291
+ contactCellPhone
292
+ attributes
293
+ updater {
296
294
  id
297
295
  name
298
- description
299
- apiKey
300
- apiAccountId
301
- apiAccountPassword
302
- businessRegistrationNumber
303
- branchIdentification
304
- businessName
305
- representativeName
306
- address
307
- businessType
308
- industryType
309
- department
310
- contactName
311
- contactPhone
312
- contactEmail
313
- contactCellPhone
314
- updater {
315
- id
316
- name
317
- }
318
- updatedAt
319
296
  }
320
- total
297
+ updatedAt
321
298
  }
322
299
  }
323
- `,
324
- variables: {
325
- filters,
326
- pagination: { page, limit },
327
- sortings
328
- }
300
+ `
329
301
  })
330
302
 
331
- return {
332
- total: response.data.responses.total || 0,
333
- records: response.data.responses.items || []
334
- }
335
- }
336
-
337
- async _deleteTaxInvoiceApi() {
338
- if (
339
- await OxPrompt.open({
340
- title: i18next.t('text.are_you_sure'),
341
- text: i18next.t('text.sure_to_x', { x: i18next.t('text.delete') }),
342
- confirmButton: { text: i18next.t('button.confirm') },
343
- cancelButton: { text: i18next.t('button.cancel') }
344
- })
345
- ) {
346
- const ids = this.grist.selected.map(record => record.id)
347
- if (ids && ids.length > 0) {
348
- const response = await client.mutate({
349
- mutation: gql`
350
- mutation ($ids: [String!]!) {
351
- deleteTaxInvoiceApis(ids: $ids)
352
- }
353
- `,
354
- variables: {
355
- ids
356
- }
357
- })
303
+ const records = response.data.response ? [response.data.response] : [{}]
358
304
 
359
- if (!response.errors) {
360
- this.grist.fetch()
361
- notify({
362
- message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') })
363
- })
364
- }
365
- }
305
+ return {
306
+ total: 1,
307
+ records: records
366
308
  }
367
309
  }
368
310
 
369
311
  async _updateTaxInvoiceApi() {
370
- let patches = this.grist.dirtyRecords
371
- if (patches && patches.length) {
372
- patches = patches.map(patch => {
373
- let patchField: any = patch.id ? { id: patch.id } : {}
374
- const dirtyFields = patch.__dirtyfields__
375
- for (let key in dirtyFields) {
376
- patchField[key] = key === 'type' ? Number(dirtyFields[key].after) : dirtyFields[key].after
377
- }
378
- patchField.cuFlag = patch.__dirty__
379
-
380
- return patchField
381
- })
312
+ let patch = this.grist.dirtyRecords[0]
313
+ if (patch) {
314
+ let patchField: any = patch.id ? { id: patch.id } : {}
315
+ const dirtyFields = patch.__dirtyfields__
316
+ for (let key in dirtyFields) {
317
+ patchField[key] = key === 'type' ? Number(dirtyFields[key].after) : dirtyFields[key].after
318
+ }
319
+ patchField.cuFlag = patch.id ? 'M' : '+'
382
320
 
383
321
  const response = await client.mutate({
384
322
  mutation: gql`
385
- mutation ($patches: [TaxInvoiceApiPatch!]!) {
386
- updateMultipleTaxInvoiceApis(patches: $patches) {
323
+ mutation ($patch: TaxInvoiceApiPatch!) {
324
+ updateMultipleTaxInvoiceApi(patch: $patch) {
387
325
  name
388
326
  }
389
327
  }
390
328
  `,
391
329
  variables: {
392
- patches
330
+ patch: patchField
393
331
  }
394
332
  })
395
333
 
@@ -402,11 +340,11 @@ export class TaxInvoiceApiPage extends localize(i18next)(ScopedElementsMixin(Pag
402
340
  }
403
341
  }
404
342
 
405
- async getAttributeSetForDomain() {
343
+ async getAttributeSetForEntity() {
406
344
  const response = await client.query({
407
345
  query: gql`
408
346
  query {
409
- attributeSet: attributeSetByEntity(entity: "Domain") {
347
+ attributeSet: attributeSetByEntity(entity: "TaxInvoiceApi") {
410
348
  entity
411
349
  description
412
350
  items {
@@ -76,13 +76,13 @@ export class TaxInvoiceCompanyImporter extends LitElement {
76
76
  {
77
77
  type: 'string',
78
78
  name: 'businessName',
79
- header: i18next.t('field.business name'),
79
+ header: i18next.t('field.tax invoice business name'),
80
80
  width: 150
81
81
  },
82
82
  {
83
83
  type: 'string',
84
84
  name: 'representativeName',
85
- header: i18next.t('field.representative name'),
85
+ header: i18next.t('field.tax invoice representative name'),
86
86
  width: 150
87
87
  },
88
88
  {