@things-factory/operato-wms 4.3.61 → 4.3.64

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/components/select-inventory-popup.js +626 -0
  2. package/client/pages/inbound/unload-product.js +10 -9
  3. package/client/pages/inventory/inventory-by-product-detail.js +99 -92
  4. package/client/pages/inventory/inventory-by-product.js +170 -68
  5. package/client/pages/inventory-check/inspecting-product.js +1 -1
  6. package/client/pages/order/release-order/b2b/b2b-order-list.js +76 -80
  7. package/client/pages/order/release-order/b2c/b2c-order-requests.js +93 -81
  8. package/client/pages/order/release-order/batch-picking-popup.js +11 -0
  9. package/client/pages/order/release-order/create-release-order.js +258 -252
  10. package/client/pages/order/release-order/release-extra-product-popup.js +10 -3
  11. package/client/pages/order/release-order/release-order-detail.js +202 -63
  12. package/client/pages/order/transport-order/delivery-note-popup.js +12 -17
  13. package/client/pages/order/transport-order/upload-delivery-note.js +6 -4
  14. package/client/pages/order/transport-order/view-delivery-note.js +0 -1
  15. package/client/pages/outbound/generate-worksheet-popup.js +337 -0
  16. package/client/pages/outbound/inventory-reassign-popup.js +1097 -0
  17. package/client/pages/outbound/loading-product.js +2 -2
  18. package/client/pages/outbound/picking-product.js +174 -100
  19. package/client/pages/outbound/sorting-product.js +5 -5
  20. package/client/pages/outbound/worksheet-batch-picking.js +39 -5
  21. package/client/pages/outbound/worksheet-picking.js +45 -6
  22. package/client/pages/report/outbound-order-details-report.js +181 -49
  23. package/client/pages/report/release-inventory-report.js +503 -0
  24. package/client/route.js +5 -0
  25. package/dist-server/graphql/resolvers/extra/add-release-good-products.js +54 -3
  26. package/dist-server/graphql/resolvers/extra/add-release-good-products.js.map +1 -1
  27. package/dist-server/graphql/resolvers/reports/index.js +2 -1
  28. package/dist-server/graphql/resolvers/reports/index.js.map +1 -1
  29. package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js +63 -28
  30. package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js.map +1 -1
  31. package/dist-server/graphql/resolvers/reports/release-inventory-report.js +180 -0
  32. package/dist-server/graphql/resolvers/reports/release-inventory-report.js.map +1 -0
  33. package/dist-server/graphql/types/reports/index.js +6 -1
  34. package/dist-server/graphql/types/reports/index.js.map +1 -1
  35. package/dist-server/graphql/types/reports/outbound-order-details-report.js +14 -1
  36. package/dist-server/graphql/types/reports/outbound-order-details-report.js.map +1 -1
  37. package/dist-server/graphql/types/reports/release-inventory-report-list.js +14 -0
  38. package/dist-server/graphql/types/reports/release-inventory-report-list.js.map +1 -0
  39. package/dist-server/graphql/types/reports/release-inventory-report.js +29 -0
  40. package/dist-server/graphql/types/reports/release-inventory-report.js.map +1 -0
  41. package/dist-server/utils/report-query-util.js +4 -2
  42. package/dist-server/utils/report-query-util.js.map +1 -1
  43. package/helps/release-note.ko.md +13 -7
  44. package/helps/release-note.md +13 -7
  45. package/helps/release-note.ms.md +13 -7
  46. package/helps/release-note.zh.md +13 -7
  47. package/package.json +9 -9
  48. package/server/graphql/resolvers/extra/add-release-good-products.ts +66 -3
  49. package/server/graphql/resolvers/reports/index.ts +3 -1
  50. package/server/graphql/resolvers/reports/outbound-order-details-report.ts +66 -29
  51. package/server/graphql/resolvers/reports/release-inventory-report.ts +202 -0
  52. package/server/graphql/types/reports/index.ts +6 -1
  53. package/server/graphql/types/reports/outbound-order-details-report.ts +14 -1
  54. package/server/graphql/types/reports/release-inventory-report-list.ts +8 -0
  55. package/server/graphql/types/reports/release-inventory-report.ts +23 -0
  56. package/server/utils/report-query-util.ts +4 -2
  57. package/things-factory.config.js +4 -0
  58. package/translations/en.json +73 -16
  59. package/translations/ko.json +157 -110
  60. package/translations/ms.json +65 -16
  61. 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'
@@ -10,7 +11,7 @@ import { i18next, localize } from '@things-factory/i18n-base'
10
11
  import { client, navigate, PageView, CustomAlert } from '@things-factory/shell'
11
12
  import { openPopup } from '@things-factory/layout-base'
12
13
  import { ScrollbarStyles, CommonButtonStyles } from '@things-factory/styles'
13
- import { isMobileDevice } from '@things-factory/utils'
14
+ import { isMobileDevice, sleep } from '@things-factory/utils'
14
15
 
15
16
  import { ORDER_STATUS } from '../../../constants'
16
17
 
@@ -65,18 +66,11 @@ class B2bOrderList extends localize(i18next)(PageView) {
65
66
  var actions = []
66
67
 
67
68
  if (this.isUserBelongsDomain) {
68
- actions.push(
69
- {
70
- title: i18next.t('button.batch_picking'),
71
- action: this._openBatchPickingPopup.bind(this),
72
- ...CommonButtonStyles.activate
73
- },
74
- {
75
- title: i18next.t('button.generate_worksheet'),
76
- action: this._generatePickingWorksheet.bind(this),
77
- ...CommonButtonStyles.activate
78
- }
79
- )
69
+ actions.push({
70
+ title: i18next.t('button.generate_worksheet'),
71
+ action: this._openGenerateWorksheetPopup.bind(this),
72
+ ...CommonButtonStyles.activate
73
+ })
80
74
  }
81
75
  return {
82
76
  title: i18next.t('title.release_orders'),
@@ -114,7 +108,7 @@ class B2bOrderList extends localize(i18next)(PageView) {
114
108
  const _bizplaces = _bizplacesReq.status == 'fulfilled' ? _bizplacesReq.value : []
115
109
  this._searchFields = [
116
110
  {
117
- label: i18next.t('field.ro'),
111
+ label: i18next.t('field.order_info'),
118
112
  name: 'name',
119
113
  type: 'text',
120
114
  props: { searchOper: 'i_like' }
@@ -142,24 +136,6 @@ class B2bOrderList extends localize(i18next)(PageView) {
142
136
  type: 'date',
143
137
  props: { searchOper: 'i_like' }
144
138
  },
145
- {
146
- label: i18next.t('field.ref_no'),
147
- name: 'refNo',
148
- type: 'text',
149
- props: { searchOper: 'i_like' }
150
- },
151
- {
152
- label: i18next.t('field.ref_no_2'),
153
- name: 'refNo2',
154
- type: 'text',
155
- props: { searchOper: 'i_like' }
156
- },
157
- {
158
- label: i18next.t('field.ref_no_3'),
159
- name: 'refNo3',
160
- type: 'text',
161
- props: { searchOper: 'i_like' }
162
- },
163
139
  {
164
140
  label: i18next.t('field.status'),
165
141
  name: 'status',
@@ -177,7 +153,7 @@ class B2bOrderList extends localize(i18next)(PageView) {
177
153
  name: 'fromDate',
178
154
  type: 'date',
179
155
  props: {
180
- searchOper: 'eq'
156
+ searchOper: 'gte'
181
157
  },
182
158
  value: (() => {
183
159
  let date = new Date()
@@ -191,7 +167,7 @@ class B2bOrderList extends localize(i18next)(PageView) {
191
167
  name: 'toDate',
192
168
  type: 'date',
193
169
  props: {
194
- searchOper: 'eq',
170
+ searchOper: 'lte',
195
171
  min: (() => {
196
172
  let date = new Date()
197
173
  date.setMonth(date.getMonth() - 6)
@@ -220,6 +196,13 @@ class B2bOrderList extends localize(i18next)(PageView) {
220
196
  type: 'checkbox',
221
197
  props: { searchOper: 'noteq' },
222
198
  attrs: ['indeterminate']
199
+ },
200
+ {
201
+ label: i18next.t('field.recall'),
202
+ name: 'recall',
203
+ type: 'checkbox',
204
+ props: { searchOper: 'eq' },
205
+ attrs: ['indeterminate']
223
206
  }
224
207
  ]
225
208
 
@@ -336,6 +319,13 @@ class B2bOrderList extends localize(i18next)(PageView) {
336
319
  imex: { header: i18next.t('field.route'), key: 'routeId', width: 20, type: 'string' },
337
320
  width: 60
338
321
  },
322
+ {
323
+ type: 'boolean',
324
+ name: 'recall',
325
+ header: i18next.t('field.recall'),
326
+ imex: { header: i18next.t('field.recall'), key: 'recall', width: 20, type: 'string' },
327
+ width: 60
328
+ },
339
329
  {
340
330
  type: 'object',
341
331
  name: 'arrivalNotice',
@@ -359,6 +349,14 @@ class B2bOrderList extends localize(i18next)(PageView) {
359
349
  sortable: true,
360
350
  width: 160
361
351
  },
352
+ {
353
+ type: 'datetime',
354
+ name: 'acceptedAt',
355
+ header: i18next.t('field.accepted_at'),
356
+ imex: { header: i18next.t('field.accepted_at'), key: 'acceptedAt', width: 30, type: 'datetime' },
357
+ sortable: true,
358
+ width: 160
359
+ },
362
360
  {
363
361
  type: 'datetime',
364
362
  name: 'updatedAt',
@@ -382,6 +380,14 @@ class B2bOrderList extends localize(i18next)(PageView) {
382
380
  imex: { header: i18next.t('field.accepted_by'), key: 'acceptedBy.name', width: 30, type: 'string' },
383
381
  sortable: true,
384
382
  width: 200
383
+ },
384
+ {
385
+ type: 'object',
386
+ name: 'updater',
387
+ header: i18next.t('field.updated_by'),
388
+ imex: { header: i18next.t('field.updated_by'), key: 'updater.name', width: 30, type: 'string' },
389
+ sortable: true,
390
+ width: 200
385
391
  }
386
392
  ]
387
393
  }
@@ -400,6 +406,25 @@ class B2bOrderList extends localize(i18next)(PageView) {
400
406
  }
401
407
 
402
408
  async fetchHandler({ page, limit, sorters = [] }) {
409
+ let filters = this.searchForm.queryFilters.map(filter => {
410
+ switch (filter.name) {
411
+ case 'fromDate':
412
+ let fromDt = new Date(filter.value)
413
+ fromDt.setHours(0)
414
+ filter.value = fromDt.toISOString()
415
+ filter.name = 'createdAt'
416
+ break
417
+ case 'toDate':
418
+ let toDt = new Date(filter.value)
419
+ toDt.setHours(23, 59, 59)
420
+ filter.value = toDt.toISOString()
421
+ filter.name = 'createdAt'
422
+ break
423
+ default:
424
+ break
425
+ }
426
+ return filter
427
+ })
403
428
  const response = await client.query({
404
429
  query: gql`
405
430
  query releaseGoodRequests($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
@@ -425,26 +450,32 @@ class B2bOrderList extends localize(i18next)(PageView) {
425
450
  exportOption
426
451
  routeId
427
452
  releaseDate
453
+ recall
428
454
  status
429
455
  createdAt
430
- updatedAt
431
456
  creator {
432
457
  id
433
458
  name
434
459
  description
435
460
  }
461
+ acceptedAt
436
462
  acceptedBy {
437
463
  id
438
464
  name
439
465
  description
440
466
  }
467
+ updatedAt
468
+ updater {
469
+ id
470
+ name
471
+ }
441
472
  }
442
473
  total
443
474
  }
444
475
  }
445
476
  `,
446
477
  variables: {
447
- filters: [...(await this.searchForm.getQueryFilters()), { name: 'type', operator: 'eq', value: 'b2b' }],
478
+ filters: [...filters, { name: 'type', operator: 'eq', value: 'b2b' }],
448
479
  pagination: { page, limit },
449
480
  sortings: sorters
450
481
  }
@@ -507,60 +538,25 @@ class B2bOrderList extends localize(i18next)(PageView) {
507
538
  }
508
539
  }
509
540
 
510
- _openBatchPickingPopup() {
511
- openPopup(
512
- html`
513
- <batch-picking-popup
514
- @generated="${() => {
515
- navigate('merged_outbound_worksheets')
516
- this._showToast({ message: i18next.t('text.worksheet_has_been_generated') })
517
- }}"
518
- ></batch-picking-popup>
519
- `,
520
- {
521
- backdrop: true,
522
- size: 'large',
523
- title: i18next.t('title.generate_batch_picking')
524
- }
525
- )
526
- }
527
-
528
- async _generatePickingWorksheet() {
541
+ async _openGenerateWorksheetPopup() {
529
542
  try {
530
- let releaseGoodNos = []
531
543
  if (this.dataGrist.selected.length <= 0)
532
544
  throw new Error(i18next.t('text.please_select_one_or_more_order_to_generate_worksheet'))
533
545
 
546
+ let releaseGoodNos = []
547
+
534
548
  let readyToPick = this.dataGrist.selected.filter(itm => itm.status === ORDER_STATUS.PENDING_WORKSHEET.value)
535
549
  releaseGoodNos = readyToPick.map(record => record.name)
536
550
 
537
551
  if (releaseGoodNos.length <= 0)
538
- throw new Error(i18next.t('text.selected_release_order(s)_has_existing_worksheet'))
539
-
540
- let result = await CustomAlert({
541
- title: i18next.t('title.are_you_sure'),
542
- text: i18next.t('text.generate_worksheet'),
543
- confirmButton: { text: i18next.t('button.submit') },
544
- cancelButton: { text: i18next.t('button.cancel') }
545
- })
552
+ throw new Error(i18next.t('text.selected_release_order(s)_is_not_in_pending_worksheet_status'))
546
553
 
547
- if (!result.value) return
548
-
549
- const response = await client.mutate({
550
- mutation: gql`
551
- mutation generateMultipleReleaseGoodWorksheet($releaseGoodNos: [String!]) {
552
- generateMultipleReleaseGoodWorksheet(releaseGoodNos: $releaseGoodNos)
553
- }
554
- `,
555
- variables: {
556
- releaseGoodNos
557
- }
554
+ await sleep(1010)
555
+ openPopup(html` <generate-worksheet-popup .gristData=${this.dataGrist}></generate-worksheet-popup> `, {
556
+ backdrop: true,
557
+ size: 'medium',
558
+ title: i18next.t('title.generate_picking_worksheet')
558
559
  })
559
-
560
- if (!response.errors) {
561
- navigate('single_outbound_worksheets')
562
- this._showToast({ message: i18next.t('text.worksheet(s)_has_been_generated') })
563
- }
564
560
  } catch (e) {
565
561
  this._showToast(e)
566
562
  }
@@ -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'),