Commit 678e69b4 by chenith

J006: payment plan details updated.

parent 0466906a
......@@ -108,7 +108,7 @@ public class SaveJobFP extends SaveFP
CompanyUser companyUser = loggedInUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
Company company = companyUser.getCompany();
BusinessObjectParser.assertFieldCondition(company.getPaymentPlan() != null, job , Company.SINGLEREFERENCE_PaymentPlan, "mandatory", exceptions, true, request);
BusinessObjectParser.assertFieldCondition(company.getSelectedPaymentPlan()!= null, job , Company.SINGLEREFERENCE_PaymentPlan, "mandatory", exceptions, true, request);
}
super.validate(process, submission, exceptions, params);
......
......@@ -8,6 +8,7 @@ import oneit.objstore.rdbms.filters.IsNotNullFilter;
import oneit.security.SecUser;
import oneit.utils.CollectionUtils;
import oneit.utils.StringUtils;
import oneit.utils.math.NullArith;
import oneit.utils.parsers.FieldException;
......@@ -97,9 +98,37 @@ public class Company extends BaseCompany
public Double getPaymentPlanAmount()
{
if(getSelectedPaymentPlan()!=null)
PaymentPlan selectedPaymentPlan = getSelectedPaymentPlan();
if(selectedPaymentPlan!=null)
{
return selectedPaymentPlan.getAmount();
}
return null;
}
public Double getPerJobPaymentPlanAmount()
{
PaymentPlan selectedPaymentPlan = getSelectedPaymentPlan();
if(selectedPaymentPlan!=null)
{
return NullArith.divide(selectedPaymentPlan.getAmount(), selectedPaymentPlan.getActiveJobCount());
}
return null;
}
public Double getPaymentPlanSaveAmount()
{
PaymentPlan selectedPaymentPlan = getSelectedPaymentPlan();
if(selectedPaymentPlan!=null)
{
return getSelectedPaymentPlan().getAmount();
return selectedPaymentPlan.getPerMonthSaveAmount();
}
return null;
......
package performa.orm;
import oneit.utils.math.NullArith;
public class PaymentPlan extends BasePaymentPlan
{
private static final long serialVersionUID = 0L;
private static final long serialVersionUID = 0L;
public static final Double PER_PER_JOB_AMOUNT = 499D;
// This constructor should not be called
public PaymentPlan ()
......@@ -11,6 +14,7 @@ public class PaymentPlan extends BasePaymentPlan
// Do not add any code to this, always put it in initialiseNewObject
}
@Override
public String getToString()
{
......@@ -21,4 +25,15 @@ public class PaymentPlan extends BasePaymentPlan
return super.getToString();
}
public Double getPerMonthSaveAmount()
{
if(getActiveJobCount()!=null)
{
return NullArith.subtract(NullArith.multiply(getActiveJobCount(), PER_PER_JOB_AMOUNT, 0D), getAmount(), 0D);
}
return null;
}
}
\ No newline at end of file
......@@ -5983,7 +5983,7 @@ input{
font-family: "Usual-Light";
font-size: 40px;
font-weight: 300;
/*line-height: 48px;*/
display: inline-block;
text-align: center;
}
......@@ -5997,6 +5997,10 @@ input{
color: #8D8D8D;
font-family: "Usual-Light";
font-size: 12px;
display: inline-block;
text-align: left;
vertical-align: middle;
margin-right: 6px;
}
.per-job {
......@@ -6047,4 +6051,7 @@ input{
.payment-paln-count{
width: 75px;
font-size: 24px;
text-align: center;
margin-top: 6px;
}
\ No newline at end of file
......@@ -56,22 +56,18 @@
<p>Hire for any role, save up to $995.00 / mo</p>
</div>
<div class="a-label-row payment-type-row">
<div class="col-md-2 col-sm-2 col-xs-2 text-right">
</div>
<div class="col-md-2 col-sm-2 col-xs-2 text-right">
<div class="col-md-6 col-sm-6 col-xs-6 text-right">
<div class="active-jobs-per-mont">
Active Jobs Per Month
</div>
</div>
<div class="col-md-2 col-sm-2 col-xs-2">
<oneit:ormInput type="number" obj="<%= company %>" attributeName="PaymentJobCount"
min="<%= minCount %>" max="<%= maxCount %>" step="1" cssClass="form-control payment-paln-count"/>
min="<%= minCount %>" max="<%= maxCount %>" step="1" cssClass="payment-paln-count"/>
</div>
<div class="col-md-4 col-sm-4 col-xs-4 text-right">
<oneit:recalcClass htmlTag="span" classScript="company.getPaymentPlanAmount()!=null ? 'show': 'hide'" company="<%= company %>">
<div class="col-md-6 col-sm-6 col-xs-6 text-left">
<oneit:recalcClass htmlTag="span" classScript="company.getPerJobPaymentPlanAmount()!=null ? 'show': 'hide'" company="<%= company %>">
<div >
<span class="payment-amt text-right">
<oneit:recalc mode="Currency" script="company.getPaymentPlanAmount()" company="<%= company %>" nullValue=""/>
<oneit:recalc mode="Currency" script="company.getPerJobPaymentPlanAmount()" company="<%= company %>" nullValue=""/>
</span>
<span class="text-left">
<p class="per-job">
......@@ -80,28 +76,36 @@
</span>
</div>
</oneit:recalcClass>
</div>
<div class="col-md-2 col-sm-2 col-xs-2 text-right">
</div>
</div>
<div class="a-label-row text-center">
<oneit:button value="Select Plan" name="saveJob" cssClass="btn btn-primary largeBtn btn-green"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry ("fromPage", fromPage)
.mapEntry("JobStatus", JobStatus.OPEN)
.mapEntry ("restartProcess", Boolean.TRUE)
.mapEntry ("attribNamesToRestore", Collections.singleton("Job"))
.toMap() %>" />
</div>
<div class="a-label-row text-center">
<div class="col-md-4 col-sm-4 col-xs-4">
</div>
<div class="col-md-4 col-sm-4 col-xs-4 payment-job-det text-center">
$1500.00 Monthly for up to 5 jobs / month Save $995.00 per month
<oneit:recalcClass htmlTag="span" classScript="company.getPaymentPlanAmount()!=null ? 'show': 'hide'" company="<%= company %>">
<div class="a-label-row text-center">
<oneit:button value="Select Plan" name="saveJob" cssClass="btn btn-primary largeBtn btn-green"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry ("fromPage", fromPage)
.mapEntry("JobStatus", JobStatus.OPEN)
.mapEntry ("restartProcess", Boolean.TRUE)
.mapEntry ("attribNamesToRestore", Collections.singleton("Job"))
.toMap() %>" />
</div>
<div class="col-md-4 col-sm-4 col-xs-4">
<div class="a-label-row text-center">
<div class="col-md-4 col-sm-4 col-xs-4">
</div>
<div class="col-md-4 col-sm-4 col-xs-4 payment-job-det text-center">
<oneit:toString value="<%= PaymentPlan.PER_PER_JOB_AMOUNT %>" mode="Currency"/>
Monthly for up to
<oneit:recalc mode="EscapeHTML" script="company.getPaymentJobCount()" company="<%= company %>" nullValue=""/>
jobs / month
Save
<oneit:recalc mode="Currency" script="company.getPaymentPlanSaveAmount()" company="<%= company %>" nullValue=""/>
per month
</div>
<div class="col-md-4 col-sm-4 col-xs-4">
</div>
</div>
</div>
</oneit:recalcClass>
</div>
<div class="form-page-area payment-optio-sep">
......
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