Commit 0e300c7e by chenith

J006 - Payment palan for job.

parent e38be188
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
<column name="stripe_reference" type="String" nullable="true" length="100"/> <column name="stripe_reference" type="String" nullable="true" length="100"/>
<column name="stripe_subscription" type="String" nullable="true" length="100"/> <column name="stripe_subscription" type="String" nullable="true" length="100"/>
<column name="added_by_user_id" type="Long" length="11" nullable="false"/> <column name="added_by_user_id" type="Long" length="11" nullable="false"/>
<column name="payment_plan_id" type="Long" length="11" nullable="true"/>
</NODE> </NODE>
</NODE></OBJECTS> </NODE></OBJECTS>
\ No newline at end of file
...@@ -21,7 +21,8 @@ CREATE TABLE tl_company ( ...@@ -21,7 +21,8 @@ CREATE TABLE tl_company (
has_client_support char(1) NULL, has_client_support char(1) NULL,
stripe_reference varchar(100) NULL, stripe_reference varchar(100) NULL,
stripe_subscription varchar(100) NULL, stripe_subscription varchar(100) NULL,
added_by_user_id numeric(12) NOT NULL added_by_user_id numeric(12) NOT NULL,
payment_plan_id numeric(12) NULL
); );
......
...@@ -22,7 +22,8 @@ CREATE TABLE tl_company ( ...@@ -22,7 +22,8 @@ CREATE TABLE tl_company (
has_client_support char(1) NULL, has_client_support char(1) NULL,
stripe_reference varchar2(100) NULL, stripe_reference varchar2(100) NULL,
stripe_subscription varchar2(100) NULL, stripe_subscription varchar2(100) NULL,
added_by_user_id number(12) NOT NULL added_by_user_id number(12) NOT NULL,
payment_plan_id number(12) NULL
); );
......
...@@ -22,7 +22,8 @@ CREATE TABLE tl_company ( ...@@ -22,7 +22,8 @@ CREATE TABLE tl_company (
has_client_support char(1) NULL, has_client_support char(1) NULL,
stripe_reference varchar(100) NULL, stripe_reference varchar(100) NULL,
stripe_subscription varchar(100) NULL, stripe_subscription varchar(100) NULL,
added_by_user_id numeric(12) NOT NULL added_by_user_id numeric(12) NOT NULL,
payment_plan_id numeric(12) NULL
); );
......
...@@ -85,6 +85,7 @@ public class SaveJobFP extends SaveFP ...@@ -85,6 +85,7 @@ public class SaveJobFP extends SaveFP
HttpServletRequest request = submission.getRequest(); HttpServletRequest request = submission.getRequest();
Job job = process.getAttribute("Job") != null ? (Job) process.getAttribute("Job") : (Job) request.getAttribute("Job"); Job job = process.getAttribute("Job") != null ? (Job) process.getAttribute("Job") : (Job) request.getAttribute("Job");
Boolean openJob = (Boolean) request.getAttribute("openJob"); Boolean openJob = (Boolean) request.getAttribute("openJob");
JobStatus status = (JobStatus) request.getAttribute("JobStatus");
if(job.getJobStatus() != JobStatus.DRAFT || openJob == Boolean.TRUE) if(job.getJobStatus() != JobStatus.DRAFT || openJob == Boolean.TRUE)
{ {
...@@ -96,6 +97,16 @@ public class SaveJobFP extends SaveFP ...@@ -96,6 +97,16 @@ public class SaveJobFP extends SaveFP
} }
} }
//to select payment plan when job open
if(status!=null && status==JobStatus.OPEN)
{
SecUser loggedInUser = SecUser.getTXUser(process.getTransaction());
CompanyUser companyUser = loggedInUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
Company company = companyUser.getCompany();
BusinessObjectParser.assertFieldCondition(company.getPaymentPlan() != null, job , Company.SINGLEREFERENCE_PaymentPlan, "mandatory", exceptions, true, request);
}
super.validate(process, submission, exceptions, params); super.validate(process, submission, exceptions, params);
} }
} }
\ No newline at end of file
...@@ -73,4 +73,15 @@ public class Company extends BaseCompany ...@@ -73,4 +73,15 @@ public class Company extends BaseCompany
{ {
return StringUtils.subNulls(getCompanyName(), super.getToString()); return StringUtils.subNulls(getCompanyName(), super.getToString());
} }
public Double getPaymentPlanAmount()
{
if(getPaymentPlan()!=null)
{
return getPaymentPlan().getAmount();
}
return null;
}
} }
\ No newline at end of file
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
<ATTRIB name="StripeSubscription" type="String" dbcol="stripe_subscription" length="100"/> <ATTRIB name="StripeSubscription" type="String" dbcol="stripe_subscription" length="100"/>
<SINGLEREFERENCE name="AddedByUser" type="CompanyUser" dbcol="added_by_user_id" mandatory="true"/> <SINGLEREFERENCE name="AddedByUser" type="CompanyUser" dbcol="added_by_user_id" mandatory="true"/>
<SINGLEREFERENCE name="PaymentPlan" type="PaymentPlan" dbcol="payment_plan_id" mandatory="false"/>
</TABLE> </TABLE>
......
package performa.orm; package performa.orm;
import java.io.*;
import java.util.*;
import oneit.appservices.config.*;
import oneit.logging.*;
import oneit.objstore.*;
import oneit.utils.*;
import performa.orm.types.*;
public class PaymentPlan extends BasePaymentPlan public class PaymentPlan extends BasePaymentPlan
{ {
...@@ -24,6 +10,15 @@ public class PaymentPlan extends BasePaymentPlan ...@@ -24,6 +10,15 @@ public class PaymentPlan extends BasePaymentPlan
{ {
// Do not add any code to this, always put it in initialiseNewObject // Do not add any code to this, always put it in initialiseNewObject
} }
}
@Override
public String getToString()
{
if(getActiveJobCount()!=null)
{
return getActiveJobCount().toString();
}
return super.getToString();
}
}
\ No newline at end of file
...@@ -25,6 +25,7 @@ public class WebUtils ...@@ -25,6 +25,7 @@ public class WebUtils
public static final String JOB_REVIEW = "JobReview"; public static final String JOB_REVIEW = "JobReview";
public static final String APPLY_JOB = "ApplyJob"; public static final String APPLY_JOB = "ApplyJob";
public static final String JOB_APPLICATION = "JobApplication"; public static final String JOB_APPLICATION = "JobApplication";
public static final String MANAGE_PLAN = "ManagePlan";
public static final String CREATED_JOB = "CreatedJob"; public static final String CREATED_JOB = "CreatedJob";
public static final String EDIT_JOB = "EditJob"; public static final String EDIT_JOB = "EditJob";
public static final String JOBS = "Jobs"; public static final String JOBS = "Jobs";
...@@ -147,6 +148,7 @@ public class WebUtils ...@@ -147,6 +148,7 @@ public class WebUtils
renderMode.equals(WORKPLACE_CULTURE) || renderMode.equals(WORKPLACE_CULTURE) ||
renderMode.equals(JOB_MATCH) || renderMode.equals(JOB_MATCH) ||
renderMode.equals(JOB_REVIEW) || renderMode.equals(JOB_REVIEW) ||
renderMode.equals(MANAGE_PLAN) ||
renderMode.equals(CREATED_JOB); renderMode.equals(CREATED_JOB);
} }
......
...@@ -5940,4 +5940,107 @@ input{ ...@@ -5940,4 +5940,107 @@ input{
font-family: "Usual-Light"; font-family: "Usual-Light";
font-size: 18px; font-size: 18px;
float: right; float: right;
}
.select-payment-optio {
color: #1A2531;
font-family: "Usual-Light";
font-size: 28px;
font-weight: 300;
line-height: 34px;
}
.payment-optio-bg {
text-align: center;
}
.annual-plan {
height: 22px;
color: #4A4A4A;
font-family: "Usual-Bold";
font-size: 18px;
font-weight: 500;
line-height: 22px;
}
.payment-optio-text {
height: 17px;
color: #8D8D8D;
font-family: Usual;
font-size: 14px;
line-height: 17px;
text-align: center;
padding: 12px 0;
}
.payment-optio-sep {
border-top: 1px solid #E6E6E6;
padding: 42px 0;
}
.payment-amt {
color: #418DE0;
font-family: "Usual-Light";
font-size: 40px;
font-weight: 300;
/*line-height: 48px;*/
text-align: center;
}
.payment-type-row{
padding-top: 30px;
padding-bottom: 80px;
}
.active-jobs-per-mont {
width: 66px;
color: #8D8D8D;
font-family: "Usual-Light";
font-size: 12px;
}
.per-job {
width: 21px;
color: #969696;
font-family: "Usual-Light";
font-size: 12px;
font-style: italic;
text-align: center;
display: inline-block;
}
.pay-only-job-btn {
height: 48px;
width: 243px;
border: 1px solid #E2E2E2;
border-radius: 24px;
background-color: #FFFFFF;
}
.pay-only-job-amt{
width: 79px;
color: #6D6D6D;
font-family: "Usual-Light";
font-size: 18px;
line-height: 22px;
}
.pay-only-job-txt {
width: 118px;
color: #8D8D8D;
font-family: "Usual-Light";
font-size: 14px;
line-height: 17px;
}
.payment-cancel{
padding-top: 60px;
}
.payment-job-det {
width: 265px;
color: #777777;
font-family: "Usual-Light";
font-size: 12px;
font-style: italic;
} }
\ No newline at end of file
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
<RenderMode name="WorkplaceCulture" preIncludeJSP="extensions/adminportal/workplace_culture.jsp"/> <RenderMode name="WorkplaceCulture" preIncludeJSP="extensions/adminportal/workplace_culture.jsp"/>
<RenderMode name="JobMatchAssessment" preIncludeJSP="extensions/adminportal/job_match_assessment.jsp"/> <RenderMode name="JobMatchAssessment" preIncludeJSP="extensions/adminportal/job_match_assessment.jsp"/>
<RenderMode name="JobReview" preIncludeJSP="extensions/adminportal/job_review_submit.jsp"/> <RenderMode name="JobReview" preIncludeJSP="extensions/adminportal/job_review_submit.jsp"/>
<RenderMode name="ManagePlan" preIncludeJSP="extensions/adminportal/manage_plan.jsp"/>
<RenderMode name="CardPayment" preIncludeJSP="extensions/adminportal/card_payment.jsp"/> <RenderMode name="CardPayment" preIncludeJSP="extensions/adminportal/card_payment.jsp"/>
<RenderMode name="CreatedJob" preIncludeJSP="extensions/adminportal/created_job.jsp"/> <RenderMode name="CreatedJob" preIncludeJSP="extensions/adminportal/created_job.jsp"/>
</NODE> </NODE>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<oneit:dynIncluded> <oneit:dynIncluded>
<% <%
Job job = (Job) process.getAttribute("Job"); Job job = (Job) process.getAttribute("Job");
String nextPage = WebUtils.getSamePageInRenderMode(request, WebUtils.CREATED_JOB) + "&fromJob=true"; String nextPage = WebUtils.getSamePageInRenderMode(request, WebUtils.MANAGE_PLAN);
String firstPage = WebUtils.getSamePageInRenderMode(request, WebUtils.CREATE_JOB); String firstPage = WebUtils.getSamePageInRenderMode(request, WebUtils.CREATE_JOB);
String secondPage = WebUtils.getSamePageInRenderMode(request, WebUtils.ASSESSMENT_CRITERIA); String secondPage = WebUtils.getSamePageInRenderMode(request, WebUtils.ASSESSMENT_CRITERIA);
String thirdPage = WebUtils.getSamePageInRenderMode(request, WebUtils.WORKPLACE_CULTURE); String thirdPage = WebUtils.getSamePageInRenderMode(request, WebUtils.WORKPLACE_CULTURE);
...@@ -213,13 +213,8 @@ ...@@ -213,13 +213,8 @@
.mapEntry ("attribNamesToRestore", Collections.singleton("Job")) .mapEntry ("attribNamesToRestore", Collections.singleton("Job"))
.toMap() %>" /> .toMap() %>" />
<oneit:button value="Open this job" name="saveJob" cssClass="btn btn-primary btn-green top-margin-25 largeBtn" <oneit:button value="Confirm and make payment" name="gotoPage" cssClass="btn btn-primary btn-green top-margin-25 largeBtn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage) requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage).toMap() %>" />
.mapEntry ("fromPage", fifthPage)
.mapEntry("JobStatus", JobStatus.OPEN)
.mapEntry ("restartProcess", Boolean.TRUE)
.mapEntry ("attribNamesToRestore", Collections.singleton("Job"))
.toMap() %>" />
</div> </div>
</div> </div>
</div> </div>
......
...@@ -36,3 +36,4 @@ Company.RoleType = Role ...@@ -36,3 +36,4 @@ Company.RoleType = Role
Company.CompanyLogo = Logo Company.CompanyLogo = Logo
Company.HiringTeamType = Hiring Team Company.HiringTeamType = Hiring Team
Company.CompanyName = Hiring Team Name Company.CompanyName = Hiring Team Name
Company.PaymentPlan = Payment Plan
<?xml version="1.0" encoding="UTF-8"?>
<!-- @AutoRun -->
<OBJECTS name="" xmlns:oneit="http://www.1iT.com.au">
<NODE name="Script" factory="Vector">
<NODE name="DDL" factory="Participant" class="oneit.sql.transfer.RedefineTableOperation">
<tableName factory="String">tl_company</tableName>
<column name="payment_plan_id" type="Long" length="11" nullable="true"/>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
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