One row per status of (part of) a purchase order line in the purchase orderflow. A line can be split over several open status rows, for example when part of it is received and the rest is still on order. A row is never changed to another status: every action closes it (is_finished = true, kept as the line's history) and opens new ones, with parent_status_id pointing back. The open rows (is_finished = false) are the current state. Which status an action leads to is configured per administration in NextStatuses (order type 30).
Label in Fledge: Inkooporder statusregels
| URL | https://odata-api.fledge.nl/v2-8/PurchaseOrderLineStatuses |
|---|---|
| Key | administration_idpurchase_order_header_idpurchase_order_line_idpurchase_order_line_status_id |
| Administration | Rows belong to one administration: always filter on administration_id. |
| Operations | GET listGET onePOSTPATCHDELETE |
| Read licenses | BASISURENPC |
| Write licenses | INKOOPBEHEER |
| Scopes | FLEDGE_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/PurchaseOrderLineStatuses" \
--data-urlencode '$filter=administration_id eq 1' \
--data-urlencode '$select=purchase_order_header_id,purchase_order_line_id,purchase_order_line_status_id,action,creation_date_time,delivery_note_number' \
--data-urlencode '$top=50' \
-H "Authorization: Bearer $TOKEN"const url = new URL('https://odata-api.fledge.nl/v2-8/PurchaseOrderLineStatuses');
url.searchParams.set('$filter', 'administration_id eq 1');
url.searchParams.set('$select', 'purchase_order_header_id,purchase_order_line_id,purchase_order_line_status_id,action,creation_date_time,delivery_note_number');
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/PurchaseOrderLineStatuses" + "?" + string.Join("&",
"$filter=" + Uri.EscapeDataString("administration_id eq 1"),
"$select=" + Uri.EscapeDataString("purchase_order_header_id,purchase_order_line_id,purchase_order_line_status_id,action,creation_date_time,delivery_note_number"),
"$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/PurchaseOrderLineStatuses(administration_id=1,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})Fields
| Field | Type | Description |
|---|---|---|
administration_idkey | Int32 | Administratienummer |
purchase_order_header_idkey | String | Ordernummer |
purchase_order_line_idkey | Int32 | Regelnummer |
purchase_order_line_status_idkey | Int32 | Volgnummer |
action | String | Actie Selecting it returns action__1 up to action__30, one flag per orderflow action number, as they were when the row was made. To filter on one, use action_flags, for example action_flags has FledgeDev.Enumerators.PurchaseOrderActionFlagsEnum'GOODS_RECEPTION' (action 9). |
created_by | Int32 | User aanmaak The user who did the action that made this row, so who approved it for a status 2 row. |
creation_date_time | DateTimeOffset | Aangemaakt: Aanmaakdatum en -tijd When the row was made, so when the line reached this status. |
delivery_note_number | String | Pakbonnummer Despite its name, the receipt number (PurchaseOrderReceiptHeaders.purchase_order_receipt_header_id), not the supplier's packing slip number; with receipt_id, the receipt line. Set on the row the receipt made, and copied to every later row of the same chain. |
has_remark | Boolean | Opmerking aanwezig (ja/nee) |
invoice_booking_year | Int32 | Boekjaar |
invoice_header_id | String | Factuurnummer The purchase invoice this quantity was booked on, with invoice_booking_year and invoice_line_id. Copied to later rows of the same chain. |
invoice_line_id | Int32 | Volgnummer |
is_dispute | Boolean | Opmerking meenemen als dispuut? Whether the receipt's remark is a dispute with the supplier. |
is_final_status | Boolean | Eindstatus True when no action at all is allowed on the row. Not the same as "the flow is done". |
is_finished | Boolean | Afgewerkt Whether this row is history. Filter on is_finished eq false for the current state. |
parent_status_id | Int32 | Parent The purchase_order_line_status_id of the row this one came from; 0 on a line's first row. |
price | Decimal | Prijs The net price per unit in the local currency (after the line's discount, without VAT), copied from the line's net_price_local_currency when the row was made, per price unit. Value of a row = quantity times price. |
purchase_order_instruction_header_id | Int32 | Volgnummer The order instruction (bestelopdracht) this row was sent in. Set on the row the instruction closed, not on the new status 3 row. |
purchase_order_instruction_line_id | Int32 | Regelnummer |
receipt_id | Int32 | Regelnummer The receipt line (PurchaseOrderReceiptLines.purchase_order_receipt_line_id) within delivery_note_number. |
remark | String | Opmerkings tekst The remark entered at the receipt. |
serial_number | Int32 | Serienummer autom.: Serienummer automatisch |
type | Int32 | Type Not used. |
article_id | String | Artikelcode |
lot_number | String | Lotnummer/partijregistratie |
quantity | Decimal | Aantal The part of the line's quantity that is in this status, in the article's price unit. Only open rows count. After a quantity change over several rows the open rows don't always add up to the line's quantity. |
status | Int32 | Status
|
warehouse_address_id | Int32 | Adresnummer |
warehouse_aisle_id | Int32 | Magazijn |
warehouse_shelf_id | Int32 | Locatie |
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.
| Navigation | Entity set | |
|---|---|---|
Administration | Administrations | one |
Article | Articles | one |
CreatedBy | Users | one |
PurchaseOrderHeader | PurchaseOrderHeaders | one |
PurchaseOrderInstructionHeader | PurchaseOrderInstructionHeaders | one |
PurchaseOrderInstructionLine | PurchaseOrderInstructionLines | one |
PurchaseOrderInvoiceHeader | PurchaseOrderInvoiceHeaders | one |
PurchaseOrderInvoiceLine | PurchaseOrderInvoiceLines | one |
PurchaseOrderLine | PurchaseOrderLines | one |
SerialNumber | SerialNumbers | one |
WarehouseAddress | WarehouseAddresses | one |
WarehouseAisle | WarehouseAisles | one |
WarehouseShelf | WarehouseShelfs | one |
PurchaseOrderProductionOrderLinks | PurchaseOrderProductionOrderLinks | many |
Actions
approve
POST https://odata-api.fledge.nl/v2-8/PurchaseOrderLineStatuses(administration_id=1,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})/approveReturns PurchaseOrderLineStatus
Licenses: BEHEER, INKOOP, PRODUCTIE