1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-29 18:52:22 +01:00

user consent about payment schedule

This commit is contained in:
Sylvain 2020-11-10 09:51:13 +01:00
parent 2ab7f3bdb9
commit a321771040
7 changed files with 31 additions and 9 deletions

View File

@ -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;
};
/**

View File

@ -17,6 +17,9 @@
<p translate>{{ 'app.shared.valid_reservation_modal.here_is_the_subscription_summary' }}</p>
<p>{{ plan | humanReadablePlanName }}</p>
</div>
<div ng-if="schedule">
<p translate translate-values="{DEADLINES: schedule.items.length}">{{ 'app.shared.valid_reservation_modal.payment_schedule' }}</p>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-info" ng-click="ok()" ng-disabled="attempting" ng-bind-html="validButtonName"></button>

View File

@ -23,9 +23,12 @@
<a href="{{cgv.custom_asset_file_attributes.attachment_url}}" target="_blank" translate>{{ 'app.shared.stripe._the_general_terms_and_conditions' }}</a>
</label>
</div>
<div ng-if="!cgv">
<input type="hidden" name="acceptCondition" ng-model="acceptCondition" value="true">
</div>
<div ng-if="!cgv">
<input type="hidden" name="acceptCondition" ng-model="acceptCondition" value="true">
</div>
</div>
<div ng-if="schedule">
<p translate translate-values="{DEADLINES: schedule.items.length}">{{ 'app.shared.stripe.payment_schedule' }}</p>
</div>
</div>

View File

@ -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 <strong>subscription</strong>:"
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"

View File

@ -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 <strong>l'abonnement</strong> :"
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"

View File

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

View File

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