Commit de8d2e26 by Nilu

S12523563 # Client - Incoming Issues (raised by Client) #Pricing need to be specific to currency

parent 46e168ad
......@@ -40,6 +40,7 @@ public class PullStripeDataBatch extends ORMBatch
Map<String, Object> planParams = new HashMap<>();
planParams.put("active", true);
planParams.put("limit", 100);
List<Plan> plansList = Plan.list(planParams).getData();
PaymentPlan[] paymentPlans = PaymentPlan.searchAll(ot);
......@@ -73,18 +74,17 @@ public class PullStripeDataBatch extends ORMBatch
paymentPlan.setStripeReference(plan.getId());
paymentPlan.setPlanName(plan.getNickname());
// paymentPlan.setDescription(plan.());
paymentPlan.setCurrencyType(CurrencyType.forName(plan.getCurrency().toUpperCase()));
paymentPlan.setAmount(plan.getAmount().doubleValue() / 100);
paymentPlan.setInterval(Interval.forName(plan.getInterval().toUpperCase()));
paymentPlan.setIntervalCount(plan.getIntervalCount().intValue());
paymentPlan.setIntervalCount(plan.getIntervalCount());
paymentPlan.setDisabled(Boolean.FALSE);
paymentPlan.setProductReference(plan.getProduct());
paymentPlan.setUsageType(UsageType.forName(plan.getUsageType().toUpperCase()));
if(plan.getTrialPeriodDays() != null)
{
paymentPlan.setTrialPeriodDays(plan.getTrialPeriodDays().intValue());
paymentPlan.setTrialPeriodDays(plan.getTrialPeriodDays());
}
if(activeJobs != null)
......
......@@ -665,4 +665,13 @@ public class Utils
return billingTeam.getCardID() != null && (billingTeam.isTrue(billingTeam.getIsPPJ()) || billingTeam.canCreateJob());
}
public static String getCurrencyFormat(HiringTeam hiringTeam)
{
CurrencyType currency = hiringTeam.getCountry().getCurrency();
return currency == CurrencyType.GBP ? "CurrencyGBPOnly" :
currency == CurrencyType.EUR ? "CurrencyEuroOnly" :
"CurrencyDollarsOnly";
}
}
\ No newline at end of file
......@@ -173,6 +173,14 @@
<PARAM name="PerformaDateFormatter" factory="Participant" class="oneit.utils.text.DateFormatterFactory"
format="MMM dd, yyyy" language="en" country="au"/>
<PARAM name="CurrencyGBPOnlyFormatter" factory="Participant" class="oneit.utils.text.DecimalFormatterFactory">
<Format factory="String" value="£#,##0"/>
</PARAM>
<PARAM name="CurrencyEuroOnlyFormatter" factory="Participant" class="oneit.utils.text.DecimalFormatterFactory">
<Format factory="String" value="€#,##0"/>
</PARAM>
</NODE>
......
......@@ -257,7 +257,7 @@
String dotClass = firstScore.getColorCode() != null ? firstScore.getColorCode().getDotCSSClass() : "";
%>
<div style="width: 100%;">
<div style="width: 100%;">
<div class="a-label-row">
<div class="width50 text-left" >
<span class="common-dot <%= dotClass %>"></span>
......@@ -280,7 +280,7 @@
}
%>
</div>
</div>
</div>
<%
}
}
......
......@@ -16,11 +16,12 @@
Debug.assertion(company != null , "Invalid company in admin portal my company");
Debug.assertion(hiringTeam != null , "Invalid Hiring Team in admin portal manage plan");
PaymentPlan[] paymentPlans = PaymentPlan.SearchByAll()
.andDisabled(new EqualsFilter<>(Boolean.FALSE))
.andUsageType(new EqualsFilter<>(UsageType.LICENSED))
.andActiveJobCount(new GreaterThanFilter<>(0))
.andCurrencyType(new EqualsFilter<>(hiringTeam.getCountry().getCurrency()))
.search(transaction);
List<PaymentPlan> sortedPlans = ObjstoreUtils.sort(Arrays.asList(paymentPlans),
......@@ -35,6 +36,8 @@
{
subscription = StripeUtils.retrieveSubscription(hiringTeam.getStripeSubscription());
}
String currencyFormat = Utils.getCurrencyFormat(hiringTeam);
%>
<script type="text/javascript">
var Popup = null;
......@@ -207,14 +210,14 @@
</div>
<div class="manage-plan-payplan">
<div class="per-job-amount">
<oneit:toString value="<%= hiringTeam.getPPJAmount(null) %>" mode="CurrencyDollarsOnly"/>/ Job
<oneit:toString value="<%= hiringTeam.getPPJAmount(null) %>" mode="<%= currencyFormat %>"/>/ Job
</div>
<%
if(hasValidCoupon)
{
%>
<div class="per-job-amount-past">
was <oneit:toString value="<%= PaymentPlan.PAY_PER_JOB_AMOUNT %>" mode="CurrencyDollarsOnly"/> per job
was <oneit:toString value="<%= PaymentPlan.PAY_PER_JOB_AMOUNT %>" mode="<%= currencyFormat %>"/> per job
</div>
<%
}
......@@ -282,26 +285,26 @@
<%= paymentPlan.getActiveJobCount() %> Jobs
</div>
<div class="cost <%= hasValidCoupon ? "discounted" : ""%>">
<oneit:toString value="<%= paymentPlan.getAmountPerJob(hiringTeam) %>" mode="CurrencyDollarsOnly"/>
<oneit:toString value="<%= paymentPlan.getAmountPerJob(hiringTeam) %>" mode="<%= currencyFormat %>"/>
<%
if(hasValidCoupon)
{
%>
<span class="past-val">
Was <oneit:toString value="<%= paymentPlan.getAmount() / paymentPlan.getActiveJobCount() %>" mode="CurrencyDollarsOnly"/>
Was <oneit:toString value="<%= paymentPlan.getAmount() / paymentPlan.getActiveJobCount() %>" mode="<%= currencyFormat %>"/>
</span>
<%
}
%>
</div>
<div class="fee <%= hasValidCoupon ? "discounted" : ""%>">
<oneit:toString value="<%= paymentPlan.getTotalAmount(hiringTeam) %>" mode="CurrencyDollarsOnly"/><span class="month"> / month </span>
<oneit:toString value="<%= paymentPlan.getTotalAmount(hiringTeam) %>" mode="<%= currencyFormat %>"/><span class="month"> / month </span>
<%
if(hasValidCoupon)
{
%>
<span class="past-val">
Was <oneit:toString value="<%= paymentPlan.getAmount() %>" mode="CurrencyDollarsOnly"/>
Was <oneit:toString value="<%= paymentPlan.getAmount() %>" mode="<%= currencyFormat %>"/>
</span>
<%
}
......@@ -340,10 +343,10 @@
{
%>
Upgrading your plan to <%= paymentPlan.getActiveJobCount() %> Jobs per month will incur an additional cost of
<%= FormatUtils.stringify(costDiff, "CurrencyDollarsOnly", "") %> be billed immediately.
<%= FormatUtils.stringify(costDiff, currencyFormat, "") %> be billed immediately.
<span>
This cost is to cover the difference between your current active <%= currentPlan.getActiveJobCount() %> job plan (<%= FormatUtils.stringify(currentPlanCost, "CurrencyDollarsOnly", "") %>)
and the new <%= paymentPlan.getActiveJobCount() %> job plan (<%= FormatUtils.stringify(newPlanCost, "CurrencyDollarsOnly", "") %>).
This cost is to cover the difference between your current active <%= currentPlan.getActiveJobCount() %> job plan (<%= FormatUtils.stringify(currentPlanCost, currencyFormat, "") %>)
and the new <%= paymentPlan.getActiveJobCount() %> job plan (<%= FormatUtils.stringify(newPlanCost, currencyFormat, "") %>).
</span>
<%
}
......@@ -369,7 +372,7 @@
</div>
<div class="list-item">
<span class="item-title">Date of next billing period</span>
<span class="item-value"><%= FormatUtils.stringify(newPlanCost, "CurrencyDollarsOnly", "") %> on <oneit:toString value="<%= new Date(subscription.getCurrentPeriodEnd() * 1000) %>" mode="LongDate"/></span>
<span class="item-value"><%= FormatUtils.stringify(newPlanCost, currencyFormat , "") %> on <oneit:toString value="<%= new Date(subscription.getCurrentPeriodEnd() * 1000) %>" mode="LongDate"/></span>
</div>
</div>
<div class="upgrade-info">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment