Do not allow re-adding exchange

This commit is contained in:
Rohan Mitchell
2015-11-20 09:46:30 +11:00
parent d4ee20455e
commit ccb23cd186
4 changed files with 23 additions and 9 deletions

View File

@@ -15,10 +15,12 @@ angular.module('admin.orderCycles').factory('OrderCycle', ($resource, $window, $
parseInt(exchange.enterprise_id) for exchange in @exchangesByDirection(direction)
novelSupplier: (enterprise) =>
@exchangeIds('incoming').indexOf(enterprise.id) == -1
id = enterprise?.id || parseInt(enterprise)
@exchangeIds('incoming').indexOf(id) == -1
novelDistributor: (enterprise) =>
@exchangeIds('outgoing').indexOf(enterprise.id) == -1
id = enterprise?.id || parseInt(enterprise)
@exchangeIds('outgoing').indexOf(id) == -1
exchangeSelectedVariants: (exchange) ->
numActiveVariants = 0