2019-08-10 16:34:29 +02:00
@ extends ( 'layout.default' )
@ section ( 'title' , $__t ( 'Location Content Sheet' ))
2019-08-11 09:24:47 +02:00
@ section ( 'viewJsName' , 'locationcontentsheet' )
2019-08-10 16:34:29 +02:00
@ push ( 'pageStyles' )
< style >
@ media print
{
2019-08-11 09:24:47 +02:00
. page : not ( : last - child ) {
2019-08-10 16:34:29 +02:00
page - break - after : always ! important ;
}
2019-08-11 09:24:47 +02:00
. 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 ;
}
2019-08-10 16:34:29 +02:00
}
</ style >
@ endpush
@ section ( 'content' )
< h1 class = " d-print-none " >
2019-08-11 09:24:47 +02:00
@ 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' ) . ')' }}
2019-08-10 16:34:29 +02:00
</ a >
</ h1 >
2019-08-11 09:24:47 +02:00
< 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 >
2019-08-10 16:34:29 +02:00
@ foreach ( $locations as $location )
< div class = " page " >
2019-08-11 09:24:47 +02:00
< 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 " >
2019-08-10 16:34:29 +02:00
< div class = " col " >
2019-08-11 09:24:47 +02:00
< table class = " table " >
2019-08-10 16:34:29 +02:00
< thead >
< tr >
< th > {{ $__t ( 'Product' ) }} </ th >
< th > {{ $__t ( 'Amount' ) }} </ th >
2020-08-18 17:28:39 +01:00
< th > {{ $__t ( 'Consumed amount' ) . ' / ' . $__t ( 'Notes' ) }} </ th >
2019-08-10 16:34:29 +02:00
</ tr >
</ thead >
< tbody >
2019-08-11 09:24:47 +02:00
@ php $currentStockEntriesForLocation = FindAllObjectsInArrayByPropertyValue ( $currentStockLocationContent , 'location_id' , $location -> id ); @ endphp
2020-08-29 16:41:27 +02:00
@ foreach ( $currentStockEntriesForLocation as $currentStockEntry )
2019-08-10 16:34:29 +02:00
< tr >
< td >
{{ FindObjectInArrayByPropertyValue ( $products , 'id' , $currentStockEntry -> product_id ) -> name }}
</ td >
< td >
2019-09-26 15:25:30 +02:00
< 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 ) }} </ span >
2019-08-10 16:34:29 +02:00
< span class = " small font-italic " >@ if ( $currentStockEntry -> amount_opened > 0 ){{ $__t ( '%s opened' , $currentStockEntry -> amount_opened ) }} @ endif </ span >
</ td >
2019-08-11 09:24:47 +02:00
< td class = " " ></ td >
2019-08-10 16:34:29 +02:00
</ tr >
@ endforeach
</ tbody >
</ table >
</ div >
</ div >
</ div >
@ endforeach
@ stop