Skip to content

/productionOrders/{id}/outsource returns 500 when warehouse_list contains multiple items #499

@toboter

Description

@toboter

Details

  • Current version number: "25.2.2"
  • Previous version number (optional):
  • Test status checked in Mobile Manager
  • Function or route (request): /productionOrders/{id}/outsource
  • Error (response): 500, “Die Lagerungsmenge ist größer als der verfügbare Bestand”

Description

When calling the Selectline Mobile API endpoint to outsource consumption articles for a production order, the API returns HTTP 500 with the error message:

“Die Lagerungsmenge ist größer als der verfügbare Bestand”

This only happens when the request payload contains multiple entries in warehouse_list (e.g. outsourcing from multiple stocks / storage places). If warehouse_list contains exactly one item, the same outsourcing works.

Steps to reproduce

Pick a production order with a consumption article that exists in more than one warehouse/storage place.
Call POST /productionOrders/{id}/outsource with a payload that includes two or more warehouse_list entries for the outsourcing (same order, multiple warehouse lines).
Observe HTTP 500 with message above.
Repeat with the exact same data but send only one warehouse_list entry → works.

Expected behavior

The API should accept multiple warehouse_list items in a single request and validate each line correctly, or
return a proper client error (4xx) with details, not a 500.

Observed behavior

With multiple warehouse_list items: HTTP 500 “Lagerungsmenge … größer … Bestand”
With one warehouse_list item: success.

Workaround

Split the call into multiple requests, each containing exactly one warehouse_list entry. This avoids the error reliably.

Notes

This looks like the server-side validation aggregates quantities incorrectly when multiple warehouse lines are present in one outsource request (e.g. validating total quantity against the available stock of a single warehouse).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions