@things-factory/operato-wms 4.0.36 → 4.0.40

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 (40) hide show
  1. package/client/bootstrap.js +24 -1
  2. package/client/pages/bulk-operation/bulk-operation.js +4 -3
  3. package/client/pages/bulk-operation/validate-gan-popup.js +10 -2
  4. package/client/pages/bulk-operation/validate-ro-popup.js +3 -5
  5. package/client/pages/components/popup-reusable-pallet.js +8 -1
  6. package/client/pages/components/worksheet-information-popup.js +1 -1
  7. package/client/pages/inbound/putaway-product.js +45 -38
  8. package/client/pages/inbound/unload-product.js +36 -43
  9. package/client/pages/inventory/inventory-adjustment.js +22 -26
  10. package/client/pages/inventory/inventory-by-product.js +0 -12
  11. package/client/pages/manifest/create-loading-manifest.js +1 -1
  12. package/client/pages/manifest/loading-manifest-list.js +3 -3
  13. package/client/pages/order/arrival-notice/assign-buffer-location.js +24 -9
  14. package/client/pages/order/arrival-notice/create-arrival-notice.js +1 -1
  15. package/client/pages/order/release-order/b2b/b2b-order-list.js +12 -1
  16. package/client/pages/order/release-order/b2c/b2c-order-requests.js +55 -3
  17. package/client/pages/order/release-order/create-release-order.js +14 -0
  18. package/client/pages/order/release-order/release-order-detail.js +2 -1
  19. package/client/pages/order/reverse-kitting-order/reverse-kitting-order-detail.js +21 -45
  20. package/client/pages/order/transport-order/contact-point-selector-popup.js +11 -10
  21. package/client/pages/outbound/picking-product.js +226 -231
  22. package/client/pages/outbound/show-ro-list-popup.js +1 -1
  23. package/client/pages/outbound/single-outbound-worksheet.js +3 -3
  24. package/client/pages/outbound/sorting-product.js +23 -27
  25. package/client/pages/outbound/worksheet-picking.js +1 -1
  26. package/client/pages/report/custom-elccl/elccl-daily-order-inventory-report.js +5 -1
  27. package/client/pages/report/custom-elccl/elccl-delivery-order-summary.js +1 -1
  28. package/client/pages/report/custom-elccl/elccl-inventory-report.js +13 -1
  29. package/client/pages/report/inventory-report.js +1 -0
  30. package/client/pages/report/product-label-report.js +0 -39
  31. package/client/pages/vas/reverse-kitting/popup-combination-sets.js +1 -1
  32. package/helps/release-note.ko.md +3 -0
  33. package/helps/release-note.md +3 -0
  34. package/helps/release-note.ms.md +3 -0
  35. package/helps/release-note.zh.md +3 -0
  36. package/package.json +65 -65
  37. package/translations/en.json +15 -6
  38. package/translations/ko.json +12 -3
  39. package/translations/ms.json +12 -3
  40. package/translations/zh.json +12 -3
@@ -178,7 +178,7 @@ class CreateLoadingManifest extends localize(i18next)(PageView) {
178
178
  type: 'string',
179
179
  name: 'transporter',
180
180
  label: true,
181
- header: i18next.t('field.shipping_provider'),
181
+ header: i18next.t('field.transporter'),
182
182
  width: 200
183
183
  }
184
184
  ]
@@ -95,7 +95,7 @@ class LoadingManifestList extends localize(i18next)(PageView) {
95
95
  props: { searchOper: 'i_like' }
96
96
  },
97
97
  {
98
- label: i18next.t('field.shipping_provider'),
98
+ label: i18next.t('field.transporter'),
99
99
  name: 'shippingProvider',
100
100
  type: 'text',
101
101
  props: { searchOper: 'i_like' }
@@ -174,7 +174,7 @@ class LoadingManifestList extends localize(i18next)(PageView) {
174
174
  {
175
175
  type: 'string',
176
176
  name: 'shippingProvider',
177
- header: i18next.t('field.shipping_provider'),
177
+ header: i18next.t('field.transporter'),
178
178
  label: true,
179
179
  sortable: true,
180
180
  width: 150
@@ -272,7 +272,7 @@ class LoadingManifestList extends localize(i18next)(PageView) {
272
272
 
273
273
  var headerSetting = [
274
274
  { header: i18next.t('field.manifest_no'), key: 'name', width: 25, type: 'string' },
275
- { header: i18next.t('field.shipping_provider'), key: 'shippingProvider', width: 25, type: 'string' },
275
+ { header: i18next.t('field.transporter'), key: 'shippingProvider', width: 25, type: 'string' },
276
276
  { header: i18next.t('field.dispatch_at'), key: 'dispatchedAt', width: 25, type: 'date' },
277
277
  { header: i18next.t('field.status'), key: 'status', width: 25, type: 'string' },
278
278
  { header: i18next.t('field.created_at'), key: 'createdAt', width: 30, type: 'date' },
@@ -1,16 +1,20 @@
1
- import { MultiColumnFormStyles } from '@things-factory/form-ui'
2
- import { CommonButtonStyles } from '@things-factory/styles'
3
1
  import '@things-factory/grist-ui'
2
+ import '../../components/attachment-viewer'
3
+ import '../../components/popup-note'
4
+ import '../../components/vas-templates'
5
+ import '@things-factory/warehouse-ui'
6
+
7
+ import gql from 'graphql-tag'
8
+ import { css, html } from 'lit-element'
9
+
10
+ import { MultiColumnFormStyles } from '@things-factory/form-ui'
4
11
  import { getRenderer } from '@things-factory/grist-ui'
5
12
  import { i18next, localize } from '@things-factory/i18n-base'
6
13
  import { openPopup } from '@things-factory/layout-base'
7
14
  import { client, CustomAlert, navigate, PageView } from '@things-factory/shell'
15
+ import { CommonButtonStyles } from '@things-factory/styles'
8
16
  import { isMobileDevice } from '@things-factory/utils'
9
- import gql from 'graphql-tag'
10
- import { css, html } from 'lit-element'
11
- import '../../components/attachment-viewer'
12
- import '../../components/popup-note'
13
- import '../../components/vas-templates'
17
+
14
18
  import {
15
19
  ORDER_STATUS,
16
20
  VAS_BATCH_AND_PRODUCT_TYPE,
@@ -18,7 +22,6 @@ import {
18
22
  VAS_ETC_TYPE,
19
23
  VAS_PRODUCT_TYPE
20
24
  } from '../../constants'
21
- import { BufferLocationSelector } from '@things-factory/warehouse-ui'
22
25
 
23
26
  class AssignBufferLocation extends localize(i18next)(PageView) {
24
27
  static get properties() {
@@ -432,6 +435,12 @@ class AssignBufferLocation extends localize(i18next)(PageView) {
432
435
  refNo2
433
436
  refNo3
434
437
  importCargo
438
+ purchaseOrder {
439
+ bufferLocation {
440
+ id
441
+ name
442
+ }
443
+ }
435
444
  attachment {
436
445
  id
437
446
  name
@@ -504,7 +513,13 @@ class AssignBufferLocation extends localize(i18next)(PageView) {
504
513
 
505
514
  if (!response.errors) {
506
515
  const { arrivalNotice } = response.data
507
- const { orderProducts, orderVass } = arrivalNotice
516
+ const { orderProducts, orderVass, purchaseOrder } = arrivalNotice
517
+
518
+ if (purchaseOrder) {
519
+ const bufferLocation = purchaseOrder.bufferLocation
520
+ this.bufferLocationField.value = bufferLocation?.name
521
+ this.bufferLocationField.setAttribute('location-id', bufferLocation.id)
522
+ }
508
523
 
509
524
  this.orderBizplace = arrivalNotice.bizplace
510
525
  this._hasContainer = arrivalNotice.containerNo ? true : false
@@ -1658,7 +1658,7 @@ class CreateArrivalNotice extends localize(i18next)(PageView) {
1658
1658
  async bulkUploadValidateOrderProducts(patches) {
1659
1659
  const response = await client.query({
1660
1660
  query: gql`
1661
- query bulkUploadValidateOrderProducts($orderProducts: [NewOrderProduct], $partnerBizplaceId: String!) {
1661
+ query bulkUploadValidateOrderProducts($orderProducts: [NewOrderProduct!], $partnerBizplaceId: String!) {
1662
1662
  bulkUploadValidateOrderProducts(orderProducts: $orderProducts, partnerBizplaceId: $partnerBizplaceId) {
1663
1663
  id
1664
1664
  packingType
@@ -106,7 +106,7 @@ class B2bOrderList extends localize(i18next)(PageView) {
106
106
  async pageInitialized() {
107
107
  this.isUserBelongsDomain = await this._checkUserBelongsDomain()
108
108
  const [_orderStatusReq, _bizplacesReq] = await Promise.allSettled([
109
- getCodeByName('RO_LIST_STATUS'),
109
+ getCodeByName('RO_REQUESTS_STATUS'),
110
110
  this._fetchBizplaces()
111
111
  ])
112
112
 
@@ -577,6 +577,17 @@ class B2bOrderList extends localize(i18next)(PageView) {
577
577
  })
578
578
  return { header: headerSetting, data: data }
579
579
  }
580
+
581
+ _showToast({ type, message }) {
582
+ document.dispatchEvent(
583
+ new CustomEvent('notify', {
584
+ detail: {
585
+ type,
586
+ message
587
+ }
588
+ })
589
+ )
590
+ }
580
591
  }
581
592
 
582
593
  window.customElements.define('b2b-order-list', B2bOrderList)
@@ -6,6 +6,7 @@ import '../batch-generate-single-picking-worksheet-popup'
6
6
  import gql from 'graphql-tag'
7
7
  import { css, html } from 'lit-element'
8
8
 
9
+ import { GhostPrint } from '@operato/ghost-print'
9
10
  import { getCodeByName } from '@things-factory/code-base'
10
11
  import { i18next, localize } from '@things-factory/i18n-base'
11
12
  import { openPopup } from '@things-factory/layout-base'
@@ -15,6 +16,11 @@ import { isMobileDevice } from '@things-factory/utils'
15
16
 
16
17
  import { ORDER_STATUS } from '../../../constants'
17
18
 
19
+ const HEADER_JSON = {
20
+ 'Content-Type': 'application/json',
21
+ Accept: 'application/json'
22
+ }
23
+
18
24
  class B2cOrderRequests extends localize(i18next)(PageView) {
19
25
  static get styles() {
20
26
  return [
@@ -62,6 +68,11 @@ class B2cOrderRequests extends localize(i18next)(PageView) {
62
68
  return {
63
69
  title: i18next.t('title.release_order_requests'),
64
70
  actions: [
71
+ {
72
+ title: i18next.t('button.print_invoice'),
73
+ action: this._printInvoices.bind(this),
74
+ ...CommonButtonStyles.label
75
+ },
65
76
  {
66
77
  title: i18next.t('button.generate_packing_list'),
67
78
  action: this._generatePackingList.bind(this),
@@ -179,7 +190,7 @@ class B2cOrderRequests extends localize(i18next)(PageView) {
179
190
  value: new Date().toISOString().split('T')[0]
180
191
  },
181
192
  {
182
- label: i18next.t('field.shipping_provider'),
193
+ label: i18next.t('field.transporter'),
183
194
  name: 'transporter',
184
195
  type: 'select',
185
196
  props: {
@@ -288,7 +299,7 @@ class B2cOrderRequests extends localize(i18next)(PageView) {
288
299
  {
289
300
  type: 'string',
290
301
  name: 'transporter',
291
- header: i18next.t('field.courier'),
302
+ header: i18next.t('field.transporter'),
292
303
  sortable: true,
293
304
  width: 120
294
305
  },
@@ -495,6 +506,47 @@ class B2cOrderRequests extends localize(i18next)(PageView) {
495
506
  )
496
507
  }
497
508
 
509
+ async _printInvoices() {
510
+ try {
511
+ if (this.dataGrist.selected && this.dataGrist.selected.length > 0) {
512
+ var timezoneOffSet = new Date().getTimezoneOffset().toString()
513
+ let url = new URL(window.location)
514
+
515
+ let data = await Promise.all(
516
+ this.dataGrist.selected.map(async x => {
517
+ return x.id
518
+ })
519
+ )
520
+
521
+ let response = await fetch(`/view_invoices/${timezoneOffSet}`, {
522
+ method: 'POST',
523
+ credentials: 'include',
524
+ headers: HEADER_JSON,
525
+ body: JSON.stringify({ roIds: data })
526
+ }).then(function (response) {
527
+ return response.text()
528
+ })
529
+
530
+ this._callPrintDialog(response)
531
+
532
+ // navigate(`print_invoices/${data}`)
533
+ } else {
534
+ throw new Error(`Please select a record.`)
535
+ }
536
+ } catch (e) {
537
+ this._showToast(e)
538
+ }
539
+ }
540
+
541
+ async _callPrintDialog(contentSource) {
542
+ GhostPrint.print({
543
+ srcdoc: contentSource,
544
+ onfinish: () => {
545
+ this._showToast({ message: i18next.t('text.document_has_been_generated') })
546
+ }
547
+ })
548
+ }
549
+
498
550
  _compareValues(key, order = 'asc') {
499
551
  return function innerSort(a, b) {
500
552
  if (!a.hasOwnProperty(key) || !b.hasOwnProperty(key)) {
@@ -547,7 +599,7 @@ class B2cOrderRequests extends localize(i18next)(PageView) {
547
599
  type: 'string'
548
600
  },
549
601
  { header: i18next.t('field.warehouse_status'), key: 'status', width: 30, type: 'string' },
550
- { header: i18next.t('field.courier'), key: 'transporter', width: 30, type: 'string' },
602
+ { header: i18next.t('field.transporter'), key: 'transporter', width: 30, type: 'string' },
551
603
  { header: i18next.t('field.delivery_address'), key: 'deliveryAddress1', width: 30, type: 'string' },
552
604
  { header: i18next.t('field.attention_to'), key: 'attentionTo', width: 30, type: 'string' },
553
605
  { header: i18next.t('field.phone'), key: 'phone1', width: 30, type: 'string' }
@@ -252,6 +252,8 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
252
252
  } else {
253
253
  this._warehouseTransportInput.checked = true
254
254
  this._warehouseTransport = true
255
+ this._exportOptionInput.checked = false
256
+ this._exportOption = false
255
257
  }
256
258
  this._validateTransport()
257
259
  }}"
@@ -269,6 +271,8 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
269
271
  if (this._warehouseTransport) {
270
272
  this._ownTransportInput.checked = false
271
273
  this._ownTransport = false
274
+ this._exportOptionInput.checked = false
275
+ this._exportOption = false
272
276
  } else {
273
277
  this._ownTransportInput.checked = true
274
278
  this._ownTransport = true
@@ -288,6 +292,16 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
288
292
  ?hidden="${!this._checkTransport}"
289
293
  @change="${e => {
290
294
  this._exportOption = e.currentTarget.checked
295
+ if (this._exportOption == true) {
296
+ this._warehouseTransportInput.checked = false
297
+ this._warehouseTransport = false
298
+ this._ownTransportInput.checked = true
299
+ this._ownTransport = true
300
+ }
301
+ if (this._warehouseTransport) {
302
+ this._exportOptionInput.checked = false
303
+ this._exportOption = false
304
+ }
291
305
  }}"
292
306
  />
293
307
  <label for="exportOption" ?hidden="${!this._checkTransport}">${i18next.t('label.export')}</label>
@@ -294,7 +294,8 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
294
294
  <input name="refNo3" ?readonly="${!this?._editable}" />
295
295
 
296
296
  <label>${i18next.t('label.release_date')}</label>
297
- <input name="releaseDate" type="date" ?readonly="${!this?._editable}" required />
297
+ <input name="releaseDate" type="date" ?readonly="${!this
298
+ ?._editable}" min="${this._getStdDate()}" required />
298
299
 
299
300
  <label ?hidden="${!this._ownTransport}">${i18next.t('label.co_no')}</label>
300
301
  <input name="collectionOrderNo" ?hidden="${!this._ownTransport}" ?readonly="${!this?._editable}" />
@@ -140,7 +140,6 @@ class ReverseKittingOrderDetail extends connect(store)(localize(i18next)(PageVie
140
140
  .config=${this.inventoryGristConfig}
141
141
  .data=${this.inventoryData}
142
142
  @record-change="${this._onProductChangeHandler.bind(this)}"
143
- @field-change="${this._onInventoryFieldChanged.bind(this)}"
144
143
  ></data-grist>
145
144
  </div>
146
145
  </div>
@@ -223,7 +222,7 @@ class ReverseKittingOrderDetail extends connect(store)(localize(i18next)(PageVie
223
222
  if (this.active) {
224
223
  if (changes.resourceId) {
225
224
  this._reverseKittingNo = changes.resourceId
226
- } else {
225
+ } else if (!this._reverseKittingNo) {
227
226
  this._reverseKittingNo = 'new'
228
227
  }
229
228
 
@@ -379,8 +378,9 @@ class ReverseKittingOrderDetail extends connect(store)(localize(i18next)(PageVie
379
378
 
380
379
  try {
381
380
  if (changedColumn === 'qty') {
382
- this._validateQty(changeRecord.qty)
381
+ this._validateQty(changeRecord.qty, changeRecord.remainQty)
383
382
  }
383
+ this._updateQtyAndUomValue(event.detail.row, changedColumn, event.detail.before, changeRecord)
384
384
  } catch (e) {
385
385
  const beforeValue = event.detail.before && event.detail.before[event.detail.column.name]
386
386
  if (beforeValue) {
@@ -392,42 +392,18 @@ class ReverseKittingOrderDetail extends connect(store)(localize(i18next)(PageVie
392
392
  }
393
393
  }
394
394
 
395
- _onInventoryFieldChanged(e) {
396
- let columnName = e.detail.column.name
395
+ _updateQtyAndUomValue(rowIndex, columnName, initialRecord, newRecord) {
397
396
  let roundedUomValue = 0
398
397
  let qty = 0
399
398
 
400
- if (columnName == 'uomValue' || columnName == 'qty' || columnName == 'inventory') {
401
- if (columnName == 'inventory') {
402
- if (
403
- e.detail.after.remainUomValue &&
404
- e.detail.after.remainQty &&
405
- e.detail.after.remainUomValue > 0 &&
406
- e.detail.after.remainQty > 0
407
- ) {
408
- qty = e.detail.record.qty || 0
409
-
410
- roundedUomValue = qty * (e.detail.after.remainUomValue / e.detail.after.remainQty)
399
+ if (columnName == 'qty' || columnName == 'uomValue') {
400
+ if (initialRecord?.remainQty && initialRecord?.remainUomValue) {
401
+ let packageUomValue = initialRecord.remainUomValue / initialRecord.remainQty
411
402
 
412
- roundedUomValue = parseFloat(roundedUomValue.toFixed(2))
413
- }
414
- } else {
415
- let packageUomValue = e.detail.record.remainUomValue / e.detail.record.remainQty
416
- if (
417
- e.detail.record.remainUomValue &&
418
- e.detail.record.remainQty &&
419
- e.detail.record.remainUomValue > 0 &&
420
- e.detail.record.remainQty > 0
421
- ) {
422
- if (columnName === 'qty') {
423
- qty = e.detail.after || 0
424
- } else {
425
- qty = Math.round(e.detail.after / packageUomValue)
426
- }
403
+ if (columnName == 'qty') qty = newRecord.qty || 0
404
+ else qty = Math.round(newRecord.uomValue / packageUomValue)
427
405
 
428
- roundedUomValue = qty * packageUomValue
429
- roundedUomValue = parseFloat(roundedUomValue.toFixed(2))
430
- }
406
+ roundedUomValue = Math.round(qty * packageUomValue * 100) / 100
431
407
  }
432
408
  }
433
409
 
@@ -435,20 +411,16 @@ class ReverseKittingOrderDetail extends connect(store)(localize(i18next)(PageVie
435
411
  ...this.inventoryData,
436
412
  ...this.inventoryGrist.dirtyData,
437
413
  records: this.inventoryGrist.dirtyData.records.map((record, idx) => {
438
- // const factor = this._pickingStd === PICKING_STANDARD.SELECT_BY_PRODUCT.value ? e.detail.row : e.detail.record.id
439
-
440
- if ((columnName == 'uomValue' || columnName == 'qty' || columnName == 'inventory') && idx === e.detail.row) {
414
+ if (idx == rowIndex && (columnName == 'qty' || columnName == 'uomValue')) {
441
415
  if (columnName == 'uomValue') record.qty = qty
442
416
  record.uomValue = roundedUomValue
443
417
  }
444
418
 
445
- let returnObj = {
419
+ return {
446
420
  ...record,
447
421
  ...record.inventory,
448
422
  name: record.name ? record.name : idx
449
423
  }
450
-
451
- return returnObj
452
424
  })
453
425
  }
454
426
 
@@ -783,21 +755,25 @@ class ReverseKittingOrderDetail extends connect(store)(localize(i18next)(PageVie
783
755
  }
784
756
 
785
757
  checkInventoryValidity() {
786
- if (!this.inventoryGrist.dirtyData.records || !this.inventoryGrist.dirtyData.records.length) {
758
+ let records = this.inventoryGrist.dirtyData?.records
759
+
760
+ if (!records || !records.length) {
787
761
  throw new Error(i18next.t('text.there_is_no_inventory'))
788
762
  }
789
763
 
790
- if (this.inventoryGrist.dirtyData.records.some(record => !record.inventory && !record.inventory.id))
764
+ if (records.some(record => !record.inventory && !record.inventory.id))
791
765
  throw new Error(i18next.t('text.invalid_inventory'))
792
766
 
793
- if (this.inventoryGrist.dirtyData.records.some(record => !record.productCombination))
767
+ if (records.some(record => !record.productCombination))
794
768
  throw new Error(i18next.t('text.invalid_product_combination'))
795
769
 
770
+ records.forEach(record => this._validateQty(record.qty, record.remainQty))
771
+
796
772
  return true
797
773
  }
798
774
 
799
- _validateQty(qty) {
800
- if (qty <= 0) {
775
+ _validateQty(qty, remainQty) {
776
+ if (!qty || qty <= 0 || qty > remainQty) {
801
777
  throw new Error(i18next.t('text.invalid_quantity_input'))
802
778
  }
803
779
  }
@@ -209,17 +209,18 @@ class ContactPointSelectorPopup extends localize(i18next)(LitElement) {
209
209
 
210
210
  const response = await client.query({
211
211
  query: gql`
212
- query contactPoints(($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
213
- contactPoints(filters: $filters, pagination: $pagination, sortings: $sortings) {) {
214
- items {
215
- id
216
- name
217
- companyName
218
- email
219
- address
220
- billingAddress
212
+ query contactPoints($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
213
+ contactPoints(filters: $filters, pagination: $pagination, sortings: $sortings) {
214
+ items {
215
+ id
216
+ name
217
+ companyName
218
+ email
219
+ address
220
+ billingAddress
221
+ }
222
+ total
221
223
  }
222
- total
223
224
  }
224
225
  `,
225
226
  variables: {