@things-factory/operato-wms 4.3.385 → 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.
@@ -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.385",
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": "2d9e6d3ebda9e7c4680d7ea22ae9ac5c6bf9f5b8"
120
+ "gitHead": "d504ae7551567b12cd2011fb1c958300159c545f"
121
121
  }