@things-factory/operato-wms 3.8.26 → 3.8.30

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.
@@ -117,7 +117,7 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
117
117
  this._searchFields = [
118
118
  {
119
119
  label: i18next.t('field.company'),
120
- name: 'bizplaceId',
120
+ name: 'bizplace',
121
121
  type: 'select',
122
122
  options: [
123
123
  { value: '' },
@@ -511,6 +511,7 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
511
511
  id
512
512
  name
513
513
  sku
514
+ productInformation
514
515
  brand
515
516
  auxUnit1
516
517
  auxValue1
@@ -571,8 +572,8 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
571
572
  const filters = await this.searchForm.getQueryFilters()
572
573
  const response = await client.query({
573
574
  query: gql`
574
- query inventories($filters: [Filter!]!, $pagination: Pagination, $sortings: [Sorting!]!) {
575
- inventories(filters: $filters, pagination: $pagination, sortings: $sortings) {
575
+ query inventoriesForExport($filters: [Filter!]!, $pagination: Pagination, $sortings: [Sorting!]!) {
576
+ inventoriesForExport(filters: $filters, pagination: $pagination, sortings: $sortings) {
576
577
  items {
577
578
  id
578
579
  palletId
@@ -598,6 +599,7 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
598
599
  brand
599
600
  name
600
601
  description
602
+ productInformation
601
603
  }
602
604
  qty
603
605
  warehouse {
@@ -612,10 +614,6 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
612
614
  description
613
615
  }
614
616
  updatedAt
615
- updater {
616
- name
617
- description
618
- }
619
617
  }
620
618
  total
621
619
  }
@@ -628,7 +626,7 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
628
626
  }
629
627
  })
630
628
 
631
- return response.data.inventories.items || []
629
+ return response.data.inventoriesForExport.items || []
632
630
  }
633
631
 
634
632
  async _fetchPartners(filters = []) {
@@ -816,7 +814,7 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
816
814
  })
817
815
  ]
818
816
 
819
- const bizplaceFilters = (await this.searchForm.getQueryFilters()).filter(x => x.name === 'bizplaceId')
817
+ const bizplaceFilters = (await this.searchForm.getQueryFilters()).filter(x => x.name === 'bizplace')
820
818
 
821
819
  if (bizplaceFilters.length == 0) {
822
820
  throw new Error(`Please select a customer for export.`)
@@ -828,7 +826,7 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
828
826
  data = await this.fetchInventoriesForExport()
829
827
  }
830
828
 
831
- let [product, bizplace, location] = await Promise.all([
829
+ let [products, bizplaces, locations] = await Promise.all([
832
830
  this.fetchProduct(bizplaceFilters),
833
831
  this.fetchBizplaces([{ ...bizplaceFilters[0], name: 'bizplace' }]),
834
832
  this.fetchLocation()
@@ -837,15 +835,13 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
837
835
  headerSetting = headerSetting.map(column => {
838
836
  switch (column.key) {
839
837
  case 'bizplace.name':
840
- column.arrData = bizplace
838
+ column.arrData = bizplaces
841
839
  break
842
840
  case 'product.name':
843
- column.arrData = product.map(itm => {
844
- return { ...itm, name: `(${itm.sku}) ${itm.name} - ${itm.description}` }
845
- })
841
+ column.arrData = products
846
842
  break
847
843
  case 'location.name':
848
- column.arrData = location
844
+ column.arrData = locations
849
845
  break
850
846
  default:
851
847
  break
@@ -858,7 +854,7 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
858
854
  item.expirationDate = new Date(item.expirationDate).getTime()
859
855
  }
860
856
 
861
- item.product.name = `(${item.product.sku}) ${item.product.name} - ${item.product.description}`
857
+ item.product.name = item.product.productInformation
862
858
  return {
863
859
  id: item.id,
864
860
  ...this.columns
@@ -873,7 +869,6 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
873
869
  }
874
870
  })
875
871
 
876
- // throw new error('test')
877
872
  return { header: headerSetting, data: data }
878
873
  } catch (e) {
879
874
  this._showToast(e)
@@ -910,20 +905,20 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
910
905
  bizplace[0].name = 'bizplace'
911
906
  const response = await client.query({
912
907
  query: gql`
913
- query productsByBizplace($filters: [Filter!]!) {
914
- productsByBizplace(filters: $filters) {
908
+ query pureProductsByBizplace($filters: [Filter!]!) {
909
+ pureProductsByBizplace(filters: $filters) {
915
910
  items {
916
911
  id
917
- sku
918
- name
919
- description
912
+ productInformation
920
913
  }
921
914
  }
922
915
  }
923
916
  `,
924
917
  variables: { filters: [...bizplace] }
925
918
  })
926
- return response.data.productsByBizplace.items
919
+ return response.data.pureProductsByBizplace.items.map(product => {
920
+ return { id: product.id, name: product.productInformation }
921
+ })
927
922
  } catch (ex) {
928
923
  throw ex
929
924
  }
@@ -932,8 +927,8 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
932
927
  async fetchLocation() {
933
928
  const response = await client.query({
934
929
  query: gql`
935
- query locations($filters: [Filter!]!) {
936
- locations(filters: $filters) {
930
+ query pureLocations($filters: [Filter!]!) {
931
+ pureLocations(filters: $filters) {
937
932
  items {
938
933
  id
939
934
  name
@@ -943,7 +938,8 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
943
938
  `,
944
939
  variables: { filters: [] }
945
940
  })
946
- return response.data.locations.items
941
+ this._locations = response.data.pureLocations.items
942
+ return response.data.pureLocations.items
947
943
  }
948
944
 
949
945
  async updateRemark(id, remark) {
@@ -164,11 +164,6 @@ class InventoryByProduct extends localize(i18next)(PageView) {
164
164
  type: 'object',
165
165
  name: 'bizplace',
166
166
  header: i18next.t('field.company'),
167
- record: {
168
- options: {
169
- queryName: 'bizplaces'
170
- }
171
- },
172
167
  imex: {
173
168
  header: i18next.t('field.company'),
174
169
  key: 'bizplace.name',
@@ -243,13 +238,6 @@ class InventoryByProduct extends localize(i18next)(PageView) {
243
238
  header: i18next.t('field.qty'),
244
239
  width: 80
245
240
  }
246
- // {
247
- // type: 'decimal',
248
- // name: 'averageUnitCost',
249
- // imex: { header: i18next.t('field.average_unit_cost'), key: 'averageUnitCost', width: 50, type: 'decimal' },
250
- // header: i18next.t('field.average_unit_cost'),
251
- // width: 160
252
- // }
253
241
  ]
254
242
  }
255
243
  }
@@ -2,6 +2,7 @@ import '@things-factory/grist-ui'
2
2
  import '../../components/attachment-viewer'
3
3
  import '../../components/popup-note'
4
4
  import '../../components/vas-templates'
5
+ import '@things-factory/warehouse-ui'
5
6
 
6
7
  import gql from 'graphql-tag'
7
8
  import { css, html } from 'lit-element'
@@ -6,6 +6,7 @@ import '../batch-generate-single-picking-worksheet-popup'
6
6
  import gql from 'graphql-tag'
7
7
  import { css, html } from 'lit-element'
8
8
 
9
+ import { GhostPrint } from '@operato/ghost-print'
9
10
  import { getCodeByName } from '@things-factory/code-base'
10
11
  import { i18next, localize } from '@things-factory/i18n-base'
11
12
  import { openPopup } from '@things-factory/layout-base'
@@ -15,6 +16,11 @@ import { isMobileDevice } from '@things-factory/utils'
15
16
 
16
17
  import { ORDER_STATUS } from '../../../constants'
17
18
 
19
+ const HEADER_JSON = {
20
+ 'Content-Type': 'application/json',
21
+ Accept: 'application/json'
22
+ }
23
+
18
24
  class B2cOrderRequests extends localize(i18next)(PageView) {
19
25
  static get styles() {
20
26
  return [
@@ -62,6 +68,11 @@ class B2cOrderRequests extends localize(i18next)(PageView) {
62
68
  return {
63
69
  title: i18next.t('title.release_order_requests'),
64
70
  actions: [
71
+ {
72
+ title: i18next.t('button.print_invoice'),
73
+ action: this._printInvoices.bind(this),
74
+ ...CommonButtonStyles.label
75
+ },
65
76
  {
66
77
  title: i18next.t('button.generate_packing_list'),
67
78
  action: this._generatePackingList.bind(this),
@@ -495,6 +506,47 @@ class B2cOrderRequests extends localize(i18next)(PageView) {
495
506
  )
496
507
  }
497
508
 
509
+ async _printInvoices() {
510
+ try {
511
+ if (this.dataGrist.selected && this.dataGrist.selected.length > 0) {
512
+ var timezoneOffSet = new Date().getTimezoneOffset().toString()
513
+ let url = new URL(window.location)
514
+
515
+ let data = await Promise.all(
516
+ this.dataGrist.selected.map(async x => {
517
+ return x.id
518
+ })
519
+ )
520
+
521
+ let response = await fetch(`/view_invoices/${timezoneOffSet}`, {
522
+ method: 'POST',
523
+ credentials: 'include',
524
+ headers: HEADER_JSON,
525
+ body: JSON.stringify({ roIds: data })
526
+ }).then(function (response) {
527
+ return response.text()
528
+ })
529
+
530
+ this._callPrintDialog(response)
531
+
532
+ // navigate(`print_invoices/${data}`)
533
+ } else {
534
+ throw new Error(`Please select a record.`)
535
+ }
536
+ } catch (e) {
537
+ this._showToast(e)
538
+ }
539
+ }
540
+
541
+ async _callPrintDialog(contentSource) {
542
+ GhostPrint.print({
543
+ srcdoc: contentSource,
544
+ onfinish: () => {
545
+ this._showToast({ message: i18next.t('text.document_has_been_generated') })
546
+ }
547
+ })
548
+ }
549
+
498
550
  _compareValues(key, order = 'asc') {
499
551
  return function innerSort(a, b) {
500
552
  if (!a.hasOwnProperty(key) || !b.hasOwnProperty(key)) {
@@ -370,6 +370,7 @@ class ElcclInventoryReport extends connect(store)(localize(i18next)(PageView)) {
370
370
  }
371
371
  }
372
372
 
373
+ // unused function ?
373
374
  async _bizplaceChange(e) {
374
375
  let bizplace = [{ name: 'bizplace', operator: 'eq', value: e.currentTarget.value }]
375
376
  if (e.currentTarget.value == '') {
@@ -401,6 +401,7 @@ class InventoryReport extends connect(store)(localize(i18next)(PageView)) {
401
401
  }
402
402
  }
403
403
 
404
+ // unused function ?
404
405
  async _bizplaceChange(e) {
405
406
  let bizplace = [{ name: 'bizplace', operator: 'eq', value: e.currentTarget.value }]
406
407
  if (e.currentTarget.value == '') {
@@ -325,45 +325,6 @@ class ProductLabelReport extends connect(store)(localize(i18next)(PageView)) {
325
325
  }
326
326
  }
327
327
 
328
- // @farishelmi any usage for this function? If no please remove.
329
- async _bizplaceChange(e) {
330
- /* let bizplace = [{ name: 'bizplace', operator: 'eq', value: e.currentTarget.value }]
331
- if (e.currentTarget.value == '') {
332
- this.searchFields
333
- this._searchFields.filter(x => x.name == 'product')[0].options = [{ name: 'All', value: '' }]
334
- this._searchFields = [...this._searchFields]
335
- } else {
336
- const response = await client.query({
337
- query: gql`
338
- query {
339
- productsByBizplace(${gqlBuilder.buildArgs({
340
- filters: [...bizplace]
341
- })}) {
342
- items {
343
- id
344
- name
345
- }
346
- }
347
- }
348
- `
349
- })
350
-
351
- if (!response.errors) {
352
- this.searchFields
353
- this._searchFields.filter(x => x.name == 'product')[0].options = [
354
- { name: 'All', value: '' },
355
- ...response.data.productsByBizplace.items.map(item => {
356
- return {
357
- name: item.name,
358
- value: item.id
359
- }
360
- })
361
- ]
362
- this._searchFields = [...this._searchFields]
363
- }
364
- } */
365
- }
366
-
367
328
  _exportableData() {
368
329
  try {
369
330
  const report = this.report
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/operato-wms",
3
- "version": "3.8.26",
3
+ "version": "3.8.30",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -46,7 +46,7 @@
46
46
  "@things-factory/attachment-ui": "^3.8.0",
47
47
  "@things-factory/auth-ui": "^3.8.0",
48
48
  "@things-factory/barcode-ui": "^3.8.0",
49
- "@things-factory/biz-ui": "^3.8.26",
49
+ "@things-factory/biz-ui": "^3.8.29",
50
50
  "@things-factory/board-service": "^3.8.0",
51
51
  "@things-factory/board-ui": "^3.8.0",
52
52
  "@things-factory/code-ui": "^3.8.0",
@@ -69,9 +69,9 @@
69
69
  "@things-factory/print-proxy-service": "^3.8.0",
70
70
  "@things-factory/print-service": "^3.8.0",
71
71
  "@things-factory/print-ui": "^3.8.0",
72
- "@things-factory/product-base": "^3.8.26",
72
+ "@things-factory/product-base": "^3.8.30",
73
73
  "@things-factory/resource-ui": "^3.8.0",
74
- "@things-factory/sales-ui": "^3.8.26",
74
+ "@things-factory/sales-ui": "^3.8.30",
75
75
  "@things-factory/scene-chartjs": "^3.7.5",
76
76
  "@things-factory/scene-clock": "^3.7.5",
77
77
  "@things-factory/scene-clone": "^3.7.5",
@@ -100,13 +100,13 @@
100
100
  "@things-factory/scene-wheel-sorter": "^3.7.5",
101
101
  "@things-factory/setting-ui": "^3.8.19",
102
102
  "@things-factory/system-ui": "^3.8.0",
103
- "@things-factory/transport-base": "^3.8.26",
103
+ "@things-factory/transport-base": "^3.8.29",
104
104
  "@things-factory/tutorial-ui": "^3.8.0",
105
- "@things-factory/warehouse-base": "^3.8.26",
106
- "@things-factory/worksheet-base": "^3.8.26"
105
+ "@things-factory/warehouse-base": "^3.8.30",
106
+ "@things-factory/worksheet-base": "^3.8.30"
107
107
  },
108
108
  "devDependencies": {
109
109
  "@things-factory/builder": "^3.7.5"
110
110
  },
111
- "gitHead": "6ca26d91b7dad8eec6bc7859391bbd50374c744b"
111
+ "gitHead": "bf379e59ba4cc6455dca937abba19c35c6339525"
112
112
  }