@things-factory/operato-wms 4.0.28 → 4.0.32

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 (50) hide show
  1. package/client/fetch-setting-value.js +10 -2
  2. package/client/pages/bulk-operation/bulk-operation.js +44 -10
  3. package/client/pages/bulk-operation/validate-gan-popup.js +5 -4
  4. package/client/pages/bulk-operation/validate-ro-popup.js +7 -39
  5. package/client/pages/components/popup-reusable-pallet.js +145 -0
  6. package/client/pages/components/vas-templates/vas-pallet-add-popup.js +12 -11
  7. package/client/pages/components/vas-templates/vas-relabel.js +57 -34
  8. package/client/pages/components/vas-templates/vas-repack-relabel.js +56 -36
  9. package/client/pages/components/vas-templates/vas-repack.js +45 -31
  10. package/client/pages/components/vas-templates/vas-repalletizing.js +58 -39
  11. package/client/pages/components/vas-templates/vas-unpack.js +38 -24
  12. package/client/pages/components/worksheet-information-popup.js +4 -1
  13. package/client/pages/inbound/unload-product.js +119 -103
  14. package/client/pages/inventory/onhand-inventory.js +1 -0
  15. package/client/pages/order/arrival-notice/arrival-notice-detail.js +52 -44
  16. package/client/pages/order/arrival-notice/arrival-notice-list.js +2 -5
  17. package/client/pages/order/release-order/b2b/b2b-order-list.js +1 -5
  18. package/client/pages/order/release-order/batch-picking-popup.js +4 -3
  19. package/client/pages/order/release-order/create-release-order.js +1 -1
  20. package/client/pages/order/release-order/release-extra-product-popup.js +10 -5
  21. package/client/pages/order/release-order/release-order-detail.js +31 -14
  22. package/client/pages/order/return-order/create-return-order.js +41 -52
  23. package/client/pages/order/reverse-kitting-order/reverse-kitting-order-detail.js +2 -2
  24. package/client/pages/order/transport-order/create-delivery-order.js +4 -2
  25. package/client/pages/order/transport-order/delivery-note-popup.js +2 -2
  26. package/client/pages/outbound/packing-worksheet-list.js +64 -4
  27. package/client/pages/outbound/picking-product.js +12 -7
  28. package/client/pages/outbound/worksheet-batch-picking.js +1 -1
  29. package/client/pages/outbound/worksheet-picking.js +2 -2
  30. package/client/pages/report/custom-elccl/elccl-inventory-summary-report.js +5 -1
  31. package/client/pages/report/inbound-order-details-report.js +3 -5
  32. package/client/pages/vas/abstract-execute-vas.js +4 -1
  33. package/client/pages/vas/execute-pure-vas.js +3 -8
  34. package/client/pages/vas/reverse-kitting/execute-reverse-kitting.js +3 -3
  35. package/client/pages/vas/reverse-kitting/popup-combination-sets.js +3 -3
  36. package/client/pages/vas/reverse-kitting/popup-reverse-kitting-template.js +1 -1
  37. package/config.development.js +73 -0
  38. package/config.production.js +113 -0
  39. package/dist-server/graphql/resolvers/reports/inbound-order-details-report.js +2 -4
  40. package/dist-server/graphql/resolvers/reports/inbound-order-details-report.js.map +1 -1
  41. package/dist-server/graphql/types/reports/inbound-order-details-report.js +2 -1
  42. package/dist-server/graphql/types/reports/inbound-order-details-report.js.map +1 -1
  43. package/package.json +65 -65
  44. package/server/graphql/resolvers/reports/inbound-order-details-report.ts +2 -4
  45. package/server/graphql/types/reports/inbound-order-details-report.ts +2 -1
  46. package/translations/en.json +15 -1
  47. package/translations/ko.json +20 -7
  48. package/translations/ms.json +21 -8
  49. package/translations/zh.json +21 -8
  50. package/client/pages/components/popup-unloading.js +0 -610
@@ -1,7 +1,7 @@
1
1
  import '@things-factory/barcode-ui'
2
2
  import '@things-factory/grist-ui'
3
3
  import '../components/popup-note'
4
- import '../components/popup-unloading'
4
+ import '../components/popup-reusable-pallet'
5
5
  import './palletizing-pallets-popup'
6
6
  import '../components/worksheet-information-popup'
7
7
  import './unloaded-inventories-popup'
@@ -21,12 +21,14 @@ import { CommonButtonStyles } from '@things-factory/styles'
21
21
  import { isMobileDevice } from '@things-factory/utils'
22
22
 
23
23
  import { fetchSettingRule } from '../../fetch-setting-value'
24
- import { ARRIVAL_NOTICE, PALLET_STATUS, RETURN_ORDER, VAS_TYPE } from '../constants'
24
+ import { ARRIVAL_NOTICE, RETURN_ORDER, VAS_TYPE } from '../constants'
25
25
 
26
26
  const AVAIL_ORDER_TYPES = { ARRIVAL_NOTICE, RETURN_ORDER }
27
27
  class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
28
28
  static get properties() {
29
29
  return {
30
+ _worksheetLoaded: Boolean,
31
+ _usingReusablePallet: Boolean,
30
32
  _bizplaceName: String,
31
33
  _cartonId: String,
32
34
  _enableProductScanning: Boolean,
@@ -36,11 +38,9 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
36
38
  _isLooseItem: Boolean,
37
39
  _isQtyChecked: Boolean,
38
40
  _isRequiredCheckExpiry: Boolean,
39
- _isReusablePallet: Boolean,
40
41
  _orderNo: String,
41
42
  _palletId: String,
42
- _reusablePalletId: Array,
43
- _reusablePalletIdData: Object,
43
+ _reusablePallet: Object,
44
44
  _scanning: Boolean,
45
45
  _selectedOrderProduct: Object,
46
46
  _selectedInventory: Object,
@@ -108,6 +108,22 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
108
108
 
109
109
  get context() {
110
110
  var actions = []
111
+ if (this._worksheetLoaded && !this._enableCartonLabel) {
112
+ if (this._usingReusablePallet) {
113
+ actions.push({
114
+ title: i18next.t('button.wooden_pallet'),
115
+ action: this._woodenPalletMode.bind(this),
116
+ ...CommonButtonStyles.activate
117
+ })
118
+ } else {
119
+ actions.push({
120
+ title: i18next.t('button.plastic_pallet'),
121
+ action: this._reusablePalletMode.bind(this),
122
+ ...CommonButtonStyles.activate
123
+ })
124
+ }
125
+ }
126
+
111
127
  if (this._isLooseItem) {
112
128
  actions.push({
113
129
  title: i18next.t('button.vas'),
@@ -290,6 +306,8 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
290
306
 
291
307
  constructor() {
292
308
  super()
309
+ this._worksheetLoaded = false
310
+ this._usingReusablePallet = false
293
311
  this._enableCartonLabel = false
294
312
  this._enableInputQty = true
295
313
  this._enableProductScanning = false
@@ -297,7 +315,6 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
297
315
  this._isLooseItem = false
298
316
  this._isQtyChecked = false
299
317
  this._isRequiredCheckExpiry = false
300
- this._isReusablePallet = false
301
318
  this._orderNo = ''
302
319
  this._scanning = false
303
320
  this.refOrderType = AVAIL_ORDER_TYPES.ARRIVAL_NOTICE.value
@@ -310,7 +327,8 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
310
327
  if (
311
328
  changedProps.has('_orderNo') ||
312
329
  changedProps.has('_selectedOrderProduct') ||
313
- changedProps.has('_unloadedInventories')
330
+ changedProps.has('_unloadedInventories') ||
331
+ changedProps.has('_usingReusablePallet')
314
332
  ) {
315
333
  this.updateContext()
316
334
  }
@@ -547,6 +565,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
547
565
  })
548
566
 
549
567
  if (!response.errors) {
568
+ this._worksheetLoaded = true
550
569
  const worksheetInfo = response.data.unloadingWorksheet.worksheetInfo
551
570
  const orderVasInfo = worksheetInfo.orderVas
552
571
 
@@ -648,7 +667,6 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
648
667
  if (!response.errors) {
649
668
  this._orderNo = orderNo
650
669
  const worksheetInfo = response.data.unloadingReturnWorksheet.worksheetInfo
651
- this._fillUpForm(this.infoForm, worksheetInfo)
652
670
 
653
671
  this.orderProductData = {
654
672
  records: orderBy(
@@ -766,22 +784,15 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
766
784
  }
767
785
 
768
786
  async _transactionHandler(e) {
769
- if (e.keyCode === 13) {
770
- e.preventDefault()
771
- try {
772
- if (this._enableCartonLabel) {
773
- await this._validateUnloading()
774
- if (this._enableProductScanning && !this._enableInputQty) {
775
- this._scanProductUnload()
776
- } else {
777
- this._qtyUnload()
778
- }
779
- } else {
780
- this._checkReusablePallet()
781
- }
782
- } catch (e) {
783
- this._showToast(e)
784
- }
787
+ if (e.keyCode !== 13) return
788
+ e.preventDefault()
789
+ try {
790
+ if (!this._enableCartonLabel) return this._unloadSelected()
791
+ await this._validateUnloading()
792
+ if (!(this._enableProductScanning && !this._enableInputQty)) return this._qtyUnload()
793
+ this._scanProductUnload()
794
+ } catch (e) {
795
+ this._showToast(e)
785
796
  }
786
797
  }
787
798
 
@@ -789,18 +800,6 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
789
800
  if (this._scanning === false) {
790
801
  this._scanning = true
791
802
  try {
792
- if (this._isRequiredCheckExpiry && this._expirationPeriod > 0) {
793
- let date = new Date()
794
- const acceptBefore = new Date(date.setDate(date.getDate() + this._expirationPeriod))
795
- let expiryDate = new Date(this.expDateInput.value)
796
- if (expiryDate < acceptBefore) {
797
- await CustomAlert({
798
- title: i18next.t('title.item_unloading_is_expiring_soon'),
799
- confirmButton: { text: i18next.t('button.confirm') }
800
- })
801
- }
802
- }
803
-
804
803
  const response = await client.mutate({
805
804
  mutation: gql`
806
805
  mutation scanProductUnload(
@@ -827,6 +826,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
827
826
  })
828
827
 
829
828
  if (!response.errors) {
829
+ await this._checkExpiry()
830
830
  await this._fetchProducts(this._orderNo)
831
831
  }
832
832
  } catch (e) {
@@ -839,50 +839,50 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
839
839
  }
840
840
  }
841
841
 
842
- async _qtyUnload() {
843
- if (this._scanning === false) {
844
- this._scanning = true
845
- try {
846
- if (this._isRequiredCheckExpiry && this._expirationPeriod > 0) {
847
- let date = new Date()
848
- const acceptBefore = new Date(date.setDate(date.getDate() + this._expirationPeriod))
849
- let expiryDate = new Date(this.expDateInput.value)
850
- if (expiryDate < acceptBefore) {
851
- await CustomAlert({
852
- title: i18next.t('title.item_unloading_is_expiring_soon'),
853
- confirmButton: { text: i18next.t('button.confirm') }
854
- })
855
- }
856
- }
842
+ async _checkExpiry() {
843
+ if (this._isRequiredCheckExpiry && this._expirationPeriod > 0) {
844
+ let date = new Date()
845
+ const acceptBefore = new Date(date.setDate(date.getDate() + this._expirationPeriod))
846
+ let expiryDate = new Date(this.expDateInput.value)
847
+ if (expiryDate < acceptBefore) {
848
+ await CustomAlert({
849
+ title: i18next.t('title.item_unloading_is_expiring_soon'),
850
+ confirmButton: { text: i18next.t('button.confirm') }
851
+ })
852
+ }
853
+ }
854
+ }
857
855
 
858
- const response = await client.mutate({
859
- mutation: gql`
860
- mutation unload($worksheetDetailName: String!, $inventory: InventoryPatch!, $productBarcode: String) {
861
- unload(worksheetDetailName: $worksheetDetailName, inventory: $inventory, productBarcode: $productBarcode)
862
- }
863
- `,
864
- variables: {
865
- worksheetDetailName: this._selectedOrderProduct.name,
866
- inventory: {
867
- palletId: this._enableCartonLabel ? null : this.lotInput.value.trim(),
868
- cartonId: this._enableCartonLabel ? this.cartonInput.value.trim() : null,
869
- qty: parseInt(this.actualQtyInput.value),
870
- expirationDate: this._isRequiredCheckExpiry ? this.expDateInput.value : null
871
- },
872
- productBarcode: this._enableProductScanning ? this.productBarcodeInput?.value : null
856
+ async _qtyUnload() {
857
+ if (this._scanning) return this._showToast({ message: i18next.t('text.previous_scan_is_executing') })
858
+ this._scanning = true
859
+ try {
860
+ const response = await client.mutate({
861
+ mutation: gql`
862
+ mutation unload($worksheetDetailName: String!, $inventory: InventoryPatch!, $productBarcode: String) {
863
+ unload(worksheetDetailName: $worksheetDetailName, inventory: $inventory, productBarcode: $productBarcode)
873
864
  }
874
- })
875
- if (!response.errors) {
876
- await this._fetchProducts(this._orderNo)
865
+ `,
866
+ variables: {
867
+ worksheetDetailName: this._selectedOrderProduct?.name || '',
868
+ inventory: {
869
+ palletId: this._enableCartonLabel ? null : this.lotInput.value.trim(),
870
+ cartonId: this._enableCartonLabel ? this.cartonInput.value.trim() : null,
871
+ qty: parseInt(this.actualQtyInput.value),
872
+ expirationDate: this._isRequiredCheckExpiry ? this.expDateInput.value : null,
873
+ reusablePallet: this._usingReusablePallet ? this._reusablePallet : null
874
+ },
875
+ productBarcode: this._enableProductScanning ? this.productBarcodeInput?.value : null
877
876
  }
878
- } catch (e) {
879
- this._showToast(e)
877
+ })
878
+ if (!response.errors) {
879
+ await this._checkExpiry()
880
+ await this._fetchProducts(this._orderNo)
880
881
  }
881
-
882
- this._scanning = false
883
- } else {
884
- this._showToast({ message: i18next.t('text.previous_scan_is_executing') })
882
+ } catch (e) {
883
+ this._showToast(e)
885
884
  }
885
+ this._scanning = false
886
886
  }
887
887
 
888
888
  async fetchProductDetail(gtin, productId) {
@@ -1017,7 +1017,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1017
1017
 
1018
1018
  if (this._isRequiredCheckExpiry) {
1019
1019
  if (!this.expDateInput.value) {
1020
- this._focusOnExipryDateInput()
1020
+ this._focusOnExpiryDateInput()
1021
1021
  throw new Error(i18next.t('text.expiry_date_is_empty'))
1022
1022
  }
1023
1023
  }
@@ -1045,7 +1045,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1045
1045
 
1046
1046
  if (this._isRequiredCheckExpiry) {
1047
1047
  if (!this.expDateInput.value) {
1048
- this._focusOnExipryDateInput()
1048
+ this._focusOnExpiryDateInput()
1049
1049
  throw new Error(i18next.t('text.expiry_date_is_empty'))
1050
1050
  }
1051
1051
  }
@@ -1169,7 +1169,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1169
1169
  }
1170
1170
  `,
1171
1171
  variables: {
1172
- worksheetDetailName: this._selectedOrderProduct.name,
1172
+ worksheetDetailName: this._selectedOrderProduct?.name || '',
1173
1173
  inventory: {
1174
1174
  palletId: this._enableCartonLabel ? null : this.lotInput.value.trim(),
1175
1175
  cartonId: this._enableCartonLabel ? this.cartonInput.value.trim() : null,
@@ -1248,33 +1248,13 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1248
1248
  }
1249
1249
  }
1250
1250
 
1251
- async _checkReusablePallet() {
1251
+ async _unloadSelected() {
1252
1252
  try {
1253
1253
  if (!this._selectedOrderProduct) throw new Error(i18next.t('text.target_is_not_selected'))
1254
1254
  if (!this.lotInput.value) return
1255
-
1256
- const response = await client.query({
1257
- query: gql`
1258
- query palletByStatus($name: String!, $status: String!) {
1259
- palletByStatus(name: $name, status: $status) {
1260
- id
1261
- name
1262
- }
1263
- }
1264
- `,
1265
- variables: { name: this.lotInput.value, status: PALLET_STATUS.ACTIVE.value }
1266
- })
1267
-
1268
- if (!response.errors) {
1269
- if (response.data.palletByStatus) {
1270
- this.reusablePalletIdData = response.data.palletByStatus
1271
- this._isReusablePallet = true
1272
- } else {
1273
- await this._validateUnloading()
1274
- await this._checkedLotScannedProduct()
1275
- this._qtyUnload()
1276
- }
1277
- }
1255
+ await this._validateUnloading()
1256
+ await this._checkedLotScannedProduct()
1257
+ this._qtyUnload()
1278
1258
  } catch (e) {
1279
1259
  this._showToast(e)
1280
1260
  }
@@ -1316,6 +1296,42 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1316
1296
  }
1317
1297
  )
1318
1298
  }
1299
+ _reusablePalletMode() {
1300
+ openPopup(
1301
+ html`
1302
+ <popup-reusable-pallet
1303
+ .label="${i18next.t('label.reusable_pallet_id')}"
1304
+ @submit=${async e => {
1305
+ this._usingReusablePallet = true
1306
+ this._reusablePallet = e.detail.reusablePallet
1307
+ this._worksheetInfo.plasticPallet = this._reusablePallet.name
1308
+ this.updateContext()
1309
+ }}
1310
+ ></popup-reusable-pallet>
1311
+ `,
1312
+ {
1313
+ backdrop: true,
1314
+ escapable: false,
1315
+ size: 'small',
1316
+ title: i18next.t('title.unloading_with_reusable_pallet')
1317
+ }
1318
+ )
1319
+ }
1320
+
1321
+ async _woodenPalletMode() {
1322
+ const result = await CustomAlert({
1323
+ title: i18next.t('title.are_you_sure'),
1324
+ text: i18next.t('text.use_wooden_pallet'),
1325
+ confirmButton: { text: i18next.t('button.confirm') },
1326
+ cancelButton: { text: i18next.t('button.cancel') }
1327
+ })
1328
+
1329
+ if (!result.value) return
1330
+ this._usingReusablePallet = false
1331
+ this._reusablePalletName = this._worksheetInfo.plasticPallet = ''
1332
+ this._showToast({ message: i18next.t('text.now_using_wooden_pallet') })
1333
+ this.updateContext()
1334
+ }
1319
1335
 
1320
1336
  _validateComplete() {
1321
1337
  if (this.refOrderType === AVAIL_ORDER_TYPES.ARRIVAL_NOTICE.value) {
@@ -1381,7 +1397,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1381
1397
  setTimeout(() => this.actualQtyInput.focus(), 100)
1382
1398
  }
1383
1399
 
1384
- _focusOnExipryDateInput() {
1400
+ _focusOnExpiryDateInput() {
1385
1401
  setTimeout(() => this.expDateInput.focus(), 100)
1386
1402
  }
1387
1403
 
@@ -479,6 +479,7 @@ class OnhandInventory extends connect(store)(localize(i18next)(PageView)) {
479
479
  { header: i18next.t('field.company'), key: 'bizplace_name', width: 30, type: 'string' },
480
480
  { header: i18next.t('field.sku_code'), key: 'product_sku', width: 25, type: 'string' },
481
481
  { header: i18next.t('field.product'), key: 'product_name', width: 40, type: 'string' },
482
+ { header: i18next.t('field.brand'), key: 'product_brand', width: 25, type: 'string' },
482
483
  { header: i18next.t('field.product_description'), key: 'product_description', width: 50, type: 'string' },
483
484
  { header: i18next.t('field.packing_type'), key: 'packingType', width: 20, type: 'string' },
484
485
  { header: i18next.t('field.qty'), key: 'remainQty', width: 15, type: 'string' },
@@ -173,6 +173,7 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
173
173
  get context() {
174
174
  var titleName = i18next.t('title.arrival_notice_detail')
175
175
  this._vasExpanded = false
176
+ this._showAssignWarehouse = false
176
177
  var actions = [
177
178
  {
178
179
  title: i18next.t('button.back'),
@@ -251,55 +252,46 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
251
252
  action: this._assignBufferLocation.bind(this),
252
253
  ...CommonButtonStyles.warehouse
253
254
  })
255
+ this._showAssignWarehouse = true
256
+ } else if (
257
+ this._status === ORDER_STATUS.PENDING_APPROVAL.value &&
258
+ this.productData.records.some(
259
+ product =>
260
+ product.status === ORDER_PRODUCT_STATUS.ADDED.value || product.status === ORDER_PRODUCT_STATUS.EDITED.value
261
+ )
262
+ ) {
263
+ actions.push({
264
+ title: i18next.t('button.product_changes'),
265
+ action: this.openProductChangesPopup.bind(this),
266
+ ...CommonButtonStyles.inspect
267
+ })
254
268
  }
255
- }
256
-
257
- if (this._status === ORDER_STATUS.ARRIVED.value && this.isUserBelongsDomain) {
258
- this._showAssignWarehouse = true
259
269
  } else {
260
- this._showAssignWarehouse = false
261
- }
262
-
263
- if (
264
- !this.isUserBelongsDomain &&
265
- this._status === ORDER_STATUS.PENDING_APPROVAL.value &&
266
- this.productData.records.some(
267
- product =>
268
- product.status === ORDER_PRODUCT_STATUS.ADDED.value || product.status === ORDER_PRODUCT_STATUS.EDITED.value
269
- )
270
- ) {
271
- actions.push({
272
- title: i18next.t('button.inspect_changes'),
273
- action: this.openApproveProductPopup.bind(this),
274
- ...CommonButtonStyles.approve
275
- })
276
- }
270
+ if (
271
+ this._status === ORDER_STATUS.PENDING_APPROVAL.value &&
272
+ this.productData.records.some(
273
+ product =>
274
+ product.status === ORDER_PRODUCT_STATUS.ADDED.value || product.status === ORDER_PRODUCT_STATUS.EDITED.value
275
+ )
276
+ ) {
277
+ actions.push({
278
+ title: i18next.t('button.inspect_changes'),
279
+ action: this.openApproveProductPopup.bind(this),
280
+ ...CommonButtonStyles.approve
281
+ })
282
+ }
277
283
 
278
- if (
279
- this.isUserBelongsDomain &&
280
- this._status === ORDER_STATUS.PENDING_APPROVAL.value &&
281
- this.productData.records.some(
282
- product =>
283
- product.status === ORDER_PRODUCT_STATUS.ADDED.value || product.status === ORDER_PRODUCT_STATUS.EDITED.value
284
- )
285
- ) {
286
- actions.push({
287
- title: i18next.t('button.product_changes'),
288
- action: this.openProductChangesPopup.bind(this),
289
- ...CommonButtonStyles.inspect
290
- })
284
+ if (this._status !== ORDER_STATUS.PENDING.value && this._status !== ORDER_STATUS.PENDING_APPROVAL.value) {
285
+ actions.push({
286
+ title: i18next.t('button.duplicate'),
287
+ action: () => window.open(`duplicate_arrival_notice/${this._ganNo}`),
288
+ ...CommonButtonStyles.copy
289
+ })
290
+ }
291
291
  }
292
292
 
293
- if (
294
- !this.isUserBelongsDomain &&
295
- this._status !== ORDER_STATUS.PENDING.value &&
296
- this._status !== ORDER_STATUS.PENDING_APPROVAL.value
297
- ) {
298
- actions.push({
299
- title: i18next.t('button.duplicate'),
300
- action: () => window.open(`duplicate_arrival_notice/${this._ganNo}`),
301
- ...CommonButtonStyles.copy
302
- })
293
+ if (this._status === ORDER_STATUS.REJECTED.value) {
294
+ titleName = i18next.t('title.rejected_arrival_notice_detail')
303
295
  }
304
296
 
305
297
  return {
@@ -844,6 +836,15 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
844
836
  status
845
837
  operationGuide
846
838
  }
839
+ purchaseOrder {
840
+ id
841
+ name
842
+ bufferLocation {
843
+ id
844
+ name
845
+ description
846
+ }
847
+ }
847
848
  }
848
849
  }
849
850
  `,
@@ -917,6 +918,13 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
917
918
 
918
919
  _fillupANForm(data) {
919
920
  this._fillupForm(this.arrivalNoticeForm, data)
921
+
922
+ if (data?.purchaseOrder?.bufferLocation) {
923
+ this.bufferLocationField.value = `${data.purchaseOrder.bufferLocation.name} ${
924
+ data.purchaseOrder.bufferLocation.description ? `(${data.purchaseOrder.bufferLocation.description})` : ''
925
+ }`
926
+ this.bufferLocationField.setAttribute('location-id', data.purchaseOrder.bufferLocation.id)
927
+ }
920
928
  }
921
929
 
922
930
  _fillupForm(form, data) {
@@ -234,11 +234,8 @@ class ArrivalNoticeList extends localize(i18next)(PageView) {
234
234
  handlers: {
235
235
  click: (columns, data, column, record, rowIndex) => {
236
236
  const status = record.status
237
- if (status === ORDER_STATUS.REJECTED.value) {
238
- navigate(`rejected_arrival_notice/${record.name}`) // 1. move to rejected detail page
239
- } else {
240
- navigate(`arrival_notice_detail/${record.name}`)
241
- }
237
+
238
+ navigate(`arrival_notice_detail/${record.name}`)
242
239
  }
243
240
  }
244
241
  },
@@ -420,11 +420,7 @@ class B2bOrderList extends localize(i18next)(PageView) {
420
420
  }
421
421
  `,
422
422
  variables: {
423
- filters: [
424
- ...(await this.searchForm.getQueryFilters()),
425
- { name: 'type', operator: 'eq', value: 'b2b' },
426
- { name: 'status', operator: 'notin', value: '' }
427
- ],
423
+ filters: [...(await this.searchForm.getQueryFilters()), { name: 'type', operator: 'eq', value: 'b2b' }],
428
424
  pagination: { page, limit },
429
425
  sortings: sorters
430
426
  }
@@ -8,6 +8,7 @@ import { css, html, LitElement } from 'lit-element'
8
8
  import gql from 'graphql-tag'
9
9
  import { ScrollbarStyles } from '@things-factory/styles'
10
10
  import { ORDER_STATUS, RO_TYPES } from '../../constants'
11
+ import { fetchSettingRule } from '../../../fetch-setting-value'
11
12
  import '@things-factory/biz-ui'
12
13
 
13
14
  class BatchPickingPopup extends localize(i18next)(LitElement) {
@@ -152,7 +153,6 @@ class BatchPickingPopup extends localize(i18next)(LitElement) {
152
153
  name: 'type',
153
154
  type: 'select',
154
155
  options: Object.keys(RO_TYPES).map(map => {
155
- debugger
156
156
  return { name: RO_TYPES[map].name, value: RO_TYPES[map].value }
157
157
  }),
158
158
  props: { searchOper: 'eq' }
@@ -292,7 +292,8 @@ class BatchPickingPopup extends localize(i18next)(LitElement) {
292
292
  { name: 'bizplaceId', operator: 'eq', value: this.partnerBizplace.id }
293
293
  ]
294
294
 
295
- const pagination = { page, limit }
295
+ let batchLimit = await fetchSettingRule('batch-picking-limit')
296
+ const pagination = { page, limit: batchLimit && !!parseInt(batchLimit) ? parseInt(batchLimit) : 20 }
296
297
  const sortings = sorters
297
298
 
298
299
  const response = await client.query({
@@ -340,7 +341,7 @@ class BatchPickingPopup extends localize(i18next)(LitElement) {
340
341
 
341
342
  const response = await client.query({
342
343
  query: gql`
343
- query mergedProductOrderInventories($filters: [Filter], $pagination: Pagination, $sortings: [Sorting]) {
344
+ query mergedProductOrderInventories($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
344
345
  mergedProductOrderInventories(filters: $filters, pagination: $pagination, sortings: $sortings) {
345
346
  items {
346
347
  productName
@@ -2258,7 +2258,7 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
2258
2258
  const response = await client.query({
2259
2259
  query: gql`
2260
2260
  query bulkUploadValidateWarehousePartnersProductsQuantity(
2261
- $orderInventories: [NewOrderInventory]
2261
+ $orderInventories: [NewOrderInventory!]
2262
2262
  $partnerBizplaceId: String!
2263
2263
  ) {
2264
2264
  bulkUploadValidateWarehousePartnersProductsQuantity(
@@ -120,7 +120,7 @@ export class ReleaseExtraProductPopup extends localize(i18next)(LitElement) {
120
120
  .mode="${isMobileDevice() ? 'LIST' : 'GRID'}"
121
121
  .config="${this.existingInventoryGristConfig}"
122
122
  .data="${this.existingInventoryData}"
123
- @record-change="${this._onProductChangeHandler.bind(this)}"
123
+ @record-change="${this._onProductChangeHandler.bind(this, 'existing')}"
124
124
  @field-change="${this._onExistingInventoryFieldChanged.bind(this)}"
125
125
  ></data-grist>
126
126
  </div>
@@ -136,7 +136,7 @@ export class ReleaseExtraProductPopup extends localize(i18next)(LitElement) {
136
136
  .mode="${isMobileDevice() ? 'LIST' : 'GRID'}"
137
137
  .config="${this.inventoryGristConfig}"
138
138
  .data="${this.inventoryData}"
139
- @record-change="${this._onProductChangeHandler.bind(this)}"
139
+ @record-change="${this._onProductChangeHandler.bind(this, 'new')}"
140
140
  @field-change="${this._onInventoryFieldChanged.bind(this)}"
141
141
  ></data-grist>
142
142
  </div>
@@ -700,15 +700,20 @@ export class ReleaseExtraProductPopup extends localize(i18next)(LitElement) {
700
700
  }
701
701
  }
702
702
 
703
- _onProductChangeHandler(event) {
703
+ _onProductChangeHandler(gristType, event) {
704
704
  const changeRecord = event.detail.after
705
705
  const beforeRecord = event.detail.before
706
706
  const changedColumn = event.detail.column.name
707
707
  var totalAvailableQty = 0
708
708
  var totalAvailableUomValue = 0
709
709
 
710
- totalAvailableQty = beforeRecord.addableQty + beforeRecord.releaseQty
711
- totalAvailableUomValue = beforeRecord.addableUomValue + beforeRecord.releaseUomValue
710
+ if (gristType == 'existing') {
711
+ totalAvailableQty = beforeRecord.addableQty + beforeRecord.releaseQty
712
+ totalAvailableUomValue = beforeRecord.addableUomValue + beforeRecord.releaseUomValue
713
+ } else {
714
+ totalAvailableQty = changeRecord.remainQty
715
+ totalAvailableUomValue = changeRecord.remainUomValue
716
+ }
712
717
 
713
718
  try {
714
719
  if (changedColumn === 'releaseQty') {