2018-04-11 19:49:35 +02:00
@ extends ( 'layout.default' )
2019-05-01 20:19:18 +02:00
@ section ( 'title' , $__t ( 'Stock overview' ))
2018-04-12 21:13:38 +02:00
@ section ( 'activeNav' , 'stockoverview' )
@ section ( 'viewJsName' , 'stockoverview' )
2020-01-28 19:27:18 +01:00
@ push ( 'pageStyles' )
2020-08-31 20:32:50 +02:00
< link href = "{{ $U ('/node_modules/animate.css/animate.min.css?v=', true) }}{{ $version }}"
rel = "stylesheet" >
2020-01-28 19:27:18 +01:00
@ endpush
2018-05-13 08:42:45 +02:00
@ push ( 'pageScripts' )
2020-08-31 20:32:50 +02:00
< script src = "{{ $U ('/viewjs/purchase.js?v=', true) }}{{ $version }}" ></ script >
2018-05-13 08:42:45 +02:00
@ endpush
2018-04-11 19:49:35 +02:00
@ section ( 'content' )
2018-07-09 21:33:23 +02:00
< div class = "row" >
2018-07-10 00:07:38 +02:00
< div class = "col" >
2020-04-19 08:51:02 -04:00
< div class = "title-related-links" >
2020-11-07 14:53:45 +01:00
< h2 class = "title mr-2 order-0" >
2020-10-31 18:37:10 +01:00
@ yield ( 'title' )
2020-11-07 14:53:45 +01:00
</ h2 >
< h2 class = "mb-0 mr-auto order-3 order-md-1 width-xs-sm-100" >
2020-10-31 18:37:10 +01:00
< span id = "info-current-stock"
class = "text-muted small" ></ span >
</ h2 >
2020-11-07 14:53:45 +01:00
< button class = "btn btn-outline-dark d-md-none mt-2 float-right order-1 order-md-3"
type = "button"
data - toggle = "collapse"
data - target = "#related-links" >
< i class = "fas fa-ellipsis-v" ></ i >
</ button >
< div class = "related-links collapse d-md-flex order-2 width-xs-sm-100"
id = "related-links" >
< a class = "btn btn-outline-dark responsive-button m-1 mt-md-0 mb-md-0 float-right"
2020-08-31 20:32:50 +02:00
href = "{{ $U ('/stockjournal') }}" >
2020-04-19 08:51:02 -04:00
{{ $__t ( 'Journal' ) }}
</ a >
2020-11-07 14:53:45 +01:00
< a class = "btn btn-outline-dark responsive-button m-1 mt-md-0 mb-md-0 float-right"
2020-08-31 20:32:50 +02:00
href = "{{ $U ('/stockentries') }}" >
2020-04-19 08:51:02 -04:00
{{ $__t ( 'Stock entries' ) }}
</ a >
@ if ( GROCY_FEATURE_FLAG_STOCK_LOCATION_TRACKING )
2020-11-07 14:53:45 +01:00
< a class = "btn btn-outline-dark responsive-button m-1 mt-md-0 mb-md-0 float-right"
2020-08-31 20:32:50 +02:00
href = "{{ $U ('/locationcontentsheet') }}" >
2020-04-19 08:51:02 -04:00
{{ $__t ( 'Location Content Sheet' ) }}
</ a >
@ endif
</ div >
</ div >
2020-10-31 18:37:10 +01:00
< div class = "border-top border-bottom my-2 py-1" >
@ if ( GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING )
2020-11-15 19:53:44 +01:00
< div id = "info-duesoon-products"
2020-10-31 18:37:10 +01:00
data - next - x - days = "{{ $nextXDays }}"
2020-11-15 19:53:44 +01:00
data - status - filter = "duesoon"
2020-10-31 18:37:10 +01:00
class = "warning-message status-filter-message responsive-button mr-2" ></ div >
2020-11-15 19:53:44 +01:00
< div id = "info-overdue-products"
data - status - filter = "overdue"
class = "secondary-message status-filter-message responsive-button mr-2" ></ div >
2020-10-31 18:37:10 +01:00
< div id = "info-expired-products"
data - status - filter = "expired"
class = "error-message status-filter-message responsive-button mr-2" ></ div >
@ endif
< div id = "info-missing-products"
data - status - filter = "belowminstockamount"
class = "normal-message status-filter-message responsive-button" ></ div >
< div class = "float-right" >
2020-11-10 18:11:33 +01:00
< a class = "btn btn-sm btn-outline-info d-md-none mt-1"
2020-11-07 14:53:45 +01:00
data - toggle = "collapse"
href = "#table-filter-row"
role = "button" >
< i class = "fas fa-filter" ></ i >
</ a >
2020-10-31 18:37:10 +01:00
< a id = "clear-filter-button"
2020-11-10 18:11:33 +01:00
class = "btn btn-sm btn-outline-info mt-1"
2020-10-31 18:37:10 +01:00
href = "#" >
{{ $__t ( 'Clear filter' ) }}
</ a >
</ div >
</ div >
2018-07-10 00:07:38 +02:00
</ div >
2018-07-09 21:33:23 +02:00
</ div >
2020-11-07 14:53:45 +01:00
< div class = "row collapse d-md-flex"
id = "table-filter-row" >
2020-08-25 20:20:51 +02:00
< div class = "col-xs-12 col-md-6 col-xl-3" >
2020-10-31 18:37:10 +01:00
< div class = "input-group" >
2020-04-19 08:51:02 -04:00
< div class = "input-group-prepend" >
2020-08-25 19:45:54 +02:00
< span class = "input-group-text" >< i class = "fas fa-search" ></ i ></ span >
2020-04-19 08:51:02 -04:00
</ div >
2020-08-31 20:32:50 +02:00
< input type = "text"
id = "search"
class = "form-control"
placeholder = "{{ $__t ('Search') }}" >
2020-04-19 08:51:02 -04:00
</ div >
2018-11-24 19:40:50 +01:00
</ div >
2019-09-19 17:46:52 +02:00
@ if ( GROCY_FEATURE_FLAG_STOCK_LOCATION_TRACKING )
2018-07-11 19:43:05 +02:00
< div class = "col-xs-12 col-md-6 col-xl-3" >
2020-10-31 18:37:10 +01:00
< div class = "input-group" >
2020-04-19 08:51:02 -04:00
< div class = "input-group-prepend" >
2020-08-25 19:45:54 +02:00
< span class = "input-group-text" >< i class = "fas fa-filter" ></ i >& nbsp ;{{ $__t ( 'Location' ) }} </ span >
2020-04-19 08:51:02 -04:00
</ div >
2020-11-16 19:10:29 +01:00
< select class = "custom-control custom-select"
2020-08-31 20:32:50 +02:00
id = "location-filter" >
2020-04-19 08:51:02 -04:00
< option value = "all" > {{ $__t ( 'All' ) }} </ option >
@ foreach ( $locations as $location )
2020-08-31 20:32:50 +02:00
< option value = "{{ $location->name }}" > {{ $location -> name }} </ option >
2020-04-19 08:51:02 -04:00
@ endforeach
</ select >
</ div >
2017-04-20 17:10:21 +02:00
</ div >
2019-09-19 17:46:52 +02:00
@ endif
2018-10-06 18:19:31 +02:00
< div class = "col-xs-12 col-md-6 col-xl-3" >
2020-10-31 18:37:10 +01:00
< div class = "input-group" >
2020-04-19 08:51:02 -04:00
< div class = "input-group-prepend" >
2020-08-25 19:45:54 +02:00
< span class = "input-group-text" >< i class = "fas fa-filter" ></ i >& nbsp ;{{ $__t ( 'Product group' ) }} </ span >
2020-04-19 08:51:02 -04:00
</ div >
2020-11-16 19:10:29 +01:00
< select class = "custom-control custom-select"
2020-08-31 20:32:50 +02:00
id = "product-group-filter" >
2020-04-19 08:51:02 -04:00
< option value = "all" > {{ $__t ( 'All' ) }} </ option >
@ foreach ( $productGroups as $productGroup )
2020-08-31 20:32:50 +02:00
< option value = "{{ $productGroup->name }}" > {{ $productGroup -> name }} </ option >
2020-04-19 08:51:02 -04:00
@ endforeach
</ select >
</ div >
2018-10-06 18:19:31 +02:00
</ div >
2018-09-24 19:13:53 +02:00
< div class = "col-xs-12 col-md-6 col-xl-3" >
2020-10-31 18:37:10 +01:00
< div class = "input-group" >
2020-04-19 08:51:02 -04:00
< div class = "input-group-prepend" >
2020-08-25 19:45:54 +02:00
< span class = "input-group-text" >< i class = "fas fa-filter" ></ i >& nbsp ;{{ $__t ( 'Status' ) }} </ span >
2020-04-19 08:51:02 -04:00
</ div >
2020-11-16 19:10:29 +01:00
< select class = "custom-control custom-select"
2020-08-31 20:32:50 +02:00
id = "status-filter" >
< option class = "bg-white"
value = "all" > {{ $__t ( 'All' ) }} </ option >
2020-04-19 08:51:02 -04:00
@ if ( GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING )
2020-11-15 19:53:44 +01:00
< option value = "duesoon" > {{ $__t ( 'Due soon' ) }} </ option >
< option value = "overdue" > {{ $__t ( 'Overdue' ) }} </ option >
< option value = "expired" > {{ $__t ( 'Expired' ) }} </ option >
2020-04-19 08:51:02 -04:00
@ endif
< option value = "belowminstockamount" > {{ $__t ( 'Below min. stock amount' ) }} </ option >
</ select >
</ div >
2018-09-24 19:13:53 +02:00
</ div >
2018-05-12 14:25:21 +02:00
</ div >
2017-04-20 17:10:21 +02:00
2018-07-10 20:37:13 +02:00
< div class = "row" >
< div class = "col" >
2020-08-31 20:32:50 +02:00
< table id = "stock-overview-table"
2020-11-07 14:53:45 +01:00
class = "table table-sm table-striped nowrap w-100" >
2018-07-10 20:37:13 +02:00
< thead >
< tr >
2020-11-11 22:28:05 +01:00
< th class = "border-right" >< a class = "text-muted change-table-columns-visibility-button"
data - toggle = "tooltip"
2020-11-11 21:11:17 +01:00
data - toggle = "tooltip"
2020-12-16 18:18:03 +01:00
title = "{{ $__t ('Table options') }}"
2020-11-11 21:11:17 +01:00
data - table - selector = "#stock-overview-table"
href = "#" >< i class = "fas fa-eye" ></ i ></ a >
</ th >
2019-05-01 20:19:18 +02:00
< th > {{ $__t ( 'Product' ) }} </ th >
2020-08-17 14:47:33 -05:00
< th > {{ $__t ( 'Product group' ) }} </ th >
2019-05-01 20:19:18 +02:00
< th > {{ $__t ( 'Amount' ) }} </ th >
2020-10-15 12:46:27 -05:00
< th class = "@if(!GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING) d-none @endif" > {{ $__t ( 'Value' ) }} </ th >
2020-11-15 19:53:44 +01:00
< th class = "@if(!GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING) d-none @endif" > {{ $__t ( 'Next due date' ) }} </ th >
2018-09-23 09:22:54 +02:00
< th class = "d-none" > Hidden location </ th >
2018-09-24 19:13:53 +02:00
< th class = "d-none" > Hidden status </ th >
2020-08-24 17:57:43 +02:00
< th class = "d-none" > Hidden product group </ th >
2020-11-11 22:38:01 +01:00
< th > {{ $__t ( 'Calories' ) }} ({{ $__t ( 'Per stock quantity unit' ) }}) </ th >
2020-11-11 22:39:24 +01:00
< th > {{ $__t ( 'Calories' ) }} </ th >
2020-12-19 10:51:07 +01:00
< th > {{ $__t ( 'Last purchased' ) }} </ th >
< th class = "@if(!GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING) d-none @endif" > {{ $__t ( 'Last price' ) }} </ th >
2020-12-19 17:25:13 +01:00
< th > {{ $__t ( 'Min. stock amount' ) }} </ th >
2019-04-22 22:16:35 +02:00
@ include ( 'components.userfields_thead' , array (
2020-08-31 20:32:50 +02:00
'userfields' => $userfields
2019-04-22 22:16:35 +02:00
))
2020-08-29 16:41:27 +02:00
2018-07-10 20:37:13 +02:00
</ tr >
</ thead >
2019-01-05 14:27:40 +01:00
< tbody class = "d-none" >
2020-08-18 19:23:37 +02:00
@ foreach ( $currentStock as $currentStockEntry )
2020-08-31 20:32:50 +02:00
< tr id = "product-{{ $currentStockEntry->product_id }}-row"
2020-11-15 19:53:44 +01:00
class = "@if(GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING && $currentStockEntry->best_before_date < date('Y-m-d 23:59:59', strtotime('-1 days')) && $currentStockEntry->amount > 0) @if( $currentStockEntry->due_type == 1) table-secondary @else table-danger @endif @elseif(GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING && $currentStockEntry->best_before_date < date('Y-m-d 23:59:59', strtotime('+' . $nextXDays . ' days')) && $currentStockEntry->amount > 0) table-warning @elseif ( $currentStockEntry->product_missing ) table-info @endif" >
2019-03-09 10:49:26 +01:00
< td class = "fit-content border-right" >
2020-12-07 19:48:33 +01:00
< a class = "permission-STOCK_CONSUME btn btn-success btn-sm product-consume-button @if( $currentStockEntry->amount_aggregated < $currentStockEntry->quick_consume_amount || $currentStockEntry->enable_tare_weight_handling == 1) disabled @endif"
2020-08-31 20:32:50 +02:00
href = "#"
data - toggle = "tooltip"
data - placement = "left"
2020-12-20 15:02:22 +01:00
title = "{{ $__t ('Consume %1 $s of %2 $s ', floatval( $currentStockEntry->quick_consume_amount ) . ' ' . $currentStockEntry->qu_unit_name , $currentStockEntry->product_name ) }}"
2018-07-10 20:37:13 +02:00
data - product - id = "{{ $currentStockEntry->product_id }}"
2020-08-18 19:23:37 +02:00
data - product - name = "{{ $currentStockEntry->product_name }}"
data - product - qu - name = "{{ $currentStockEntry->qu_unit_name }}"
2020-11-15 09:57:45 +01:00
data - consume - amount = "{{ $currentStockEntry->quick_consume_amount }}" >
< i class = "fas fa-utensils" ></ i > < span class = "locale-number locale-number-quantity-amount" > {{ $currentStockEntry -> quick_consume_amount }} </ span >
2018-07-10 20:37:13 +02:00
</ a >
2020-08-31 20:32:50 +02:00
< a id = "product-{{ $currentStockEntry->product_id }}-consume-all-button"
2020-12-07 19:48:33 +01:00
class = "permission-STOCK_CONSUME btn btn-danger btn-sm product-consume-button @if( $currentStockEntry->amount_aggregated == 0) disabled @endif"
2020-08-31 20:32:50 +02:00
href = "#"
data - toggle = "tooltip"
data - placement = "right"
title = "{{ $__t ('Consume all %s which are currently in stock', $currentStockEntry->product_name ) }}"
2018-07-10 20:37:13 +02:00
data - product - id = "{{ $currentStockEntry->product_id }}"
2020-08-18 19:23:37 +02:00
data - product - name = "{{ $currentStockEntry->product_name }}"
data - product - qu - name = "{{ $currentStockEntry->qu_unit_name }}"
data - consume - amount = "@if( $currentStockEntry->enable_tare_weight_handling == 1){ { $currentStockEntry -> tare_weight } }@else{ { $currentStockEntry -> amount } }@endif"
2020-04-13 17:29:00 +02:00
data - original - total - stock - amount = "{ { $currentStockEntry -> amount } }" >
2019-05-01 20:19:18 +02:00
< i class = "fas fa-utensils" ></ i > {{ $__t ( 'All' ) }}
2018-07-10 20:37:13 +02:00
</ a >
2019-09-19 17:46:52 +02:00
@ if ( GROCY_FEATURE_FLAG_STOCK_PRODUCT_OPENED_TRACKING )
2020-12-07 19:48:33 +01:00
< a class = "btn btn-success btn-sm product-open-button @if( $currentStockEntry->amount_aggregated < $currentStockEntry->quick_consume_amount || $currentStockEntry->amount_aggregated == $currentStockEntry->amount_opened_aggregated || $currentStockEntry->enable_tare_weight_handling == 1) disabled @endif"
2020-08-31 20:32:50 +02:00
href = "#"
data - toggle = "tooltip"
data - placement = "left"
2020-12-20 15:02:22 +01:00
title = "{{ $__t ('Mark %1 $s of %2 $s as open', floatval( $currentStockEntry->quick_consume_amount ) . ' ' . $currentStockEntry->qu_unit_name , $currentStockEntry->product_name ) }}"
2018-11-17 19:39:37 +01:00
data - product - id = "{{ $currentStockEntry->product_id }}"
2020-08-18 19:23:37 +02:00
data - product - name = "{{ $currentStockEntry->product_name }}"
2020-11-15 09:57:45 +01:00
data - product - qu - name = "{{ $currentStockEntry->qu_unit_name }}"
data - open - amount = "{{ $currentStockEntry->quick_consume_amount }}" >
< i class = "fas fa-box-open" ></ i > < span class = "locale-number locale-number-quantity-amount" > {{ $currentStockEntry -> quick_consume_amount }} </ span >
2018-11-17 19:39:37 +01:00
</ a >
2019-09-19 17:46:52 +02:00
@ endif
2019-03-09 13:11:50 +01:00
< div class = "dropdown d-inline-block" >
2020-08-31 20:32:50 +02:00
< button class = "btn btn-sm btn-light text-secondary"
type = "button"
data - toggle = "dropdown" >
2019-03-09 13:11:50 +01:00
< i class = "fas fa-ellipsis-v" ></ i >
</ button >
2020-03-21 15:52:51 +01:00
< div class = "table-inline-menu dropdown-menu dropdown-menu-right" >
2020-08-31 20:32:50 +02:00
< a class = "dropdown-item show-as-dialog-link permission-SHOPPINGLIST_ITEMS_ADD"
type = "button"
href = "{{ $U ('/shoppinglistitem/new?embedded&updateexistingproduct&product=' . $currentStockEntry->product_id ) }}" >
2020-03-21 15:52:51 +01:00
< span class = "dropdown-item-icon" >< i class = "fas fa-shopping-cart" ></ i ></ span > < span class = "dropdown-item-text" > {{ $__t ( 'Add to shopping list' ) }} </ span >
2019-09-20 13:37:53 +02:00
</ a >
< div class = "dropdown-divider" ></ div >
2020-08-31 20:32:50 +02:00
< a class = "dropdown-item show-as-dialog-link permission-STOCK_PURCHASE"
type = "button"
href = "{{ $U ('/purchase?embedded&product=' . $currentStockEntry->product_id ) }}" >
2020-12-21 19:04:48 +01:00
< span class = "dropdown-item-icon" >< i class = "fas fa-cart-plus" ></ i ></ span > < span class = "dropdown-item-text" > {{ $__t ( 'Purchase' ) }} </ span >
2019-09-20 13:37:53 +02:00
</ a >
2020-08-31 20:32:50 +02:00
< a class = "dropdown-item show-as-dialog-link permission-STOCK_CONSUME"
type = "button"
href = "{{ $U ('/consume?embedded&product=' . $currentStockEntry->product_id ) }}" >
2020-03-21 15:52:51 +01:00
< span class = "dropdown-item-icon" >< i class = "fas fa-utensils" ></ i ></ span > < span class = "dropdown-item-text" > {{ $__t ( 'Consume' ) }} </ span >
2019-09-20 13:37:53 +02:00
</ a >
2019-12-19 12:48:36 -06:00
@ if ( GROCY_FEATURE_FLAG_STOCK_LOCATION_TRACKING )
2020-08-31 20:32:50 +02:00
< a class = "dropdown-item show-as-dialog-link permission-STOCK_TRANSFER @if( $currentStockEntry->amount < 1) disabled @endif"
type = "button"
href = "{{ $U ('/transfer?embedded&product=' . $currentStockEntry->product_id ) }}" >
2020-03-21 15:52:51 +01:00
< span class = "dropdown-item-icon" >< i class = "fas fa-exchange-alt" ></ i ></ span > < span class = "dropdown-item-text" > {{ $__t ( 'Transfer' ) }} </ span >
2019-12-19 12:48:36 -06:00
</ a >
@ endif
2020-08-31 20:32:50 +02:00
< a class = "dropdown-item show-as-dialog-link permission-STOCK_INVENTORY"
type = "button"
href = "{{ $U ('/inventory?embedded&product=' . $currentStockEntry->product_id ) }}" >
2020-03-21 15:52:51 +01:00
< span class = "dropdown-item-icon" >< i class = "fas fa-list" ></ i ></ span > < span class = "dropdown-item-text" > {{ $__t ( 'Inventory' ) }} </ span >
2019-09-20 13:37:53 +02:00
</ a >
< div class = "dropdown-divider" ></ div >
2020-12-07 19:48:33 +01:00
< a class = "dropdown-item product-consume-button product-consume-button-spoiled permission-STOCK_CONSUME @if( $currentStockEntry->amount_aggregated < 1) disabled @endif"
2020-11-12 21:35:10 +01:00
type = "button"
href = "#"
data - product - id = "{{ $currentStockEntry->product_id }}"
data - product - name = "{{ $currentStockEntry->product_name }}"
data - product - qu - name = "{{ $currentStockEntry->qu_unit_name }}"
data - consume - amount = "1" >
< span class = "dropdown-item-text" > {{ $__t ( 'Consume %1$s of %2$s as spoiled' , '1 ' . $currentStockEntry -> qu_unit_name , $currentStockEntry -> product_name ) }} </ span >
</ a >
@ if ( GROCY_FEATURE_FLAG_RECIPES )
< a class = "dropdown-item"
type = "button"
href = "{{ $U ('/recipes?search=') }}{{ $currentStockEntry->product_name }}" >
< span class = "dropdown-item-text" > {{ $__t ( 'Search for recipes containing this product' ) }} </ span >
</ a >
@ endif
< div class = "dropdown-divider" ></ div >
2020-08-31 20:32:50 +02:00
< a class = "dropdown-item product-name-cell"
data - product - id = "{{ $currentStockEntry->product_id }}"
type = "button"
href = "#" >
2020-11-12 21:35:10 +01:00
< span class = "dropdown-item-text" > {{ $__t ( 'Product overview' ) }} </ span >
2019-03-09 13:11:50 +01:00
</ a >
2020-11-08 15:09:10 +01:00
< a class = "dropdown-item show-as-dialog-link"
2020-08-31 20:32:50 +02:00
type = "button"
2020-11-08 15:09:10 +01:00
href = "{{ $U ('/stockentries?embedded&product=') }}{{ $currentStockEntry->product_id }}"
2019-12-19 12:48:36 -06:00
data - product - id = "{{ $currentStockEntry->product_id }}" >
2020-11-12 21:35:10 +01:00
< span class = "dropdown-item-text" > {{ $__t ( 'Stock entries' ) }} </ span >
2019-12-19 12:48:36 -06:00
</ a >
2020-11-08 15:09:10 +01:00
< a class = "dropdown-item show-as-dialog-link"
2020-08-31 20:32:50 +02:00
type = "button"
2020-11-08 15:09:10 +01:00
href = "{{ $U ('/stockjournal?embedded&product=') }}{{ $currentStockEntry->product_id }}" >
2020-11-12 21:35:10 +01:00
< span class = "dropdown-item-text" > {{ $__t ( 'Stock journal' ) }} </ span >
2019-03-09 13:11:50 +01:00
</ a >
2020-11-08 15:09:10 +01:00
< a class = "dropdown-item show-as-dialog-link"
2020-09-06 13:18:51 +02:00
type = "button"
2020-11-08 15:09:10 +01:00
href = "{{ $U ('/stockjournal/summary?embedded&product_id=') }}{{ $currentStockEntry->product_id }}" >
2020-11-12 21:35:10 +01:00
< span class = "dropdown-item-text" > {{ $__t ( 'Stock journal summary' ) }} </ span >
2020-09-06 13:18:51 +02:00
</ a >
2020-08-31 20:32:50 +02:00
< a class = "dropdown-item permission-MASTER_DATA_EDIT"
type = "button"
href = "{{ $U ('/product/') }}{{ $currentStockEntry->product_id . '?returnto=%2Fstockoverview' }}" >
2020-11-12 21:35:10 +01:00
< span class = "dropdown-item-text" > {{ $__t ( 'Edit product' ) }} </ span >
2019-03-09 13:11:50 +01:00
</ a >
</ div >
</ div >
2018-07-10 20:37:13 +02:00
</ td >
2020-08-31 20:32:50 +02:00
< td class = "product-name-cell cursor-link"
data - product - id = "{{ $currentStockEntry->product_id }}" >
2020-08-18 19:23:37 +02:00
{{ $currentStockEntry -> product_name }}
2018-07-10 20:37:13 +02:00
</ td >
2020-08-17 14:47:33 -05:00
< td >
2020-08-18 19:23:37 +02:00
@ if ( $currentStockEntry -> product_group_name !== null ){{ $currentStockEntry -> product_group_name }} @ endif
2020-08-17 14:47:33 -05:00
</ td >
2020-12-17 17:33:24 +01:00
< td data - order = {{ $currentStockEntry -> amount }} >
2020-08-31 20:32:50 +02:00
< span id = "product-{{ $currentStockEntry->product_id }}-amount"
class = "locale-number locale-number-quantity-amount" > {{ $currentStockEntry -> amount }} </ span > < span id = "product-{{ $currentStockEntry->product_id }}-qu-name" > {{ $__n ( $currentStockEntry -> amount , $currentStockEntry -> qu_unit_name , $currentStockEntry -> qu_unit_name_plural ) }} </ span >
< span id = "product-{{ $currentStockEntry->product_id }}-opened-amount"
class = "small font-italic" >@ if ( $currentStockEntry -> amount_opened > 0 ){{ $__t ( '%s opened' , $currentStockEntry -> amount_opened ) }} @ endif </ span >
2019-09-14 17:34:36 +02:00
@ if ( $currentStockEntry -> is_aggregated_amount == 1 )
2019-09-17 16:18:00 +02:00
< span class = "pl-1 text-secondary" >
2020-08-31 20:32:50 +02:00
< i class = "fas fa-custom-sigma-sign" ></ i > < span id = "product-{{ $currentStockEntry->product_id }}-amount-aggregated"
class = "locale-number locale-number-quantity-amount" > {{ $currentStockEntry -> amount_aggregated }} </ span > {{ $__n ( $currentStockEntry -> amount_aggregated , $currentStockEntry -> qu_unit_name , $currentStockEntry -> qu_unit_name_plural ) }}
@ if ( $currentStockEntry -> amount_opened_aggregated > 0 ) < span id = "product-{{ $currentStockEntry->product_id }}-opened-amount-aggregated"
class = "small font-italic" > {{ $__t ( '%s opened' , $currentStockEntry -> amount_opened_aggregated ) }} </ span >@ endif
2019-09-14 17:34:36 +02:00
</ span >
@ endif
2020-04-13 18:47:41 +02:00
@ if ( boolval ( $userSettings [ 'show_icon_on_stock_overview_page_when_product_is_on_shopping_list' ]))
2020-08-18 19:23:37 +02:00
@ if ( $currentStockEntry -> on_shopping_list )
2020-11-12 21:35:10 +01:00
< span class = "text-muted cursor-normal"
data - toggle = "tooltip"
title = "{{ $__t ('This product is currently on a shopping list') }}" >
2020-04-13 18:47:41 +02:00
< i class = "fas fa-shopping-cart" ></ i >
</ span >
@ endif
@ endif
2018-07-10 20:37:13 +02:00
</ td >
2020-10-15 12:46:27 -05:00
< td >
2020-10-18 15:08:09 +02:00
< span id = "product-{{ $currentStockEntry->product_id }}-value"
class = "locale-number locale-number-currency" > {{ $currentStockEntry -> value }} </ span >
2020-10-15 12:46:27 -05:00
</ td >
2020-04-13 21:56:24 +02:00
< td class = "@if(!GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING) d-none @endif" >
2020-11-15 19:53:44 +01:00
< span id = "product-{{ $currentStockEntry->product_id }}-next-due-date" > {{ $currentStockEntry -> best_before_date }} </ span >
< time id = "product-{{ $currentStockEntry->product_id }}-next-due-date-timeago"
2020-08-31 20:32:50 +02:00
class = "timeago timeago-contextual"
datetime = "{{ $currentStockEntry->best_before_date }} 23:59:59" ></ time >
2018-07-10 20:37:13 +02:00
</ td >
2018-09-23 09:22:54 +02:00
< td class = "d-none" >
2020-08-18 19:23:37 +02:00
@ foreach ( FindAllObjectsInArrayByPropertyValue ( $currentStockLocations , 'product_id' , $currentStockEntry -> product_id ) as $locationsForProduct )
2020-08-24 17:57:43 +02:00
xx {{ FindObjectInArrayByPropertyValue ( $locations , 'id' , $locationsForProduct -> location_id ) -> name }} xx
2019-03-01 20:25:01 +01:00
@ endforeach
2018-07-10 20:37:13 +02:00
</ td >
2018-09-24 19:13:53 +02:00
< td class = "d-none" >
2020-08-31 20:32:50 +02:00
@ if ( $currentStockEntry -> best_before_date < date ( 'Y-m-d
23:59:59' ,
2020-10-29 17:32:21 +01:00
strtotime ( '-'
. '1'
. ' days'
))
2020-08-31 20:32:50 +02:00
&&
2020-11-15 19:53:44 +01:00
$currentStockEntry -> amount > 0 ) @ if ( $currentStockEntry -> due_type == 1 ) overdue @ else expired @ endif @ elseif ( $currentStockEntry -> best_before_date < date ( 'Y-m-d
2020-10-18 15:08:09 +02:00
23:59:59' ,
strtotime ( '+'
.
$nextXDays
. ' days'
))
2020-08-31 20:32:50 +02:00
&&
2020-11-15 19:53:44 +01:00
$currentStockEntry -> amount > 0 ) duesoon @ elseif ( $currentStockEntry -> product_missing ) belowminstockamount @ endif "
2018-09-24 19:13:53 +02:00
</td>
2020-08-24 17:57:43 +02:00
<td class=" d - none ">
xx{{ $currentStockEntry->product_group_name }}xx
</td>
2020-11-11 22:38:01 +01:00
<td>
2020-11-15 22:29:47 +01:00
<span class=" locale - number locale - number - quantity - amount ">{{ $currentStockEntry->product_calories }}</span>
2020-11-11 22:38:01 +01:00
</td>
2020-11-11 22:06:01 +01:00
<td>
2020-11-15 22:29:47 +01:00
<span class=" locale - number locale - number - quantity - amount ">{{ $currentStockEntry->calories }}</span>
2020-11-11 22:06:01 +01:00
</td>
2020-12-19 10:51:07 +01:00
<td>
{{ $currentStockEntry->last_purchased }}
<time class=" timeago timeago - contextual "
datetime=" {{ $currentStockEntry -> last_purchased }} "></time>
</td>
<td class=" @ if ( ! GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING ) d - none @ endif ">
<span class=" locale - number locale - number - currency ">{{ $currentStockEntry->last_price }}</span>
</td>
2020-12-19 17:25:13 +01:00
<td>
<span class=" locale - number locale - number - quantity - amount ">{{ $currentStockEntry->min_stock_amount }}</span>
</td>
2019-04-22 22:16:35 +02:00
@include('components.userfields_tbody', array(
2020-08-31 20:32:50 +02:00
'userfields' => $userfields ,
'userfieldValues' => FindAllObjectsInArrayByPropertyValue( $userfieldValues , 'object_id', $currentStockEntry->product_id )
2019-04-22 22:16:35 +02:00
))
2018-07-10 20:37:13 +02:00
</tr>
@endforeach
</tbody>
</table>
</div>
2017-04-15 23:16:20 +02:00
</div>
2018-10-22 19:28:59 +02:00
2020-08-31 20:32:50 +02:00
<div class=" modal fade "
id=" stockoverview - productcard - modal "
tabindex=" - 1 ">
2018-10-22 19:28:59 +02:00
<div class=" modal - dialog ">
<div class=" modal - content text - center ">
<div class=" modal - body ">
@include('components.productcard')
</div>
<div class=" modal - footer ">
2020-08-31 20:32:50 +02:00
<button type=" button "
class=" btn btn - secondary "
data-dismiss=" modal ">{{ $__t ('Close') }}</button>
2018-10-22 19:28:59 +02:00
</div>
</div>
</div>
</div>
2018-04-11 19:49:35 +02:00
@stop