diff --git a/app/frontend/src/javascript/directives/cart.js b/app/frontend/src/javascript/directives/cart.js index 9f77cde2d..ed86ac191 100644 --- a/app/frontend/src/javascript/directives/cart.js +++ b/app/frontend/src/javascript/directives/cart.js @@ -670,10 +670,13 @@ Application.Directives.directive('cart', ['$rootScope', '$uibModal', 'dialogs', cartItems () { return mkRequestParams(reservation, $scope.coupon.applied); }, + schedule () { + return $scope.schedule.payment_schedule; + }, stripeKey: ['Setting', function (Setting) { return Setting.get({ name: 'stripe_public_key' }).$promise; }] }, - controller: ['$scope', '$uibModalInstance', '$state', 'reservation', 'price', 'cgv', 'Auth', 'Reservation', 'wallet', 'helpers', '$filter', 'coupon', 'cartItems', 'stripeKey', - function ($scope, $uibModalInstance, $state, reservation, price, cgv, Auth, Reservation, wallet, helpers, $filter, coupon, cartItems, stripeKey) { + controller: ['$scope', '$uibModalInstance', '$state', 'reservation', 'price', 'cgv', 'Auth', 'Reservation', 'wallet', 'helpers', '$filter', 'coupon', 'cartItems', 'stripeKey', 'schedule', + function ($scope, $uibModalInstance, $state, reservation, price, cgv, Auth, Reservation, wallet, helpers, $filter, coupon, cartItems, stripeKey, schedule) { // user wallet amount $scope.walletAmount = wallet.amount; @@ -695,6 +698,9 @@ Application.Directives.directive('cart', ['$rootScope', '$uibModal', 'dialogs', // stripe publishable key $scope.stripeKey = stripeKey.setting.value; + // Shows the schedule info in the modal + $scope.schedule = schedule; + /** * Callback to handle the post-payment and reservation */ @@ -729,7 +735,7 @@ Application.Directives.directive('cart', ['$rootScope', '$uibModal', 'dialogs', return $scope.selectedPlan; }, schedule () { - return $scope.schedule.requested_schedule; + return $scope.schedule; } }, controller: ['$scope', '$uibModalInstance', '$state', 'reservation', 'price', 'Auth', 'Reservation', 'Subscription', 'wallet', 'helpers', '$filter', 'coupon', 'selectedPlan', 'schedule', @@ -752,8 +758,8 @@ Application.Directives.directive('cart', ['$rootScope', '$uibModal', 'dialogs', // Used in wallet info template to interpolate some translations $scope.numberFilter = $filter('number'); - // TODO, show the schedule info in the modal - $scope.schedule = schedule; + // Shows the schedule info in the modal + $scope.schedule = schedule.payment_schedule; // Button label if ($scope.amount > 0) { @@ -778,7 +784,7 @@ Application.Directives.directive('cart', ['$rootScope', '$uibModal', 'dialogs', subscription: { plan_id: selectedPlan.id, user_id: reservation.user_id, - payment_schedule: schedule + payment_schedule: schedule.requested_schedule } }, function (subscription) { $uibModalInstance.close(subscription); @@ -820,6 +826,8 @@ Application.Directives.directive('cart', ['$rootScope', '$uibModal', 'dialogs', $scope.coupon.applied = null; $scope.slot = null; $scope.selectedPlan = null; + $scope.schedule.requested_schedule = false; + $scope.schedule.payment_schedule = null; }; /** diff --git a/app/frontend/templates/shared/valid_reservation_modal.html b/app/frontend/templates/shared/valid_reservation_modal.html index 06a879fd3..3df22145c 100644 --- a/app/frontend/templates/shared/valid_reservation_modal.html +++ b/app/frontend/templates/shared/valid_reservation_modal.html @@ -17,6 +17,9 @@

{{ 'app.shared.valid_reservation_modal.here_is_the_subscription_summary' }}

{{ plan | humanReadablePlanName }}

+
+

{{ 'app.shared.valid_reservation_modal.payment_schedule' }}

+
-
- -
+
+ +
+ +
+

{{ 'app.shared.stripe.payment_schedule' }}

diff --git a/config/locales/app.public.en.yml b/config/locales/app.public.en.yml index 33f11d874..9b6832797 100644 --- a/config/locales/app.public.en.yml +++ b/config/locales/app.public.en.yml @@ -246,7 +246,9 @@ en: his_group: "{GENDER, select, male{His} female{Her} other{Its}} group" he_wants_to_change_group: "{ROLE, select, member{I want} other{The user wants}} to change group" change_my_group: "Change {ROLE, select, member{my} other{{GENDER, select, male{his} female{her} other{its}}}} group" + summary: "Summary" your_subscription_has_expired_on_the_DATE: "Your subscription has expired on the {DATE}" + subscription_price: "Subscription price" you_ve_just_payed_the_subscription_html: "You've just paid the subscription:" thank_you_your_subscription_is_successful: "Thank you. Your subscription is successful!" your_invoice_will_be_available_soon_from_your_dashboard: "Your invoice will be available soon from your dashboard" diff --git a/config/locales/app.public.fr.yml b/config/locales/app.public.fr.yml index 9beea739c..ee5c43709 100644 --- a/config/locales/app.public.fr.yml +++ b/config/locales/app.public.fr.yml @@ -246,7 +246,9 @@ fr: his_group: "Son groupe" he_wants_to_change_group: "{ROLE, select, member{Je veux} other{L'utilisateur veut}} changer de groupe" change_my_group: "Changer {ROLE, select, member{mon} other{{GENDER, select, other{son}}}} groupe" + summary: "Résumé" your_subscription_has_expired_on_the_DATE: "Votre abonnement a expiré au {DATE}" + subscription_price: "Coût de l'abonnement" you_ve_just_payed_the_subscription_html: "Vous venez de régler l'abonnement :" thank_you_your_subscription_is_successful: "Merci. Votre abonnement a bien été pris en compte !" your_invoice_will_be_available_soon_from_your_dashboard: "Votre facture sera bientôt disponible depuis votre tableau de bord" diff --git a/config/locales/app.shared.en.yml b/config/locales/app.shared.en.yml index fdea37f99..0ad0bc36a 100644 --- a/config/locales/app.shared.en.yml +++ b/config/locales/app.shared.en.yml @@ -121,6 +121,7 @@ en: _the_general_terms_and_conditions: "the general terms and conditions." credit_amount_for_pay_reservation: "{amount} {currency} remains to be paid to confirm your reservation" client_credit_amount_for_pay_reservation: "{amount} {currency} remains to be paid to confirm reservation of client" + payment_schedule: "You're about to subscribe to a payment schedule of {DEADLINES} months. By paying this bill, you agree to pay all payment deadlines." confirm_payment_of_: "Pay: {AMOUNT}" #dialog of on site payment for reservations valid_reservation_modal: @@ -128,6 +129,7 @@ en: here_is_the_summary_of_the_slots_to_book_for_the_current_user: "Here is the summary of the slots to book for the current user:" subscription_confirmation: "Subscription confirmation" here_is_the_subscription_summary: "Here is the subscription summary:" + payment_schedule: "This subscription is payed with a payment schedule of {DEADLINES} months. By validating, you confirm to collect the first monthly payment." #event edition form event: title: "Title" diff --git a/config/locales/app.shared.fr.yml b/config/locales/app.shared.fr.yml index bc75248c7..77e3aec67 100644 --- a/config/locales/app.shared.fr.yml +++ b/config/locales/app.shared.fr.yml @@ -121,6 +121,7 @@ fr: _the_general_terms_and_conditions: "les conditions générales de vente." credit_amount_for_pay_reservation: "Il vous reste {amount} {currency} à payer pour valider votre réservation" client_credit_amount_for_pay_reservation: "Il reste {amount} {currency} à payer pour valider la réservation" + payment_schedule: "Vous êtes sur le point de souscrire à un échéancier de paiement de {DEADLINES} mois. En payant cette facture, vous vous engagez à payer l'ensemble des échéances." confirm_payment_of_: "Payer : {AMOUNT}" #dialog of on site payment for reservations valid_reservation_modal: @@ -128,6 +129,7 @@ fr: here_is_the_summary_of_the_slots_to_book_for_the_current_user: "Voici le récapitulatif des créneaux à réserver pour l'utilisateur courant :" subscription_confirmation: "Validation de l'abonnement" here_is_the_subscription_summary: "Voici le récapitulatif de l'abonnement :" + payment_schedule: "Cet abonnement est souscrit par un échéancier de paiement sur {DEADLINES} mois. En validant, vous confirmez encaisser la première mensualité." #event edition form event: title: "Titre"