@things-factory/worksheet-base 4.3.355 → 4.3.357
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/worksheet.js +2 -1
- package/dist-server/constants/worksheet.js.map +1 -1
- package/dist-server/controllers/inspect/cycle-count-worksheet-controller.js +691 -257
- package/dist-server/controllers/inspect/cycle-count-worksheet-controller.js.map +1 -1
- package/dist-server/controllers/outbound/picking-worksheet-controller.js +76 -0
- package/dist-server/controllers/outbound/picking-worksheet-controller.js.map +1 -1
- package/dist-server/controllers/worksheet-controller.js +9 -2
- package/dist-server/controllers/worksheet-controller.js.map +1 -1
- package/dist-server/entities/worksheet-detail.js +9 -4
- package/dist-server/entities/worksheet-detail.js.map +1 -1
- package/dist-server/entities/worksheet.js +4 -0
- package/dist-server/entities/worksheet.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/check-stock-take-current-location.js +18 -11
- package/dist-server/graphql/resolvers/worksheet/check-stock-take-current-location.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/cycle-count-adjustment.js +75 -48
- package/dist-server/graphql/resolvers/worksheet/cycle-count-adjustment.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/cycle-count-worksheet-for-carton.js +82 -0
- package/dist-server/graphql/resolvers/worksheet/cycle-count-worksheet-for-carton.js.map +1 -0
- package/dist-server/graphql/resolvers/worksheet/cycle-count-worksheet-for-pallet.js +82 -0
- package/dist-server/graphql/resolvers/worksheet/cycle-count-worksheet-for-pallet.js.map +1 -0
- package/dist-server/graphql/resolvers/worksheet/generate-worksheet/generate-cycle-count-worksheet-carton.js +17 -0
- package/dist-server/graphql/resolvers/worksheet/generate-worksheet/generate-cycle-count-worksheet-carton.js.map +1 -0
- package/dist-server/graphql/resolvers/worksheet/generate-worksheet/generate-cycle-count-worksheet.js +4 -4
- package/dist-server/graphql/resolvers/worksheet/generate-worksheet/generate-cycle-count-worksheet.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/generate-worksheet/index.js +2 -1
- package/dist-server/graphql/resolvers/worksheet/generate-worksheet/index.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/index.js +3 -2
- package/dist-server/graphql/resolvers/worksheet/index.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/inspecting/add-extra-inventory.js +16 -0
- package/dist-server/graphql/resolvers/worksheet/inspecting/add-extra-inventory.js.map +1 -0
- package/dist-server/graphql/resolvers/worksheet/inspecting/check-missing-inventory-carton.js +16 -0
- package/dist-server/graphql/resolvers/worksheet/inspecting/check-missing-inventory-carton.js.map +1 -0
- package/dist-server/graphql/resolvers/worksheet/inspecting/check-missing-inventory.js +16 -0
- package/dist-server/graphql/resolvers/worksheet/inspecting/check-missing-inventory.js.map +1 -0
- package/dist-server/graphql/resolvers/worksheet/inspecting/index.js +9 -5
- package/dist-server/graphql/resolvers/worksheet/inspecting/index.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/inspecting/inspecting-carton.js +16 -0
- package/dist-server/graphql/resolvers/worksheet/inspecting/inspecting-carton.js.map +1 -0
- package/dist-server/graphql/resolvers/worksheet/inspecting/inspecting-pallet.js +16 -0
- package/dist-server/graphql/resolvers/worksheet/inspecting/inspecting-pallet.js.map +1 -0
- package/dist-server/graphql/resolvers/worksheet/inspecting/relocate-inventory-carton.js +16 -0
- package/dist-server/graphql/resolvers/worksheet/inspecting/relocate-inventory-carton.js.map +1 -0
- package/dist-server/graphql/resolvers/worksheet/inspecting/relocate-inventory.js +16 -0
- package/dist-server/graphql/resolvers/worksheet/inspecting/relocate-inventory.js.map +1 -0
- package/dist-server/graphql/resolvers/worksheet/inspecting/undo-inspection-carton.js +16 -0
- package/dist-server/graphql/resolvers/worksheet/inspecting/undo-inspection-carton.js.map +1 -0
- package/dist-server/graphql/resolvers/worksheet/not-tally-target-inventories.js +9 -5
- package/dist-server/graphql/resolvers/worksheet/not-tally-target-inventories.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/worksheet-with-pagination.js +9 -7
- package/dist-server/graphql/resolvers/worksheet/worksheet-with-pagination.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/worksheets.js +23 -9
- package/dist-server/graphql/resolvers/worksheet/worksheets.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet-detail/create-worksheet-detail.js +8 -1
- package/dist-server/graphql/resolvers/worksheet-detail/create-worksheet-detail.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet-detail/worksheet-detail.js +12 -1
- package/dist-server/graphql/resolvers/worksheet-detail/worksheet-detail.js.map +1 -1
- package/dist-server/graphql/types/worksheet/index.js +65 -9
- package/dist-server/graphql/types/worksheet/index.js.map +1 -1
- package/dist-server/graphql/types/worksheet/inventory-check-worksheet.js +2 -1
- package/dist-server/graphql/types/worksheet/inventory-check-worksheet.js.map +1 -1
- package/dist-server/graphql/types/worksheet/worksheet-detail-info.js +3 -0
- package/dist-server/graphql/types/worksheet/worksheet-detail-info.js.map +1 -1
- package/dist-server/graphql/types/worksheet/worksheet.js +2 -0
- package/dist-server/graphql/types/worksheet/worksheet.js.map +1 -1
- package/dist-server/graphql/types/worksheet-detail/new-worksheet-detail.js +1 -0
- package/dist-server/graphql/types/worksheet-detail/new-worksheet-detail.js.map +1 -1
- package/dist-server/graphql/types/worksheet-detail/worksheet-detail-patch.js +1 -0
- package/dist-server/graphql/types/worksheet-detail/worksheet-detail-patch.js.map +1 -1
- package/dist-server/graphql/types/worksheet-detail/worksheet-detail.js +1 -0
- package/dist-server/graphql/types/worksheet-detail/worksheet-detail.js.map +1 -1
- package/dist-server/utils/lmd-util.js +10 -10
- package/dist-server/utils/lmd-util.js.map +1 -1
- package/package.json +6 -6
- package/server/constants/worksheet.ts +2 -1
- package/server/controllers/inspect/cycle-count-worksheet-controller.ts +904 -296
- package/server/controllers/outbound/picking-worksheet-controller.ts +95 -1
- package/server/controllers/worksheet-controller.ts +10 -4
- package/server/entities/worksheet-detail.ts +7 -10
- package/server/entities/worksheet.ts +3 -0
- package/server/graphql/resolvers/worksheet/check-stock-take-current-location.ts +21 -14
- package/server/graphql/resolvers/worksheet/cycle-count-adjustment.ts +114 -51
- package/server/graphql/resolvers/worksheet/cycle-count-worksheet-for-carton.ts +90 -0
- package/server/graphql/resolvers/worksheet/cycle-count-worksheet-for-pallet.ts +91 -0
- package/server/graphql/resolvers/worksheet/generate-worksheet/generate-cycle-count-worksheet-carton.ts +57 -0
- package/server/graphql/resolvers/worksheet/generate-worksheet/generate-cycle-count-worksheet.ts +17 -11
- package/server/graphql/resolvers/worksheet/generate-worksheet/index.ts +2 -0
- package/server/graphql/resolvers/worksheet/index.ts +4 -2
- package/server/graphql/resolvers/worksheet/inspecting/{add-extra-pallet.ts → add-extra-inventory.ts} +27 -12
- package/server/graphql/resolvers/worksheet/inspecting/check-missing-inventory-carton.ts +24 -0
- package/server/graphql/resolvers/worksheet/inspecting/{check-missing-pallet.ts → check-missing-inventory.ts} +10 -5
- package/server/graphql/resolvers/worksheet/inspecting/index.ts +17 -9
- package/server/graphql/resolvers/worksheet/inspecting/inspecting-carton.ts +51 -0
- package/server/graphql/resolvers/worksheet/inspecting/{inspecting.ts → inspecting-pallet.ts} +5 -5
- package/server/graphql/resolvers/worksheet/inspecting/relocate-inventory-carton.ts +62 -0
- package/server/graphql/resolvers/worksheet/inspecting/{relocate-pallet.ts → relocate-inventory.ts} +15 -5
- package/server/graphql/resolvers/worksheet/inspecting/undo-inspection-carton.ts +24 -0
- package/server/graphql/resolvers/worksheet/not-tally-target-inventories.ts +11 -7
- package/server/graphql/resolvers/worksheet/worksheet-with-pagination.ts +9 -7
- package/server/graphql/resolvers/worksheet/worksheets.ts +57 -38
- package/server/graphql/resolvers/worksheet-detail/create-worksheet-detail.ts +10 -2
- package/server/graphql/resolvers/worksheet-detail/worksheet-detail.ts +12 -1
- package/server/graphql/types/worksheet/index.ts +65 -9
- package/server/graphql/types/worksheet/inventory-check-worksheet.ts +2 -1
- package/server/graphql/types/worksheet/worksheet-detail-info.ts +3 -0
- package/server/graphql/types/worksheet/worksheet.ts +2 -0
- package/server/graphql/types/worksheet-detail/new-worksheet-detail.ts +1 -0
- package/server/graphql/types/worksheet-detail/worksheet-detail-patch.ts +1 -0
- package/server/graphql/types/worksheet-detail/worksheet-detail.ts +1 -0
- package/server/utils/lmd-util.ts +30 -45
- package/tsconfig.json +1 -1
- package/dist-server/graphql/resolvers/worksheet/cycle-count-worksheet.js +0 -74
- package/dist-server/graphql/resolvers/worksheet/cycle-count-worksheet.js.map +0 -1
- package/dist-server/graphql/resolvers/worksheet/inspecting/add-extra-pallet.js +0 -16
- package/dist-server/graphql/resolvers/worksheet/inspecting/add-extra-pallet.js.map +0 -1
- package/dist-server/graphql/resolvers/worksheet/inspecting/check-missing-pallet.js +0 -16
- package/dist-server/graphql/resolvers/worksheet/inspecting/check-missing-pallet.js.map +0 -1
- package/dist-server/graphql/resolvers/worksheet/inspecting/inspecting.js +0 -16
- package/dist-server/graphql/resolvers/worksheet/inspecting/inspecting.js.map +0 -1
- package/dist-server/graphql/resolvers/worksheet/inspecting/relocate-pallet.js +0 -16
- package/dist-server/graphql/resolvers/worksheet/inspecting/relocate-pallet.js.map +0 -1
- package/server/graphql/resolvers/worksheet/cycle-count-worksheet.ts +0 -80
package/server/graphql/resolvers/worksheet/inspecting/{relocate-pallet.ts → relocate-inventory.ts}
RENAMED
|
@@ -3,10 +3,14 @@ import { Domain } from '@things-factory/shell'
|
|
|
3
3
|
import { EntityManager } from 'typeorm'
|
|
4
4
|
import { CycleCountWorksheetController } from '../../../../controllers'
|
|
5
5
|
|
|
6
|
-
export const
|
|
7
|
-
async
|
|
6
|
+
export const relocateInventoryResolver = {
|
|
7
|
+
async relocateInventory(
|
|
8
|
+
_: any,
|
|
9
|
+
{ worksheetDetailName, inspectedBatchNo, inspectedQty, inspectedUomValue, inspectedLocationName },
|
|
10
|
+
context: any
|
|
11
|
+
) {
|
|
8
12
|
const { tx, domain, user }: { tx: EntityManager; domain: Domain; user: User } = context.state
|
|
9
|
-
await
|
|
13
|
+
await relocateInventory(
|
|
10
14
|
tx,
|
|
11
15
|
domain,
|
|
12
16
|
user,
|
|
@@ -19,7 +23,7 @@ export const relocatePalletResolver = {
|
|
|
19
23
|
}
|
|
20
24
|
}
|
|
21
25
|
|
|
22
|
-
export async function
|
|
26
|
+
export async function relocateInventory(
|
|
23
27
|
tx: EntityManager,
|
|
24
28
|
domain: Domain,
|
|
25
29
|
user: User,
|
|
@@ -30,5 +34,11 @@ export async function relocatePallet(
|
|
|
30
34
|
inspectedLocationName: string
|
|
31
35
|
) {
|
|
32
36
|
const worksheetController: CycleCountWorksheetController = new CycleCountWorksheetController(tx, domain, user)
|
|
33
|
-
await worksheetController.
|
|
37
|
+
await worksheetController.relocateInventory(
|
|
38
|
+
worksheetDetailName,
|
|
39
|
+
inspectedBatchNo,
|
|
40
|
+
inspectedQty,
|
|
41
|
+
inspectedUomValue,
|
|
42
|
+
inspectedLocationName
|
|
43
|
+
)
|
|
34
44
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { User } from '@things-factory/auth-base'
|
|
2
|
+
import { Domain } from '@things-factory/shell'
|
|
3
|
+
import { EntityManager } from 'typeorm'
|
|
4
|
+
import { CycleCountWorksheetController } from '../../../../controllers'
|
|
5
|
+
|
|
6
|
+
export const undoInspectionCartonResolver = {
|
|
7
|
+
async undoInspectionCarton(_: any, { productDetailId, cartonId, batchId, locationId }, context: any) {
|
|
8
|
+
const { tx, domain, user }: { tx: EntityManager; domain: Domain; user: User } = context.state
|
|
9
|
+
await undoInspectionCarton(tx, domain, user, productDetailId, cartonId, batchId, locationId)
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export async function undoInspectionCarton(
|
|
14
|
+
tx: EntityManager,
|
|
15
|
+
domain: Domain,
|
|
16
|
+
user: User,
|
|
17
|
+
productDetailId: string,
|
|
18
|
+
cartonId: string,
|
|
19
|
+
batchId: string,
|
|
20
|
+
locationId: string
|
|
21
|
+
): Promise<void> {
|
|
22
|
+
const worksheetController: CycleCountWorksheetController = new CycleCountWorksheetController(tx, domain, user)
|
|
23
|
+
await worksheetController.undoInspectionCarton(productDetailId, cartonId, batchId, locationId)
|
|
24
|
+
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { createQueryBuilder, getRepository, SelectQueryBuilder } from 'typeorm'
|
|
2
2
|
|
|
3
|
-
import { InventoryCheck,
|
|
3
|
+
import { InventoryCheck, INVENTORY_CHECK_ITEM_STATUS } from '@things-factory/sales-base'
|
|
4
4
|
import { Domain } from '@things-factory/shell'
|
|
5
5
|
|
|
6
6
|
import { Worksheet, WorksheetDetail } from '../../../entities'
|
|
7
7
|
|
|
8
|
+
import { WORKSHEET_STATUS } from '../../../constants'
|
|
9
|
+
|
|
8
10
|
export const notTallyTargetInventoriesResolver = {
|
|
9
11
|
async notTallyTargetInventories(_: any, { cycleCountNo }, context: any) {
|
|
10
12
|
const { domain }: { domain: Domain } = context.state
|
|
@@ -14,21 +16,23 @@ export const notTallyTargetInventoriesResolver = {
|
|
|
14
16
|
})
|
|
15
17
|
|
|
16
18
|
const worksheet: Worksheet = await getRepository(Worksheet).findOne({
|
|
17
|
-
where: { domain, inventoryCheck: cycleCount }
|
|
19
|
+
where: { domain, inventoryCheck: cycleCount, status: WORKSHEET_STATUS.NOT_TALLY }
|
|
18
20
|
})
|
|
19
|
-
|
|
20
21
|
const qb: SelectQueryBuilder<WorksheetDetail> = createQueryBuilder(WorksheetDetail, 'WSD')
|
|
21
22
|
const worksheetDetails: WorksheetDetail[] = await qb
|
|
22
|
-
.leftJoinAndSelect('WSD.
|
|
23
|
+
.leftJoinAndSelect('WSD.targetInventoryCheckItem', 'T_INV')
|
|
23
24
|
.leftJoinAndSelect('T_INV.inventory', 'INV')
|
|
24
25
|
.leftJoinAndSelect('T_INV.originLocation', 'ORG_LOC')
|
|
25
26
|
.leftJoinAndSelect('T_INV.inspectedLocation', 'ISP_LOC')
|
|
26
|
-
.leftJoinAndSelect('
|
|
27
|
+
.leftJoinAndSelect('T_INV.product', 'PROD')
|
|
28
|
+
.leftJoinAndSelect('INV.product', 'PROD_INV')
|
|
29
|
+
.leftJoinAndSelect('T_INV.productDetail', 'PD')
|
|
30
|
+
.leftJoinAndSelect('INV.productDetail', 'PD_INV')
|
|
27
31
|
.where('WSD.domain = :domainId', { domainId: domain.id })
|
|
28
32
|
.andWhere('WSD.worksheet = :worksheetId', { worksheetId: worksheet.id })
|
|
29
|
-
.andWhere('WSD.status = :status', { status:
|
|
33
|
+
.andWhere('WSD.status = :status', { status: INVENTORY_CHECK_ITEM_STATUS.NOT_TALLY })
|
|
30
34
|
.getMany()
|
|
31
35
|
|
|
32
|
-
return worksheetDetails.map((wsd: WorksheetDetail) => wsd.
|
|
36
|
+
return worksheetDetails.map((wsd: WorksheetDetail) => wsd.targetInventoryCheckItem)
|
|
33
37
|
}
|
|
34
38
|
}
|
|
@@ -11,18 +11,20 @@ export const worksheetWithPaginationResolver = {
|
|
|
11
11
|
const { domain }: { domain: Domain } = context.state
|
|
12
12
|
const worksheet: Worksheet = await getRepository(Worksheet).findOne({
|
|
13
13
|
where: { domain, name },
|
|
14
|
-
relations: ['bizplace', '
|
|
14
|
+
relations: ['bizplace', 'bizplace.domain', 'inventoryCheck']
|
|
15
15
|
})
|
|
16
16
|
|
|
17
17
|
let findManyOptions: FindManyOptions<WorksheetDetail> = {
|
|
18
18
|
where: { domain, worksheet },
|
|
19
19
|
relations: [
|
|
20
|
-
'
|
|
21
|
-
'
|
|
22
|
-
'
|
|
23
|
-
'
|
|
24
|
-
'
|
|
25
|
-
'
|
|
20
|
+
'targetInventoryCheckItem',
|
|
21
|
+
'targetInventoryCheckItem.originLocation',
|
|
22
|
+
'targetInventoryCheckItem.inspectedLocation',
|
|
23
|
+
'targetInventoryCheckItem.inventory',
|
|
24
|
+
'targetInventoryCheckItem.inventory.location',
|
|
25
|
+
'targetInventoryCheckItem.inventory.product',
|
|
26
|
+
'targetInventoryCheckItem.product',
|
|
27
|
+
'targetInventoryCheckItem.productDetail'
|
|
26
28
|
]
|
|
27
29
|
}
|
|
28
30
|
|
|
@@ -25,21 +25,21 @@ export const worksheetsResolver = {
|
|
|
25
25
|
params.filters.findIndex(item => item.name == 'arrivalNoticeNo'),
|
|
26
26
|
1
|
|
27
27
|
)
|
|
28
|
-
|
|
28
|
+
// arrFilters.push({ ...arrivalNoticeParam, name: 'name' })
|
|
29
29
|
}
|
|
30
30
|
if (arrivalNoticeRefNoParam) {
|
|
31
31
|
params.filters.splice(
|
|
32
32
|
params.filters.findIndex(item => item.name == 'arrivalNoticeRefNo'),
|
|
33
33
|
1
|
|
34
34
|
)
|
|
35
|
-
|
|
35
|
+
// arrFilters.push({ ...arrivalNoticeRefNoParam, name: 'refNo' })
|
|
36
36
|
}
|
|
37
37
|
if (arrivalNoticeCrossDockingParam) {
|
|
38
38
|
params.filters.splice(
|
|
39
39
|
params.filters.findIndex(item => item.name == 'arrivalNoticeCrossDocking'),
|
|
40
40
|
1
|
|
41
41
|
)
|
|
42
|
-
|
|
42
|
+
// arrFilters.push({ ...arrivalNoticeCrossDockingParam, name: 'crossDocking' })
|
|
43
43
|
}
|
|
44
44
|
// const foundArrivalNotices: ArrivalNotice[] = await getRepository(ArrivalNotice).find({
|
|
45
45
|
// ...convertListParams({ filters: arrFilters }, domain.id)
|
|
@@ -108,14 +108,16 @@ export const worksheetsResolver = {
|
|
|
108
108
|
const releaseGoodPackingOptionParam = params.filters.find(param => param.name === 'releaseGoodPackingOption')
|
|
109
109
|
const orderRemarkParam = params.filters.find(param => param.name === 'orderRemark')
|
|
110
110
|
const manifestParam = params.filters.find(param => param.name === 'manifest')
|
|
111
|
-
const releaseGoodPriorityDeliveryParam = params.filters.find(
|
|
111
|
+
const releaseGoodPriorityDeliveryParam = params.filters.find(
|
|
112
|
+
param => param.name === 'releaseGoodPriorityDelivery'
|
|
113
|
+
)
|
|
112
114
|
|
|
113
115
|
if (
|
|
114
116
|
releaseGoodParam ||
|
|
115
117
|
releaseGoodRefNoParam ||
|
|
116
118
|
releaseGoodCrossDockingParam ||
|
|
117
119
|
releaseGoodCourierOptionParam ||
|
|
118
|
-
releaseGoodPackingOptionParam ||
|
|
120
|
+
releaseGoodPackingOptionParam ||
|
|
119
121
|
releaseGoodPriorityDeliveryParam
|
|
120
122
|
) {
|
|
121
123
|
// let arrFilters = []
|
|
@@ -124,8 +126,8 @@ export const worksheetsResolver = {
|
|
|
124
126
|
params.filters.findIndex(item => item.name == 'releaseGoodNo'),
|
|
125
127
|
1
|
|
126
128
|
)
|
|
127
|
-
|
|
128
|
-
|
|
129
|
+
|
|
130
|
+
// arrFilters.push({ ...releaseGoodParam, name: 'name' })
|
|
129
131
|
}
|
|
130
132
|
|
|
131
133
|
if (releaseGoodRefNoParam) {
|
|
@@ -259,7 +261,7 @@ export const worksheetsResolver = {
|
|
|
259
261
|
////For inventory check worksheet filter
|
|
260
262
|
const inventoryCheckParam = params.filters.find(param => param.name === 'inventoryCheckNo')
|
|
261
263
|
const inventoryCheckStatusParam = params.filters.find(param => param.name === 'inventoryCheckStatus')
|
|
262
|
-
const inventoryCheckExecutionDateParam = params.filters.find(param => param.name === '
|
|
264
|
+
const inventoryCheckExecutionDateParam = params.filters.find(param => param.name === 'executionDate')
|
|
263
265
|
if (inventoryCheckParam || inventoryCheckExecutionDateParam || inventoryCheckStatusParam) {
|
|
264
266
|
// let arrFilters = []
|
|
265
267
|
if (inventoryCheckParam) {
|
|
@@ -278,7 +280,7 @@ export const worksheetsResolver = {
|
|
|
278
280
|
}
|
|
279
281
|
if (inventoryCheckExecutionDateParam) {
|
|
280
282
|
params.filters.splice(
|
|
281
|
-
params.filters.findIndex(item => item.name == '
|
|
283
|
+
params.filters.findIndex(item => item.name == 'executionDate'),
|
|
282
284
|
1
|
|
283
285
|
)
|
|
284
286
|
// arrFilters.push({ ...executionDateParam, name: 'executionDate' })
|
|
@@ -362,13 +364,13 @@ export const worksheetsResolver = {
|
|
|
362
364
|
|
|
363
365
|
////For vas worksheets filter
|
|
364
366
|
let orderName: string = ''
|
|
365
|
-
if (
|
|
367
|
+
if (params.filters.find(param => param.name === 'name')) {
|
|
366
368
|
orderName = params.filters.find(param => param.name === 'name').value?.toLowerCase()
|
|
367
369
|
params.filters = params.filters.filter(param => param.name !== 'name')
|
|
368
370
|
}
|
|
369
371
|
|
|
370
372
|
let vasNameFilter: string = ''
|
|
371
|
-
if (
|
|
373
|
+
if (params.filters.find(param => param.name === 'vasName')) {
|
|
372
374
|
vasNameFilter = params.filters.find(param => param.name === 'vasName').value?.toLowerCase()
|
|
373
375
|
params.filters = params.filters.filter(param => param.name !== 'vasName')
|
|
374
376
|
}
|
|
@@ -391,39 +393,38 @@ export const worksheetsResolver = {
|
|
|
391
393
|
new Brackets(qb2 => {
|
|
392
394
|
// qb2.where('vasOrder.name ILIKE :orderName', {orderName: orderName})
|
|
393
395
|
// .orWhere('releaseGood.name ILIKE :orderName', {orderName: orderName})
|
|
394
|
-
qb2.where('ws.name ILIKE :orderName', {orderName: orderName})
|
|
396
|
+
qb2.where('ws.name ILIKE :orderName', { orderName: orderName })
|
|
395
397
|
})
|
|
396
398
|
)
|
|
397
399
|
}
|
|
398
400
|
|
|
399
|
-
if (vasNameFilter
|
|
401
|
+
if (vasNameFilter) {
|
|
400
402
|
qb.andWhere(
|
|
401
403
|
new Brackets(qb2 => {
|
|
402
|
-
qb2.where(`vasOrder.name ILIKE '${vasNameFilter}'`)
|
|
403
|
-
.orWhere(`releaseGood.name ILIKE '${vasNameFilter}'`)
|
|
404
|
+
qb2.where(`vasOrder.name ILIKE '${vasNameFilter}'`).orWhere(`releaseGood.name ILIKE '${vasNameFilter}'`)
|
|
404
405
|
})
|
|
405
406
|
)
|
|
406
407
|
}
|
|
407
408
|
|
|
408
|
-
if(assigneeParam) {
|
|
409
|
+
if (assigneeParam) {
|
|
409
410
|
qb.andWhere(`assignee.name ILIKE '${assigneeParam.value}'`)
|
|
410
411
|
}
|
|
411
412
|
|
|
412
|
-
if(arrivalNoticeParam) {
|
|
413
|
+
if (arrivalNoticeParam) {
|
|
413
414
|
qb.andWhere(`arrivalNotice.name ILIKE '${arrivalNoticeParam.value}'`)
|
|
414
415
|
}
|
|
415
|
-
if(arrivalNoticeRefNoParam) {
|
|
416
|
+
if (arrivalNoticeRefNoParam) {
|
|
416
417
|
qb.andWhere(`arrivalNotice.ref_no ILIKE '${arrivalNoticeRefNoParam.value}'`)
|
|
417
418
|
}
|
|
418
419
|
|
|
419
|
-
if(returnOrderParam) {
|
|
420
|
+
if (returnOrderParam) {
|
|
420
421
|
qb.andWhere(`returnOrder.name ILIKE '${returnOrderParam.value}'`)
|
|
421
422
|
}
|
|
422
|
-
if(returnOrderRefNoParam) {
|
|
423
|
+
if (returnOrderRefNoParam) {
|
|
423
424
|
qb.andWhere(`returnOrder.ref_no ILIKE '${returnOrderRefNoParam.value}'`)
|
|
424
425
|
}
|
|
425
426
|
|
|
426
|
-
if(replenishmentParam) {
|
|
427
|
+
if (replenishmentParam) {
|
|
427
428
|
qb.andWhere(`replenishment.name ILIKE '${replenishmentParam.value}'`)
|
|
428
429
|
}
|
|
429
430
|
|
|
@@ -447,18 +448,18 @@ export const worksheetsResolver = {
|
|
|
447
448
|
)`)
|
|
448
449
|
}
|
|
449
450
|
|
|
450
|
-
if(releaseGoodRefNoParam) {
|
|
451
|
+
if (releaseGoodRefNoParam) {
|
|
451
452
|
qb.andWhere(`releaseGood.ref_no ILIKE '${releaseGoodRefNoParam.value}'`)
|
|
452
453
|
}
|
|
453
454
|
|
|
454
|
-
if(inventoryCheckParam) {
|
|
455
|
+
if (inventoryCheckParam) {
|
|
455
456
|
qb.andWhere(`inventoryCheck.name ILIKE '${inventoryCheckParam.value}'`)
|
|
456
457
|
}
|
|
457
|
-
if(inventoryCheckStatusParam) {
|
|
458
|
+
if (inventoryCheckStatusParam) {
|
|
458
459
|
qb.andWhere(`inventoryCheck.status ILIKE '${inventoryCheckStatusParam.value}'`)
|
|
459
460
|
}
|
|
460
|
-
if(inventoryCheckExecutionDateParam) {
|
|
461
|
-
qb.andWhere(
|
|
461
|
+
if (inventoryCheckExecutionDateParam) {
|
|
462
|
+
qb.andWhere(`inventoryCheck.execution_date ILIKE '${inventoryCheckExecutionDateParam.value}'`)
|
|
462
463
|
}
|
|
463
464
|
|
|
464
465
|
if (outboundOrderInfoFilter) {
|
|
@@ -520,20 +521,26 @@ export const worksheetsResolver = {
|
|
|
520
521
|
'cc.status = ws.status'
|
|
521
522
|
)
|
|
522
523
|
|
|
523
|
-
if(arrivalNoticeCrossDockingParam) {
|
|
524
|
-
qb.andWhere(`arrivalNotice.cross_docking = :crossDocking`, {
|
|
524
|
+
if (arrivalNoticeCrossDockingParam) {
|
|
525
|
+
qb.andWhere(`arrivalNotice.cross_docking = :crossDocking`, {
|
|
526
|
+
crossDocking: arrivalNoticeCrossDockingParam.value
|
|
527
|
+
})
|
|
525
528
|
}
|
|
526
|
-
if(releaseGoodCrossDockingParam) {
|
|
527
|
-
qb.andWhere(`releaseGood.cross_docking = :crossDocking`, { crossDocking: releaseGoodCrossDockingParam.value})
|
|
529
|
+
if (releaseGoodCrossDockingParam) {
|
|
530
|
+
qb.andWhere(`releaseGood.cross_docking = :crossDocking`, { crossDocking: releaseGoodCrossDockingParam.value })
|
|
528
531
|
}
|
|
529
|
-
if(releaseGoodCourierOptionParam) {
|
|
530
|
-
qb.andWhere(`releaseGood.courier_option = :transporter`, { transporter: releaseGoodCourierOptionParam.value})
|
|
532
|
+
if (releaseGoodCourierOptionParam) {
|
|
533
|
+
qb.andWhere(`releaseGood.courier_option = :transporter`, { transporter: releaseGoodCourierOptionParam.value })
|
|
531
534
|
}
|
|
532
|
-
if(releaseGoodPackingOptionParam) {
|
|
533
|
-
qb.andWhere(`releaseGood.packing_option = :packingOption`, {
|
|
535
|
+
if (releaseGoodPackingOptionParam) {
|
|
536
|
+
qb.andWhere(`releaseGood.packing_option = :packingOption`, {
|
|
537
|
+
packingOption: releaseGoodPackingOptionParam.value
|
|
538
|
+
})
|
|
534
539
|
}
|
|
535
|
-
if(releaseGoodPriorityDeliveryParam) {
|
|
536
|
-
qb.andWhere(`releaseGood.priority_delivery = :priorityDelivery`, {
|
|
540
|
+
if (releaseGoodPriorityDeliveryParam) {
|
|
541
|
+
qb.andWhere(`releaseGood.priority_delivery = :priorityDelivery`, {
|
|
542
|
+
priorityDelivery: releaseGoodPriorityDeliveryParam.value
|
|
543
|
+
})
|
|
537
544
|
}
|
|
538
545
|
|
|
539
546
|
////Add sorting conditions
|
|
@@ -544,7 +551,8 @@ export const worksheetsResolver = {
|
|
|
544
551
|
sort.name != 'arrivalRefNo' &&
|
|
545
552
|
sort.name != 'releaseRefNo' &&
|
|
546
553
|
sort.name != 'returnOrderNo' &&
|
|
547
|
-
sort.name != 'inventoryCheckStatus'
|
|
554
|
+
sort.name != 'inventoryCheckStatus' &&
|
|
555
|
+
sort.name != 'executionDate'
|
|
548
556
|
) {
|
|
549
557
|
return {
|
|
550
558
|
...acc,
|
|
@@ -600,6 +608,17 @@ export const worksheetsResolver = {
|
|
|
600
608
|
}
|
|
601
609
|
}
|
|
602
610
|
|
|
611
|
+
if (params.sortings.some(e => e.name === 'executionDate')) {
|
|
612
|
+
// overwrite the worksheet status sorting since inventory check status is needed
|
|
613
|
+
sort = {
|
|
614
|
+
'inventoryCheck.executionDate': params.sortings[
|
|
615
|
+
params.sortings.findIndex(item => item.name == 'executionDate')
|
|
616
|
+
].desc
|
|
617
|
+
? 'DESC'
|
|
618
|
+
: 'ASC'
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
|
|
603
622
|
qb.orderBy(sort)
|
|
604
623
|
|
|
605
624
|
let [items, total] = await qb.getManyAndCount()
|
|
@@ -616,4 +635,4 @@ export const worksheetsResolver = {
|
|
|
616
635
|
throw error
|
|
617
636
|
}
|
|
618
637
|
}
|
|
619
|
-
}
|
|
638
|
+
}
|
|
@@ -2,7 +2,7 @@ import { User } from '@things-factory/auth-base'
|
|
|
2
2
|
import { Domain } from '@things-factory/shell'
|
|
3
3
|
import { EntityManager } from 'typeorm'
|
|
4
4
|
import { getPermittedBizplaceIds, Worker } from '@things-factory/biz-base'
|
|
5
|
-
import { OrderProduct, OrderVas, OrderInventory } from '@things-factory/sales-base'
|
|
5
|
+
import { OrderProduct, OrderVas, OrderInventory, InventoryCheckItem } from '@things-factory/sales-base'
|
|
6
6
|
import { Worksheet, WorksheetDetail } from '../../../entities'
|
|
7
7
|
|
|
8
8
|
export const createWorksheetDetail = {
|
|
@@ -25,13 +25,21 @@ export const createWorksheetDetail = {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
if (worksheetDetail.targetInventory && worksheetDetail.targetInventory.id) {
|
|
28
|
-
worksheetDetail.targetInventory = await tx
|
|
28
|
+
worksheetDetail.targetInventory = await tx
|
|
29
|
+
.getRepository(OrderInventory)
|
|
30
|
+
.findOne(worksheetDetail.targetInventory.id)
|
|
29
31
|
}
|
|
30
32
|
|
|
31
33
|
if (worksheetDetail.targetVas && worksheetDetail.targetVas.id) {
|
|
32
34
|
worksheetDetail.targetVas = await tx.getRepository(OrderVas).findOne(worksheetDetail.targetVas.id)
|
|
33
35
|
}
|
|
34
36
|
|
|
37
|
+
if (worksheetDetail.targetInventoryCheckItem && worksheetDetail.targetInventoryCheckItem.id) {
|
|
38
|
+
worksheetDetail.targetInventoryCheckItem = await tx
|
|
39
|
+
.getRepository(InventoryCheckItem)
|
|
40
|
+
.findOne(worksheetDetail.targetInventoryCheckItem.id)
|
|
41
|
+
}
|
|
42
|
+
|
|
35
43
|
return await tx.getRepository(WorksheetDetail).save({
|
|
36
44
|
...worksheetDetail,
|
|
37
45
|
domain,
|
|
@@ -14,7 +14,18 @@ export const worksheetDetailResolver = {
|
|
|
14
14
|
bizplace: In(await getPermittedBizplaceIds(domain, user)),
|
|
15
15
|
name
|
|
16
16
|
},
|
|
17
|
-
relations: [
|
|
17
|
+
relations: [
|
|
18
|
+
'domain',
|
|
19
|
+
'bizplace',
|
|
20
|
+
'worksheet',
|
|
21
|
+
'worker',
|
|
22
|
+
'targetInventory',
|
|
23
|
+
'targetInventoryCheckItem',
|
|
24
|
+
'targetProduct',
|
|
25
|
+
'targetVas',
|
|
26
|
+
'creator',
|
|
27
|
+
'updater'
|
|
28
|
+
]
|
|
18
29
|
})
|
|
19
30
|
}
|
|
20
31
|
}
|
|
@@ -95,9 +95,21 @@ export const Mutation = /* GraphQL */ `
|
|
|
95
95
|
generateCycleCountWorksheet (
|
|
96
96
|
executionDate: String!
|
|
97
97
|
customerId: String!
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
inventoryCheckItemIds: [String]
|
|
99
|
+
inventoryCheckItems: [InventoryCheckItemPatch]
|
|
100
100
|
limit: Int
|
|
101
|
+
selectedLocation: [String]
|
|
102
|
+
cycleCountNo: String
|
|
103
|
+
): CycleCountWorksheet @privilege(category: "worksheet_control", privilege: "mutation") @transaction
|
|
104
|
+
|
|
105
|
+
generateCycleCountWorksheetCarton (
|
|
106
|
+
executionDate: String!
|
|
107
|
+
customerId: String!
|
|
108
|
+
cycleCountNo: String
|
|
109
|
+
cartonIds: [String]
|
|
110
|
+
batchIds: [String]
|
|
111
|
+
productDetailIds: [String]
|
|
112
|
+
locationNames: [String]
|
|
101
113
|
): CycleCountWorksheet @privilege(category: "worksheet_control", privilege: "mutation") @transaction
|
|
102
114
|
|
|
103
115
|
generateReturnOrderWorksheet (
|
|
@@ -231,6 +243,7 @@ export const Mutation = /* GraphQL */ `
|
|
|
231
243
|
): Boolean @privilege(category: "worksheet_execute", privilege: "mutation") @transaction
|
|
232
244
|
|
|
233
245
|
cycleCountAdjustment (
|
|
246
|
+
worksheetNo: String!
|
|
234
247
|
cycleCountNo: String!
|
|
235
248
|
): Boolean @privilege(category: "inventory_adjustment_approval", privilege: "mutation") @transaction
|
|
236
249
|
|
|
@@ -440,22 +453,47 @@ export const Mutation = /* GraphQL */ `
|
|
|
440
453
|
releaseQty: Int!
|
|
441
454
|
): Boolean @privilege(category: "worksheet_execute", privilege: "mutation") @transaction
|
|
442
455
|
|
|
443
|
-
|
|
456
|
+
|
|
457
|
+
inspectingPallet (
|
|
444
458
|
worksheetDetailName: String!
|
|
445
459
|
inspectedBatchNo: String!
|
|
446
460
|
inspectedQty: Int!
|
|
447
461
|
inspectedUomValue: Float!
|
|
448
462
|
): Boolean @privilege(category: "worksheet_execute", privilege: "mutation") @transaction
|
|
449
463
|
|
|
464
|
+
inspectingCarton (
|
|
465
|
+
productDetailId: String!
|
|
466
|
+
cartonId: String!
|
|
467
|
+
batchId: String!
|
|
468
|
+
locationId: String!
|
|
469
|
+
inspectedBatchNo: String!
|
|
470
|
+
inspectedQty: Int!
|
|
471
|
+
inspectedUomValue: Float!
|
|
472
|
+
): Boolean @privilege(category: "worksheet_execute", privilege: "mutation") @transaction
|
|
473
|
+
|
|
450
474
|
undoInspection (
|
|
451
475
|
worksheetDetailName: String!
|
|
452
476
|
): Boolean @privilege(category: "worksheet_execute", privilege: "mutation") @transaction
|
|
453
477
|
|
|
454
|
-
|
|
478
|
+
undoInspectionCarton (
|
|
479
|
+
productDetailId: String!
|
|
480
|
+
cartonId: String!
|
|
481
|
+
batchId: String!
|
|
482
|
+
locationId: String!
|
|
483
|
+
): Boolean @privilege(category: "worksheet_execute", privilege: "mutation") @transaction
|
|
484
|
+
|
|
485
|
+
checkMissingInventory (
|
|
455
486
|
worksheetDetailName: String!
|
|
456
487
|
): Boolean @privilege(category: "worksheet_execute", privilege: "mutation") @transaction
|
|
457
488
|
|
|
458
|
-
|
|
489
|
+
checkMissingInventoryCarton (
|
|
490
|
+
productDetailId: String!
|
|
491
|
+
cartonId: String!
|
|
492
|
+
batchId: String!
|
|
493
|
+
locationId: String!
|
|
494
|
+
): Boolean @privilege(category: "worksheet_execute", privilege: "mutation") @transaction
|
|
495
|
+
|
|
496
|
+
relocateInventory (
|
|
459
497
|
worksheetDetailName: String!
|
|
460
498
|
inspectedBatchNo: String!
|
|
461
499
|
inspectedQty: Int!
|
|
@@ -463,15 +501,29 @@ export const Mutation = /* GraphQL */ `
|
|
|
463
501
|
inspectedLocationName: String!
|
|
464
502
|
): Boolean @privilege(category: "worksheet_execute", privilege: "mutation") @transaction
|
|
465
503
|
|
|
466
|
-
|
|
504
|
+
relocateInventoryCarton (
|
|
505
|
+
productDetailId: String!
|
|
506
|
+
cartonId: String!
|
|
507
|
+
batchId: String!
|
|
508
|
+
locationId: String!
|
|
509
|
+
inspectedBatchNo: String!
|
|
510
|
+
inspectedQty: Int!
|
|
511
|
+
inspectedUomValue: Float!
|
|
512
|
+
inspectedLocationName: String!
|
|
513
|
+
): Boolean @privilege(category: "worksheet_execute", privilege: "mutation") @transaction
|
|
514
|
+
|
|
515
|
+
addExtraInventory (
|
|
467
516
|
cycleCountNo: String!
|
|
468
|
-
|
|
517
|
+
inspectedLocation: String!
|
|
518
|
+
productDetailId: String!
|
|
519
|
+
productId: String!
|
|
469
520
|
inspectedBatchNo: String!
|
|
470
521
|
inspectedQty: Int!
|
|
471
522
|
inspectedUomValue: Float!
|
|
472
|
-
|
|
523
|
+
countNo: Int!
|
|
473
524
|
): Boolean @privilege(category: "worksheet_execute", privilege: "mutation") @transaction
|
|
474
525
|
|
|
526
|
+
|
|
475
527
|
completePicking (
|
|
476
528
|
releaseGoodNo: String!
|
|
477
529
|
): Inventory @privilege(category: "worksheet_execute", privilege: "mutation") @transaction
|
|
@@ -717,7 +769,11 @@ export const Query = /* GraphQL */ `
|
|
|
717
769
|
taskNo: String!
|
|
718
770
|
): ExecutingWorksheet @privilege(category: "worksheet", privilege: "query")
|
|
719
771
|
|
|
720
|
-
|
|
772
|
+
cycleCountWorksheetForPallet (
|
|
773
|
+
inventoryCheckNo: String!, locationSortingRules: [Sorting]
|
|
774
|
+
): ExecutingWorksheet @privilege(category: "worksheet", privilege: "query")
|
|
775
|
+
|
|
776
|
+
cycleCountWorksheetForCarton (
|
|
721
777
|
inventoryCheckNo: String!, locationSortingRules: [Sorting]
|
|
722
778
|
): ExecutingWorksheet @privilege(category: "worksheet", privilege: "query")
|
|
723
779
|
|
|
@@ -58,6 +58,8 @@ export const WorksheetDetailInfo = gql`
|
|
|
58
58
|
reusablePallet: Pallet
|
|
59
59
|
relatedOrderInv: OrderInventory
|
|
60
60
|
targetInventory: OrderInventory
|
|
61
|
+
relatedInvCheckItem: InventoryCheckItem
|
|
62
|
+
targetInventoryCheckItem: InventoryCheckItem
|
|
61
63
|
releaseGood: ReleaseGood
|
|
62
64
|
actualQty: Int
|
|
63
65
|
actualUomValue: Float
|
|
@@ -70,5 +72,6 @@ export const WorksheetDetailInfo = gql`
|
|
|
70
72
|
packingTypeSize: String
|
|
71
73
|
reusablePalletName: String
|
|
72
74
|
expirationPeriod: Int
|
|
75
|
+
productDetail: ProductDetail
|
|
73
76
|
}
|
|
74
77
|
`
|
|
@@ -13,6 +13,7 @@ export const Worksheet = gql`
|
|
|
13
13
|
replenishment: Replenishment
|
|
14
14
|
returnOrder: ReturnOrder
|
|
15
15
|
inventoryCheck: InventoryCheck
|
|
16
|
+
inventoryCheckItems: [InventoryCheckItem]
|
|
16
17
|
orderInventories: [OrderInventory]
|
|
17
18
|
shippingOrder: ShippingOrder
|
|
18
19
|
vasOrder: VasOrder
|
|
@@ -27,6 +28,7 @@ export const Worksheet = gql`
|
|
|
27
28
|
status: String
|
|
28
29
|
startedAt: String
|
|
29
30
|
endedAt: String
|
|
31
|
+
checkCount: Int
|
|
30
32
|
creator: User
|
|
31
33
|
updater: User
|
|
32
34
|
createdAt: String
|
|
@@ -13,6 +13,7 @@ export const WorksheetDetailPatch = gql`
|
|
|
13
13
|
targetProduct: OrderProductPatch
|
|
14
14
|
targetVas: OrderVasPatch
|
|
15
15
|
targetInventory: OrderInventoryPatch
|
|
16
|
+
targetInventoryCheckItem: InventoryCheckItemPatch
|
|
16
17
|
fromLocation: ObjectRef
|
|
17
18
|
toLocation: ObjectRef
|
|
18
19
|
batchId: String
|