1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-29 10:24:20 +01:00

disable monthly payment for 1 month of subscription

This commit is contained in:
Du Peng 2021-09-10 15:34:49 +02:00
parent 6b763cc1c9
commit 65ba3a686b
3 changed files with 2 additions and 3 deletions

View File

@ -84,7 +84,7 @@ const PlanCardComponent: React.FC<PlanCardProps> = ({ plan, userId, subscribedPl
* Check if the plan is allowing a monthly payment schedule
*/
const canBeScheduled = (): boolean => {
return plan.monthly_payment && plan.interval_count !== 1;
return plan.monthly_payment;
};
/**
* Callback triggered when the user select the plan

View File

@ -630,7 +630,6 @@ Application.Directives.directive('cart', ['$rootScope', '$uibModal', 'dialogs',
if (Auth.isAuthenticated()) {
if ($scope.selectedPlan !== $scope.plan) {
$scope.selectedPlan = $scope.plan;
if ($scope.selectedPlan.monthly_payment && $scope.selectedPlan.interval_count === 1) { $scope.selectedPlan.monthly_payment = false; }
$scope.schedule.requested_schedule = $scope.plan.monthly_payment;
} else {
$scope.selectedPlan = null;

View File

@ -132,7 +132,7 @@
<div class="input-group m-t-md">
<label for="plan[monthly_payment]" class="control-label m-r-md">{{ 'app.shared.plan.monthly_payment' | translate }} *</label>
<switch id="plan[monthly_payment]" disabled="plan.interval === 'week' || plan.interval_count === 1" checked="plan.monthly_payment" on-change="toggleMonthlyPayment" class-name="'v-middle'" ng-if="plan && method != 'PATCH'"></switch>
<switch id="plan[monthly_payment]" disabled="plan.interval === 'week' || (plan.interval === 'month' && plan.interval_count === 1)" checked="plan.monthly_payment" on-change="toggleMonthlyPayment" class-name="'v-middle'" ng-if="plan && method != 'PATCH'"></switch>
<span ng-if="method == 'PATCH'">{{ (plan.monthly_payment ? 'app.shared.buttons.yes' : 'app.shared.buttons.no') | translate }}</span>
<input type="hidden" id="plan_monthly_input" name="plan[monthly_payment]" value="{{plan.monthly_payment}}" />
<span class="help-block" translate>{{ 'app.shared.plan.monthly_payment_info' }}</span>