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

URLhttps://odata-api.fledge.nl/v2-8/PurchaseOrderProductionOrderLinks
Keyadministration_idmaterial_outsourcing_purchase_partproduction_order_assembly_idproduction_order_header_idpurchase_order_header_idpurchase_order_line_idpurchase_order_line_status_idtype
AdministrationRows belong to one administration: always filter on administration_id.
OperationsGET listGET onePOSTPATCHDELETE
Read licensesBASISURENPC
Write licensesPRODUCTIEINKOOP
ScopesFLEDGE_PORTALFLEDGE_TERMINAL

Example requests

A page of rows, with only the fields you need. See Authentication for the token.

curl -G "https://odata-api.fledge.nl/v2-8/PurchaseOrderProductionOrderLinks" \
  --data-urlencode '$filter=administration_id eq 1' \
  --data-urlencode '$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' \
  --data-urlencode '$top=50' \
  -H "Authorization: Bearer $TOKEN"
const url = new URL('https://odata-api.fledge.nl/v2-8/PurchaseOrderProductionOrderLinks');
url.searchParams.set('$filter', 'administration_id eq 1');
url.searchParams.set('$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');
url.searchParams.set('$top', '50');

const response = await fetch(url, { headers: { Authorization: `Bearer ${token}` } });
const { value } = await response.json();
var url = "https://odata-api.fledge.nl/v2-8/PurchaseOrderProductionOrderLinks" + "?" + string.Join("&",
    "$filter=" + Uri.EscapeDataString("administration_id eq 1"),
    "$select=" + Uri.EscapeDataString("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=" + Uri.EscapeDataString("50"));

http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
var json = await http.GetStringAsync(url);

One row by its key:

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

FieldTypeDescription
administration_idkeyInt32Administratienummer
purchase_order_header_idkeyStringOrdernummer
material_outsourcing_purchase_partkeyInt32MUK 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.

typekeyInt32Type (materiaal, uitbesteding, koopdeel)

What kind of part material_outsourcing_purchase_part is; always filter on both together.

  • 0 The assembly itself, not a component
  • 1 Material (materiaal)
  • 2 Outsourcing (uitbesteding)
  • 3 Buy part (koopdeel)
  • 4 Order cost
purchase_order_line_idkeyInt32Regelnummer
purchase_order_line_status_idkeyInt32Volgnummer
production_order_header_idkeyStringOrder nummer
production_order_assembly_idkeyInt32Schrapnummer

The assembly of the production order (schrapnummer).

date_invoiceDateFactuur datum
invoice_is_bookedBooleanFactuur 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_processedBooleanVerwerkt

Whether the need is covered even though less was received.

price_post_calculationDecimalPrijs NC
quantityDecimalAantal

The quantity of the purchase meant for this part.

Relations

Read a related row or list in the same request with $expand, and give it its own $select; a list also needs a $top.

NavigationEntity set
AdministrationAdministrationsone
PreCalculationBuyMakePartsPreCalculationBuyMakePartsone
PreCalculationMaterialsPreCalculationMaterialsone
PreCalculationOutsourcedItemsPreCalculationOutsourcedItemsone
ProductionOrderAssemblyProductionOrderAssembliesone
ProductionOrderHeaderProductionOrderHeadersone
PurchaseOrderHeaderPurchaseOrderHeadersone
PurchaseOrderLinePurchaseOrderLinesone
PurchaseOrderLineStatusPurchaseOrderLineStatusesone
Wingman