@things-factory/worksheet-base 4.0.10 → 4.0.14
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/constants/template.js +1 -0
- package/dist-server/constants/template.js.map +1 -1
- package/dist-server/controllers/ecommerce/sellercraft-controller.js +3 -3
- package/dist-server/controllers/ecommerce/sellercraft-controller.js.map +1 -1
- package/dist-server/controllers/inbound/putaway-worksheet-controller.js +24 -5
- package/dist-server/controllers/inbound/putaway-worksheet-controller.js.map +1 -1
- package/dist-server/controllers/inbound/unloading-worksheet-controller.js +67 -28
- package/dist-server/controllers/inbound/unloading-worksheet-controller.js.map +1 -1
- package/dist-server/controllers/index.js +1 -0
- package/dist-server/controllers/index.js.map +1 -1
- package/dist-server/controllers/outbound/loading-worksheet-controller.js +4 -0
- package/dist-server/controllers/outbound/loading-worksheet-controller.js.map +1 -1
- package/dist-server/controllers/outbound/packing-worksheet-controller.js +1 -3
- package/dist-server/controllers/outbound/packing-worksheet-controller.js.map +1 -1
- package/dist-server/controllers/outbound/picking-worksheet-controller.js +159 -116
- package/dist-server/controllers/outbound/picking-worksheet-controller.js.map +1 -1
- package/dist-server/controllers/render-elccl-grn.js +6 -6
- package/dist-server/controllers/render-elccl-grn.js.map +1 -1
- package/dist-server/controllers/render-manifest.js +64 -0
- package/dist-server/controllers/render-manifest.js.map +1 -0
- package/dist-server/controllers/worksheet-controller.js +28 -2
- package/dist-server/controllers/worksheet-controller.js.map +1 -1
- package/dist-server/graphql/resolvers/pallet/index.js +2 -1
- package/dist-server/graphql/resolvers/pallet/index.js.map +1 -1
- package/dist-server/graphql/resolvers/pallet/pallet-outbound.js +1 -1
- package/dist-server/graphql/resolvers/pallet/pallet-outbound.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/inventories-by-pallet.js +6 -5
- package/dist-server/graphql/resolvers/worksheet/inventories-by-pallet.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/loading-worksheet.js +23 -2
- package/dist-server/graphql/resolvers/worksheet/loading-worksheet.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/packing-worksheet.js +22 -0
- package/dist-server/graphql/resolvers/worksheet/packing-worksheet.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/pending-cancellation-release-order.js +6 -3
- package/dist-server/graphql/resolvers/worksheet/pending-cancellation-release-order.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/picking/activate-picking.js +0 -4
- package/dist-server/graphql/resolvers/worksheet/picking/activate-picking.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/picking/complete-picking.js +30 -5
- package/dist-server/graphql/resolvers/worksheet/picking/complete-picking.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/picking/fetch-and-assign-picking-task.js +72 -0
- package/dist-server/graphql/resolvers/worksheet/picking/fetch-and-assign-picking-task.js.map +1 -0
- package/dist-server/graphql/resolvers/worksheet/picking/index.js +2 -1
- package/dist-server/graphql/resolvers/worksheet/picking/index.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/picking/picking.js +4 -4
- package/dist-server/graphql/resolvers/worksheet/picking/picking.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/picking/scan-product-picking.js +4 -4
- package/dist-server/graphql/resolvers/worksheet/picking/scan-product-picking.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/picking-worksheet.js +86 -57
- package/dist-server/graphql/resolvers/worksheet/picking-worksheet.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/recommend-putway-location.js +2 -2
- package/dist-server/graphql/resolvers/worksheet/recommend-putway-location.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/unloaded-inventories.js +6 -1
- package/dist-server/graphql/resolvers/worksheet/unloaded-inventories.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/unloading-return-worksheet.js +2 -2
- package/dist-server/graphql/resolvers/worksheet/unloading-return-worksheet.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet-detail/generate-release-good-worksheet-details.js +48 -44
- package/dist-server/graphql/resolvers/worksheet-detail/generate-release-good-worksheet-details.js.map +1 -1
- package/dist-server/graphql/types/index.js +9 -4
- package/dist-server/graphql/types/index.js.map +1 -1
- package/dist-server/graphql/types/pallet/index.js +6 -3
- package/dist-server/graphql/types/pallet/index.js.map +1 -1
- package/dist-server/graphql/types/pallet/pallet.js +10 -0
- package/dist-server/graphql/types/pallet/pallet.js.map +1 -0
- package/dist-server/graphql/types/worksheet/index.js +7 -1
- package/dist-server/graphql/types/worksheet/index.js.map +1 -1
- package/dist-server/index.js +1 -0
- package/dist-server/index.js.map +1 -1
- package/dist-server/routes.js +4 -0
- package/dist-server/routes.js.map +1 -1
- package/dist-server/utils/inventory-util.js +29 -4
- package/dist-server/utils/inventory-util.js.map +1 -1
- package/package.json +16 -16
- package/server/constants/template.ts +1 -0
- package/server/controllers/ecommerce/sellercraft-controller.ts +3 -3
- package/server/controllers/inbound/putaway-worksheet-controller.ts +29 -8
- package/server/controllers/inbound/unloading-worksheet-controller.ts +83 -29
- package/server/controllers/index.ts +1 -0
- package/server/controllers/outbound/loading-worksheet-controller.ts +20 -0
- package/server/controllers/outbound/packing-worksheet-controller.ts +3 -5
- package/server/controllers/outbound/picking-worksheet-controller.ts +206 -154
- package/server/controllers/render-elccl-grn.ts +8 -6
- package/server/controllers/render-manifest.ts +68 -0
- package/server/controllers/worksheet-controller.ts +41 -2
- package/server/graphql/resolvers/pallet/index.ts +2 -0
- package/server/graphql/resolvers/pallet/pallet-outbound.ts +1 -2
- package/server/graphql/resolvers/worksheet/inventories-by-pallet.ts +10 -8
- package/server/graphql/resolvers/worksheet/loading-worksheet.ts +30 -4
- package/server/graphql/resolvers/worksheet/packing-worksheet.ts +28 -3
- package/server/graphql/resolvers/worksheet/pending-cancellation-release-order.ts +13 -7
- package/server/graphql/resolvers/worksheet/picking/activate-picking.ts +1 -6
- package/server/graphql/resolvers/worksheet/picking/complete-picking.ts +35 -4
- package/server/graphql/resolvers/worksheet/picking/fetch-and-assign-picking-task.ts +78 -0
- package/server/graphql/resolvers/worksheet/picking/index.ts +3 -1
- package/server/graphql/resolvers/worksheet/picking/picking.ts +6 -4
- package/server/graphql/resolvers/worksheet/picking/scan-product-picking.ts +7 -4
- package/server/graphql/resolvers/worksheet/picking-worksheet.ts +102 -62
- package/server/graphql/resolvers/worksheet/recommend-putway-location.ts +4 -2
- package/server/graphql/resolvers/worksheet/unloaded-inventories.ts +10 -1
- package/server/graphql/resolvers/worksheet/unloading-return-worksheet.ts +6 -4
- package/server/graphql/resolvers/worksheet-detail/generate-release-good-worksheet-details.ts +102 -76
- package/server/graphql/types/index.ts +9 -4
- package/server/graphql/types/pallet/index.ts +8 -2
- package/server/graphql/types/pallet/pallet.ts +7 -0
- package/server/graphql/types/worksheet/index.ts +8 -2
- package/server/index.ts +1 -0
- package/server/routes.ts +5 -0
- package/server/utils/inventory-util.ts +31 -9
|
@@ -81,8 +81,6 @@ export class UnloadingWorksheetController extends VasWorksheetController {
|
|
|
81
81
|
},
|
|
82
82
|
relations: [
|
|
83
83
|
'bizplace',
|
|
84
|
-
'bizplace.company',
|
|
85
|
-
'bizplace.company.domain',
|
|
86
84
|
'worksheet',
|
|
87
85
|
'worksheet.arrivalNotice',
|
|
88
86
|
'worksheet.returnOrder',
|
|
@@ -90,9 +88,13 @@ export class UnloadingWorksheetController extends VasWorksheetController {
|
|
|
90
88
|
'worksheet.bufferLocation.warehouse',
|
|
91
89
|
'targetProduct',
|
|
92
90
|
'targetProduct.product',
|
|
91
|
+
'targetProduct.product.productDetails',
|
|
92
|
+
'targetProduct.product.productDetails.childProductDetail',
|
|
93
93
|
'targetInventory',
|
|
94
|
+
'targetInventory.inventory',
|
|
94
95
|
'targetInventory.product',
|
|
95
|
-
'targetInventory.
|
|
96
|
+
'targetInventory.product.productDetails',
|
|
97
|
+
'targetInventory.product.productDetails.childProductDetail'
|
|
96
98
|
]
|
|
97
99
|
})
|
|
98
100
|
if (!worksheetDetail) throw new Error(this.ERROR_MSG.FIND.NO_RESULT(worksheetDetailName))
|
|
@@ -111,13 +113,10 @@ export class UnloadingWorksheetController extends VasWorksheetController {
|
|
|
111
113
|
const product: Product = Boolean(arrivalNotice) ? targetProduct.product : targetInventory.product
|
|
112
114
|
const packingType: string = Boolean(arrivalNotice) ? targetProduct.packingType : targetInventory.packingType
|
|
113
115
|
const packingSize: number = Boolean(arrivalNotice) ? targetProduct.packingSize : targetInventory.packingSize
|
|
114
|
-
const uom: string = Boolean(arrivalNotice) ? targetProduct.uom : originInventory.uom
|
|
115
116
|
const remark: string = Boolean(arrivalNotice) ? targetProduct.remark : targetInventory.remark
|
|
116
117
|
const manufactureYear: number = Boolean(arrivalNotice) ? targetProduct.manufactureYear : null
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
? Math.round(qty * targetProduct.uomValue * 100) / 100
|
|
120
|
-
: targetInventory.returnUomValue
|
|
118
|
+
let qty: number = inventory.qty
|
|
119
|
+
let uom: string = Boolean(arrivalNotice) ? targetProduct.uom : targetInventory.uom
|
|
121
120
|
const location: Location = worksheet.bufferLocation
|
|
122
121
|
const warehouse: Warehouse = location.warehouse
|
|
123
122
|
const zone: string = location.zone
|
|
@@ -144,14 +143,46 @@ export class UnloadingWorksheetController extends VasWorksheetController {
|
|
|
144
143
|
}
|
|
145
144
|
|
|
146
145
|
if (productBarcode) {
|
|
147
|
-
const
|
|
148
|
-
|
|
149
|
-
|
|
146
|
+
const productDetails: ProductDetail[] = product?.productDetails.filter(detail => !detail.deletedAt)
|
|
147
|
+
const isMatchingBarcode: boolean = productDetails.map(detail => detail.gtin).includes(productBarcode)
|
|
148
|
+
if (!isMatchingBarcode) throw new Error(this.ERROR_MSG.FIND.NO_RESULT(productBarcode))
|
|
149
|
+
|
|
150
|
+
const foundProductDetail: ProductDetail = productDetails.find(
|
|
151
|
+
(detail: ProductDetail) =>
|
|
152
|
+
detail.gtin === productBarcode && detail.packingType === packingType && detail.packingSize == packingSize
|
|
153
|
+
)
|
|
150
154
|
|
|
151
|
-
if (!
|
|
152
|
-
|
|
155
|
+
if (!foundProductDetail) {
|
|
156
|
+
const orderProductDetail: ProductDetail = productDetails.find(
|
|
157
|
+
(parentDetail: ProductDetail) =>
|
|
158
|
+
parentDetail.packingType === packingType && parentDetail.packingSize == packingSize
|
|
159
|
+
)
|
|
160
|
+
if (!orderProductDetail)
|
|
161
|
+
throw new Error(
|
|
162
|
+
this.ERROR_MSG.FIND.NO_RESULT(`Packing Type ( ${packingType}) or Packing Size (${packingSize})`)
|
|
163
|
+
)
|
|
164
|
+
|
|
165
|
+
if (arrivalNotice) {
|
|
166
|
+
uom = targetProduct.uom
|
|
167
|
+
} else {
|
|
168
|
+
uom = orderProductDetail.uom
|
|
169
|
+
}
|
|
170
|
+
qty = (await this.getChildQty(productDetails, productBarcode, orderProductDetail)) * qty
|
|
171
|
+
} else {
|
|
172
|
+
uom = foundProductDetail.uom
|
|
173
|
+
qty
|
|
174
|
+
}
|
|
153
175
|
}
|
|
154
176
|
|
|
177
|
+
const uomValue: number =
|
|
178
|
+
Math.round(
|
|
179
|
+
qty *
|
|
180
|
+
(Boolean(arrivalNotice)
|
|
181
|
+
? targetProduct.uomValue
|
|
182
|
+
: targetInventory.returnUomValue / targetInventory.returnQty) *
|
|
183
|
+
100
|
|
184
|
+
) / 100
|
|
185
|
+
|
|
155
186
|
let newInventory: Partial<Inventory> = new Inventory()
|
|
156
187
|
newInventory.bizplace = bizplace
|
|
157
188
|
newInventory.name = InventoryNoGenerator.inventoryName()
|
|
@@ -173,10 +204,10 @@ export class UnloadingWorksheetController extends VasWorksheetController {
|
|
|
173
204
|
if (arrivalNotice) {
|
|
174
205
|
newInventory.manufactureYear = manufactureYear
|
|
175
206
|
newInventory.batchIdRef = batchIdRef
|
|
176
|
-
newInventory.orderProductId = targetProduct
|
|
207
|
+
newInventory.orderProductId = targetProduct?.id
|
|
177
208
|
} else if (returnOrder) {
|
|
178
|
-
newInventory.orderInventoryId = targetInventory
|
|
179
|
-
newInventory.refInventory = inventory
|
|
209
|
+
newInventory.orderInventoryId = targetInventory?.id
|
|
210
|
+
newInventory.refInventory = targetInventory?.inventory
|
|
180
211
|
}
|
|
181
212
|
newInventory.warehouse = warehouse
|
|
182
213
|
newInventory.location = location
|
|
@@ -257,7 +288,7 @@ export class UnloadingWorksheetController extends VasWorksheetController {
|
|
|
257
288
|
const packingSize: number = Boolean(arrivalNotice) ? targetProduct.packingSize : targetInventory.packingSize
|
|
258
289
|
const batchId: string = Boolean(arrivalNotice) ? targetProduct.batchId : targetInventory.batchId
|
|
259
290
|
let qty: number = 0
|
|
260
|
-
|
|
291
|
+
let uom: string = Boolean(arrivalNotice) ? targetProduct.uom : targetInventory.uom
|
|
261
292
|
const cartonId: string = inventory.cartonId
|
|
262
293
|
const orderId: string = Boolean(arrivalNotice) ? arrivalNotice.id : returnOrder.id
|
|
263
294
|
await this.checkCartonDuplication(cartonId, orderId)
|
|
@@ -283,8 +314,14 @@ export class UnloadingWorksheetController extends VasWorksheetController {
|
|
|
283
314
|
this.ERROR_MSG.FIND.NO_RESULT(`Packing Type ( ${packingType}) or Packing Size (${packingSize})`)
|
|
284
315
|
)
|
|
285
316
|
|
|
317
|
+
if (arrivalNotice) {
|
|
318
|
+
uom = targetProduct.uom
|
|
319
|
+
} else {
|
|
320
|
+
uom = orderProductDetail.uom
|
|
321
|
+
}
|
|
286
322
|
qty = await this.getChildQty(productDetails, productBarcode, orderProductDetail)
|
|
287
323
|
} else {
|
|
324
|
+
uom = foundProductDetail.uom
|
|
288
325
|
qty++
|
|
289
326
|
}
|
|
290
327
|
|
|
@@ -313,7 +350,6 @@ export class UnloadingWorksheetController extends VasWorksheetController {
|
|
|
313
350
|
let foundInventory: Inventory = await invQb.getOne()
|
|
314
351
|
|
|
315
352
|
const batchIdRef: string = Boolean(arrivalNotice) ? targetProduct.batchIdRef : null
|
|
316
|
-
const uom: string = Boolean(arrivalNotice) ? targetProduct.uom : targetInventory.uom
|
|
317
353
|
const remark: string = Boolean(arrivalNotice) ? targetProduct.remark : targetInventory.remark
|
|
318
354
|
const manufactureYear: number = Boolean(arrivalNotice) ? targetProduct.manufactureYear : null
|
|
319
355
|
const location: Location = worksheet.bufferLocation
|
|
@@ -342,9 +378,14 @@ export class UnloadingWorksheetController extends VasWorksheetController {
|
|
|
342
378
|
newInventory.uom = uom
|
|
343
379
|
newInventory.remark = remark
|
|
344
380
|
newInventory.qty = qty
|
|
345
|
-
newInventory.uomValue =
|
|
346
|
-
|
|
347
|
-
|
|
381
|
+
newInventory.uomValue =
|
|
382
|
+
Math.round(
|
|
383
|
+
qty *
|
|
384
|
+
(Boolean(arrivalNotice)
|
|
385
|
+
? targetProduct.uomValue
|
|
386
|
+
: targetInventory.returnUomValue / targetInventory.returnQty) *
|
|
387
|
+
100
|
|
388
|
+
) / 100
|
|
348
389
|
newInventory.manufactureYear = manufactureYear
|
|
349
390
|
newInventory.refOrderId = orderId
|
|
350
391
|
newInventory.unitCost = unitCost
|
|
@@ -368,17 +409,23 @@ export class UnloadingWorksheetController extends VasWorksheetController {
|
|
|
368
409
|
targetProduct.actualPackQty = Boolean(targetProduct.actualPackQty) ? targetProduct.actualPackQty + qty : qty
|
|
369
410
|
} else if (returnOrder) {
|
|
370
411
|
targetInventory.actualPalletQty++
|
|
371
|
-
targetInventory.actualPackQty
|
|
412
|
+
targetInventory.actualPackQty = Boolean(targetInventory.actualPackQty)
|
|
372
413
|
? targetInventory.actualPackQty + qty
|
|
373
414
|
: qty
|
|
374
415
|
}
|
|
375
416
|
await this.trxMgr.getRepository(Inventory).save(newInventory)
|
|
376
417
|
} else {
|
|
377
418
|
const updatedQty: number = foundInventory.qty + qty
|
|
419
|
+
foundInventory.expirationDate = new Date(foundInventory.expirationDate)
|
|
378
420
|
foundInventory.qty = updatedQty
|
|
379
|
-
foundInventory.uomValue
|
|
380
|
-
|
|
381
|
-
|
|
421
|
+
foundInventory.uomValue +=
|
|
422
|
+
Math.round(
|
|
423
|
+
qty *
|
|
424
|
+
(Boolean(arrivalNotice)
|
|
425
|
+
? targetProduct.uomValue
|
|
426
|
+
: targetInventory.returnUomValue / targetInventory.returnQty) *
|
|
427
|
+
100
|
|
428
|
+
) / 100
|
|
382
429
|
if (arrivalNotice) targetProduct.actualPackQty = targetProduct.actualPackQty + qty
|
|
383
430
|
else if (returnOrder) targetInventory.actualPackQty = targetInventory.actualPackQty + qty
|
|
384
431
|
await this.trxMgr.getRepository(Inventory).save(foundInventory)
|
|
@@ -499,6 +546,8 @@ export class UnloadingWorksheetController extends VasWorksheetController {
|
|
|
499
546
|
let targetProduct: OrderProduct = worksheetDetail.targetProduct
|
|
500
547
|
targetProduct.actualPackQty -= qty
|
|
501
548
|
targetProduct.actualPalletQty--
|
|
549
|
+
targetProduct.remark = null
|
|
550
|
+
targetProduct.issue = null
|
|
502
551
|
targetProduct.status = ORDER_PRODUCT_STATUS.UNLOADING
|
|
503
552
|
targetProduct.updater = this.user
|
|
504
553
|
await this.updateOrderTargets([targetProduct])
|
|
@@ -511,6 +560,7 @@ export class UnloadingWorksheetController extends VasWorksheetController {
|
|
|
511
560
|
await this.updateOrderTargets([targetInventory])
|
|
512
561
|
}
|
|
513
562
|
|
|
563
|
+
worksheetDetail.issue = null
|
|
514
564
|
worksheetDetail.status = WORKSHEET_STATUS.EXECUTING
|
|
515
565
|
worksheetDetail.updater = this.user
|
|
516
566
|
await this.trxMgr.getRepository(WorksheetDetail).save(worksheetDetail)
|
|
@@ -595,19 +645,23 @@ export class UnloadingWorksheetController extends VasWorksheetController {
|
|
|
595
645
|
targetInventory.updater = this.user
|
|
596
646
|
}
|
|
597
647
|
|
|
598
|
-
worksheetDetail.status = WORKSHEET_STATUS.EXECUTING
|
|
599
|
-
worksheetDetail.updater = this.user
|
|
600
|
-
await this.trxMgr.getRepository(WorksheetDetail).save(worksheetDetail)
|
|
601
|
-
|
|
602
648
|
foundInventory.qty--
|
|
603
649
|
foundInventory.uomValue =
|
|
604
650
|
Math.round(
|
|
605
651
|
foundInventory.qty * (Boolean(arrivalNotice) ? targetProduct.uomValue : targetInventory.returnUomValue) * 100
|
|
606
652
|
) / 100
|
|
607
653
|
foundInventory.updater = this.user
|
|
654
|
+
|
|
655
|
+
worksheetDetail.issue = foundInventory.qty == 0 && worksheetDetail.issue ? null : worksheetDetail.issue
|
|
656
|
+
worksheetDetail.status = WORKSHEET_STATUS.EXECUTING
|
|
657
|
+
worksheetDetail.updater = this.user
|
|
658
|
+
await this.trxMgr.getRepository(WorksheetDetail).save(worksheetDetail)
|
|
659
|
+
|
|
608
660
|
if (foundInventory.qty == 0) {
|
|
609
661
|
if (arrivalNotice) {
|
|
610
662
|
targetProduct.actualPalletQty--
|
|
663
|
+
targetProduct.issue = null
|
|
664
|
+
targetProduct.remark = null
|
|
611
665
|
await this.updateOrderTargets([targetProduct])
|
|
612
666
|
} else if (returnOrder) {
|
|
613
667
|
targetInventory.actualPalletQty--
|
|
@@ -7,6 +7,7 @@ export * from './render-kimeda-grn'
|
|
|
7
7
|
export * from './render-orientage-grn'
|
|
8
8
|
export * from './render-orientage-do'
|
|
9
9
|
export * from './render-seebuu-grn'
|
|
10
|
+
export * from './render-manifest'
|
|
10
11
|
|
|
11
12
|
/* Worksheet Controllers */
|
|
12
13
|
export * from './worksheet-controller'
|
|
@@ -34,6 +34,26 @@ export class LoadingWorksheetController extends VasWorksheetController {
|
|
|
34
34
|
)
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
async updateLoadingWorksheet(
|
|
38
|
+
releaseGoodNo: string,
|
|
39
|
+
targetInventories: Partial<OrderInventory>[],
|
|
40
|
+
worksheet: Worksheet
|
|
41
|
+
): Promise<Worksheet> {
|
|
42
|
+
const releaseGood: ReleaseGood = await this.findRefOrder(
|
|
43
|
+
ReleaseGood,
|
|
44
|
+
{ domain: this.domain, name: releaseGoodNo },
|
|
45
|
+
['bizplace']
|
|
46
|
+
)
|
|
47
|
+
return await this.updateWorksheet(
|
|
48
|
+
WORKSHEET_TYPE.LOADING,
|
|
49
|
+
releaseGood,
|
|
50
|
+
worksheet,
|
|
51
|
+
targetInventories,
|
|
52
|
+
ORDER_STATUS.LOADING,
|
|
53
|
+
ORDER_INVENTORY_STATUS.LOADING
|
|
54
|
+
)
|
|
55
|
+
}
|
|
56
|
+
|
|
37
57
|
async activateLoading(worksheetNo: string, loadingWorksheetDetails: Partial<WorksheetDetail>[]): Promise<Worksheet> {
|
|
38
58
|
const worksheet: Worksheet = await this.findActivatableWorksheet(worksheetNo, WORKSHEET_TYPE.LOADING, [
|
|
39
59
|
'releaseGood',
|
|
@@ -19,11 +19,9 @@ export class PackingWorksheetController extends VasWorksheetController {
|
|
|
19
19
|
)
|
|
20
20
|
const orderInventories: OrderInventory[] = releaseGood.orderInventories
|
|
21
21
|
|
|
22
|
-
const existingPackingWorksheet: Worksheet = await this.trxMgr
|
|
23
|
-
.
|
|
24
|
-
|
|
25
|
-
where: { domain: this.domain, releaseGood, type: WORKSHEET_TYPE.PACKING, status: WORKSHEET_STATUS.DEACTIVATED }
|
|
26
|
-
})
|
|
22
|
+
const existingPackingWorksheet: Worksheet = await this.trxMgr.getRepository(Worksheet).findOne({
|
|
23
|
+
where: { domain: this.domain, releaseGood, type: WORKSHEET_TYPE.PACKING, status: WORKSHEET_STATUS.DEACTIVATED }
|
|
24
|
+
})
|
|
27
25
|
|
|
28
26
|
if (existingPackingWorksheet) throw new Error('There is existing packing worksheet that has been generated')
|
|
29
27
|
let worksheet: Worksheet = await this.createWorksheet(releaseGood, WORKSHEET_TYPE.PACKING)
|