|
@@ -23,17 +23,6 @@ function shouldPlanChangeAtTermEnd(oldPlan, newPlan, isInTrial) {
|
|
|
return oldPlan.price_in_cents > newPlan.price_in_cents
|
|
return oldPlan.price_in_cents > newPlan.price_in_cents
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-/**
|
|
|
|
|
- * This is duplicated in:
|
|
|
|
|
- * - services/web/scripts/plan-prices/plans.mjs
|
|
|
|
|
- * - services/web/modules/subscriptions/frontend/js/pages/plans/group-member-picker/group-plan-pricing.js
|
|
|
|
|
- * @param {number} number
|
|
|
|
|
- * @returns {number}
|
|
|
|
|
- */
|
|
|
|
|
-function roundUpToNearest5Cents(number) {
|
|
|
|
|
- return Math.ceil(number * 20) / 20
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* @import { CurrencyCode } from '../../../../types/subscription/currency'
|
|
* @import { CurrencyCode } from '../../../../types/subscription/currency'
|
|
|
*/
|
|
*/
|
|
@@ -48,7 +37,6 @@ function roundUpToNearest5Cents(number) {
|
|
|
* @typedef {Object} LocalizedGroupPrice
|
|
* @typedef {Object} LocalizedGroupPrice
|
|
|
* @property {PlanToPrice} price
|
|
* @property {PlanToPrice} price
|
|
|
* @property {PlanToPrice} pricePerUser
|
|
* @property {PlanToPrice} pricePerUser
|
|
|
- * @property {PlanToPrice} pricePerUserPerMonth
|
|
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -65,17 +53,11 @@ function generateInitialLocalizedGroupPrice(recommendedCurrency, locale) {
|
|
|
INITIAL_LICENSE_SIZE
|
|
INITIAL_LICENSE_SIZE
|
|
|
].price_in_cents / 100
|
|
].price_in_cents / 100
|
|
|
const collaboratorPricePerUser = collaboratorPrice / INITIAL_LICENSE_SIZE
|
|
const collaboratorPricePerUser = collaboratorPrice / INITIAL_LICENSE_SIZE
|
|
|
- const collaboratorPricePerUserPerMonth = roundUpToNearest5Cents(
|
|
|
|
|
- collaboratorPrice / INITIAL_LICENSE_SIZE / 12
|
|
|
|
|
- )
|
|
|
|
|
const professionalPrice =
|
|
const professionalPrice =
|
|
|
GroupPlansData.enterprise.professional[recommendedCurrency][
|
|
GroupPlansData.enterprise.professional[recommendedCurrency][
|
|
|
INITIAL_LICENSE_SIZE
|
|
INITIAL_LICENSE_SIZE
|
|
|
].price_in_cents / 100
|
|
].price_in_cents / 100
|
|
|
const professionalPricePerUser = professionalPrice / INITIAL_LICENSE_SIZE
|
|
const professionalPricePerUser = professionalPrice / INITIAL_LICENSE_SIZE
|
|
|
- const professionalPricePerUserPerMonth = roundUpToNearest5Cents(
|
|
|
|
|
- professionalPrice / INITIAL_LICENSE_SIZE / 12
|
|
|
|
|
- )
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* @param {number} price
|
|
* @param {number} price
|
|
@@ -93,10 +75,6 @@ function generateInitialLocalizedGroupPrice(recommendedCurrency, locale) {
|
|
|
collaborator: formatPrice(collaboratorPricePerUser),
|
|
collaborator: formatPrice(collaboratorPricePerUser),
|
|
|
professional: formatPrice(professionalPricePerUser),
|
|
professional: formatPrice(professionalPricePerUser),
|
|
|
},
|
|
},
|
|
|
- pricePerUserPerMonth: {
|
|
|
|
|
- collaborator: formatPrice(collaboratorPricePerUserPerMonth),
|
|
|
|
|
- professional: formatPrice(professionalPricePerUserPerMonth),
|
|
|
|
|
- },
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|