mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-25 05:45:15 +00:00
Create factory to hold auxillary functions for subscriptions
NOTE: Moved estimatedSubtotal and estimatedTotal functions to the new factory from the subscription line items controller
This commit is contained in:
@@ -22,12 +22,3 @@ angular.module("admin.subscriptions").controller "SubscriptionLineItemsControlle
|
||||
sli.variant_id == $scope.newItem.variant_id
|
||||
return matching[0] if matching.length > 0
|
||||
null
|
||||
|
||||
$scope.estimatedSubtotal = ->
|
||||
$scope.subscription.subscription_line_items.reduce (subtotal, item) ->
|
||||
return subtotal if item._destroy
|
||||
subtotal += item.price_estimate * item.quantity
|
||||
, 0
|
||||
|
||||
$scope.estimatedTotal = ->
|
||||
$scope.estimatedSubtotal()
|
||||
|
||||
Reference in New Issue
Block a user