# PreCalculationBuyMakeParts

> One planned line of a buy or make part (koop-/maakdeel, halffabricaat) of a production order assembly in the pre-calculation (voorcalculatie).

Subject: Calculations.

One planned line of a buy or make part (koop-/maakdeel, halffabricaat) of a production order assembly in the pre-calculation (voorcalculatie). What was booked against it is in PostCalculationBuyMakeParts; a purchase order line is linked through PurchaseOrderProductionOrderLinks. Only live orders: a finished order's lines are not in this set.

Label in Fledge: Productieorder VC koop-/maakdelen.

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

## Example requests

```http
GET https://odata-api.fledge.nl/v2-8/PreCalculationBuyMakeParts?$filter=administration_id eq 1&$select=pre_calculation_buy_make_part_id,production_order_assembly_id,production_order_header_id,date_available,is_quantity_independent,is_reserved&$top=50
GET https://odata-api.fledge.nl/v2-8/PreCalculationBuyMakeParts(administration_id=1,pre_calculation_buy_make_part_id={pre_calculation_buy_make_part_id},production_order_assembly_id={production_order_assembly_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 |
| `pre_calculation_buy_make_part_id` (key) | Int32, not null | Order koopdeel nummer |
| `production_order_assembly_id` (key) | Int32, not null | Schrapnummer |
| `apply_replacement_value` | Boolean | Vervangingswaarde toepassen (j/n) |
| `date_available` | Date | Gewenste beschikbaarheids datum. The desired availability date (gewenste beschikbaarheid); can be empty. A purchase order made from the order advice doesn't take it over as its delivery date. |
| `delivery_text` | Int32 | Lev/art/tekst: Leverancier/artikel/tekst |
| `description_1` | String | Omschrijving |
| `description_2` | String | Omschrijving |
| `description_3` | String | Omschrijving |
| `drawing_number` | String | Tekeningnummer |
| `instruction` | Int32 | Voorschrift |
| `is_archived` | Boolean | Archief: Gearchiveerd |
| `is_ordered` | Boolean | Besteld j/n |
| `is_ordered_finished` | Boolean | Besteld afgewerkt |
| `is_stock` | Boolean | Voorraad j/n |
| `is_stock_finished` | Boolean | Voorraad afgwerkt: Voorraad afgewerkt |
| `measure_surface` | Boolean | Bepaal oppervlakte |
| `measure_weight` | Boolean | Bepaal gewicht |
| `memo` | String | Memo |
| `post_calculation_quantity_from_stock` | Decimal | Totaal aantal nc uit voorraad: Totale hoeveelheid NC die uit voorraad gehaald is |
| `pre_calculation_price` | Decimal | Declarabel bedrag |
| `produce` | Boolean | Produceren j/n |
| `production_finished` | Boolean | Produceren afgw.: Produceren afgewerkt |
| `purchase_status` | Int32 | Inkoop status |
| `quantity_from_stock` | Decimal | Totaal aantal uit voorraad: Totaal aantal NC dat uit voorraad gehaald zal worden |
| `revision` | String | Revisie |
| `storage` | Decimal | Opslag |
| `is_quantity_independent` | Boolean | Aantal onafhankelijk. True when the line counts once per order, whatever the quantity. |
| `warehouse_address_id` | Int32 | Adresnummer |
| `article_id` | String | Artikelcode |
| `creditor_id` | Int32 | Crediteurnummer |
| `article_custom_field_set_id` | Int32 | Volgnummer |
| `is_reserved` | Boolean | Gereserveerd. Stock is reserved for what is still needed, set when the assembly reaches the reservation status. |
| `sequence` | Int32 | Volgorde |
| `main_operation_id` | Int32 | Hoofdbewerkings nummer |
| `next_step` | Int32 | Vervolg (voorraad, inkoop, productie). What happens to the line, set by the backend. 0 means the need is still open (it shows in the order advice).. Values: 0 = None yet (the need is open); 1 = Stock (Uitgegeven); 2 = Purchase (Besteld); 3 = Production (Wordt geproduceerd); 4 = Return (Retour); 5 = Production on a separate order |
| `position_number` | String | Pos-nummer |
| `post_calculation_quantity` | Decimal | Aantal NC: Aantal gebruikt in NC. What has been accounted for so far in the post-calculation, by issues and purchase receipts. |
| `price` | Decimal | Prijs. The planned price for one unit of the assembly: multiply by the assembly's calculation_quantity for the order, except a line with is_quantity_independent, which counts once. |
| `quantity` | Decimal | Aantal |
| `sub_operation_id` | Int32 | Subbewerkingsnummer |
| `total_quantity` | Decimal | Totaal aantal VC. What the whole assembly needs, in the article's price unit, with net or gross and trade sizes applied. Still needed = total_quantity - post_calculation_quantity. |
| `warehouse_aisle_id` | Int32 | Magazijn |
| `warehouse_shelf_id` | Int32 | Locatie |

## Relations

- `Administration` → [Administrations](https://docs.fledge.nl/en/api/reference/Administrations.md) (one)
- `Article` → [Articles](https://docs.fledge.nl/en/api/reference/Articles.md) (one)
- `Creditor` → [Creditors](https://docs.fledge.nl/en/api/reference/Creditors.md) (one)
- `ProductionOrderAssemblies` → [ProductionOrderAssemblies](https://docs.fledge.nl/en/api/reference/ProductionOrderAssemblies.md) (one)
- `ProductionOrderHeader` → [ProductionOrderHeaders](https://docs.fledge.nl/en/api/reference/ProductionOrderHeaders.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)
- `PostCalculationBuyMakeParts` → [PostCalculationBuyMakeParts](https://docs.fledge.nl/en/api/reference/PostCalculationBuyMakeParts.md) (many)
- `PreCalculationSubOperationLinks` → [PreCalculationSubOperationLinks](https://docs.fledge.nl/en/api/reference/PreCalculationSubOperationLinks.md) (many)
- `PurchaseOrderProductionOrderLinks` → [PurchaseOrderProductionOrderLinks](https://docs.fledge.nl/en/api/reference/PurchaseOrderProductionOrderLinks.md) (many)

## Actions

- `POST PreCalculationBuyMakeParts(administration_id=1,pre_calculation_buy_make_part_id={pre_calculation_buy_make_part_id},production_order_assembly_id={production_order_assembly_id},production_order_header_id='{production_order_header_id}')/issueOut` — body: `account_date` Date; `quantity` Decimal; `postcalculation_excess_percentage` Decimal; `recalculate_origin` RecalculationOriginsEnum — returns PreCalculationBuyMakePart

---

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