@things-factory/operato-wms 4.3.469 → 4.3.471

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.
@@ -67,7 +67,8 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
67
67
  productData: Object,
68
68
  vasData: Object,
69
69
  arrivalNoticeId: String,
70
- _disableTransport: Boolean
70
+ _disableTransport: Boolean,
71
+ userRole: Array
71
72
  }
72
73
  }
73
74
 
@@ -191,12 +192,26 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
191
192
  }
192
193
  ]
193
194
 
194
- if (this._status === ORDER_STATUS.PENDING.value) {
195
+
196
+ if (
197
+ this._status === ORDER_STATUS.PENDING.value &&
198
+ this.userRoles?.find(itm => itm.name.toLowerCase().includes('admin'))
199
+ ){
195
200
  actions.push({
196
- title: i18next.t('button.update_order_details'),
197
- action: this._updateArrivalNotice.bind(this),
201
+ title: i18next.t('button.edit_product'),
202
+ action: this.openEditProductPopup.bind(this),
198
203
  ...CommonButtonStyles.add
199
204
  })
205
+ }
206
+
207
+ if (this._status === ORDER_STATUS.PENDING.value) {
208
+ actions.push(
209
+ {
210
+ title: i18next.t('button.update_order_details'),
211
+ action: this._updateArrivalNotice.bind(this),
212
+ ...CommonButtonStyles.add
213
+ }
214
+ )
200
215
 
201
216
  actions.push({
202
217
  title: i18next.t('button.delete'),
@@ -658,6 +673,7 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
658
673
  this.containerSizes = await getCodeByName('CONTAINER_SIZES')
659
674
  this._enableTransportationServiceSetting = await fetchSettingRule('enable-transportation-service')
660
675
  this.isUserBelongsDomain = await this._checkUserBelongsDomain()
676
+ this.userRoles = await this.fetchUserRoleHandler()
661
677
  this.vasGristConfig = {
662
678
  list: { fields: ['set', 'targetType', 'target', 'packingType', 'qty', 'vas', 'status', 'remark'] },
663
679
  pagination: { infinite: true },
@@ -1655,6 +1671,7 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
1655
1671
  html`
1656
1672
  <edit-product-popup
1657
1673
  .ganNo="${this._ganNo}"
1674
+ .status="${this._status}"
1658
1675
  .productData="${this.productData}"
1659
1676
  .bizplace="${this.orderBizplace}"
1660
1677
  .strictEditable="${this._strictProductSelection}"
@@ -1715,6 +1732,26 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
1715
1732
  })
1716
1733
  }
1717
1734
 
1735
+ async fetchUserRoleHandler() {
1736
+ const response = await client.query({
1737
+ query: gql`
1738
+ query myRoles {
1739
+ myRoles {
1740
+ id
1741
+ name
1742
+ description
1743
+ }
1744
+ }
1745
+ `
1746
+ })
1747
+
1748
+ if (!response.errors?.length) {
1749
+ return response.data.myRoles
1750
+ }
1751
+
1752
+ return []
1753
+ }
1754
+
1718
1755
  _showToast({ type, message }) {
1719
1756
  document.dispatchEvent(
1720
1757
  new CustomEvent('notify', {
@@ -60,6 +60,10 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
60
60
  background-color: var(--button-container-background);
61
61
  height: var(--button-container-height);
62
62
  }
63
+
64
+ .hidden {
65
+ display: none;
66
+ }
63
67
  [danger] {
64
68
  --mdc-theme-primary: var(--mdc-danger-button-primary-color);
65
69
  }
@@ -70,12 +74,14 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
70
74
  static get properties() {
71
75
  return {
72
76
  ganNo: String,
77
+ status: String,
73
78
  bizplace: Object,
74
79
  editProductConfig: Object,
75
80
  addProductConfig: Object,
76
81
  productData: Object,
77
82
  newProductData: Object,
78
- strictEditable: Boolean
83
+ strictEditable: Boolean,
84
+ userRole: Array
79
85
  }
80
86
  }
81
87
 
@@ -116,8 +122,18 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
116
122
  ></mwc-button>
117
123
  <mwc-button
118
124
  raised
119
- @click="${this._addEditProducts.bind(this)}"
125
+ @click="${this._addEditProducts.bind(this, false)}"
120
126
  label="${i18next.t('button.submit_for_approval')}"
127
+ class="${this.status === 'PENDING' ? 'hidden' : ''}"
128
+ ></mwc-button>
129
+ <mwc-button
130
+ type="button"
131
+ raised
132
+ @click="${this._addEditProducts.bind(this, true)}"
133
+ label="${i18next.t('button.submit')}"
134
+ class="${this.status !== 'PENDING' && this.userRole?.find(itm => !itm.name.toLowerCase().includes('admin'))
135
+ ? 'hidden'
136
+ : ''}"
121
137
  ></mwc-button>
122
138
  </div>
123
139
  `
@@ -396,6 +412,8 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
396
412
  }
397
413
  ]
398
414
  }
415
+
416
+ this.userRole = await this.fetchUserRoleHandler()
399
417
  }
400
418
 
401
419
  get editProductGrist() {
@@ -590,7 +608,7 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
590
608
  }
591
609
  }
592
610
 
593
- async _addEditProducts() {
611
+ async _addEditProducts(approveAdminAddEditProducts) {
594
612
  try {
595
613
  this._validateProducts()
596
614
 
@@ -612,11 +630,13 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
612
630
  const response = await client.mutate({
613
631
  mutation: gql`
614
632
  mutation addEditArrivalNoticeProducts(
633
+ $approvedAddEditProducts: Boolean
615
634
  $ganNo: String!
616
635
  $newOrderProducts: [NewOrderProduct!]
617
636
  $existingOrderProducts: [OrderProductPatch!]
618
637
  ) {
619
638
  addEditArrivalNoticeProducts(
639
+ approvedAddEditProducts: $approvedAddEditProducts
620
640
  ganNo: $ganNo
621
641
  newOrderProducts: $newOrderProducts
622
642
  existingOrderProducts: $existingOrderProducts
@@ -624,6 +644,7 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
624
644
  }
625
645
  `,
626
646
  variables: {
647
+ approvedAddEditProducts: approveAdminAddEditProducts ? true : false,
627
648
  ganNo: this.ganNo,
628
649
  newOrderProducts,
629
650
  existingOrderProducts
@@ -631,7 +652,11 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
631
652
  })
632
653
 
633
654
  if (!response.errors) {
634
- this._showToast({ message: i18next.t('text.add_edit_products_has_been_submitted_for_approval') })
655
+ if (approveAdminAddEditProducts) {
656
+ this._showToast({ message: i18next.t('text.add_edit_products_has_been_updated') })
657
+ } else {
658
+ this._showToast({ message: i18next.t('text.add_edit_products_has_been_submitted_for_approval') })
659
+ }
635
660
  this.dispatchEvent(new CustomEvent('completed'))
636
661
  history.back()
637
662
  }
@@ -644,31 +669,32 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
644
669
  }
645
670
 
646
671
  _getNewOrderProducts() {
672
+ const isStatusPending = this.status === 'PENDING' ? true : false
647
673
  return this.addProductGrist.dirtyData.records.map(record => {
648
674
  record.unitPrice = parseFloat(record.unitPrice)
649
675
  return {
650
- batchId: `N/A`,
651
- adjustedBatchId: record.batchId,
652
- palletQty: 0,
653
- adjustedPalletQty: record?.palletQty ? record.palletQty : null,
676
+ batchId: isStatusPending ? record.batchId : `N/A`,
677
+ adjustedBatchId: !(isStatusPending) ? record.batchId : null,
678
+ palletQty: isStatusPending ? (record.palletQty ? record.palletQty : 0 ): 0,
679
+ adjustedPalletQty: !(isStatusPending) ? (record?.palletQty ? record.palletQty : null) : null,
654
680
  product: { id: record.product.id },
655
681
  productDetail: { id: record.productDetailId },
656
- packingType: 'N/A',
657
- adjustedPackingType: record.packingType,
658
- uomValue: 0,
682
+ packingType: isStatusPending ? record.packingType : 'N/A',
683
+ adjustedPackingType: !(isStatusPending) ? record.packingType : null,
684
+ uomValue: isStatusPending ? record.uomValue : 0,
659
685
  status: ORDER_PRODUCT_STATUS.ADDED.value,
660
- adjustedUomValue: record?.uomValue ? record.uomValue : 0,
661
- uom: 'N/A',
662
- adjustedUom: record.uom,
663
- packQty: 0,
664
- adjustedPackQty: record.packQty,
665
- totalUomValue: 'N/A',
666
- adjustedTotalUomValue: record?.totalUomValue ? record.totalUomValue : 'N/A',
686
+ adjustedUomValue: !(isStatusPending) ? (record?.uomValue ? record.uomValue : 0) : null,
687
+ uom: isStatusPending ? record.uom : 'N/A',
688
+ adjustedUom: !(isStatusPending) ? record.uom : null,
689
+ packQty: isStatusPending ? (record.packQty ? record.packQty : 0 ): 0,
690
+ adjustedPackQty: !(isStatusPending) ? record.packQty : null,
691
+ totalUomValue: isStatusPending ? record.totalUomValue : 'N/A',
692
+ adjustedTotalUomValue: record?.totalUomValue && !(isStatusPending) ? record.totalUomValue : 'N/A',
667
693
  manufactureDate: record?.manufactureDate ? record.manufactureDate : null,
668
- batchIdRef: 'N/A',
669
- adjustedBatchIdRef: record?.batchIdRef ? record.batchIdRef : null,
670
- unitPrice: 0,
671
- adjustedUnitPrice: record?.unitPrice ? record.unitPrice : null,
694
+ batchIdRef: isStatusPending ? record?.batchIdRef : 'N/A',
695
+ adjustedBatchIdRef: record?.batchIdRef && !(isStatusPending) ? record.batchIdRef : null,
696
+ unitPrice: isStatusPending ? record.unitPrice : 0,
697
+ adjustedUnitPrice: record?.unitPrice && !(isStatusPending) ? record.unitPrice : null,
672
698
  remark: record?.remark ? record.remark : null,
673
699
  packingSize: record.packingSize || record.product.packingSize
674
700
  }
@@ -677,24 +703,37 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
677
703
 
678
704
  _getExistingOrderProducts() {
679
705
  let editedOrderProducts = []
706
+ const isStatusPending = this.status === 'PENDING' ? true : false
680
707
  if (this.editProductGrist.dirtyData.records.some(record => record.__dirty__)) {
681
708
  this.editProductGrist.dirtyData.records.map(record => {
682
709
  record.unitPrice = parseFloat(record.unitPrice)
683
710
  editedOrderProducts.push({
684
711
  id: record.id,
685
- adjustedBatchId: record.batchId === record.__origin__.batchId ? null : record.batchId,
686
- adjustedBatchIdRef: record.batchIdRef === record.__origin__.batchIdRef ? null : record.batchIdRef,
687
- adjustedPalletQty: record.palletQty == record.__origin__.palletQty ? null : record.palletQty,
712
+ adjustedBatchId: !(isStatusPending) ? (record.batchId === record.__origin__.batchId ? null : record.batchId) : null,
713
+ adjustedBatchIdRef: !(isStatusPending) ? (record.batchIdRef === record.__origin__.batchIdRef ? null : record.batchIdRef) : null,
714
+ adjustedPalletQty: !(isStatusPending) ? (record.palletQty === record.__origin__.palletQty ? null : record.palletQty) : null,
688
715
  product: { id: record.product.id },
689
716
  productDetail: { id: record.productDetail.id },
690
- adjustedPackingType: record.packingType === record.__origin__.packingType ? null : record.packingType,
691
- adjustedUomValue: record.uomValue == record.__origin__.uomValue ? null : record.uomValue,
692
- adjustedUom: record.uom === record.__origin__.uom ? null : record.uom,
693
- adjustedPackQty: record.packQty == record.__origin__.packQty ? null : record.packQty,
694
- adjustedTotalUomValue: record.totalUomValue == record.__origin__.totalUomValue ? null : record.totalUomValue,
717
+ adjustedPackingType: !(isStatusPending) ? (record.packingType === record.__origin__.packingType ? null : record.packingType) : null,
718
+ adjustedUomValue: !(isStatusPending) ? (record.uomValue == record.__origin__.uomValue ? null : record.uomValue) : null,
719
+ adjustedUom: !(isStatusPending) ? (record.uom === record.__origin__.uom ? null : record.uom) : null,
720
+ adjustedPackQty: !(isStatusPending) ? (record.packQty == record.__origin__.packQty ? null : record.packQty) : null,
721
+ adjustedTotalUomValue: !(isStatusPending) ? (record.totalUomValue == record.__origin__.totalUomValue ? null : record.totalUomValue) : null,
695
722
  manufactureDate: record?.manufactureDate ? record.manufactureDate : null,
696
- adjustedUnitPrice: record?.unitPrice ? record.unitPrice : null,
697
- remark: record?.remark ? record.remark : null
723
+ adjustedUnitPrice: record?.unitPrice && !(isStatusPending) ? record.unitPrice : null,
724
+ remark: record?.remark ? record.remark : null,
725
+ ...(isStatusPending && {
726
+ unitPrice: record.unitPrice,
727
+ batchIdRef: record?.batchIdRef,
728
+ packingType: record.packingType,
729
+ packQty: record.packQty,
730
+ palletQty: record.palletQty,
731
+ uomValue: record.uomValue,
732
+ uom: record.uom,
733
+ batchId: record.batchId,
734
+ totalUomValue: record.totalUomValue
735
+ })
736
+
698
737
  })
699
738
  })
700
739
  }
@@ -717,6 +756,26 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
717
756
  throw new Error(i18next.t('text.empty_value_in_add_product_list'))
718
757
  }
719
758
 
759
+ async fetchUserRoleHandler() {
760
+ const response = await client.query({
761
+ query: gql`
762
+ query myRoles {
763
+ myRoles {
764
+ id
765
+ name
766
+ description
767
+ }
768
+ }
769
+ `
770
+ })
771
+
772
+ if (!response.errors?.length) {
773
+ return response.data.myRoles
774
+ }
775
+
776
+ return []
777
+ }
778
+
720
779
  _showToast({ type, message }) {
721
780
  document.dispatchEvent(
722
781
  new CustomEvent('notify', {
@@ -1,21 +1,11 @@
1
1
  import '@things-factory/grist-ui'
2
2
 
3
3
  import gql from 'graphql-tag'
4
- import {
5
- css,
6
- html,
7
- LitElement
8
- } from 'lit-element'
4
+ import { css, html, LitElement } from 'lit-element'
9
5
 
10
6
  import { MultiColumnFormStyles } from '@things-factory/form-ui'
11
- import {
12
- i18next,
13
- localize
14
- } from '@things-factory/i18n-base'
15
- import {
16
- client,
17
- CustomAlert
18
- } from '@things-factory/shell'
7
+ import { i18next, localize } from '@things-factory/i18n-base'
8
+ import { client, CustomAlert } from '@things-factory/shell'
19
9
  import { ScrollbarStyles } from '@things-factory/styles'
20
10
  import { isMobileDevice } from '@things-factory/utils'
21
11
 
@@ -354,7 +344,8 @@ export class ReleaseExtraProductPopup extends localize(i18next)(LitElement) {
354
344
  filters: [
355
345
  { name: 'status', operator: 'eq', value: INVENTORY_STATUS.STORED.value },
356
346
  { name: 'bizplace_id', value: this.bizplace, operator: 'eq' },
357
- { name: 'recall', value: this.recall ? this.recall : false, operator: '' }
347
+ { name: 'recall', value: this.recall ? this.recall : false, operator: '' },
348
+ { name: 'invFilter', value: this.existingInventoryGrist.dirtyData.records.map(itm => itm.inventory.id), operator: 'eq' }
358
349
  ],
359
350
  locationSortingRules
360
351
  },
@@ -12,26 +12,14 @@ 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 {
16
- css,
17
- html
18
- } from 'lit-element'
15
+ import { css, html } from 'lit-element'
19
16
  import { connect } from 'pwa-helpers/connect-mixin'
20
17
 
21
18
  import { getCodeByName } from '@things-factory/code-base'
22
19
  import { MultiColumnFormStyles } from '@things-factory/form-ui'
23
- import {
24
- i18next,
25
- localize
26
- } from '@things-factory/i18n-base'
20
+ import { i18next, localize } from '@things-factory/i18n-base'
27
21
  import { openPopup } from '@things-factory/layout-base'
28
- import {
29
- client,
30
- CustomAlert,
31
- navigate,
32
- PageView,
33
- store
34
- } from '@things-factory/shell'
22
+ import { client, CustomAlert, navigate, PageView, store } from '@things-factory/shell'
35
23
  import { CommonButtonStyles } from '@things-factory/styles'
36
24
  import { isMobileDevice } from '@things-factory/utils'
37
25
 
@@ -464,7 +452,7 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
464
452
  <input name="refNo3" ?readonly="${!this?._editable}" />
465
453
 
466
454
  <label>${i18next.t('label.release_date')}</label>
467
- <input name="releaseDate" type="date" ?readonly="${!this?._editable}"/>
455
+ <input name="releaseDate" type="date" ?readonly="${!this?._editable}" />
468
456
 
469
457
  <label ?hidden="${!this._ownTransport}">${i18next.t('label.co_no')}</label>
470
458
  <input name="collectionOrderNo" ?hidden="${!this._ownTransport}" ?readonly="${!this?._editable}" />
@@ -909,6 +897,17 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
909
897
  })
910
898
  }
911
899
 
900
+ if (
901
+ this._status === ORDER_STATUS.PENDING.value &&
902
+ this._userRoles?.find(itm => itm.name.toLowerCase().includes('admin'))
903
+ ) {
904
+ actions.push({
905
+ title: i18next.t('button.edit_product'),
906
+ action: this._openExtraProductPopup.bind(this),
907
+ ...CommonButtonStyles.add
908
+ })
909
+ }
910
+
912
911
  let addProductStatus = [ORDER_STATUS.PICKING.value, ORDER_STATUS.LOADING.value]
913
912
  if (addProductStatus.indexOf(this._status) >= 0 && this._allowROAddProductSetting && !this._isInBatchPicking) {
914
913
  actions.push({
@@ -1626,7 +1625,8 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
1626
1625
  remainQty: inventoryInfo.qty,
1627
1626
  remainUomValue: inventoryInfo.uomValue,
1628
1627
  releaseUomValue: inventoryInfo.releaseUomValue,
1629
- releaseUomValueWithUom: inventoryInfo.releaseUomValue + ' ' + inventoryInfo.uom
1628
+ releaseUomValueWithUom: inventoryInfo.releaseUomValue + ' ' + inventoryInfo.uom,
1629
+ uom: inventoryInfo.uom
1630
1630
  },
1631
1631
  qty: inventoryInfo.qty,
1632
1632
  remainQty: inventoryInfo.qty - inventoryInfo.lockedQty,
@@ -1654,6 +1654,7 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
1654
1654
 
1655
1655
  this._releaseOrderId = releaseOrder.id
1656
1656
  this.partnerBizplaceId = releaseOrder.bizplace.id
1657
+ this.partnerBizplace = releaseOrder.bizplace
1657
1658
  this._exportOption = releaseOrder.exportOption
1658
1659
  this._recallOption = releaseOrder.recall
1659
1660
 
@@ -3443,6 +3444,7 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
3443
3444
  return this.vasFormattedData
3444
3445
  }
3445
3446
 
3447
+
3446
3448
  sortByNameField(items, nameField, nameField2) {
3447
3449
  if (nameField2) {
3448
3450
  items?.sort((a, b) => {
@@ -65,8 +65,10 @@ exports.addReleaseGoodProducts = {
65
65
  targetInventory: curOrderInv
66
66
  }
67
67
  });
68
- existingWorksheetDetail = Object.assign(Object.assign({}, existingWorksheetDetail), { status: worksheet_base_1.WORKSHEET_STATUS.CANCELLED });
69
- await tx.getRepository(worksheet_base_1.WorksheetDetail).save(existingWorksheetDetail);
68
+ if (existingWorksheetDetail) {
69
+ existingWorksheetDetail = Object.assign(Object.assign({}, existingWorksheetDetail), { status: worksheet_base_1.WORKSHEET_STATUS.CANCELLED });
70
+ await tx.getRepository(worksheet_base_1.WorksheetDetail).save(existingWorksheetDetail);
71
+ }
70
72
  await tx.getRepository(sales_base_1.OrderInventory).save(curOrderInv);
71
73
  }
72
74
  }
@@ -90,7 +92,7 @@ exports.addReleaseGoodProducts = {
90
92
  await tx.getRepository(warehouse_base_1.Inventory).save(foundInv);
91
93
  if (existingOrderInv) {
92
94
  // if found existing OrderInventory and worksheetDetail then qty, uomValue, and status are updated
93
- curOrderInv = Object.assign(Object.assign({}, existingOrderInv), { releaseQty: curOrderInv.releaseQty, releaseUomValue: curOrderInv.releaseUomValue, status: sales_base_1.ORDER_INVENTORY_STATUS.PICKING });
95
+ curOrderInv = Object.assign(Object.assign({}, existingOrderInv), { releaseQty: curOrderInv.releaseQty, releaseUomValue: curOrderInv.releaseUomValue, status: pickingWorksheet ? sales_base_1.ORDER_INVENTORY_STATUS.PICKING : sales_base_1.ORDER_INVENTORY_STATUS.PENDING });
94
96
  let existingWorksheetDetail = await tx.getRepository(worksheet_base_1.WorksheetDetail).findOne({
95
97
  where: {
96
98
  worksheet: pickingWorksheet,
@@ -120,7 +122,7 @@ exports.addReleaseGoodProducts = {
120
122
  }
121
123
  }
122
124
  }
123
- if (orderInventories) {
125
+ if (orderInventories.length > 0) {
124
126
  for (let oi of orderInventories) {
125
127
  // map input to OrderInventory Object
126
128
  let newOrderInv = Object.assign({}, oi);
@@ -145,10 +147,16 @@ exports.addReleaseGoodProducts = {
145
147
  // check if it is release by inventory (has inventory value) or product
146
148
  if ((_b = newOrderInv.inventory) === null || _b === void 0 ? void 0 : _b.id) {
147
149
  // if release by inventory, then quantity and uomValue values are updated
148
- const foundInv = await tx.getRepository(warehouse_base_1.Inventory).findOne(newOrderInv.inventory.id);
150
+ const foundInv = await tx
151
+ .getRepository(warehouse_base_1.Inventory)
152
+ .findOne({ where: { id: newOrderInv.inventory.id }, relations: ['productDetail'] });
149
153
  newOrderInv.inventory = foundInv;
150
154
  newOrderInv.uom = (oi === null || oi === void 0 ? void 0 : oi.uom) || foundInv.uom;
151
155
  newOrderInv.batchIdRef = (oi === null || oi === void 0 ? void 0 : oi.batchIdRef) || foundInv.batchIdRef;
156
+ if (foundInv.productDetail) {
157
+ newOrderInv.uomValue = foundInv.productDetail.uomValue;
158
+ delete foundInv.productDetail;
159
+ }
152
160
  // check for existing released OrderInventory specifying product, batchId, packingType, and inventory
153
161
  existingOrderInv = await tx.getRepository(sales_base_1.OrderInventory).findOne({
154
162
  where: {
@@ -201,28 +209,22 @@ exports.addReleaseGoodProducts = {
201
209
  await tx.getRepository(worksheet_base_1.WorksheetDetail).save(existingWorksheetDetail);
202
210
  }
203
211
  }
212
+ let mappedOrderInv = (data) => {
213
+ return Object.assign(Object.assign({}, data), { domain: domain, creator: user, updater: user });
214
+ };
215
+ if (releaseGood.status === 'PENDING') {
216
+ let savedOrderInv = new sales_base_1.OrderInventory();
217
+ savedOrderInv = mappedOrderInv(newOrderInv);
218
+ savedOrderInv = await tx.getRepository(sales_base_1.OrderInventory).save(savedOrderInv);
219
+ }
204
220
  if (pickingWorksheet) {
205
221
  // if has picking worksheet, status will be deactivated to prevent any action from warehouse operator until office admin has confirmation
206
- pickingWorksheet = Object.assign(Object.assign({}, pickingWorksheet), { status: worksheet_base_1.WORKSHEET_STATUS.DEACTIVATED });
222
+ // pickingWorksheet = {
223
+ // ...pickingWorksheet,
224
+ // status: WORKSHEET_STATUS.DEACTIVATED
225
+ // }
207
226
  let savedOrderInv = new sales_base_1.OrderInventory();
208
- savedOrderInv.name = newOrderInv.name;
209
- savedOrderInv.type = newOrderInv.type;
210
- savedOrderInv.releaseQty = newOrderInv.releaseQty;
211
- savedOrderInv.releaseUomValue = newOrderInv.releaseUomValue;
212
- savedOrderInv.batchId = newOrderInv.batchId;
213
- savedOrderInv.batchIdRef = newOrderInv.batchIdRef;
214
- savedOrderInv.packingType = newOrderInv.packingType;
215
- savedOrderInv.uom = newOrderInv.uom;
216
- savedOrderInv.product = newOrderInv.product;
217
- savedOrderInv.productDetail = newOrderInv.productDetail;
218
- savedOrderInv.inventory = newOrderInv.inventory;
219
- savedOrderInv.status = newOrderInv.status;
220
- savedOrderInv.releaseGood = newOrderInv.releaseGood;
221
- savedOrderInv.orderProduct = newOrderInv.orderProduct;
222
- savedOrderInv.bizplace = newOrderInv.bizplace;
223
- savedOrderInv.domain = domain;
224
- savedOrderInv.creator = user;
225
- savedOrderInv.updater = user;
227
+ savedOrderInv = mappedOrderInv(newOrderInv);
226
228
  if (newOrderInv === null || newOrderInv === void 0 ? void 0 : newOrderInv.id) {
227
229
  // newOrderInv will have id if it was updated from existingOrderInv
228
230
  // this solution will remove ix_order-inventory_0 unique error
@@ -235,9 +237,9 @@ exports.addReleaseGoodProducts = {
235
237
  // if this is a new orderInventory and has existing worksheet then generate a new worksheet detail for it
236
238
  await (0, worksheet_base_1.generatePickingWorksheetDetail)(tx, domain, user, pickingWorksheet, savedOrderInv);
237
239
  }
240
+ await tx.getRepository(worksheet_base_1.Worksheet).update(pickingWorksheet.id, { status: worksheet_base_1.WORKSHEET_STATUS.DEACTIVATED });
238
241
  }
239
242
  }
240
- await tx.getRepository(worksheet_base_1.Worksheet).save(pickingWorksheet);
241
243
  }
242
244
  if (loadingWorksheet) {
243
245
  // if has loading worksheet, status will be deactivated to prevent any action from warehouse operator until office admin has confirmation
@@ -1 +1 @@
1
- {"version":3,"file":"add-release-good-products.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/other/add-release-good-products.ts"],"names":[],"mappings":";;;AAAA,qCAAgD;AAIhD,+DAAqE;AACrE,2DAOmC;AAEnC,mEAA0D;AAC1D,mEAMuC;AAE1B,QAAA,sBAAsB,GAAG;IACpC,KAAK,CAAC,sBAAsB,CAAC,CAAM,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,EAAE,OAAY;;QACrG,IAAI;YACF,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,GAAsD,OAAO,CAAC,KAAK,CAAA;YAE7F,IAAI,WAAW,GAAgB,MAAM,EAAE,CAAC,aAAa,CAAC,wBAAW,CAAC,CAAC,OAAO,CAAC;gBACzE,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE;gBAC7B,SAAS,EAAE,CAAC,UAAU,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AA;gBAED,IAAI,eAAe,IAAI,CAAC,EAAE;oBACxB,YAAY,CAAC,MAAM,GAAG,iCAAoB,CAAC,UAAU,CAAA;iBACtD;gBAED,MAAM,EAAE,CAAC,aAAa,CAAC,yBAAY,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,YAAY,CAAC,CAAA;YAC1E,CAAC,CAAC,CACH,CAAA;SACF;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,KAAK,CAAA;SACZ;IACH,CAAC;CACF,CAAA"}
1
+ {"version":3,"file":"add-release-good-products.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/other/add-release-good-products.ts"],"names":[],"mappings":";;;AAAA,qCAAgD;AAIhD,+DAAqE;AACrE,2DAOmC;AAEnC,mEAA0D;AAC1D,mEAMuC;AAE1B,QAAA,sBAAsB,GAAG;IACpC,KAAK,CAAC,sBAAsB,CAAC,CAAM,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,EAAE,OAAY;;QACrG,IAAI;YACF,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,GAAsD,OAAO,CAAC,KAAK,CAAA;YAE7F,IAAI,WAAW,GAAgB,MAAM,EAAE,CAAC,aAAa,CAAC,wBAAW,CAAC,CAAC,OAAO,CAAC;gBACzE,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE;gBAC7B,SAAS,EAAE,CAAC,UAAU,EAAE,eAAe,CAAC;aACzC,CAAC,CAAA;YAEF,MAAM,QAAQ,GAAa,WAAW,CAAC,QAAQ,CAAA;YAE/C,IAAI,gBAAgB,GAAc,MAAM,EAAE,CAAC,aAAa,CAAC,0BAAS,CAAC,CAAC,OAAO,CAAC;gBAC1E,KAAK,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,+BAAc,CAAC,OAAO,EAAE;aACrD,CAAC,CAAA;YAEF,IAAI,gBAAgB,GAAc,MAAM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2
2
  "name": "@things-factory/operato-wms",
3
- "version": "4.3.469",
3
+ "version": "4.3.471",
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.434",
92
92
  "@things-factory/product-base": "^4.3.452",
93
93
  "@things-factory/resource-ui": "^4.3.452",
94
- "@things-factory/sales-ui": "^4.3.468",
94
+ "@things-factory/sales-ui": "^4.3.470",
95
95
  "@things-factory/scene-data-transform": "^4.3.381",
96
96
  "@things-factory/scene-excel": "^4.3.381",
97
97
  "@things-factory/scene-firebase": "^4.3.381",
@@ -107,8 +107,8 @@
107
107
  "@things-factory/system-ui": "^4.3.434",
108
108
  "@things-factory/transport-base": "^4.3.452",
109
109
  "@things-factory/tutorial-ui": "^4.3.452",
110
- "@things-factory/warehouse-base": "^4.3.468",
111
- "@things-factory/worksheet-base": "^4.3.468"
110
+ "@things-factory/warehouse-base": "^4.3.470",
111
+ "@things-factory/worksheet-base": "^4.3.471"
112
112
  },
113
113
  "devDependencies": {
114
114
  "@things-factory/builder": "^4.3.381",
@@ -117,5 +117,5 @@
117
117
  "cypress-localstorage-commands": "^1.6.1",
118
118
  "eslint-plugin-cypress": "^2.12.1"
119
119
  },
120
- "gitHead": "ae8e4cb7182a2a90f4332feb645dbbc464f81a17"
120
+ "gitHead": "75a04c48dcd202f40c876a64a243ef34104bdb42"
121
121
  }
@@ -100,11 +100,14 @@ export const addReleaseGoodProducts = {
100
100
  }
101
101
  })
102
102
 
103
- existingWorksheetDetail = {
104
- ...existingWorksheetDetail,
105
- status: WORKSHEET_STATUS.CANCELLED
103
+ if (existingWorksheetDetail) {
104
+ existingWorksheetDetail = {
105
+ ...existingWorksheetDetail,
106
+ status: WORKSHEET_STATUS.CANCELLED
107
+ }
108
+ await tx.getRepository(WorksheetDetail).save(existingWorksheetDetail)
106
109
  }
107
- await tx.getRepository(WorksheetDetail).save(existingWorksheetDetail)
110
+
108
111
  await tx.getRepository(OrderInventory).save(curOrderInv)
109
112
  }
110
113
  } else if (curOrderInv.releaseQty == existingOrderInv.pickedQty) {
@@ -144,7 +147,7 @@ export const addReleaseGoodProducts = {
144
147
  ...existingOrderInv,
145
148
  releaseQty: curOrderInv.releaseQty,
146
149
  releaseUomValue: curOrderInv.releaseUomValue,
147
- status: ORDER_INVENTORY_STATUS.PICKING
150
+ status: pickingWorksheet ? ORDER_INVENTORY_STATUS.PICKING : ORDER_INVENTORY_STATUS.PENDING
148
151
  }
149
152
 
150
153
  let existingWorksheetDetail: WorksheetDetail = await tx.getRepository(WorksheetDetail).findOne({
@@ -192,7 +195,7 @@ export const addReleaseGoodProducts = {
192
195
  }
193
196
  }
194
197
 
195
- if (orderInventories) {
198
+ if (orderInventories.length > 0) {
196
199
  for (let oi of orderInventories) {
197
200
  // map input to OrderInventory Object
198
201
  let newOrderInv: OrderInventory = Object.assign({}, oi)
@@ -220,11 +223,18 @@ export const addReleaseGoodProducts = {
220
223
  // check if it is release by inventory (has inventory value) or product
221
224
  if (newOrderInv.inventory?.id) {
222
225
  // if release by inventory, then quantity and uomValue values are updated
223
- const foundInv: Inventory = await tx.getRepository(Inventory).findOne(newOrderInv.inventory.id)
226
+ const foundInv: Inventory = await tx
227
+ .getRepository(Inventory)
228
+ .findOne({ where: { id: newOrderInv.inventory.id }, relations: ['productDetail'] })
224
229
  newOrderInv.inventory = foundInv
225
230
  newOrderInv.uom = oi?.uom || foundInv.uom
226
231
  newOrderInv.batchIdRef = oi?.batchIdRef || foundInv.batchIdRef
227
232
 
233
+ if (foundInv.productDetail){
234
+ newOrderInv.uomValue = foundInv.productDetail.uomValue
235
+ delete foundInv.productDetail
236
+ }
237
+
228
238
  // check for existing released OrderInventory specifying product, batchId, packingType, and inventory
229
239
  existingOrderInv = await tx.getRepository(OrderInventory).findOne({
230
240
  where: {
@@ -303,32 +313,33 @@ export const addReleaseGoodProducts = {
303
313
  }
304
314
  }
305
315
 
316
+ let mappedOrderInv = (data) => {
317
+
318
+ return {
319
+ ...data,
320
+ domain: domain,
321
+ creator: user,
322
+ updater: user
323
+ }
324
+ }
325
+
326
+ if (releaseGood.status === 'PENDING') {
327
+ let savedOrderInv: OrderInventory = new OrderInventory()
328
+
329
+ savedOrderInv = mappedOrderInv(newOrderInv)
330
+
331
+ savedOrderInv = await tx.getRepository(OrderInventory).save(savedOrderInv)
332
+ }
333
+
306
334
  if (pickingWorksheet) {
307
335
  // if has picking worksheet, status will be deactivated to prevent any action from warehouse operator until office admin has confirmation
308
- pickingWorksheet = {
309
- ...pickingWorksheet,
310
- status: WORKSHEET_STATUS.DEACTIVATED
311
- }
336
+ // pickingWorksheet = {
337
+ // ...pickingWorksheet,
338
+ // status: WORKSHEET_STATUS.DEACTIVATED
339
+ // }
312
340
 
313
341
  let savedOrderInv: OrderInventory = new OrderInventory()
314
- savedOrderInv.name = newOrderInv.name
315
- savedOrderInv.type = newOrderInv.type
316
- savedOrderInv.releaseQty = newOrderInv.releaseQty
317
- savedOrderInv.releaseUomValue = newOrderInv.releaseUomValue
318
- savedOrderInv.batchId = newOrderInv.batchId
319
- savedOrderInv.batchIdRef = newOrderInv.batchIdRef
320
- savedOrderInv.packingType = newOrderInv.packingType
321
- savedOrderInv.uom = newOrderInv.uom
322
- savedOrderInv.product = newOrderInv.product
323
- savedOrderInv.productDetail = newOrderInv.productDetail
324
- savedOrderInv.inventory = newOrderInv.inventory
325
- savedOrderInv.status = newOrderInv.status
326
- savedOrderInv.releaseGood = newOrderInv.releaseGood
327
- savedOrderInv.orderProduct = newOrderInv.orderProduct
328
- savedOrderInv.bizplace = newOrderInv.bizplace
329
- savedOrderInv.domain = domain
330
- savedOrderInv.creator = user
331
- savedOrderInv.updater = user
342
+ savedOrderInv = mappedOrderInv(newOrderInv)
332
343
 
333
344
  if (newOrderInv?.id) {
334
345
  // newOrderInv will have id if it was updated from existingOrderInv
@@ -344,10 +355,10 @@ export const addReleaseGoodProducts = {
344
355
  // if this is a new orderInventory and has existing worksheet then generate a new worksheet detail for it
345
356
  await generatePickingWorksheetDetail(tx, domain, user, pickingWorksheet, savedOrderInv)
346
357
  }
358
+
359
+ await tx.getRepository(Worksheet).update(pickingWorksheet.id, { status: WORKSHEET_STATUS.DEACTIVATED })
347
360
  }
348
361
  }
349
-
350
- await tx.getRepository(Worksheet).save(pickingWorksheet)
351
362
  }
352
363
 
353
364
  if (loadingWorksheet) {
@@ -1226,6 +1226,7 @@
1226
1226
  "text.activate": "activate",
1227
1227
  "text.add_edit_products_has_been_submitted_for_approval": "add/edit order products has been submitted for approval",
1228
1228
  "text.add_extra_product": "add extra product",
1229
+ "text.add_edit_products_has_been_updated": "add/edit order products has been updated",
1229
1230
  "text.adjustment_code_is_required_kindly_fill_in_the_adjustment_code_to_continue": "Adjustment Code is required. Kindly fill in the adjustment code to continue",
1230
1231
  "text.adjustment_note_is_required_kindly_fill_in_the_adjustment_note_to_continue": "Adjustment Note is required. Kindly fill in the adjustment note to continue",
1231
1232
  "text.adjustment_pending_admin_approval": "adjustment pending admin approval",
@@ -1217,6 +1217,7 @@
1217
1217
  "text.activate": "활성화",
1218
1218
  "text.add_edit_products_has_been_submitted_for_approval": "[ko]add/edit order products has been submitted for approval",
1219
1219
  "text.add_extra_product": "추가상품 추가",
1220
+ "text.add_edit_products_has_been_updated": "[ko]add/edit order products has been updated",
1220
1221
  "text.adjustment_pending_admin_approval": "변경사항 적용 관리자 승인대기",
1221
1222
  "text.advise_mt_date_is_empty": "advise mt date is empty",
1222
1223
  "text.all_related_serial_number_will_be_deleted": "[ko] all related serial number will be deleted!",
@@ -1193,6 +1193,7 @@
1193
1193
  "text.activate": "activate",
1194
1194
  "text.add_edit_products_has_been_submitted_for_approval": "[ms]add/edit order products has been submitted for approval",
1195
1195
  "text.add_extra_product": "add extra product",
1196
+ "text.add_edit_products_has_been_updated": "[ms]add/edit order products has been updated",
1196
1197
  "text.adjustment_pending_admin_approval": "adjustment pending admin approval",
1197
1198
  "text.advise_mt_date_is_empty": "advise mt date is empty",
1198
1199
  "text.all_related_serial_number_will_be_deleted": "[ms] all related serial number will be deleted!",
@@ -1159,6 +1159,7 @@
1159
1159
  "text.activate": "activate",
1160
1160
  "text.add_edit_products_has_been_submitted_for_approval": "[zh]add/edit order products has been submitted for approval",
1161
1161
  "text.add_extra_product": "add extra product",
1162
+ "text.add_edit_products_has_been_updated": "[zh]add/edit order products has been updated",
1162
1163
  "text.adjustment_pending_admin_approval": "adjustment pending admin approval",
1163
1164
  "text.advise_mt_date_is_empty": "advise mt date is empty",
1164
1165
  "text.all_related_serial_number_will_be_deleted": "[zh] all related serial number will be deleted!",