@things-factory/operato-wms 4.1.26 → 5.0.0-alpha.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 (42) hide show
  1. package/client/pages/adjustment/transfer-inventory.js +8 -4
  2. package/client/pages/bulk-operation/bulk-operation.js +12 -5
  3. package/client/pages/bulk-operation/validate-gan-popup.js +6 -6
  4. package/client/pages/inbound/unload-product.js +1 -1
  5. package/client/pages/inventory/inventory-adjustment-approval.js +21 -7
  6. package/client/pages/inventory/inventory-adjustment.js +99 -54
  7. package/client/pages/inventory-check/create-cycle-count.js +0 -2
  8. package/client/pages/master/product/product-detail-bizplace-setting-popup.js +0 -2
  9. package/client/pages/master/product/product-details-popup.js +10 -9
  10. package/client/pages/master/product/product-list.js +10 -9
  11. package/client/pages/order/arrival-notice/arrival-notice-detail.js +6 -6
  12. package/client/pages/order/arrival-notice/create-arrival-notice.js +25 -24
  13. package/client/pages/order/arrival-notice/duplicate-arrival-notice.js +31 -30
  14. package/client/pages/order/arrival-notice/edit-product-popup.js +12 -25
  15. package/client/pages/order/arrival-notice/proceed-edit-product-popup.js +4 -4
  16. package/client/pages/order/arrival-notice/view-product-changes-popup.js +4 -4
  17. package/client/pages/outbound/worksheet-batch-picking.js +1 -1
  18. package/client/pages/report/inbound-order-details-report.js +9 -8
  19. package/client/pages/report/outbound-order-details-report.js +9 -8
  20. package/dist-server/graphql/index.js +5 -1
  21. package/dist-server/graphql/index.js.map +1 -1
  22. package/dist-server/graphql/resolvers/index.js +5 -1
  23. package/dist-server/graphql/resolvers/index.js.map +1 -1
  24. package/dist-server/graphql/resolvers/reports/inbound-order-details-report.js +2 -2
  25. package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js +2 -2
  26. package/dist-server/graphql/types/index.js +5 -1
  27. package/dist-server/graphql/types/index.js.map +1 -1
  28. package/dist-server/graphql/types/reports/inbound-order-details-report.js +1 -1
  29. package/dist-server/graphql/types/reports/outbound-order-details-report.js +1 -1
  30. package/dist-server/index.js +5 -1
  31. package/dist-server/index.js.map +1 -1
  32. package/dist-server/utils/index.js +5 -1
  33. package/dist-server/utils/index.js.map +1 -1
  34. package/package.json +51 -51
  35. package/server/graphql/resolvers/reports/inbound-order-details-report.ts +2 -2
  36. package/server/graphql/resolvers/reports/outbound-order-details-report.ts +2 -2
  37. package/server/graphql/types/reports/inbound-order-details-report.ts +1 -1
  38. package/server/graphql/types/reports/outbound-order-details-report.ts +1 -1
  39. package/translations/en.json +5 -2
  40. package/translations/ko.json +5 -1
  41. package/translations/ms.json +5 -1
  42. package/translations/zh.json +5 -1
@@ -365,7 +365,7 @@ class TransferInventory extends connect(store)(localize(i18next)(PageView)) {
365
365
  ></barcode-scanable-input>`
366
366
  : ``
367
367
  : html`
368
- <label class="content-title">${i18next.t('label.carton_id')}</label>
368
+ <label class="content-title">${i18next.t('label.new_carton_id')}</label>
369
369
  <barcode-scanable-input
370
370
  name="newCartonId"
371
371
  custom-input
@@ -580,9 +580,13 @@ class TransferInventory extends connect(store)(localize(i18next)(PageView)) {
580
580
 
581
581
  if (!response.errors) {
582
582
  if (response.data.inventories.total == 0) {
583
- if (this.refInventoryType === INVENTORY_TYPES.LOT.value) this.focusOnPalletInput()
584
- else this.focusOnCartonInput()
585
- throw new Error(i18next.t('text.wrong_lot_id'))
583
+ if (this.refInventoryType === INVENTORY_TYPES.LOT.value) {
584
+ this.focusOnPalletInput()
585
+ throw new Error(i18next.t('text.lot_id_not_found'))
586
+ } else {
587
+ this.focusOnCartonInput()
588
+ throw new Error(i18next.t('text.carton_id_not_found'))
589
+ }
586
590
  }
587
591
 
588
592
  this._data = {
@@ -167,7 +167,7 @@ class BulkOperation extends localize(i18next)(PageView) {
167
167
  refNo: '',
168
168
  refNo2: '',
169
169
  refNo3: '',
170
- etaDate: '',
170
+ etaDate: new Date(),
171
171
  truckNo: '',
172
172
  containerNo: '',
173
173
  containerSize: '',
@@ -181,7 +181,7 @@ class BulkOperation extends localize(i18next)(PageView) {
181
181
  uom: '',
182
182
  packQty: 0,
183
183
  palletQty: 0,
184
- manufactureYear: 0,
184
+ manufactureDate: new Date(),
185
185
  unitPrice: ''
186
186
  }
187
187
  ]
@@ -348,7 +348,8 @@ class BulkOperation extends localize(i18next)(PageView) {
348
348
  html`
349
349
  <validate-gan-popup
350
350
  .records=${records.map(raw => {
351
- let etaDate = new Date(String(raw.etaDate || ''))
351
+ let etaDate = new Date((raw.etaDate - (25567 + 1)) * 86400 * 1000 || NULL)
352
+ let mfgDate = new Date((raw.manufactureDate - (25567 + 1)) * 86400 * 1000 || NULL)
352
353
 
353
354
  return {
354
355
  refNo: String(raw.refNo || ''),
@@ -369,8 +370,14 @@ class BulkOperation extends localize(i18next)(PageView) {
369
370
  packQty: parseInt(raw.packQty || 0),
370
371
  palletQty: parseInt(raw.palletQty || 0),
371
372
  unitPrice: Number(raw.unitPrice || 0),
372
- manufactureYear: Math.round(Number(raw.manufactureYear || 0)),
373
- etaDate: this._getStdDateStr(etaDate)
373
+ manufactureDate: `${mfgDate.getFullYear()}-${(mfgDate.getMonth() + 1).toString().padStart(2, 0)}-${mfgDate
374
+ .getDate()
375
+ .toString()
376
+ .padStart(2, 0)}`,
377
+ etaDate: `${etaDate.getFullYear()}-${(etaDate.getMonth() + 1).toString().padStart(2, 0)}-${etaDate
378
+ .getDate()
379
+ .toString()
380
+ .padStart(2, 0)}`
374
381
  }
375
382
  })}
376
383
  .bizplaceId=${this._ganBizplaceId}
@@ -109,7 +109,7 @@ class ValidateGanPopup extends localize(i18next)(LitElement) {
109
109
  width: 150
110
110
  },
111
111
  {
112
- type: 'string',
112
+ type: 'date',
113
113
  name: 'etaDate',
114
114
  header: i18next.t('field.eta_date'),
115
115
  width: 150
@@ -205,9 +205,9 @@ class ValidateGanPopup extends localize(i18next)(LitElement) {
205
205
  width: 100
206
206
  },
207
207
  {
208
- type: 'integer',
209
- name: 'manufactureYear',
210
- header: i18next.t('field.manufacture_year'),
208
+ type: 'date',
209
+ name: 'manufactureDate',
210
+ header: i18next.t('field.manufacture_date'),
211
211
  width: 100
212
212
  },
213
213
  {
@@ -291,7 +291,7 @@ class ValidateGanPopup extends localize(i18next)(LitElement) {
291
291
  totalUomValue
292
292
  palletQty
293
293
  unitPrice
294
- manufactureYear
294
+ manufactureDate
295
295
  errorMsg
296
296
  }
297
297
  }
@@ -346,7 +346,7 @@ class ValidateGanPopup extends localize(i18next)(LitElement) {
346
346
  packQty: raw.packQty,
347
347
  palletQty: raw.palletQty,
348
348
  unitPrice: raw.unitPrice,
349
- manufactureYear: raw.manufactureYear
349
+ manufactureDate: new Date(parseInt(raw.manufactureDate))
350
350
  }
351
351
  }),
352
352
  bizplaceId
@@ -10,7 +10,7 @@ import './select-product-batch'
10
10
 
11
11
  import gql from 'graphql-tag'
12
12
  import { css, html } from 'lit-element'
13
- import orderBy from 'lodash/orderBy'
13
+ import orderBy from 'lodash-es/orderBy'
14
14
  import { connect } from 'pwa-helpers/connect-mixin.js'
15
15
 
16
16
  import { MultiColumnFormStyles } from '@things-factory/form-ui'
@@ -135,7 +135,7 @@ class InventoryAdjustmentApproval extends connect(store)(localize(i18next)(PageV
135
135
  { column: 'uom', name: 'Uom' },
136
136
  { column: 'uomValue', name: 'UomValue' },
137
137
  { column: 'expirationDate', name: 'Exp. Date' },
138
- { column: 'manufactureYear', name: 'Mfg. Date' },
138
+ { column: 'manufactureDate', name: 'Mfg. Date' },
139
139
  { column: 'unitCost', name: 'Unit Cost' }
140
140
  ]
141
141
 
@@ -368,7 +368,7 @@ class InventoryAdjustmentApproval extends connect(store)(localize(i18next)(PageV
368
368
  status
369
369
  transactionType
370
370
  expirationDate
371
- manufactureYear
371
+ manufactureDate
372
372
  unitCost
373
373
  bizplace {
374
374
  id
@@ -412,7 +412,7 @@ class InventoryAdjustmentApproval extends connect(store)(localize(i18next)(PageV
412
412
  uom
413
413
  uomValue
414
414
  expirationDate
415
- manufactureYear
415
+ manufactureDate
416
416
  unitCost
417
417
  }
418
418
  lastInventoryHistory {
@@ -442,7 +442,7 @@ class InventoryAdjustmentApproval extends connect(store)(localize(i18next)(PageV
442
442
  uom
443
443
  uomValue
444
444
  expirationDate
445
- manufactureYear
445
+ manufactureDate
446
446
  unitCost
447
447
  }
448
448
  createdAt
@@ -474,19 +474,33 @@ class InventoryAdjustmentApproval extends connect(store)(localize(i18next)(PageV
474
474
  ? this._convertUnixTimestampToDate(item?.inventory?.expirationDate)
475
475
  : null
476
476
 
477
+ let inventoryChangesMfgDate = item?.manufactureDate
478
+ ? this._convertUnixTimestampToDate(item?.manufactureDate)
479
+ : null
480
+ let lastInventoryChangesMfgDate = item?.lastInventoryHistory?.manufactureDate
481
+ ? this._convertUnixTimestampToDate(item?.lastInventoryHistory?.manufactureDate)
482
+ : null
483
+
484
+ let inventoryMfgDate = item?.inventory?.manufactureDate
485
+ ? this._convertUnixTimestampToDate(item?.inventory?.manufactureDate)
486
+ : null
487
+
477
488
  return {
478
489
  ...item,
479
490
  cartonId: item.inventory?.cartonId,
480
491
  inventory: {
481
492
  ...item.inventory,
482
- expirationDate: inventoryExpDate ? inventoryExpDate : null
493
+ expirationDate: inventoryExpDate ? inventoryExpDate : null,
494
+ manufactureDate: inventoryMfgDate ? inventoryMfgDate : null
483
495
  },
484
496
  lastInventoryHistory: {
485
497
  ...item.lastInventoryHistory,
486
- expirationDate: lastInventoryChangesExpDate ? lastInventoryChangesExpDate : null
498
+ expirationDate: lastInventoryChangesExpDate ? lastInventoryChangesExpDate : null,
499
+ manufactureDate: lastInventoryChangesMfgDate ? lastInventoryChangesMfgDate : null
487
500
  },
488
501
  customerName: item?.inventory?.bizplace?.name || item.bizplace.name,
489
- expirationDate: inventoryChangesExpDate ? inventoryChangesExpDate : null
502
+ expirationDate: inventoryChangesExpDate ? inventoryChangesExpDate : null,
503
+ manufactureDate: inventoryChangesMfgDate ? inventoryChangesMfgDate : null
490
504
  }
491
505
  }) || []
492
506
  }
@@ -425,11 +425,11 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
425
425
  width: 150
426
426
  },
427
427
  {
428
- type: 'number',
429
- name: 'manufactureYear',
430
- header: i18next.t('field.manufacture_year'),
431
- imex: { header: i18next.t('field.manufacture_year'), key: 'manufactureYear', width: 40, type: 'number' },
432
- record: { editable: true, options: { min: 1500, max: 2200 } },
428
+ type: 'date',
429
+ name: 'manufactureDate',
430
+ header: i18next.t('field.manufacture_date'),
431
+ imex: { header: i18next.t('field.manufacture_date'), key: 'manufactureDate', width: 40, type: 'date' },
432
+ record: { editable: true },
433
433
  sortable: true,
434
434
  width: 120
435
435
  },
@@ -437,7 +437,6 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
437
437
  type: 'string',
438
438
  name: 'remark',
439
439
  header: i18next.t('field.remark'),
440
- imex: { header: i18next.t('field.remark'), key: 'remark', width: 40, type: 'string' },
441
440
  sortable: true,
442
441
  width: 200,
443
442
  handlers: {
@@ -501,7 +500,7 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
501
500
  packingSize
502
501
  uom
503
502
  uomValue
504
- manufactureYear
503
+ manufactureDate
505
504
  bizplace {
506
505
  id
507
506
  name
@@ -586,7 +585,7 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
586
585
  uomValue
587
586
  remark
588
587
  expirationDate
589
- manufactureYear
588
+ manufactureDate
590
589
  unitCost
591
590
  bizplace {
592
591
  id
@@ -679,46 +678,34 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
679
678
  }
680
679
 
681
680
  fieldChange(e) {
681
+ let popUpDataGrist = e.target?.shadowRoot.querySelector('data-grist')
682
+
683
+ let item = e.target.localName == 'import-pop-up' ? popUpDataGrist : this.dataGrist
684
+
682
685
  switch (e.detail.column.name) {
683
686
  case 'uomValue':
684
- if (e.detail.after < 0) this.dataGrist._data.records[e.detail.row].uomValue = 0
687
+ if (e.detail.after < 0) item._data.records[e.detail.row].uomValue = 0
685
688
  break
686
689
  case 'qty':
687
690
  if (e.detail.after < 0 || !Number.isInteger(e.detail.after))
688
- this.dataGrist._data.records[e.detail.row].qty = e.detail.before
691
+ item._data.records[e.detail.row].qty = e.detail.before
689
692
  break
690
693
  case 'unitCost':
691
- if (e.detail.after < 0) this.dataGrist._data.records[e.detail.row].unitCost = e.detail.before
694
+ if (e.detail.after < 0) item._data.records[e.detail.row].unitCost = e.detail.before
692
695
  break
693
- case 'manufactureYear':
694
- if (
695
- e.detail.after != 0 &&
696
- (e.detail.after < 0 ||
697
- !Number.isInteger(e.detail.after) ||
698
- e.detail.after.toString().length < 4 ||
699
- e.detail.after.toString().length > 4)
700
- ) {
701
- this.dataGrist._data.records[e.detail.row].manufactureYear = e.detail.before == 0 ? null : e.detail.before
702
- this._showToast({ type: 'error', message: 'Invalid Manufacture Year.' })
703
- } else if (e.detail.after == 0) {
704
- this.dataGrist._data.records[e.detail.row].manufactureYear = null
705
- }
706
-
696
+ case 'manufactureDate':
697
+ if (new Date(e.detail.after) > new Date()) item._data.records[e.detail.row].manufactureDate = e.detail.before
707
698
  break
708
699
  case 'product':
709
- this.dataGrist._data.records[e.detail.row].uom = e.detail.after?.uom ? e.detail.after.uom : ''
700
+ item._data.records[e.detail.row].uom = e.detail.after?.uom ? e.detail.after.uom : ''
710
701
 
711
- this.dataGrist._data.records[e.detail.row].packingType = e.detail.after?.packingType
712
- ? e.detail.after.packingType
713
- : ''
702
+ item._data.records[e.detail.row].packingType = e.detail.after?.packingType ? e.detail.after.packingType : ''
714
703
 
715
- this.dataGrist._data.records[e.detail.row].packingSize = e.detail.after?.packingSize
716
- ? e.detail.after.packingSize
717
- : 1
704
+ item._data.records[e.detail.row].packingSize = e.detail.after?.packingSize ? e.detail.after.packingSize : 1
718
705
 
719
- this.dataGrist._data.records[e.detail.row].brand = e.detail.after?.brand ? e.detail.after.brand : ''
706
+ item._data.records[e.detail.row].brand = e.detail.after?.brand ? e.detail.after.brand : ''
720
707
 
721
- this.dataGrist._data.records[e.detail.row].sku = e.detail.after?.sku ? e.detail.after.sku : ''
708
+ item._data.records[e.detail.row].sku = e.detail.after?.sku ? e.detail.after.sku : ''
722
709
  break
723
710
  default:
724
711
  break
@@ -775,28 +762,81 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
775
762
  }
776
763
 
777
764
  async importHandler(patches) {
778
- patches.map(itm => {
779
- itm.qty = parseFloat(itm.qty)
780
- itm.packingSize = parseFloat(itm.packingSize)
781
- itm.uomValue = parseFloat(itm.uomValue)
782
- itm.manufactureYear = parseFloat(itm.manufactureYear)
783
- let dt = new Date(itm.expirationDate)
784
- itm.expirationDate = `${dt.getFullYear()}-${dt.getMonth() + 1}-${dt.getDate()}`
785
- })
765
+ try {
766
+ patches.map(itm => {
767
+ if (itm.cuFlag == '+') {
768
+ if (
769
+ !itm.bizplace?.id ||
770
+ !itm.location?.id ||
771
+ !itm.product?.id ||
772
+ !itm.batchId ||
773
+ !itm.qty ||
774
+ !itm.uomValue ||
775
+ !itm.uom ||
776
+ !itm.packingType
777
+ ) {
778
+ throw new Error(i18next.t('text.empty_value_in_list'))
779
+ }
786
780
 
787
- const response = await client.mutate({
788
- mutation: gql`
789
- mutation submitInventoryChanges($patches: [InventoryPatch!]!) {
790
- submitInventoryChanges(patches: $patches)
781
+ if (itm.qty < 1 || itm.unitCost < 0 || itm.packingSize < 1 || itm.uomValue < 1) {
782
+ throw new Error(i18next.t('text.invalid_value_in_list'))
783
+ }
784
+
785
+ if (itm.manufactureYear && itm.manufactureYear < 1000) {
786
+ throw new Error(i18next.t('text.invalid_value_in_list'))
787
+ }
788
+ }
789
+ itm.qty = parseInt(itm.qty)
790
+ itm.packingSize = parseFloat(itm.packingSize)
791
+ itm.uomValue = parseFloat(itm.uomValue)
792
+ itm.unitCost = parseFloat(itm.unitCost)
793
+
794
+ //if user repic location after import
795
+ if (itm.location.zone || itm.location.row || itm.location.column) {
796
+ delete itm.location.zone
797
+ delete itm.location.row
798
+ delete itm.location.column
791
799
  }
792
- `,
793
- variables: { patches }
794
- })
795
800
 
796
- if (!response.errors) {
797
- history.back()
798
- this.dataGrist.fetch()
799
- this._showToast({ message: i18next.t('text.data_submitted_for_approval') })
801
+ //if user repick product after import
802
+ if (itm.product.productId) {
803
+ itm.product.id = itm.product.productId
804
+ delete itm.product.productId
805
+ delete itm.product.brand
806
+ delete itm.product.packingType
807
+ delete itm.product.packingSize
808
+ delete itm.product.sku
809
+ delete itm.product.type
810
+ delete itm.product.uom
811
+ }
812
+
813
+ if (itm.expirationDate) {
814
+ let dt = new Date(itm.expirationDate)
815
+ itm.expirationDate = `${dt.getFullYear()}-${dt.getMonth() + 1}-${dt.getDate()}`
816
+ }
817
+
818
+ if (itm.manufactureDate) {
819
+ let mdt = new Date(itm.manufactureDate)
820
+ itm.manufactureDate = `${mdt.getFullYear()}-${mdt.getMonth() + 1}-${mdt.getDate()}`
821
+ }
822
+ })
823
+
824
+ const response = await client.mutate({
825
+ mutation: gql`
826
+ mutation submitInventoryChanges($patches: [InventoryPatch!]!) {
827
+ submitInventoryChanges(patches: $patches)
828
+ }
829
+ `,
830
+ variables: { patches }
831
+ })
832
+
833
+ if (!response.errors) {
834
+ history.back()
835
+ this.dataGrist.fetch()
836
+ this._showToast({ message: i18next.t('text.data_submitted_for_approval') })
837
+ }
838
+ } catch (e) {
839
+ this._showToast(e)
800
840
  }
801
841
  }
802
842
 
@@ -811,6 +851,7 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
811
851
  columns: [...this.config.columns.filter(column => column.imex !== undefined)]
812
852
  }}
813
853
  .importHandler="${this.importHandler.bind(this)}"
854
+ @field-change="${this.fieldChange.bind(this)}"
814
855
  ></import-pop-up>
815
856
  `,
816
857
  {
@@ -870,10 +911,14 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
870
911
  })
871
912
 
872
913
  data = data.map(item => {
873
- if (item?.expirationDate != '') {
914
+ if (item?.expirationDate !== null && item?.expirationDate !== '') {
874
915
  item.expirationDate = new Date(item.expirationDate).getTime()
875
916
  }
876
917
 
918
+ if (item?.manufactureDate !== null && item?.manufactureDate !== '') {
919
+ item.manufactureDate = new Date(item.manufactureDate).getTime()
920
+ }
921
+
877
922
  item.product.name = item.product.productInformation
878
923
  return {
879
924
  id: item.id,
@@ -16,8 +16,6 @@ import { isMobileDevice } from '@things-factory/utils'
16
16
  import { fetchLocationSortingRule } from '../../fetch-location-sorting-rule'
17
17
  import { LOCATION_SORTING_RULE } from '../constants'
18
18
 
19
- const _ = require('lodash')
20
-
21
19
  class CreateCycleCount extends localize(i18next)(PageView) {
22
20
  static get properties() {
23
21
  return {
@@ -9,8 +9,6 @@ import { client, CustomAlert, gqlContext } from '@things-factory/shell'
9
9
  import { ScrollbarStyles } from '@things-factory/styles'
10
10
  import { flattenObject, isMobileDevice } from '@things-factory/utils'
11
11
 
12
- const _ = require('lodash')
13
-
14
12
  export class ProductDetailBizplaceSettingPopup extends localize(i18next)(LitElement) {
15
13
  static get styles() {
16
14
  return [
@@ -3,6 +3,9 @@ import '@things-factory/grist-ui'
3
3
 
4
4
  import gql from 'graphql-tag'
5
5
  import { css, html, LitElement } from 'lit-element'
6
+ import isEmpty from 'lodash-es/isEmpty'
7
+ import isNaN from 'lodash-es/isNaN'
8
+ import isNumber from 'lodash-es/isNumber'
6
9
 
7
10
  import { getCodeByName } from '@things-factory/code-base'
8
11
  import { i18next, localize } from '@things-factory/i18n-base'
@@ -10,8 +13,6 @@ import { client, CustomAlert, gqlContext } from '@things-factory/shell'
10
13
  import { ScrollbarStyles } from '@things-factory/styles'
11
14
  import { isMobileDevice } from '@things-factory/utils'
12
15
 
13
- const _ = require('lodash')
14
-
15
16
  export class ProductDetailsPopup extends localize(i18next)(LitElement) {
16
17
  static get styles() {
17
18
  return [
@@ -555,20 +556,20 @@ export class ProductDetailsPopup extends localize(i18next)(LitElement) {
555
556
  let data = this.dataGrist._data.records.map(itm => {
556
557
  itm.error = false
557
558
 
558
- if (_.isEmpty(itm.gtin) || '') {
559
+ if (isEmpty(itm.gtin) || '') {
559
560
  itm.error = true
560
561
  if (!errors.find(err => err.type == 'gtin')) errors.push({ type: 'gtin', value: 'GTIN is required' })
561
562
  }
562
- if (_.isEmpty(itm.packingType) || '') {
563
+ if (isEmpty(itm.packingType) || '') {
563
564
  itm.error = true
564
565
  if (!errors.find(err => err.type == 'packingType'))
565
566
  errors.push({ type: 'packingType', value: 'Packing type is required' })
566
567
  }
567
- if (_.isEmpty(itm.uom) || '') {
568
+ if (isEmpty(itm.uom) || '') {
568
569
  itm.error = true
569
570
  if (!errors.find(err => err.type == 'uom')) errors.push({ type: 'uom', value: 'UOM is required' })
570
571
  }
571
- if (!_.isNumber(itm.uomValue) || _.isNaN(itm.uomValue) || '') {
572
+ if (!isNumber(itm.uomValue) || isNaN(itm.uomValue) || '') {
572
573
  itm.error = true
573
574
  if (!errors.find(err => err.type == 'uomValue'))
574
575
  errors.push({ type: 'uomValue', value: 'UOM Value is required' })
@@ -626,7 +627,7 @@ export class ProductDetailsPopup extends localize(i18next)(LitElement) {
626
627
  ...this.dataGrist._data,
627
628
  records: this._updateRowOption(
628
629
  this.dataGrist._data.records.map((record, idx) => {
629
- if (!_.isEmpty(record.childProductDetail) && record.childProductDetail == before) {
630
+ if (!isEmpty(record.childProductDetail) && record.childProductDetail == before) {
630
631
  record.childProductDetail = after
631
632
  }
632
633
  return record
@@ -636,7 +637,7 @@ export class ProductDetailsPopup extends localize(i18next)(LitElement) {
636
637
 
637
638
  break
638
639
  case 'uomValue':
639
- if (_.isNaN(after)) {
640
+ if (isNaN(after)) {
640
641
  updatedRecords.records[row].uomValue = 1
641
642
  }
642
643
  break
@@ -691,7 +692,7 @@ export class ProductDetailsPopup extends localize(i18next)(LitElement) {
691
692
  value: ''
692
693
  },
693
694
  ...data
694
- .filter(child => child.gtin != itm.gtin && !_.isEmpty(child.gtin))
695
+ .filter(child => child.gtin != itm.gtin && !isEmpty(child.gtin))
695
696
  .map(x => {
696
697
  const rowOption = {
697
698
  display: x.gtin,
@@ -5,6 +5,9 @@ import './product-detail-bizplace-setting-popup'
5
5
 
6
6
  import gql from 'graphql-tag'
7
7
  import { css, html } from 'lit-element'
8
+ import isEmpty from 'lodash-es/isEmpty'
9
+ import isNaN from 'lodash-es/isNaN'
10
+ import isNumber from 'lodash-es/isNumber'
8
11
 
9
12
  import { getCodeByName } from '@things-factory/code-base'
10
13
  import { i18next, localize } from '@things-factory/i18n-base'
@@ -14,8 +17,6 @@ import { client, CustomAlert, gqlContext, PageView } from '@things-factory/shell
14
17
  import { CommonButtonStyles, ScrollbarStyles } from '@things-factory/styles'
15
18
  import { isMobileDevice } from '@things-factory/utils'
16
19
 
17
- const _ = require('lodash')
18
-
19
20
  class ProductList extends localize(i18next)(PageView) {
20
21
  static get properties() {
21
22
  return {
@@ -821,7 +822,7 @@ class ProductList extends localize(i18next)(PageView) {
821
822
 
822
823
  async _saveProducts(patches) {
823
824
  try {
824
- if (_.isEmpty(this._bizplaceInput.value) || this._bizplaceInput?.value == undefined) {
825
+ if (isEmpty(this._bizplaceInput.value) || this._bizplaceInput?.value == undefined) {
825
826
  return this.showToast(i18next.t('text.no_company_selected'))
826
827
  }
827
828
 
@@ -944,23 +945,23 @@ class ProductList extends localize(i18next)(PageView) {
944
945
  _validate(data) {
945
946
  let errors = []
946
947
  data = data.map(itm => {
947
- if (_.isEmpty(itm.sku) || '') {
948
+ if (isEmpty(itm.sku) || '') {
948
949
  if (!errors.find(err => err.type == 'sku')) errors.push({ type: 'sku', value: 'Product SKU is required' })
949
950
  }
950
- if (_.isEmpty(itm.name) || '') {
951
+ if (isEmpty(itm.name) || '') {
951
952
  if (!errors.find(err => err.type == 'name')) errors.push({ type: 'name', value: 'Product name is required' })
952
953
  }
953
- if (_.isEmpty(itm.type) || '') {
954
+ if (isEmpty(itm.type) || '') {
954
955
  if (!errors.find(err => err.type == 'type')) errors.push({ type: 'name', value: 'Product type is required' })
955
956
  }
956
- if (_.isEmpty(itm.packingType) || '') {
957
+ if (isEmpty(itm.packingType) || '') {
957
958
  if (!errors.find(err => err.type == 'packingType'))
958
959
  errors.push({ type: 'packingType', value: 'Packing type is required' })
959
960
  }
960
- if (_.isEmpty(itm.uom) || '') {
961
+ if (isEmpty(itm.uom) || '') {
961
962
  if (!errors.find(err => err.type == 'uom')) errors.push({ type: 'uom', value: 'UOM is required' })
962
963
  }
963
- if (!_.isNumber(itm.uomValue) || _.isNaN(itm.uomValue) || '' || itm?.uomValue <= 0) {
964
+ if (!isNumber(itm.uomValue) || isNaN(itm.uomValue) || '' || itm?.uomValue <= 0) {
964
965
  if (!errors.find(err => err.type == 'uomValue'))
965
966
  errors.push({ type: 'uomValue', value: 'UOM Value is required' })
966
967
  }
@@ -678,10 +678,10 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
678
678
  width: 80
679
679
  },
680
680
  {
681
- type: 'string',
682
- name: 'manufactureYear',
683
- header: i18next.t('field.manufacture_year'),
684
- width: 100
681
+ type: 'date',
682
+ name: 'manufactureDate',
683
+ header: i18next.t('field.manufacture_date'),
684
+ width: 120
685
685
  },
686
686
  {
687
687
  type: 'string',
@@ -722,7 +722,7 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
722
722
  'packQty',
723
723
  'totalUomValue',
724
724
  'palletQty',
725
- 'manufactureYear',
725
+ 'manufactureDate',
726
726
  'batchIdRef',
727
727
  'unitPrice',
728
728
  'remark'
@@ -811,7 +811,7 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
811
811
  adjustedTotalUomValue
812
812
  palletQty
813
813
  adjustedPalletQty
814
- manufactureYear
814
+ manufactureDate
815
815
  releaseQty
816
816
  releaseUomValue
817
817
  }