WIP: Adding panel for editing items to standing order index

This commit is contained in:
Rob Harrington
2016-11-25 08:14:41 +11:00
parent 05bc2bd293
commit 1bd01c83a7
11 changed files with 98 additions and 69 deletions

View File

@@ -0,0 +1,3 @@
angular.module("admin.standingOrders").controller "ProductsPanelController", ($scope) ->
$scope.standingOrder = $scope.object
$scope.distributor_id = $scope.standingOrder.shop.id

View File

@@ -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