Optimized location content sheet layout / don't show empty locations

This commit is contained in:
Bernd Bestel 2022-04-01 22:10:24 +02:00
parent f7c33a4579
commit ba289d6e6a
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300

View File

@ -70,6 +70,9 @@
<hr class="my-2 d-print-none"> <hr class="my-2 d-print-none">
@foreach($locations as $location) @foreach($locations as $location)
@if(FindAllObjectsInArrayByPropertyValue($currentStockLocationContent, 'location_id', $location->id) == null)
@continue
@endif
<div class="page"> <div class="page">
<h1 class="pt-4 text-center"> <h1 class="pt-4 text-center">
<img src="{{ $U('/img/grocy_logo.svg?v=', true) }}{{ $version }}" <img src="{{ $U('/img/grocy_logo.svg?v=', true) }}{{ $version }}"
@ -85,7 +88,7 @@
{{ $__t('Time of printing') }}: {{ $__t('Time of printing') }}:
<span class="d-inline print-timestamp"></span> <span class="d-inline print-timestamp"></span>
</h6> </h6>
<div class="row w-75"> <div class="row">
<div class="col"> <div class="col">
<table class="table"> <table class="table">
<thead> <thead>
@ -99,10 +102,10 @@
@php $currentStockEntriesForLocation = FindAllObjectsInArrayByPropertyValue($currentStockLocationContent, 'location_id', $location->id); @endphp @php $currentStockEntriesForLocation = FindAllObjectsInArrayByPropertyValue($currentStockLocationContent, 'location_id', $location->id); @endphp
@foreach($currentStockEntriesForLocation as $currentStockEntry) @foreach($currentStockEntriesForLocation as $currentStockEntry)
<tr> <tr>
<td> <td class="fit-content">
{{ FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->name }} {{ FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->name }}
</td> </td>
<td> <td class="fit-content">
<span class="locale-number locale-number-quantity-amount">{{ $currentStockEntry->amount }}</span> <span id="product-{{ $currentStockEntry->product_id }}-qu-name">{{ $__n($currentStockEntry->amount, FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->qu_id_stock)->name, FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->qu_id_stock)->name_plural, true) }}</span> <span class="locale-number locale-number-quantity-amount">{{ $currentStockEntry->amount }}</span> <span id="product-{{ $currentStockEntry->product_id }}-qu-name">{{ $__n($currentStockEntry->amount, FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->qu_id_stock)->name, FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->qu_id_stock)->name_plural, true) }}</span>
<span class="small font-italic">@if($currentStockEntry->amount_opened > 0){{ $__t('%s opened', $currentStockEntry->amount_opened) }}@endif</span> <span class="small font-italic">@if($currentStockEntry->amount_opened > 0){{ $__t('%s opened', $currentStockEntry->amount_opened) }}@endif</span>
</td> </td>