mirror of
https://github.com/grocy/grocy.git
synced 2025-08-20 04:12:59 +00:00
Finished the implementation of "Location Content Sheet" (closes #341)
This commit is contained in:
@@ -1,40 +1,68 @@
|
||||
@extends('layout.default')
|
||||
|
||||
@section('title', $__t('Location Content Sheet'))
|
||||
@section('viewJsName', 'locationcontentsheet')
|
||||
|
||||
@push('pageStyles')
|
||||
<style>
|
||||
@media print
|
||||
{
|
||||
.page {
|
||||
.page:not(:last-child) {
|
||||
page-break-after: always !important;
|
||||
}
|
||||
|
||||
.page.no-page-break {
|
||||
page-break-after: avoid !important;
|
||||
}
|
||||
|
||||
/*
|
||||
Workaround because of Firefox bug
|
||||
see https://github.com/twbs/bootstrap/issues/22753
|
||||
and https://bugzilla.mozilla.org/show_bug.cgi?id=1413121
|
||||
*/
|
||||
.row {
|
||||
display: inline !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<h1 class="d-print-none">
|
||||
<a class="btn btn-outline-dark responsive-button" href="javascript:window.print();">
|
||||
<i class="fas fa-print"></i> {{ $__t('Print') }}
|
||||
@yield('title')
|
||||
<a class="btn btn-outline-dark responsive-button print-all-locations-button" href="#">
|
||||
<i class="fas fa-print"></i> {{ $__t('Print') . ' (' . $__t('all locations') . ')' }}
|
||||
</a>
|
||||
</h1>
|
||||
<h5 class="mb-5 d-print-none">
|
||||
<small class="text-muted">{{ $__t('Here you can print a page per location with the current stock, maybe to hang it there and note the consumed things on it.') }}</small>
|
||||
</h5>
|
||||
|
||||
@foreach($locations as $location)
|
||||
<div class="page">
|
||||
<h1>{{ $location->name }}</h1>
|
||||
@php $currentStockEntriesForLocation = FindAllObjectsInArrayByPropertyValue($currentStockLocationContent, 'location_id', $location->id); @endphp
|
||||
<div class="row w-50">
|
||||
<h1 class="text-center">
|
||||
<img src="{{ $U('/img/grocy_logo.svg?v=', true) }}{{ $version }}" height="30" class="d-none d-print-flex mx-auto">
|
||||
{{ $location->name }}
|
||||
<a class="btn btn-outline-dark responsive-button print-single-location-button d-print-none" href="#">
|
||||
<i class="fas fa-print"></i> {{ $__t('Print') . ' (' . $__t('this location') . ')' }}
|
||||
</a>
|
||||
</h1>
|
||||
<h6 class="text-center mb-4 d-none d-print-block">
|
||||
{{ $__t('Time of printing') }}:
|
||||
<span class="d-inline print-timestamp"></span>
|
||||
</h6>
|
||||
<div class="row w-75">
|
||||
<div class="col">
|
||||
<table class="table table-sm table-striped">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ $__t('Product') }}</th>
|
||||
<th>{{ $__t('Amount') }}</th>
|
||||
<th></th>
|
||||
<th>{{ $__t('Consumend amount') . ' / ' . $__t('Notes') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php $currentStockEntriesForLocation = FindAllObjectsInArrayByPropertyValue($currentStockLocationContent, 'location_id', $location->id); @endphp
|
||||
@foreach($currentStockEntriesForLocation as $currentStockEntry)
|
||||
<tr>
|
||||
<td>
|
||||
@@ -44,7 +72,7 @@
|
||||
<span>{{ $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) }}</span>
|
||||
<span class="small font-italic">@if($currentStockEntry->amount_opened > 0){{ $__t('%s opened', $currentStockEntry->amount_opened) }}@endif</span>
|
||||
</td>
|
||||
<td class="fit-content">____________________</td>
|
||||
<td class=""></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
|
@@ -24,6 +24,9 @@
|
||||
<a class="btn btn-outline-dark responsive-button" href="{{ $U('/stockjournal') }}">
|
||||
<i class="fas fa-file-alt"></i> {{ $__t('Journal') }}
|
||||
</a>
|
||||
<a class="btn btn-outline-dark responsive-button" href="{{ $U('/locationcontentsheet') }}">
|
||||
<i class="fas fa-print"></i> {{ $__t('Location Content Sheet') }}
|
||||
</a>
|
||||
</h1>
|
||||
<p id="info-expiring-products" data-next-x-days="{{ $nextXDays }}" data-status-filter="expiring" class="btn btn-lg btn-warning status-filter-button responsive-button mr-2"></p>
|
||||
<p id="info-expired-products" data-status-filter="expired" class="btn btn-lg btn-danger status-filter-button responsive-button mr-2"></p>
|
||||
|
Reference in New Issue
Block a user