# HistoricProductionOrderAssemblies

> One assembly of a finished production order (productiehistorie), with the final pre-calculation (VC) and post-calculation (NC) figures.

Subject: Production.

One assembly of a finished production order (productiehistorie), with the final pre-calculation (VC) and post-calculation (NC) figures. Join it to HistoricProductionOrderHeaders on historic_production_order_header_id, and its operations (HistoricPreCalculationSubOperations) on historic_production_order_header_id and historic_production_order_assembly_id. There is no reference table, so the assembly tree of a finished order can't be rebuilt.

Label in Fledge: Productieorder historie schraps.

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

## Example requests

```http
GET https://odata-api.fledge.nl/v2-8/HistoricProductionOrderAssemblies?$filter=administration_id eq 1&$select=historic_production_order_assembly_id,historic_production_order_header_id,article,assembly_reference,calculation_quantity&$top=50
GET https://odata-api.fledge.nl/v2-8/HistoricProductionOrderAssemblies(administration_id=1,historic_production_order_assembly_id={historic_production_order_assembly_id},historic_production_order_header_id='{historic_production_order_header_id}')
```

## Fields

| Field | Type | Description |
| --- | --- | --- |
| `administration_id` (key) | Int32 | Administratienummer |
| `historic_production_order_header_id` (key) | String, not null | Ordernummer |
| `historic_production_order_assembly_id` (key) | Int32, not null | Schrap |
| `address` | Int32 | Adres |
| `article` | String | Artikel. The article the assembly makes (article_id elsewhere). |
| `article_custom_field_set_id` | Int32 | Volgnummer |
| `article_group` | Int32 | Artikelgroep |
| `assembly_reference` | String | Referentie. The free-text reference (Referentie), not a link to another assembly. |
| `billable_buy_make_parts_post_calculation` | Decimal | Deklarabel koop-/maakdelen NC |
| `billable_materials_post_calculation` | Decimal | Deklarabel materiaal NC |
| `billable_operations_post_calculation` | Decimal | Deklarabel bewerkingen NC |
| `billable_order_costs_post_calculation` | Decimal | Deklarabel orderkosten NC |
| `billable_outsourcing_post_calculation` | Decimal | Deklarabel uitbesteding NC |
| `billable_setup_cost_post_calculation` | Decimal | Deklarabel instelkosten NC |
| `billable_total_post_calculation` | Decimal | Totaal deklarabel NC |
| `calculation_assembly` | Int32 | Calculatie schrap |
| `calculation_header` | String | Calculatie |
| `calculation_quantity` | Decimal | Calculatie aantal. The quantity the assembly was costed at (Calculatie aantal). |
| `cost_price_buy_make_part_post_calculation` | Decimal | Kostprijs koop-/maakdeel NC |
| `cost_price_buy_make_part_post_calculation_same_assembly` | Decimal | Tot. kostprijs kmdelen schrap zelf, dus exclusief de bijdrage van in onderliggende schrap geproduceerde kmdelen. |
| `cost_price_buy_make_part_pre_calculation` | Decimal | Kostprijs koop-/maakdeel VC |
| `cost_price_materials_post_calculation` | Decimal | Kostprijs materiaal NC |
| `cost_price_materials_pre_calculation` | Decimal | Kostprijs materiaal VC |
| `cost_price_operations_post_calculation` | Decimal | Kostprijs bewerkingen NC |
| `cost_price_operations_pre_calculation` | Decimal | Kostprijs bewerkingen VC |
| `cost_price_order_cost_post_calculation` | Decimal | Kostprijs orderkosten NC |
| `cost_price_order_cost_pre_calculation` | Decimal | Kostprijs orderkosten VC |
| `cost_price_outsourcing_post_calculation` | Decimal | Kostprijs uitbesteding NC |
| `cost_price_outsourcing_pre_calculation` | Decimal | Kostprijs uitbesteding VC |
| `cost_price_post_calculation` | Decimal | Kostprijs NC. The booked cost of the assembly (Kostprijs NC). See cost_price_pre_calculation. |
| `cost_price_pre_calculation` | Decimal | Kostprijs VC. The planned cost of the assembly (Kostprijs VC). A line that made a sub assembly carries its cost, so the order's cost is the root's; adding up all assemblies counts sub assemblies twice. The same holds for cost_price_post_calculation and the other cost fields. Provisional: the app's finished-order margin reads the VC cost fields as per unit of the assembly and adds all assemblies up; the code doesn't settle which is right. |
| `cost_price_setup_post_calculation` | Decimal | Kostprijs instelkosten NC |
| `cost_price_setup_pre_calculation` | Decimal | Kostprijs instelkosten VC |
| `cost_price_system` | Int32 | Kostprijs systeem |
| `created_by` | Int32 | User aanmaak |
| `custom_field_1` | String | Veld 1 |
| `custom_field_10` | String | Vrije veld 10 |
| `custom_field_11` | String | Vrije veld 11 |
| `custom_field_12` | String | Vrije veld 12 |
| `custom_field_13` | String | Vrije veld 13 |
| `custom_field_14` | String | Vrije veld 14 |
| `custom_field_15` | String | Vrije veld 15 |
| `custom_field_16` | String | Vrij veld 16 |
| `custom_field_17` | String | Vrij veld 17 |
| `custom_field_18` | String | Vrij veld 18 |
| `custom_field_19` | String | Vrij veld 19 |
| `custom_field_2` | String | Vrije veld 2 |
| `custom_field_20` | String | Vrij veld 20 |
| `custom_field_21` | String | Vrij veld 21 |
| `custom_field_22` | String | Vrij veld 22 |
| `custom_field_23` | String | Vrij veld 23 |
| `custom_field_24` | String | Vrij veld 24 |
| `custom_field_25` | String | Vrij veld 25 |
| `custom_field_3` | String | Vrije veld 3 |
| `custom_field_4` | String | Vrije veld 4 |
| `custom_field_5` | String | Vrije veld 5 |
| `custom_field_6` | String | Vrije veld 6 |
| `custom_field_7` | String | Vrije veld 7 |
| `custom_field_8` | String | Vrije veld 8 |
| `custom_field_9` | String | Vrije veld 9 |
| `date_creation` | Date | Datum aanmaak |
| `date_external` | Date | Datum extern |
| `date_history` | Date | Datum historie. When the assembly moved to history. |
| `date_internal` | Date | Datum intern |
| `date_ready` | Date | Datum gereed |
| `description_1` | String | Omschrijving |
| `description_2` | String | Omschrijving |
| `description_3` | String | Omschrijving |
| `drawing_number` | String | Tekeningnr.: Tekeningnummer |
| `entry_operations_pre_calculation` | Decimal | Ingave bewerkingen VC |
| `entry_price_buy_make_part_pre_calculation` | Decimal | Ingave koop-/maakdeel VC: Ingave prijs koop-/maakdeel VC |
| `entry_price_materials_pre_calculation` | Decimal | Ingave materiaal VC: Ingave prijs materiaal VC |
| `entry_price_order_costs_pre_calculation` | Decimal | Ingave orderkosten VC |
| `entry_price_outsourcing_pre_calculation` | Decimal | Ingave uitbesteding VC: Ingave prijs uitbesteding VC |
| `entry_price_post_calculation` | Decimal | Ingave prijs NC |
| `entry_price_pre_calculation` | Decimal | Ingave prijs VC |
| `entry_time_manual_post_calculation` | Int32 | Insteltijd man NC |
| `entry_time_post_calculation` | Int32 | Insteltijd NC |
| `entry_time_pre_calculation` | Int32 | Insteltijd VC |
| `fase` | Int32 | Fase |
| `financial_period_id` | Int32 | Periode |
| `financial_year` | Int32 | Boekjaar |
| `level` | Int32 | Niveau. 1 is the root assembly, the one that makes the order's article. The legacy ERP gives every other assembly 2, whatever its depth. Only level eq 1 means something: use it to find the root, never as the depth or to find a parent. |
| `memo` | String | Memo |
| `net_gross_manual` | Int32 | Netto/bruto/handmatig |
| `operation_time_man_hours_post_calculation` | Int32 | Bewerkingstijd man NC |
| `operation_time_post_calculation` | Int32 | Bewerkingstijd NC |
| `operation_time_pre_calculation` | Int32 | Bewerkingstijd VC |
| `operator` | String | Operator |
| `production_quantity` | Decimal | Productie aantal. The quantity to produce. |
| `quantity_ready` | Decimal | Gereed aantal. The quantity reported ready. |
| `revenue_group` | Int32 | Omzetgroep |
| `revision` | String | Revisie |
| `surcharge_buy_make_part_pre_calculation` | Decimal | Opslag koop-/maakdeel VC |
| `surcharge_buy_part_post_calculation` | Decimal | Opslag koopdeel NC |
| `surcharge_machine_hours_post_calculation` | Decimal | Opslag machine uren NC |
| `surcharge_man_hours_post_calculation` | Decimal | Opslag man uren NC |
| `surcharge_materials_post_calculation` | Decimal | Opslag materiaal NC |
| `surcharge_materials_pre_calculation` | Decimal | Opslag materiaal VC |
| `surcharge_operations_pre_calculation` | Decimal | Opslag bewerkingen VC |
| `surcharge_outsourcing_pre_calculation` | Decimal | Opslag uitbesteding VC |
| `surcharge_outsouring_post_calculation` | Decimal | Opslag uitbesteding NC |
| `surcharge_setup_cost_pre_calculation` | Decimal | Instelkosten plus opslag VC |
| `surface_area` | Decimal | Oppervlakte |
| `unit_factor` | Decimal | Factor |
| `unit_production` | Int32 | Eenheid productie |
| `user_history` | Int32 | User historie |
| `user_ready` | Int32 | User gereed |
| `warehouse_aisle_id` | Int32 | Magazijn |
| `warehouse_shelf_id` | Int32 | Locatie |
| `weight` | Decimal | Gewicht |

## Relations

- `Administration` → [Administrations](https://docs.fledge.nl/en/api/reference/Administrations.md) (one)
- `HistoricProductionOrderHeader` → [HistoricProductionOrderHeaders](https://docs.fledge.nl/en/api/reference/HistoricProductionOrderHeaders.md) (one)

---

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