@things-factory/operato-wms 4.3.458 → 4.3.459

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.
@@ -342,6 +342,7 @@ class ValidateRoPopup extends localize(i18next)(LitElement) {
342
342
  postalCode
343
343
  phone1
344
344
  errorMsg
345
+ exportOption
345
346
  }
346
347
  }
347
348
  `,
@@ -4,11 +4,21 @@ import '@things-factory/import-ui'
4
4
  import './inventory-by-product-detail'
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
 
9
- import { i18next, localize } from '@things-factory/i18n-base'
12
+ import { MultiColumnFormStyles } from '@things-factory/form-ui'
13
+ import {
14
+ i18next,
15
+ localize
16
+ } from '@things-factory/i18n-base'
10
17
  import { openPopup } from '@things-factory/layout-base'
11
- import { client, PageView } from '@things-factory/shell'
18
+ import {
19
+ client,
20
+ PageView
21
+ } from '@things-factory/shell'
12
22
  import { ScrollbarStyles } from '@things-factory/styles'
13
23
  import { isMobileDevice } from '@things-factory/utils'
14
24
 
@@ -25,21 +35,69 @@ class InventoryByProduct extends localize(i18next)(PageView) {
25
35
  static get styles() {
26
36
  return [
27
37
  ScrollbarStyles,
38
+ MultiColumnFormStyles,
28
39
  css`
29
40
  :host {
30
41
  display: flex;
31
42
  flex-direction: column;
32
- overflow: hidden;
33
43
  }
34
44
 
35
45
  search-form {
36
46
  overflow: visible;
37
47
  }
38
48
 
49
+ search-form.search-form {
50
+ border-bottom: none;
51
+ }
52
+
39
53
  data-grist {
40
54
  overflow-y: auto;
41
55
  flex: 1;
42
56
  }
57
+
58
+ input[type="checkbox"].toggle{
59
+ font-size: 13px;
60
+ -webkit-appearance: none;
61
+ -moz-appearance: none;
62
+ appearance: none;
63
+ width: 3.5em;
64
+ height: 1.5em;
65
+ border: 0.5px solid #3A5877;
66
+ border-radius: 3em;
67
+ position: relative;
68
+ cursor: pointer;
69
+ outline: none;
70
+ -webkit-transition: all .2s ease-in-out;
71
+ transition: all .2s ease-in-out;
72
+ padding: 0px 0px;
73
+ }
74
+
75
+ input[type="checkbox"].toggle:checked{
76
+ background: #b8e0e1;
77
+ border: 0.5px solid #3A5877;
78
+ }
79
+
80
+ input[type="checkbox"].toggle:after{
81
+ padding-top: 0;
82
+ position: absolute;
83
+ content: "";
84
+ width: 1.4em;
85
+ height: 1.4em;
86
+ border-radius: 50%;
87
+ background: #3a5877;
88
+ -webkit-box-shadow: 0 0 .25em rgba(0,0,0,.3);
89
+ box-shadow: 0 0 .25em rgba(0,0,0,.3);
90
+ -webkit-transform: scale(.7);
91
+ transform: scale(.7);
92
+ left: 0;
93
+ -webkit-transition: all .2s ease-in-out;
94
+ transition: all .2s ease-in-out;
95
+ }
96
+
97
+ input[type="checkbox"].toggle:checked:after{
98
+ left: calc(100% - 1.4em);
99
+ }
100
+
43
101
  `
44
102
  ]
45
103
  }
@@ -47,20 +105,35 @@ class InventoryByProduct extends localize(i18next)(PageView) {
47
105
  constructor() {
48
106
  super()
49
107
  this._checkedBoxes = []
108
+ this._showTotalUom = false
109
+ // count holds value to determine if data needs to be fetch from database.
110
+ this.count = 0
111
+ this.responseArr
50
112
  }
51
113
 
52
114
  render() {
53
115
  return html`
54
- <search-form id="search-form" .fields=${this._searchFields} @submit=${e => this.dataGrist.fetch()}></search-form>
116
+ <search-form id="search-form" .fields=${this._searchFields} @submit=${e => this.dataGrist.fetch()}></search-form>
117
+ <form name="uom-selection" class="multi-column-form" style="margin-top: 0px">
118
+ <fieldset>
119
+ <legend>${i18next.t('title.column_selection')}</legend>
120
+ </fieldset>
121
+ <input id="uomToggle" type="checkbox" class="toggle" @change="${this._handleShowTotalUomChange}">
122
+ <label for="showTotalUom">${i18next.t('field.show_total_uom')}</label>
123
+ </form>
55
124
 
56
125
  <data-grist
57
126
  .mode=${isMobileDevice() ? 'LIST' : 'GRID'}
58
127
  .config=${this.config}
59
- .fetchHandler="${this.fetchHandler.bind(this)}"
128
+ .fetchHandler= "${this.fetchHandler.bind(this)}"
60
129
  ></data-grist>
61
130
  `
62
131
  }
63
132
 
133
+ getResponseArr() {
134
+ return this.responseArr
135
+ }
136
+
64
137
  get context() {
65
138
  return {
66
139
  title: i18next.t('title.inventory_by_product'),
@@ -81,6 +154,7 @@ class InventoryByProduct extends localize(i18next)(PageView) {
81
154
  }
82
155
 
83
156
  get dataGrist() {
157
+ this.count = 0
84
158
  return this.shadowRoot.querySelector('data-grist')
85
159
  }
86
160
 
@@ -93,7 +167,15 @@ class InventoryByProduct extends localize(i18next)(PageView) {
93
167
  }
94
168
  }
95
169
 
170
+ _handleShowTotalUomChange(event) {
171
+ this._showTotalUom = event.target.checked
172
+ this.count = 1
173
+ this.config = this.getConfig()
174
+ this.requestUpdate()
175
+ }
176
+
96
177
  async pageInitialized() {
178
+ this.count = 0
97
179
  const partners = await this._fetchPartners()
98
180
  this._searchFields = [
99
181
  {
@@ -175,8 +257,11 @@ class InventoryByProduct extends localize(i18next)(PageView) {
175
257
  handlers: { change: this._updateSearchInputState.bind(this, 'reserveStock') }
176
258
  }
177
259
  ]
260
+ this.config = this.getConfig()
261
+ }
178
262
 
179
- this.config = {
263
+ getConfig() {
264
+ return {
180
265
  rows: { appendable: false, selectable: { multiple: true } },
181
266
  list: { fields: ['bizplace', 'sku', 'name', 'description', 'type', 'qty'] },
182
267
  pagination: { limit: 100, pages: [100, 200, 500, 1000] },
@@ -383,10 +468,26 @@ class InventoryByProduct extends localize(i18next)(PageView) {
383
468
  {
384
469
  type: 'integer',
385
470
  name: 'minQty',
386
- imex: { header: i18next.t('field.min_qty'), key: 'minQty', width: 20, type: 'integer' },
471
+ imex: {
472
+ header: i18next.t('field.min_qty'),
473
+ key: 'minQty',
474
+ width: 20,
475
+ type: 'integer' },
387
476
  header: i18next.t('field.min_qty'),
388
477
  label: true,
389
478
  width: 80
479
+ },
480
+ {
481
+ type: 'integer',
482
+ name: 'uomValueMinQty',
483
+ imex: {
484
+ header: i18next.t('field.total_uom_value_min'),
485
+ key: 'uomValueMinQty',
486
+ width: 60,
487
+ type: 'integer' },
488
+ header: i18next.t('field.total_uom_value_min'),
489
+ width: 120,
490
+ hidden: !this._showTotalUom
390
491
  },
391
492
  {
392
493
  type: 'integer',
@@ -396,6 +497,18 @@ class InventoryByProduct extends localize(i18next)(PageView) {
396
497
  label: true,
397
498
  width: 80
398
499
  },
500
+ {
501
+ type: 'integer',
502
+ name: 'uomValueMaxQty',
503
+ imex: {
504
+ header: i18next.t('field.total_uom_value_max'),
505
+ key: 'uomValueTransferQty',
506
+ width: 60,
507
+ type: 'integer' },
508
+ header: i18next.t('field.total_uom_value_max'),
509
+ width: 120,
510
+ hidden: !this._showTotalUom
511
+ },
399
512
  {
400
513
  type: 'integer',
401
514
  name: 'qty',
@@ -404,6 +517,18 @@ class InventoryByProduct extends localize(i18next)(PageView) {
404
517
  label: true,
405
518
  width: 120
406
519
  },
520
+ {
521
+ type: 'integer',
522
+ name: 'uomValueShelfQty',
523
+ imex: {
524
+ header: i18next.t('field.total_uom_value_shelf'),
525
+ key: 'uomValueShelfQty',
526
+ width: 60,
527
+ type: 'integer' },
528
+ header: i18next.t('field.total_uom_value_shelf'),
529
+ width: 120,
530
+ hidden: !this._showTotalUom
531
+ },
407
532
  {
408
533
  type: 'integer',
409
534
  name: 'draftQty',
@@ -412,6 +537,18 @@ class InventoryByProduct extends localize(i18next)(PageView) {
412
537
  label: true,
413
538
  width: 120
414
539
  },
540
+ {
541
+ type: 'integer',
542
+ name: 'uomValueDraftQty',
543
+ imex: {
544
+ header: i18next.t('field.total_uom_value_draft'),
545
+ key: 'uomValueDraftQty',
546
+ width: 60,
547
+ type: 'integer' },
548
+ header: i18next.t('field.total_uom_value_draft'),
549
+ width: 120,
550
+ hidden: !this._showTotalUom
551
+ },
415
552
  {
416
553
  type: 'integer',
417
554
  name: 'releaseQty',
@@ -420,6 +557,18 @@ class InventoryByProduct extends localize(i18next)(PageView) {
420
557
  label: true,
421
558
  width: 120
422
559
  },
560
+ {
561
+ type: 'integer',
562
+ name: 'uomValueReleaseQty',
563
+ imex: {
564
+ header: i18next.t('field.total_uom_value_release'),
565
+ key: 'uomValueReleaseQty',
566
+ width: 60,
567
+ type: 'integer' },
568
+ header: i18next.t('field.total_uom_value_release'),
569
+ width: 120,
570
+ hidden: !this._showTotalUom
571
+ },
423
572
  {
424
573
  type: 'integer',
425
574
  name: 'insufficientQty',
@@ -428,6 +577,18 @@ class InventoryByProduct extends localize(i18next)(PageView) {
428
577
  label: true,
429
578
  width: 120
430
579
  },
580
+ {
581
+ type: 'integer',
582
+ name: 'uomValueInsufficientQty',
583
+ imex: {
584
+ header: i18next.t('field.total_uom_value_insufficient'),
585
+ key: 'uomValueInsufficientQty',
586
+ width: 60,
587
+ type: 'integer' },
588
+ header: i18next.t('field.total_uom_value_insufficient'),
589
+ width: 120,
590
+ hidden: !this._showTotalUom
591
+ },
431
592
  {
432
593
  type: 'integer',
433
594
  name: 'putawayQty',
@@ -436,6 +597,18 @@ class InventoryByProduct extends localize(i18next)(PageView) {
436
597
  label: true,
437
598
  width: 120
438
599
  },
600
+ {
601
+ type: 'integer',
602
+ name: 'uomValuePutawayQty',
603
+ imex: {
604
+ header: i18next.t('field.total_uom_value_putaway'),
605
+ key: 'uomValuePutawayQty',
606
+ width: 60,
607
+ type: 'integer' },
608
+ header: i18next.t('field.total_uom_value_putaway'),
609
+ width: 120,
610
+ hidden: !this._showTotalUom
611
+ },
439
612
  {
440
613
  type: 'integer',
441
614
  name: 'availableQty',
@@ -444,6 +617,18 @@ class InventoryByProduct extends localize(i18next)(PageView) {
444
617
  label: true,
445
618
  width: 120
446
619
  },
620
+ {
621
+ type: 'integer',
622
+ name: 'uomValueAvailableQty',
623
+ imex: {
624
+ header: i18next.t('field.total_uom_value_available'),
625
+ key: 'uomValueAvailableQty',
626
+ width: 60,
627
+ type: 'integer' },
628
+ header: i18next.t('field.total_uom_value_available'),
629
+ width: 120,
630
+ hidden: !this._showTotalUom
631
+ },
447
632
  {
448
633
  type: 'integer',
449
634
  name: 'quarantineQty',
@@ -452,6 +637,18 @@ class InventoryByProduct extends localize(i18next)(PageView) {
452
637
  label: true,
453
638
  width: 120
454
639
  },
640
+ {
641
+ type: 'integer',
642
+ name: 'uomValueQuarantineQty',
643
+ imex: {
644
+ header: i18next.t('field.total_uom_value_quarantine'),
645
+ key: 'uomValueQuarantineQty',
646
+ width: 60,
647
+ type: 'integer' },
648
+ header: i18next.t('field.total_uom_value_quarantine'),
649
+ width: 120,
650
+ hidden: !this._showTotalUom
651
+ },
455
652
  {
456
653
  type: 'integer',
457
654
  name: 'reserveQty',
@@ -460,6 +657,18 @@ class InventoryByProduct extends localize(i18next)(PageView) {
460
657
  label: true,
461
658
  width: 120
462
659
  },
660
+ {
661
+ type: 'integer',
662
+ name: 'uomValueReserveQty',
663
+ imex: {
664
+ header: i18next.t('field.total_uom_value_reserve'),
665
+ key: 'uomValueReserveQty',
666
+ width: 60,
667
+ type: 'integer' },
668
+ header: i18next.t('field.total_uom_value_reserve'),
669
+ width: 120,
670
+ hidden: !this._showTotalUom
671
+ },
463
672
  {
464
673
  type: 'integer',
465
674
  name: 'warehouseQty',
@@ -468,6 +677,18 @@ class InventoryByProduct extends localize(i18next)(PageView) {
468
677
  label: true,
469
678
  width: 120
470
679
  },
680
+ {
681
+ type: 'integer',
682
+ name: 'uomValueWarehouseQty',
683
+ imex: {
684
+ header: i18next.t('field.total_uom_value_warehouse'),
685
+ key: 'uomValueWarehouseQty',
686
+ width: 60,
687
+ type: 'integer' },
688
+ header: i18next.t('field.total_uom_value_warehouse'),
689
+ width: 120,
690
+ hidden: !this._showTotalUom
691
+ },
471
692
  {
472
693
  type: 'integer',
473
694
  name: 'obsoleteQty',
@@ -476,6 +697,18 @@ class InventoryByProduct extends localize(i18next)(PageView) {
476
697
  label: true,
477
698
  width: 120
478
699
  },
700
+ {
701
+ type: 'integer',
702
+ name: 'uomValueObsoleteQty',
703
+ imex: {
704
+ header: i18next.t('field.total_uom_value_obsolete'),
705
+ key: 'uomValueObsoleteQty',
706
+ width: 60,
707
+ type: 'integer' },
708
+ header: i18next.t('field.total_uom_value_obsolete'),
709
+ width: 120,
710
+ hidden: !this._showTotalUom
711
+ },
479
712
  {
480
713
  type: 'integer',
481
714
  name: 'damageQty',
@@ -484,6 +717,18 @@ class InventoryByProduct extends localize(i18next)(PageView) {
484
717
  label: true,
485
718
  width: 120
486
719
  },
720
+ {
721
+ type: 'integer',
722
+ name: 'uomValueDamageQty',
723
+ imex: {
724
+ header: i18next.t('field.total_uom_value_damage'),
725
+ key: 'uomValueDamageQty',
726
+ width: 60,
727
+ type: 'integer' },
728
+ header: i18next.t('field.total_uom_value_damage'),
729
+ width: 120,
730
+ hidden: !this._showTotalUom
731
+ },
487
732
  {
488
733
  type: 'integer',
489
734
  name: 'storageQty',
@@ -492,6 +737,18 @@ class InventoryByProduct extends localize(i18next)(PageView) {
492
737
  label: true,
493
738
  width: 120
494
739
  },
740
+ {
741
+ type: 'integer',
742
+ name: 'uomValueStorageQty',
743
+ imex: {
744
+ header: i18next.t('field.total_uom_value_storage'),
745
+ key: 'uomValueStorageQty',
746
+ width: 60,
747
+ type: 'integer' },
748
+ header: i18next.t('field.total_uom_value_storage'),
749
+ width: 120,
750
+ hidden: !this._showTotalUom
751
+ },
495
752
  {
496
753
  type: 'integer',
497
754
  name: 'transferQty',
@@ -499,66 +756,85 @@ class InventoryByProduct extends localize(i18next)(PageView) {
499
756
  header: i18next.t('field.transfer_qty'),
500
757
  label: true,
501
758
  width: 120
759
+ },
760
+ {
761
+ type: 'integer',
762
+ name: 'uomValueTransferQty',
763
+ imex: {
764
+ header: i18next.t('field.total_uom_value_transfer'),
765
+ key: 'uomValueTransferQty',
766
+ width: 60,
767
+ type: 'integer' },
768
+ header: i18next.t('field.total_uom_value_transfer'),
769
+ width: 120,
770
+ hidden: !this._showTotalUom
502
771
  }
503
772
  ]
504
773
  }
505
774
  }
506
775
 
507
776
  async fetchHandler({ page, limit, sorters = [] }) {
508
- const response = await client.query({
509
- query: gql`
510
- query inventoriesByProduct($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
511
- inventoriesByProduct(filters: $filters, pagination: $pagination, sortings: $sortings) {
512
- items {
513
- product {
514
- id
515
- sku
516
- brand
517
- name
518
- description
519
- minQty
520
- maxQty
521
- auxUnit1
522
- auxValue1
523
- auxUnit2
524
- auxValue2
525
- auxUnit3
526
- auxValue3
527
- auxUnit4
528
- auxValue4
529
- auxUnit5
530
- auxValue5
531
- }
532
- bizplace {
533
- name
777
+ let records = []
778
+ let total
779
+
780
+ if (this.count===1) {
781
+ records = this.responseArr
782
+ total = this.responseArr.length
783
+ } else {
784
+ const response = await client.query({
785
+ query: gql`
786
+ query inventoriesByProduct($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
787
+ inventoriesByProduct(filters: $filters, pagination: $pagination, sortings: $sortings) {
788
+ items {
789
+ product {
790
+ id
791
+ sku
792
+ brand
793
+ name
794
+ description
795
+ minQty
796
+ maxQty
797
+ auxUnit1
798
+ auxValue1
799
+ auxUnit2
800
+ auxValue2
801
+ auxUnit3
802
+ auxValue3
803
+ auxUnit4
804
+ auxValue4
805
+ auxUnit5
806
+ auxValue5
807
+ }
808
+ bizplace {
809
+ name
810
+ }
811
+ packingType
812
+ averageUnitCost
813
+ qty
814
+ putawayQty
815
+ availableQty
816
+ insufficientQty
817
+ releaseQty
818
+ quarantineQty
819
+ reserveQty
820
+ draftQty
821
+ warehouseQty
822
+ obsoleteQty
823
+ damageQty
824
+ storageQty
825
+ transferQty
826
+ uomValue
534
827
  }
535
- packingType
536
- averageUnitCost
537
- qty
538
- putawayQty
539
- availableQty
540
- insufficientQty
541
- releaseQty
542
- quarantineQty
543
- reserveQty
544
- draftQty
545
- warehouseQty
546
- obsoleteQty
547
- damageQty
548
- storageQty
549
- transferQty
828
+ total
550
829
  }
551
- total
552
830
  }
553
- }
554
- `,
555
- variables: { filters: await this.searchForm.getQueryFilters(), pagination: { page, limit }, sortings: sorters }
556
- })
831
+ `,
832
+ variables: { filters: await this.searchForm.getQueryFilters(), pagination: { page, limit }, sortings: sorters }
833
+ })
557
834
 
558
- if (!response.errors) {
559
- return {
560
- total: response.data.inventoriesByProduct.total || 0,
561
- records: (response.data.inventoriesByProduct.items || []).map(item => {
835
+ if (!response.errors) {
836
+ total = response.data.inventoriesByProduct.total || 0
837
+ records = (response.data.inventoriesByProduct.items || []).map(item => {
562
838
  // changed to direct assign instead of spread ...item, ...item.product to improve performance
563
839
  let record = item.product
564
840
  record.packingType = item.packingType
@@ -577,10 +853,29 @@ class InventoryByProduct extends localize(i18next)(PageView) {
577
853
  record.transferQty = item.transferQty
578
854
  record.storageQty = item.storageQty
579
855
  record.damageQty = item.damageQty
856
+ record.uomValue = item.uomValue
857
+
858
+ record.uomValueMinQty = record.uomValue * record.minQty
859
+ record.uomValueMaxQty = record.uomValue * record.maxQty
860
+ record.uomValueShelfQty = record.uomValue * record.qty
861
+ record.uomValueDraftQty = record.uomValue * record.draftQty
862
+ record.uomValueReleaseQty = record.uomValue * record.releaseQty
863
+ record.uomValueInsufficientQty = record.uomValue * record.insufficientQty
864
+ record.uomValuePutawayQty = record.uomValue * record.putawayQty
865
+ record.uomValueAvailableQty = record.uomValue * record.availableQty
866
+ record.uomValueQuarantineQty = record.uomValue * record.quarantineQty
867
+ record.uomValueReserveQty = record.uomValue * record.reserveQty
868
+ record.uomValueWarehouseQty = record.uomValue * record.warehouseQty
869
+ record.uomValueObsoleteQty = record.uomValue * record.obsoleteQty
870
+ record.uomValueDamageQty = record.uomValue * record.damageQty
871
+ record.uomValueStorageQty = record.uomValue * record.storageQty
872
+ record.uomValueTransferQty = record.uomValue * record.transferQty
580
873
 
581
874
  return record
582
875
  })
876
+ this.responseArr = records
583
877
  }
878
+ return { records, total }
584
879
  }
585
880
  }
586
881
 
@@ -589,6 +884,7 @@ class InventoryByProduct extends localize(i18next)(PageView) {
589
884
  }
590
885
 
591
886
  _updateSearchInputState(fieldName) {
887
+ this.count = 0
592
888
  const targetField = this.searchForm.shadowRoot.querySelector(`input[name=${fieldName}]`)
593
889
 
594
890
  if (targetField.checked) {
@@ -279,6 +279,11 @@ class DraftReleaseGoodPopup extends localize(i18next)(LitElement) {
279
279
  return
280
280
  }
281
281
 
282
+ if (selectedGristData.some(item => item.valueRadio === '')) {
283
+ this._showToast({ message: i18next.t('text.unable_to_create_partial_release_order_for_sku_as_miminum_required_quantity_to_release_is_1') })
284
+ return
285
+ }
286
+
282
287
  const filterSelectedData = selectedGristData.map(item => {
283
288
  return {
284
289
  id: item.valueInfo ? item.valueInfo : '',