diff --git a/app/assets/javascripts/admin/order_cycle.js.erb.coffee b/app/assets/javascripts/admin/order_cycle.js.erb.coffee index bf23fe50b0..27d41eb77f 100644 --- a/app/assets/javascripts/admin/order_cycle.js.erb.coffee +++ b/app/assets/javascripts/admin/order_cycle.js.erb.coffee @@ -123,10 +123,10 @@ angular.module('order_cycle', ['ngResource']) exchange.showProducts = !exchange.showProducts addSupplier: (new_supplier_id) -> - this.order_cycle.incoming_exchanges.push({enterprise_id: new_supplier_id, active: true, variants: {}}) + this.order_cycle.incoming_exchanges.push({enterprise_id: new_supplier_id, active: true, variants: {}, enterprise_fees: []}) addDistributor: (new_distributor_id) -> - this.order_cycle.outgoing_exchanges.push({enterprise_id: new_distributor_id, active: true, variants: {}}) + this.order_cycle.outgoing_exchanges.push({enterprise_id: new_distributor_id, active: true, variants: {}, enterprise_fees: []}) addCoordinatorFee: -> this.order_cycle.coordinator_fees.push({}) diff --git a/app/views/admin/order_cycles/show.rep b/app/views/admin/order_cycles/show.rep index 76d839d69e..9876bbd419 100644 --- a/app/views/admin/order_cycles/show.rep +++ b/app/views/admin/order_cycles/show.rep @@ -16,6 +16,10 @@ r.element :order_cycle, @order_cycle do r.element :variants, Hash[ exchange.variants.map { |v| [v.id, true] } ], {} + r.list_of :enterprise_fees do |fee| + r.element :id + end + r.element :pickup_time r.element :pickup_instructions end diff --git a/spec/javascripts/unit/order_cycle_spec.js.coffee b/spec/javascripts/unit/order_cycle_spec.js.coffee index ee575b5a96..7cd290650f 100644 --- a/spec/javascripts/unit/order_cycle_spec.js.coffee +++ b/spec/javascripts/unit/order_cycle_spec.js.coffee @@ -334,7 +334,7 @@ describe 'OrderCycle services', -> it 'adds the supplier to incoming exchanges', -> OrderCycle.addSupplier('123') expect(OrderCycle.order_cycle.incoming_exchanges).toEqual [ - {enterprise_id: '123', active: true, variants: {}} + {enterprise_id: '123', active: true, variants: {}, enterprise_fees: []} ] describe 'adding distributors', -> @@ -343,7 +343,7 @@ describe 'OrderCycle services', -> it 'adds the distributor to outgoing exchanges', -> OrderCycle.addDistributor('123') expect(OrderCycle.order_cycle.outgoing_exchanges).toEqual [ - {enterprise_id: '123', active: true, variants: {}} + {enterprise_id: '123', active: true, variants: {}, enterprise_fees: []} ] describe 'adding coordinator fees', ->