mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-29 21:17:17 +00:00
Renaming standing order files
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
angular.module("admin.standingOrders").controller "StandingOrdersController", ($scope, StandingOrders, Columns, RequestMonitor, shops, ShippingMethods, PaymentMethods) ->
|
||||
$scope.columns = Columns.columns
|
||||
$scope.shops = shops
|
||||
$scope.shop_id = if shops.length == 1 then shops[0].id else null
|
||||
$scope.shippingMethodsByID = ShippingMethods.byID
|
||||
$scope.paymentMethodsByID = PaymentMethods.byID
|
||||
$scope.RequestMonitor = RequestMonitor
|
||||
$scope.query = ''
|
||||
|
||||
$scope.$watch "shop_id", ->
|
||||
if $scope.shop_id?
|
||||
$scope.standingOrders = StandingOrders.index("q[shop_id_eq]": $scope.shop_id, "q[canceled_at_null]": true)
|
||||
|
||||
$scope.itemCount = (standingOrder) ->
|
||||
standingOrder.standing_line_items.reduce (sum, sli) ->
|
||||
return sum + sli.quantity
|
||||
, 0
|
||||
|
||||
$scope.filtersApplied = ->
|
||||
$scope.query != ''
|
||||
Reference in New Issue
Block a user