Also show quantity unit on dashboard next to amount

This commit is contained in:
Bernd Bestel 2017-04-22 11:38:43 +02:00
parent 14faf57a9e
commit 049a9cee06
2 changed files with 2 additions and 1 deletions

View File

@ -42,6 +42,7 @@ $app->get('/', function(Request $request, Response $response) use($db)
'title' => 'Dashboard',
'contentPage' => 'dashboard.php',
'products' => $db->products(),
'quantityunits' => $db->quantity_units(),
'currentStock' => GrocyLogicStock::GetCurrentStock(),
'missingProducts' => GrocyLogicStock::GetMissingProducts()
]);

View File

@ -30,7 +30,7 @@
<?php echo GrocyPhpHelper::FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->name; ?>
</td>
<td>
<?php echo $currentStockEntry->amount; ?>
<?php echo $currentStockEntry->amount . ' ' . GrocyPhpHelper::FindObjectInArrayByPropertyValue($quantityunits, 'id', GrocyPhpHelper::FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->qu_id_stock)->name; ?>
</td>
<td>
<?php echo $currentStockEntry->best_before_date; ?>