From dd2783cb7aa968478f867bea9a8213a5dcc685ec Mon Sep 17 00:00:00 2001 From: Fabian Wunsch Date: Tue, 23 Jun 2026 08:36:43 +0200 Subject: [PATCH] add minamound and orderamount to bom table --- src/DataTables/ProjectBomEntriesDataTable.php | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/DataTables/ProjectBomEntriesDataTable.php b/src/DataTables/ProjectBomEntriesDataTable.php index b5beeca0..2f0766ee 100644 --- a/src/DataTables/ProjectBomEntriesDataTable.php +++ b/src/DataTables/ProjectBomEntriesDataTable.php @@ -195,6 +195,30 @@ class ProjectBomEntriesDataTable implements DataTableTypeInterface return ''; } ]) + ->add('minAmount', TextColumn::class, [ + 'label' => $this->translator->trans('part.table.minamount'), + 'visible' => false, + 'orderField' => 'part.minamount', + 'render' => function ($value, ProjectBOMEntry $context): string { + if (!$context->getPart() instanceof Part) { + return ''; + } + + return htmlspecialchars($this->amountFormatter->format($context->getPart()->getMinAmount(), $context->getPart()->getPartUnit())); + }, + ]) + ->add('orderAmount', TextColumn::class, [ + 'label' => $this->translator->trans('part.table.orderamount'), + 'visible' => false, + 'orderField' => 'part.orderamount', + 'render' => function ($value, ProjectBOMEntry $context): string { + if (!$context->getPart() instanceof Part) { + return ''; + } + + return htmlspecialchars($this->amountFormatter->format($context->getPart()->getOrderAmount(), $context->getPart()->getPartUnit())); + }, + ]) ->add('storelocation', TextColumn::class, [ 'label' => $this->translator->trans('part.table.storeLocations'), //We need to use a aggregate function to get the first store location, as we have a one-to-many relation