Commit 3c4ad790 by Nilu

PPJ pricing according to selected currency

parent b1cf1e30
...@@ -14,6 +14,7 @@ import oneit.utils.StringUtils; ...@@ -14,6 +14,7 @@ import oneit.utils.StringUtils;
import oneit.utils.filter.Filter; import oneit.utils.filter.Filter;
import oneit.utils.parsers.FieldException; import oneit.utils.parsers.FieldException;
import performa.orm.types.AssessmentType; import performa.orm.types.AssessmentType;
import performa.orm.types.CurrencyType;
import performa.orm.types.RoleType; import performa.orm.types.RoleType;
import performa.utils.StripeUtils; import performa.utils.StripeUtils;
...@@ -218,8 +219,19 @@ public class HiringTeam extends BaseHiringTeam ...@@ -218,8 +219,19 @@ public class HiringTeam extends BaseHiringTeam
public Double getPPJAmount(Job job) public Double getPPJAmount(Job job)
{ {
double amount = job != null ? (job.getAssessmentType() == AssessmentType.COMPREHENSIVE ? PaymentPlan.PAY_PER_JOB_AMOUNT : PaymentPlan.PAY_PER_JOB_EXPRESS) : PaymentPlan.PAY_PER_JOB_AMOUNT; // double amount = job != null ? (job.getAssessmentType() == AssessmentType.COMPREHENSIVE ? PaymentPlan.PAY_PER_JOB_AMOUNT : PaymentPlan.PAY_PER_JOB_EXPRESS) : PaymentPlan.PAY_PER_JOB_AMOUNT;
return amount * (getCoupon() != null ? (100 - getCoupon().getPercentageOff()) * 0.01 : 1); return getPPJAmount() * (getCoupon() != null ? (100 - getCoupon().getPercentageOff()) * 0.01 : 1);
}
public Double getPPJAmount()
{
CurrencyType currency = getCountry().getCurrency();
return currency == CurrencyType.NZD ? 412D :
currency == CurrencyType.CAD ? 358D :
currency == CurrencyType.USD ? 277D :
currency == CurrencyType.GBP ? 212D :
currency == CurrencyType.EUR ? 239D : 385D;
} }
} }
\ No newline at end of file
...@@ -55,13 +55,13 @@ ...@@ -55,13 +55,13 @@
width : 600, height : 640 width : 600, height : 640
}); });
PopupCoupon = new jBox('Modal', { PopupCoupon = new jBox('Modal', {
id : "change-plan", id : "change-plan",
overlay : true, overlay : true,
width : 500, height : 400 width : 500, height : 400
}); });
PopupAlert = new jBox('Modal', { PopupAlert = new jBox('Modal', {
id : "change-plan", id : "change-plan",
overlay : true, overlay : true,
width : 350, height : 300 width : 350, height : 300
...@@ -76,6 +76,7 @@ ...@@ -76,6 +76,7 @@
$(".invalid-coupon-close-button").on("click",function(){ $(".invalid-coupon-close-button").on("click",function(){
PopupCoupon.close(); PopupCoupon.close();
PopupAlert.close();
}); });
$(".change-plan-no-button").on("click",function(){ $(".change-plan-no-button").on("click",function(){
...@@ -217,7 +218,7 @@ ...@@ -217,7 +218,7 @@
{ {
%> %>
<div class="per-job-amount-past"> <div class="per-job-amount-past">
was <oneit:toString value="<%= PaymentPlan.PAY_PER_JOB_AMOUNT %>" mode="<%= currencyFormat %>"/> per job was <oneit:toString value="<%= hiringTeam.getPPJAmount() %>" mode="<%= currencyFormat %>"/> per job
</div> </div>
<% <%
} }
......
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