@things-factory/operato-mms 4.0.0-alpha.7 → 4.0.0-beta.1

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 (71) hide show
  1. package/Dockerfile +2 -1
  2. package/client/bootstrap.js +32 -16
  3. package/client/components/marketplace-order-max-weight.js +158 -0
  4. package/client/components/mms-home-cards.js +1 -1
  5. package/client/components/stock-allocation-ratio.js +17 -23
  6. package/client/pages/catalogue/products.js +2 -1
  7. package/client/pages/catalogue/warehouse-products.js +2 -1
  8. package/client/pages/catalogue-variation/product-variations.js +72 -15
  9. package/client/pages/inventory/inventory-by-product.js +3 -2
  10. package/client/pages/order/logistics/batch-init-popup.js +566 -0
  11. package/client/pages/order/logistics/lazada-order-init-batch-popup.js +233 -21
  12. package/client/pages/order/logistics/order-shipping-items.js +47 -16
  13. package/client/pages/order/logistics/order-shipping.js +7 -4
  14. package/client/pages/order/logistics/request-ro-popup.js +104 -17
  15. package/client/pages/order/logistics/shopee-order-init-batch-popup.js +431 -129
  16. package/client/pages/order/order-by-store.js +176 -149
  17. package/client/pages/setting/marketplace-setting.js +12 -0
  18. package/dist-server/graphql/index.js +1 -1
  19. package/dist-server/graphql/resolvers/index.js +1 -1
  20. package/dist-server/graphql/resolvers/interface-with-hub/add-release-order.js +74 -13
  21. package/dist-server/graphql/resolvers/interface-with-hub/add-release-order.js.map +1 -1
  22. package/dist-server/graphql/resolvers/interface-with-hub/auto-add-release-order.js +74 -13
  23. package/dist-server/graphql/resolvers/interface-with-hub/auto-add-release-order.js.map +1 -1
  24. package/dist-server/graphql/resolvers/interface-with-hub/generate-replenishment-order.js +1 -1
  25. package/dist-server/graphql/resolvers/interface-with-hub/generate-replenishment-order.js.map +1 -1
  26. package/dist-server/graphql/resolvers/interface-with-hub/warehouse-marketplace-products.js +53 -36
  27. package/dist-server/graphql/resolvers/interface-with-hub/warehouse-marketplace-products.js.map +1 -1
  28. package/dist-server/graphql/resolvers/warehouse-product/auto-link-warehouse-marketplace-product-variations.js +5 -5
  29. package/dist-server/graphql/resolvers/warehouse-product/auto-link-warehouse-marketplace-product-variations.js.map +1 -1
  30. package/dist-server/graphql/types/index.js +1 -1
  31. package/dist-server/graphql/types/interface-with-hub/new-stock-replenishment.js +1 -1
  32. package/dist-server/graphql/types/interface-with-hub/new-stock-replenishment.js.map +1 -1
  33. package/dist-server/graphql/types/interface-with-hub/replenishment-order-product.js +1 -1
  34. package/dist-server/graphql/types/interface-with-hub/replenishment-order-product.js.map +1 -1
  35. package/dist-server/graphql/types/interface-with-hub/stock-replenishment-list.js +1 -1
  36. package/dist-server/graphql/types/interface-with-hub/stock-replenishment-list.js.map +1 -1
  37. package/dist-server/graphql/types/interface-with-hub/stock-replenishment.js +1 -1
  38. package/dist-server/graphql/types/interface-with-hub/stock-replenishment.js.map +1 -1
  39. package/dist-server/graphql/types/interface-with-hub/warehouse-inventory.js +1 -1
  40. package/dist-server/graphql/types/interface-with-hub/warehouse-inventory.js.map +1 -1
  41. package/dist-server/graphql/types/interface-with-hub/warehouse-marketplace-product-list.js +1 -1
  42. package/dist-server/graphql/types/interface-with-hub/warehouse-marketplace-product-list.js.map +1 -1
  43. package/dist-server/graphql/types/interface-with-hub/warehouse-marketplace-product.js +1 -1
  44. package/dist-server/graphql/types/interface-with-hub/warehouse-marketplace-product.js.map +1 -1
  45. package/dist-server/graphql/types/warehouse-product/warehouse-product.js +1 -1
  46. package/dist-server/graphql/types/warehouse-product/warehouse-product.js.map +1 -1
  47. package/dist-server/index.js +1 -1
  48. package/dist-server/migrations/1599732967233-SeedCommonCode.js +5 -5
  49. package/dist-server/migrations/1599732967233-SeedCommonCode.js.map +1 -1
  50. package/dist-server/migrations/1608009991075-SeedUser.js +4 -4
  51. package/dist-server/migrations/1608009991075-SeedUser.js.map +1 -1
  52. package/dist-server/routers/etrax-router.js +7 -6
  53. package/dist-server/routers/etrax-router.js.map +1 -1
  54. package/dist-server/routers/shopify-pos-public-router.js +10 -10
  55. package/dist-server/routers/shopify-pos-public-router.js.map +1 -1
  56. package/dist-server/util/interface-helper.js +2 -2
  57. package/dist-server/util/interface-helper.js.map +1 -1
  58. package/dist-server/util/no-generator.js +2 -2
  59. package/dist-server/util/no-generator.js.map +1 -1
  60. package/package.json +65 -63
  61. package/server/graphql/resolvers/interface-with-hub/add-release-order.ts +83 -14
  62. package/server/graphql/resolvers/interface-with-hub/auto-add-release-order.ts +79 -11
  63. package/server/graphql/resolvers/interface-with-hub/warehouse-marketplace-products.ts +50 -33
  64. package/server/routers/etrax-router.ts +6 -4
  65. package/translations/en.json +16 -0
  66. package/translations/ko.json +14 -0
  67. package/translations/ms.json +14 -0
  68. package/translations/zh.json +14 -0
  69. package/views/auth-page.html +1 -1
  70. package/views/public/home.html +1 -1
  71. package/config.development.js +0 -54
@@ -1,21 +1,25 @@
1
- import { getCodeByName } from '@things-factory/code-base'
2
1
  import '@things-factory/form-ui'
3
2
  import '@things-factory/grist-ui'
4
- import { i18next, localize } from '@things-factory/i18n-base'
5
- import { client, PageView, CustomAlert } from '@things-factory/shell'
6
- import { ScrollbarStyles, CommonButtonStyles } from '@things-factory/styles'
7
- import { openPopup } from '@things-factory/layout-base'
8
- import { isMobileDevice } from '@things-factory/utils'
9
- import gql from 'graphql-tag'
10
- import { css, html } from 'lit-element'
11
- import { PLATFORM } from '../constants'
12
-
13
3
  import './select-datetime-popup'
14
4
  import './logistics/order-init-popup'
15
5
  import './logistics/shopee-order-init-batch-popup'
16
6
  import './logistics/lazada-order-init-batch-popup'
7
+ import './logistics/batch-init-popup'
17
8
  import './logistics/request-ro-popup'
18
9
 
10
+ import gql from 'graphql-tag'
11
+ import { css, html } from 'lit-element'
12
+
13
+ import { GhostPrint } from '@operato/ghost-print'
14
+ import { getCodeByName } from '@things-factory/code-base'
15
+ import { i18next, localize } from '@things-factory/i18n-base'
16
+ import { openPopup } from '@things-factory/layout-base'
17
+ import { client, CustomAlert, PageView } from '@things-factory/shell'
18
+ import { CommonButtonStyles, ScrollbarStyles } from '@things-factory/styles'
19
+ import { isMobileDevice } from '@things-factory/utils'
20
+
21
+ import { PLATFORM } from '../constants'
22
+
19
23
  class OrderByStore extends localize(i18next)(PageView) {
20
24
  static get properties() {
21
25
  return {
@@ -61,6 +65,11 @@ class OrderByStore extends localize(i18next)(PageView) {
61
65
  title: i18next.t('button.sync_order'),
62
66
  action: this._syncOrder.bind(this),
63
67
  ...CommonButtonStyles.sync
68
+ },
69
+ {
70
+ title: i18next.t('button.airway_bill'),
71
+ action: this._openAirwayBillPopup.bind(this),
72
+ ...CommonButtonStyles.label
64
73
  }
65
74
  ]
66
75
 
@@ -68,11 +77,6 @@ class OrderByStore extends localize(i18next)(PageView) {
68
77
  switch (this.store.platform) {
69
78
  case PLATFORM.SHOPEE.value:
70
79
  actions = [
71
- {
72
- title: i18next.t('button.airway_bill'),
73
- action: this._openAirwayBillPopup.bind(this),
74
- ...CommonButtonStyles.label
75
- },
76
80
  {
77
81
  title: i18next.t('button.order_init_batch'),
78
82
  action: this._openShopeeOrderInitBatch.bind(this),
@@ -83,11 +87,6 @@ class OrderByStore extends localize(i18next)(PageView) {
83
87
  break
84
88
  case PLATFORM.LAZADA.value:
85
89
  actions = [
86
- {
87
- title: i18next.t('button.airway_bill'),
88
- action: this._openAirwayBillPopup.bind(this),
89
- ...CommonButtonStyles.label
90
- },
91
90
  {
92
91
  title: i18next.t('button.order_init_batch'),
93
92
  action: this._openLazadaOrderInitBatch.bind(this),
@@ -97,6 +96,14 @@ class OrderByStore extends localize(i18next)(PageView) {
97
96
  ]
98
97
  break
99
98
  default:
99
+ actions = [
100
+ {
101
+ title: i18next.t('button.order_init_batch'),
102
+ action: this._openDefaultOrderInitBatch.bind(this),
103
+ ...CommonButtonStyles.init
104
+ },
105
+ ...actions
106
+ ]
100
107
  break
101
108
  }
102
109
  }
@@ -114,7 +121,7 @@ class OrderByStore extends localize(i18next)(PageView) {
114
121
 
115
122
  return {
116
123
  title: this.store
117
- ? `${i18next.t('title.order_by_store')} - ${this.store.name}`
124
+ ? `${i18next.t('title.order_by_store')} - ${this.store.storeName}`
118
125
  : i18next.t('title.order_by_store'),
119
126
  actions,
120
127
  exportable: {
@@ -144,7 +151,7 @@ class OrderByStore extends localize(i18next)(PageView) {
144
151
  this._searchFields = [
145
152
  {
146
153
  label: i18next.t('field.order_no'),
147
- name: 'name',
154
+ name: 'orderNo',
148
155
  type: 'text',
149
156
  props: { searchOper: 'i_like' }
150
157
  },
@@ -222,6 +229,13 @@ class OrderByStore extends localize(i18next)(PageView) {
222
229
  sortable: false,
223
230
  width: 130
224
231
  },
232
+ {
233
+ type: 'string',
234
+ name: 'newOwnTrackingNo',
235
+ header: i18next.t('field.own_tracking_no'),
236
+ sortable: false,
237
+ width: 130
238
+ },
225
239
  {
226
240
  type: 'string',
227
241
  name: 'shippingProvider',
@@ -229,6 +243,20 @@ class OrderByStore extends localize(i18next)(PageView) {
229
243
  sortable: true,
230
244
  width: 130
231
245
  },
246
+ {
247
+ type: 'string',
248
+ name: 'newOwnTransporter',
249
+ header: i18next.t('field.own_shipping_carrier'),
250
+ sortable: false,
251
+ width: 130
252
+ },
253
+ {
254
+ type: 'string',
255
+ name: 'postCode',
256
+ header: i18next.t('field.post_code'),
257
+ sortable: true,
258
+ width: 130
259
+ },
232
260
  {
233
261
  type: 'string',
234
262
  name: 'itemCount',
@@ -250,6 +278,13 @@ class OrderByStore extends localize(i18next)(PageView) {
250
278
  sortable: true,
251
279
  width: 120
252
280
  },
281
+ {
282
+ type: 'string',
283
+ name: 'remark',
284
+ header: i18next.t('field.remark'),
285
+ sortable: true,
286
+ width: 200
287
+ },
253
288
  {
254
289
  type: 'datetime',
255
290
  name: 'orderUpdatedAt',
@@ -266,90 +301,6 @@ class OrderByStore extends localize(i18next)(PageView) {
266
301
  }
267
302
  ]
268
303
  }
269
-
270
- this.excelConfig = {
271
- columns: [
272
- {
273
- type: 'string',
274
- name: 'orderNo',
275
- header: i18next.t('field.order_no'),
276
- sortable: true,
277
- width: 130,
278
- imex: { header: i18next.t('field.order_no'), key: 'orderNo', width: 50, type: 'string' }
279
- },
280
- {
281
- type: 'string',
282
- name: 'marketplaceStoreName',
283
- header: i18next.t('field.store_name'),
284
- sortable: true,
285
- width: 120,
286
- imex: { header: i18next.t('field.store_name'), key: 'marketplaceStoreName', width: 40, type: 'string' }
287
- },
288
- {
289
- type: 'string',
290
- name: 'marketplaceStorePlatform',
291
- header: i18next.t('field.platform'),
292
- sortable: true,
293
- width: 120,
294
- imex: { header: i18next.t('field.platform'), key: 'marketplaceStorePlatform', width: 50, type: 'string' }
295
- },
296
- {
297
- type: 'string',
298
- name: 'shippingProvider',
299
- header: i18next.t('field.shipping_carrier'),
300
- sortable: true,
301
- width: 130,
302
- imex: { header: i18next.t('field.shipping_carrier'), key: 'shippingProvider', width: 50, type: 'string' }
303
- },
304
- {
305
- type: 'string',
306
- name: 'sku',
307
- header: i18next.t('field.sku'),
308
- sortable: true,
309
- width: 130,
310
- imex: { header: i18next.t('field.sku'), key: 'sku', width: 50, type: 'string' }
311
- },
312
- {
313
- type: 'string',
314
- name: 'variationName',
315
- header: i18next.t('field.variation_name'),
316
- sortable: true,
317
- width: 130,
318
- imex: { header: i18next.t('field.variation_name'), key: 'variationName', width: 50, type: 'string' }
319
- },
320
- {
321
- type: 'float',
322
- name: 'itemQty',
323
- header: i18next.t('field.qty'),
324
- sortable: true,
325
- width: 100,
326
- imex: { header: i18next.t('field.qty'), key: 'itemQty', width: 20, type: 'string' }
327
- },
328
- {
329
- type: 'string',
330
- name: 'status',
331
- header: i18next.t('field.status'),
332
- sortable: true,
333
- width: 120,
334
- imex: { header: i18next.t('field.status'), key: 'status', width: 30, type: 'string' }
335
- },
336
- {
337
- type: 'string',
338
- name: 'trackingNo',
339
- header: i18next.t('field.tracking_no'),
340
- sortable: true,
341
- width: 120,
342
- imex: { header: i18next.t('field.tracking_no'), key: 'trackingNo', width: 50, type: 'string' }
343
- },
344
- {
345
- type: 'datetime',
346
- name: 'updatedAt',
347
- header: i18next.t('field.last_updated'),
348
- sortable: true,
349
- width: 180
350
- }
351
- ]
352
- }
353
304
  }
354
305
 
355
306
  async pageUpdated(changes, lifecycle) {
@@ -390,6 +341,8 @@ class OrderByStore extends localize(i18next)(PageView) {
390
341
  id
391
342
  name
392
343
  platform
344
+ isOwnTransport
345
+ storeName
393
346
  storeId
394
347
  status
395
348
  }
@@ -408,7 +361,7 @@ class OrderByStore extends localize(i18next)(PageView) {
408
361
 
409
362
  if (this.store) {
410
363
  filters.push({
411
- name: 'marketplaceStore',
364
+ name: 'marketplaceStoreId',
412
365
  operator: 'eq',
413
366
  value: this.store.id
414
367
  })
@@ -428,6 +381,7 @@ class OrderByStore extends localize(i18next)(PageView) {
428
381
  id
429
382
  name
430
383
  platform
384
+ isOwnTransport
431
385
  description
432
386
  }
433
387
  marketplaceOrderItems {
@@ -447,6 +401,15 @@ class OrderByStore extends localize(i18next)(PageView) {
447
401
  phone2
448
402
  attentionTo
449
403
  trackingNo
404
+ ownTrackingNo
405
+ totalWeight
406
+ weightUnit
407
+ totalVolume
408
+ volumeUnit
409
+ transporter
410
+ ownTransporter
411
+ orderNoRef
412
+ subOrderNoRef
450
413
  }
451
414
  marketplaceProductVariation {
452
415
  marketplaceProduct {
@@ -460,12 +423,14 @@ class OrderByStore extends localize(i18next)(PageView) {
460
423
  paidPrice
461
424
  }
462
425
  orderNo
426
+ remark
463
427
  type
464
428
  paymentMethod
465
429
  status
466
430
  itemCount
467
431
  releaseOrderId
468
432
  totalAmount
433
+ shippingProvider
469
434
  orderCreatedAt
470
435
  orderUpdatedAt
471
436
  updatedAt
@@ -482,7 +447,10 @@ class OrderByStore extends localize(i18next)(PageView) {
482
447
  marketplaceOrders = marketplaceOrders.map(item => {
483
448
  return {
484
449
  ...item,
485
- newTrackingNo: this.getTrackingNos(item.marketplaceOrderItems)
450
+ newTrackingNo: this.getOrderShippingInformation(item.marketplaceOrderItems, 'trackingNo'),
451
+ newOwnTrackingNo: this.getOrderShippingInformation(item.marketplaceOrderItems, 'ownTrackingNo'),
452
+ newOwnTransporter: this.getOrderShippingInformation(item.marketplaceOrderItems, 'ownTransporter'),
453
+ postCode: this.getOrderShippingInformation(item.marketplaceOrderItems, 'postCode')
486
454
  }
487
455
  })
488
456
 
@@ -493,8 +461,8 @@ class OrderByStore extends localize(i18next)(PageView) {
493
461
  }
494
462
  }
495
463
 
496
- getTrackingNos(marketplaceOrderItems) {
497
- let trackingNo = ''
464
+ getOrderShippingInformation(marketplaceOrderItems, type) {
465
+ let item
498
466
  let marketplaceOrderShippings = []
499
467
 
500
468
  marketplaceOrderItems.map(item => {
@@ -509,23 +477,48 @@ class OrderByStore extends localize(i18next)(PageView) {
509
477
  return marketplaceOrderShippings.find(a => a.id === id)
510
478
  })
511
479
 
512
- if (uniqueMarketplaceOrderShippings) {
513
- uniqueMarketplaceOrderShippings.map(marketplaceOrderShipping => {
514
- if (this.store?.platform === PLATFORM.LAZADA.value) {
515
- var newTrackingNo = []
516
- if (marketplaceOrderShipping?.trackingNo) {
517
- const trackingNos = JSON.parse(marketplaceOrderShipping.trackingNo)
518
- newTrackingNo = trackingNos.map(item => item.tracking_code)
519
- }
520
- let uniqueTrackingNos = [...new Set(newTrackingNo)]
521
- trackingNo = uniqueTrackingNos.join(', ')
522
- } else {
523
- trackingNo = marketplaceOrderShipping.trackingNo
480
+ switch (type) {
481
+ case 'trackingNo':
482
+ if (uniqueMarketplaceOrderShippings) {
483
+ uniqueMarketplaceOrderShippings.map(marketplaceOrderShipping => {
484
+ if (this.store?.platform === PLATFORM.LAZADA.value) {
485
+ var newTrackingNo = []
486
+ if (marketplaceOrderShipping?.trackingNo) {
487
+ const trackingNos = JSON.parse(marketplaceOrderShipping.trackingNo)
488
+ newTrackingNo = trackingNos.map(item => item.tracking_code)
489
+ }
490
+ let uniqueTrackingNos = [...new Set(newTrackingNo)]
491
+ item = uniqueTrackingNos.join(', ')
492
+ } else {
493
+ item = marketplaceOrderShipping.trackingNo
494
+ }
495
+ })
524
496
  }
525
- })
497
+ break
498
+ case 'ownTrackingNo':
499
+ if (uniqueMarketplaceOrderShippings) {
500
+ uniqueMarketplaceOrderShippings.map(marketplaceOrderShipping => {
501
+ item = marketplaceOrderShipping.ownTrackingNo
502
+ })
503
+ }
504
+ break
505
+ case 'ownTransporter':
506
+ if (uniqueMarketplaceOrderShippings) {
507
+ uniqueMarketplaceOrderShippings.map(marketplaceOrderShipping => {
508
+ item = marketplaceOrderShipping.ownTransporter
509
+ })
510
+ }
511
+ break
512
+ case 'postCode':
513
+ if (uniqueMarketplaceOrderShippings) {
514
+ uniqueMarketplaceOrderShippings.map(marketplaceOrderShipping => {
515
+ item = marketplaceOrderShipping.postCode
516
+ })
517
+ }
518
+ break
526
519
  }
527
520
 
528
- return trackingNo
521
+ return item
529
522
  }
530
523
 
531
524
  _syncOrder() {
@@ -575,7 +568,7 @@ class OrderByStore extends localize(i18next)(PageView) {
575
568
  backdrop: true,
576
569
  escapable: false,
577
570
  size: 'large',
578
- title: `${record.name}`
571
+ title: `${record.orderNo}`
579
572
  }
580
573
  )
581
574
  }
@@ -600,7 +593,27 @@ class OrderByStore extends localize(i18next)(PageView) {
600
593
  )
601
594
  }
602
595
 
603
- _openLazadaOrderInitBatch(record) {
596
+ _openDefaultOrderInitBatch() {
597
+ openPopup(
598
+ html`
599
+ <batch-init-popup
600
+ .store="${this.store}"
601
+ @order-updated="${() => {
602
+ this.dataGrist.fetch()
603
+ this._showToast({ message: i18next.t('text.order_has_been_updated') })
604
+ }}"
605
+ ></batch-init-popup>
606
+ `,
607
+ {
608
+ backdrop: true,
609
+ escapable: false,
610
+ size: 'large',
611
+ title: i18next.t('text.order_init_batch')
612
+ }
613
+ )
614
+ }
615
+
616
+ _openLazadaOrderInitBatch() {
604
617
  openPopup(
605
618
  html`
606
619
  <lazada-order-init-batch-popup
@@ -696,6 +709,7 @@ class OrderByStore extends localize(i18next)(PageView) {
696
709
  } else {
697
710
  switch (this.store.platform) {
698
711
  case 'shopee':
712
+ case 'woocommerce':
699
713
  const orderDocUrls = orderDocInfo.map(item => item.airwayBill)
700
714
  for (var i = 0; i < orderDocUrls.length; i++) {
701
715
  orderDocUrls[i] = 'urls=' + orderDocUrls[i]
@@ -709,6 +723,9 @@ class OrderByStore extends localize(i18next)(PageView) {
709
723
  var decodedHTML = atob(orderDocInfo[0].file)
710
724
  this._callPrintDialog(decodedHTML)
711
725
  break
726
+
727
+ default:
728
+ break
712
729
  }
713
730
  }
714
731
  }
@@ -718,28 +735,30 @@ class OrderByStore extends localize(i18next)(PageView) {
718
735
  }
719
736
  }
720
737
 
721
- _callPrintDialog(contentSource) {
738
+ async _callPrintDialog(contentSource) {
722
739
  const iframe = document.createElement('iframe')
723
740
  iframe.style.display = 'none'
724
741
  document.body.appendChild(iframe)
725
742
 
726
743
  switch (this.store.platform) {
727
744
  case 'shopee':
728
- iframe.src = contentSource
729
- iframe.onload = () => {
730
- iframe.focus()
731
- iframe.contentWindow.print()
732
- this._showToast({ message: i18next.t('text.document_has_been_generated') })
733
- }
745
+ default:
746
+ GhostPrint.print({
747
+ src: contentSource,
748
+ onfinish: () => {
749
+ this._showToast({ message: i18next.t('text.document_has_been_generated') })
750
+ }
751
+ })
734
752
  break
735
753
 
736
754
  case 'lazada':
737
- iframe.contentDocument.body.innerHTML = contentSource
738
- setTimeout(() => {
739
- iframe.focus()
740
- iframe.contentWindow.print()
741
- this._showToast({ message: i18next.t('text.document_has_been_generated') })
742
- }, 1000)
755
+ GhostPrint.print({
756
+ srcdoc: contentSource,
757
+ pending: 1000,
758
+ onfinish: () => {
759
+ this._showToast({ message: i18next.t('text.document_has_been_generated') })
760
+ }
761
+ })
743
762
  break
744
763
  }
745
764
  }
@@ -748,8 +767,8 @@ class OrderByStore extends localize(i18next)(PageView) {
748
767
  try {
749
768
  const response = await client.query({
750
769
  query: gql`
751
- query marketplaceOrdersForExport($orderNo: String!) {
752
- marketplaceOrdersForExport(orderNo: $orderNo) {
770
+ query marketplaceOrdersForExport($orderNos: [String!]!) {
771
+ marketplaceOrdersForExport(orderNos: $orderNos) {
753
772
  orderNo
754
773
  marketplaceStoreName
755
774
  marketplaceStorePlatform
@@ -759,10 +778,12 @@ class OrderByStore extends localize(i18next)(PageView) {
759
778
  status
760
779
  shippingProvider
761
780
  trackingNo
781
+ createdAt
782
+ updatedAt
762
783
  }
763
784
  }
764
785
  `,
765
- variables: { orderNo: selectedOrderNo }
786
+ variables: { orderNos: selectedOrderNo }
766
787
  })
767
788
 
768
789
  if (!response.errors) {
@@ -777,12 +798,18 @@ class OrderByStore extends localize(i18next)(PageView) {
777
798
  try {
778
799
  let records = []
779
800
  if (this.dataGrist.selected && this.dataGrist.selected.length > 0) {
780
- let header = [
781
- ...this.excelConfig.columns
782
- .filter(column => column.type !== 'gutter' && column.record !== undefined && column.imex !== undefined)
783
- .map(column => {
784
- return column.imex
785
- })
801
+ const headerSetting = [
802
+ { header: i18next.t('field.order_no'), key: 'orderNo', width: 75, type: 'string' },
803
+ { header: i18next.t('field.store_name'), key: 'marketplaceStoreName', width: 75, type: 'string' },
804
+ { header: i18next.t('field.platform'), key: 'marketplaceStorePlatform', width: 75, type: 'string' },
805
+ { header: i18next.t('field.sku'), key: 'sku', width: 75, type: 'string' },
806
+ { header: i18next.t('field.variation_name'), key: 'variationName', width: 75, type: 'string' },
807
+ { header: i18next.t('field.tracking_no'), key: 'trackingNo', width: 75, type: 'string' },
808
+ { header: i18next.t('field.shipping_carrier'), key: 'shippingProvider', width: 75, type: 'string' },
809
+ { header: i18next.t('field.qty'), key: 'itemQty', width: 75, type: 'number' },
810
+ { header: i18next.t('field.status'), key: 'status', width: 75, type: 'string' },
811
+ { header: i18next.t('field.created_at'), key: 'createdAt', width: 75, type: 'date' },
812
+ { header: i18next.t('field.updated_at'), key: 'updatedAt', width: 75, type: 'date' }
786
813
  ]
787
814
 
788
815
  records = this.dataGrist.selected
@@ -790,7 +817,7 @@ class OrderByStore extends localize(i18next)(PageView) {
790
817
 
791
818
  let data = await this._fetchOrdersForExport(selectedOrderNo)
792
819
 
793
- return { header, data }
820
+ return { header: headerSetting, data }
794
821
  }
795
822
  } catch (e) {
796
823
  this._showToast(e)
@@ -4,6 +4,7 @@ import { connect } from 'pwa-helpers/connect-mixin.js'
4
4
  import { client, store, PageView } from '@things-factory/shell'
5
5
  import gql from 'graphql-tag'
6
6
  import '../../components/stock-allocation-ratio'
7
+ import '../../components/marketplace-order-max-weight'
7
8
 
8
9
  class MarketplaceSetting extends connect(store)(PageView) {
9
10
  static get styles() {
@@ -55,10 +56,20 @@ class MarketplaceSetting extends connect(store)(PageView) {
55
56
 
56
57
  <stock-allocation-ratio
57
58
  .ratioSettings=${ratioSettings.filter(setting => setting.category === 'stock_allocation')}
59
+ .category=${'stock_allocation'}
58
60
  @fetch-settings=${async () => {
59
61
  this.ratioSettings = await this.fetchMarketplaceSettings()
60
62
  }}
61
63
  ></stock-allocation-ratio>
64
+
65
+ <div subtitle>${i18next.t('text.update_marketplace_order_max_weight')}</div>
66
+
67
+ <marketplace-order-max-weight
68
+ .maxWeightSettings=${ratioSettings.filter(setting => setting.category === 'marketplace_order_max_weight')}
69
+ @fetch-settings=${async () => {
70
+ this.ratioSettings = await this.fetchMarketplaceSettings()
71
+ }}
72
+ ></marketplace-order-max-weight>
62
73
  `
63
74
  }
64
75
 
@@ -135,6 +146,7 @@ class MarketplaceSetting extends connect(store)(PageView) {
135
146
  marketplaceStore {
136
147
  id
137
148
  name
149
+ storeName
138
150
  platform
139
151
  description
140
152
  }
@@ -14,7 +14,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
14
14
  var __importStar = (this && this.__importStar) || function (mod) {
15
15
  if (mod && mod.__esModule) return mod;
16
16
  var result = {};
17
- if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
18
  __setModuleDefault(result, mod);
19
19
  return result;
20
20
  };
@@ -14,7 +14,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
14
14
  var __importStar = (this && this.__importStar) || function (mod) {
15
15
  if (mod && mod.__esModule) return mod;
16
16
  var result = {};
17
- if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
18
  __setModuleDefault(result, mod);
19
19
  return result;
20
20
  };