Scale up values on the shopping list when shopping_list_round_up is enabled (closes #2687)

This commit is contained in:
Bernd Bestel
2025-02-25 18:43:42 +01:00
parent 2b994fd2ee
commit 27b79841fc
3 changed files with 44 additions and 5 deletions

View File

@@ -17,6 +17,17 @@
<script src="{{ $U('/viewjs/purchase.js?v=', true) }}{{ $version }}"></script>
@endpush
@php
if(boolval($userSettings['shopping_list_round_up']))
{
foreach($listItems as $listItem)
{
$listItem->amount = ceil($listItem->amount);
$listItem->last_price_total = $listItem->price * $listItem->amount;
}
}
@endphp
@section('content')
<div class="row d-print-none hide-on-fullscreen-card">
<div class="col">
@@ -266,11 +277,6 @@
{
$listItem->amount = $listItem->amount * $productQuConversion->factor;
}
if(boolval($userSettings['shopping_list_round_up']))
{
$listItem->amount = ceil($listItem->amount);
}
@endphp
@endif
<td>