@things-factory/operato-wms 4.3.363 → 4.3.365

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.
@@ -5,13 +5,24 @@ import './transport-driver-popup'
5
5
  import '../../outbound/transport-vehicles-popup'
6
6
 
7
7
  import gql from 'graphql-tag'
8
- import { css, html } from 'lit-element'
8
+ import {
9
+ css,
10
+ html
11
+ } from 'lit-element'
9
12
 
10
13
  import { getCodeByName } from '@things-factory/code-base'
11
14
  import { MultiColumnFormStyles } from '@things-factory/form-ui'
12
- import { i18next, localize } from '@things-factory/i18n-base'
15
+ import {
16
+ i18next,
17
+ localize
18
+ } from '@things-factory/i18n-base'
13
19
  import { openPopup } from '@things-factory/layout-base'
14
- import { client, CustomAlert, navigate, PageView } from '@things-factory/shell'
20
+ import {
21
+ client,
22
+ CustomAlert,
23
+ navigate,
24
+ PageView
25
+ } from '@things-factory/shell'
15
26
  import { CommonButtonStyles } from '@things-factory/styles'
16
27
  import { isMobileDevice } from '@things-factory/utils'
17
28
 
@@ -452,12 +463,12 @@ class CreateDeliveryOrder extends localize(i18next)(PageView) {
452
463
  },
453
464
  {
454
465
  type: 'object',
455
- name: 'product',
466
+ name: 'productDetails',
456
467
  header: i18next.t('field.product'),
457
468
  record: {
458
469
  editable: true,
459
470
  options: {
460
- queryName: 'products',
471
+ queryName: 'productDetails',
461
472
  basicArgs: { filters: [{ name: 'bizplace_id', operator: 'eq', value: this._bizplaceId }] },
462
473
  nameField: 'name',
463
474
  descriptionField: 'description',
@@ -467,8 +478,9 @@ class CreateDeliveryOrder extends localize(i18next)(PageView) {
467
478
  { name: 'name', header: i18next.t('field.name') },
468
479
  { name: 'description', header: i18next.t('field.description') },
469
480
  { name: 'packingType', header: i18next.t('field.packing_type') },
470
- { name: 'primaryUnit', header: i18next.t('field.uom') },
471
- { name: 'primaryValue', header: i18next.t('field.uom_value') }
481
+ { name: 'uom', header: i18next.t('field.uom') },
482
+ { name: 'uomValue', header: i18next.t('field.uom_value') },
483
+ { name: 'productId', hidden: true }
472
484
  ],
473
485
  list: { fields: ['sku', 'name', 'description', 'packingType'] }
474
486
  }
@@ -491,7 +503,7 @@ class CreateDeliveryOrder extends localize(i18next)(PageView) {
491
503
  header: i18next.t('field.uom'),
492
504
  record: {
493
505
  editable: true,
494
- rowOptionField: 'rowOptionPrimaryUnit'
506
+ rowOptionField: 'rowOptionUom'
495
507
  },
496
508
  width: 80
497
509
  },
@@ -531,23 +543,23 @@ class CreateDeliveryOrder extends localize(i18next)(PageView) {
531
543
  try {
532
544
  this._checkProductDuplication()
533
545
  let changeRecord = event.detail.after
534
- changeRecord['packingType'] = changeRecord.product?.packingType || ''
546
+ changeRecord['packingType'] = changeRecord.productDetails?.packingType || ''
535
547
  const changedColumn = event.detail.column.name
536
548
 
537
- if (event.detail.column.name == 'product') {
538
- let primaryValue = !!changeRecord.product?.primaryValue
539
- changeRecord.uomValue = primaryValue ? changeRecord.product.primaryValue : null
540
- let primaryUnit = !!changeRecord.product?.primaryUnit
541
- changeRecord.uom = primaryUnit ? changeRecord.product.primaryUnit : ''
542
- let packingType = !!changeRecord.product?.packingType
543
- changeRecord.packingType = packingType ? changeRecord.product.packingType : ''
544
- ;(changeRecord.rowOptionPrimaryUnit = {
549
+ if (event.detail.column.name == 'productDetails') {
550
+ let uomValue = !!changeRecord.productDetails?.uomValue
551
+ changeRecord.uomValue = uomValue ? changeRecord.productDetails.uomValue : null
552
+ let uom = !!changeRecord.productDetails?.uom
553
+ changeRecord.uom = uom ? changeRecord.productDetails.uom : ''
554
+ let packingType = !!changeRecord.productDetails?.packingType
555
+ changeRecord.packingType = packingType ? changeRecord.productDetails.packingType : ''
556
+ ;(changeRecord.rowOptionUom = {
545
557
  options: [
546
- ...(primaryUnit
558
+ ...(uom
547
559
  ? [
548
560
  {
549
- display: changeRecord.product.primaryUnit,
550
- value: changeRecord.product.primaryUnit
561
+ display: changeRecord.productDetails.uom,
562
+ value: changeRecord.productDetails.uom
551
563
  }
552
564
  ]
553
565
  : [
@@ -566,8 +578,8 @@ class CreateDeliveryOrder extends localize(i18next)(PageView) {
566
578
  ...(packingType
567
579
  ? [
568
580
  {
569
- display: changeRecord.product.packingType,
570
- value: changeRecord.product.packingType
581
+ display: changeRecord.productDetails.packingType,
582
+ value: changeRecord.productDetails.packingType
571
583
  }
572
584
  ]
573
585
  : [
@@ -689,8 +701,8 @@ class CreateDeliveryOrder extends localize(i18next)(PageView) {
689
701
  // batchId, product.id, packingType
690
702
  let isDuplicated = false
691
703
  const completedRows = this.productGrist.dirtyData.records
692
- .filter(record => record.batchId && record.product && record.product.id && record.packingType)
693
- .map(record => `${record.batchId}-${record.product.id}-${record.packingType}`)
704
+ .filter(record => record.batchId && record.productDetails && record.productDetails.id && record.packingType)
705
+ .map(record => `${record.batchId}-${record.productDetails.id}-${record.packingType}`)
694
706
 
695
707
  completedRows.forEach((row, idx, rows) => {
696
708
  if (rows.lastIndexOf(row) !== idx) {
@@ -932,7 +944,11 @@ class CreateDeliveryOrder extends localize(i18next)(PageView) {
932
944
  return this.productGrist.dirtyData.records.map(record => {
933
945
  let orderInventory = {
934
946
  batchId: record.batchId,
935
- product: { id: record.product.id },
947
+ product: { id: record.productDetails?.productId },
948
+ productDetail: {
949
+ id: record.productDetails?.id,
950
+ sku: record.sku
951
+ },
936
952
  packingType: record.packingType,
937
953
  releaseUomValue: record?.uomValue ? record?.uomValue : 0,
938
954
  uom: record.uom,
@@ -1002,7 +1018,7 @@ class CreateDeliveryOrder extends localize(i18next)(PageView) {
1002
1018
  if (this.productGrist.dirtyData.records.some(record => !record.batchId))
1003
1019
  throw new Error(i18next.t('text.invalid_batch_no'))
1004
1020
 
1005
- if (this.productGrist.dirtyData.records.some(record => !record.product || !record.product.id))
1021
+ if (this.productGrist.dirtyData.records.some(record => !record.productDetails || !record.productDetails.id))
1006
1022
  throw new Error(i18next.t('text.invalid_product'))
1007
1023
 
1008
1024
  if (this.productGrist.dirtyData.records.some(record => !record.packingType))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/operato-wms",
3
- "version": "4.3.363",
3
+ "version": "4.3.365",
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.281",
92
92
  "@things-factory/product-base": "^4.3.357",
93
93
  "@things-factory/resource-ui": "^4.3.281",
94
- "@things-factory/sales-ui": "^4.3.363",
94
+ "@things-factory/sales-ui": "^4.3.364",
95
95
  "@things-factory/scene-data-transform": "^4.3.281",
96
96
  "@things-factory/scene-excel": "^4.3.281",
97
97
  "@things-factory/scene-firebase": "^4.3.281",
@@ -108,7 +108,7 @@
108
108
  "@things-factory/transport-base": "^4.3.344",
109
109
  "@things-factory/tutorial-ui": "^4.3.281",
110
110
  "@things-factory/warehouse-base": "^4.3.363",
111
- "@things-factory/worksheet-base": "^4.3.363"
111
+ "@things-factory/worksheet-base": "^4.3.365"
112
112
  },
113
113
  "devDependencies": {
114
114
  "@things-factory/builder": "^4.3.281",
@@ -117,5 +117,5 @@
117
117
  "cypress-localstorage-commands": "^1.6.1",
118
118
  "eslint-plugin-cypress": "^2.12.1"
119
119
  },
120
- "gitHead": "e857b2bf1329b34e2610a9891fdebf64a9f19353"
120
+ "gitHead": "79682e4ddbc2f4da1131a0c657db9e031b466f81"
121
121
  }