@things-factory/worksheet-base 4.3.637 → 4.3.639
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/dist-server/controllers/inbound/unloading-worksheet-controller.js +24 -14
- package/dist-server/controllers/inbound/unloading-worksheet-controller.js.map +1 -1
- package/dist-server/controllers/inspect/cycle-count-worksheet-controller.js +1 -5
- package/dist-server/controllers/inspect/cycle-count-worksheet-controller.js.map +1 -1
- package/dist-server/controllers/outbound/loading-worksheet-controller.js +9 -1
- package/dist-server/controllers/outbound/loading-worksheet-controller.js.map +1 -1
- package/dist-server/controllers/outbound/packing-worksheet-controller.js +10 -23
- package/dist-server/controllers/outbound/packing-worksheet-controller.js.map +1 -1
- package/dist-server/controllers/outbound/picking-worksheet-controller.js +6 -7
- package/dist-server/controllers/outbound/picking-worksheet-controller.js.map +1 -1
- package/dist-server/controllers/outbound/returning-worksheet-controller.js +1 -1
- package/dist-server/controllers/outbound/returning-worksheet-controller.js.map +1 -1
- package/dist-server/controllers/outbound/sorting-worksheet-controller.js +1 -7
- package/dist-server/controllers/outbound/sorting-worksheet-controller.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/batch-picking-worksheet.js +2 -5
- package/dist-server/graphql/resolvers/worksheet/batch-picking-worksheet.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/confirm-cancellation-release-order.js +23 -6
- package/dist-server/graphql/resolvers/worksheet/confirm-cancellation-release-order.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/inventories-by-pallet.js +1 -1
- package/dist-server/graphql/resolvers/worksheet/inventories-by-pallet.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/proceed-extra-products.js +6 -6
- package/dist-server/graphql/resolvers/worksheet/proceed-extra-products.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/worksheet.js +21 -96
- package/dist-server/graphql/resolvers/worksheet/worksheet.js.map +1 -1
- package/dist-server/graphql/types/worksheet/index.js +11 -11
- package/dist-server/graphql/types/worksheet/worksheet-detail-info.js +6 -7
- package/dist-server/graphql/types/worksheet/worksheet-detail-info.js.map +1 -1
- package/package.json +12 -12
- package/server/controllers/inbound/unloading-worksheet-controller.ts +47 -32
- package/server/controllers/inspect/cycle-count-worksheet-controller.ts +1 -6
- package/server/controllers/outbound/loading-worksheet-controller.ts +12 -1
- package/server/controllers/outbound/packing-worksheet-controller.ts +18 -30
- package/server/controllers/outbound/picking-worksheet-controller.ts +7 -10
- package/server/controllers/outbound/returning-worksheet-controller.ts +1 -1
- package/server/controllers/outbound/sorting-worksheet-controller.ts +1 -7
- package/server/graphql/resolvers/worksheet/batch-picking-worksheet.ts +14 -8
- package/server/graphql/resolvers/worksheet/confirm-cancellation-release-order.ts +26 -7
- package/server/graphql/resolvers/worksheet/inventories-by-pallet.ts +1 -2
- package/server/graphql/resolvers/worksheet/proceed-extra-products.ts +59 -65
- package/server/graphql/resolvers/worksheet/worksheet.ts +76 -117
- package/server/graphql/types/worksheet/index.ts +11 -11
- package/server/graphql/types/worksheet/worksheet-detail-info.ts +6 -7
|
@@ -1,11 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
getRepository,
|
|
3
|
+
SelectQueryBuilder
|
|
4
|
+
} from 'typeorm'
|
|
2
5
|
|
|
3
6
|
import { ORDER_INVENTORY_STATUS } from '@things-factory/sales-base'
|
|
4
7
|
import { Domain } from '@things-factory/shell'
|
|
5
8
|
import { InventoryChange } from '@things-factory/warehouse-base'
|
|
6
9
|
|
|
7
|
-
import {
|
|
8
|
-
|
|
10
|
+
import {
|
|
11
|
+
WORKSHEET_STATUS,
|
|
12
|
+
WORKSHEET_TYPE
|
|
13
|
+
} from '../../../constants'
|
|
14
|
+
import {
|
|
15
|
+
Worksheet,
|
|
16
|
+
WorksheetDetail
|
|
17
|
+
} from '../../../entities'
|
|
9
18
|
|
|
10
19
|
export const batchPickingWorksheetResolver = {
|
|
11
20
|
async batchPickingWorksheet(_: any, { taskNo, locationSortingRules }, context: any) {
|
|
@@ -34,7 +43,6 @@ export const batchPickingWorksheetResolver = {
|
|
|
34
43
|
.addSelect('"PROD".name', 'productName')
|
|
35
44
|
.addSelect('"PROD".sku', 'productSku')
|
|
36
45
|
.addSelect('"PROD".description', 'productDescription')
|
|
37
|
-
.addSelect('"PROD".is_inventory_decimal', 'isInventoryDecimal')
|
|
38
46
|
.addSelect('"PROD_DET".id', 'productDetailId')
|
|
39
47
|
.addSelect('"INV".qty', 'qty')
|
|
40
48
|
.addSelect('"INV".packing_type', 'packingType')
|
|
@@ -108,8 +116,7 @@ export const batchPickingWorksheetResolver = {
|
|
|
108
116
|
id: item?.productId,
|
|
109
117
|
name: item?.productName,
|
|
110
118
|
description: item?.productDescription,
|
|
111
|
-
sku: item?.productSku
|
|
112
|
-
isInventoryDecimal: item?.isInventoryDecimal
|
|
119
|
+
sku: item?.productSku
|
|
113
120
|
},
|
|
114
121
|
qty: item?.qty,
|
|
115
122
|
releaseQty: item.releaseQty,
|
|
@@ -128,8 +135,7 @@ export const batchPickingWorksheetResolver = {
|
|
|
128
135
|
id: item?.productId,
|
|
129
136
|
name: item?.productName,
|
|
130
137
|
description: item?.productDescription,
|
|
131
|
-
sku: item?.productSku
|
|
132
|
-
isInventoryDecimal: item?.isInventoryDecimal
|
|
138
|
+
sku: item?.productSku
|
|
133
139
|
},
|
|
134
140
|
productDetail: {
|
|
135
141
|
id: item?.productDetailId
|
|
@@ -24,8 +24,8 @@ import {
|
|
|
24
24
|
ProductDetailStock,
|
|
25
25
|
WebspertController
|
|
26
26
|
} from '@things-factory/warehouse-base'
|
|
27
|
-
|
|
28
27
|
import { Worksheet, WorksheetDetail } from '../../../entities'
|
|
28
|
+
import { getTmsService } from '@things-factory/integration-lmd'
|
|
29
29
|
|
|
30
30
|
export const confirmCancellationReleaseOrder = {
|
|
31
31
|
async confirmCancellationReleaseOrder(_: any, { name }, context: any) {
|
|
@@ -72,8 +72,8 @@ export const confirmCancellationReleaseOrder = {
|
|
|
72
72
|
.createQueryBuilder()
|
|
73
73
|
.update(Inventory)
|
|
74
74
|
.set({
|
|
75
|
-
qty: () => `COALESCE("qty", 0) + ${orderInventory.releaseQty}
|
|
76
|
-
uomValue: () => `COALESCE("uom_value", 0) + ${orderInventory.releaseUomValue}
|
|
75
|
+
qty: () => `COALESCE("qty", 0) + ${orderInventory.releaseQty}`,
|
|
76
|
+
uomValue: () => `COALESCE("uom_value", 0) + ${orderInventory.releaseUomValue}`,
|
|
77
77
|
status: INVENTORY_STATUS.STORED,
|
|
78
78
|
updater: user
|
|
79
79
|
})
|
|
@@ -111,12 +111,25 @@ export const confirmCancellationReleaseOrder = {
|
|
|
111
111
|
.createQueryBuilder()
|
|
112
112
|
.update(Inventory)
|
|
113
113
|
.set({
|
|
114
|
-
lockedQty: () => `COALESCE("locked_qty", 0) - ${orderInventory.releaseQty}
|
|
115
|
-
lockedUomValue: () => `COALESCE("locked_uom_value", 0) - ${orderInventory.releaseUomValue}
|
|
114
|
+
lockedQty: () => `COALESCE("locked_qty", 0) - ${orderInventory.releaseQty}`,
|
|
115
|
+
lockedUomValue: () => `COALESCE("locked_uom_value", 0) - ${orderInventory.releaseUomValue}`,
|
|
116
116
|
updater: user
|
|
117
117
|
})
|
|
118
118
|
.where('id = :id', { id: inventory.id })
|
|
119
119
|
.execute()
|
|
120
|
+
|
|
121
|
+
// @ChrisLim-git commented for further review as it causes qty to add into inventory
|
|
122
|
+
// await tx
|
|
123
|
+
// .createQueryBuilder()
|
|
124
|
+
// .update(Inventory)
|
|
125
|
+
// .set({
|
|
126
|
+
// qty: () => `COALESCE("qty", 0) + ${orderInventory.releaseQty}`,
|
|
127
|
+
// uomValue: () => `COALESCE("uom_value", 0) + ${orderInventory.releaseUomValue}`,
|
|
128
|
+
// status: INVENTORY_STATUS.STORED,
|
|
129
|
+
// updater: user
|
|
130
|
+
// })
|
|
131
|
+
// .where('id = :id', { id: inventory.id })
|
|
132
|
+
// .execute()
|
|
120
133
|
}
|
|
121
134
|
|
|
122
135
|
return orderInventory
|
|
@@ -258,8 +271,8 @@ export const confirmCancellationReleaseOrder = {
|
|
|
258
271
|
.createQueryBuilder()
|
|
259
272
|
.update(ProductDetailStock)
|
|
260
273
|
.set({
|
|
261
|
-
unassignedQty: () => `"unassigned_qty" - ${op.releaseQty}
|
|
262
|
-
unassignedUomValue: () => `"unassigned_uom_value" - ${op.releaseUomValue}
|
|
274
|
+
unassignedQty: () => `"unassigned_qty" - ${op.releaseQty}`,
|
|
275
|
+
unassignedUomValue: () => `"unassigned_uom_value" - ${op.releaseUomValue}`
|
|
263
276
|
})
|
|
264
277
|
.where({ productDetail: op.productDetail.id })
|
|
265
278
|
.execute()
|
|
@@ -268,6 +281,12 @@ export const confirmCancellationReleaseOrder = {
|
|
|
268
281
|
|
|
269
282
|
await updateStockForOrderInventories(targetOIs, releaseGood, domain, user, tx)
|
|
270
283
|
|
|
284
|
+
if (releaseGood.lastMileDelivery.isTms && releaseGood.lastMileDelivery.status === 'active') {
|
|
285
|
+
const tmsService = getTmsService(releaseGood.lastMileDelivery.platform)
|
|
286
|
+
|
|
287
|
+
tmsService.cancelShipment(releaseGood)
|
|
288
|
+
}
|
|
289
|
+
|
|
271
290
|
return
|
|
272
291
|
}
|
|
273
292
|
}
|
|
@@ -180,8 +180,7 @@ export const inventoriesByPalletResolver = {
|
|
|
180
180
|
productSKU: item.product.sku,
|
|
181
181
|
productBrand: item.product.brand,
|
|
182
182
|
productId: item.product.id,
|
|
183
|
-
productDetailId: item.productDetail.id
|
|
184
|
-
isInventoryDecimal: item.product.isInventoryDecimal,
|
|
183
|
+
productDetailId: item.productDetail.id
|
|
185
184
|
}
|
|
186
185
|
})
|
|
187
186
|
)
|
|
@@ -71,76 +71,70 @@ export const proceedExtraProductsResolver = {
|
|
|
71
71
|
)
|
|
72
72
|
|
|
73
73
|
if (editedApprovedProducts?.length > 0) {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
: ORDER_PRODUCT_STATUS.UNLOADING,
|
|
112
|
-
updater: user
|
|
113
|
-
})
|
|
74
|
+
editedApprovedProducts.map((editedApprovedProd: OrderProduct) => {
|
|
75
|
+
const selectedOrderProduct: OrderProduct = storedOrderProducts.find(
|
|
76
|
+
(op: OrderProduct) => op.id === editedApprovedProd.id
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
updatedOrderProducts.push({
|
|
80
|
+
...selectedOrderProduct,
|
|
81
|
+
batchId: selectedOrderProduct?.adjustedBatchId
|
|
82
|
+
? selectedOrderProduct.adjustedBatchId
|
|
83
|
+
: selectedOrderProduct.batchId,
|
|
84
|
+
batchIdRef: selectedOrderProduct?.adjustedBatchIdRef
|
|
85
|
+
? selectedOrderProduct.adjustedBatchIdRef
|
|
86
|
+
: selectedOrderProduct.batchIdRef,
|
|
87
|
+
packingType: selectedOrderProduct?.adjustedPackingType
|
|
88
|
+
? selectedOrderProduct.adjustedPackingType
|
|
89
|
+
: selectedOrderProduct.packingType,
|
|
90
|
+
packQty: selectedOrderProduct?.adjustedPackQty != null
|
|
91
|
+
? selectedOrderProduct.adjustedPackQty
|
|
92
|
+
: selectedOrderProduct.packQty,
|
|
93
|
+
uom: selectedOrderProduct?.adjustedUom ? selectedOrderProduct.adjustedUom : selectedOrderProduct.uom,
|
|
94
|
+
uomValue: selectedOrderProduct?.adjustedUomValue
|
|
95
|
+
? selectedOrderProduct.adjustedUomValue
|
|
96
|
+
: selectedOrderProduct.uomValue,
|
|
97
|
+
totalUomValue: (selectedOrderProduct?.adjustedTotalUomValue || selectedOrderProduct?.adjustedTotalUomValue === '')
|
|
98
|
+
? selectedOrderProduct.adjustedTotalUomValue
|
|
99
|
+
: selectedOrderProduct.totalUomValue,
|
|
100
|
+
palletQty: selectedOrderProduct?.adjustedPalletQty
|
|
101
|
+
? selectedOrderProduct.adjustedPalletQty
|
|
102
|
+
: selectedOrderProduct.palletQty,
|
|
103
|
+
unitPrice: selectedOrderProduct?.adjustedUnitPrice
|
|
104
|
+
? selectedOrderProduct.adjustedUnitPrice
|
|
105
|
+
: selectedOrderProduct.unitPrice,
|
|
106
|
+
status:
|
|
107
|
+
worksheet.status === WORKSHEET_STATUS.DEACTIVATED
|
|
108
|
+
? ORDER_PRODUCT_STATUS.READY_TO_UNLOAD
|
|
109
|
+
: ORDER_PRODUCT_STATUS.UNLOADING,
|
|
110
|
+
updater: user
|
|
114
111
|
})
|
|
115
|
-
)
|
|
112
|
+
})
|
|
116
113
|
}
|
|
117
114
|
|
|
118
115
|
if (addedApprovedProducts?.length > 0) {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
: ORDER_PRODUCT_STATUS.UNLOADING,
|
|
140
|
-
updater: user
|
|
141
|
-
})
|
|
116
|
+
addedApprovedProducts.map((addedApprovedProd: OrderProduct) => {
|
|
117
|
+
const selectedOrderProduct: OrderProduct = storedOrderProducts.find(
|
|
118
|
+
(op: OrderProduct) => op.id === addedApprovedProd.id
|
|
119
|
+
)
|
|
120
|
+
updatedOrderProducts.push({
|
|
121
|
+
...selectedOrderProduct,
|
|
122
|
+
batchId: selectedOrderProduct.adjustedBatchId,
|
|
123
|
+
batchIdRef: selectedOrderProduct.adjustedBatchIdRef,
|
|
124
|
+
packingType: selectedOrderProduct.adjustedPackingType,
|
|
125
|
+
packQty: selectedOrderProduct.adjustedPackQty,
|
|
126
|
+
uom: selectedOrderProduct.adjustedUom,
|
|
127
|
+
uomValue: selectedOrderProduct.adjustedUomValue,
|
|
128
|
+
totalUomValue: selectedOrderProduct.adjustedTotalUomValue,
|
|
129
|
+
palletQty: selectedOrderProduct.adjustedPalletQty,
|
|
130
|
+
unitPrice: selectedOrderProduct.adjustedUnitPrice,
|
|
131
|
+
status:
|
|
132
|
+
worksheet.status === WORKSHEET_STATUS.DEACTIVATED
|
|
133
|
+
? ORDER_PRODUCT_STATUS.READY_TO_UNLOAD
|
|
134
|
+
: ORDER_PRODUCT_STATUS.UNLOADING,
|
|
135
|
+
updater: user
|
|
142
136
|
})
|
|
143
|
-
)
|
|
137
|
+
})
|
|
144
138
|
}
|
|
145
139
|
|
|
146
140
|
debug('approved and updated order product', updatedOrderProducts)
|
|
@@ -1,18 +1,10 @@
|
|
|
1
1
|
import { Equal, getRepository, Not } from 'typeorm'
|
|
2
2
|
|
|
3
3
|
import { MarketplaceOrder, MarketplaceOrderShipping } from '@things-factory/marketplace-base'
|
|
4
|
-
import {
|
|
5
|
-
ArrivalNotice,
|
|
6
|
-
ORDER_INVENTORY_STATUS,
|
|
7
|
-
OrderInventory,
|
|
8
|
-
OrderProduct,
|
|
9
|
-
OrderVas,
|
|
10
|
-
ReleaseGood
|
|
11
|
-
} from '@things-factory/sales-base'
|
|
4
|
+
import { ORDER_INVENTORY_STATUS, OrderInventory, OrderProduct, OrderVas } from '@things-factory/sales-base'
|
|
12
5
|
import { Setting } from '@things-factory/setting-base'
|
|
13
6
|
import { Domain } from '@things-factory/shell'
|
|
14
7
|
import { Inventory, INVENTORY_STATUS, InventoryHistory } from '@things-factory/warehouse-base'
|
|
15
|
-
import { Bizplace } from '@things-factory/biz-base'
|
|
16
8
|
|
|
17
9
|
import { WORKSHEET_TYPE } from '../../../constants'
|
|
18
10
|
import { Worksheet, WorksheetDetail } from '../../../entities'
|
|
@@ -39,38 +31,80 @@ export const worksheetResolver = {
|
|
|
39
31
|
|
|
40
32
|
let worksheetRelations: string[] = []
|
|
41
33
|
|
|
42
|
-
|
|
43
|
-
'PICKING'
|
|
44
|
-
'BATCH_PICKING'
|
|
45
|
-
'LOADING'
|
|
46
|
-
'PACKING'
|
|
47
|
-
'PICKING_REPLENISHMENT'
|
|
48
|
-
'SORTING'
|
|
49
|
-
'WAREHOUSE_RETURN'
|
|
50
|
-
'PUTAWAY_RETURN'
|
|
51
|
-
'UNLOADING_RETURN'
|
|
52
|
-
'PUTAWAY_REPLENISHMENT'
|
|
53
|
-
'VAS'
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
34
|
+
switch (thisWorksheet?.type) {
|
|
35
|
+
case 'PICKING':
|
|
36
|
+
case 'BATCH_PICKING':
|
|
37
|
+
case 'LOADING':
|
|
38
|
+
case 'PACKING':
|
|
39
|
+
case 'PICKING_REPLENISHMENT':
|
|
40
|
+
case 'SORTING':
|
|
41
|
+
case 'WAREHOUSE_RETURN':
|
|
42
|
+
case 'PUTAWAY_RETURN':
|
|
43
|
+
case 'UNLOADING_RETURN':
|
|
44
|
+
case 'PUTAWAY_REPLENISHMENT':
|
|
45
|
+
case 'VAS':
|
|
46
|
+
worksheetRelations.push(
|
|
47
|
+
'domain',
|
|
48
|
+
'bizplace',
|
|
49
|
+
'bizplace.domain',
|
|
50
|
+
'bufferLocation',
|
|
51
|
+
'bufferLocation.warehouse',
|
|
52
|
+
'arrivalNotice',
|
|
53
|
+
'arrivalNotice.releaseGood',
|
|
54
|
+
'releaseGood',
|
|
55
|
+
'releaseGood.arrivalNotice',
|
|
56
|
+
'releaseGood.shippingOrder',
|
|
57
|
+
'releaseGood.orderPackages',
|
|
58
|
+
'releaseGood.orderProducts',
|
|
59
|
+
'releaseGood.orderProducts.product',
|
|
60
|
+
'replenishment',
|
|
61
|
+
'returnOrder',
|
|
62
|
+
'inventoryCheck',
|
|
63
|
+
'vasOrder',
|
|
64
|
+
'assignee',
|
|
65
|
+
'worksheetDetails',
|
|
66
|
+
'worksheetDetails.targetProduct',
|
|
67
|
+
'worksheetDetails.targetProduct.product',
|
|
68
|
+
'worksheetDetails.targetProduct.releaseGood',
|
|
69
|
+
'worksheetDetails.targetInventory',
|
|
70
|
+
'worksheetDetails.targetInventory.bizplace',
|
|
71
|
+
'worksheetDetails.targetInventory.releaseGood',
|
|
72
|
+
'worksheetDetails.targetInventory.product',
|
|
73
|
+
'worksheetDetails.targetInventory.inventory',
|
|
74
|
+
'worksheetDetails.targetInventory.inventory.product',
|
|
75
|
+
'worksheetDetails.targetInventory.inventory.warehouse',
|
|
76
|
+
'worksheetDetails.targetInventory.inventory.location',
|
|
77
|
+
'worksheetDetails.targetVas',
|
|
78
|
+
'worksheetDetails.targetVas.product',
|
|
79
|
+
'worksheetDetails.targetVas.newProduct',
|
|
80
|
+
'worksheetDetails.targetVas.newProductDetail',
|
|
81
|
+
'worksheetDetails.targetVas.orderVasItems',
|
|
82
|
+
'worksheetDetails.targetVas.orderVasItems.vas',
|
|
83
|
+
'creator',
|
|
84
|
+
'updater'
|
|
85
|
+
)
|
|
86
|
+
break
|
|
87
|
+
|
|
88
|
+
case 'UNLOADING':
|
|
89
|
+
worksheetRelations.push(
|
|
90
|
+
'worksheetDetails',
|
|
91
|
+
'worksheetDetails.toLocation',
|
|
92
|
+
'worksheetDetails.targetProduct',
|
|
93
|
+
'worksheetDetails.targetProduct.product',
|
|
94
|
+
'worksheetDetails.targetProduct.releaseGood',
|
|
95
|
+
'worksheetDetails.targetVas.product',
|
|
96
|
+
'worksheetDetails.targetVas.newProduct',
|
|
97
|
+
'worksheetDetails.targetVas.newProductDetail',
|
|
98
|
+
'worksheetDetails.targetVas.orderVasItems',
|
|
99
|
+
'worksheetDetails.targetVas.orderVasItems.vas',
|
|
100
|
+
'worksheetDetails.targetInventory.releaseGood',
|
|
101
|
+
'worksheetDetails.targetInventory.inspectedLocation'
|
|
102
|
+
)
|
|
103
|
+
break
|
|
104
|
+
|
|
105
|
+
default:
|
|
106
|
+
// Default case if the name doesn't match any defined case
|
|
107
|
+
break
|
|
74
108
|
}
|
|
75
109
|
|
|
76
110
|
worksheet = (await getRepository(Worksheet).findOne({
|
|
@@ -81,82 +115,7 @@ export const worksheetResolver = {
|
|
|
81
115
|
relations: worksheetRelations
|
|
82
116
|
})) as WorksheetInterface
|
|
83
117
|
|
|
84
|
-
if (worksheet) {
|
|
85
|
-
if (thisWorksheet.type === 'UNLOADING') {
|
|
86
|
-
worksheet.worksheetDetails = await getRepository(WorksheetDetail).find({
|
|
87
|
-
where: {
|
|
88
|
-
domain,
|
|
89
|
-
worksheet: worksheet.id
|
|
90
|
-
},
|
|
91
|
-
relations: [
|
|
92
|
-
'toLocation',
|
|
93
|
-
'targetProduct',
|
|
94
|
-
'targetProduct.product',
|
|
95
|
-
'targetProduct.releaseGood',
|
|
96
|
-
'targetVas.product',
|
|
97
|
-
'targetVas.newProduct',
|
|
98
|
-
'targetVas.newProductDetail',
|
|
99
|
-
'targetVas.orderVasItems',
|
|
100
|
-
'targetVas.orderVasItems.vas',
|
|
101
|
-
'targetInventory.releaseGood',
|
|
102
|
-
'targetInventory.inspectedLocation'
|
|
103
|
-
]
|
|
104
|
-
})
|
|
105
|
-
} else if (otherWorksheetTypes.includes(thisWorksheet.type)) {
|
|
106
|
-
const [bizplace, bufferLocation, arrivalNotice, releaseGood, worksheetDetails] = await Promise.all([
|
|
107
|
-
getRepository(Bizplace).findOne({
|
|
108
|
-
where: { id: worksheet.bizplace.id },
|
|
109
|
-
relations: ['domain']
|
|
110
|
-
}),
|
|
111
|
-
worksheet.bufferLocation
|
|
112
|
-
? getRepository(Inventory).findOne({
|
|
113
|
-
where: { id: worksheet.bufferLocation.id },
|
|
114
|
-
relations: ['warehouse']
|
|
115
|
-
})
|
|
116
|
-
: null,
|
|
117
|
-
worksheet.arrivalNotice
|
|
118
|
-
? getRepository(ArrivalNotice).findOne({
|
|
119
|
-
where: { id: worksheet.arrivalNotice.id },
|
|
120
|
-
relations: ['releaseGood']
|
|
121
|
-
})
|
|
122
|
-
: null,
|
|
123
|
-
worksheet.releaseGood
|
|
124
|
-
? getRepository(ReleaseGood).findOne({
|
|
125
|
-
where: { id: worksheet.releaseGood.id },
|
|
126
|
-
relations: ['arrivalNotice', 'shippingOrder', 'orderPackages', 'orderProducts', 'orderProducts.product']
|
|
127
|
-
})
|
|
128
|
-
: null,
|
|
129
|
-
getRepository(WorksheetDetail).find({
|
|
130
|
-
where: { domain, worksheet: worksheet.id },
|
|
131
|
-
relations: [
|
|
132
|
-
'targetProduct',
|
|
133
|
-
'targetProduct.product',
|
|
134
|
-
'targetProduct.releaseGood',
|
|
135
|
-
'targetInventory',
|
|
136
|
-
'targetInventory.bizplace',
|
|
137
|
-
'targetInventory.releaseGood',
|
|
138
|
-
'targetInventory.product',
|
|
139
|
-
'targetInventory.inventory',
|
|
140
|
-
'targetInventory.inventory.product',
|
|
141
|
-
'targetInventory.inventory.warehouse',
|
|
142
|
-
'targetInventory.inventory.location',
|
|
143
|
-
'targetVas',
|
|
144
|
-
'targetVas.product',
|
|
145
|
-
'targetVas.newProduct',
|
|
146
|
-
'targetVas.newProductDetail',
|
|
147
|
-
'targetVas.orderVasItems',
|
|
148
|
-
'targetVas.orderVasItems.vas'
|
|
149
|
-
]
|
|
150
|
-
})
|
|
151
|
-
])
|
|
152
|
-
|
|
153
|
-
worksheet.bizplace = bizplace
|
|
154
|
-
worksheet.bufferLocation = bufferLocation
|
|
155
|
-
worksheet.arrivalNotice = arrivalNotice
|
|
156
|
-
worksheet.releaseGood = releaseGood
|
|
157
|
-
worksheet.worksheetDetails = worksheetDetails
|
|
158
|
-
}
|
|
159
|
-
} else {
|
|
118
|
+
if (!worksheet) {
|
|
160
119
|
worksheet = (await getRepository(Worksheet).findOne({
|
|
161
120
|
where: {
|
|
162
121
|
domain,
|
|
@@ -379,7 +379,7 @@ export const Mutation = /* GraphQL */ `
|
|
|
379
379
|
palletId: String
|
|
380
380
|
cartonId: String
|
|
381
381
|
locationName: String!
|
|
382
|
-
releaseQty:
|
|
382
|
+
releaseQty: Int!
|
|
383
383
|
binLocation: String
|
|
384
384
|
serialNumber: String
|
|
385
385
|
toteNo: String
|
|
@@ -393,7 +393,7 @@ export const Mutation = /* GraphQL */ `
|
|
|
393
393
|
binLocation: String
|
|
394
394
|
serialNumber: String
|
|
395
395
|
toteNo: String
|
|
396
|
-
pickingQty:
|
|
396
|
+
pickingQty: Int
|
|
397
397
|
): Boolean @privilege(category: "worksheet_execute", privilege: "mutation") @transaction
|
|
398
398
|
|
|
399
399
|
replenishmentPicking (
|
|
@@ -403,7 +403,7 @@ export const Mutation = /* GraphQL */ `
|
|
|
403
403
|
cartonId: String!
|
|
404
404
|
binLocation: String
|
|
405
405
|
serialNumber: String
|
|
406
|
-
pickingQty:
|
|
406
|
+
pickingQty: Int
|
|
407
407
|
): Boolean @privilege(category: "worksheet_execute", privilege: "mutation") @transaction
|
|
408
408
|
|
|
409
409
|
sortingProduct (
|
|
@@ -444,7 +444,7 @@ export const Mutation = /* GraphQL */ `
|
|
|
444
444
|
palletId: String!
|
|
445
445
|
locationName: String
|
|
446
446
|
binLocationName: String
|
|
447
|
-
releaseQty:
|
|
447
|
+
releaseQty: Int!
|
|
448
448
|
): Boolean @privilege(category: "worksheet_execute", privilege: "mutation") @transaction
|
|
449
449
|
|
|
450
450
|
scanProductBatchPicking (
|
|
@@ -454,21 +454,21 @@ export const Mutation = /* GraphQL */ `
|
|
|
454
454
|
productBarcode: String!
|
|
455
455
|
inventory: InventoryPatch!
|
|
456
456
|
binLocationName: String
|
|
457
|
-
pickingQty:
|
|
457
|
+
pickingQty: Int
|
|
458
458
|
): Boolean @privilege(category: "worksheet_execute", privilege: "mutation") @transaction
|
|
459
459
|
|
|
460
460
|
crossDockPicking (
|
|
461
461
|
worksheetDetailName: String!
|
|
462
462
|
worksheetType: String!
|
|
463
463
|
palletId: String!
|
|
464
|
-
releaseQty:
|
|
464
|
+
releaseQty: Int!
|
|
465
465
|
): Boolean @privilege(category: "worksheet_execute", privilege: "mutation") @transaction
|
|
466
466
|
|
|
467
467
|
|
|
468
468
|
inspectingPallet (
|
|
469
469
|
worksheetDetailName: String!
|
|
470
470
|
inspectedBatchNo: String!
|
|
471
|
-
inspectedQty:
|
|
471
|
+
inspectedQty: Int!
|
|
472
472
|
inspectedUomValue: Float!
|
|
473
473
|
inspectedExpirationDate: Date
|
|
474
474
|
): Boolean @privilege(category: "worksheet_execute", privilege: "mutation") @transaction
|
|
@@ -479,7 +479,7 @@ export const Mutation = /* GraphQL */ `
|
|
|
479
479
|
batchId: String!
|
|
480
480
|
locationId: String!
|
|
481
481
|
inspectedBatchNo: String!
|
|
482
|
-
inspectedQty:
|
|
482
|
+
inspectedQty: Int!
|
|
483
483
|
inspectedUomValue: Float!
|
|
484
484
|
inspectedExpirationDate: Date
|
|
485
485
|
): Boolean @privilege(category: "worksheet_execute", privilege: "mutation") @transaction
|
|
@@ -511,7 +511,7 @@ export const Mutation = /* GraphQL */ `
|
|
|
511
511
|
relocateInventory (
|
|
512
512
|
worksheetDetailName: String!
|
|
513
513
|
inspectedBatchNo: String!
|
|
514
|
-
inspectedQty:
|
|
514
|
+
inspectedQty: Int!
|
|
515
515
|
inspectedUomValue: Float!
|
|
516
516
|
inspectedLocationName: String!
|
|
517
517
|
): Boolean @privilege(category: "worksheet_execute", privilege: "mutation") @transaction
|
|
@@ -522,7 +522,7 @@ export const Mutation = /* GraphQL */ `
|
|
|
522
522
|
batchId: String!
|
|
523
523
|
locationId: String!
|
|
524
524
|
inspectedBatchNo: String!
|
|
525
|
-
inspectedQty:
|
|
525
|
+
inspectedQty: Int!
|
|
526
526
|
inspectedUomValue: Float!
|
|
527
527
|
inspectedLocationName: String!
|
|
528
528
|
): Boolean @privilege(category: "worksheet_execute", privilege: "mutation") @transaction
|
|
@@ -533,7 +533,7 @@ export const Mutation = /* GraphQL */ `
|
|
|
533
533
|
productDetailId: String!
|
|
534
534
|
productId: String!
|
|
535
535
|
inspectedBatchNo: String!
|
|
536
|
-
inspectedQty:
|
|
536
|
+
inspectedQty: Int!
|
|
537
537
|
inspectedUomValue: Float!
|
|
538
538
|
countNo: Int!
|
|
539
539
|
inspectedExpirationDate: Date
|
|
@@ -19,12 +19,12 @@ export const WorksheetDetailInfo = gql`
|
|
|
19
19
|
expirationDate: String
|
|
20
20
|
palletQty: Int
|
|
21
21
|
actualPalletQty: Int
|
|
22
|
-
packQty:
|
|
23
|
-
actualPackQty:
|
|
22
|
+
packQty: Int
|
|
23
|
+
actualPackQty: Int
|
|
24
24
|
adjustedPalletQty: Int
|
|
25
25
|
adjustedBatchId: String
|
|
26
26
|
sku: String
|
|
27
|
-
qty:
|
|
27
|
+
qty: Int
|
|
28
28
|
uom: String
|
|
29
29
|
uomValue: Float
|
|
30
30
|
releaseQty: Float
|
|
@@ -33,14 +33,13 @@ export const WorksheetDetailInfo = gql`
|
|
|
33
33
|
sortedQty: Float
|
|
34
34
|
releaseUomValue: Float
|
|
35
35
|
inspectedBatchNo: String
|
|
36
|
-
originQty:
|
|
36
|
+
originQty: Int
|
|
37
37
|
originUomValue: Float
|
|
38
38
|
originExpirationDate: String
|
|
39
|
-
inspectedQty:
|
|
39
|
+
inspectedQty: Int
|
|
40
40
|
inspectedUomValue: Float
|
|
41
41
|
inspectedExpirationDate: String
|
|
42
42
|
inspectedLocation: Location
|
|
43
|
-
isInventoryDecimal: Boolean
|
|
44
43
|
operationGuide: String
|
|
45
44
|
set: Int
|
|
46
45
|
targetType: String
|
|
@@ -66,7 +65,7 @@ export const WorksheetDetailInfo = gql`
|
|
|
66
65
|
relatedInvCheckItem: InventoryCheckItem
|
|
67
66
|
targetInventoryCheckItem: InventoryCheckItem
|
|
68
67
|
releaseGood: ReleaseGood
|
|
69
|
-
actualQty:
|
|
68
|
+
actualQty: Int
|
|
70
69
|
actualUomValue: Float
|
|
71
70
|
manufactureDate: String
|
|
72
71
|
binRemarks: String
|