@things-factory/operato-wms 4.3.583 → 4.3.586

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.
@@ -411,15 +411,14 @@ class ValidateGanPopup extends localize(i18next)(LitElement) {
411
411
  throw new Error(i18next.t('text.please_recheck_your_request_data'))
412
412
  }
413
413
  if (this._enableLotIdInput == false) {
414
- let batchIds = this.records
415
- .map(item => item.batchId)
416
- .filter(batchId => batchId !== null)
417
- .map(batchId => batchId.toLowerCase())
418
-
419
- let uniqueBatchIds = new Set(batchIds)
420
- if (uniqueBatchIds.size !== batchIds.length) {
421
- throw new Error(i18next.t('text.duplicated_batch_id'))
422
- }
414
+ let batchSkuPairs = this.records
415
+ .filter(item => item.batchId !== null && item.sku !== null) // Filter out items with null batchId or sku
416
+ .map(item => `${item.batchId.toLowerCase()}-${item.sku.toLowerCase()}`) // Create a combined key of batchId and sku
417
+
418
+ let uniqueBatchSkuPairs = new Set(batchSkuPairs)
419
+ if (uniqueBatchSkuPairs.size !== batchSkuPairs.length) {
420
+ throw new Error(i18next.t('text.duplicated_batch_id_and_sku'))
421
+ }
423
422
  } else {
424
423
  let palletIds = this.records
425
424
  .map(item => item.palletId)
@@ -4,20 +4,38 @@ import '@things-factory/warehouse-ui'
4
4
  import '@things-factory/import-ui'
5
5
 
6
6
  import gql from 'graphql-tag'
7
- import { css, html } from 'lit-element'
7
+ import {
8
+ css,
9
+ html
10
+ } from 'lit-element'
8
11
  import isEmpty from 'lodash-es/isEmpty'
9
12
  import { connect } from 'pwa-helpers/connect-mixin'
10
13
 
11
14
  import { getCodeByName } from '@things-factory/code-base'
12
15
  import { MultiColumnFormStyles } from '@things-factory/form-ui'
13
- import { i18next, localize } from '@things-factory/i18n-base'
16
+ import {
17
+ i18next,
18
+ localize
19
+ } from '@things-factory/i18n-base'
14
20
  import { openPopup } from '@things-factory/layout-base'
15
21
  import { fetchSettingRule } from '@things-factory/setting-ui'
16
- import { client, CustomAlert, navigate, PageView, store } from '@things-factory/shell'
22
+ import {
23
+ client,
24
+ CustomAlert,
25
+ navigate,
26
+ PageView,
27
+ store
28
+ } from '@things-factory/shell'
17
29
  import { CommonButtonStyles } from '@things-factory/styles'
18
- import { flattenObject, isMobileDevice } from '@things-factory/utils'
30
+ import {
31
+ flattenObject,
32
+ isMobileDevice
33
+ } from '@things-factory/utils'
19
34
 
20
- import { DRAFT_RELEASE_ORDER_STATUS, PRODUCT_GROUP_TYPES } from '../../../constants'
35
+ import {
36
+ DRAFT_RELEASE_ORDER_STATUS,
37
+ PRODUCT_GROUP_TYPES
38
+ } from '../../../constants'
21
39
 
22
40
  class DraftReleaseGoodDetail extends connect(store)(localize(i18next)(PageView)) {
23
41
  static get properties() {
@@ -595,10 +613,7 @@ class DraftReleaseGoodDetail extends connect(store)(localize(i18next)(PageView))
595
613
  options: {
596
614
  queryName: 'allBizplaceProductInventory',
597
615
  basicArgs: {
598
- filters: [
599
- { name: 'bizplace_id', operator: 'eq', value: this._bizplaceId },
600
- { name: 'deleted_at', operator: 'eq', value: true }
601
- ]
616
+ filters: [{ name: 'bizplace_id', operator: 'eq', value: this._bizplaceId }]
602
617
  },
603
618
  nameField: 'productSKU',
604
619
  descriptionField: 'productName',
@@ -444,13 +444,10 @@ class DraftReleaseGoodList extends localize(i18next)(PageView) {
444
444
  let orderIds = []
445
445
  let selectedGristData = this.dataGrist.selected
446
446
 
447
- if (
448
- selectedGristData.filter(itm => itm.status == DRAFT_RELEASE_ORDER_STATUS.DRAFT).length <= 0 &&
449
- selectedGristData.filter(itm => itm.status == DRAFT_RELEASE_ORDER_STATUS.INSUFFICIENT).length <= 0
450
- )
447
+ if (selectedGristData.filter(itm => itm.status == DRAFT_RELEASE_ORDER_STATUS.DRAFT).length <= 0)
451
448
  throw new Error(i18next.t('text.please_select_a_valid_draft_order_to_generate_release_order'))
452
449
 
453
- let selectedOrders = selectedGristData
450
+ let selectedOrders = selectedGristData.filter(itm => itm.status === DRAFT_RELEASE_ORDER_STATUS.DRAFT)
454
451
  orderIds = selectedOrders.map(record => ({ id: record.id, releaseType: 'release' }))
455
452
 
456
453
  let result = await CustomAlert({
@@ -474,9 +471,6 @@ class DraftReleaseGoodList extends localize(i18next)(PageView) {
474
471
  mutation generateReleaseGoodsfromDraft($releaseInfo: [DraftReleaseGoodInfos!]!) {
475
472
  generateReleaseGoodsfromDraft(releaseInfo: $releaseInfo) {
476
473
  draftName
477
- successCount
478
- insufficientCount
479
- deletedCount
480
474
  }
481
475
  }
482
476
  `,
@@ -486,40 +480,17 @@ class DraftReleaseGoodList extends localize(i18next)(PageView) {
486
480
  })
487
481
 
488
482
  if (!response.errors) {
489
- let successCount = response.data.generateReleaseGoodsfromDraft[0].successCount
490
- let insufficientCount = response.data.generateReleaseGoodsfromDraft[0].insufficientCount
491
- let deletedCount = response.data.generateReleaseGoodsfromDraft[0].deletedCount
492
-
493
- if (insufficientCount > 0 && deletedCount == 0) {
494
- CustomAlert({
495
- title: i18next.t('title.completed'),
496
- text: 'Notice: ' + insufficientCount + ' ' + i18next.t('text.draft_order_insufficient'),
497
- confirmButton: { text: i18next.t('button.confirm') }
498
- })
499
- } else if (deletedCount > 0 && insufficientCount == 0) {
500
- CustomAlert({
483
+ if (response.data.generateReleaseGoodsfromDraft.length < 1) {
484
+ await CustomAlert({
501
485
  title: i18next.t('title.completed'),
502
- text: 'Notice: ' + deletedCount + ' ' + i18next.t('text.draft_order_deleted_detail'),
503
- confirmButton: { text: i18next.t('button.confirm') }
504
- })
505
- } else if (deletedCount > 0 && insufficientCount > 0) {
506
- CustomAlert({
507
- title: i18next.t('title.completed'),
508
- text:
509
- 'Notice: ' +
510
- insufficientCount +
511
- ' ' +
512
- i18next.t('text.draft_order_insufficient') +
513
- ', ' +
514
- deletedCount +
515
- ' ' +
516
- i18next.t('text.draft_order_deleted_detail'),
486
+ text: i18next.t('text.release_order(s)_has_been_generated'),
517
487
  confirmButton: { text: i18next.t('button.confirm') }
518
488
  })
519
489
  } else {
490
+ // this.dataGrist.fetch()
520
491
  CustomAlert({
521
- title: i18next.t('title.completed'),
522
- text: successCount + ' ' + i18next.t('text.draft_order_success'),
492
+ title: i18next.t('title.error'),
493
+ text: i18next.t('text.unable_to_release_specific_draft_order(s)_due_to_insufficient_quantity'),
523
494
  confirmButton: { text: i18next.t('button.confirm') }
524
495
  })
525
496
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/operato-wms",
3
- "version": "4.3.583",
3
+ "version": "4.3.586",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -91,7 +91,7 @@
91
91
  "@things-factory/print-ui": "^4.3.535",
92
92
  "@things-factory/product-base": "^4.3.582",
93
93
  "@things-factory/resource-ui": "^4.3.582",
94
- "@things-factory/sales-ui": "^4.3.583",
94
+ "@things-factory/sales-ui": "^4.3.584",
95
95
  "@things-factory/scene-data-transform": "^4.3.534",
96
96
  "@things-factory/scene-excel": "^4.3.534",
97
97
  "@things-factory/scene-firebase": "^4.3.534",
@@ -108,7 +108,7 @@
108
108
  "@things-factory/transport-base": "^4.3.582",
109
109
  "@things-factory/tutorial-ui": "^4.3.582",
110
110
  "@things-factory/warehouse-base": "^4.3.582",
111
- "@things-factory/worksheet-base": "^4.3.583"
111
+ "@things-factory/worksheet-base": "^4.3.584"
112
112
  },
113
113
  "devDependencies": {
114
114
  "@things-factory/builder": "^4.3.534",
@@ -117,5 +117,5 @@
117
117
  "cypress-localstorage-commands": "^1.6.1",
118
118
  "eslint-plugin-cypress": "^2.12.1"
119
119
  },
120
- "gitHead": "1deef6368e91eb3e4db1b91da707e7d6a9631f1a"
120
+ "gitHead": "a11cd447614c768f5eb677bbdc8e0a4fc1e2af03"
121
121
  }
@@ -1426,9 +1426,6 @@
1426
1426
  "text.document_has_been_generated": "document has been generated",
1427
1427
  "text.does_not_support_multi_package": "Does not support multi-package",
1428
1428
  "text.draft_order_form_invalid": "draft order form invalid",
1429
- "text.draft_order_success": "Draft order successfully converted to RO",
1430
- "text.draft_order_insufficient": "Draft order failed: Insufficient quantity",
1431
- "text.draft_order_deleted_detail": "Draft order failed: Missing Product Details",
1432
1429
  "text.draft_purchase_order": "draft purchase order",
1433
1430
  "text.driver_and_vehicle_is_not_selected": "driver and vehicle is not selected",
1434
1431
  "text.driver_is_empty": "driver name is empty",