@things-factory/worksheet-base 4.3.448 → 4.3.452
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/outbound/picking-worksheet-controller.js +12 -8
- package/dist-server/controllers/outbound/picking-worksheet-controller.js.map +1 -1
- package/dist-server/controllers/vas/vas-worksheet-controller.js +8 -4
- package/dist-server/controllers/vas/vas-worksheet-controller.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/loading-worksheet.js +4 -1
- package/dist-server/graphql/resolvers/worksheet/loading-worksheet.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/picking/complete-batch-picking.js +2 -2
- package/dist-server/graphql/resolvers/worksheet/picking/complete-batch-picking.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/picking/complete-picking.js +2 -2
- package/dist-server/graphql/resolvers/worksheet/picking/complete-picking.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/vas/complete-vas.js +32 -1
- package/dist-server/graphql/resolvers/worksheet/vas/complete-vas.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/vas-worksheet.js +1 -0
- package/dist-server/graphql/resolvers/worksheet/vas-worksheet.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/worksheet.js +1 -1
- package/dist-server/graphql/resolvers/worksheet/worksheet.js.map +1 -1
- package/dist-server/graphql/types/worksheet/worksheet-info.js +1 -0
- package/dist-server/graphql/types/worksheet/worksheet-info.js.map +1 -1
- package/package.json +18 -18
- package/server/controllers/outbound/picking-worksheet-controller.ts +35 -31
- package/server/controllers/vas/vas-worksheet-controller.ts +9 -7
- package/server/graphql/resolvers/worksheet/loading-worksheet.ts +5 -2
- package/server/graphql/resolvers/worksheet/picking/complete-batch-picking.ts +2 -2
- package/server/graphql/resolvers/worksheet/picking/complete-picking.ts +2 -2
- package/server/graphql/resolvers/worksheet/vas/complete-vas.ts +38 -1
- package/server/graphql/resolvers/worksheet/vas-worksheet.ts +1 -0
- package/server/graphql/resolvers/worksheet/worksheet.ts +8 -25
- package/server/graphql/types/worksheet/worksheet-info.ts +1 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { User } from '@things-factory/auth-base'
|
|
2
|
-
import { ArrivalNotice, ReleaseGood } from '@things-factory/sales-base'
|
|
2
|
+
import { ArrivalNotice, ReleaseGood, OrderVas, OrderVasItem } from '@things-factory/sales-base'
|
|
3
3
|
import { Domain } from '@things-factory/shell'
|
|
4
4
|
import { EntityManager, getRepository, In } from 'typeorm'
|
|
5
5
|
import { WORKSHEET_TYPE } from '../../../../constants'
|
|
@@ -65,9 +65,46 @@ export async function completeVAS(
|
|
|
65
65
|
// await activateLoadingWorksheet(tx, domain, user, releaseGood)
|
|
66
66
|
// }
|
|
67
67
|
|
|
68
|
+
await setOrderVasStatus(tx, domain, user, orderNo)
|
|
69
|
+
|
|
68
70
|
return worksheet
|
|
69
71
|
}
|
|
70
72
|
|
|
73
|
+
export async function setOrderVasStatus(tx: EntityManager, domain: Domain, user: User, orderNo: string): Promise<void> {
|
|
74
|
+
const orderVasRepo: OrderVas = tx.getRepository(OrderVas)
|
|
75
|
+
const orderVasItemRepo: OrderVasItem = tx.getRepository(OrderVasItem)
|
|
76
|
+
|
|
77
|
+
const releaseGood: ReleaseGood = await getRepository(ReleaseGood).findOne({
|
|
78
|
+
where: { name: orderNo, domain: domain.id }
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
const orderVasList = await orderVasRepo.find({
|
|
82
|
+
where: {
|
|
83
|
+
releaseGood: releaseGood
|
|
84
|
+
}
|
|
85
|
+
})
|
|
86
|
+
|
|
87
|
+
// Update the status of each OrderVas to TERMINATED
|
|
88
|
+
for (const orderVas of orderVasList) {
|
|
89
|
+
orderVas.status = 'TERMINATED'
|
|
90
|
+
orderVas.updater = user
|
|
91
|
+
await orderVasRepo.save(orderVas)
|
|
92
|
+
|
|
93
|
+
// Find and update OrderVasItems
|
|
94
|
+
const orderVasItems = await orderVasItemRepo.find({
|
|
95
|
+
where: { orderVas: orderVas }
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
for (const item of orderVasItems) {
|
|
99
|
+
if (item.executedAt === null) {
|
|
100
|
+
item.executedAt = orderVas.updatedAt
|
|
101
|
+
item.updater = user
|
|
102
|
+
await orderVasItemRepo.save(item)
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
71
108
|
async function activatePutawayWorksheet(
|
|
72
109
|
tx: EntityManager,
|
|
73
110
|
domain: Domain,
|
|
@@ -1,32 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
} from 'typeorm'
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
MarketplaceOrder,
|
|
9
|
-
MarketplaceOrderShipping
|
|
10
|
-
} from '@things-factory/marketplace-base'
|
|
11
|
-
import {
|
|
12
|
-
ORDER_INVENTORY_STATUS,
|
|
13
|
-
OrderInventory,
|
|
14
|
-
OrderProduct,
|
|
15
|
-
OrderVas
|
|
16
|
-
} from '@things-factory/sales-base'
|
|
1
|
+
import { Equal, getRepository, Not } from 'typeorm'
|
|
2
|
+
|
|
3
|
+
import { MarketplaceOrder, MarketplaceOrderShipping } from '@things-factory/marketplace-base'
|
|
4
|
+
import { ORDER_INVENTORY_STATUS, OrderInventory, OrderProduct, OrderVas } from '@things-factory/sales-base'
|
|
17
5
|
import { Setting } from '@things-factory/setting-base'
|
|
18
6
|
import { Domain } from '@things-factory/shell'
|
|
19
|
-
import {
|
|
20
|
-
Inventory,
|
|
21
|
-
INVENTORY_STATUS,
|
|
22
|
-
InventoryHistory
|
|
23
|
-
} from '@things-factory/warehouse-base'
|
|
7
|
+
import { Inventory, INVENTORY_STATUS, InventoryHistory } from '@things-factory/warehouse-base'
|
|
24
8
|
|
|
25
9
|
import { WORKSHEET_TYPE } from '../../../constants'
|
|
26
|
-
import {
|
|
27
|
-
Worksheet,
|
|
28
|
-
WorksheetDetail
|
|
29
|
-
} from '../../../entities'
|
|
10
|
+
import { Worksheet, WorksheetDetail } from '../../../entities'
|
|
30
11
|
|
|
31
12
|
interface WorksheetInterface extends Worksheet {
|
|
32
13
|
orderProducts: OrderProduct[]
|
|
@@ -95,6 +76,8 @@ export const worksheetResolver = {
|
|
|
95
76
|
'worksheetDetails.targetInventory.inventory.location',
|
|
96
77
|
'worksheetDetails.targetVas',
|
|
97
78
|
'worksheetDetails.targetVas.product',
|
|
79
|
+
'worksheetDetails.targetVas.newProduct',
|
|
80
|
+
'worksheetDetails.targetVas.newProductDetail',
|
|
98
81
|
'worksheetDetails.targetVas.orderVasItems',
|
|
99
82
|
'worksheetDetails.targetVas.orderVasItems.vas',
|
|
100
83
|
'creator',
|