From 852437ebf8fec89d5cc87b961b7bf640fdc010c0 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 29 Nov 2016 15:35:54 +0100 Subject: [PATCH] remove coupon from memory after payment --- app/assets/javascripts/controllers/events.coffee.erb | 1 + app/assets/javascripts/controllers/machines.coffee.erb | 1 + app/assets/javascripts/controllers/plans.coffee.erb | 2 ++ app/assets/javascripts/controllers/trainings.coffee.erb | 1 + 4 files changed, 5 insertions(+) diff --git a/app/assets/javascripts/controllers/events.coffee.erb b/app/assets/javascripts/controllers/events.coffee.erb index 97f2362b7..32f3b54b7 100644 --- a/app/assets/javascripts/controllers/events.coffee.erb +++ b/app/assets/javascripts/controllers/events.coffee.erb @@ -675,6 +675,7 @@ Application.Controllers.controller "ShowEventController", ["$scope", "$state", " $scope.event.nb_free_places = $scope.event.nb_free_places - reservation.total_booked_seats resetEventReserve() $scope.reserveSuccess = true + $scope.coupon.applied = null $scope.reservations.push reservation if $scope.currentUser.role == 'admin' $scope.ctrl.member = null diff --git a/app/assets/javascripts/controllers/machines.coffee.erb b/app/assets/javascripts/controllers/machines.coffee.erb index 78dee629b..6234165e5 100644 --- a/app/assets/javascripts/controllers/machines.coffee.erb +++ b/app/assets/javascripts/controllers/machines.coffee.erb @@ -950,6 +950,7 @@ Application.Controllers.controller "ReserveMachineController", ["$scope", "$stat $scope.paidMachineSlots = $scope.eventsReserved $scope.eventsReserved = [] + $scope.coupon.applied = null if $scope.selectedPlan $scope.ctrl.member.subscribed_plan = angular.copy($scope.selectedPlan) diff --git a/app/assets/javascripts/controllers/plans.coffee.erb b/app/assets/javascripts/controllers/plans.coffee.erb index 788db36f8..4396d03e9 100644 --- a/app/assets/javascripts/controllers/plans.coffee.erb +++ b/app/assets/javascripts/controllers/plans.coffee.erb @@ -249,6 +249,7 @@ Application.Controllers.controller "PlansIndexController", ["$scope", "$rootScop Auth._currentUser.subscribed_plan = angular.copy($scope.selectedPlan) $scope.paid.plan = angular.copy($scope.selectedPlan) $scope.selectedPlan = null + $scope.coupon.applied = null @@ -326,6 +327,7 @@ Application.Controllers.controller "PlansIndexController", ["$scope", "$rootScop $scope.ctrl.member = null $scope.paid.plan = angular.copy($scope.selectedPlan) $scope.selectedPlan = null + $scope.coupon.applied = null diff --git a/app/assets/javascripts/controllers/trainings.coffee.erb b/app/assets/javascripts/controllers/trainings.coffee.erb index ccb9a65f6..cdd4563b4 100644 --- a/app/assets/javascripts/controllers/trainings.coffee.erb +++ b/app/assets/javascripts/controllers/trainings.coffee.erb @@ -676,6 +676,7 @@ Application.Controllers.controller "ReserveTrainingController", ["$scope", "$sta $scope.selectedTraining = null $scope.trainingIsValid = false + $scope.coupon.applied = null if $scope.selectedPlan $scope.ctrl.member.subscribed_plan = angular.copy($scope.selectedPlan)