From 563edb17319efb760e9f510b9b8c2fecc9b591df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Thu, 26 Oct 2023 17:55:03 +0200 Subject: [PATCH] Added ipn to possible columns in project BOM view This fixes issue #418 --- src/DataTables/ProjectBomEntriesDataTable.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/DataTables/ProjectBomEntriesDataTable.php b/src/DataTables/ProjectBomEntriesDataTable.php index 4586d2f7..5a706146 100644 --- a/src/DataTables/ProjectBomEntriesDataTable.php +++ b/src/DataTables/ProjectBomEntriesDataTable.php @@ -100,7 +100,16 @@ class ProjectBomEntriesDataTable implements DataTableTypeInterface throw new \Exception('This should never happen!'); }, ]) - + ->add('ipn', TextColumn::class, [ + 'label' => $this->translator->trans('part.table.ipn'), + 'orderField' => 'part.ipn', + 'visible' => false, + 'render' => function ($value, ProjectBOMEntry $context) { + if($context->getPart() instanceof Part) { + return $context->getPart()->getIpn(); + } + } + ]) ->add('description', MarkdownColumn::class, [ 'label' => $this->translator->trans('part.table.description'), 'data' => function (ProjectBOMEntry $context) {