mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-01-29 18:52:22 +01:00
use plant.base_name instands of plan.name
This commit is contained in:
parent
a9901fccb2
commit
1c54e54c17
@ -956,14 +956,14 @@ Application.Controllers.controller('CreateEventModalController', ['$scope', '$ui
|
||||
});
|
||||
$scope.tagsName = localizedList(tags);
|
||||
if ($scope.isOnlySubscriptions && $scope.selectedPlans.length > 0) {
|
||||
$scope.plansName = localizedList($scope.selectedPlans);
|
||||
$scope.plansName = localizedList($scope.selectedPlans, 'base_name');
|
||||
}
|
||||
};
|
||||
|
||||
const localizedList = function (items) {
|
||||
const localizedList = function (items, attr = 'name') {
|
||||
if (items.length === 0) return `<span class="text-gray text-italic">${_t('app.admin.calendar.none')}</span>`;
|
||||
|
||||
const names = items.map(function (i) { return $sce.trustAsHtml(`<strong>${i.name}</strong>`); });
|
||||
const names = items.map(function (i) { return $sce.trustAsHtml(`<strong>${i[attr]}</strong>`); });
|
||||
if (items.length > 1) return names.slice(0, -1).join(', ') + ` ${_t('app.admin.calendar.and')} ` + names[names.length - 1];
|
||||
|
||||
return names[0];
|
||||
|
@ -115,7 +115,7 @@
|
||||
<div class="font-sbold">{{::g.name}}</div>
|
||||
<ul class="m-n" ng-repeat="plan in g.plans">
|
||||
<li>
|
||||
{{::plan.name}}
|
||||
{{::plan.base_name}}
|
||||
<span class="btn btn-warning btn-xs" ng-click="removePlan(plan)" ><i class="fa fa-times red"></i></span>
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -149,7 +149,7 @@
|
||||
<div ng-repeat="group in plansClassifiedByGroup">
|
||||
<div class="text-center font-sbold">{{::group.name}}</div>
|
||||
<label class="checkbox m-l-md" ng-repeat="plan in group.plans">
|
||||
<input type="checkbox" ng-click="toggleSelectPlan(plan)" ng-model="selectedPlansBinding[plan.id]"> {{::plan.name}}</span>
|
||||
<input type="checkbox" ng-click="toggleSelectPlan(plan)" ng-model="selectedPlansBinding[plan.id]"> {{::plan.base_name}}</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -37,7 +37,7 @@
|
||||
<div ng-repeat="group in slot.plansGrouped">
|
||||
<div class="font-sbold">{{::group.name}}</div>
|
||||
<ul class="m-n" ng-repeat="plan in group.plans">
|
||||
<li>{{::plan.name}}</li>
|
||||
<li>{{::plan.base_name}}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -11,7 +11,7 @@
|
||||
<div ng-repeat="group in slot.plansGrouped">
|
||||
<div class="font-sbold">{{::group.name}}</div>
|
||||
<ul class="m-n" ng-repeat="plan in group.plans">
|
||||
<li>{{::plan.name}}</li>
|
||||
<li>{{::plan.base_name}}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -24,7 +24,7 @@ class CartItem::Subscription < CartItem::BaseItem
|
||||
end
|
||||
|
||||
def name
|
||||
@plan.name
|
||||
@plan.base_name
|
||||
end
|
||||
|
||||
def to_object
|
||||
|
@ -132,6 +132,6 @@ class Plan < ApplicationRecord
|
||||
end
|
||||
|
||||
def update_gateway_product
|
||||
PaymentGatewayService.new.create_or_update_product(Plan.name, id)
|
||||
PaymentGatewayService.new.create_or_update_product(Plan.base_name, id)
|
||||
end
|
||||
end
|
||||
|
@ -57,7 +57,7 @@ class Subscription < ApplicationRecord
|
||||
operator_profile_id: operator_profile_id,
|
||||
total: 0
|
||||
)
|
||||
invoice.invoice_items.push InvoiceItem.new(amount: 0, description: plan.name, object: od)
|
||||
invoice.invoice_items.push InvoiceItem.new(amount: 0, description: plan.base_name, object: od)
|
||||
invoice.save
|
||||
|
||||
if save
|
||||
|
@ -175,7 +175,7 @@ class InvoicesService
|
||||
|
||||
invoice.invoice_items.push InvoiceItem.new(
|
||||
amount: payment_details[:elements][:plan],
|
||||
description: subscription.plan.name,
|
||||
description: subscription.plan.base_name,
|
||||
object: subscription,
|
||||
main: main
|
||||
)
|
||||
|
@ -249,7 +249,7 @@ class PaymentScheduleService
|
||||
|
||||
invoice.invoice_items.push InvoiceItem.new(
|
||||
amount: payment_details[:subscription],
|
||||
description: subscription.plan.name,
|
||||
description: subscription.plan.base_name,
|
||||
object: subscription,
|
||||
main: main
|
||||
)
|
||||
|
@ -57,6 +57,7 @@ json.array!(@members) do |member|
|
||||
json.plan do
|
||||
json.id member.subscription.plan.id
|
||||
json.name member.subscription.plan.name
|
||||
json.base_name member.subscription.plan.base_name
|
||||
json.interval member.subscription.plan.interval
|
||||
json.amount member.subscription.plan.amount ? (member.subscription.plan.amount / 100.0) : 0
|
||||
end
|
||||
|
@ -1,5 +1,4 @@
|
||||
json.title notification.notification_type
|
||||
json.description t('.subscription_PLAN_has_been_subscribed_by_USER_html',
|
||||
PLAN: notification.attached_object.plan.name,
|
||||
PLAN: notification.attached_object.plan.base_name,
|
||||
USER: notification.attached_object.user&.profile&.full_name || t('api.notifications.deleted_user'))
|
||||
|
||||
|
@ -1,9 +1,8 @@
|
||||
json.title notification.notification_type
|
||||
json.description _t('.subscription_PLAN_of_the_member_USER_has_been_extended_FREE_until_DATE_html',
|
||||
{
|
||||
PLAN: notification.attached_object.plan.name,
|
||||
PLAN: notification.attached_object.plan.base_name,
|
||||
USER: notification.attached_object.user&.profile&.full_name || t('api.notifications.deleted_user'),
|
||||
FREE: notification.get_meta_data(:free_days).to_s,
|
||||
DATE: I18n.l(notification.attached_object.expired_at.to_date)
|
||||
}) # messageFormat
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
json.title notification.notification_type
|
||||
json.description t('.you_have_subscribed_to_PLAN_html',
|
||||
PLAN: notification.attached_object.plan.name)
|
||||
|
||||
PLAN: notification.attached_object.plan.base_name)
|
||||
|
@ -1,4 +1,3 @@
|
||||
json.title notification.notification_type
|
||||
json.description t('.your_subscription_PLAN_was_successfully_cancelled_html',
|
||||
PLAN: notification.attached_object.plan.name)
|
||||
|
||||
PLAN: notification.attached_object.plan.base_name)
|
||||
|
@ -1,8 +1,7 @@
|
||||
json.title notification.notification_type
|
||||
json.description _t('.your_subscription_PLAN_has_been_extended_FREE_until_DATE_html',
|
||||
{
|
||||
PLAN: notification.attached_object.plan.name,
|
||||
PLAN: notification.attached_object.plan.base_name,
|
||||
FREE: notification.get_meta_data(:free_days).to_s,
|
||||
DATE: I18n.l(notification.attached_object.expired_at.to_date)
|
||||
}) # messageFormat
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
json.title notification.notification_type
|
||||
json.description t('.subscription_partner_PLAN_has_been_subscribed_by_USER_html',
|
||||
{
|
||||
PLAN: notification.attached_object.plan.name,
|
||||
PLAN: notification.attached_object.plan.base_name,
|
||||
USER: notification.attached_object.user&.profile&.full_name || t('api.notifications.deleted_user')
|
||||
}) # messageFormat
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user