mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-14 04:04:23 +00:00
WIP: Adding panel for editing items to standing order index
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
angular.module("admin.standingOrders").controller "ProductsPanelController", ($scope) ->
|
||||
$scope.standingOrder = $scope.object
|
||||
$scope.distributor_id = $scope.standingOrder.shop.id
|
||||
@@ -7,3 +7,8 @@ angular.module("admin.standingOrders").controller "StandingOrdersController", ($
|
||||
if $scope.shop_id?
|
||||
# CurrentShop.shop = $filter('filter')($scope.shops, {id: $scope.shop_id})[0]
|
||||
$scope.standingOrders = StandingOrders.index("q[shop_id_eq]": $scope.shop_id, ams_prefix: 'index')
|
||||
|
||||
$scope.itemCount = (standingOrder) ->
|
||||
standingOrder.standing_line_items.reduce (sum, sli) ->
|
||||
return sum + sli.quantity
|
||||
, 0
|
||||
|
||||
Reference in New Issue
Block a user