Skip to content

Allow sorting of BOM based on manufacturing_status, instockAmount, storageLocations or mount names #1305

@mkne

Description

@mkne

When sourcing parts based on the BOM of a project, it might be useful to sort the BOM based on the entry in the field of instockAmount to quickly see all parts with an amount of "0". Also sorting by storageLocations might help in quickly source all parts. The manufacturing_status is also missing as a column to sort the BOM. This might help in quickly getting an overview about critical parts with status "End of Life" or "NRND".
Maybe also make mountnames a sortable column.

Image

In https://github.com/Part-DB/Part-DB-server/blob/master/src/DataTables/ProjectBomEntriesDataTable.php the columns in question need a attribute 'orderField'. For example, 'orderField' => 'NATSORT(manufacturer.name)',
Consider that fields with multiple values (one-to-many relations) like storageLocations and mountnames, might not be sortable.
Have a look in https://github.com/Part-DB/Part-DB-server/tree/master/src/DataTables/PartsDataTable.php how it's done there for these types of columns. For example, 'orderField' => 'NATSORT(MIN(_storelocations.name))',

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions