diff --git a/memberportal/api_admin_tools/views.py b/memberportal/api_admin_tools/views.py index 56ba5a91..21fab742 100644 --- a/memberportal/api_admin_tools/views.py +++ b/memberportal/api_admin_tools/views.py @@ -801,6 +801,8 @@ def get(self, request, member_id): "cancelAt": s.cancel_at, "cancelAtPeriodEnd": s.cancel_at_period_end, "startDate": s.start_date, + "membershipTier": member.profile.membership_plan.member_tier.get_object(), + "membershipPlan": member.profile.membership_plan.get_object(), } else: billing_info["subscription"] = None diff --git a/memberportal/api_billing/views.py b/memberportal/api_billing/views.py index a3e537de..b61c6326 100644 --- a/memberportal/api_billing/views.py +++ b/memberportal/api_billing/views.py @@ -505,6 +505,8 @@ def get(self, request): "cancelAt": s.cancel_at, "cancelAtPeriodEnd": s.cancel_at_period_end, "startDate": s.start_date, + "membershipTier": request.user.profile.membership_plan.member_tier.get_object(), + "membershipPlan": request.user.profile.membership_plan.get_object(), } return Response({"success": True, "subscription": subscription}) diff --git a/src-frontend/src/components/AdminTools/ManageMember.vue b/src-frontend/src/components/AdminTools/ManageMember.vue index 0c7c9a20..e3db98c7 100644 --- a/src-frontend/src/components/AdminTools/ManageMember.vue +++ b/src-frontend/src/components/AdminTools/ManageMember.vue @@ -898,6 +898,12 @@ > + + {{ $t(`adminTools.membershipTier`) }} + + + {{ $t(`adminTools.billingPlan`) }} + {{ $t(`adminTools.billingCycleAnchor`) }} @@ -905,16 +911,48 @@ {{ $t(`adminTools.currentPeriodEnd`) }} - - {{ $t(`adminTools.cancelAt`) }} - - - {{ $t(`adminTools.cancelAtPeriodEnd`) }} - + + + {{ + billing.subscription.membershipTier.name + }} + + + {{ + $t('paymentPlans.intervalDescription', { + currency: + billing.subscription.membershipPlan.currency.toUpperCase(), + amount: $n( + billing.subscription.membershipPlan.cost / 100, + 'currency', + siteLocaleCurrency + ), + interval: $tc( + `paymentPlans.interval.${billing.subscription.membershipPlan.interval.toLowerCase()}`, + billing.subscription.membershipPlan.intervalAmount + ), + }) + }} + {{ formatDate(billing.subscription.billingCycleAnchor) }} @@ -924,12 +962,18 @@ {{ formatDate(billing.subscription.currentPeriodEnd) }} - - {{ formatDate(billing.subscription.cancelAt) }} - - - {{ formatDate(billing.subscription.cancelAtPeriodEnd) }} - + @@ -1643,13 +1687,13 @@ export default defineComponent({ max-width: 100%; } -a, -a:visited, -a:hover, -a:active { - color: inherit; - text-decoration: none; -} +//a, +//a:visited, +//a:hover, +//a:active { +// color: inherit; +// text-decoration: none; +//} .active { color: green; diff --git a/src-frontend/src/i18n/en-AU/index.ts b/src-frontend/src/i18n/en-AU/index.ts index 9dc5d374..18658d88 100644 --- a/src-frontend/src/i18n/en-AU/index.ts +++ b/src-frontend/src/i18n/en-AU/index.ts @@ -467,6 +467,8 @@ export default { cancelAt: 'Cancels At', cancelAtPeriodEnd: 'Cancels At Period End', currentPeriodEnd: 'Current Period End', + membershipTier: 'Membership Tier', + billingPlan: 'Billing Plan', startDate: 'Start Date', noSubscription: 'No subscription was found for this member.', noMembers: 'No members were found that match your filter or search query.', diff --git a/src-frontend/src/types/subscriptions.d.ts b/src-frontend/src/types/subscriptions.d.ts index c1b4ccbc..00958656 100644 --- a/src-frontend/src/types/subscriptions.d.ts +++ b/src-frontend/src/types/subscriptions.d.ts @@ -1,3 +1,20 @@ +interface MemberPlan { + id: number; + name: string; + currency: string; + cost: number; + intervalAmount: number; + interval: string; +} + +interface MemberTier { + id: number; + name: string; + description: string; + featured: boolean; + plans: MemberPlan[]; +} + interface MemberSubscription { billingCycleAnchor: Date; cancelAt: Date; @@ -5,4 +22,6 @@ interface MemberSubscription { currentPeriodEnd: Date; startDate: Date; status: string; + membershipPlan: MemberPlan; + membershipTier: MemberTier; } diff --git a/src-frontend/tsconfig.json b/src-frontend/tsconfig.json index e1a1e119..b0365ac3 100644 --- a/src-frontend/tsconfig.json +++ b/src-frontend/tsconfig.json @@ -8,7 +8,8 @@ "@store/*": ["src/store/*"], "@mixins/*": ["src/mixins/*"], "@assets/*": ["src/assets/*"], - "types/*": ["src/types/*"] + "types/*": ["src/types/*"], + "boot/*": ["src/boot/*"], } }, "moduleResolution": "node"