mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 09:39:57 +00:00
Fixed differences in highlighting for expiring/expired items in header vs table on stock overview page (fixes #198)
This commit is contained in:
parent
2d3df2024a
commit
12082b52ab
@ -511,3 +511,13 @@ $(document).on("click", ".easy-link-copy-textbox", function()
|
|||||||
{
|
{
|
||||||
$(this).select();
|
$(this).select();
|
||||||
});
|
});
|
||||||
|
$('.dropdown-toggle').click(function ()
|
||||||
|
{
|
||||||
|
dropDownFixPosition($('button'), $('.dropdown-menu'));
|
||||||
|
});
|
||||||
|
function dropDownFixPosition(button, dropdown)
|
||||||
|
{
|
||||||
|
var dropDownTop = button.offset().top + button.outerHeight();
|
||||||
|
dropdown.css('top', dropDownTop + "px");
|
||||||
|
dropdown.css('left', button.offset().left + "px");
|
||||||
|
}
|
||||||
|
@ -53,11 +53,11 @@ class StockService extends BaseService
|
|||||||
public function GetExpiringProducts(int $days = 5, bool $excludeExpired = false)
|
public function GetExpiringProducts(int $days = 5, bool $excludeExpired = false)
|
||||||
{
|
{
|
||||||
$currentStock = $this->GetCurrentStock(true);
|
$currentStock = $this->GetCurrentStock(true);
|
||||||
$currentStock = FindAllObjectsInArrayByPropertyValue($currentStock, 'best_before_date', date('Y-m-d', strtotime("+$days days")), '<');
|
$currentStock = FindAllObjectsInArrayByPropertyValue($currentStock, 'best_before_date', date('Y-m-d 23:59:59', strtotime("+$days days")), '<');
|
||||||
|
|
||||||
if ($excludeExpired)
|
if ($excludeExpired)
|
||||||
{
|
{
|
||||||
$currentStock = FindAllObjectsInArrayByPropertyValue($currentStock, 'best_before_date', date('Y-m-d', strtotime('now')), '>');
|
$currentStock = FindAllObjectsInArrayByPropertyValue($currentStock, 'best_before_date', date('Y-m-d 23:59:59', strtotime('now')), '>');
|
||||||
}
|
}
|
||||||
|
|
||||||
return $currentStock;
|
return $currentStock;
|
||||||
|
@ -137,7 +137,7 @@
|
|||||||
@endforeach
|
@endforeach
|
||||||
</td>
|
</td>
|
||||||
<td class="d-none">
|
<td class="d-none">
|
||||||
@if($currentStockEntry->best_before_date < date('Y-m-d 23:59:59', strtotime('-1 days')) && $currentStockEntry->amount > 0) expired @elseif($currentStockEntry->best_before_date < date('Y-m-d 23:59:59', strtotime("+$nextXDays days")) && $currentStockEntry->amount > 0) expiring @elseif (FindObjectInArrayByPropertyValue($missingProducts, 'id', $currentStockEntry->product_id) !== null) belowminstockamount @endif
|
@if($currentStockEntry->best_before_date < date('Y-m-d 23:59:59', strtotime('-1 days')) && $currentStockEntry->amount > 0) expired @elseif($currentStockEntry->best_before_date < date('Y-m-d 23:59:59', strtotime("+$nextXDays days")) && $currentStockEntry->amount > 0) expiring @endif @if(FindObjectInArrayByPropertyValue($missingProducts, 'id', $currentStockEntry->product_id) !== null) belowminstockamount @endif
|
||||||
</td>
|
</td>
|
||||||
@php $productGroup = FindObjectInArrayByPropertyValue($productGroups, 'id', FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->product_group_id) @endphp
|
@php $productGroup = FindObjectInArrayByPropertyValue($productGroups, 'id', FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->product_group_id) @endphp
|
||||||
<td class="d-none">
|
<td class="d-none">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user