# PostCalculationSubOperations

> One booking of an operation on a production order assembly in the post-calculation (nacalculatie): time and cost booked on a planned operation line.

Subject: Production.

One booking of an operation on a production order assembly in the post-calculation (nacalculatie): time and cost booked on a planned operation line. Made when booked hours are processed. For every planned operation the backend also keeps an empty row with is_dummy = true; those are no bookings.

Label in Fledge: Productieorder NC bewerkingen sub.

| | |
| --- | --- |
| URL | `https://odata-api.fledge.nl/v2-8/PostCalculationSubOperations` |
| Key | `administration_id`, `main_operation_id`, `post_calculation_sub_operation_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, PRODUCTIE |
| Write licenses | PRODUCTIE, BEHEER |
| Scopes | FLEDGE_PORTAL |

> **Watch out:** Every planned operation has an empty post-calculation row with is_dummy = true. Add is_dummy eq false, or the empty rows count as bookings.

## Example requests

```http
GET https://odata-api.fledge.nl/v2-8/PostCalculationSubOperations?$filter=administration_id eq 1&$select=main_operation_id,post_calculation_sub_operation_id,production_order_assembly_id,production_order_header_id,operation_duration,operation_duration_hours,pre_calculation_sub_operation_id&$top=50
GET https://odata-api.fledge.nl/v2-8/PostCalculationSubOperations(administration_id=1,main_operation_id={main_operation_id},post_calculation_sub_operation_id={post_calculation_sub_operation_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 |
| `main_operation_id` (key) | Int32, not null | Hoofdbewerkings nummer |
| `post_calculation_sub_operation_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 |
| `amount` | Decimal | Bedrag nc |
| `are_hours_ready` | Boolean | Uren gereed |
| `date` | Date | Datum |
| `description` | String | Omschrijving |
| `employee_ready` | Int32 | Medewerker gereedmelding |
| `invoice_number` | String | Faktuurnummer |
| `is_parked` | Boolean | Parkeren |
| `operation_duration` | Int32 | Bewtijd totaal: Bewerkingstijd totaal. The time booked, in seconds. |
| `operation_duration_hours` | Int32 | Bew. tijd man: Bewerkingstijd man. Despite its name, the man time, in seconds. |
| `pre_calculation_sub_operation_id` | Int32 | Volgnummer. The planned operation line it was booked on, together with main_operation_id; 0 or empty when it was booked on no planned line. |
| `price` | Decimal | Prijs. The cost of the booking, as the app shows it. |
| `rate` | Decimal | Tarief |
| `ready_date` | Date | Datum gereedmelding |
| `sequence` | Int32 | Volgorde |
| `set_up_code` | Boolean | Instelcode |
| `status` | Int32 | Status |
| `sub_operation_id` | Int32 | Subbewerkingsnummer |
| `is_dummy` | Boolean | Dummy vc. True for the empty row kept for every planned operation. Always filter is_dummy eq false. |

## Relations

- `Administration` → [Administrations](https://docs.fledge.nl/en/api/reference/Administrations.md) (one)
- `MainOperation` → [MainOperations](https://docs.fledge.nl/en/api/reference/MainOperations.md) (one)
- `PreCalculationSubOperation` → [PreCalculationSubOperations](https://docs.fledge.nl/en/api/reference/PreCalculationSubOperations.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)
- `SubOperation` → [SubOperations](https://docs.fledge.nl/en/api/reference/SubOperations.md) (one)

---

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