@things-factory/operato-wms 4.3.59 → 4.3.62

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 (65) hide show
  1. package/client/pages/components/select-inventory-popup.js +626 -0
  2. package/client/pages/inbound/select-product-batch.js +7 -1
  3. package/client/pages/inbound/unload-product.js +75 -25
  4. package/client/pages/inventory/inventory-adjustment.js +1 -1
  5. package/client/pages/inventory/inventory-by-product-detail.js +99 -92
  6. package/client/pages/inventory/inventory-by-product.js +170 -68
  7. package/client/pages/inventory-check/inspecting-product.js +1 -1
  8. package/client/pages/order/release-order/b2b/b2b-order-list.js +76 -80
  9. package/client/pages/order/release-order/b2c/b2c-order-requests.js +93 -81
  10. package/client/pages/order/release-order/batch-picking-popup.js +11 -0
  11. package/client/pages/order/release-order/create-release-order.js +258 -252
  12. package/client/pages/order/release-order/release-extra-product-popup.js +10 -3
  13. package/client/pages/order/release-order/release-order-detail.js +202 -63
  14. package/client/pages/order/transport-order/delivery-note-popup.js +12 -17
  15. package/client/pages/order/transport-order/upload-delivery-note.js +6 -4
  16. package/client/pages/order/transport-order/view-delivery-note.js +0 -1
  17. package/client/pages/outbound/generate-worksheet-popup.js +337 -0
  18. package/client/pages/outbound/inventory-reassign-popup.js +1097 -0
  19. package/client/pages/outbound/loading-product.js +2 -2
  20. package/client/pages/outbound/picking-product.js +174 -100
  21. package/client/pages/outbound/sorting-product.js +5 -5
  22. package/client/pages/outbound/worksheet-batch-picking.js +39 -5
  23. package/client/pages/outbound/worksheet-picking.js +45 -6
  24. package/client/pages/report/outbound-order-details-report.js +181 -49
  25. package/client/pages/report/release-inventory-report.js +503 -0
  26. package/client/route.js +5 -0
  27. package/dist-server/graphql/resolvers/dashboard/outbound-order-by-status.js +3 -3
  28. package/dist-server/graphql/resolvers/extra/add-release-good-products.js +54 -3
  29. package/dist-server/graphql/resolvers/extra/add-release-good-products.js.map +1 -1
  30. package/dist-server/graphql/resolvers/reports/index.js +2 -1
  31. package/dist-server/graphql/resolvers/reports/index.js.map +1 -1
  32. package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js +63 -28
  33. package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js.map +1 -1
  34. package/dist-server/graphql/resolvers/reports/release-inventory-report.js +180 -0
  35. package/dist-server/graphql/resolvers/reports/release-inventory-report.js.map +1 -0
  36. package/dist-server/graphql/types/reports/index.js +6 -1
  37. package/dist-server/graphql/types/reports/index.js.map +1 -1
  38. package/dist-server/graphql/types/reports/outbound-order-details-report.js +14 -1
  39. package/dist-server/graphql/types/reports/outbound-order-details-report.js.map +1 -1
  40. package/dist-server/graphql/types/reports/release-inventory-report-list.js +14 -0
  41. package/dist-server/graphql/types/reports/release-inventory-report-list.js.map +1 -0
  42. package/dist-server/graphql/types/reports/release-inventory-report.js +29 -0
  43. package/dist-server/graphql/types/reports/release-inventory-report.js.map +1 -0
  44. package/dist-server/utils/report-query-util.js +4 -2
  45. package/dist-server/utils/report-query-util.js.map +1 -1
  46. package/helps/release-note.ko.md +13 -7
  47. package/helps/release-note.md +13 -7
  48. package/helps/release-note.ms.md +13 -7
  49. package/helps/release-note.zh.md +13 -7
  50. package/package.json +10 -10
  51. package/server/graphql/resolvers/dashboard/outbound-order-by-status.ts +3 -3
  52. package/server/graphql/resolvers/extra/add-release-good-products.ts +66 -3
  53. package/server/graphql/resolvers/reports/index.ts +3 -1
  54. package/server/graphql/resolvers/reports/outbound-order-details-report.ts +66 -29
  55. package/server/graphql/resolvers/reports/release-inventory-report.ts +202 -0
  56. package/server/graphql/types/reports/index.ts +6 -1
  57. package/server/graphql/types/reports/outbound-order-details-report.ts +14 -1
  58. package/server/graphql/types/reports/release-inventory-report-list.ts +8 -0
  59. package/server/graphql/types/reports/release-inventory-report.ts +23 -0
  60. package/server/utils/report-query-util.ts +4 -2
  61. package/things-factory.config.js +4 -0
  62. package/translations/en.json +73 -16
  63. package/translations/ko.json +157 -110
  64. package/translations/ms.json +65 -16
  65. package/translations/zh.json +79 -29
@@ -1,6 +1,7 @@
1
1
  import '@things-factory/form-ui'
2
2
  import '@things-factory/grist-ui'
3
3
  import '../batch-picking-popup'
4
+ import '../../../outbound/generate-worksheet-popup'
4
5
 
5
6
  import gql from 'graphql-tag'
6
7
  import { css, html } from 'lit-element'
@@ -13,7 +14,7 @@ import { i18next, localize } from '@things-factory/i18n-base'
13
14
  import { openPopup } from '@things-factory/layout-base'
14
15
  import { client, CustomAlert, navigate, PageView, store } from '@things-factory/shell'
15
16
  import { CommonButtonStyles, ScrollbarStyles } from '@things-factory/styles'
16
- import { isMobileDevice } from '@things-factory/utils'
17
+ import { isMobileDevice, sleep } from '@things-factory/utils'
17
18
 
18
19
  import { fetchSettingRule } from '../../../../fetch-setting-value'
19
20
  import { INTENALIZED_AWB_SETTING_KEY, ORDER_STATUS } from '../../../constants'
@@ -84,14 +85,9 @@ class B2cOrderRequests extends connect(store)(localize(i18next)(PageView)) {
84
85
  action: this._generatePackingList.bind(this),
85
86
  ...CommonButtonStyles.label
86
87
  },
87
- {
88
- title: i18next.t('button.batch_picking'),
89
- action: this._openBatchPickingPopup.bind(this),
90
- ...CommonButtonStyles.activate
91
- },
92
88
  {
93
89
  title: i18next.t('button.generate_worksheet'),
94
- action: this._generatePickingWorksheet.bind(this),
90
+ action: this._openGenerateWorksheetPopup.bind(this),
95
91
  ...CommonButtonStyles.activate
96
92
  }
97
93
  ]
@@ -131,7 +127,7 @@ class B2cOrderRequests extends connect(store)(localize(i18next)(PageView)) {
131
127
 
132
128
  this._searchFields = [
133
129
  {
134
- label: i18next.t('field.release_order_no'),
130
+ label: i18next.t('field.order_info'),
135
131
  name: 'name',
136
132
  type: 'text',
137
133
  props: { searchOper: 'i_like' }
@@ -159,40 +155,26 @@ class B2cOrderRequests extends connect(store)(localize(i18next)(PageView)) {
159
155
  type: 'select',
160
156
  options: [
161
157
  { value: '' },
162
- ..._orderStatus.map(status => {
163
- return { name: i18next.t(`label.${status.description}`), value: status.name }
164
- })
158
+ ..._orderStatus
159
+ .filter(res => {
160
+ return res.name !== 'LOADING'
161
+ })
162
+ .map(status => {
163
+ return { name: i18next.t(`label.${status.description}`), value: status.name }
164
+ })
165
165
  ],
166
166
  props: { searchOper: 'eq' }
167
167
  },
168
- {
169
- label: i18next.t('field.ref_no'),
170
- name: 'refNo',
171
- type: 'text',
172
- props: { searchOper: 'i_like' }
173
- },
174
- {
175
- label: i18next.t('field.ref_no_2'),
176
- name: 'refNo2',
177
- type: 'text',
178
- props: { searchOper: 'i_like' }
179
- },
180
- {
181
- label: i18next.t('field.ref_no_3'),
182
- name: 'refNo3',
183
- type: 'text',
184
- props: { searchOper: 'i_like' }
185
- },
186
168
  {
187
169
  label: i18next.t('field.from'),
188
170
  name: 'fromDate',
189
171
  type: 'date',
190
172
  props: {
191
- searchOper: 'eq'
173
+ searchOper: 'gte'
192
174
  },
193
175
  value: (() => {
194
176
  let date = new Date()
195
- date.setMonth(date.getMonth() - 6)
177
+ date.setMonth(date.getMonth() - 1)
196
178
  return date.toISOString().split('T')[0]
197
179
  })(),
198
180
  handlers: { change: this._modifyDateRange.bind(this) }
@@ -202,10 +184,15 @@ class B2cOrderRequests extends connect(store)(localize(i18next)(PageView)) {
202
184
  name: 'toDate',
203
185
  type: 'date',
204
186
  props: {
205
- searchOper: 'eq',
187
+ searchOper: 'lte',
206
188
  min: (() => {
207
189
  let date = new Date()
208
- date.setMonth(date.getMonth() - 6)
190
+ date.setMonth(date.getMonth() - 1)
191
+ return date.toISOString().split('T')[0]
192
+ })(),
193
+ max: (() => {
194
+ let date = new Date()
195
+ date.setDate(date.getDate())
209
196
  return date.toISOString().split('T')[0]
210
197
  })()
211
198
  },
@@ -238,7 +225,7 @@ class B2cOrderRequests extends connect(store)(localize(i18next)(PageView)) {
238
225
  options: [{ value: '' }, { name: 'Single Item', value: 1 }, { name: 'Multiple Item', value: 2 }]
239
226
  },
240
227
  {
241
- label: i18next.t('field.sku'),
228
+ label: i18next.t('field.product_info'),
242
229
  name: 'sku',
243
230
  type: 'text',
244
231
  props: { searchOper: 'i_like' }
@@ -249,6 +236,13 @@ class B2cOrderRequests extends connect(store)(localize(i18next)(PageView)) {
249
236
  type: 'checkbox',
250
237
  props: { searchOper: 'eq' },
251
238
  attrs: ['indeterminate']
239
+ },
240
+ {
241
+ label: i18next.t('field.manifested'),
242
+ name: 'manifested',
243
+ type: 'checkbox',
244
+ props: { searchOper: 'eq' },
245
+ attrs: ['indeterminate']
252
246
  }
253
247
  ]
254
248
 
@@ -344,6 +338,7 @@ class B2cOrderRequests extends connect(store)(localize(i18next)(PageView)) {
344
338
  type: 'string',
345
339
  name: 'postalCode',
346
340
  header: i18next.t('field.postal_code'),
341
+ imex: { header: i18next.t('field.postal_code'), key: 'postalCode', width: 25, type: 'string' },
347
342
  sortable: true,
348
343
  width: 100
349
344
  },
@@ -351,6 +346,7 @@ class B2cOrderRequests extends connect(store)(localize(i18next)(PageView)) {
351
346
  type: 'string',
352
347
  name: 'transporter',
353
348
  header: i18next.t('field.transporter'),
349
+ imex: { header: i18next.t('field.transporter'), key: 'transporter', width: 25, type: 'string' },
354
350
  sortable: true,
355
351
  width: 120
356
352
  },
@@ -366,7 +362,7 @@ class B2cOrderRequests extends connect(store)(localize(i18next)(PageView)) {
366
362
  type: 'string',
367
363
  name: 'status',
368
364
  header: i18next.t('field.status'),
369
- imex: { header: i18next.t('field.grn_status'), key: 'status', width: 25, type: 'string' },
365
+ imex: { header: i18next.t('field.status'), key: 'status', width: 25, type: 'string' },
370
366
  sortable: true,
371
367
  width: 120
372
368
  },
@@ -378,6 +374,14 @@ class B2cOrderRequests extends connect(store)(localize(i18next)(PageView)) {
378
374
  sortable: true,
379
375
  width: 120
380
376
  },
377
+ {
378
+ type: 'datetime',
379
+ name: 'acceptedAt',
380
+ header: i18next.t('field.accepted_at'),
381
+ imex: { header: i18next.t('field.accepted_at'), key: 'acceptedAt', width: 25, type: 'datetime' },
382
+ sortable: true,
383
+ width: 160
384
+ },
381
385
  {
382
386
  type: 'datetime',
383
387
  name: 'updatedAt',
@@ -393,6 +397,14 @@ class B2cOrderRequests extends connect(store)(localize(i18next)(PageView)) {
393
397
  imex: { header: i18next.t('field.accepted_by'), key: 'acceptedBy.name', width: 25, type: 'string' },
394
398
  sortable: true,
395
399
  width: 200
400
+ },
401
+ {
402
+ type: 'object',
403
+ name: 'updater',
404
+ header: i18next.t('field.updated_by'),
405
+ imex: { header: i18next.t('field.updated_by'), key: 'updater.name', width: 25, type: 'string' },
406
+ sortable: true,
407
+ width: 200
396
408
  }
397
409
  ]
398
410
  }
@@ -406,7 +418,30 @@ class B2cOrderRequests extends connect(store)(localize(i18next)(PageView)) {
406
418
  return this.shadowRoot.querySelector('data-grist')
407
419
  }
408
420
 
421
+ get _toDateInput() {
422
+ return this.searchForm.shadowRoot.querySelector('input[name=toDate]')
423
+ }
424
+
409
425
  async fetchHandler({ page, limit, sorters = [] }) {
426
+ let filters = this.searchForm.queryFilters.map(filter => {
427
+ switch (filter.name) {
428
+ case 'fromDate':
429
+ let fromDt = new Date(filter.value)
430
+ fromDt.setHours(0)
431
+ filter.value = fromDt.toISOString()
432
+ filter.name = 'createdAt'
433
+ break
434
+ case 'toDate':
435
+ let toDt = new Date(filter.value)
436
+ toDt.setHours(23, 59, 59)
437
+ filter.value = toDt.toISOString()
438
+ filter.name = 'createdAt'
439
+ break
440
+ default:
441
+ break
442
+ }
443
+ return filter
444
+ })
410
445
  const response = await client.query({
411
446
  query: gql`
412
447
  query releaseGoodRequests($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
@@ -446,11 +481,17 @@ class B2cOrderRequests extends connect(store)(localize(i18next)(PageView)) {
446
481
  noOfItems
447
482
  createdAt
448
483
  updatedAt
484
+ acceptedAt
449
485
  acceptedBy {
450
486
  id
451
487
  name
452
488
  description
453
489
  }
490
+ updater {
491
+ id
492
+ name
493
+ description
494
+ }
454
495
  airwayBill
455
496
  trackingNo
456
497
  }
@@ -459,7 +500,7 @@ class B2cOrderRequests extends connect(store)(localize(i18next)(PageView)) {
459
500
  }
460
501
  `,
461
502
  variables: {
462
- filters: [...(await this.searchForm.getQueryFilters()), { name: 'type', operator: 'eq', value: 'b2c' }],
503
+ filters: [...filters, { name: 'type', operator: 'eq', value: 'b2c' }],
463
504
  pagination: { page, limit },
464
505
  sortings: sorters
465
506
  }
@@ -548,24 +589,6 @@ class B2cOrderRequests extends connect(store)(localize(i18next)(PageView)) {
548
589
  }
549
590
  }
550
591
 
551
- _openBatchPickingPopup() {
552
- openPopup(
553
- html`
554
- <batch-picking-popup
555
- @generated="${() => {
556
- navigate('merged_outbound_worksheets')
557
- this._showToast({ message: i18next.t('text.worksheet_has_been_generated') })
558
- }}"
559
- ></batch-picking-popup>
560
- `,
561
- {
562
- backdrop: true,
563
- size: 'large',
564
- title: i18next.t('title.generate_batch_picking')
565
- }
566
- )
567
- }
568
-
569
592
  async _printInvoices() {
570
593
  try {
571
594
  if (this.dataGrist.selected && this.dataGrist.selected.length > 0) {
@@ -749,42 +772,25 @@ class B2cOrderRequests extends connect(store)(localize(i18next)(PageView)) {
749
772
  }
750
773
  }
751
774
 
752
- async _generatePickingWorksheet() {
775
+ async _openGenerateWorksheetPopup() {
753
776
  try {
754
- let releaseGoodNos = []
755
777
  if (this.dataGrist.selected.length <= 0)
756
778
  throw new Error(i18next.t('text.please_select_one_or_more_order_to_generate_worksheet'))
757
779
 
780
+ let releaseGoodNos = []
781
+
758
782
  let readyToPick = this.dataGrist.selected.filter(itm => itm.status === ORDER_STATUS.PENDING_WORKSHEET.value)
759
783
  releaseGoodNos = readyToPick.map(record => record.name)
760
784
 
761
785
  if (releaseGoodNos.length <= 0)
762
- throw new Error(i18next.t('text.selected_release_order(s)_has_existing_worksheet'))
763
-
764
- let result = await CustomAlert({
765
- title: i18next.t('title.are_you_sure'),
766
- text: i18next.t('text.generate_worksheet'),
767
- confirmButton: { text: i18next.t('button.submit') },
768
- cancelButton: { text: i18next.t('button.cancel') }
769
- })
770
-
771
- if (!result.value) return
786
+ throw new Error(i18next.t('text.selected_release_order(s)_is_not_in_pending_worksheet_status'))
772
787
 
773
- const response = await client.mutate({
774
- mutation: gql`
775
- mutation generateMultipleReleaseGoodWorksheet($releaseGoodNos: [String!]) {
776
- generateMultipleReleaseGoodWorksheet(releaseGoodNos: $releaseGoodNos)
777
- }
778
- `,
779
- variables: {
780
- releaseGoodNos
781
- }
788
+ await sleep(1010)
789
+ openPopup(html` <generate-worksheet-popup .gristData=${this.dataGrist}></generate-worksheet-popup> `, {
790
+ backdrop: true,
791
+ size: 'medium',
792
+ title: i18next.t('title.generate_picking_worksheet')
782
793
  })
783
-
784
- if (!response.errors) {
785
- navigate('single_outbound_worksheets')
786
- this._showToast({ message: i18next.t('text.worksheet(s)_has_been_generated') })
787
- }
788
794
  } catch (e) {
789
795
  this._showToast(e)
790
796
  }
@@ -812,15 +818,21 @@ class B2cOrderRequests extends connect(store)(localize(i18next)(PageView)) {
812
818
  _modifyDateRange(e) {
813
819
  const fromDate = e.currentTarget.value
814
820
 
815
- if (this._toDateInput.value < fromDate) this._toDateInput.value = fromDate
821
+ if (this._toDateInput?.value < fromDate) this._toDateInput.value = fromDate
816
822
 
817
823
  let min = new Date(fromDate)
818
824
  let today = new Date()
825
+ let oneMonthRange = new Date(fromDate)
826
+ oneMonthRange.setMonth(oneMonthRange.getMonth() + 1)
827
+ oneMonthRange = oneMonthRange.toISOString().split('T')[0]
828
+
819
829
  today.setHours(0, 0, 0, 0)
820
830
 
821
831
  min = min.toISOString().split('T')[0]
822
832
 
823
833
  this._toDateInput.min = min
834
+ this._toDateInput.value = oneMonthRange
835
+ this._toDateInput.max = oneMonthRange
824
836
  }
825
837
 
826
838
  _exportableData() {
@@ -312,6 +312,7 @@ class BatchPickingPopup extends localize(i18next)(LitElement) {
312
312
  name
313
313
  description
314
314
  }
315
+ recall
315
316
  }
316
317
  total
317
318
  }
@@ -369,7 +370,17 @@ class BatchPickingPopup extends localize(i18next)(LitElement) {
369
370
 
370
371
  async generateBatchPicking() {
371
372
  try {
373
+ const data = this.releaseOrderGrist
372
374
  if (this.releaseOrderGrist.selected.length < 2) throw new Error('Minimum of 2 orders required for batch picking')
375
+
376
+ let uniqueWS = this.releaseOrderGrist.selected.filter(
377
+ res => res.recall !== this.releaseOrderGrist.selected[0].recall
378
+ )
379
+
380
+ if (uniqueWS.length > 0) {
381
+ throw new Error("Recall Release Order can't be generated together with Normal Release Order")
382
+ }
383
+
373
384
  let result = await CustomAlert({
374
385
  title: i18next.t('title.are_you_sure'),
375
386
  text: i18next.t('text.create_batch_picking'),