Generating Inventories from OrderRequest
support#43 (closed) describes the idea to create a new Inventory
record for each OrderRequestItem
in a OrderRequest
.
The API endpoint in OrderRequestController
.../generate-inventories will for every OrderRequestItem
in the selected OrderRequest
create a new inventory i
record based on ori.inventory
:
i.site = ori.inventory.site
i.accession = ori.inventory.accession
i.parent = ori.inventory
-
i.inventoryNumberPart2 = -1
to force generation of a new number -
i.isDistributable
set toN
-
i.isAvailable
set toN
-
i.quantityOnHand
set tonull
-
i.storageLocation1..4
set tonull
The reference to the new inventory is also recorded in OrderRequestItem ori
in a new field @OneToOne Inventory withdrawnInventory
.