2018-04-11 19:49:35 +02:00
@ extends ( 'layout.default' )
2018-04-16 19:11:32 +02:00
@ section ( 'title' , $L ( 'Stock overview' ))
2018-04-12 21:13:38 +02:00
@ section ( 'activeNav' , 'stockoverview' )
@ section ( 'viewJsName' , 'stockoverview' )
2018-04-11 19:49:35 +02:00
@ section ( 'content' )
2018-04-14 11:10:38 +02:00
< div class = " col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 " >
2017-04-20 17:10:21 +02:00
2018-04-21 19:18:00 +02:00
< h1 class = " page-header " > {{ $L ( 'Stock overview' ) }} < span class = " text-muted small " > {{ $L ( '#1 products with #2 units in stock' , count ( $currentStock ), SumArrayValue ( $currentStock , 'amount' )) }} </ span ></ h1 >
2017-04-20 17:10:21 +02:00
2017-04-21 12:30:08 +02:00
< div class = " container-fluid " >
< div class = " row " >
2018-04-16 19:11:32 +02:00
< p class = " btn btn-lg btn-warning no-real-button " > {{ $L ( '#1 products expiring within the next #2 days' , count ( FindAllObjectsInArrayByPropertyValue ( $currentStock , 'best_before_date' , date ( 'Y-m-d' , strtotime ( '+5 days' )), '<' )), 5 ) }} </ p >
< p class = " btn btn-lg btn-danger no-real-button " > {{ $L ( '#1 products are already expired' , count ( FindAllObjectsInArrayByPropertyValue ( $currentStock , 'best_before_date' , date ( 'Y-m-d' , strtotime ( '-1 days' )), '<' ))) }} </ p >
< p class = " btn btn-lg btn-info no-real-button " > {{ $L ( '#1 products are below defined min. stock amount' , count ( $missingProducts )) }} </ p >
2017-04-21 12:30:08 +02:00
</ div >
2017-04-20 17:10:21 +02:00
</ div >
2017-04-21 12:30:08 +02:00
< div class = " discrete-content-separator-2x " ></ div >
2017-04-15 23:16:20 +02:00
< div class = " table-responsive " >
2017-07-25 20:03:31 +02:00
< table id = " stock-overview-table " class = " table table-striped " >
2017-04-15 23:16:20 +02:00
< thead >
< tr >
2018-04-16 19:11:32 +02:00
< th > {{ $L ( 'Product' ) }} </ th >
< th > {{ $L ( 'Amount' ) }} </ th >
< th > {{ $L ( 'Next best before date' ) }} </ th >
2017-04-15 23:16:20 +02:00
</ tr >
</ thead >
< tbody >
2018-04-12 21:13:38 +02:00
@ foreach ( $currentStock as $currentStockEntry )
< tr class = " @if( $currentStockEntry->best_before_date < date('Y-m-d', strtotime('-1 days'))) error-bg @elseif( $currentStockEntry->best_before_date < date('Y-m-d', strtotime('+5 days'))) warning-bg @elseif (FindObjectInArrayByPropertyValue( $missingProducts , 'id', $currentStockEntry->product_id ) !== null) info-bg @endif " >
2017-04-15 23:16:20 +02:00
< td >
2018-04-12 21:13:38 +02:00
{{ FindObjectInArrayByPropertyValue ( $products , 'id' , $currentStockEntry -> product_id ) -> name }}
2017-04-15 23:16:20 +02:00
</ td >
< td >
2018-04-12 21:13:38 +02:00
{{ $currentStockEntry -> amount . ' ' . FindObjectInArrayByPropertyValue ( $quantityunits , 'id' , FindObjectInArrayByPropertyValue ( $products , 'id' , $currentStockEntry -> product_id ) -> qu_id_stock ) -> name }}
2017-04-15 23:16:20 +02:00
</ td >
< td >
2018-04-12 21:13:38 +02:00
{{ $currentStockEntry -> best_before_date }}
< time class = " timeago timeago-contextual " datetime = " { { $currentStockEntry->best_before_date }} " ></ time >
2017-04-15 23:16:20 +02:00
</ td >
</ tr >
2018-04-12 21:13:38 +02:00
@ endforeach
2017-04-15 23:16:20 +02:00
</ tbody >
</ table >
</ div >
2017-04-20 17:10:21 +02:00
2017-04-15 23:16:20 +02:00
</ div >
2018-04-11 19:49:35 +02:00
@ stop