mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-08-03 15:11:40 +00:00
Sometimes this is null
This commit is contained in:
parent
7998918ae4
commit
bd97bf1c97
1 changed files with 10 additions and 7 deletions
|
|
@ -150,14 +150,17 @@ class ToolsController extends AbstractController
|
|||
{
|
||||
foreach ($p->getBomEntries() as $bom_entry)
|
||||
{
|
||||
$part_id = $bom_entry->getPart()->getID();
|
||||
if (array_key_exists($part_id, $combined_bom))
|
||||
if ($bom_entry->getPart())
|
||||
{
|
||||
$combined_bom[$part_id]['quantity'] += $bom_entry->getQuantity() * $count_for_project;
|
||||
}
|
||||
else
|
||||
{
|
||||
$combined_bom[$part_id] = array('quantity'=>$bom_entry->getQuantity() * $count_for_project, 'part'=>$bom_entry->getPart());
|
||||
$part_id = $bom_entry->getPart()->getID();
|
||||
if (array_key_exists($part_id, $combined_bom))
|
||||
{
|
||||
$combined_bom[$part_id]['quantity'] += $bom_entry->getQuantity() * $count_for_project;
|
||||
}
|
||||
else
|
||||
{
|
||||
$combined_bom[$part_id] = array('quantity'=>$bom_entry->getQuantity() * $count_for_project, 'part'=>$bom_entry->getPart());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue