Show counts including all variants in order cycle exchanges

This commit is contained in:
Matt-Yorkley
2019-12-27 16:58:45 +01:00
parent 747be81aec
commit 6f644936b0
5 changed files with 12 additions and 5 deletions

View File

@@ -8,6 +8,13 @@ angular.module('admin.orderCycles')
$scope.productsLoading = ->
RequestMonitor.loading
$scope.exchangeLoadedVariants = (exchange) ->
loaded_variants = 0
angular.forEach $scope.enterprises[exchange.enterprise_id].supplied_products, (product) ->
loaded_variants += product.variants.length
loaded_variants
$scope.setSelectAllVariantsCheckboxValue = (exchange, totalNumberOfVariants) ->
exchange.select_all_variants = $scope.exchangeSelectedVariants(exchange) >= totalNumberOfVariants