# PurchaseOrderProductionOrderLinks

> Which purchase is meant for which production order: one row per purchase status row and pre-calculation part (a material, outsourced item or buy part of a production order's assembly), with the quantity.

Subject: Purchase.

Which purchase is meant for which production order: one row per purchase status row and pre-calculation part (a material, outsourced item or buy part of a production order's assembly), with the quantity. Made when the part is ordered from the production order or the order advice. The link moves to the new status row on every purchase action, so it sits on an open row until the purchase line moves to history; then it stays without a status row, and an expand of PurchaseOrderLineStatus or PurchaseOrderLine leaves it out.

Label in Fledge: Inkooporder koppeling met productieorder.

| | |
| --- | --- |
| URL | `https://odata-api.fledge.nl/v2-8/PurchaseOrderProductionOrderLinks` |
| Key | `administration_id`, `material_outsourcing_purchase_part`, `production_order_assembly_id`, `production_order_header_id`, `purchase_order_header_id`, `purchase_order_line_id`, `purchase_order_line_status_id`, `type` |
| Administration-specific | yes: always filter on `administration_id` |
| Operations | GET list, GET one, POST, PATCH, DELETE |
| Read licenses | BASIS, URENPC |
| Write licenses | PRODUCTIE, INKOOP |
| Scopes | FLEDGE_PORTAL, FLEDGE_TERMINAL |

## Example requests

```http
GET https://odata-api.fledge.nl/v2-8/PurchaseOrderProductionOrderLinks?$filter=administration_id eq 1&$select=material_outsourcing_purchase_part,production_order_assembly_id,production_order_header_id,purchase_order_header_id,purchase_order_line_id,purchase_order_line_status_id,type,invoice_is_booked,is_processed,quantity&$top=50
GET https://odata-api.fledge.nl/v2-8/PurchaseOrderProductionOrderLinks(administration_id=1,material_outsourcing_purchase_part={material_outsourcing_purchase_part},production_order_assembly_id={production_order_assembly_id},production_order_header_id='{production_order_header_id}',purchase_order_header_id='{purchase_order_header_id}',purchase_order_line_id={purchase_order_line_id},purchase_order_line_status_id={purchase_order_line_status_id},type={type})
```

## Fields

| Field | Type | Description |
| --- | --- | --- |
| `administration_id` (key) | Int32 | Administratienummer |
| `purchase_order_header_id` (key) | String, not null | Ordernummer |
| `material_outsourcing_purchase_part` (key) | Int32, not null | MUK nummer. The id of the part, of the kind type says: PreCalculationMaterials (1), PreCalculationOutsourcedItems (2) or PreCalculationBuyMakeParts (3). The three navigations don't check the type, so expand only the one that fits. |
| `type` (key) | Int32, not null | Type (materiaal, uitbesteding, koopdeel). What kind of part material_outsourcing_purchase_part is; always filter on both together.. Values: 0 = The assembly itself, not a component; 1 = Material (materiaal); 2 = Outsourcing (uitbesteding); 3 = Buy part (koopdeel); 4 = Order cost |
| `purchase_order_line_id` (key) | Int32, not null | Regelnummer |
| `purchase_order_line_status_id` (key) | Int32, not null | Volgnummer |
| `production_order_header_id` (key) | String, not null | Order nummer |
| `production_order_assembly_id` (key) | Int32, not null | Schrapnummer. The assembly of the production order (schrapnummer). |
| `date_invoice` | Date | Factuur datum |
| `invoice_is_booked` | Boolean | Factuur geboekt. Whether the purchase invoice is booked, with price_post_calculation (the price that goes to the production order's post-calculation) and date_invoice. price_post_calculation 0 means not invoiced yet, not free. |
| `is_processed` | Boolean | Verwerkt. Whether the need is covered even though less was received. |
| `price_post_calculation` | Decimal | Prijs NC |
| `quantity` | Decimal | Aantal. The quantity of the purchase meant for this part. |

## Relations

- `Administration` → [Administrations](https://docs.fledge.nl/en/api/reference/Administrations.md) (one)
- `PreCalculationBuyMakeParts` → [PreCalculationBuyMakeParts](https://docs.fledge.nl/en/api/reference/PreCalculationBuyMakeParts.md) (one)
- `PreCalculationMaterials` → [PreCalculationMaterials](https://docs.fledge.nl/en/api/reference/PreCalculationMaterials.md) (one)
- `PreCalculationOutsourcedItems` → [PreCalculationOutsourcedItems](https://docs.fledge.nl/en/api/reference/PreCalculationOutsourcedItems.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)
- `PurchaseOrderHeader` → [PurchaseOrderHeaders](https://docs.fledge.nl/en/api/reference/PurchaseOrderHeaders.md) (one)
- `PurchaseOrderLine` → [PurchaseOrderLines](https://docs.fledge.nl/en/api/reference/PurchaseOrderLines.md) (one)
- `PurchaseOrderLineStatus` → [PurchaseOrderLineStatuses](https://docs.fledge.nl/en/api/reference/PurchaseOrderLineStatuses.md) (one)

---

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