# ProductionOrderAssemblyStatuses

> One row per status of (part of) a production order assembly in the production orderflow.

Subject: Production.

One row per status of (part of) a production order assembly in the production orderflow. An assembly can be split over several open rows, for example when part of it is reported ready. A row is never changed to another status: every action closes it (is_finished = true, kept as history) and opens a new one, with parent_status_id pointing back. The open rows (is_finished = false) are the current state; the order's state is that of its root assembly (ProductionOrderAssembly/level eq 1). Which status an action leads to is configured per administration in NextStatuses (type 20).

Label in Fledge: Productieorder statusregels.

| | |
| --- | --- |
| URL | `https://odata-api.fledge.nl/v2-8/ProductionOrderAssemblyStatuses` |
| Key | `administration_id`, `production_order_assembly_id`, `production_order_assembly_status_id`, `production_order_header_id` |
| Administration-specific | yes: always filter on `administration_id` |
| Operations | GET list, GET one, POST, PATCH, DELETE |
| Read licenses | BASIS, BASISAPP, URENPC |
| Write licenses | PRODUCTIE, BEHEER |
| Scopes | FLEDGE_PORTAL, FLEDGE_TERMINAL |

> **Watch out:** Finished rows are history: every orderflow action keeps the old row with is_finished = true. Add is_finished eq false for the current state; leave it out only when the history is what you want.

> **Watch out:** Some administrations have no status 6: reporting ready leaves the row in 5, and the ready quantity is only in ProductionOrderAssemblies.amount_finished. Check the configuration (NextStatuses, type 20) before reading "ready" from status 6 alone. Status 9 is processed, which older screens also call "Gereed".

## Example requests

```http
GET https://odata-api.fledge.nl/v2-8/ProductionOrderAssemblyStatuses?$filter=administration_id eq 1&$select=production_order_assembly_id,production_order_assembly_status_id,production_order_header_id,action,creation_date_time,is_final_status&$top=50
GET https://odata-api.fledge.nl/v2-8/ProductionOrderAssemblyStatuses(administration_id=1,production_order_assembly_id={production_order_assembly_id},production_order_assembly_status_id={production_order_assembly_status_id},production_order_header_id='{production_order_header_id}')
```

## Fields

| Field | Type | Description |
| --- | --- | --- |
| `administration_id` (key) | Int32 | Administratienummer |
| `production_order_header_id` (key) | String, not null | Order nummer |
| `production_order_assembly_id` (key) | Int32, not null | Schrapnummer |
| `production_order_assembly_status_id` (key) | Int32, not null | Volgnummer. A sequence number within the assembly, not the status. |
| `action` | String | Is actie mogelijk j/n. Selecting it returns action__1 up to action__30, one flag per orderflow action number, as they were when the row was made. To filter on one, use action_flags, for example action_flags has FledgeDev.Enumerators.ProductionOrderActionFlagsEnum'ENTER_TIMESHEET_ENTRY' (action 13, hours can be booked). |
| `created_by` | Int32 | User aanmaak. The user who did the action that made this row, so who confirmed it for a status 2 row. |
| `creation_date_time` | DateTimeOffset | Aangemaakt: Aanmaakdatum en -tijd. When the row was made, so when the assembly reached this status. Local time, except rows the Fledge API made (since v2-8 in UTC), such as those of generating work documents. |
| `is_final_status` | Boolean | Eindstatus. True when no action at all was allowed on the row's status when it was made. A final row stays open. |
| `is_finished` | Boolean | Afgewerkt. Whether this row is history. Filter on is_finished eq false for the current state. |
| `parent_status_id` | Int32 | Parent. The production_order_assembly_status_id of the row this one came from. |
| `price` | Decimal | Prijs. The assembly's planned price for one unit (entry_price_pre_calculation) when the row was made, copied forward by later rows (provisional: shown for rows the Fledge API makes). |
| `serial_number` | Int32 | Serienummer autom.: Serienummer automatisch |
| `sscc_label_id` | Int64 | SSCC-code id: Uniek volgnummer SSCC-code |
| `article_id` | String | Artikelcode |
| `lot_number` | String | Lotnummer/partijregistratie. The lot made when the assembly was reported ready (status 6), carried to later rows. |
| `quantity` | Decimal | Aantal. The part of the assembly's quantity in this status, in the article's calculation unit. Only open rows count. |
| `status` | Int32 | Status. Values: 1 = Created (Aangemaakt); 2 = Confirmed (Bevestigd, formerly gefiatteerd); 3 = In planning; 4 = Planned (Gepland); 5 = In production (In productie); 6 = Ready (Gereed), quantities reported ready; 7 = Historic (Historisch); 8 = Deleted (Verwijderd); 9 = Processed (Verwerkt), financially ready; older word "Gereed" |
| `warehouse_address_id` | Int32 | Adresnummer |
| `warehouse_aisle_id` | Int32 | Magazijn |
| `warehouse_shelf_id` | Int32 | Locatie |

## Relations

- `Administrations` → [Administrations](https://docs.fledge.nl/en/api/reference/Administrations.md) (one)
- `Article` → [Articles](https://docs.fledge.nl/en/api/reference/Articles.md) (one)
- `CreatedBy` → [Users](https://docs.fledge.nl/en/api/reference/Users.md) (one)
- `ProductionOrderAssembly` → [ProductionOrderAssemblies](https://docs.fledge.nl/en/api/reference/ProductionOrderAssemblies.md) (one)
- `ProductionOrderHeader` → [ProductionOrderHeaders](https://docs.fledge.nl/en/api/reference/ProductionOrderHeaders.md) (one)
- `SerialNumber` → [SerialNumbers](https://docs.fledge.nl/en/api/reference/SerialNumbers.md) (one)
- `SsccLabel` → [SsccLabels](https://docs.fledge.nl/en/api/reference/SsccLabels.md) (one)
- `WarehouseAddress` → [WarehouseAddresses](https://docs.fledge.nl/en/api/reference/WarehouseAddresses.md) (one)
- `WarehouseAisle` → [WarehouseAisles](https://docs.fledge.nl/en/api/reference/WarehouseAisles.md) (one)
- `WarehouseShelf` → [WarehouseShelfs](https://docs.fledge.nl/en/api/reference/WarehouseShelfs.md) (one)

## Actions

- `POST ProductionOrderAssemblyStatuses(administration_id=1,production_order_assembly_id={production_order_assembly_id},production_order_assembly_status_id={production_order_assembly_status_id},production_order_header_id='{production_order_header_id}')/approve` — returns ProductionOrderAssemblyStatus
- `POST ProductionOrderAssemblyStatuses(administration_id=1,production_order_assembly_id={production_order_assembly_id},production_order_assembly_status_id={production_order_assembly_status_id},production_order_header_id='{production_order_header_id}')/generateWorkDocument` — returns ProductionOrderAssemblyStatus
- `POST ProductionOrderAssemblyStatuses/generateWorkDocument` — body: `ProductionOrderAssemblyStatuses` ProductionOrderAssemblyStatusKeyDto[]: administration_id (Int32), production_order_header_id (String), production_order_assembly_id (Int32), production_order_assembly_status_id (Int32) — returns ProductionOrderAssemblyStatus[]
- `POST ProductionOrderAssemblyStatuses(administration_id=1,production_order_assembly_id={production_order_assembly_id},production_order_assembly_status_id={production_order_assembly_status_id},production_order_header_id='{production_order_header_id}')/toProduction` — returns ProductionOrderAssemblyStatus

---

Source: https://docs.fledge.nl/en/api/reference/ProductionOrderAssemblyStatuses
