@things-factory/operato-wms 4.3.384 → 4.3.386

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.
@@ -141,7 +141,10 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
141
141
  _showVasSummary: Boolean,
142
142
 
143
143
  // Type
144
- _selectBy: String
144
+ _selectBy: String,
145
+
146
+ // Settings
147
+ _strictProductSelection: Boolean
145
148
  }
146
149
  }
147
150
 
@@ -1075,6 +1078,8 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
1075
1078
  getCodeByName('PACKING_TYPES')
1076
1079
  ])
1077
1080
 
1081
+ this._strictProductSelection = await fetchSettingRule('strict-product-selection')
1082
+
1078
1083
  this.containerSizes = await getCodeByName('CONTAINER_SIZES')
1079
1084
 
1080
1085
  this.quickFindContent.currentTabKey = i18next.t('label.order')
@@ -2051,7 +2056,7 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
2051
2056
  // changeRecord.vasQty = changeRecord.qty
2052
2057
  changeRecord.outputQty = initialRecord.outputQty ? initialRecord.outputQty : null
2053
2058
  //
2054
- } else if (changedColumn === 'outputQty') {
2059
+ } else if (changedColumn === 'outputQty' && !this._strictProductSelection) {
2055
2060
  if (changeRecord.outputQty <= 0 || isNaN(changeRecord.outputQty)) {
2056
2061
  throw new Error(i18next.t('text.invalid_quantity_input'))
2057
2062
  } else if (initialRecord.outputQty == null) {
@@ -12,14 +12,26 @@ import '../../order/vas-order/popup/vas-target-product-popup'
12
12
  import '../../order/vas-order/popup/select-vas-popup'
13
13
 
14
14
  import gql from 'graphql-tag'
15
- import { css, html } from 'lit-element'
15
+ import {
16
+ css,
17
+ html
18
+ } from 'lit-element'
16
19
  import { connect } from 'pwa-helpers/connect-mixin'
17
20
 
18
21
  import { getCodeByName } from '@things-factory/code-base'
19
22
  import { MultiColumnFormStyles } from '@things-factory/form-ui'
20
- import { i18next, localize } from '@things-factory/i18n-base'
23
+ import {
24
+ i18next,
25
+ localize
26
+ } from '@things-factory/i18n-base'
21
27
  import { openPopup } from '@things-factory/layout-base'
22
- import { client, CustomAlert, navigate, PageView, store } from '@things-factory/shell'
28
+ import {
29
+ client,
30
+ CustomAlert,
31
+ navigate,
32
+ PageView,
33
+ store
34
+ } from '@things-factory/shell'
23
35
  import { CommonButtonStyles } from '@things-factory/styles'
24
36
  import { isMobileDevice } from '@things-factory/utils'
25
37
 
@@ -110,7 +122,10 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
110
122
  // Vas //
111
123
  vasGristConfig: Object,
112
124
  vasData: Object,
113
- deletedVas: Array
125
+ deletedVas: Array,
126
+
127
+ // Settings//
128
+ _strictProductSelection: Boolean
114
129
  }
115
130
  }
116
131
 
@@ -1065,6 +1080,8 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
1065
1080
  await this.fetchCountry()
1066
1081
  this.containerSizes = await getCodeByName('CONTAINER_SIZES')
1067
1082
 
1083
+ this._strictProductSelection = await fetchSettingRule('strict-product-selection')
1084
+
1068
1085
  this.isUserBelongsDomain = await this._checkUserBelongsDomain()
1069
1086
  let [allowROAddProductSetting, userRoles] = [fetchSettingRule('allow-ro-add-product'), this.fetchUserRoleHandler()]
1070
1087
  let [enableTransportationServiceSetting] = await Promise.all([fetchSettingRule('enable-transportation-service')])
@@ -2140,7 +2157,7 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
2140
2157
  .targetList="${targetList}"
2141
2158
  .vasList="${this.vasData.records}"
2142
2159
  .record="${record}"
2143
- .productSKU= "${record.productSKU}"
2160
+ .productSKU="${record.productSKU}"
2144
2161
  @selected="${selected => {
2145
2162
  let group = this.vasGrist.data.records[this.vasGrist.data.records.length - 1]?.group
2146
2163
  ? this.vasGrist.data.records[this.vasGrist.data.records.length - 1]?.group
@@ -2607,7 +2624,7 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
2607
2624
  : null
2608
2625
  changeRecord.outputQty = initialRecord.outputQty ? initialRecord.outputQty : null
2609
2626
  //
2610
- } else if (changedColumn === 'outputQty') {
2627
+ } else if (changedColumn === 'outputQty' && !this._strictProductSelection) {
2611
2628
  if (changeRecord.outputQty <= 0 || isNaN(changeRecord.outputQty)) {
2612
2629
  throw new Error(i18next.t('text.invalid_quantity_input'))
2613
2630
  } else if (initialRecord.outputQty == null) {
@@ -2692,9 +2709,9 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
2692
2709
  shippingOrderInfo.billingCountry = contactPointInfo.country
2693
2710
  }
2694
2711
 
2695
- let releaseOrderChanged = this._compareObjects(releaseOrder, oldResorder);
2696
- let shippingOrderChanged = this._compareObjects(shippingOrderInfo, oldResorder);
2697
- let exportDataChanged = this._compareExportObjects(exportData, oldResorder);
2712
+ let releaseOrderChanged = this._compareObjects(releaseOrder, oldResorder)
2713
+ let shippingOrderChanged = this._compareObjects(shippingOrderInfo, oldResorder)
2714
+ let exportDataChanged = this._compareExportObjects(exportData, oldResorder)
2698
2715
 
2699
2716
  if (releaseOrderChanged == true || shippingOrderChanged == true || exportDataChanged == true) {
2700
2717
  releaseOrderChanged = true
@@ -2772,8 +2789,8 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
2772
2789
  }
2773
2790
 
2774
2791
  _compareObjects(object1, object2) {
2775
- let formChanged = false;
2776
-
2792
+ let formChanged = false
2793
+
2777
2794
  for (const key in object1) {
2778
2795
  if (object1?.orderPackages?.length > 0) {
2779
2796
  if (key == 'trackingNo' && object1[key] !== object2.orderPackages[0].trackingNo) {
@@ -2792,24 +2809,19 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
2792
2809
  }
2793
2810
  }
2794
2811
  } else if (object1.hasOwnProperty(key) && object1[key] !== object2[key]) {
2795
- if (
2796
- !(
2797
- (object1[key] == '' || object1[key] == null) &&
2798
- (object2[key] == '' || object2[key] == null)
2799
- )
2800
- ) {
2812
+ if (!((object1[key] == '' || object1[key] == null) && (object2[key] == '' || object2[key] == null))) {
2801
2813
  formChanged = true
2802
2814
  break
2803
2815
  }
2804
2816
  }
2805
2817
  }
2806
-
2818
+
2807
2819
  return formChanged
2808
2820
  }
2809
2821
 
2810
2822
  _compareExportObjects(object1, object2) {
2811
- let formChanged = false;
2812
-
2823
+ let formChanged = false
2824
+
2813
2825
  for (const key in object1) {
2814
2826
  if (object1.hasOwnProperty(key) && object1[key] !== object2.shippingOrderInfo[key]) {
2815
2827
  if (
@@ -2823,7 +2835,7 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
2823
2835
  }
2824
2836
  }
2825
2837
  }
2826
-
2838
+
2827
2839
  return formChanged
2828
2840
  }
2829
2841
 
@@ -3,10 +3,20 @@ import '@things-factory/grist-ui'
3
3
  import '../components/popup-note'
4
4
 
5
5
  import gql from 'graphql-tag'
6
- import { css, html, LitElement } from 'lit-element'
6
+ import {
7
+ css,
8
+ html,
9
+ LitElement
10
+ } from 'lit-element'
7
11
 
8
- import { MultiColumnFormStyles, SingleColumnFormStyles } from '@things-factory/form-ui'
9
- import { i18next, localize } from '@things-factory/i18n-base'
12
+ import {
13
+ MultiColumnFormStyles,
14
+ SingleColumnFormStyles
15
+ } from '@things-factory/form-ui'
16
+ import {
17
+ i18next,
18
+ localize
19
+ } from '@things-factory/i18n-base'
10
20
  import { client } from '@things-factory/shell'
11
21
  import { isMobileDevice } from '@things-factory/utils'
12
22
 
@@ -347,7 +357,7 @@ export class VasListPopup extends localize(i18next)(LitElement) {
347
357
  ...record,
348
358
  sku: record?.product?.sku,
349
359
  outputQty: record?.outputQty,
350
- newSku: record?.newProduct?.sku,
360
+ newSKU: record?.newProduct?.sku,
351
361
  qty: record?.qty,
352
362
  vas: record?.orderVasItems?.vas,
353
363
  vasQty: record?.orderVasItems?.vasQty,
@@ -3,39 +3,28 @@ import '@things-factory/grist-ui'
3
3
  import '../inventory/inventory-by-product-detail'
4
4
 
5
5
  import gql from 'graphql-tag'
6
- import {
7
- css,
8
- html
9
- } from 'lit-element'
6
+ import { css, html } from 'lit-element'
10
7
  import { connect } from 'pwa-helpers/connect-mixin'
11
8
 
12
- import {
13
- i18next,
14
- localize
15
- } from '@things-factory/i18n-base'
16
- import {
17
- client,
18
- gqlContext,
19
- PageView,
20
- store
21
- } from '@things-factory/shell'
9
+ import { i18next, localize } from '@things-factory/i18n-base'
10
+ import { client, gqlContext, PageView, store } from '@things-factory/shell'
22
11
  // import { ScrollbarStyles } from '@things-factory/styles'
23
12
  import { isMobileDevice } from '@things-factory/utils'
24
13
 
25
14
  import { showToast } from '../../util'
26
15
 
27
- class shortageReport extends connect(store)(localize(i18next)(PageView)){
28
- static get styles(){
16
+ class shortageReport extends connect(store)(localize(i18next)(PageView)) {
17
+ static get styles() {
29
18
  return [
30
19
  // ScrollbarStyles,
31
20
  css`
32
21
  :host {
33
- display:flex;
22
+ display: flex;
34
23
  flex-direction: column;
35
- width: 100%
24
+ width: 100%;
36
25
  }
37
-
38
- data-grist{
26
+
27
+ data-grist {
39
28
  overflow-y: auto;
40
29
  flex: 1;
41
30
  }
@@ -58,12 +47,12 @@ class shortageReport extends connect(store)(localize(i18next)(PageView)){
58
47
  }
59
48
 
60
49
  static get properties() {
61
- return{
50
+ return {
62
51
  _searchFields: Array,
63
52
  _config: Object,
64
- _gristData:Object,
65
- _partners:Object,
66
- items: Object,
53
+ _gristData: Object,
54
+ _partners: Object,
55
+ items: Object
67
56
  // importHandler: Object
68
57
  }
69
58
  }
@@ -82,7 +71,7 @@ class shortageReport extends connect(store)(localize(i18next)(PageView)){
82
71
  get dataGrist() {
83
72
  return this.shadowRoot.querySelector('data-grist')
84
73
  }
85
-
74
+
86
75
  get searchForm() {
87
76
  return this.shadowRoot.querySelector('search-form')
88
77
  }
@@ -99,32 +88,32 @@ class shortageReport extends connect(store)(localize(i18next)(PageView)){
99
88
  return this.searchForm.shadowRoot.querySelector('input[name=toDate]')
100
89
  }
101
90
 
102
- render () {
91
+ render() {
103
92
  return html`
104
93
  <search-form
105
94
  id="search-form"
106
95
  .fields=${this._searchFields}
107
96
  initFocus="description"
108
- @submit=${e => this.dataGrist.fetch()}
109
- ></search-form>
110
-
111
- <data-grist
112
- .mode=${isMobileDevice() ? 'LIST' : 'GRID'}
113
- .config=${this._config}
114
- .fetchHandler="${this.fetchHandler.bind(this)}"
115
- ></data-grist>
116
- `
117
- }
97
+ @submit=${e => this.dataGrist.fetch()}
98
+ ></search-form>
99
+
100
+ <data-grist
101
+ .mode=${isMobileDevice() ? 'LIST' : 'GRID'}
102
+ .config=${this._config}
103
+ .fetchHandler="${this.fetchHandler.bind(this)}"
104
+ ></data-grist>
105
+ `
106
+ }
118
107
 
119
- get searchFields() {
120
- return [
121
- {
122
- label: i18next.t('Company'),
123
- name:'bizplace',
124
- type:'select',
125
- options: [
126
- { value: ''},
127
- ...this._partners
108
+ get searchFields() {
109
+ return [
110
+ {
111
+ label: i18next.t('Company'),
112
+ name: 'bizplace',
113
+ type: 'select',
114
+ options: [
115
+ { value: '' },
116
+ ...this._partners
128
117
  .map(partner => {
129
118
  return {
130
119
  name: `${partner.name} ${partner.description ? `(${partner.description})` : ''}`,
@@ -133,55 +122,54 @@ class shortageReport extends connect(store)(localize(i18next)(PageView)){
133
122
  })
134
123
  .sort(this._compareValues('name', 'asc'))
135
124
  ],
136
- props: {searchOper: 'eq'}
125
+ props: { searchOper: 'eq' }
126
+ },
127
+ {
128
+ label: i18next.t('field.from_date'),
129
+ name: 'fromDate',
130
+ type: 'date',
131
+ props: {
132
+ searchOper: 'eq',
133
+ max: new Date().toISOString().split('T')[0]
137
134
  },
138
- {
139
- label: i18next.t('field.from_date'),
140
- name: 'fromDate',
141
- type: 'date',
142
- props: {
143
- searchOper: 'eq',
144
- max: new Date().toISOString().split('T')[0]
145
- },
146
- value: (() => {
135
+ value: (() => {
136
+ let date = new Date()
137
+ date.setMonth(date.getMonth() - 1)
138
+ return date.toISOString().split('T')[0]
139
+ })(),
140
+ handlers: { change: this._modifyDateRange.bind(this) }
141
+ },
142
+ {
143
+ label: i18next.t('field.to_date'),
144
+ name: 'toDate',
145
+ type: 'date',
146
+ props: {
147
+ searchOper: 'eq',
148
+ min: (() => {
147
149
  let date = new Date()
148
150
  date.setMonth(date.getMonth() - 1)
149
151
  return date.toISOString().split('T')[0]
150
152
  })(),
151
- handlers: { change: this._modifyDateRange.bind(this) }
152
- },
153
- {
154
- label: i18next.t('field.to_date'),
155
- name: 'toDate',
156
- type: 'date',
157
- props: {
158
- searchOper: 'eq',
159
- min: (() => {
160
- let date = new Date()
161
- date.setMonth(date.getMonth() - 1)
162
- return date.toISOString().split('T')[0]
163
- })(),
164
- max: new Date().toISOString().split('T')[0]
165
- },
166
- value: new Date().toISOString().split('T')[0],
167
- handlers: { change: this._submit.bind(this) }
168
- },
169
- {
170
- label: i18next.t('field.product_info'),
171
- name: 'product',
172
- type: 'string',
173
- props: { searchOper: 'in' }
153
+ max: new Date().toISOString().split('T')[0]
174
154
  },
175
- {
176
- label: i18next.t('field.order_no'),
177
- name: 'orderNo',
178
- type: 'text',
179
- props: { searchOper: 'custom' }
180
- }
181
- ]
182
- }
155
+ value: new Date().toISOString().split('T')[0],
156
+ handlers: { change: this._submit.bind(this) }
157
+ },
158
+ {
159
+ label: i18next.t('field.product_info'),
160
+ name: 'product',
161
+ type: 'string',
162
+ props: { searchOper: 'in' }
163
+ },
164
+ {
165
+ label: i18next.t('field.order_no'),
166
+ name: 'orderNo',
167
+ type: 'text',
168
+ props: { searchOper: 'custom' }
169
+ }
170
+ ]
171
+ }
183
172
 
184
-
185
173
  get reportConfig() {
186
174
  // let rows = {
187
175
  // selectable: false,
@@ -272,7 +260,7 @@ class shortageReport extends connect(store)(localize(i18next)(PageView)){
272
260
  }
273
261
  }
274
262
 
275
- async pageInitialized(){
263
+ async pageInitialized() {
276
264
  this._gristData = { total: 0, records: [] }
277
265
  this._products = []
278
266
 
@@ -282,7 +270,6 @@ class shortageReport extends connect(store)(localize(i18next)(PageView)){
282
270
 
283
271
  this._searchFields = this.searchFields
284
272
  this._config = this.reportConfig
285
-
286
273
  }
287
274
 
288
275
  pageUpdated(changes, lifecycle) {
@@ -291,7 +278,7 @@ class shortageReport extends connect(store)(localize(i18next)(PageView)){
291
278
  }
292
279
  }
293
280
 
294
- async fetchHandler({page, limit, sorters = []}) {
281
+ async fetchHandler({ page, limit, sorters = [] }) {
295
282
  try {
296
283
  this._validate()
297
284
  let filters = this.searchForm.queryFilters.map(filter => {
@@ -314,12 +301,12 @@ class shortageReport extends connect(store)(localize(i18next)(PageView)){
314
301
 
315
302
  const pagination = { page, limit }
316
303
  const sortings = sorters
317
-
318
- const response = await client.query({
319
- query:gql`
304
+
305
+ const response = await client.query({
306
+ query: gql`
320
307
  query shortageReport($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
321
308
  shortageReport(filters: $filters, pagination: $pagination, sortings: $sortings) {
322
- items {
309
+ items {
323
310
  bizplaceName
324
311
  orderNo
325
312
  refNo
@@ -338,11 +325,11 @@ class shortageReport extends connect(store)(localize(i18next)(PageView)){
338
325
  }
339
326
  }
340
327
  `,
341
- variables: { filters,pagination,sortings},
342
- context:gqlContext()
328
+ variables: { filters, pagination, sortings },
329
+ context: gqlContext()
343
330
  })
344
331
 
345
- return{
332
+ return {
346
333
  total: response.data.shortageReport.total || 0,
347
334
  records: response.data.shortageReport.items || []
348
335
  }
@@ -433,14 +420,14 @@ class shortageReport extends connect(store)(localize(i18next)(PageView)){
433
420
  { header: i18next.t('field.order_no'), key: 'orderNo', width: 30, type: 'string' },
434
421
  { header: i18next.t('field.ref_no'), key: 'refNo', width: 60, type: 'string' },
435
422
  { header: i18next.t('field.sku'), key: 'productSku', width: 25, type: 'string' },
436
- {header: i18next.t('field.product'), key: 'productName', width: 50, type: 'string' },
437
- {header: i18next.t('field.order_quantity'), key: 'orderQty', width: 15, type: 'string' },
438
- {header: i18next.t('field.available_qty'), key: 'avQty', width: 15, type: 'string' },
439
- {header: i18next.t('field.nett_stock'), key: 'nettStock', width: 15, type: 'string' },
440
- {header: i18next.t('field.delivery_address'), key: 'deliveryAddress', width: 15, type: 'string' },
441
- {header: i18next.t('field.state'), key: 'state', width: 15, type: 'string' },
442
- {header: i18next.t('field.city'), key: 'city', width: 15, type: 'string' },
443
- {header: i18next.t('field.country'), key: 'country', width: 15, type: 'string' },
423
+ { header: i18next.t('field.product'), key: 'productName', width: 50, type: 'string' },
424
+ { header: i18next.t('field.order_quantity'), key: 'orderQty', width: 15, type: 'string' },
425
+ { header: i18next.t('field.available_qty'), key: 'avQty', width: 15, type: 'string' },
426
+ { header: i18next.t('field.nett_stock'), key: 'nettStock', width: 15, type: 'string' },
427
+ { header: i18next.t('field.delivery_address'), key: 'deliveryAddress', width: 15, type: 'string' },
428
+ { header: i18next.t('field.state'), key: 'state', width: 15, type: 'string' },
429
+ { header: i18next.t('field.city'), key: 'city', width: 15, type: 'string' },
430
+ { header: i18next.t('field.country'), key: 'country', width: 15, type: 'string' },
444
431
  { header: i18next.t('field.created_at'), key: 'createdAt', width: 30, type: 'string' }
445
432
  ]
446
433
 
@@ -449,7 +436,7 @@ class shortageReport extends connect(store)(localize(i18next)(PageView)){
449
436
  data: (await this.fetchHandler({ page: 1, limit: 9999999 })).records.map(itm => {
450
437
  return {
451
438
  ...itm,
452
- createdAt: itm.createdAt ? new Date(parseInt(itm.createdAt)).toLocaleString() : '',
439
+ createdAt: itm.createdAt ? new Date(parseInt(itm.createdAt)).toLocaleString() : ''
453
440
  }
454
441
  })
455
442
  }
@@ -471,5 +458,5 @@ class shortageReport extends connect(store)(localize(i18next)(PageView)){
471
458
  )
472
459
  }
473
460
  }
474
-
461
+
475
462
  window.customElements.define('shortage-report', shortageReport)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/operato-wms",
3
- "version": "4.3.384",
3
+ "version": "4.3.386",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -117,5 +117,5 @@
117
117
  "cypress-localstorage-commands": "^1.6.1",
118
118
  "eslint-plugin-cypress": "^2.12.1"
119
119
  },
120
- "gitHead": "275a82285e56b18dbe228cf54ad3ad5cdd543aaf"
120
+ "gitHead": "d504ae7551567b12cd2011fb1c958300159c545f"
121
121
  }