mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Should be divided by scale if the smallest unit
This commit is contained in:
@@ -182,6 +182,8 @@ angular.module("admin.lineItems").controller 'LineItemsCtrl', ($scope, $timeout,
|
||||
if $scope.selectedUnitsProduct.hasOwnProperty("group_buy_unit_size") && $scope.selectedUnitsProduct.group_buy_unit_size > 0 &&
|
||||
$scope.selectedUnitsProduct.hasOwnProperty("variant_unit") &&
|
||||
( $scope.selectedUnitsProduct.variant_unit == "weight" || $scope.selectedUnitsProduct.variant_unit == "volume" )
|
||||
scale = $scope.getScale($scope.selectedUnitsProduct, $scope.selectedUnitsVariant)
|
||||
sumOfUnitValues = sumOfUnitValues / scale if scale == 28.35 # divide by scale if smallest unit
|
||||
$scope.roundToThreeDecimals(sumOfUnitValues / $scope.selectedUnitsProduct.group_buy_unit_size * $scope.selectedUnitsVariant.unit_value)
|
||||
else
|
||||
''
|
||||
|
||||
Reference in New Issue
Block a user