@things-factory/operato-wms 4.3.27 → 4.3.28

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/operato-wms",
3
- "version": "4.3.27",
3
+ "version": "4.3.28",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -92,7 +92,7 @@
92
92
  "@things-factory/print-ui": "^4.3.27",
93
93
  "@things-factory/product-base": "^4.3.27",
94
94
  "@things-factory/resource-ui": "^4.3.27",
95
- "@things-factory/sales-ui": "^4.3.27",
95
+ "@things-factory/sales-ui": "^4.3.28",
96
96
  "@things-factory/scene-data-transform": "^4.3.27",
97
97
  "@things-factory/scene-excel": "^4.3.27",
98
98
  "@things-factory/scene-firebase": "^4.3.27",
@@ -108,8 +108,8 @@
108
108
  "@things-factory/system-ui": "^4.3.27",
109
109
  "@things-factory/transport-base": "^4.3.27",
110
110
  "@things-factory/tutorial-ui": "^4.3.27",
111
- "@things-factory/warehouse-base": "^4.3.27",
112
- "@things-factory/worksheet-base": "^4.3.27"
111
+ "@things-factory/warehouse-base": "^4.3.28",
112
+ "@things-factory/worksheet-base": "^4.3.28"
113
113
  },
114
114
  "devDependencies": {
115
115
  "@things-factory/builder": "^4.3.27",
@@ -118,5 +118,5 @@
118
118
  "cypress-localstorage-commands": "^1.6.1",
119
119
  "eslint-plugin-cypress": "^2.12.1"
120
120
  },
121
- "gitHead": "52398bed65c4cf97263cd983c2c518e882ddbcde"
121
+ "gitHead": "f1af695e2848b49871ca1d4f1661a5620ed428da"
122
122
  }
@@ -3,9 +3,16 @@ import { EntityManager } from 'typeorm'
3
3
  import { User } from '@things-factory/auth-base'
4
4
  import { Bizplace } from '@things-factory/biz-base'
5
5
  import { Product } from '@things-factory/product-base'
6
- import { ORDER_INVENTORY_STATUS, OrderInventory, OrderNoGenerator, ReleaseGood } from '@things-factory/sales-base'
6
+ import {
7
+ ORDER_INVENTORY_STATUS,
8
+ ORDER_PRODUCT_STATUS,
9
+ OrderInventory,
10
+ OrderNoGenerator,
11
+ OrderProduct,
12
+ ReleaseGood
13
+ } from '@things-factory/sales-base'
7
14
  import { Domain } from '@things-factory/shell'
8
- import { Inventory, INVENTORY_TRANSACTION_TYPE, InventoryHistory } from '@things-factory/warehouse-base'
15
+ import { Inventory } from '@things-factory/warehouse-base'
9
16
  import {
10
17
  generatePickingWorksheetDetail,
11
18
  Worksheet,
@@ -49,14 +56,6 @@ export const addReleaseGoodProducts = {
49
56
  const foundInv: Inventory = await tx.getRepository(Inventory).findOne(curOrderInv.inventory.id)
50
57
  curOrderInv.inventory = foundInv
51
58
 
52
- let foundPickingHistory: InventoryHistory = await tx.getRepository(InventoryHistory).findOne({
53
- where: {
54
- refOrderId: releaseGood.id,
55
- palletId: foundInv.palletId,
56
- transactionType: INVENTORY_TRANSACTION_TYPE.PICKING
57
- }
58
- })
59
-
60
59
  existingOrderInv = await tx.getRepository(OrderInventory).findOne({
61
60
  where: {
62
61
  releaseGood,
@@ -141,14 +140,12 @@ export const addReleaseGoodProducts = {
141
140
  await tx.getRepository(Inventory).save(foundInv)
142
141
 
143
142
  if (existingOrderInv) {
144
- const orderInvStatus = ORDER_INVENTORY_STATUS.PICKING
145
-
146
143
  // if found existing OrderInventory and worksheetDetail then qty, uomValue, and status are updated
147
144
  curOrderInv = {
148
145
  ...existingOrderInv,
149
146
  releaseQty: curOrderInv.releaseQty,
150
147
  releaseUomValue: curOrderInv.releaseUomValue,
151
- status: orderInvStatus
148
+ status: ORDER_INVENTORY_STATUS.PICKING
152
149
  }
153
150
 
154
151
  let existingWorksheetDetail: WorksheetDetail = await tx.getRepository(WorksheetDetail).findOne({
@@ -234,6 +231,18 @@ export const addReleaseGoodProducts = {
234
231
  foundInv.lockedUomValue = Number(foundInv.lockedUomValue) + newOrderInv.releaseUomValue
235
232
  foundInv.updater = user
236
233
 
234
+ let newOrderProduct: OrderProduct = Object.assign(new OrderProduct(), newOrderInv)
235
+ newOrderProduct = {
236
+ ...newOrderProduct,
237
+ packQty: 0,
238
+ actualPackQty: 0,
239
+ palletQty: 0,
240
+ actualPalletQty: 0,
241
+ status: ORDER_PRODUCT_STATUS.ASSIGNED
242
+ }
243
+
244
+ newOrderProduct = await tx.getRepository(OrderProduct).save(newOrderProduct)
245
+
237
246
  await tx.getRepository(Inventory).save(foundInv)
238
247
  } else {
239
248
  // check for existing released OrderInventory specifying product, batchId and packingType