# PurchaseOrderLineStatuses

> One row per status of (part of) a purchase order line in the purchase orderflow.

Subject: Purchase.

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_id`, `purchase_order_header_id`, `purchase_order_line_id`, `purchase_order_line_status_id` |
| Administration-specific | yes: always filter on `administration_id` |
| Operations | GET list, GET one, POST, PATCH, DELETE |
| Read licenses | BASIS, URENPC |
| Write licenses | INKOOP, BEHEER |
| Scopes | FLEDGE_PORTAL, FLEDGE_TERMINAL |

> **Watch out:** Finished rows are history: every orderflow action keeps the old row with is_finished = true. Add is_finished eq false for the current state; leave it out only when the history is what you want.

> **Watch out:** Status 3 is only part of what is still to be received: rows approved or created but not ordered yet (1, 2), and in some administrations received rows, can still allow a receipt. For "still to receive" filter on the receipt action instead: action_flags has FledgeDev.Enumerators.PurchaseOrderActionFlagsEnum'GOODS_RECEPTION'.

> **Watch out:** Status 2 is the internal approval (Bevestigen in the orderflow). Whether the supplier confirmed the order is PurchaseOrderHeaders.is_confirmed and confirmed_date instead. Check which one the user means.

## Example requests

```http
GET https://odata-api.fledge.nl/v2-8/PurchaseOrderLineStatuses?$filter=administration_id eq 1&$select=purchase_order_header_id,purchase_order_line_id,purchase_order_line_status_id,action,creation_date_time,delivery_note_number&$top=50
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_id` (key) | Int32 | Administratienummer |
| `purchase_order_header_id` (key) | String, not null | Ordernummer |
| `purchase_order_line_id` (key) | Int32, not null | Regelnummer |
| `purchase_order_line_status_id` (key) | Int32, not null | 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. Values: 1 = Created (Aangemaakt); 2 = Approved (Bevestigd, formerly goedgekeurd or gefiatteerd); 3 = Ordered (Besteld); 4 = Received (Ontvangen); 5 = Inspected (Gekeurd); 6 = Invoice booked (Factuur geboekt); 7 = Historic (Historisch); 8 = Deleted (Verwijderd); 9 = Not received (Niet ontvangen); 10 = Delivery note processed (Pakbon verwerkt); 11 = Not invoiced (Niet gefactureerd) |
| `warehouse_address_id` | Int32 | Adresnummer |
| `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)
- `CreatedBy` → [Users](https://docs.fledge.nl/en/api/reference/Users.md) (one)
- `PurchaseOrderHeader` → [PurchaseOrderHeaders](https://docs.fledge.nl/en/api/reference/PurchaseOrderHeaders.md) (one)
- `PurchaseOrderInstructionHeader` → [PurchaseOrderInstructionHeaders](https://docs.fledge.nl/en/api/reference/PurchaseOrderInstructionHeaders.md) (one)
- `PurchaseOrderInstructionLine` → [PurchaseOrderInstructionLines](https://docs.fledge.nl/en/api/reference/PurchaseOrderInstructionLines.md) (one)
- `PurchaseOrderInvoiceHeader` → [PurchaseOrderInvoiceHeaders](https://docs.fledge.nl/en/api/reference/PurchaseOrderInvoiceHeaders.md) (one)
- `PurchaseOrderInvoiceLine` → [PurchaseOrderInvoiceLines](https://docs.fledge.nl/en/api/reference/PurchaseOrderInvoiceLines.md) (one)
- `PurchaseOrderLine` → [PurchaseOrderLines](https://docs.fledge.nl/en/api/reference/PurchaseOrderLines.md) (one)
- `SerialNumber` → [SerialNumbers](https://docs.fledge.nl/en/api/reference/SerialNumbers.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)
- `PurchaseOrderProductionOrderLinks` → [PurchaseOrderProductionOrderLinks](https://docs.fledge.nl/en/api/reference/PurchaseOrderProductionOrderLinks.md) (many)

## Actions

- `POST 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})/approve` — returns PurchaseOrderLineStatus

---

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