diff --git a/public/viewjs/stockentries.js b/public/viewjs/stockentries.js index 8a1b8579..8f173a05 100644 --- a/public/viewjs/stockentries.js +++ b/public/viewjs/stockentries.js @@ -166,18 +166,35 @@ function RefreshStockEntryRow(stockRowId) function(locationResult) { locationName = locationResult.name; + + $('#stock-' + stockRowId + '-location').attr('data-location-id', result.location_id); + $('#stock-' + stockRowId + '-location').text(locationName); }, function(xhr) { console.error(xhr); } ); - $('#stock-' + stockRowId + '-location').attr('data-location-id', result.location_id); - $('#stock-' + stockRowId + '-location').text(locationName); + $('#stock-' + stockRowId + '-price').text(result.price); $('#stock-' + stockRowId + '-purchased-date').text(result.purchased_date); $('#stock-' + stockRowId + '-purchased-date-timeago').attr('datetime', result.purchased_date + ' 23:59:59'); + var shoppingLocationName = ""; + Grocy.Api.Get("objects/shopping_locations/" + result.shopping_location_id, + function(shoppingLocationResult) + { + shoppingLocationName = shoppingLocationResult.name; + + $('#stock-' + stockRowId + '-shopping-location').attr('data-shopping-location-id', result.location_id); + $('#stock-' + stockRowId + '-shopping-location').text(shoppingLocationName); + }, + function (xhr) + { + console.error(xhr); + } + ); + if (result.open == 1) { $('#stock-' + stockRowId + '-opened-amount').text(__t('Opened')); diff --git a/views/stockentries.blade.php b/views/stockentries.blade.php index 38c99e6d..36042ade 100644 --- a/views/stockentries.blade.php +++ b/views/stockentries.blade.php @@ -143,14 +143,14 @@ @endif @if(GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING) -