# Open Packing Container ## Overview After creating a Material to be packed, assign it to a Packing Container Material. The MES should be able to create a material of type Packing Container in which other materials will be packed into. ### Concept In order to open a **Container**, the user should go to the Resource page and open the **Resource View**. !!! note "The user should see the section "Scan Materials"." In the **Scan Materials wizard** the user can access the materials ready to be packed into a new or existing **Packing Container Material**. ??? note "Packing container material creation" When a **Material is selected for packing** we check the assigned **Container Products** and select one of them as the base for the **Container Material** to be created. When selecting multiple materials, all must have the same following parameters, to be able to pack: - Product - Form - Primary Unit - Production Order or None - Flow Path - Material Type The selected **Packing Container Product** must be of type **Packing Container** (Attribute IsPackingContainer=TRUE). - A **Packing Container Material** is then created with the following constraints: - Form = PackingContainer - Product = Container Product (Selected from **Container Products**) - Primary Quantity = 0 - Flow and Step = Flow and Step from **Material selected for packing** - Packing State Attribute set to **Open** If the Step is a **Packing Step** (Step Attribute IsPacking=TRUE), we Track In the created **Packing Container Material** in the Resource provided to the API. We then resolve the table **Material Printable Document Context** using the operation type (**OpenPackingContainer**) and the **Packing Container Product**. If any labels are returned we issue a printing operation. If there is no entry on the table for this operation, no label printing will occur. Finally the **AddItemsToPackingContainer** API is called to handle the actual packing process by adding the **Material selected for packing** into the **Packing Container Material**. After opening a **Packing Container Material**, the user should be able to associate new Materials to a container. - For that, the operator must scan one material (that is a container) and then select the option to `Add items`. - Then, a wizard should open with the current material associated with the Container, and in order to add, the user can select Materials manually or by using the scan. - As soon as the MES captures the selected/scanned Material it will automatically add it to the Container and generate the Label for that Material. - Lastly, the user has the following options: - `Close the container` if desired. - `Close the Container and TrackOut` which also performs the TrackOut operation after closing the container. - The `Cancel` button. !!! info "Preconditions" - The Packing Container Product must have the attribute `IsPackingContainer` set - The Material selected for packing must have the `FlowPath` set - The Step must have the `IsPacking` attribute set - The necessary [SMTMaterialPackingContext](../../artifacts/tables.md#smtmaterialpackingcontext) and [SMTMaterialPrintableDocumentContext](../../artifacts/tables.md#smtmaterialprintabledocumentcontext) smart tables should be set - The name generator `MaterialNameGenerator` should also be set ## Setting up Set the [SMTMaterialPackingContext](../../artifacts/tables.md#smtmaterialpackingcontext) with the Product of the Material to be packed and the Product of the Container to be associated: ![Screenshot](images/open/smtmaterialpackingcontext.png) Set the [SMTMaterialNameGenerationContext](../../artifacts/tables.md#smtmaterialnamegenerationcontext) with the Step where the Packing operation will occur, the **PackingContainer** material Form and the Name Generator desired: ![Screenshot](images/open/st_namegeneratorcontext.png) Set the [SMTMaterialPrintableDocumentContext](../../artifacts/tables.md#smtmaterialprintabledocumentcontext) for the Open Container operation, the **PackingContainer** material Form, the packing Step and the desired Label (**This is an optional step, skip this if you don't want labels to be printed**): ![Screenshot](images/open/smtmaterialprintabledocumentcontext.png) Check that the Container Product has the IsPackingContainer attribute set to true, you can also set the MinimumPackingQuantity and MaximumPackingQuantity attributes here: ![Screenshot](images/open/ispackingcontainerminmax.png) Check that the Packing Step has the IsPacking attribute set to true: ![Screenshot](images/open/ispackingstep.png) ## Executing Create one or multiple materials to pack: ![Screenshot](images/open/materialtopack.png) Open the **Resource View** of the Resource where the packing operation will occur and search for the Material to pack and click in Open Container: ![Screenshot](images/open/clickopencontainer.png) The Open Container Wizard shall appear, simply click Open to open the container. ![Screenshot](images/open/openwizard.png) ## Administration The user will need the `Smt.OpenContainer` feature in order to access the wizard.