diff --git a/changelog/52_UNRELEASED_2019-xx-xx.md b/changelog/52_UNRELEASED_2019-xx-xx.md index 932b4979..40b2c1fe 100644 --- a/changelog/52_UNRELEASED_2019-xx-xx.md +++ b/changelog/52_UNRELEASED_2019-xx-xx.md @@ -1,3 +1,5 @@ +- Stock improvements + - You can now print a "Location Content Sheet" with the current stock per location - new button at the top of the stock overview page - Chores improvements - New option "Due date rollover" per chore which means the chore can never be overdue, the due date will shift forward each day when due - General improvements/fixes diff --git a/localization/strings.pot b/localization/strings.pot index ef3ccc2b..0c52a459 100644 --- a/localization/strings.pot +++ b/localization/strings.pot @@ -1293,8 +1293,23 @@ msgstr "" msgid "When enabled the chore can never be overdue, the due date will shift forward each day when due" msgstr "" +msgid "Location Content Sheet" +msgstr "" + msgid "Print" msgstr "" -msgid "Location Content Sheet" +msgid "all locations" +msgstr "" + +msgid "Here you can print a page per location with the current stock, maybe to hang it there and note the consumed things on it." +msgstr "" + +msgid "this location" +msgstr "" + +msgid "Consumend amount" +msgstr "" + +msgid "Time of printing" msgstr "" diff --git a/public/viewjs/locationcontentsheet.js b/public/viewjs/locationcontentsheet.js new file mode 100644 index 00000000..504a76ba --- /dev/null +++ b/public/viewjs/locationcontentsheet.js @@ -0,0 +1,14 @@ +$(document).on("click", ".print-all-locations-button", function(e) +{ + $(".page").removeClass("d-print-none").removeClass("no-page-break"); + $(".print-timestamp").text(moment().format("l LT")); + window.print(); +}); + +$(document).on("click", ".print-single-location-button", function(e) +{ + $(".page").addClass("d-print-none"); + $(e.currentTarget).closest(".page").removeClass("d-print-none").addClass("no-page-break"); + $(".print-timestamp").text(moment().format("l LT")); + window.print(); +}); diff --git a/views/locationcontentsheet.blade.php b/views/locationcontentsheet.blade.php index 0881d4f1..84d247ba 100644 --- a/views/locationcontentsheet.blade.php +++ b/views/locationcontentsheet.blade.php @@ -1,40 +1,68 @@ @extends('layout.default') @section('title', $__t('Location Content Sheet')) +@section('viewJsName', 'locationcontentsheet') @push('pageStyles') @endpush @section('content')

- - {{ $__t('Print') }} + @yield('title') + + {{ $__t('Print') . ' (' . $__t('all locations') . ')' }}

+
+ {{ $__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.') }} +
@foreach($locations as $location)
-

{{ $location->name }}

- @php $currentStockEntriesForLocation = FindAllObjectsInArrayByPropertyValue($currentStockLocationContent, 'location_id', $location->id); @endphp -
+

+ + {{ $location->name }} + + {{ $__t('Print') . ' (' . $__t('this location') . ')' }} + +

+
+ {{ $__t('Time of printing') }}: + +
+
- +
- + + @php $currentStockEntriesForLocation = FindAllObjectsInArrayByPropertyValue($currentStockLocationContent, 'location_id', $location->id); @endphp @foreach($currentStockEntriesForLocation as $currentStockEntry) - + @endforeach diff --git a/views/stockoverview.blade.php b/views/stockoverview.blade.php index 4b07bc0a..f8abc200 100644 --- a/views/stockoverview.blade.php +++ b/views/stockoverview.blade.php @@ -24,6 +24,9 @@ {{ $__t('Journal') }} + + {{ $__t('Location Content Sheet') }} +

{{ $__t('Product') }} {{ $__t('Amount') }}{{ $__t('Consumend amount') . ' / ' . $__t('Notes') }}
@@ -44,7 +72,7 @@ {{ $currentStockEntry->amount }} {{ $__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) }} @if($currentStockEntry->amount_opened > 0){{ $__t('%s opened', $currentStockEntry->amount_opened) }}@endif ____________________