mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-08-04 23:51:46 +00:00
add minamound and orderamount to bom table
This commit is contained in:
parent
a1c26de9ae
commit
dd2783cb7a
1 changed files with 24 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue