@things-factory/tax-invoice 6.2.88 → 6.2.92

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 (27) hide show
  1. package/client/pages/tax-invoice/tax-invoice-detail-popup.ts +5 -0
  2. package/client/pages/tax-invoice-api/tax-invoice-api-page.ts +47 -110
  3. package/client/pages/tax-invoice-send/tax-invoice-send-page.ts +339 -105
  4. package/client/route.ts +1 -1
  5. package/dist-client/pages/tax-invoice/tax-invoice-detail-popup.js +5 -0
  6. package/dist-client/pages/tax-invoice/tax-invoice-detail-popup.js.map +1 -1
  7. package/dist-client/pages/tax-invoice-api/tax-invoice-api-page.d.ts +2 -4
  8. package/dist-client/pages/tax-invoice-api/tax-invoice-api-page.js +47 -101
  9. package/dist-client/pages/tax-invoice-api/tax-invoice-api-page.js.map +1 -1
  10. package/dist-client/pages/tax-invoice-send/tax-invoice-send-page.d.ts +11 -5
  11. package/dist-client/pages/tax-invoice-send/tax-invoice-send-page.js +325 -99
  12. package/dist-client/pages/tax-invoice-send/tax-invoice-send-page.js.map +1 -1
  13. package/dist-client/route.js +1 -1
  14. package/dist-client/route.js.map +1 -1
  15. package/dist-client/tsconfig.tsbuildinfo +1 -1
  16. package/dist-server/service/tax-invoice-api/tax-invoice-api-mutation.js +13 -21
  17. package/dist-server/service/tax-invoice-api/tax-invoice-api-mutation.js.map +1 -1
  18. package/dist-server/service/tax-invoice-api/tax-invoice-api-query.js +4 -25
  19. package/dist-server/service/tax-invoice-api/tax-invoice-api-query.js.map +1 -1
  20. package/dist-server/service/tax-invoice-api/tax-invoice-api.js +7 -1
  21. package/dist-server/service/tax-invoice-api/tax-invoice-api.js.map +1 -1
  22. package/dist-server/tsconfig.tsbuildinfo +1 -1
  23. package/package.json +2 -2
  24. package/server/service/tax-invoice-api/tax-invoice-api-mutation.ts +19 -33
  25. package/server/service/tax-invoice-api/tax-invoice-api-query.ts +4 -21
  26. package/server/service/tax-invoice-api/tax-invoice-api.ts +7 -15
  27. package/translations/ko.json +4 -1
@@ -66,10 +66,15 @@ export class TaxInvoiceDetailPopup extends localize(i18next)(LitElement) {
66
66
  td,
67
67
  th {
68
68
  padding: 5px;
69
+ min-width: 60px;
70
+ }
71
+ td {
72
+ padding-left: 8px;
69
73
  }
70
74
  th.target {
71
75
  width: 25px;
72
76
  writing-mode: vertical-rl;
77
+ min-width: unset;
73
78
  }
74
79
 
75
80
  &.supplier {
@@ -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
  },
@@ -271,126 +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
- attributes
315
- updater {
316
- id
317
- name
318
- }
319
- updatedAt
320
296
  }
321
- total
297
+ updatedAt
322
298
  }
323
299
  }
324
- `,
325
- variables: {
326
- filters,
327
- pagination: { page, limit },
328
- sortings
329
- }
300
+ `
330
301
  })
331
302
 
332
- return {
333
- total: response.data.responses.total || 0,
334
- records: response.data.responses.items || []
335
- }
336
- }
337
-
338
- async _deleteTaxInvoiceApi() {
339
- if (
340
- await OxPrompt.open({
341
- title: i18next.t('text.are_you_sure'),
342
- text: i18next.t('text.sure_to_x', { x: i18next.t('text.delete') }),
343
- confirmButton: { text: i18next.t('button.confirm') },
344
- cancelButton: { text: i18next.t('button.cancel') }
345
- })
346
- ) {
347
- const ids = this.grist.selected.map(record => record.id)
348
- if (ids && ids.length > 0) {
349
- const response = await client.mutate({
350
- mutation: gql`
351
- mutation ($ids: [String!]!) {
352
- deleteTaxInvoiceApis(ids: $ids)
353
- }
354
- `,
355
- variables: {
356
- ids
357
- }
358
- })
303
+ const records = response.data.response ? [response.data.response] : [{}]
359
304
 
360
- if (!response.errors) {
361
- this.grist.fetch()
362
- notify({
363
- message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') })
364
- })
365
- }
366
- }
305
+ return {
306
+ total: 1,
307
+ records: records
367
308
  }
368
309
  }
369
310
 
370
311
  async _updateTaxInvoiceApi() {
371
- let patches = this.grist.dirtyRecords
372
- if (patches && patches.length) {
373
- patches = patches.map(patch => {
374
- let patchField: any = patch.id ? { id: patch.id } : {}
375
- const dirtyFields = patch.__dirtyfields__
376
- for (let key in dirtyFields) {
377
- patchField[key] = key === 'type' ? Number(dirtyFields[key].after) : dirtyFields[key].after
378
- }
379
- patchField.cuFlag = patch.__dirty__
380
-
381
- return patchField
382
- })
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' : '+'
383
320
 
384
321
  const response = await client.mutate({
385
322
  mutation: gql`
386
- mutation ($patches: [TaxInvoiceApiPatch!]!) {
387
- updateMultipleTaxInvoiceApis(patches: $patches) {
323
+ mutation ($patch: TaxInvoiceApiPatch!) {
324
+ updateMultipleTaxInvoiceApi(patch: $patch) {
388
325
  name
389
326
  }
390
327
  }
391
328
  `,
392
329
  variables: {
393
- patches
330
+ patch: patchField
394
331
  }
395
332
  })
396
333