Commit c3400012 by Nilu

Finish Feature-0.0.4.2

Conflicts:
	cmsWebApp/src/performa/form/SaveJobFP.java
parents 62428d7c 1fecfb55
......@@ -21,7 +21,13 @@
<column name="has_client_support" type="Boolean" nullable="true"/>
<column name="stripe_reference" type="String" nullable="true" length="100"/>
<column name="stripe_subscription" type="String" nullable="true" length="100"/>
<column name="name_on_card" type="String" nullable="true" length="100"/>
<column name="card_post_code" type="String" nullable="true" length="10"/>
<column name="card_id" type="String" nullable="true" length="100"/>
<column name="plan_renewed_on" type="Date" nullable="true"/>
<column name="used_credits" type="Long" nullable="true"/>
<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></OBJECTS>
\ No newline at end of file
......@@ -24,6 +24,8 @@
<column name="state" type="String" nullable="true" length="200"/>
<column name="country" type="String" nullable="true" length="200"/>
<column name="manually_closed" type="Boolean" nullable="true"/>
<column name="last_edited" type="Date" nullable="true"/>
<column name="is_ppj" type="Boolean" nullable="true"/>
<column name="level_id" type="Long" length="11" nullable="true"/>
<column name="client_id" type="Long" length="11" nullable="true"/>
<column name="company_user_id" type="Long" length="11" nullable="true"/>
......
<?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.DefineTableOperation">
<tableName factory="String">tl_payment_plan</tableName>
<column name="object_id" type="Long" nullable="false" length="11"/>
<column name="object_last_updated_date" type="Date" nullable="false" length="22"/>
<column name="object_created_date" type="Date" nullable="false" length="22"/>
<column name="stripe_reference" type="String" nullable="false" length="100"/>
<column name="plan_name" type="CLOB" nullable="true"/>
<column name="description" type="CLOB" nullable="true"/>
<column name="currency_type" type="String" nullable="false" length="200"/>
<column name="amount" type="Double" nullable="false"/>
<column name="interval" type="String" nullable="false" length="200"/>
<column name="interval_count" type="Long" nullable="false"/>
<column name="trial_period_days" type="Long" nullable="true"/>
<column name="active_job_count" type="Long" nullable="true"/>
</NODE>
</NODE></OBJECTS>
\ No newline at end of file
......@@ -21,7 +21,13 @@ CREATE TABLE tl_company (
has_client_support char(1) NULL,
stripe_reference varchar(100) NULL,
stripe_subscription varchar(100) NULL,
added_by_user_id numeric(12) NOT NULL
name_on_card varchar(100) NULL,
card_post_code varchar(10) NULL,
card_id varchar(100) NULL,
plan_renewed_on datetime NULL,
used_credits numeric(12) NULL,
added_by_user_id numeric(12) NOT NULL,
payment_plan_id numeric(12) NULL
);
......
......@@ -24,6 +24,8 @@ CREATE TABLE tl_job (
state varchar(200) NULL,
country varchar(200) NULL,
manually_closed char(1) NULL,
last_edited datetime NULL,
is_ppj char(1) NULL,
level_id numeric(12) NULL,
client_id numeric(12) NULL,
company_user_id numeric(12) NULL,
......
-- DROP TABLE tl_payment_plan;
CREATE TABLE tl_payment_plan (
object_id int NOT NULL ,
object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
object_created_date datetime DEFAULT getdate() NOT NULL
,
stripe_reference varchar(100) NOT NULL,
plan_name text NULL,
description text NULL,
currency_type varchar(200) NOT NULL,
amount numeric(20,5) NOT NULL,
interval varchar(200) NOT NULL,
interval_count numeric(12) NOT NULL,
trial_period_days numeric(12) NULL,
active_job_count numeric(12) NULL
);
ALTER TABLE tl_payment_plan ADD
CONSTRAINT PK_tl_payment_plan PRIMARY KEY
(
object_id
) ;
\ No newline at end of file
......@@ -22,7 +22,13 @@ CREATE TABLE tl_company (
has_client_support char(1) NULL,
stripe_reference varchar2(100) NULL,
stripe_subscription varchar2(100) NULL,
added_by_user_id number(12) NOT NULL
name_on_card varchar2(100) NULL,
card_post_code varchar2(10) NULL,
card_id varchar2(100) NULL,
plan_renewed_on date NULL,
used_credits number(12) NULL,
added_by_user_id number(12) NOT NULL,
payment_plan_id number(12) NULL
);
......
......@@ -25,6 +25,8 @@ CREATE TABLE tl_job (
state varchar2(200) NULL,
country varchar2(200) NULL,
manually_closed char(1) NULL,
last_edited date NULL,
is_ppj char(1) NULL,
level_id number(12) NULL,
client_id number(12) NULL,
company_user_id number(12) NULL,
......
-- DROP TABLE tl_payment_plan;
CREATE TABLE tl_payment_plan (
object_id number(12) NOT NULL ,
object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
object_created_date date DEFAULT SYSDATE NOT NULL
,
stripe_reference varchar2(100) NOT NULL,
plan_name clob NULL,
description clob NULL,
currency_type varchar2(200) NOT NULL,
amount number(20,5) NOT NULL,
interval varchar2(200) NOT NULL,
interval_count number(12) NOT NULL,
trial_period_days number(12) NULL,
active_job_count number(12) NULL
);
ALTER TABLE tl_payment_plan ADD
CONSTRAINT PK_tl_payment_plan PRIMARY KEY
(
object_id
) ;
\ No newline at end of file
......@@ -22,7 +22,13 @@ CREATE TABLE tl_company (
has_client_support char(1) NULL,
stripe_reference varchar(100) NULL,
stripe_subscription varchar(100) NULL,
added_by_user_id numeric(12) NOT NULL
name_on_card varchar(100) NULL,
card_post_code varchar(10) NULL,
card_id varchar(100) NULL,
plan_renewed_on timestamp NULL,
used_credits numeric(12) NULL,
added_by_user_id numeric(12) NOT NULL,
payment_plan_id numeric(12) NULL
);
......
......@@ -25,6 +25,8 @@ CREATE TABLE tl_job (
state varchar(200) NULL,
country varchar(200) NULL,
manually_closed char(1) NULL,
last_edited timestamp NULL,
is_ppj char(1) NULL,
level_id numeric(12) NULL,
client_id numeric(12) NULL,
company_user_id numeric(12) NULL,
......
-- @AutoRun
-- drop table tl_payment_plan;
CREATE TABLE tl_payment_plan (
object_id numeric(12) NOT NULL ,
object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
object_created_date timestamp DEFAULT NOW() NOT NULL
,
stripe_reference varchar(100) NOT NULL,
plan_name text NULL,
description text NULL,
currency_type varchar(200) NOT NULL,
amount numeric(20,5) NOT NULL,
interval varchar(200) NOT NULL,
interval_count numeric(12) NOT NULL,
trial_period_days numeric(12) NULL,
active_job_count numeric(12) NULL
);
ALTER TABLE tl_payment_plan ADD
CONSTRAINT pk_tl_payment_plan PRIMARY KEY
(
object_id
) ;
\ No newline at end of file
......@@ -21,7 +21,7 @@ public class CloseJobBatch extends ORMBatch
@Override
public void run(ObjectTransaction ot) throws StorageException, FieldException
{
LogMgr.log (CLOSE_JOB_BATCH, LogLevel.DEBUG2, "RUNNING Close Job Batch");
LogMgr.log (CLOSE_JOB_BATCH, LogLevel.PROCESSING1, "RUNNING Close Job Batch");
Job[] expiringJobs = Job.SearchByAll()
.andApplyBy(new LessThanFilter<>(DateDiff.getToday()))
......@@ -32,7 +32,7 @@ public class CloseJobBatch extends ORMBatch
job.setJobStatus(JobStatus.COMPLETE);
job.setIsManuallyClosed(Boolean.FALSE);
LogMgr.log(CLOSE_JOB_BATCH, LogLevel.DEBUG2, "Setting Job Status to Closed in job : ", job);
LogMgr.log(CLOSE_JOB_BATCH, LogLevel.PROCESSING1, "Setting Job Status to Closed in job : ", job);
}
// Update closed job details to intercom
......
package performa.batch;
import com.stripe.Stripe;
import com.stripe.exception.APIConnectionException;
import com.stripe.exception.APIException;
import com.stripe.exception.AuthenticationException;
import com.stripe.exception.CardException;
import com.stripe.exception.InvalidRequestException;
import com.stripe.model.Plan;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import oneit.appservices.batch.ORMBatch;
import oneit.logging.LogLevel;
import oneit.logging.LogMgr;
import oneit.logging.LoggingArea;
import oneit.objstore.ObjectTransaction;
import oneit.objstore.StorageException;
import oneit.objstore.rdbms.filters.EqualsFilter;
import oneit.utils.parsers.FieldException;
import performa.orm.PaymentPlan;
import performa.orm.types.CurrencyType;
import performa.orm.types.Interval;
import performa.utils.StripeUtils;
public class PullStripeDataBatch extends ORMBatch
{
public static LoggingArea PULL_STRIPE_DATA_BATCH = LoggingArea.createLoggingArea("PullStripeDataBatch");
@Override
public void run(ObjectTransaction ot) throws StorageException, FieldException
{
try
{
LogMgr.log (PULL_STRIPE_DATA_BATCH, LogLevel.PROCESSING1, "RUNNING Pull Stripe Data Batch");
Stripe.apiKey = StripeUtils.STRIPE_KEY;
Map<String, Object> planParams = new HashMap<>();
List<Plan> plansList = Plan.list(planParams).getData();
for (Plan plan : plansList)
{
PaymentPlan[] paymentPlans = PaymentPlan.SearchByAll().andStripeReference(new EqualsFilter<>(plan.getId())).search(ot);
PaymentPlan paymentPlan;
if(paymentPlans != null && paymentPlans.length > 0)
{
paymentPlan = paymentPlans[0];
LogMgr.log (PULL_STRIPE_DATA_BATCH, LogLevel.PROCESSING1, "Updating exiting payment plan: " , paymentPlan, " to match stripe plan: ", plan);
}
else
{
paymentPlan = PaymentPlan.createPaymentPlan(ot);
LogMgr.log (PULL_STRIPE_DATA_BATCH, LogLevel.PROCESSING1, "Creating a new payment plan for stripe plan: ", plan);
}
Map<String, String> metadata = plan.getMetadata();
String activeJobs = metadata.get("ActiveJobs");
paymentPlan.setStripeReference(plan.getId());
paymentPlan.setPlanName(plan.getName());
paymentPlan.setDescription(plan.getStatementDescriptor());
paymentPlan.setCurrencyType(CurrencyType.forName(plan.getCurrency().toUpperCase()));
paymentPlan.setAmount(plan.getAmount().doubleValue() / 100);
paymentPlan.setInterval(Interval.forName(plan.getInterval().toUpperCase()));
paymentPlan.setIntervalCount(plan.getIntervalCount());
paymentPlan.setTrialPeriodDays(plan.getTrialPeriodDays());
if(activeJobs != null)
{
paymentPlan.setActiveJobCount(Integer.valueOf(activeJobs));
}
LogMgr.log (PULL_STRIPE_DATA_BATCH, LogLevel.PROCESSING1, "Saving payment plan: " , paymentPlan, " mapped from stripe plan: ", plan);
}
}
catch (AuthenticationException | InvalidRequestException | APIConnectionException | CardException | APIException | StorageException | FieldException | NumberFormatException ex)
{
LogMgr.log(PULL_STRIPE_DATA_BATCH, LogLevel.PROCESSING1, ex, "Error while pulling plan details from stripe");
}
}
}
\ No newline at end of file
......@@ -18,7 +18,7 @@ public class URLShortnerBatch extends ORMBatch
@Override
public void run(ObjectTransaction ot) throws StorageException, FieldException
{
LogMgr.log (URL_SHORTNER_BATCH, LogLevel.DEBUG2, "RUNNING URL Shortner Batch");
LogMgr.log (URL_SHORTNER_BATCH, LogLevel.PROCESSING1, "RUNNING URL Shortner Batch");
Job[] jobs = Job.SearchByAll()
.andShortenedURL(new IsNullFilter<>())
......@@ -30,7 +30,7 @@ public class URLShortnerBatch extends ORMBatch
{
job.createShortenedURL();
LogMgr.log(URL_SHORTNER_BATCH, LogLevel.DEBUG2, "Setting Shortened URL to job : ", job);
LogMgr.log(URL_SHORTNER_BATCH, LogLevel.PROCESSING1, "Setting Shortened URL to job : ", job);
}
catch(StorageException | FieldException e)
{
......
......@@ -29,6 +29,8 @@ public class CompleteApplicationFP extends SaveFP
jobApplication = (JobApplication) jobApplication.getInTransaction (objTran);
}
LogMgr.log(JobApplication.LOG, LogLevel.PROCESSING2, "CompleteApplicationFP Job Application :", jobApplication);
jobApplication.setApplicationStatus(ApplicationStatus.SUBMITTED);
jobApplication.setSubmittedDate(new Date());
......
......@@ -35,7 +35,7 @@ public class LoadCultureFromTemplateFP extends ORMProcessFormProcessor
Job job = (Job) request.getAttribute("Job");
CultureCriteriaTemplate template = job.getCultureTemplate();
LogMgr.log(Job.LOG, LogLevel.PROCESSING1, "Inside LoadCultureFromTemplateFP for ", job.getObjectID(), " load from template:", template);
LogMgr.log(Job.LOG, LogLevel.PROCESSING1, "Inside LoadCultureFromTemplateFP for ", job , " load from template:", template);
if(template != null)
{
......@@ -55,7 +55,8 @@ public class LoadCultureFromTemplateFP extends ORMProcessFormProcessor
job.addToCultureCriterias(criteriaCopy);
}
}
LogMgr.log(Job.LOG, LogLevel.PROCESSING1, "LoadCultureFromTemplateFP completed for ", job.getObjectID());
LogMgr.log(Job.LOG, LogLevel.PROCESSING1, "LoadCultureFromTemplateFP completed for ", job);
return RedisplayResult.getInstance();
}
......
package performa.form;
import java.util.HashMap;
import java.util.Map;
import oneit.appservices.config.ConfigMgr;
import oneit.servlets.forms.SubmissionDetails;
import oneit.servlets.process.SaveFP;
import oneit.utils.BusinessException;
import oneit.utils.math.NullArith;
import javax.servlet.http.HttpServletRequest;
import oneit.logging.LogLevel;
import oneit.logging.LogMgr;
import oneit.objstore.StorageException;
import oneit.servlets.forms.SuccessfulResult;
import oneit.servlets.process.ORMProcessState;
import com.stripe.exception.StripeException;
import com.stripe.model.Card;
import com.stripe.model.Charge;
import java.util.Calendar;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import oneit.logging.LoggingArea;
import oneit.security.SecUser;
import oneit.utils.DateDiff;
import performa.intercom.utils.IntercomUtils;
import performa.orm.Company;
import performa.orm.CompanyUser;
import performa.orm.Job;
import performa.orm.types.AssessmentType;
import performa.orm.types.JobStatus;
import performa.utils.StripeUtils;
public class MakePaymentFP extends SaveFP
{
public static final String STRIPE_KEY = ConfigMgr.getKeyfileString("stripe.key","");
public static final String STRIPE_PUB_KEY = ConfigMgr.getKeyfileString("stripe.pubkey","");
private static final LoggingArea LOG = LoggingArea.createLoggingArea("MakePaymentFP");
@Override
public SuccessfulResult processForm(ORMProcessState process, SubmissionDetails submission, Map p) throws BusinessException, StorageException
{
HttpServletRequest request = submission.getRequest();
Boolean ppj = request.getAttribute("PPJ") != null ? (Boolean) request.getAttribute("PPJ") : Boolean.FALSE;
Boolean editCard = request.getAttribute("EditCard") != null ? (Boolean) request.getAttribute("EditCard") : Boolean.FALSE;
Boolean replaceCard = request.getAttribute("ReplaceCard") != null ? (Boolean) request.getAttribute("ReplaceCard") : Boolean.FALSE;
SecUser secUser = SecUser.getTXUser(process.getTransaction());
CompanyUser companyUser = secUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
Company company = companyUser.getCompany();
Job job = (Job) process.getAttribute("Job");
LogMgr.log(LOG, LogLevel.PROCESSING1,"In MakePaymentFP from customer to open job: " + company.getStripeReference());
if(editCard)
{
UpdateCardFP.updateCardDetails(process, submission);
}
if(replaceCard)
{
ReplaceCardFP.replaceCardDetails(process, submission);
}
if(company.getCardID() != null && ppj)
{
try
{
Map<String, Object> chargeParams = new HashMap<>();
chargeParams.put("amount", NullArith.intVal(NullArith.multiply(job.getAssessmentType() == AssessmentType.COMPREHENSIVE ? 499.0 : 399.0, 100, 0d)));
chargeParams.put("currency", "aud");
chargeParams.put("description", "Charges of creating job");
chargeParams.put("customer", company.getStripeReference());
Charge.create(chargeParams);
}
catch (StripeException e)
{
LogMgr.log(LOG, LogLevel.PROCESSING1, e, "Error while making a payment of company stripe " + company.getStripeReference());
throw new BusinessException("Stripe payment was failed, Please contact adminstrator for more info.");
}
}
if(company.getCardID() == null)
{
Card card = StripeUtils.retrieveCard(company);
company.setNameOnCard(card.getName());
company.setCardPostCode(card.getAddressZip());
company.setCardID(card.getId());
}
job.setApplyBy(DateDiff.add(DateDiff.getToday(), Calendar.DATE, 30));
job.setOpenDate(new Date());
job.setJobStatus(JobStatus.OPEN);
job.setLastEdited(new Date());
job.setIsPPJ(ppj);
if(job.getShortenedURL() == null)
{
job.createShortenedURL();
}
if(!ppj && company.getPaymentPlan() != null)
{
// cannot subscribe to a plan without card details
// company.setPlanRenewedOn(DateDiff.getToday());
// company.setUsedCredits(1);
StripeUtils.updatePlan(company);
}
// restarting process as custom attributes needs to be updated to intercom
Set<String> attribsToRestore = new HashSet<>();
attribsToRestore.add("Job");
attribsToRestore.add("Company");
completeProcessRestartAndRestoreAttribs(process, attribsToRestore);
secUser = SecUser.getTXUser(process.getTransaction());
companyUser = secUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
// Update company in intercom
if(companyUser.getCompany() != null)
{
IntercomUtils.updateCompany(companyUser.getCompany());
}
return super.processForm(process, submission, p);
}
}
\ No newline at end of file
package performa.form;
import com.stripe.Stripe;
import com.stripe.model.Plan;
import com.stripe.model.PlanCollection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.servlet.http.HttpServletRequest;
import oneit.appservices.config.ConfigMgr;
import oneit.logging.LogLevel;
import oneit.logging.LogMgr;
import oneit.objstore.StorageException;
import oneit.servlets.forms.SubmissionDetails;
import oneit.servlets.forms.SuccessfulResult;
import oneit.servlets.process.ORMProcessState;
import oneit.servlets.process.SaveFP;
import oneit.utils.BusinessException;
import performa.orm.Job;
public class ManagePlansFP extends SaveFP
{
public static final String STRIPE_KEY = ConfigMgr.getKeyfileString("stripe.key","");
public static final String STRIPE_PUB_KEY = ConfigMgr.getKeyfileString("stripe.pubkey","");
@Override
public SuccessfulResult processForm(ORMProcessState process, SubmissionDetails submission, Map p) throws BusinessException, StorageException
{
HttpServletRequest request = submission.getRequest();
LogMgr.log(Job.LOG, LogLevel.PROCESSING1,"In ManagePlansFP : " );
Stripe.apiKey = STRIPE_KEY;
try {
Map<String, Object> planParams = new HashMap<>();
PlanCollection list = Plan.list(planParams);
List<Plan> lists = list.getData();
for (Plan plan : lists)
{
// Map<String, String> metadata = plan.getMetadata();
// PaymentPlan paymentPlan = PaymentPlan.createPaymentPlan(process.getTransaction());
//
// paymentPlan.setStripeReference(plan.getId());
// paymentPlan.setPlanName(plan.getName());
// paymentPlan.setDescription(plan.getStatementDescriptor());
// paymentPlan.setCurrencyType(CurrencyType.forName(plan.getCurrency().toUpperCase()));
// paymentPlan.setAmount(plan.getAmount().doubleValue());
// paymentPlan.setInterval(Interval.forName(plan.getInterval().toUpperCase()));
// paymentPlan.setIntervalCount(plan.getIntervalCount());
// paymentPlan.setTrialPeriodDays(plan.getTrialPeriodDays());
// paymentPlan.setActiveJobCount(Integer.valueOf(metadata.get("ActiveJobs")));
}
} catch (Exception ex)
{
Logger.getLogger(ManagePlansFP.class.getName()).log(Level.SEVERE, null, ex);
}
return super.processForm(process, submission, p);
}
}
package performa.form;
import com.stripe.Stripe;
import com.stripe.model.Card;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import oneit.appservices.config.ConfigMgr;
import oneit.logging.LogLevel;
import oneit.logging.LogMgr;
import oneit.logging.LoggingArea;
import oneit.objstore.StorageException;
import oneit.security.SecUser;
import oneit.servlets.forms.SubmissionDetails;
import oneit.servlets.forms.SuccessfulResult;
import oneit.servlets.process.ORMProcessState;
import oneit.servlets.process.SaveFP;
import oneit.utils.BusinessException;
import oneit.utils.StringUtils;
import oneit.utils.parsers.FieldException;
import performa.orm.Company;
import performa.orm.CompanyUser;
import performa.utils.StripeUtils;
public class ReplaceCardFP extends SaveFP
{
public static final String STRIPE_KEY = ConfigMgr.getKeyfileString("stripe.key","");
public static final String STRIPE_PUB_KEY = ConfigMgr.getKeyfileString("stripe.pubkey","");
private static final LoggingArea LOG = LoggingArea.createLoggingArea("ReplaceCardFP");
@Override
public SuccessfulResult processForm(ORMProcessState process, SubmissionDetails submission, Map p) throws BusinessException, StorageException
{
LogMgr.log(LOG, LogLevel.PROCESSING1,"In ReplaceCardFP to replace card details");
replaceCardDetails(process, submission);
return super.processForm(process, submission, p);
}
public static void replaceCardDetails(ORMProcessState process, SubmissionDetails submission) throws BusinessException
{
HttpServletRequest request = submission.getRequest();
Stripe.apiKey = STRIPE_KEY;
String token = request.getParameter("stripe-token-id");
if(StringUtils.subBlanks(token) == null)
{
throw new BusinessException("Updating card details failed, Please contact adminstrator for more info.");
}
try
{
SecUser secUser = SecUser.getTXUser(process.getTransaction());
CompanyUser companyUser = secUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
Card card = StripeUtils.updateCardDetails(companyUser.getCompany(), token);
Company company = companyUser.getCompany();
LogMgr.log(LOG, LogLevel.PROCESSING1,"In ReplaceCardFP replacing card details of company: " + company );
company.setNameOnCard(card.getName());
company.setCardPostCode(card.getAddressZip());
company.setCardID(card.getId());
// cannot subscribe to a plan without card details
if(company.getPaymentPlan() != null)
{
StripeUtils.updatePlan(company);
}
}
catch(StorageException | FieldException e)
{
LogMgr.log(LOG, LogLevel.PROCESSING1, e, "Error while replacing stripe card details");
}
}
}
\ No newline at end of file
......@@ -5,14 +5,17 @@ import javax.servlet.http.HttpServletRequest;
import oneit.logging.LogLevel;
import oneit.logging.LogMgr;
import oneit.objstore.StorageException;
import oneit.objstore.parser.BusinessObjectParser;
import oneit.servlets.forms.SubmissionDetails;
import oneit.servlets.forms.SuccessfulResult;
import oneit.servlets.process.ORMProcessState;
import oneit.servlets.process.SaveFP;
import oneit.utils.BusinessException;
import oneit.utils.CollectionUtils;
import oneit.utils.MultiException;
import performa.intercom.utils.IntercomUtils;
import performa.orm.Company;
import performa.utils.StripeUtils;
public class SaveCompanyFP extends SaveFP
......@@ -20,8 +23,9 @@ public class SaveCompanyFP extends SaveFP
@Override
public SuccessfulResult processForm(ORMProcessState process, SubmissionDetails submission, Map params) throws BusinessException, StorageException
{
HttpServletRequest request = submission.getRequest();
Company company = process.getAttribute("Company") != null ? (Company) process.getAttribute("Company") : (Company) request.getAttribute("Company");
HttpServletRequest request = submission.getRequest();
Company company = process.getAttribute("Company") != null ? (Company) process.getAttribute("Company") : (Company) request.getAttribute("Company");
Boolean isPayment = (Boolean) request.getAttribute("IsPayment");
LogMgr.log(Company.LOG, LogLevel.PROCESSING1,"In SaveCompanyFP saving company : ", company );
......@@ -30,11 +34,43 @@ public class SaveCompanyFP extends SaveFP
company.setCompanyLogo(null);
LogMgr.log(Company.LOG, LogLevel.PROCESSING1,"In SaveCompanyFP setting comany logo to null of company : ", company );
}
}
if(CollectionUtils.equals(isPayment, Boolean.TRUE) && company.getPaymentJobCount()!=null)
{
company.setPaymentPlan(company.getSelectedPaymentPlan());
LogMgr.log(Company.LOG, LogLevel.PROCESSING1,"Company payment plan updated.", company, company.getPaymentPlan());
if(company.getCardID() != null )
{
// cannot subscribe a user to a plan without card details
StripeUtils.updatePlan(company);
LogMgr.log(Company.LOG, LogLevel.PROCESSING1,"Strpe subscription updated.", company, company.getStripeSubscription());
}
}
// Update company in intercom
IntercomUtils.updateCompany(company);
return super.processForm(process, submission, params);
}
@Override
public void validate(ORMProcessState process, SubmissionDetails submission, MultiException exceptions, Map params) throws StorageException
{
HttpServletRequest request = submission.getRequest();
Company company = process.getAttribute("Company") != null ? (Company) process.getAttribute("Company") : (Company) request.getAttribute("Company");
Boolean isPayment = (Boolean) request.getAttribute("IsPayment");
//to select payment plan when job open
if(CollectionUtils.equals(isPayment, Boolean.TRUE) && company.getPaymentJobCount()!=null)
{
BusinessObjectParser.assertFieldCondition(company.getSelectedPaymentPlan()!= null, company , Company.SINGLEREFERENCE_PaymentPlan, "mandatory", exceptions, true, request);
}
super.validate(process, submission, exceptions, params);
}
}
\ No newline at end of file
......@@ -16,6 +16,7 @@ import oneit.servlets.process.SaveFP;
import oneit.utils.BusinessException;
import oneit.utils.DateDiff;
import oneit.utils.MultiException;
import oneit.utils.math.NullArith;
import performa.intercom.utils.IntercomUtils;
import performa.orm.*;
import performa.orm.types.JobStatus;
......@@ -29,6 +30,9 @@ public class SaveJobFP extends SaveFP
HttpServletRequest request = submission.getRequest();
Job job = request.getAttribute("Job") != null ? (Job) request.getAttribute("Job") : (Job) process.getAttribute("Job");
JobStatus status = (JobStatus) request.getAttribute("JobStatus");
SecUser secUser = SecUser.getTXUser(process.getTransaction());
CompanyUser companyUser = secUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
Company company = companyUser.getCompany();
LogMgr.log(Job.LOG, LogLevel.PROCESSING1,"In SaveJobFP saving job : ", job );
......@@ -46,8 +50,17 @@ public class SaveJobFP extends SaveFP
job.setApplyBy(DateDiff.add(DateDiff.getToday(), Calendar.DATE, 30));
job.setOpenDate(new Date());
company.setUsedCredits(NullArith.add(company.getUsedCredits(), 1).intValue());
if(status == JobStatus.OPEN)
{
if(company.getSelectedPaymentPlan() != null)
{
company.setPaymentPlan(company.getSelectedPaymentPlan());
LogMgr.log(Company.LOG, LogLevel.PROCESSING1,"Company payment plan updated.", job, company, company.getPaymentPlan());
}
job.setJobStatus(status);
LogMgr.log(Job.LOG, LogLevel.PROCESSING1,"Job status changed as Open. ", job );
......@@ -64,11 +77,13 @@ public class SaveJobFP extends SaveFP
job.setIsManuallyClosed(Boolean.TRUE);
}
job.setLastEdited(new Date());
// restarting process as custom attributes needs to be updated to intercom
completeProcessRestartAndRestoreAttribs(process, request);
SecUser secUser = SecUser.getTXUser(process.getTransaction());
CompanyUser companyUser = secUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
secUser = SecUser.getTXUser(process.getTransaction());
companyUser = secUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
// Update company in intercom
if(companyUser.getCompany() != null)
......@@ -82,9 +97,13 @@ public class SaveJobFP extends SaveFP
@Override
public void validate(ORMProcessState process, SubmissionDetails submission, MultiException exceptions, Map params) throws StorageException
{
HttpServletRequest request = submission.getRequest();
Job job = process.getAttribute("Job") != null ? (Job) process.getAttribute("Job") : (Job) request.getAttribute("Job");
Boolean openJob = (Boolean) request.getAttribute("openJob");
HttpServletRequest request = submission.getRequest();
Job job = process.getAttribute("Job") != null ? (Job) process.getAttribute("Job") : (Job) request.getAttribute("Job");
Boolean openJob = (Boolean) request.getAttribute("openJob");
JobStatus status = (JobStatus) request.getAttribute("JobStatus");
SecUser loggedInUser = SecUser.getTXUser(process.getTransaction());
CompanyUser companyUser = loggedInUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
Company company = companyUser.getCompany();
if(job.getJobStatus() != JobStatus.DRAFT || openJob == Boolean.TRUE)
{
......@@ -96,6 +115,24 @@ public class SaveJobFP extends SaveFP
}
}
//to select payment plan when job open
if(status != null && status == JobStatus.OPEN)
{
BusinessObjectParser.assertFieldCondition(company.getSelectedPaymentPlan() != null || company.getPaymentPlan() != null, company, Company.SINGLEREFERENCE_PaymentPlan, "mandatory", exceptions, true, request);
if(company.getSelectedPaymentPlan() != null)
{
BusinessObjectParser.assertFieldCondition(company.getSelectedPaymentPlan().getActiveJobCount() > company.getUsedCredits() , job, Job.FIELD_JobStatus, "insufficientCredit", exceptions, true, request);
}
}
if(job.getJobStatus() == JobStatus.OPEN)
{
BusinessObjectParser.assertFieldCondition(company.getCardID() != null , company, Company.FIELD_CardID, "mandatoryCardDetails", exceptions, true, request);
BusinessObjectParser.assertFieldCondition(company.canCreateJob() , job, Job.FIELD_JobStatus, "insufficientCredit", exceptions, true, request);
}
super.validate(process, submission, exceptions, params);
}
}
\ No newline at end of file
......@@ -120,8 +120,8 @@ public class SendCompanyUserInvitesFP extends SaveFP
StripeUtils.createCustomer(companyUser);
LogMgr.log(LOG, LogLevel.PROCESSING1,"Created customer in Stripe, customer reference ", company.getStripeReference());
StripeUtils.subscribeCustomer(company);
LogMgr.log(LOG, LogLevel.PROCESSING1,"Subscribed customer to default plan in Stripe, subscription reference ", company.getStripeSubscription());
// StripeUtils.subscribeCustomer(company);
// LogMgr.log(LOG, LogLevel.PROCESSING1,"Subscribed customer to default plan in Stripe, subscription reference ", company.getStripeSubscription());
//process user invitations
......
......@@ -130,6 +130,7 @@ public class SendVerificationMailFP extends SaveFP
secUser = SecUser.createSecUser(objTran);
secUser.setUserName(email);
secUser.setEmail(email);
secUser.setAttribute("md5:" + SecUser.FIELD_Password, CompanyUser.DEFAULT_PASSWORD);
secUser.addRole(Utils.getRole(Utils.ROLE_APPLICANT, objTran));
}
......
package performa.form;
import com.stripe.Stripe;
import com.stripe.exception.APIConnectionException;
import com.stripe.exception.APIException;
import com.stripe.exception.AuthenticationException;
import com.stripe.exception.CardException;
import com.stripe.exception.InvalidRequestException;
import com.stripe.model.Card;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import oneit.logging.LogLevel;
import oneit.logging.LogMgr;
import oneit.logging.LoggingArea;
import oneit.objstore.StorageException;
import oneit.security.SecUser;
import oneit.servlets.forms.SubmissionDetails;
import oneit.servlets.forms.SuccessfulResult;
import oneit.servlets.process.ORMProcessState;
import oneit.servlets.process.SaveFP;
import oneit.utils.BusinessException;
import oneit.utils.parsers.FieldException;
import performa.orm.Company;
import performa.orm.CompanyUser;
import performa.utils.StripeUtils;
public class UpdateCardFP extends SaveFP
{
private static final LoggingArea LOG = LoggingArea.createLoggingArea("UpdateCardFP");
@Override
public SuccessfulResult processForm(ORMProcessState process, SubmissionDetails submission, Map p) throws BusinessException, StorageException
{
Stripe.apiKey = StripeUtils.STRIPE_KEY;
updateCardDetails(process, submission);
return super.processForm(process, submission, p);
}
public static void updateCardDetails(ORMProcessState process, SubmissionDetails submission) throws FieldException
{
try
{
HttpServletRequest request = submission.getRequest();
SecUser secUser = SecUser.getTXUser(process.getTransaction());
CompanyUser companyUser = secUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
Company company = companyUser.getCompany();
Card card = StripeUtils.retrieveCard(company);
LogMgr.log(LOG, LogLevel.PROCESSING1,"In UpdateCardFP updating card details of user : ", company, " card : " , card );
Map<String, Object> updateParams = new HashMap<>();
String expiryDate = request.getParameter("expiry-date");
String name = request.getParameter("holder-name");
String addressZip = request.getParameter("address-zip");
if(expiryDate != null && !expiryDate.isEmpty() && expiryDate.length() == 7)
{
updateParams.put("exp_month", expiryDate.substring(0, 2));
updateParams.put("exp_year", expiryDate.substring(5, 7));
}
if(name != null && !name.isEmpty())
{
updateParams.put("name", name);
company.setNameOnCard(name);
}
if(addressZip != null && !addressZip.isEmpty())
{
updateParams.put("address_zip", addressZip);
company.setCardPostCode(addressZip);
}
Card updatedCard = card.update(updateParams);
LogMgr.log(LOG, LogLevel.PROCESSING1,"Updated card details of user : ", company, " updated card : " , updatedCard );
}
catch (AuthenticationException | InvalidRequestException | APIConnectionException | CardException | APIException e)
{
LogMgr.log(LOG, LogLevel.PROCESSING1, e, "Error while updating card details of user");
}
}
}
\ No newline at end of file
package performa.form;
import java.util.Map;
import oneit.logging.LogLevel;
import oneit.logging.LogMgr;
import oneit.objstore.ObjectTransaction;
import oneit.security.LoginProcessor;
import oneit.security.SecUser;
......@@ -23,6 +25,8 @@ public class UserLoginFP extends LoginProcessor
CompanyUser companyUser = userToCheck.getExtension(CompanyUser.REFERENCE_CompanyUser);
LogMgr.log(LOGIN, LogLevel.PROCESSING1,"In UserLoginFP checking user can log : ", companyUser );
if(!Utils.checkAdminPortalAccess(userToCheck) || companyUser == null || !companyUser.isTrue(companyUser.getIsAccountVerified()))
{
throw new FieldException("You're not an authorised user to access this portal.", SecUser.FIELD_UserName);
......
......@@ -9,7 +9,6 @@ import java.util.Map;
import oneit.logging.LogLevel;
import oneit.logging.LogMgr;
import oneit.logging.LoggingArea;
import oneit.objstore.ObjectTransaction;
import oneit.objstore.StorageException;
import oneit.objstore.rdbms.filters.EqualsFilter;
import oneit.objstore.rdbms.filters.InFilter;
......@@ -19,9 +18,15 @@ import oneit.utils.CollectionUtils;
import oneit.utils.ObjectTransform;
import oneit.utils.filter.CollectionFilter;
import oneit.utils.filter.Filter;
import performa.intercom.resources.AuthorizationException;
import performa.intercom.resources.ClientException;
import performa.intercom.resources.Company;
import performa.intercom.resources.CustomAttribute;
import performa.intercom.resources.Intercom;
import performa.intercom.resources.InvalidException;
import performa.intercom.resources.NotFoundException;
import performa.intercom.resources.RateLimitException;
import performa.intercom.resources.ServerException;
import performa.intercom.resources.User;
import performa.orm.Job;
import performa.orm.JobApplication;
......@@ -56,9 +61,13 @@ public class IntercomUtils
user.addCompany(company);
}
return User.create(user);
User.create(user);
LogMgr.log(LoggingArea.ALL, LogLevel.PROCESSING1, "Created Intercom User: ", user);
return user;
}
catch (Exception e)
catch (AuthorizationException | ClientException | ServerException | InvalidException | RateLimitException e)
{
LogMgr.log(LoggingArea.ALL, LogLevel.PROCESSING1, e, "Error while creating a user in intercom");
......@@ -77,7 +86,7 @@ public class IntercomUtils
return User.find(map);
}
catch (Exception e)
catch (AuthorizationException | ClientException | ServerException | InvalidException | RateLimitException | NotFoundException e)
{
LogMgr.log(LoggingArea.ALL, LogLevel.PROCESSING1, e, "Error while fetching a user by id from intercom");
......@@ -100,9 +109,11 @@ public class IntercomUtils
User.update(user);
}
LogMgr.log(LoggingArea.ALL, LogLevel.PROCESSING1, "Updated Intercom User: ", user);
return user;
}
catch (Exception e)
catch (InvalidException | AuthorizationException e)
{
LogMgr.log(LoggingArea.ALL, LogLevel.PROCESSING1, e, "Error while updating a user in intercom");
return null;
......@@ -118,9 +129,13 @@ public class IntercomUtils
setCompanyDetails(intercomCompany, company);
return Company.create(intercomCompany);
Company.create(intercomCompany);
LogMgr.log(LoggingArea.ALL, LogLevel.PROCESSING1, "Created Intercom Company: ", intercomCompany);
return intercomCompany;
}
catch (Exception e)
catch (StorageException | InvalidException | AuthorizationException e)
{
LogMgr.log(LoggingArea.ALL, LogLevel.PROCESSING1, e, "Error while creating a company in intercom");
......@@ -188,7 +203,7 @@ public class IntercomUtils
return Company.find(map);
}
catch (Exception e)
catch (InvalidException | AuthorizationException | NotFoundException e)
{
LogMgr.log(LoggingArea.ALL, LogLevel.PROCESSING1, e, "Error while fetching a company by id from intercom");
......@@ -212,6 +227,8 @@ public class IntercomUtils
setCompanyDetails(intercomCompany, company);
Company.update(intercomCompany);
LogMgr.log(LoggingArea.ALL, LogLevel.PROCESSING1, "Updated Intercom Company: ", intercomCompany);
}
}
catch (Exception e)
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -60,6 +60,8 @@ public abstract class BaseJob extends BaseBusinessClass
public static final String FIELD_State = "State";
public static final String FIELD_Country = "Country";
public static final String FIELD_IsManuallyClosed = "IsManuallyClosed";
public static final String FIELD_LastEdited = "LastEdited";
public static final String FIELD_IsPPJ = "IsPPJ";
public static final String FIELD_Email = "Email";
public static final String FIELD_Password = "Password";
public static final String FIELD_ConfirmPassword = "ConfirmPassword";
......@@ -111,6 +113,8 @@ public abstract class BaseJob extends BaseBusinessClass
private static final EnumeratedAttributeHelper<Job, State> HELPER_State = new EnumeratedAttributeHelper<Job, State> (State.FACTORY_State);
private static final EnumeratedAttributeHelper<Job, Countries> HELPER_Country = new EnumeratedAttributeHelper<Job, Countries> (Countries.FACTORY_Countries);
private static final DefaultAttributeHelper<Job> HELPER_IsManuallyClosed = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<Job> HELPER_LastEdited = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<Job> HELPER_IsPPJ = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<Job> HELPER_Email = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<Job> HELPER_Password = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<Job> HELPER_ConfirmPassword = DefaultAttributeHelper.INSTANCE;
......@@ -143,6 +147,8 @@ public abstract class BaseJob extends BaseBusinessClass
private State _State;
private Countries _Country;
private Boolean _IsManuallyClosed;
private Date _LastEdited;
private Boolean _IsPPJ;
private String _Email;
private String _Password;
private String _ConfirmPassword;
......@@ -207,6 +213,8 @@ public abstract class BaseJob extends BaseBusinessClass
private static final AttributeValidator[] FIELD_State_Validators;
private static final AttributeValidator[] FIELD_Country_Validators;
private static final AttributeValidator[] FIELD_IsManuallyClosed_Validators;
private static final AttributeValidator[] FIELD_LastEdited_Validators;
private static final AttributeValidator[] FIELD_IsPPJ_Validators;
// Arrays of behaviour decorators
......@@ -263,6 +271,8 @@ public abstract class BaseJob extends BaseBusinessClass
FIELD_State_Validators = (AttributeValidator[])setupAttribMetaData_State(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_Country_Validators = (AttributeValidator[])setupAttribMetaData_Country(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_IsManuallyClosed_Validators = (AttributeValidator[])setupAttribMetaData_IsManuallyClosed(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_LastEdited_Validators = (AttributeValidator[])setupAttribMetaData_LastEdited(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_IsPPJ_Validators = (AttributeValidator[])setupAttribMetaData_IsPPJ(validatorMapping).toArray (new AttributeValidator[0]);
REFERENCE_Job.initialiseReference ();
......@@ -955,6 +965,43 @@ public abstract class BaseJob extends BaseBusinessClass
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_LastEdited(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "last_edited");
metaInfo.put ("name", "LastEdited");
metaInfo.put ("type", "Date");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Job.LastEdited:", metaInfo);
ATTRIBUTES_METADATA_Job.put (FIELD_LastEdited, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(Job.class, "LastEdited", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for Job.LastEdited:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_IsPPJ(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "is_ppj");
metaInfo.put ("defaultValue", "Boolean.FALSE");
metaInfo.put ("name", "IsPPJ");
metaInfo.put ("type", "Boolean");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Job.IsPPJ:", metaInfo);
ATTRIBUTES_METADATA_Job.put (FIELD_IsPPJ, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(Job.class, "IsPPJ", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for Job.IsPPJ:", validators);
return validators;
}
// END OF STATIC METADATA DEFINITION
......@@ -998,6 +1045,8 @@ public abstract class BaseJob extends BaseBusinessClass
_State = (State)(State.WA);
_Country = (Countries)(Countries.AU);
_IsManuallyClosed = (Boolean)(Boolean.FALSE);
_LastEdited = (Date)(HELPER_LastEdited.initialise (_LastEdited));
_IsPPJ = (Boolean)(Boolean.FALSE);
_Email = (String)(HELPER_Email.initialise (_Email));
_Password = (String)(HELPER_Password.initialise (_Password));
_ConfirmPassword = (String)(HELPER_ConfirmPassword.initialise (_ConfirmPassword));
......@@ -2630,6 +2679,202 @@ public abstract class BaseJob extends BaseBusinessClass
}
/**
* Get the attribute LastEdited
*/
public Date getLastEdited ()
{
assertValid();
Date valToReturn = _LastEdited;
for (JobBehaviourDecorator bhd : Job_BehaviourDecorators)
{
valToReturn = bhd.getLastEdited ((Job)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preLastEditedChange (Date newLastEdited) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postLastEditedChange () throws FieldException
{
}
public FieldWriteability getWriteability_LastEdited ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute LastEdited. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setLastEdited (Date newLastEdited) throws FieldException
{
boolean oldAndNewIdentical = HELPER_LastEdited.compare (_LastEdited, newLastEdited);
try
{
for (JobBehaviourDecorator bhd : Job_BehaviourDecorators)
{
newLastEdited = bhd.setLastEdited ((Job)this, newLastEdited);
oldAndNewIdentical = HELPER_LastEdited.compare (_LastEdited, newLastEdited);
}
if (FIELD_LastEdited_Validators.length > 0)
{
Object newLastEditedObj = HELPER_LastEdited.toObject (newLastEdited);
if (newLastEditedObj != null)
{
int loopMax = FIELD_LastEdited_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_Job.get (FIELD_LastEdited);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_LastEdited_Validators[v].checkAttribute (this, FIELD_LastEdited, metadata, newLastEditedObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_LastEdited () != FieldWriteability.FALSE, "Field LastEdited is not writeable");
preLastEditedChange (newLastEdited);
markFieldChange (FIELD_LastEdited);
_LastEdited = newLastEdited;
postFieldChange (FIELD_LastEdited);
postLastEditedChange ();
}
}
/**
* Get the attribute IsPPJ
*/
public Boolean getIsPPJ ()
{
assertValid();
Boolean valToReturn = _IsPPJ;
for (JobBehaviourDecorator bhd : Job_BehaviourDecorators)
{
valToReturn = bhd.getIsPPJ ((Job)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preIsPPJChange (Boolean newIsPPJ) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postIsPPJChange () throws FieldException
{
}
public FieldWriteability getWriteability_IsPPJ ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute IsPPJ. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setIsPPJ (Boolean newIsPPJ) throws FieldException
{
boolean oldAndNewIdentical = HELPER_IsPPJ.compare (_IsPPJ, newIsPPJ);
try
{
for (JobBehaviourDecorator bhd : Job_BehaviourDecorators)
{
newIsPPJ = bhd.setIsPPJ ((Job)this, newIsPPJ);
oldAndNewIdentical = HELPER_IsPPJ.compare (_IsPPJ, newIsPPJ);
}
if (FIELD_IsPPJ_Validators.length > 0)
{
Object newIsPPJObj = HELPER_IsPPJ.toObject (newIsPPJ);
if (newIsPPJObj != null)
{
int loopMax = FIELD_IsPPJ_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_Job.get (FIELD_IsPPJ);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_IsPPJ_Validators[v].checkAttribute (this, FIELD_IsPPJ, metadata, newIsPPJObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_IsPPJ () != FieldWriteability.FALSE, "Field IsPPJ is not writeable");
preIsPPJChange (newIsPPJ);
markFieldChange (FIELD_IsPPJ);
_IsPPJ = newIsPPJ;
postFieldChange (FIELD_IsPPJ);
postIsPPJChange ();
}
}
/**
* Get the attribute Email
*/
public String getEmail ()
......@@ -5359,6 +5604,8 @@ public abstract class BaseJob extends BaseBusinessClass
tl_jobPSet.setAttrib (FIELD_State, HELPER_State.toObject (_State)); //
tl_jobPSet.setAttrib (FIELD_Country, HELPER_Country.toObject (_Country)); //
tl_jobPSet.setAttrib (FIELD_IsManuallyClosed, HELPER_IsManuallyClosed.toObject (_IsManuallyClosed)); //
tl_jobPSet.setAttrib (FIELD_LastEdited, HELPER_LastEdited.toObject (_LastEdited)); //
tl_jobPSet.setAttrib (FIELD_IsPPJ, HELPER_IsPPJ.toObject (_IsPPJ)); //
_Level.getPersistentSets (allSets);
_Client.getPersistentSets (allSets);
_CompanyUser.getPersistentSets (allSets);
......@@ -5393,6 +5640,8 @@ public abstract class BaseJob extends BaseBusinessClass
_State = (State)(HELPER_State.fromObject (_State, tl_jobPSet.getAttrib (FIELD_State))); //
_Country = (Countries)(HELPER_Country.fromObject (_Country, tl_jobPSet.getAttrib (FIELD_Country))); //
_IsManuallyClosed = (Boolean)(HELPER_IsManuallyClosed.fromObject (_IsManuallyClosed, tl_jobPSet.getAttrib (FIELD_IsManuallyClosed))); //
_LastEdited = (Date)(HELPER_LastEdited.fromObject (_LastEdited, tl_jobPSet.getAttrib (FIELD_LastEdited))); //
_IsPPJ = (Boolean)(HELPER_IsPPJ.fromObject (_IsPPJ, tl_jobPSet.getAttrib (FIELD_IsPPJ))); //
_Level.setFromPersistentSets (objectID, allSets);
_Client.setFromPersistentSets (objectID, allSets);
_CompanyUser.setFromPersistentSets (objectID, allSets);
......@@ -5556,6 +5805,24 @@ public abstract class BaseJob extends BaseBusinessClass
e.addException (ex);
}
try
{
setLastEdited (otherJob.getLastEdited ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setIsPPJ (otherJob.getIsPPJ ());
}
catch (FieldException ex)
{
e.addException (ex);
}
}
}
......@@ -5587,6 +5854,8 @@ public abstract class BaseJob extends BaseBusinessClass
_State = sourceJob._State;
_Country = sourceJob._Country;
_IsManuallyClosed = sourceJob._IsManuallyClosed;
_LastEdited = sourceJob._LastEdited;
_IsPPJ = sourceJob._IsPPJ;
_Email = sourceJob._Email;
_Password = sourceJob._Password;
_ConfirmPassword = sourceJob._ConfirmPassword;
......@@ -5678,6 +5947,8 @@ public abstract class BaseJob extends BaseBusinessClass
_State = (State)(HELPER_State.readExternal (_State, vals.get(FIELD_State))); //
_Country = (Countries)(HELPER_Country.readExternal (_Country, vals.get(FIELD_Country))); //
_IsManuallyClosed = (Boolean)(HELPER_IsManuallyClosed.readExternal (_IsManuallyClosed, vals.get(FIELD_IsManuallyClosed))); //
_LastEdited = (Date)(HELPER_LastEdited.readExternal (_LastEdited, vals.get(FIELD_LastEdited))); //
_IsPPJ = (Boolean)(HELPER_IsPPJ.readExternal (_IsPPJ, vals.get(FIELD_IsPPJ))); //
_Email = (String)(HELPER_Email.readExternal (_Email, vals.get(FIELD_Email))); //
_Password = (String)(HELPER_Password.readExternal (_Password, vals.get(FIELD_Password))); //
_ConfirmPassword = (String)(HELPER_ConfirmPassword.readExternal (_ConfirmPassword, vals.get(FIELD_ConfirmPassword))); //
......@@ -5728,6 +5999,8 @@ public abstract class BaseJob extends BaseBusinessClass
vals.put (FIELD_State, HELPER_State.writeExternal (_State));
vals.put (FIELD_Country, HELPER_Country.writeExternal (_Country));
vals.put (FIELD_IsManuallyClosed, HELPER_IsManuallyClosed.writeExternal (_IsManuallyClosed));
vals.put (FIELD_LastEdited, HELPER_LastEdited.writeExternal (_LastEdited));
vals.put (FIELD_IsPPJ, HELPER_IsPPJ.writeExternal (_IsPPJ));
vals.put (FIELD_Email, HELPER_Email.writeExternal (_Email));
vals.put (FIELD_Password, HELPER_Password.writeExternal (_Password));
vals.put (FIELD_ConfirmPassword, HELPER_ConfirmPassword.writeExternal (_ConfirmPassword));
......@@ -5828,6 +6101,14 @@ public abstract class BaseJob extends BaseBusinessClass
{
listener.notifyFieldChange(this, other, FIELD_IsManuallyClosed, HELPER_IsManuallyClosed.toObject(this._IsManuallyClosed), HELPER_IsManuallyClosed.toObject(otherJob._IsManuallyClosed));
}
if (!HELPER_LastEdited.compare(this._LastEdited, otherJob._LastEdited))
{
listener.notifyFieldChange(this, other, FIELD_LastEdited, HELPER_LastEdited.toObject(this._LastEdited), HELPER_LastEdited.toObject(otherJob._LastEdited));
}
if (!HELPER_IsPPJ.compare(this._IsPPJ, otherJob._IsPPJ))
{
listener.notifyFieldChange(this, other, FIELD_IsPPJ, HELPER_IsPPJ.toObject(this._IsPPJ), HELPER_IsPPJ.toObject(otherJob._IsPPJ));
}
// Compare single assocs
_AssessmentTemplate.compare (otherJob._AssessmentTemplate, listener);
......@@ -5889,6 +6170,8 @@ public abstract class BaseJob extends BaseBusinessClass
visitor.visitField(this, FIELD_State, HELPER_State.toObject(getState()));
visitor.visitField(this, FIELD_Country, HELPER_Country.toObject(getCountry()));
visitor.visitField(this, FIELD_IsManuallyClosed, HELPER_IsManuallyClosed.toObject(getIsManuallyClosed()));
visitor.visitField(this, FIELD_LastEdited, HELPER_LastEdited.toObject(getLastEdited()));
visitor.visitField(this, FIELD_IsPPJ, HELPER_IsPPJ.toObject(getIsPPJ()));
visitor.visitAssociation (_AssessmentTemplate);
visitor.visitAssociation (_CultureTemplate);
visitor.visitAssociation (_JobTemplate);
......@@ -6036,6 +6319,14 @@ public abstract class BaseJob extends BaseBusinessClass
{
return filter.matches (getIsManuallyClosed ());
}
else if (attribName.equals (FIELD_LastEdited))
{
return filter.matches (getLastEdited ());
}
else if (attribName.equals (FIELD_IsPPJ))
{
return filter.matches (getIsPPJ ());
}
else if (attribName.equals (SINGLEREFERENCE_Level))
{
return filter.matches (getLevel ());
......@@ -6179,6 +6470,18 @@ public abstract class BaseJob extends BaseBusinessClass
return this;
}
public SearchAll andLastEdited (QueryFilter<Date> filter)
{
filter.addFilter (context, "tl_job.last_edited", "LastEdited");
return this;
}
public SearchAll andIsPPJ (QueryFilter<Boolean> filter)
{
filter.addFilter (context, "tl_job.is_ppj", "IsPPJ");
return this;
}
public SearchAll andLevel (QueryFilter<Level> filter)
{
filter.addFilter (context, "tl_job.level_id", "Level");
......@@ -6362,6 +6665,18 @@ public abstract class BaseJob extends BaseBusinessClass
return this;
}
public SearchJobKey andLastEdited (QueryFilter<Date> filter)
{
filter.addFilter (context, "tl_job.last_edited", "LastEdited");
return this;
}
public SearchJobKey andIsPPJ (QueryFilter<Boolean> filter)
{
filter.addFilter (context, "tl_job.is_ppj", "IsPPJ");
return this;
}
public SearchJobKey andLevel (QueryFilter<Level> filter)
{
filter.addFilter (context, "tl_job.level_id", "Level");
......@@ -6539,6 +6854,18 @@ public abstract class BaseJob extends BaseBusinessClass
return this;
}
public SearchCompany andLastEdited (QueryFilter<Date> filter)
{
filter.addFilter (context, "tl_job.last_edited", "LastEdited");
return this;
}
public SearchCompany andIsPPJ (QueryFilter<Boolean> filter)
{
filter.addFilter (context, "tl_job.is_ppj", "IsPPJ");
return this;
}
public SearchCompany andLevel (QueryFilter<Level> filter)
{
filter.addFilter (context, "tl_job.level_id", "Level");
......@@ -6663,6 +6990,14 @@ public abstract class BaseJob extends BaseBusinessClass
{
return HELPER_IsManuallyClosed.toObject (getIsManuallyClosed ());
}
else if (attribName.equals (FIELD_LastEdited))
{
return HELPER_LastEdited.toObject (getLastEdited ());
}
else if (attribName.equals (FIELD_IsPPJ))
{
return HELPER_IsPPJ.toObject (getIsPPJ ());
}
else if (attribName.equals (FIELD_Email))
{
return HELPER_Email.toObject (getEmail ());
......@@ -6792,6 +7127,14 @@ public abstract class BaseJob extends BaseBusinessClass
{
return HELPER_IsManuallyClosed;
}
else if (attribName.equals (FIELD_LastEdited))
{
return HELPER_LastEdited;
}
else if (attribName.equals (FIELD_IsPPJ))
{
return HELPER_IsPPJ;
}
else if (attribName.equals (FIELD_Email))
{
return HELPER_Email;
......@@ -6921,6 +7264,14 @@ public abstract class BaseJob extends BaseBusinessClass
{
setIsManuallyClosed ((Boolean)(HELPER_IsManuallyClosed.fromObject (_IsManuallyClosed, attribValue)));
}
else if (attribName.equals (FIELD_LastEdited))
{
setLastEdited ((Date)(HELPER_LastEdited.fromObject (_LastEdited, attribValue)));
}
else if (attribName.equals (FIELD_IsPPJ))
{
setIsPPJ ((Boolean)(HELPER_IsPPJ.fromObject (_IsPPJ, attribValue)));
}
else if (attribName.equals (FIELD_Email))
{
setEmail ((String)(HELPER_Email.fromObject (_Email, attribValue)));
......@@ -7057,6 +7408,14 @@ public abstract class BaseJob extends BaseBusinessClass
{
return getWriteability_IsManuallyClosed ();
}
else if (fieldName.equals (FIELD_LastEdited))
{
return getWriteability_LastEdited ();
}
else if (fieldName.equals (FIELD_IsPPJ))
{
return getWriteability_IsPPJ ();
}
else if (fieldName.equals (MULTIPLEREFERENCE_JobApplications))
{
return getWriteability_JobApplications ();
......@@ -7239,6 +7598,16 @@ public abstract class BaseJob extends BaseBusinessClass
fields.add (FIELD_IsManuallyClosed);
}
if (getWriteability_LastEdited () != FieldWriteability.TRUE)
{
fields.add (FIELD_LastEdited);
}
if (getWriteability_IsPPJ () != FieldWriteability.TRUE)
{
fields.add (FIELD_IsPPJ);
}
if (getWriteability_Email () != FieldWriteability.TRUE)
{
fields.add (FIELD_Email);
......@@ -7329,6 +7698,8 @@ public abstract class BaseJob extends BaseBusinessClass
result.add(HELPER_State.getAttribObject (getClass (), _State, false, FIELD_State));
result.add(HELPER_Country.getAttribObject (getClass (), _Country, false, FIELD_Country));
result.add(HELPER_IsManuallyClosed.getAttribObject (getClass (), _IsManuallyClosed, false, FIELD_IsManuallyClosed));
result.add(HELPER_LastEdited.getAttribObject (getClass (), _LastEdited, false, FIELD_LastEdited));
result.add(HELPER_IsPPJ.getAttribObject (getClass (), _IsPPJ, false, FIELD_IsPPJ));
result.add(HELPER_Email.getAttribObject (getClass (), _Email, false, FIELD_Email));
result.add(HELPER_Password.getAttribObject (getClass (), _Password, false, FIELD_Password));
result.add(HELPER_ConfirmPassword.getAttribObject (getClass (), _ConfirmPassword, false, FIELD_ConfirmPassword));
......@@ -7681,6 +8052,42 @@ public abstract class BaseJob extends BaseBusinessClass
}
/**
* Get the attribute LastEdited
*/
public Date getLastEdited (Job obj, Date original)
{
return original;
}
/**
* Change the value set for attribute LastEdited.
* May modify the field beforehand
* Occurs before validation.
*/
public Date setLastEdited (Job obj, Date newLastEdited) throws FieldException
{
return newLastEdited;
}
/**
* Get the attribute IsPPJ
*/
public Boolean getIsPPJ (Job obj, Boolean original)
{
return original;
}
/**
* Change the value set for attribute IsPPJ.
* May modify the field beforehand
* Occurs before validation.
*/
public Boolean setIsPPJ (Job obj, Boolean newIsPPJ) throws FieldException
{
return newIsPPJ;
}
/**
* Get the attribute Email
*/
public String getEmail (Job obj, String original)
......@@ -8106,6 +8513,14 @@ public abstract class BaseJob extends BaseBusinessClass
{
return toIsManuallyClosed ();
}
if (name.equals ("LastEdited"))
{
return toLastEdited ();
}
if (name.equals ("IsPPJ"))
{
return toIsPPJ ();
}
if (name.equals ("Level"))
{
return toLevel ();
......@@ -8185,6 +8600,10 @@ public abstract class BaseJob extends BaseBusinessClass
public PipeLine<From, Countries> toCountry () { return pipe(new ORMAttributePipe<Me, Countries>(FIELD_Country)); }
public PipeLine<From, Boolean> toIsManuallyClosed () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_IsManuallyClosed)); }
public PipeLine<From, Date> toLastEdited () { return pipe(new ORMAttributePipe<Me, Date>(FIELD_LastEdited)); }
public PipeLine<From, Boolean> toIsPPJ () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_IsPPJ)); }
public AssessmentCriteriaTemplate.AssessmentCriteriaTemplatePipeLineFactory<From, AssessmentCriteriaTemplate> toAssessmentTemplate () { return toAssessmentTemplate (Filter.ALL); }
public AssessmentCriteriaTemplate.AssessmentCriteriaTemplatePipeLineFactory<From, AssessmentCriteriaTemplate> toAssessmentTemplate (Filter<AssessmentCriteriaTemplate> filter)
......
/*
* IMPORTANT!!!! XSL Autogenerated class, DO NOT EDIT!!!!!
* Template: Infrastructure8.2 rev3 [oneit.objstore.BusinessObjectTemplate.xsl]
*
* Version: 1.0
* Vendor: Apache Software Foundation (Xalan XSLTC)
* Vendor URL: http://xml.apache.org/xalan-j
*/
package performa.orm;
import java.io.*;
import java.util.*;
import oneit.appservices.config.*;
import oneit.logging.*;
import oneit.objstore.*;
import oneit.objstore.assocs.*;
import oneit.objstore.attributes.*;
import oneit.objstore.rdbms.filters.*;
import oneit.objstore.parser.*;
import oneit.objstore.validator.*;
import oneit.objstore.utils.*;
import oneit.utils.*;
import oneit.utils.filter.Filter;
import oneit.utils.transform.*;
import oneit.utils.parsers.FieldException;
import performa.orm.types.*;
public abstract class BasePaymentPlan extends BaseBusinessClass
{
// Reference instance for the object
public static final PaymentPlan REFERENCE_PaymentPlan = new PaymentPlan ();
// Reference instance for the object
public static final PaymentPlan DUMMY_PaymentPlan = new DummyPaymentPlan ();
// Static constants corresponding to field names
public static final String FIELD_StripeReference = "StripeReference";
public static final String FIELD_PlanName = "PlanName";
public static final String FIELD_Description = "Description";
public static final String FIELD_CurrencyType = "CurrencyType";
public static final String FIELD_Amount = "Amount";
public static final String FIELD_Interval = "Interval";
public static final String FIELD_IntervalCount = "IntervalCount";
public static final String FIELD_TrialPeriodDays = "TrialPeriodDays";
public static final String FIELD_ActiveJobCount = "ActiveJobCount";
// Static constants corresponding to searches
public static final String SEARCH_All = "All";
public static final String SEARCH_Max = "Max";
// Static constants corresponding to attribute helpers
private static final DefaultAttributeHelper<PaymentPlan> HELPER_StripeReference = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<PaymentPlan> HELPER_PlanName = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<PaymentPlan> HELPER_Description = DefaultAttributeHelper.INSTANCE;
private static final EnumeratedAttributeHelper<PaymentPlan, CurrencyType> HELPER_CurrencyType = new EnumeratedAttributeHelper<PaymentPlan, CurrencyType> (CurrencyType.FACTORY_CurrencyType);
private static final DefaultAttributeHelper<PaymentPlan> HELPER_Amount = DefaultAttributeHelper.INSTANCE;
private static final EnumeratedAttributeHelper<PaymentPlan, Interval> HELPER_Interval = new EnumeratedAttributeHelper<PaymentPlan, Interval> (Interval.FACTORY_Interval);
private static final DefaultAttributeHelper<PaymentPlan> HELPER_IntervalCount = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<PaymentPlan> HELPER_TrialPeriodDays = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<PaymentPlan> HELPER_ActiveJobCount = DefaultAttributeHelper.INSTANCE;
// Private attributes corresponding to business object data
private String _StripeReference;
private String _PlanName;
private String _Description;
private CurrencyType _CurrencyType;
private Double _Amount;
private Interval _Interval;
private Integer _IntervalCount;
private Integer _TrialPeriodDays;
private Integer _ActiveJobCount;
// Private attributes corresponding to single references
// Private attributes corresponding to multiple references
// Map of maps of metadata
private static final Map ATTRIBUTES_METADATA_PaymentPlan = new HashMap ();
// Arrays of validators for each attribute
private static final AttributeValidator[] FIELD_StripeReference_Validators;
private static final AttributeValidator[] FIELD_PlanName_Validators;
private static final AttributeValidator[] FIELD_Description_Validators;
private static final AttributeValidator[] FIELD_CurrencyType_Validators;
private static final AttributeValidator[] FIELD_Amount_Validators;
private static final AttributeValidator[] FIELD_Interval_Validators;
private static final AttributeValidator[] FIELD_IntervalCount_Validators;
private static final AttributeValidator[] FIELD_TrialPeriodDays_Validators;
private static final AttributeValidator[] FIELD_ActiveJobCount_Validators;
// Arrays of behaviour decorators
private static final PaymentPlanBehaviourDecorator[] PaymentPlan_BehaviourDecorators;
static
{
try
{
Map validatorMapping = ((Map)ConfigMgr.getConfigObject ("CONFIG.ORMVALIDATOR", "ValidatorMapping"));
FIELD_StripeReference_Validators = (AttributeValidator[])setupAttribMetaData_StripeReference(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_PlanName_Validators = (AttributeValidator[])setupAttribMetaData_PlanName(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_Description_Validators = (AttributeValidator[])setupAttribMetaData_Description(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_CurrencyType_Validators = (AttributeValidator[])setupAttribMetaData_CurrencyType(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_Amount_Validators = (AttributeValidator[])setupAttribMetaData_Amount(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_Interval_Validators = (AttributeValidator[])setupAttribMetaData_Interval(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_IntervalCount_Validators = (AttributeValidator[])setupAttribMetaData_IntervalCount(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_TrialPeriodDays_Validators = (AttributeValidator[])setupAttribMetaData_TrialPeriodDays(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_ActiveJobCount_Validators = (AttributeValidator[])setupAttribMetaData_ActiveJobCount(validatorMapping).toArray (new AttributeValidator[0]);
REFERENCE_PaymentPlan.initialiseReference ();
DUMMY_PaymentPlan.initialiseReference ();
PaymentPlan_BehaviourDecorators = BaseBusinessClass.getBBCBehaviours(PaymentPlan.class).toArray(new PaymentPlanBehaviourDecorator[0]);
}
catch (RuntimeException e)
{
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR1, e, "Error initialising");
throw e;
}
}
// Meta Info setup
private static List setupAttribMetaData_StripeReference(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "stripe_reference");
metaInfo.put ("length", "100");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "StripeReference");
metaInfo.put ("type", "String");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for PaymentPlan.StripeReference:", metaInfo);
ATTRIBUTES_METADATA_PaymentPlan.put (FIELD_StripeReference, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(PaymentPlan.class, "StripeReference", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for PaymentPlan.StripeReference:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_PlanName(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "plan_name");
metaInfo.put ("name", "PlanName");
metaInfo.put ("type", "String");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for PaymentPlan.PlanName:", metaInfo);
ATTRIBUTES_METADATA_PaymentPlan.put (FIELD_PlanName, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(PaymentPlan.class, "PlanName", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for PaymentPlan.PlanName:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_Description(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "description");
metaInfo.put ("name", "Description");
metaInfo.put ("type", "String");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for PaymentPlan.Description:", metaInfo);
ATTRIBUTES_METADATA_PaymentPlan.put (FIELD_Description, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(PaymentPlan.class, "Description", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for PaymentPlan.Description:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_CurrencyType(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("attribHelper", "EnumeratedAttributeHelper");
metaInfo.put ("dbcol", "currency_type");
metaInfo.put ("defaultValue", "CurrencyType.AUD");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "CurrencyType");
metaInfo.put ("type", "CurrencyType");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for PaymentPlan.CurrencyType:", metaInfo);
ATTRIBUTES_METADATA_PaymentPlan.put (FIELD_CurrencyType, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(PaymentPlan.class, "CurrencyType", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for PaymentPlan.CurrencyType:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_Amount(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.putAll ((Map)ConfigMgr.getConfigObject ("CONFIG.SUBTYPE_ATTRIBS", "Currency", new HashMap ()));
metaInfo.put ("dbcol", "amount");
metaInfo.put ("Formatter", "Currency");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "Amount");
metaInfo.put ("SubType", "Currency");
metaInfo.put ("type", "Double");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for PaymentPlan.Amount:", metaInfo);
ATTRIBUTES_METADATA_PaymentPlan.put (FIELD_Amount, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(PaymentPlan.class, "Amount", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for PaymentPlan.Amount:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_Interval(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("attribHelper", "EnumeratedAttributeHelper");
metaInfo.put ("dbcol", "interval");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "Interval");
metaInfo.put ("type", "Interval");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for PaymentPlan.Interval:", metaInfo);
ATTRIBUTES_METADATA_PaymentPlan.put (FIELD_Interval, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(PaymentPlan.class, "Interval", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for PaymentPlan.Interval:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_IntervalCount(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "interval_count");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "IntervalCount");
metaInfo.put ("type", "Integer");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for PaymentPlan.IntervalCount:", metaInfo);
ATTRIBUTES_METADATA_PaymentPlan.put (FIELD_IntervalCount, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(PaymentPlan.class, "IntervalCount", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for PaymentPlan.IntervalCount:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_TrialPeriodDays(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "trial_period_days");
metaInfo.put ("name", "TrialPeriodDays");
metaInfo.put ("type", "Integer");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for PaymentPlan.TrialPeriodDays:", metaInfo);
ATTRIBUTES_METADATA_PaymentPlan.put (FIELD_TrialPeriodDays, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(PaymentPlan.class, "TrialPeriodDays", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for PaymentPlan.TrialPeriodDays:", validators);
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_ActiveJobCount(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "active_job_count");
metaInfo.put ("name", "ActiveJobCount");
metaInfo.put ("type", "Integer");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for PaymentPlan.ActiveJobCount:", metaInfo);
ATTRIBUTES_METADATA_PaymentPlan.put (FIELD_ActiveJobCount, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(PaymentPlan.class, "ActiveJobCount", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for PaymentPlan.ActiveJobCount:", validators);
return validators;
}
// END OF STATIC METADATA DEFINITION
// This constructor should not be called
protected BasePaymentPlan ()
{
}
protected BBCBehaviourDecorator[] getBehaviours()
{
return PaymentPlan_BehaviourDecorators;
}
// Initialise the attributes
protected void _initialiseNewObjAttributes (ObjectTransaction transaction) throws StorageException
{
super._initialiseNewObjAttributes (transaction);
_StripeReference = (String)(HELPER_StripeReference.initialise (_StripeReference));
_PlanName = (String)(HELPER_PlanName.initialise (_PlanName));
_Description = (String)(HELPER_Description.initialise (_Description));
_CurrencyType = (CurrencyType)(CurrencyType.AUD);
_Amount = (Double)(HELPER_Amount.initialise (_Amount));
_Interval = (Interval)(HELPER_Interval.initialise (_Interval));
_IntervalCount = (Integer)(HELPER_IntervalCount.initialise (_IntervalCount));
_TrialPeriodDays = (Integer)(HELPER_TrialPeriodDays.initialise (_TrialPeriodDays));
_ActiveJobCount = (Integer)(HELPER_ActiveJobCount.initialise (_ActiveJobCount));
}
// Initialise the associations
protected void _initialiseAssociations ()
{
super._initialiseAssociations ();
}
// Initialise the associations
protected BaseBusinessClass initialiseReference ()
{
super.initialiseReference ();
return this;
}
/**
* Get the attribute StripeReference
*/
public String getStripeReference ()
{
assertValid();
String valToReturn = _StripeReference;
for (PaymentPlanBehaviourDecorator bhd : PaymentPlan_BehaviourDecorators)
{
valToReturn = bhd.getStripeReference ((PaymentPlan)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preStripeReferenceChange (String newStripeReference) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postStripeReferenceChange () throws FieldException
{
}
public FieldWriteability getWriteability_StripeReference ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute StripeReference. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setStripeReference (String newStripeReference) throws FieldException
{
boolean oldAndNewIdentical = HELPER_StripeReference.compare (_StripeReference, newStripeReference);
try
{
for (PaymentPlanBehaviourDecorator bhd : PaymentPlan_BehaviourDecorators)
{
newStripeReference = bhd.setStripeReference ((PaymentPlan)this, newStripeReference);
oldAndNewIdentical = HELPER_StripeReference.compare (_StripeReference, newStripeReference);
}
BusinessObjectParser.assertFieldCondition (newStripeReference != null, this, FIELD_StripeReference, "mandatory");
if (FIELD_StripeReference_Validators.length > 0)
{
Object newStripeReferenceObj = HELPER_StripeReference.toObject (newStripeReference);
if (newStripeReferenceObj != null)
{
int loopMax = FIELD_StripeReference_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_PaymentPlan.get (FIELD_StripeReference);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_StripeReference_Validators[v].checkAttribute (this, FIELD_StripeReference, metadata, newStripeReferenceObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_StripeReference () != FieldWriteability.FALSE, "Field StripeReference is not writeable");
preStripeReferenceChange (newStripeReference);
markFieldChange (FIELD_StripeReference);
_StripeReference = newStripeReference;
postFieldChange (FIELD_StripeReference);
postStripeReferenceChange ();
}
}
/**
* Get the attribute PlanName
*/
public String getPlanName ()
{
assertValid();
String valToReturn = _PlanName;
for (PaymentPlanBehaviourDecorator bhd : PaymentPlan_BehaviourDecorators)
{
valToReturn = bhd.getPlanName ((PaymentPlan)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void prePlanNameChange (String newPlanName) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postPlanNameChange () throws FieldException
{
}
public FieldWriteability getWriteability_PlanName ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute PlanName. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setPlanName (String newPlanName) throws FieldException
{
boolean oldAndNewIdentical = HELPER_PlanName.compare (_PlanName, newPlanName);
try
{
for (PaymentPlanBehaviourDecorator bhd : PaymentPlan_BehaviourDecorators)
{
newPlanName = bhd.setPlanName ((PaymentPlan)this, newPlanName);
oldAndNewIdentical = HELPER_PlanName.compare (_PlanName, newPlanName);
}
if (FIELD_PlanName_Validators.length > 0)
{
Object newPlanNameObj = HELPER_PlanName.toObject (newPlanName);
if (newPlanNameObj != null)
{
int loopMax = FIELD_PlanName_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_PaymentPlan.get (FIELD_PlanName);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_PlanName_Validators[v].checkAttribute (this, FIELD_PlanName, metadata, newPlanNameObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_PlanName () != FieldWriteability.FALSE, "Field PlanName is not writeable");
prePlanNameChange (newPlanName);
markFieldChange (FIELD_PlanName);
_PlanName = newPlanName;
postFieldChange (FIELD_PlanName);
postPlanNameChange ();
}
}
/**
* Get the attribute Description
*/
public String getDescription ()
{
assertValid();
String valToReturn = _Description;
for (PaymentPlanBehaviourDecorator bhd : PaymentPlan_BehaviourDecorators)
{
valToReturn = bhd.getDescription ((PaymentPlan)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preDescriptionChange (String newDescription) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postDescriptionChange () throws FieldException
{
}
public FieldWriteability getWriteability_Description ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute Description. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setDescription (String newDescription) throws FieldException
{
boolean oldAndNewIdentical = HELPER_Description.compare (_Description, newDescription);
try
{
for (PaymentPlanBehaviourDecorator bhd : PaymentPlan_BehaviourDecorators)
{
newDescription = bhd.setDescription ((PaymentPlan)this, newDescription);
oldAndNewIdentical = HELPER_Description.compare (_Description, newDescription);
}
if (FIELD_Description_Validators.length > 0)
{
Object newDescriptionObj = HELPER_Description.toObject (newDescription);
if (newDescriptionObj != null)
{
int loopMax = FIELD_Description_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_PaymentPlan.get (FIELD_Description);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_Description_Validators[v].checkAttribute (this, FIELD_Description, metadata, newDescriptionObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_Description () != FieldWriteability.FALSE, "Field Description is not writeable");
preDescriptionChange (newDescription);
markFieldChange (FIELD_Description);
_Description = newDescription;
postFieldChange (FIELD_Description);
postDescriptionChange ();
}
}
/**
* Get the attribute CurrencyType
*/
public CurrencyType getCurrencyType ()
{
assertValid();
CurrencyType valToReturn = _CurrencyType;
for (PaymentPlanBehaviourDecorator bhd : PaymentPlan_BehaviourDecorators)
{
valToReturn = bhd.getCurrencyType ((PaymentPlan)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preCurrencyTypeChange (CurrencyType newCurrencyType) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postCurrencyTypeChange () throws FieldException
{
}
public FieldWriteability getWriteability_CurrencyType ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute CurrencyType. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setCurrencyType (CurrencyType newCurrencyType) throws FieldException
{
boolean oldAndNewIdentical = HELPER_CurrencyType.compare (_CurrencyType, newCurrencyType);
try
{
for (PaymentPlanBehaviourDecorator bhd : PaymentPlan_BehaviourDecorators)
{
newCurrencyType = bhd.setCurrencyType ((PaymentPlan)this, newCurrencyType);
oldAndNewIdentical = HELPER_CurrencyType.compare (_CurrencyType, newCurrencyType);
}
BusinessObjectParser.assertFieldCondition (newCurrencyType != null, this, FIELD_CurrencyType, "mandatory");
if (FIELD_CurrencyType_Validators.length > 0)
{
Object newCurrencyTypeObj = HELPER_CurrencyType.toObject (newCurrencyType);
if (newCurrencyTypeObj != null)
{
int loopMax = FIELD_CurrencyType_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_PaymentPlan.get (FIELD_CurrencyType);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_CurrencyType_Validators[v].checkAttribute (this, FIELD_CurrencyType, metadata, newCurrencyTypeObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_CurrencyType () != FieldWriteability.FALSE, "Field CurrencyType is not writeable");
preCurrencyTypeChange (newCurrencyType);
markFieldChange (FIELD_CurrencyType);
_CurrencyType = newCurrencyType;
postFieldChange (FIELD_CurrencyType);
postCurrencyTypeChange ();
}
}
/**
* Get the attribute Amount
*/
public Double getAmount ()
{
assertValid();
Double valToReturn = _Amount;
for (PaymentPlanBehaviourDecorator bhd : PaymentPlan_BehaviourDecorators)
{
valToReturn = bhd.getAmount ((PaymentPlan)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preAmountChange (Double newAmount) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postAmountChange () throws FieldException
{
}
public FieldWriteability getWriteability_Amount ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute Amount. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setAmount (Double newAmount) throws FieldException
{
boolean oldAndNewIdentical = HELPER_Amount.compare (_Amount, newAmount);
try
{
for (PaymentPlanBehaviourDecorator bhd : PaymentPlan_BehaviourDecorators)
{
newAmount = bhd.setAmount ((PaymentPlan)this, newAmount);
oldAndNewIdentical = HELPER_Amount.compare (_Amount, newAmount);
}
BusinessObjectParser.assertFieldCondition (newAmount != null, this, FIELD_Amount, "mandatory");
if (FIELD_Amount_Validators.length > 0)
{
Object newAmountObj = HELPER_Amount.toObject (newAmount);
if (newAmountObj != null)
{
int loopMax = FIELD_Amount_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_PaymentPlan.get (FIELD_Amount);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_Amount_Validators[v].checkAttribute (this, FIELD_Amount, metadata, newAmountObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_Amount () != FieldWriteability.FALSE, "Field Amount is not writeable");
preAmountChange (newAmount);
markFieldChange (FIELD_Amount);
_Amount = newAmount;
postFieldChange (FIELD_Amount);
postAmountChange ();
}
}
/**
* Get the attribute Interval
*/
public Interval getInterval ()
{
assertValid();
Interval valToReturn = _Interval;
for (PaymentPlanBehaviourDecorator bhd : PaymentPlan_BehaviourDecorators)
{
valToReturn = bhd.getInterval ((PaymentPlan)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preIntervalChange (Interval newInterval) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postIntervalChange () throws FieldException
{
}
public FieldWriteability getWriteability_Interval ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute Interval. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setInterval (Interval newInterval) throws FieldException
{
boolean oldAndNewIdentical = HELPER_Interval.compare (_Interval, newInterval);
try
{
for (PaymentPlanBehaviourDecorator bhd : PaymentPlan_BehaviourDecorators)
{
newInterval = bhd.setInterval ((PaymentPlan)this, newInterval);
oldAndNewIdentical = HELPER_Interval.compare (_Interval, newInterval);
}
BusinessObjectParser.assertFieldCondition (newInterval != null, this, FIELD_Interval, "mandatory");
if (FIELD_Interval_Validators.length > 0)
{
Object newIntervalObj = HELPER_Interval.toObject (newInterval);
if (newIntervalObj != null)
{
int loopMax = FIELD_Interval_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_PaymentPlan.get (FIELD_Interval);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_Interval_Validators[v].checkAttribute (this, FIELD_Interval, metadata, newIntervalObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_Interval () != FieldWriteability.FALSE, "Field Interval is not writeable");
preIntervalChange (newInterval);
markFieldChange (FIELD_Interval);
_Interval = newInterval;
postFieldChange (FIELD_Interval);
postIntervalChange ();
}
}
/**
* Get the attribute IntervalCount
*/
public Integer getIntervalCount ()
{
assertValid();
Integer valToReturn = _IntervalCount;
for (PaymentPlanBehaviourDecorator bhd : PaymentPlan_BehaviourDecorators)
{
valToReturn = bhd.getIntervalCount ((PaymentPlan)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preIntervalCountChange (Integer newIntervalCount) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postIntervalCountChange () throws FieldException
{
}
public FieldWriteability getWriteability_IntervalCount ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute IntervalCount. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setIntervalCount (Integer newIntervalCount) throws FieldException
{
boolean oldAndNewIdentical = HELPER_IntervalCount.compare (_IntervalCount, newIntervalCount);
try
{
for (PaymentPlanBehaviourDecorator bhd : PaymentPlan_BehaviourDecorators)
{
newIntervalCount = bhd.setIntervalCount ((PaymentPlan)this, newIntervalCount);
oldAndNewIdentical = HELPER_IntervalCount.compare (_IntervalCount, newIntervalCount);
}
BusinessObjectParser.assertFieldCondition (newIntervalCount != null, this, FIELD_IntervalCount, "mandatory");
if (FIELD_IntervalCount_Validators.length > 0)
{
Object newIntervalCountObj = HELPER_IntervalCount.toObject (newIntervalCount);
if (newIntervalCountObj != null)
{
int loopMax = FIELD_IntervalCount_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_PaymentPlan.get (FIELD_IntervalCount);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_IntervalCount_Validators[v].checkAttribute (this, FIELD_IntervalCount, metadata, newIntervalCountObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_IntervalCount () != FieldWriteability.FALSE, "Field IntervalCount is not writeable");
preIntervalCountChange (newIntervalCount);
markFieldChange (FIELD_IntervalCount);
_IntervalCount = newIntervalCount;
postFieldChange (FIELD_IntervalCount);
postIntervalCountChange ();
}
}
/**
* Get the attribute TrialPeriodDays
*/
public Integer getTrialPeriodDays ()
{
assertValid();
Integer valToReturn = _TrialPeriodDays;
for (PaymentPlanBehaviourDecorator bhd : PaymentPlan_BehaviourDecorators)
{
valToReturn = bhd.getTrialPeriodDays ((PaymentPlan)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preTrialPeriodDaysChange (Integer newTrialPeriodDays) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postTrialPeriodDaysChange () throws FieldException
{
}
public FieldWriteability getWriteability_TrialPeriodDays ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute TrialPeriodDays. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setTrialPeriodDays (Integer newTrialPeriodDays) throws FieldException
{
boolean oldAndNewIdentical = HELPER_TrialPeriodDays.compare (_TrialPeriodDays, newTrialPeriodDays);
try
{
for (PaymentPlanBehaviourDecorator bhd : PaymentPlan_BehaviourDecorators)
{
newTrialPeriodDays = bhd.setTrialPeriodDays ((PaymentPlan)this, newTrialPeriodDays);
oldAndNewIdentical = HELPER_TrialPeriodDays.compare (_TrialPeriodDays, newTrialPeriodDays);
}
if (FIELD_TrialPeriodDays_Validators.length > 0)
{
Object newTrialPeriodDaysObj = HELPER_TrialPeriodDays.toObject (newTrialPeriodDays);
if (newTrialPeriodDaysObj != null)
{
int loopMax = FIELD_TrialPeriodDays_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_PaymentPlan.get (FIELD_TrialPeriodDays);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_TrialPeriodDays_Validators[v].checkAttribute (this, FIELD_TrialPeriodDays, metadata, newTrialPeriodDaysObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_TrialPeriodDays () != FieldWriteability.FALSE, "Field TrialPeriodDays is not writeable");
preTrialPeriodDaysChange (newTrialPeriodDays);
markFieldChange (FIELD_TrialPeriodDays);
_TrialPeriodDays = newTrialPeriodDays;
postFieldChange (FIELD_TrialPeriodDays);
postTrialPeriodDaysChange ();
}
}
/**
* Get the attribute ActiveJobCount
*/
public Integer getActiveJobCount ()
{
assertValid();
Integer valToReturn = _ActiveJobCount;
for (PaymentPlanBehaviourDecorator bhd : PaymentPlan_BehaviourDecorators)
{
valToReturn = bhd.getActiveJobCount ((PaymentPlan)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preActiveJobCountChange (Integer newActiveJobCount) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postActiveJobCountChange () throws FieldException
{
}
public FieldWriteability getWriteability_ActiveJobCount ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute ActiveJobCount. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setActiveJobCount (Integer newActiveJobCount) throws FieldException
{
boolean oldAndNewIdentical = HELPER_ActiveJobCount.compare (_ActiveJobCount, newActiveJobCount);
try
{
for (PaymentPlanBehaviourDecorator bhd : PaymentPlan_BehaviourDecorators)
{
newActiveJobCount = bhd.setActiveJobCount ((PaymentPlan)this, newActiveJobCount);
oldAndNewIdentical = HELPER_ActiveJobCount.compare (_ActiveJobCount, newActiveJobCount);
}
if (FIELD_ActiveJobCount_Validators.length > 0)
{
Object newActiveJobCountObj = HELPER_ActiveJobCount.toObject (newActiveJobCount);
if (newActiveJobCountObj != null)
{
int loopMax = FIELD_ActiveJobCount_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_PaymentPlan.get (FIELD_ActiveJobCount);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_ActiveJobCount_Validators[v].checkAttribute (this, FIELD_ActiveJobCount, metadata, newActiveJobCountObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_ActiveJobCount () != FieldWriteability.FALSE, "Field ActiveJobCount is not writeable");
preActiveJobCountChange (newActiveJobCount);
markFieldChange (FIELD_ActiveJobCount);
_ActiveJobCount = newActiveJobCount;
postFieldChange (FIELD_ActiveJobCount);
postActiveJobCountChange ();
}
}
/**
* A list of multi assoc names e.g. list of strings.
*/
public List<String> getSingleAssocs()
{
List result = super.getSingleAssocs ();
return result;
}
public BaseBusinessClass getSingleAssocReferenceInstance (String assocName)
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else
{
return super.getSingleAssocReferenceInstance (assocName);
}
}
public String getSingleAssocBackReference(String assocName)
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else
{
return super.getSingleAssocBackReference (assocName);
}
}
public BaseBusinessClass getSingleAssoc (String assocName) throws StorageException
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else
{
return super.getSingleAssoc (assocName);
}
}
public BaseBusinessClass getSingleAssoc (String assocName, Get getType) throws StorageException
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else
{
return super.getSingleAssoc (assocName, getType);
}
}
public Long getSingleAssocID (String assocName) throws StorageException
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else
{
return super.getSingleAssocID (assocName);
}
}
public void setSingleAssoc (String assocName, BaseBusinessClass newValue) throws StorageException, FieldException
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else
{
super.setSingleAssoc (assocName, newValue);
}
}
/**
* A list of multi assoc names e.g. list of strings.
*/
public List<String> getMultiAssocs()
{
List result = super.getMultiAssocs ();
return result;
}
/**
* Get the reference instance for the multi assoc name.
*/
public BaseBusinessClass getMultiAssocReferenceInstance(String attribName)
{
return super.getMultiAssocReferenceInstance(attribName);
}
public String getMultiAssocBackReference(String attribName)
{
return super.getMultiAssocBackReference(attribName);
}
/**
* Get the assoc count for the multi assoc name.
*/
public int getMultiAssocCount(String attribName) throws StorageException
{
return super.getMultiAssocCount(attribName);
}
/**
* Get the assoc at a particular index
*/
public BaseBusinessClass getMultiAssocAt(String attribName, int index) throws StorageException
{
return super.getMultiAssocAt(attribName, index);
}
/**
* Add to a multi assoc by attribute name
*/
public void addToMultiAssoc(String attribName, BaseBusinessClass newElement) throws StorageException
{
super.addToMultiAssoc(attribName, newElement);
}
/**
* Remove from a multi assoc by attribute name
*/
public void removeFromMultiAssoc(String attribName, BaseBusinessClass oldElement) throws StorageException
{
super.removeFromMultiAssoc(attribName, oldElement);
}
protected void __loadMultiAssoc (String attribName, BaseBusinessClass[] elements)
{
super.__loadMultiAssoc(attribName, elements);
}
protected boolean __isMultiAssocLoaded (String attribName)
{
return super.__isMultiAssocLoaded(attribName);
}
public void onDelete ()
{
try
{
}
catch (Exception e)
{
throw NestedException.wrap(e);
}
super.onDelete ();
}
public PaymentPlan newInstance ()
{
return new PaymentPlan ();
}
public PaymentPlan referenceInstance ()
{
return REFERENCE_PaymentPlan;
}
public PaymentPlan getInTransaction (ObjectTransaction t) throws StorageException
{
return getPaymentPlanByID (t, getObjectID());
}
public BaseBusinessClass dummyInstance ()
{
return DUMMY_PaymentPlan;
}
public String getBaseSetName ()
{
return "tl_payment_plan";
}
/**
* This is where an object returns the Persistent sets that will
* store it into the database.
* The should be entered into allSets
*/
public void getPersistentSets (PersistentSetCollection allSets)
{
ObjectStatus myStatus = getStatus ();
PersistentSetStatus myPSetStatus = myStatus.getPSetStatus();
ObjectID myID = getID();
super.getPersistentSets (allSets);
PersistentSet tl_payment_planPSet = allSets.getPersistentSet (myID, "tl_payment_plan", myPSetStatus);
tl_payment_planPSet.setAttrib (FIELD_ObjectID, myID);
tl_payment_planPSet.setAttrib (FIELD_StripeReference, HELPER_StripeReference.toObject (_StripeReference)); //
tl_payment_planPSet.setAttrib (FIELD_PlanName, HELPER_PlanName.toObject (_PlanName)); //
tl_payment_planPSet.setAttrib (FIELD_Description, HELPER_Description.toObject (_Description)); //
tl_payment_planPSet.setAttrib (FIELD_CurrencyType, HELPER_CurrencyType.toObject (_CurrencyType)); //
tl_payment_planPSet.setAttrib (FIELD_Amount, HELPER_Amount.toObject (_Amount)); //
tl_payment_planPSet.setAttrib (FIELD_Interval, HELPER_Interval.toObject (_Interval)); //
tl_payment_planPSet.setAttrib (FIELD_IntervalCount, HELPER_IntervalCount.toObject (_IntervalCount)); //
tl_payment_planPSet.setAttrib (FIELD_TrialPeriodDays, HELPER_TrialPeriodDays.toObject (_TrialPeriodDays)); //
tl_payment_planPSet.setAttrib (FIELD_ActiveJobCount, HELPER_ActiveJobCount.toObject (_ActiveJobCount)); //
}
/**
* Sets the objects state based on Persistent sets.
*/
public void setFromPersistentSets (ObjectID objectID, PersistentSetCollection allSets)
{
super.setFromPersistentSets (objectID, allSets);
PersistentSet tl_payment_planPSet = allSets.getPersistentSet (objectID, "tl_payment_plan");
_StripeReference = (String)(HELPER_StripeReference.fromObject (_StripeReference, tl_payment_planPSet.getAttrib (FIELD_StripeReference))); //
_PlanName = (String)(HELPER_PlanName.fromObject (_PlanName, tl_payment_planPSet.getAttrib (FIELD_PlanName))); //
_Description = (String)(HELPER_Description.fromObject (_Description, tl_payment_planPSet.getAttrib (FIELD_Description))); //
_CurrencyType = (CurrencyType)(HELPER_CurrencyType.fromObject (_CurrencyType, tl_payment_planPSet.getAttrib (FIELD_CurrencyType))); //
_Amount = (Double)(HELPER_Amount.fromObject (_Amount, tl_payment_planPSet.getAttrib (FIELD_Amount))); //
_Interval = (Interval)(HELPER_Interval.fromObject (_Interval, tl_payment_planPSet.getAttrib (FIELD_Interval))); //
_IntervalCount = (Integer)(HELPER_IntervalCount.fromObject (_IntervalCount, tl_payment_planPSet.getAttrib (FIELD_IntervalCount))); //
_TrialPeriodDays = (Integer)(HELPER_TrialPeriodDays.fromObject (_TrialPeriodDays, tl_payment_planPSet.getAttrib (FIELD_TrialPeriodDays))); //
_ActiveJobCount = (Integer)(HELPER_ActiveJobCount.fromObject (_ActiveJobCount, tl_payment_planPSet.getAttrib (FIELD_ActiveJobCount))); //
}
public void setAttributesFrom (BaseBusinessClass other, MultiException e)
{
super.setAttributesFrom (other, e);
if (other instanceof PaymentPlan)
{
PaymentPlan otherPaymentPlan = (PaymentPlan)other;
try
{
setStripeReference (otherPaymentPlan.getStripeReference ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setPlanName (otherPaymentPlan.getPlanName ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setDescription (otherPaymentPlan.getDescription ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setCurrencyType (otherPaymentPlan.getCurrencyType ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setAmount (otherPaymentPlan.getAmount ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setInterval (otherPaymentPlan.getInterval ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setIntervalCount (otherPaymentPlan.getIntervalCount ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setTrialPeriodDays (otherPaymentPlan.getTrialPeriodDays ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setActiveJobCount (otherPaymentPlan.getActiveJobCount ());
}
catch (FieldException ex)
{
e.addException (ex);
}
}
}
/**
* Set the attributes in this to copies of the attributes in source.
*/
public void copyAttributesFrom (BaseBusinessClass source)
{
super.copyAttributesFrom (source);
if (source instanceof BasePaymentPlan)
{
BasePaymentPlan sourcePaymentPlan = (BasePaymentPlan)(source);
_StripeReference = sourcePaymentPlan._StripeReference;
_PlanName = sourcePaymentPlan._PlanName;
_Description = sourcePaymentPlan._Description;
_CurrencyType = sourcePaymentPlan._CurrencyType;
_Amount = sourcePaymentPlan._Amount;
_Interval = sourcePaymentPlan._Interval;
_IntervalCount = sourcePaymentPlan._IntervalCount;
_TrialPeriodDays = sourcePaymentPlan._TrialPeriodDays;
_ActiveJobCount = sourcePaymentPlan._ActiveJobCount;
}
}
/**
* Set the associations in this to copies of the attributes in source.
*/
public void copySingleAssociationsFrom (BaseBusinessClass source, boolean linkToGhosts)
{
super.copySingleAssociationsFrom (source, linkToGhosts);
if (source instanceof BasePaymentPlan)
{
BasePaymentPlan sourcePaymentPlan = (BasePaymentPlan)(source);
}
}
/**
* Set the associations in this to copies of the attributes in source.
*/
public void copyAssociationsFrom (BaseBusinessClass source, boolean linkToGhosts)
{
super.copyAssociationsFrom (source, linkToGhosts);
if (source instanceof BasePaymentPlan)
{
BasePaymentPlan sourcePaymentPlan = (BasePaymentPlan)(source);
}
}
public void validate (ValidationContext context)
{
super.validate (context);
}
/**
* Subclasses must override this to read in their attributes
*/
protected void readExternalData(Map<String, Object> vals) throws IOException, ClassNotFoundException
{
super.readExternalData(vals);
_StripeReference = (String)(HELPER_StripeReference.readExternal (_StripeReference, vals.get(FIELD_StripeReference))); //
_PlanName = (String)(HELPER_PlanName.readExternal (_PlanName, vals.get(FIELD_PlanName))); //
_Description = (String)(HELPER_Description.readExternal (_Description, vals.get(FIELD_Description))); //
_CurrencyType = (CurrencyType)(HELPER_CurrencyType.readExternal (_CurrencyType, vals.get(FIELD_CurrencyType))); //
_Amount = (Double)(HELPER_Amount.readExternal (_Amount, vals.get(FIELD_Amount))); //
_Interval = (Interval)(HELPER_Interval.readExternal (_Interval, vals.get(FIELD_Interval))); //
_IntervalCount = (Integer)(HELPER_IntervalCount.readExternal (_IntervalCount, vals.get(FIELD_IntervalCount))); //
_TrialPeriodDays = (Integer)(HELPER_TrialPeriodDays.readExternal (_TrialPeriodDays, vals.get(FIELD_TrialPeriodDays))); //
_ActiveJobCount = (Integer)(HELPER_ActiveJobCount.readExternal (_ActiveJobCount, vals.get(FIELD_ActiveJobCount))); //
}
/**
* Subclasses must override this to write out their attributes
*/
protected void writeExternalData(Map<String, Object> vals) throws IOException
{
super.writeExternalData(vals);
vals.put (FIELD_StripeReference, HELPER_StripeReference.writeExternal (_StripeReference));
vals.put (FIELD_PlanName, HELPER_PlanName.writeExternal (_PlanName));
vals.put (FIELD_Description, HELPER_Description.writeExternal (_Description));
vals.put (FIELD_CurrencyType, HELPER_CurrencyType.writeExternal (_CurrencyType));
vals.put (FIELD_Amount, HELPER_Amount.writeExternal (_Amount));
vals.put (FIELD_Interval, HELPER_Interval.writeExternal (_Interval));
vals.put (FIELD_IntervalCount, HELPER_IntervalCount.writeExternal (_IntervalCount));
vals.put (FIELD_TrialPeriodDays, HELPER_TrialPeriodDays.writeExternal (_TrialPeriodDays));
vals.put (FIELD_ActiveJobCount, HELPER_ActiveJobCount.writeExternal (_ActiveJobCount));
}
public void compare (BaseBusinessClass other, AttributeChangeListener listener) throws StorageException
{
super.compare (other, listener);
if (other instanceof BasePaymentPlan)
{
BasePaymentPlan otherPaymentPlan = (BasePaymentPlan)(other);
if (!HELPER_StripeReference.compare(this._StripeReference, otherPaymentPlan._StripeReference))
{
listener.notifyFieldChange(this, other, FIELD_StripeReference, HELPER_StripeReference.toObject(this._StripeReference), HELPER_StripeReference.toObject(otherPaymentPlan._StripeReference));
}
if (!HELPER_PlanName.compare(this._PlanName, otherPaymentPlan._PlanName))
{
listener.notifyFieldChange(this, other, FIELD_PlanName, HELPER_PlanName.toObject(this._PlanName), HELPER_PlanName.toObject(otherPaymentPlan._PlanName));
}
if (!HELPER_Description.compare(this._Description, otherPaymentPlan._Description))
{
listener.notifyFieldChange(this, other, FIELD_Description, HELPER_Description.toObject(this._Description), HELPER_Description.toObject(otherPaymentPlan._Description));
}
if (!HELPER_CurrencyType.compare(this._CurrencyType, otherPaymentPlan._CurrencyType))
{
listener.notifyFieldChange(this, other, FIELD_CurrencyType, HELPER_CurrencyType.toObject(this._CurrencyType), HELPER_CurrencyType.toObject(otherPaymentPlan._CurrencyType));
}
if (!HELPER_Amount.compare(this._Amount, otherPaymentPlan._Amount))
{
listener.notifyFieldChange(this, other, FIELD_Amount, HELPER_Amount.toObject(this._Amount), HELPER_Amount.toObject(otherPaymentPlan._Amount));
}
if (!HELPER_Interval.compare(this._Interval, otherPaymentPlan._Interval))
{
listener.notifyFieldChange(this, other, FIELD_Interval, HELPER_Interval.toObject(this._Interval), HELPER_Interval.toObject(otherPaymentPlan._Interval));
}
if (!HELPER_IntervalCount.compare(this._IntervalCount, otherPaymentPlan._IntervalCount))
{
listener.notifyFieldChange(this, other, FIELD_IntervalCount, HELPER_IntervalCount.toObject(this._IntervalCount), HELPER_IntervalCount.toObject(otherPaymentPlan._IntervalCount));
}
if (!HELPER_TrialPeriodDays.compare(this._TrialPeriodDays, otherPaymentPlan._TrialPeriodDays))
{
listener.notifyFieldChange(this, other, FIELD_TrialPeriodDays, HELPER_TrialPeriodDays.toObject(this._TrialPeriodDays), HELPER_TrialPeriodDays.toObject(otherPaymentPlan._TrialPeriodDays));
}
if (!HELPER_ActiveJobCount.compare(this._ActiveJobCount, otherPaymentPlan._ActiveJobCount))
{
listener.notifyFieldChange(this, other, FIELD_ActiveJobCount, HELPER_ActiveJobCount.toObject(this._ActiveJobCount), HELPER_ActiveJobCount.toObject(otherPaymentPlan._ActiveJobCount));
}
// Compare single assocs
// Compare multiple assocs
}
}
public void visitTransients (AttributeVisitor visitor) throws StorageException
{
super.visitAttributes (visitor);
}
public void visitAttributes (AttributeVisitor visitor) throws StorageException
{
super.visitAttributes (visitor);
visitor.visitField(this, FIELD_StripeReference, HELPER_StripeReference.toObject(getStripeReference()));
visitor.visitField(this, FIELD_PlanName, HELPER_PlanName.toObject(getPlanName()));
visitor.visitField(this, FIELD_Description, HELPER_Description.toObject(getDescription()));
visitor.visitField(this, FIELD_CurrencyType, HELPER_CurrencyType.toObject(getCurrencyType()));
visitor.visitField(this, FIELD_Amount, HELPER_Amount.toObject(getAmount()));
visitor.visitField(this, FIELD_Interval, HELPER_Interval.toObject(getInterval()));
visitor.visitField(this, FIELD_IntervalCount, HELPER_IntervalCount.toObject(getIntervalCount()));
visitor.visitField(this, FIELD_TrialPeriodDays, HELPER_TrialPeriodDays.toObject(getTrialPeriodDays()));
visitor.visitField(this, FIELD_ActiveJobCount, HELPER_ActiveJobCount.toObject(getActiveJobCount()));
}
public void visitAssociations (AssociationVisitor visitor, AssociatedScope scope) throws StorageException
{
super.visitAssociations (visitor, scope);
}
public static PaymentPlan createPaymentPlan (ObjectTransaction transaction) throws StorageException
{
PaymentPlan result = new PaymentPlan ();
result.initialiseNewObject (transaction);
return result;
}
public static PaymentPlan getPaymentPlanByID (ObjectTransaction transaction, Long objectID) throws StorageException
{
return (PaymentPlan)(transaction.getObjectByID (REFERENCE_PaymentPlan, objectID));
}
public boolean testFilter (String attribName, QueryFilter filter) throws StorageException
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_StripeReference))
{
return filter.matches (getStripeReference ());
}
else if (attribName.equals (FIELD_PlanName))
{
return filter.matches (getPlanName ());
}
else if (attribName.equals (FIELD_Description))
{
return filter.matches (getDescription ());
}
else if (attribName.equals (FIELD_CurrencyType))
{
return filter.matches (getCurrencyType ());
}
else if (attribName.equals (FIELD_Amount))
{
return filter.matches (getAmount ());
}
else if (attribName.equals (FIELD_Interval))
{
return filter.matches (getInterval ());
}
else if (attribName.equals (FIELD_IntervalCount))
{
return filter.matches (getIntervalCount ());
}
else if (attribName.equals (FIELD_TrialPeriodDays))
{
return filter.matches (getTrialPeriodDays ());
}
else if (attribName.equals (FIELD_ActiveJobCount))
{
return filter.matches (getActiveJobCount ());
}
else
{
return super.testFilter (attribName, filter);
}
}
public static SearchAll SearchByAll () { return new SearchAll (); }
public static class SearchAll extends SearchObject<PaymentPlan>
{
public SearchAll andObjectID (QueryFilter<Long> filter)
{
filter.addFilter (context, "tl_payment_plan.object_id", FIELD_ObjectID);
return this;
}
public SearchAll andObjectCreated (QueryFilter<Date> filter)
{
filter.addFilter (context, "tl_payment_plan.object_created_date", FIELD_ObjectCreated);
return this;
}
public SearchAll andObjectLastModified (QueryFilter<Date> filter)
{
filter.addFilter (context, "tl_payment_plan.object_last_updated_date", FIELD_ObjectLastModified);
return this;
}
public SearchAll andStripeReference (QueryFilter<String> filter)
{
filter.addFilter (context, "tl_payment_plan.stripe_reference", "StripeReference");
return this;
}
public SearchAll andPlanName (QueryFilter<String> filter)
{
filter.addFilter (context, "tl_payment_plan.plan_name", "PlanName");
return this;
}
public SearchAll andDescription (QueryFilter<String> filter)
{
filter.addFilter (context, "tl_payment_plan.description", "Description");
return this;
}
public SearchAll andCurrencyType (QueryFilter<CurrencyType> filter)
{
filter.addFilter (context, "tl_payment_plan.currency_type", "CurrencyType");
return this;
}
public SearchAll andAmount (QueryFilter<Double> filter)
{
filter.addFilter (context, "tl_payment_plan.amount", "Amount");
return this;
}
public SearchAll andInterval (QueryFilter<Interval> filter)
{
filter.addFilter (context, "tl_payment_plan.interval", "Interval");
return this;
}
public SearchAll andIntervalCount (QueryFilter<Integer> filter)
{
filter.addFilter (context, "tl_payment_plan.interval_count", "IntervalCount");
return this;
}
public SearchAll andTrialPeriodDays (QueryFilter<Integer> filter)
{
filter.addFilter (context, "tl_payment_plan.trial_period_days", "TrialPeriodDays");
return this;
}
public SearchAll andActiveJobCount (QueryFilter<Integer> filter)
{
filter.addFilter (context, "tl_payment_plan.active_job_count", "ActiveJobCount");
return this;
}
public PaymentPlan[]
search (ObjectTransaction transaction) throws StorageException
{
BaseBusinessClass[] results = super.search (transaction, REFERENCE_PaymentPlan, SEARCH_All, criteria);
Set<PaymentPlan> typedResults = new LinkedHashSet <PaymentPlan> ();
for (BaseBusinessClass bbcResult : results)
{
PaymentPlan aResult = (PaymentPlan)bbcResult;
typedResults.add (aResult);
}
return ObjstoreUtils.removeDeleted(transaction, typedResults).toArray (new PaymentPlan[0]);
}
}
public static PaymentPlan[]
searchAll (ObjectTransaction transaction) throws StorageException
{
return SearchByAll ()
.search (transaction);
}
public static SearchMax SearchByMax () { return new SearchMax (); }
public static class SearchMax extends SearchObject<PaymentPlan>
{
public SearchMax andObjectID (QueryFilter<Long> filter)
{
filter.addFilter (context, "tl_payment_plan.object_id", FIELD_ObjectID);
return this;
}
public SearchMax andObjectCreated (QueryFilter<Date> filter)
{
filter.addFilter (context, "tl_payment_plan.object_created_date", FIELD_ObjectCreated);
return this;
}
public SearchMax andObjectLastModified (QueryFilter<Date> filter)
{
filter.addFilter (context, "tl_payment_plan.object_last_updated_date", FIELD_ObjectLastModified);
return this;
}
public SearchMax andStripeReference (QueryFilter<String> filter)
{
filter.addFilter (context, "tl_payment_plan.stripe_reference", "StripeReference");
return this;
}
public SearchMax andPlanName (QueryFilter<String> filter)
{
filter.addFilter (context, "tl_payment_plan.plan_name", "PlanName");
return this;
}
public SearchMax andDescription (QueryFilter<String> filter)
{
filter.addFilter (context, "tl_payment_plan.description", "Description");
return this;
}
public SearchMax andCurrencyType (QueryFilter<CurrencyType> filter)
{
filter.addFilter (context, "tl_payment_plan.currency_type", "CurrencyType");
return this;
}
public SearchMax andAmount (QueryFilter<Double> filter)
{
filter.addFilter (context, "tl_payment_plan.amount", "Amount");
return this;
}
public SearchMax andInterval (QueryFilter<Interval> filter)
{
filter.addFilter (context, "tl_payment_plan.interval", "Interval");
return this;
}
public SearchMax andIntervalCount (QueryFilter<Integer> filter)
{
filter.addFilter (context, "tl_payment_plan.interval_count", "IntervalCount");
return this;
}
public SearchMax andTrialPeriodDays (QueryFilter<Integer> filter)
{
filter.addFilter (context, "tl_payment_plan.trial_period_days", "TrialPeriodDays");
return this;
}
public SearchMax andActiveJobCount (QueryFilter<Integer> filter)
{
filter.addFilter (context, "tl_payment_plan.active_job_count", "ActiveJobCount");
return this;
}
public PaymentPlan search (ObjectTransaction transaction) throws StorageException
{
BaseBusinessClass[] results = super.search (transaction, REFERENCE_PaymentPlan, SEARCH_Max, criteria);
Set<PaymentPlan> typedResults = new LinkedHashSet <PaymentPlan> ();
for (BaseBusinessClass bbcResult : results)
{
PaymentPlan aResult = (PaymentPlan)bbcResult;
typedResults.add (aResult);
}
return (PaymentPlan)singletonResult(ObjstoreUtils.removeDeleted(transaction, typedResults).toArray(new BaseBusinessClass[0]), "PaymentPlan", "");
}
}
public static PaymentPlan searchMax (ObjectTransaction transaction) throws StorageException
{
return SearchByMax ()
.search (transaction);
}
public Object getAttribute (String attribName)
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_StripeReference))
{
return HELPER_StripeReference.toObject (getStripeReference ());
}
else if (attribName.equals (FIELD_PlanName))
{
return HELPER_PlanName.toObject (getPlanName ());
}
else if (attribName.equals (FIELD_Description))
{
return HELPER_Description.toObject (getDescription ());
}
else if (attribName.equals (FIELD_CurrencyType))
{
return HELPER_CurrencyType.toObject (getCurrencyType ());
}
else if (attribName.equals (FIELD_Amount))
{
return HELPER_Amount.toObject (getAmount ());
}
else if (attribName.equals (FIELD_Interval))
{
return HELPER_Interval.toObject (getInterval ());
}
else if (attribName.equals (FIELD_IntervalCount))
{
return HELPER_IntervalCount.toObject (getIntervalCount ());
}
else if (attribName.equals (FIELD_TrialPeriodDays))
{
return HELPER_TrialPeriodDays.toObject (getTrialPeriodDays ());
}
else if (attribName.equals (FIELD_ActiveJobCount))
{
return HELPER_ActiveJobCount.toObject (getActiveJobCount ());
}
else
{
return super.getAttribute (attribName);
}
}
public AttributeHelper getAttributeHelper (String attribName)
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_StripeReference))
{
return HELPER_StripeReference;
}
else if (attribName.equals (FIELD_PlanName))
{
return HELPER_PlanName;
}
else if (attribName.equals (FIELD_Description))
{
return HELPER_Description;
}
else if (attribName.equals (FIELD_CurrencyType))
{
return HELPER_CurrencyType;
}
else if (attribName.equals (FIELD_Amount))
{
return HELPER_Amount;
}
else if (attribName.equals (FIELD_Interval))
{
return HELPER_Interval;
}
else if (attribName.equals (FIELD_IntervalCount))
{
return HELPER_IntervalCount;
}
else if (attribName.equals (FIELD_TrialPeriodDays))
{
return HELPER_TrialPeriodDays;
}
else if (attribName.equals (FIELD_ActiveJobCount))
{
return HELPER_ActiveJobCount;
}
else
{
return super.getAttributeHelper (attribName);
}
}
public void setAttribute (String attribName, Object attribValue) throws FieldException
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_StripeReference))
{
setStripeReference ((String)(HELPER_StripeReference.fromObject (_StripeReference, attribValue)));
}
else if (attribName.equals (FIELD_PlanName))
{
setPlanName ((String)(HELPER_PlanName.fromObject (_PlanName, attribValue)));
}
else if (attribName.equals (FIELD_Description))
{
setDescription ((String)(HELPER_Description.fromObject (_Description, attribValue)));
}
else if (attribName.equals (FIELD_CurrencyType))
{
setCurrencyType ((CurrencyType)(HELPER_CurrencyType.fromObject (_CurrencyType, attribValue)));
}
else if (attribName.equals (FIELD_Amount))
{
setAmount ((Double)(HELPER_Amount.fromObject (_Amount, attribValue)));
}
else if (attribName.equals (FIELD_Interval))
{
setInterval ((Interval)(HELPER_Interval.fromObject (_Interval, attribValue)));
}
else if (attribName.equals (FIELD_IntervalCount))
{
setIntervalCount ((Integer)(HELPER_IntervalCount.fromObject (_IntervalCount, attribValue)));
}
else if (attribName.equals (FIELD_TrialPeriodDays))
{
setTrialPeriodDays ((Integer)(HELPER_TrialPeriodDays.fromObject (_TrialPeriodDays, attribValue)));
}
else if (attribName.equals (FIELD_ActiveJobCount))
{
setActiveJobCount ((Integer)(HELPER_ActiveJobCount.fromObject (_ActiveJobCount, attribValue)));
}
else
{
super.setAttribute (attribName, attribValue);
}
}
public boolean isWriteable (String fieldName)
{
return getWriteable (fieldName) == FieldWriteability.TRUE;
}
public FieldWriteability getWriteable (String fieldName)
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (fieldName.equals (FIELD_StripeReference))
{
return getWriteability_StripeReference ();
}
else if (fieldName.equals (FIELD_PlanName))
{
return getWriteability_PlanName ();
}
else if (fieldName.equals (FIELD_Description))
{
return getWriteability_Description ();
}
else if (fieldName.equals (FIELD_CurrencyType))
{
return getWriteability_CurrencyType ();
}
else if (fieldName.equals (FIELD_Amount))
{
return getWriteability_Amount ();
}
else if (fieldName.equals (FIELD_Interval))
{
return getWriteability_Interval ();
}
else if (fieldName.equals (FIELD_IntervalCount))
{
return getWriteability_IntervalCount ();
}
else if (fieldName.equals (FIELD_TrialPeriodDays))
{
return getWriteability_TrialPeriodDays ();
}
else if (fieldName.equals (FIELD_ActiveJobCount))
{
return getWriteability_ActiveJobCount ();
}
else
{
return super.getWriteable (fieldName);
}
}
public void putUnwriteable (Set<String> fields)
{
if (getWriteability_StripeReference () != FieldWriteability.TRUE)
{
fields.add (FIELD_StripeReference);
}
if (getWriteability_PlanName () != FieldWriteability.TRUE)
{
fields.add (FIELD_PlanName);
}
if (getWriteability_Description () != FieldWriteability.TRUE)
{
fields.add (FIELD_Description);
}
if (getWriteability_CurrencyType () != FieldWriteability.TRUE)
{
fields.add (FIELD_CurrencyType);
}
if (getWriteability_Amount () != FieldWriteability.TRUE)
{
fields.add (FIELD_Amount);
}
if (getWriteability_Interval () != FieldWriteability.TRUE)
{
fields.add (FIELD_Interval);
}
if (getWriteability_IntervalCount () != FieldWriteability.TRUE)
{
fields.add (FIELD_IntervalCount);
}
if (getWriteability_TrialPeriodDays () != FieldWriteability.TRUE)
{
fields.add (FIELD_TrialPeriodDays);
}
if (getWriteability_ActiveJobCount () != FieldWriteability.TRUE)
{
fields.add (FIELD_ActiveJobCount);
}
super.putUnwriteable (fields);
}
public List<AbstractAttribute> getAttributes ()
{
List result = super.getAttributes ();
result.add(HELPER_StripeReference.getAttribObject (getClass (), _StripeReference, true, FIELD_StripeReference));
result.add(HELPER_PlanName.getAttribObject (getClass (), _PlanName, false, FIELD_PlanName));
result.add(HELPER_Description.getAttribObject (getClass (), _Description, false, FIELD_Description));
result.add(HELPER_CurrencyType.getAttribObject (getClass (), _CurrencyType, true, FIELD_CurrencyType));
result.add(HELPER_Amount.getAttribObject (getClass (), _Amount, true, FIELD_Amount));
result.add(HELPER_Interval.getAttribObject (getClass (), _Interval, true, FIELD_Interval));
result.add(HELPER_IntervalCount.getAttribObject (getClass (), _IntervalCount, true, FIELD_IntervalCount));
result.add(HELPER_TrialPeriodDays.getAttribObject (getClass (), _TrialPeriodDays, false, FIELD_TrialPeriodDays));
result.add(HELPER_ActiveJobCount.getAttribObject (getClass (), _ActiveJobCount, false, FIELD_ActiveJobCount));
return result;
}
public Map getAttributeMetadata (String attribute)
{
if (ATTRIBUTES_METADATA_PaymentPlan.containsKey (attribute))
{
return (Map)ATTRIBUTES_METADATA_PaymentPlan.get (attribute);
}
else
{
return super.getAttributeMetadata (attribute);
}
}
public Object getAttributeMetadata (String attribute, String metadata)
{
if (ATTRIBUTES_METADATA_PaymentPlan.containsKey (attribute))
{
return ((Map)ATTRIBUTES_METADATA_PaymentPlan.get (attribute)).get(metadata);
}
else
{
return super.getAttributeMetadata (attribute, metadata);
}
}
public void preCommit (boolean willBeStored) throws Exception
{
super.preCommit(willBeStored);
if(willBeStored)
{
}
}
public oneit.servlets.objstore.binary.BinaryContentHandler getBinaryContentHandler(String attribName)
{
return super.getBinaryContentHandler(attribName);
}
public static class PaymentPlanBehaviourDecorator extends BaseBusinessClass.BBCBehaviourDecorator<PaymentPlan>
{
/**
* Get the attribute StripeReference
*/
public String getStripeReference (PaymentPlan obj, String original)
{
return original;
}
/**
* Change the value set for attribute StripeReference.
* May modify the field beforehand
* Occurs before validation.
*/
public String setStripeReference (PaymentPlan obj, String newStripeReference) throws FieldException
{
return newStripeReference;
}
/**
* Get the attribute PlanName
*/
public String getPlanName (PaymentPlan obj, String original)
{
return original;
}
/**
* Change the value set for attribute PlanName.
* May modify the field beforehand
* Occurs before validation.
*/
public String setPlanName (PaymentPlan obj, String newPlanName) throws FieldException
{
return newPlanName;
}
/**
* Get the attribute Description
*/
public String getDescription (PaymentPlan obj, String original)
{
return original;
}
/**
* Change the value set for attribute Description.
* May modify the field beforehand
* Occurs before validation.
*/
public String setDescription (PaymentPlan obj, String newDescription) throws FieldException
{
return newDescription;
}
/**
* Get the attribute CurrencyType
*/
public CurrencyType getCurrencyType (PaymentPlan obj, CurrencyType original)
{
return original;
}
/**
* Change the value set for attribute CurrencyType.
* May modify the field beforehand
* Occurs before validation.
*/
public CurrencyType setCurrencyType (PaymentPlan obj, CurrencyType newCurrencyType) throws FieldException
{
return newCurrencyType;
}
/**
* Get the attribute Amount
*/
public Double getAmount (PaymentPlan obj, Double original)
{
return original;
}
/**
* Change the value set for attribute Amount.
* May modify the field beforehand
* Occurs before validation.
*/
public Double setAmount (PaymentPlan obj, Double newAmount) throws FieldException
{
return newAmount;
}
/**
* Get the attribute Interval
*/
public Interval getInterval (PaymentPlan obj, Interval original)
{
return original;
}
/**
* Change the value set for attribute Interval.
* May modify the field beforehand
* Occurs before validation.
*/
public Interval setInterval (PaymentPlan obj, Interval newInterval) throws FieldException
{
return newInterval;
}
/**
* Get the attribute IntervalCount
*/
public Integer getIntervalCount (PaymentPlan obj, Integer original)
{
return original;
}
/**
* Change the value set for attribute IntervalCount.
* May modify the field beforehand
* Occurs before validation.
*/
public Integer setIntervalCount (PaymentPlan obj, Integer newIntervalCount) throws FieldException
{
return newIntervalCount;
}
/**
* Get the attribute TrialPeriodDays
*/
public Integer getTrialPeriodDays (PaymentPlan obj, Integer original)
{
return original;
}
/**
* Change the value set for attribute TrialPeriodDays.
* May modify the field beforehand
* Occurs before validation.
*/
public Integer setTrialPeriodDays (PaymentPlan obj, Integer newTrialPeriodDays) throws FieldException
{
return newTrialPeriodDays;
}
/**
* Get the attribute ActiveJobCount
*/
public Integer getActiveJobCount (PaymentPlan obj, Integer original)
{
return original;
}
/**
* Change the value set for attribute ActiveJobCount.
* May modify the field beforehand
* Occurs before validation.
*/
public Integer setActiveJobCount (PaymentPlan obj, Integer newActiveJobCount) throws FieldException
{
return newActiveJobCount;
}
}
public ORMPipeLine pipes()
{
return new PaymentPlanPipeLineFactory<PaymentPlan, PaymentPlan> ((PaymentPlan)this);
}
/**
* Use this instead of pipes() to get rid of type casting.
*/
public PaymentPlanPipeLineFactory<PaymentPlan, PaymentPlan> pipelinePaymentPlan()
{
return (PaymentPlanPipeLineFactory<PaymentPlan, PaymentPlan>) pipes();
}
public static PaymentPlanPipeLineFactory<PaymentPlan, PaymentPlan> pipesPaymentPlan(Collection<PaymentPlan> items)
{
return REFERENCE_PaymentPlan.new PaymentPlanPipeLineFactory<PaymentPlan, PaymentPlan> (items);
}
public static PaymentPlanPipeLineFactory<PaymentPlan, PaymentPlan> pipesPaymentPlan(PaymentPlan[] _items)
{
return pipesPaymentPlan(Arrays.asList (_items));
}
public static PaymentPlanPipeLineFactory<PaymentPlan, PaymentPlan> pipesPaymentPlan()
{
return pipesPaymentPlan((Collection)null);
}
public class PaymentPlanPipeLineFactory<From extends BaseBusinessClass, Me extends PaymentPlan> extends BaseBusinessClass.ORMPipeLine<From, Me>
{
public <Prev> PaymentPlanPipeLineFactory (PipeLine<From, Prev> pipeLine, Pipe<Prev, Me> nextPipe)
{
super (pipeLine, nextPipe);
}
public PaymentPlanPipeLineFactory (From seed)
{
super(seed);
}
public PaymentPlanPipeLineFactory (Collection<From> seed)
{
super(seed);
}
public PipeLine<From, ? extends Object> to(String name)
{
if (name.equals ("StripeReference"))
{
return toStripeReference ();
}
if (name.equals ("PlanName"))
{
return toPlanName ();
}
if (name.equals ("Description"))
{
return toDescription ();
}
if (name.equals ("CurrencyType"))
{
return toCurrencyType ();
}
if (name.equals ("Amount"))
{
return toAmount ();
}
if (name.equals ("Interval"))
{
return toInterval ();
}
if (name.equals ("IntervalCount"))
{
return toIntervalCount ();
}
if (name.equals ("TrialPeriodDays"))
{
return toTrialPeriodDays ();
}
if (name.equals ("ActiveJobCount"))
{
return toActiveJobCount ();
}
return super.to(name);
}
public PipeLine<From, String> toStripeReference () { return pipe(new ORMAttributePipe<Me, String>(FIELD_StripeReference)); }
public PipeLine<From, String> toPlanName () { return pipe(new ORMAttributePipe<Me, String>(FIELD_PlanName)); }
public PipeLine<From, String> toDescription () { return pipe(new ORMAttributePipe<Me, String>(FIELD_Description)); }
public PipeLine<From, CurrencyType> toCurrencyType () { return pipe(new ORMAttributePipe<Me, CurrencyType>(FIELD_CurrencyType)); }
public PipeLine<From, Double> toAmount () { return pipe(new ORMAttributePipe<Me, Double>(FIELD_Amount)); }
public PipeLine<From, Interval> toInterval () { return pipe(new ORMAttributePipe<Me, Interval>(FIELD_Interval)); }
public PipeLine<From, Integer> toIntervalCount () { return pipe(new ORMAttributePipe<Me, Integer>(FIELD_IntervalCount)); }
public PipeLine<From, Integer> toTrialPeriodDays () { return pipe(new ORMAttributePipe<Me, Integer>(FIELD_TrialPeriodDays)); }
public PipeLine<From, Integer> toActiveJobCount () { return pipe(new ORMAttributePipe<Me, Integer>(FIELD_ActiveJobCount)); }
}
public boolean isTransientAttrib(String attribName)
{
return super.isTransientAttrib(attribName);
}
public boolean isTransientSingleReference(String assocName)
{
return super.isTransientSingleReference(assocName);
}
}
class DummyPaymentPlan extends PaymentPlan
{
// Default constructor primarily to support Externalisable
public DummyPaymentPlan()
{
super();
}
public void assertValid ()
{
}
}
package performa.orm;
import com.stripe.model.Card;
import oneit.logging.LoggingArea;
import oneit.objstore.ObjectStatus;
import oneit.objstore.ValidationContext;
import oneit.objstore.rdbms.filters.EqualsFilter;
import oneit.security.SecUser;
import oneit.utils.CollectionUtils;
import oneit.utils.StringUtils;
import oneit.utils.math.NullArith;
import oneit.utils.parsers.FieldException;
import performa.orm.types.JobStatus;
import performa.utils.StripeUtils;
import performa.utils.Utils;
public class Company extends BaseCompany
......@@ -73,4 +79,151 @@ public class Company extends BaseCompany
{
return StringUtils.subNulls(getCompanyName(), super.getToString());
}
public PaymentPlan getSelectedPaymentPlan()
{
if(getPaymentJobCount() != null)
{
PaymentPlan maxPlan = Utils.getMaximumPaymentPlan(getTransaction());
if(maxPlan!=null && getPaymentJobCount()>=maxPlan.getActiveJobCount())
{
return maxPlan;
}
PaymentPlan[] plans = PaymentPlan.SearchByAll()
.andActiveJobCount(new EqualsFilter<>(getPaymentJobCount()))
.search(getTransaction());
if(plans.length > 0)
{
return plans[0];
}
}
return null;
}
public Double getPaymentPlanAmount()
{
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 selectedPaymentPlan.getPerMonthSaveAmount();
}
return null;
}
public boolean canCreateJob()
{
return getPaymentPlan() != null && getPaymentPlan().getActiveJobCount() > getUsedCredits();
}
@Override
public Integer getUsedCredits()
{
return super.getUsedCredits() != null ? super.getUsedCredits() : 0;
}
public Job[] getOpenJobs()
{
return Job.SearchByCompany()
.andJobStatus(new EqualsFilter<>(JobStatus.OPEN))
.byCompany(this)
.search(getTransaction());
}
public Integer getOpenJobsCount()
{
return getOpenJobs().length;
}
public Card getCard() throws FieldException
{
return StripeUtils.retrieveCard(this);
}
public String getCardNumber() throws FieldException
{
if(getStripeLast4() == null)
{
Card card = StripeUtils.retrieveCard(this);
if(card != null)
{
setStripeLast4(card.getLast4());
setStripeBrand(card.getBrand());
return "xxxx-xxxx-xxxx-" + getStripeLast4();
}
else
{
return "";
}
}
return "xxxx-xxxx-xxxx-" + getStripeLast4();
}
public String getExpiry () throws FieldException
{
Card card = StripeUtils.retrieveCard(this);
return card != null ? String.format("%02d", card.getExpMonth()) + " / " + (card.getExpYear() % 100) : "";
}
public Boolean isSubscriptionChanged()
{
PaymentPlan selectedPaymentPlan = getSelectedPaymentPlan();
if(selectedPaymentPlan!=null)
{
Company earliestBackup = (Company) getEarliestBackup();
if(!CollectionUtils.equals(earliestBackup.getPaymentPlan(), selectedPaymentPlan))
{
return Boolean.TRUE;
}
}
return Boolean.FALSE;
}
}
\ No newline at end of file
......@@ -17,6 +17,9 @@
<TRANSIENT name="RoleType" type="RoleType" defaultValue="RoleType.STANDARD" attribHelper="EnumeratedAttributeHelper"/>
<TRANSIENT name="IsLogoDeleted" type="Boolean" defaultValue="Boolean.FALSE"/>
<TRANSIENT name="CompletedProfile" type="Boolean" defaultValue="Boolean.FALSE"/>
<TRANSIENT name="PaymentJobCount" type="Integer"/>
<TRANSIENT name="StripeLast4" type="String" />
<TRANSIENT name="StripeBrand" type="String" />
<TABLE name="tl_company" tablePrefix="object">
......@@ -31,10 +34,16 @@
<ATTRIB name="PostCode" type="String" dbcol="post_code" mandatory="false" length="10"/>
<ATTRIB name="City" type="String" dbcol="city" mandatory="false" length="100"/>
<ATTRIB name="HasClientSupport" type="Boolean" dbcol="has_client_support" mandatory="false" defaultValue="Boolean.FALSE"/>
<ATTRIB name="StripeReference" type="String" dbcol="stripe_reference" length="100"/>
<ATTRIB name="StripeSubscription" type="String" dbcol="stripe_subscription" length="100"/>
<SINGLEREFERENCE name="AddedByUser" type="CompanyUser" dbcol="added_by_user_id" mandatory="true"/>
<ATTRIB name="StripeReference" type="String" dbcol="stripe_reference" length="100" />
<ATTRIB name="StripeSubscription" type="String" dbcol="stripe_subscription" length="100" />
<ATTRIB name="NameOnCard" type="String" dbcol="name_on_card" length="100" />
<ATTRIB name="CardPostCode" type="String" dbcol="card_post_code" length="10" />
<ATTRIB name="CardID" type="String" dbcol="card_id" length="100" />
<ATTRIB name="PlanRenewedOn" type="Date" dbcol="plan_renewed_on" mandatory="false" />
<ATTRIB name="UsedCredits" type="Integer" dbcol="used_credits" />
<SINGLEREFERENCE name="AddedByUser" type="CompanyUser" dbcol="added_by_user_id" mandatory="true" />
<SINGLEREFERENCE name="PaymentPlan" type="PaymentPlan" dbcol="payment_plan_id" mandatory="false" />
</TABLE>
......
......@@ -42,6 +42,11 @@ public class CompanyPersistenceMgr extends ObjectPersistenceMgr
private Boolean dummyHasClientSupport;
private String dummyStripeReference;
private String dummyStripeSubscription;
private String dummyNameOnCard;
private String dummyCardPostCode;
private String dummyCardID;
private Date dummyPlanRenewedOn;
private Integer dummyUsedCredits;
// Static constants corresponding to attribute helpers
......@@ -58,6 +63,11 @@ public class CompanyPersistenceMgr extends ObjectPersistenceMgr
private static final DefaultAttributeHelper HELPER_HasClientSupport = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_StripeReference = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_StripeSubscription = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_NameOnCard = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_CardPostCode = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_CardID = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_PlanRenewedOn = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_UsedCredits = DefaultAttributeHelper.INSTANCE;
......@@ -77,10 +87,15 @@ public class CompanyPersistenceMgr extends ObjectPersistenceMgr
dummyHasClientSupport = (Boolean)(HELPER_HasClientSupport.initialise (dummyHasClientSupport));
dummyStripeReference = (String)(HELPER_StripeReference.initialise (dummyStripeReference));
dummyStripeSubscription = (String)(HELPER_StripeSubscription.initialise (dummyStripeSubscription));
dummyNameOnCard = (String)(HELPER_NameOnCard.initialise (dummyNameOnCard));
dummyCardPostCode = (String)(HELPER_CardPostCode.initialise (dummyCardPostCode));
dummyCardID = (String)(HELPER_CardID.initialise (dummyCardID));
dummyPlanRenewedOn = (Date)(HELPER_PlanRenewedOn.initialise (dummyPlanRenewedOn));
dummyUsedCredits = (Integer)(HELPER_UsedCredits.initialise (dummyUsedCredits));
}
private String SELECT_COLUMNS = "{PREFIX}tl_company.object_id as id, {PREFIX}tl_company.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_company.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_company.company_name, {PREFIX}tl_company.company_logo, {PREFIX}tl_company.hiring_team_type, {PREFIX}tl_company.industry, {PREFIX}tl_company.time_zone, {PREFIX}tl_company.is_verified, {PREFIX}tl_company.state, {PREFIX}tl_company.country, {PREFIX}tl_company.post_code, {PREFIX}tl_company.city, {PREFIX}tl_company.has_client_support, {PREFIX}tl_company.stripe_reference, {PREFIX}tl_company.stripe_subscription, {PREFIX}tl_company.added_by_user_id, 1 AS commasafe ";
private String SELECT_COLUMNS = "{PREFIX}tl_company.object_id as id, {PREFIX}tl_company.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_company.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_company.company_name, {PREFIX}tl_company.company_logo, {PREFIX}tl_company.hiring_team_type, {PREFIX}tl_company.industry, {PREFIX}tl_company.time_zone, {PREFIX}tl_company.is_verified, {PREFIX}tl_company.state, {PREFIX}tl_company.country, {PREFIX}tl_company.post_code, {PREFIX}tl_company.city, {PREFIX}tl_company.has_client_support, {PREFIX}tl_company.stripe_reference, {PREFIX}tl_company.stripe_subscription, {PREFIX}tl_company.name_on_card, {PREFIX}tl_company.card_post_code, {PREFIX}tl_company.card_id, {PREFIX}tl_company.plan_renewed_on, {PREFIX}tl_company.used_credits, {PREFIX}tl_company.added_by_user_id, {PREFIX}tl_company.payment_plan_id, 1 AS commasafe ";
private String SELECT_JOINS = "";
public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
......@@ -144,7 +159,13 @@ public class CompanyPersistenceMgr extends ObjectPersistenceMgr
!tl_companyPSet.containsAttrib(Company.FIELD_HasClientSupport)||
!tl_companyPSet.containsAttrib(Company.FIELD_StripeReference)||
!tl_companyPSet.containsAttrib(Company.FIELD_StripeSubscription)||
!tl_companyPSet.containsAttrib(Company.SINGLEREFERENCE_AddedByUser))
!tl_companyPSet.containsAttrib(Company.FIELD_NameOnCard)||
!tl_companyPSet.containsAttrib(Company.FIELD_CardPostCode)||
!tl_companyPSet.containsAttrib(Company.FIELD_CardID)||
!tl_companyPSet.containsAttrib(Company.FIELD_PlanRenewedOn)||
!tl_companyPSet.containsAttrib(Company.FIELD_UsedCredits)||
!tl_companyPSet.containsAttrib(Company.SINGLEREFERENCE_AddedByUser)||
!tl_companyPSet.containsAttrib(Company.SINGLEREFERENCE_PaymentPlan))
{
// We will need to retrieve it
idsToFetch.add (id.longValue());
......@@ -214,10 +235,10 @@ public class CompanyPersistenceMgr extends ObjectPersistenceMgr
{
int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}tl_company " +
"SET company_name = ?, company_logo = ?, hiring_team_type = ?, industry = ?, time_zone = ?, is_verified = ?, state = ?, country = ?, post_code = ?, city = ?, has_client_support = ?, stripe_reference = ?, stripe_subscription = ?, added_by_user_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"SET company_name = ?, company_logo = ?, hiring_team_type = ?, industry = ?, time_zone = ?, is_verified = ?, state = ?, country = ?, post_code = ?, city = ?, has_client_support = ?, stripe_reference = ?, stripe_subscription = ?, name_on_card = ?, card_post_code = ?, card_id = ?, plan_renewed_on = ?, used_credits = ?, added_by_user_id = ? , payment_plan_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE tl_company.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_CompanyName.getForSQL(dummyCompanyName, tl_companyPSet.getAttrib (Company.FIELD_CompanyName))).listEntry (HELPER_CompanyLogo.getForSQL(dummyCompanyLogo, tl_companyPSet.getAttrib (Company.FIELD_CompanyLogo))).listEntry (HELPER_HiringTeamType.getForSQL(dummyHiringTeamType, tl_companyPSet.getAttrib (Company.FIELD_HiringTeamType))).listEntry (HELPER_Industry.getForSQL(dummyIndustry, tl_companyPSet.getAttrib (Company.FIELD_Industry))).listEntry (HELPER_TimeZone.getForSQL(dummyTimeZone, tl_companyPSet.getAttrib (Company.FIELD_TimeZone))).listEntry (HELPER_IsVerified.getForSQL(dummyIsVerified, tl_companyPSet.getAttrib (Company.FIELD_IsVerified))).listEntry (HELPER_State.getForSQL(dummyState, tl_companyPSet.getAttrib (Company.FIELD_State))).listEntry (HELPER_Country.getForSQL(dummyCountry, tl_companyPSet.getAttrib (Company.FIELD_Country))).listEntry (HELPER_PostCode.getForSQL(dummyPostCode, tl_companyPSet.getAttrib (Company.FIELD_PostCode))).listEntry (HELPER_City.getForSQL(dummyCity, tl_companyPSet.getAttrib (Company.FIELD_City))).listEntry (HELPER_HasClientSupport.getForSQL(dummyHasClientSupport, tl_companyPSet.getAttrib (Company.FIELD_HasClientSupport))).listEntry (HELPER_StripeReference.getForSQL(dummyStripeReference, tl_companyPSet.getAttrib (Company.FIELD_StripeReference))).listEntry (HELPER_StripeSubscription.getForSQL(dummyStripeSubscription, tl_companyPSet.getAttrib (Company.FIELD_StripeSubscription))).listEntry (SQLManager.CheckNull((Long)(tl_companyPSet.getAttrib (Company.SINGLEREFERENCE_AddedByUser)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
CollectionUtils.listEntry (HELPER_CompanyName.getForSQL(dummyCompanyName, tl_companyPSet.getAttrib (Company.FIELD_CompanyName))).listEntry (HELPER_CompanyLogo.getForSQL(dummyCompanyLogo, tl_companyPSet.getAttrib (Company.FIELD_CompanyLogo))).listEntry (HELPER_HiringTeamType.getForSQL(dummyHiringTeamType, tl_companyPSet.getAttrib (Company.FIELD_HiringTeamType))).listEntry (HELPER_Industry.getForSQL(dummyIndustry, tl_companyPSet.getAttrib (Company.FIELD_Industry))).listEntry (HELPER_TimeZone.getForSQL(dummyTimeZone, tl_companyPSet.getAttrib (Company.FIELD_TimeZone))).listEntry (HELPER_IsVerified.getForSQL(dummyIsVerified, tl_companyPSet.getAttrib (Company.FIELD_IsVerified))).listEntry (HELPER_State.getForSQL(dummyState, tl_companyPSet.getAttrib (Company.FIELD_State))).listEntry (HELPER_Country.getForSQL(dummyCountry, tl_companyPSet.getAttrib (Company.FIELD_Country))).listEntry (HELPER_PostCode.getForSQL(dummyPostCode, tl_companyPSet.getAttrib (Company.FIELD_PostCode))).listEntry (HELPER_City.getForSQL(dummyCity, tl_companyPSet.getAttrib (Company.FIELD_City))).listEntry (HELPER_HasClientSupport.getForSQL(dummyHasClientSupport, tl_companyPSet.getAttrib (Company.FIELD_HasClientSupport))).listEntry (HELPER_StripeReference.getForSQL(dummyStripeReference, tl_companyPSet.getAttrib (Company.FIELD_StripeReference))).listEntry (HELPER_StripeSubscription.getForSQL(dummyStripeSubscription, tl_companyPSet.getAttrib (Company.FIELD_StripeSubscription))).listEntry (HELPER_NameOnCard.getForSQL(dummyNameOnCard, tl_companyPSet.getAttrib (Company.FIELD_NameOnCard))).listEntry (HELPER_CardPostCode.getForSQL(dummyCardPostCode, tl_companyPSet.getAttrib (Company.FIELD_CardPostCode))).listEntry (HELPER_CardID.getForSQL(dummyCardID, tl_companyPSet.getAttrib (Company.FIELD_CardID))).listEntry (HELPER_PlanRenewedOn.getForSQL(dummyPlanRenewedOn, tl_companyPSet.getAttrib (Company.FIELD_PlanRenewedOn))).listEntry (HELPER_UsedCredits.getForSQL(dummyUsedCredits, tl_companyPSet.getAttrib (Company.FIELD_UsedCredits))).listEntry (SQLManager.CheckNull((Long)(tl_companyPSet.getAttrib (Company.SINGLEREFERENCE_AddedByUser)))).listEntry (SQLManager.CheckNull((Long)(tl_companyPSet.getAttrib (Company.SINGLEREFERENCE_PaymentPlan)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
if (rowsUpdated != 1)
{
......@@ -486,8 +507,14 @@ public class CompanyPersistenceMgr extends ObjectPersistenceMgr
tl_companyPSet.setAttrib(Company.FIELD_HasClientSupport, HELPER_HasClientSupport.getFromRS(dummyHasClientSupport, r, "has_client_support"));
tl_companyPSet.setAttrib(Company.FIELD_StripeReference, HELPER_StripeReference.getFromRS(dummyStripeReference, r, "stripe_reference"));
tl_companyPSet.setAttrib(Company.FIELD_StripeSubscription, HELPER_StripeSubscription.getFromRS(dummyStripeSubscription, r, "stripe_subscription"));
tl_companyPSet.setAttrib(Company.FIELD_NameOnCard, HELPER_NameOnCard.getFromRS(dummyNameOnCard, r, "name_on_card"));
tl_companyPSet.setAttrib(Company.FIELD_CardPostCode, HELPER_CardPostCode.getFromRS(dummyCardPostCode, r, "card_post_code"));
tl_companyPSet.setAttrib(Company.FIELD_CardID, HELPER_CardID.getFromRS(dummyCardID, r, "card_id"));
tl_companyPSet.setAttrib(Company.FIELD_PlanRenewedOn, HELPER_PlanRenewedOn.getFromRS(dummyPlanRenewedOn, r, "plan_renewed_on"));
tl_companyPSet.setAttrib(Company.FIELD_UsedCredits, HELPER_UsedCredits.getFromRS(dummyUsedCredits, r, "used_credits"));
tl_companyPSet.setAttrib(Company.SINGLEREFERENCE_AddedByUser, r.getObject ("added_by_user_id"));
tl_companyPSet.setAttrib(Company.SINGLEREFERENCE_PaymentPlan, r.getObject ("payment_plan_id"));
}
......@@ -504,10 +531,10 @@ public class CompanyPersistenceMgr extends ObjectPersistenceMgr
{
executeStatement (sqlMgr,
"INSERT INTO {PREFIX}tl_company " +
" (company_name, company_logo, hiring_team_type, industry, time_zone, is_verified, state, country, post_code, city, has_client_support, stripe_reference, stripe_subscription, added_by_user_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
" (company_name, company_logo, hiring_team_type, industry, time_zone, is_verified, state, country, post_code, city, has_client_support, stripe_reference, stripe_subscription, name_on_card, card_post_code, card_id, plan_renewed_on, used_credits, added_by_user_id, payment_plan_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
"VALUES " +
" (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_CompanyName.getForSQL(dummyCompanyName, tl_companyPSet.getAttrib (Company.FIELD_CompanyName))).listEntry (HELPER_CompanyLogo.getForSQL(dummyCompanyLogo, tl_companyPSet.getAttrib (Company.FIELD_CompanyLogo))).listEntry (HELPER_HiringTeamType.getForSQL(dummyHiringTeamType, tl_companyPSet.getAttrib (Company.FIELD_HiringTeamType))).listEntry (HELPER_Industry.getForSQL(dummyIndustry, tl_companyPSet.getAttrib (Company.FIELD_Industry))).listEntry (HELPER_TimeZone.getForSQL(dummyTimeZone, tl_companyPSet.getAttrib (Company.FIELD_TimeZone))).listEntry (HELPER_IsVerified.getForSQL(dummyIsVerified, tl_companyPSet.getAttrib (Company.FIELD_IsVerified))).listEntry (HELPER_State.getForSQL(dummyState, tl_companyPSet.getAttrib (Company.FIELD_State))).listEntry (HELPER_Country.getForSQL(dummyCountry, tl_companyPSet.getAttrib (Company.FIELD_Country))).listEntry (HELPER_PostCode.getForSQL(dummyPostCode, tl_companyPSet.getAttrib (Company.FIELD_PostCode))).listEntry (HELPER_City.getForSQL(dummyCity, tl_companyPSet.getAttrib (Company.FIELD_City))).listEntry (HELPER_HasClientSupport.getForSQL(dummyHasClientSupport, tl_companyPSet.getAttrib (Company.FIELD_HasClientSupport))).listEntry (HELPER_StripeReference.getForSQL(dummyStripeReference, tl_companyPSet.getAttrib (Company.FIELD_StripeReference))).listEntry (HELPER_StripeSubscription.getForSQL(dummyStripeSubscription, tl_companyPSet.getAttrib (Company.FIELD_StripeSubscription))) .listEntry (SQLManager.CheckNull((Long)(tl_companyPSet.getAttrib (Company.SINGLEREFERENCE_AddedByUser)))) .listEntry (objectID.longID ()).toList().toArray());
" (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_CompanyName.getForSQL(dummyCompanyName, tl_companyPSet.getAttrib (Company.FIELD_CompanyName))).listEntry (HELPER_CompanyLogo.getForSQL(dummyCompanyLogo, tl_companyPSet.getAttrib (Company.FIELD_CompanyLogo))).listEntry (HELPER_HiringTeamType.getForSQL(dummyHiringTeamType, tl_companyPSet.getAttrib (Company.FIELD_HiringTeamType))).listEntry (HELPER_Industry.getForSQL(dummyIndustry, tl_companyPSet.getAttrib (Company.FIELD_Industry))).listEntry (HELPER_TimeZone.getForSQL(dummyTimeZone, tl_companyPSet.getAttrib (Company.FIELD_TimeZone))).listEntry (HELPER_IsVerified.getForSQL(dummyIsVerified, tl_companyPSet.getAttrib (Company.FIELD_IsVerified))).listEntry (HELPER_State.getForSQL(dummyState, tl_companyPSet.getAttrib (Company.FIELD_State))).listEntry (HELPER_Country.getForSQL(dummyCountry, tl_companyPSet.getAttrib (Company.FIELD_Country))).listEntry (HELPER_PostCode.getForSQL(dummyPostCode, tl_companyPSet.getAttrib (Company.FIELD_PostCode))).listEntry (HELPER_City.getForSQL(dummyCity, tl_companyPSet.getAttrib (Company.FIELD_City))).listEntry (HELPER_HasClientSupport.getForSQL(dummyHasClientSupport, tl_companyPSet.getAttrib (Company.FIELD_HasClientSupport))).listEntry (HELPER_StripeReference.getForSQL(dummyStripeReference, tl_companyPSet.getAttrib (Company.FIELD_StripeReference))).listEntry (HELPER_StripeSubscription.getForSQL(dummyStripeSubscription, tl_companyPSet.getAttrib (Company.FIELD_StripeSubscription))).listEntry (HELPER_NameOnCard.getForSQL(dummyNameOnCard, tl_companyPSet.getAttrib (Company.FIELD_NameOnCard))).listEntry (HELPER_CardPostCode.getForSQL(dummyCardPostCode, tl_companyPSet.getAttrib (Company.FIELD_CardPostCode))).listEntry (HELPER_CardID.getForSQL(dummyCardID, tl_companyPSet.getAttrib (Company.FIELD_CardID))).listEntry (HELPER_PlanRenewedOn.getForSQL(dummyPlanRenewedOn, tl_companyPSet.getAttrib (Company.FIELD_PlanRenewedOn))).listEntry (HELPER_UsedCredits.getForSQL(dummyUsedCredits, tl_companyPSet.getAttrib (Company.FIELD_UsedCredits))) .listEntry (SQLManager.CheckNull((Long)(tl_companyPSet.getAttrib (Company.SINGLEREFERENCE_AddedByUser)))).listEntry (SQLManager.CheckNull((Long)(tl_companyPSet.getAttrib (Company.SINGLEREFERENCE_PaymentPlan)))) .listEntry (objectID.longID ()).toList().toArray());
tl_companyPSet.setStatus (PersistentSetStatus.PROCESSED);
}
......
......@@ -175,4 +175,9 @@ public class CompanyUser extends BaseCompanyUser
}
}
public boolean hasRole(RoleType role)
{
return getRoles() != null && getRoles().contains(role);
}
}
\ No newline at end of file
......@@ -47,6 +47,8 @@
<ATTRIB name="State" type="State" dbcol="state" defaultValue="State.WA" attribHelper="EnumeratedAttributeHelper"/>
<ATTRIB name="Country" type="Countries" dbcol="country" defaultValue="Countries.AU" attribHelper="EnumeratedAttributeHelper"/>
<ATTRIB name="IsManuallyClosed" type="Boolean" dbcol="manually_closed" defaultValue="Boolean.FALSE"/>
<ATTRIB name="LastEdited" type="Date" dbcol="last_edited" />
<ATTRIB name="IsPPJ" type="Boolean" dbcol="is_ppj" defaultValue="Boolean.FALSE"/>
<SINGLEREFERENCE name="Level" type="Level" dbcol="level_id" mandatory="false"/>
<SINGLEREFERENCE name="Client" type="Client" dbcol="client_id" backreferenceName="Jobs"/>
......
......@@ -45,6 +45,8 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr
private State dummyState;
private Countries dummyCountry;
private Boolean dummyIsManuallyClosed;
private Date dummyLastEdited;
private Boolean dummyIsPPJ;
// Static constants corresponding to attribute helpers
......@@ -64,6 +66,8 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr
private static final EnumeratedAttributeHelper HELPER_State = new EnumeratedAttributeHelper (State.FACTORY_State);
private static final EnumeratedAttributeHelper HELPER_Country = new EnumeratedAttributeHelper (Countries.FACTORY_Countries);
private static final DefaultAttributeHelper HELPER_IsManuallyClosed = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_LastEdited = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_IsPPJ = DefaultAttributeHelper.INSTANCE;
......@@ -86,10 +90,12 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr
dummyState = (State)(HELPER_State.initialise (dummyState));
dummyCountry = (Countries)(HELPER_Country.initialise (dummyCountry));
dummyIsManuallyClosed = (Boolean)(HELPER_IsManuallyClosed.initialise (dummyIsManuallyClosed));
dummyLastEdited = (Date)(HELPER_LastEdited.initialise (dummyLastEdited));
dummyIsPPJ = (Boolean)(HELPER_IsPPJ.initialise (dummyIsPPJ));
}
private String SELECT_COLUMNS = "{PREFIX}tl_job.object_id as id, {PREFIX}tl_job.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_job.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_job.job_title, {PREFIX}tl_job.job_description, {PREFIX}tl_job.job_status, {PREFIX}tl_job.open_date, {PREFIX}tl_job.apply_by, {PREFIX}tl_job.include_assessment_criteria, {PREFIX}tl_job.assessment_type, {PREFIX}tl_job.random_key, {PREFIX}tl_job.job_type, {PREFIX}tl_job.ref_number, {PREFIX}tl_job.last_status_change_date, {PREFIX}tl_job.remote, {PREFIX}tl_job.city, {PREFIX}tl_job.state, {PREFIX}tl_job.country, {PREFIX}tl_job.manually_closed, {PREFIX}tl_job.level_id, {PREFIX}tl_job.client_id, {PREFIX}tl_job.company_user_id, {PREFIX}tl_job.shortened_url_id, 1 AS commasafe ";
private String SELECT_COLUMNS = "{PREFIX}tl_job.object_id as id, {PREFIX}tl_job.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_job.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_job.job_title, {PREFIX}tl_job.job_description, {PREFIX}tl_job.job_status, {PREFIX}tl_job.open_date, {PREFIX}tl_job.apply_by, {PREFIX}tl_job.include_assessment_criteria, {PREFIX}tl_job.assessment_type, {PREFIX}tl_job.random_key, {PREFIX}tl_job.job_type, {PREFIX}tl_job.ref_number, {PREFIX}tl_job.last_status_change_date, {PREFIX}tl_job.remote, {PREFIX}tl_job.city, {PREFIX}tl_job.state, {PREFIX}tl_job.country, {PREFIX}tl_job.manually_closed, {PREFIX}tl_job.last_edited, {PREFIX}tl_job.is_ppj, {PREFIX}tl_job.level_id, {PREFIX}tl_job.client_id, {PREFIX}tl_job.company_user_id, {PREFIX}tl_job.shortened_url_id, 1 AS commasafe ";
private String SELECT_JOINS = "";
public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
......@@ -156,6 +162,8 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr
!tl_jobPSet.containsAttrib(Job.FIELD_State)||
!tl_jobPSet.containsAttrib(Job.FIELD_Country)||
!tl_jobPSet.containsAttrib(Job.FIELD_IsManuallyClosed)||
!tl_jobPSet.containsAttrib(Job.FIELD_LastEdited)||
!tl_jobPSet.containsAttrib(Job.FIELD_IsPPJ)||
!tl_jobPSet.containsAttrib(Job.SINGLEREFERENCE_Level)||
!tl_jobPSet.containsAttrib(Job.SINGLEREFERENCE_Client)||
!tl_jobPSet.containsAttrib(Job.SINGLEREFERENCE_CompanyUser)||
......@@ -239,10 +247,10 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr
{
int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}tl_job " +
"SET job_title = ?, job_description = ?, job_status = ?, open_date = ?, apply_by = ?, include_assessment_criteria = ?, assessment_type = ?, random_key = ?, job_type = ?, ref_number = ?, last_status_change_date = ?, remote = ?, city = ?, state = ?, country = ?, manually_closed = ?, level_id = ? , client_id = ? , company_user_id = ? , shortened_url_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"SET job_title = ?, job_description = ?, job_status = ?, open_date = ?, apply_by = ?, include_assessment_criteria = ?, assessment_type = ?, random_key = ?, job_type = ?, ref_number = ?, last_status_change_date = ?, remote = ?, city = ?, state = ?, country = ?, manually_closed = ?, last_edited = ?, is_ppj = ?, level_id = ? , client_id = ? , company_user_id = ? , shortened_url_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE tl_job.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_JobTitle.getForSQL(dummyJobTitle, tl_jobPSet.getAttrib (Job.FIELD_JobTitle))).listEntry (HELPER_JobDescription.getForSQL(dummyJobDescription, tl_jobPSet.getAttrib (Job.FIELD_JobDescription))).listEntry (HELPER_JobStatus.getForSQL(dummyJobStatus, tl_jobPSet.getAttrib (Job.FIELD_JobStatus))).listEntry (HELPER_OpenDate.getForSQL(dummyOpenDate, tl_jobPSet.getAttrib (Job.FIELD_OpenDate))).listEntry (HELPER_ApplyBy.getForSQL(dummyApplyBy, tl_jobPSet.getAttrib (Job.FIELD_ApplyBy))).listEntry (HELPER_IncludeAssessmentCriteria.getForSQL(dummyIncludeAssessmentCriteria, tl_jobPSet.getAttrib (Job.FIELD_IncludeAssessmentCriteria))).listEntry (HELPER_AssessmentType.getForSQL(dummyAssessmentType, tl_jobPSet.getAttrib (Job.FIELD_AssessmentType))).listEntry (HELPER_RandomKey.getForSQL(dummyRandomKey, tl_jobPSet.getAttrib (Job.FIELD_RandomKey))).listEntry (HELPER_JobType.getForSQL(dummyJobType, tl_jobPSet.getAttrib (Job.FIELD_JobType))).listEntry (HELPER_ReferenceNumber.getForSQL(dummyReferenceNumber, tl_jobPSet.getAttrib (Job.FIELD_ReferenceNumber))).listEntry (HELPER_LastStatusChangeDate.getForSQL(dummyLastStatusChangeDate, tl_jobPSet.getAttrib (Job.FIELD_LastStatusChangeDate))).listEntry (HELPER_Remote.getForSQL(dummyRemote, tl_jobPSet.getAttrib (Job.FIELD_Remote))).listEntry (HELPER_City.getForSQL(dummyCity, tl_jobPSet.getAttrib (Job.FIELD_City))).listEntry (HELPER_State.getForSQL(dummyState, tl_jobPSet.getAttrib (Job.FIELD_State))).listEntry (HELPER_Country.getForSQL(dummyCountry, tl_jobPSet.getAttrib (Job.FIELD_Country))).listEntry (HELPER_IsManuallyClosed.getForSQL(dummyIsManuallyClosed, tl_jobPSet.getAttrib (Job.FIELD_IsManuallyClosed))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_Level)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_Client)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_CompanyUser)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_ShortenedURL)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
CollectionUtils.listEntry (HELPER_JobTitle.getForSQL(dummyJobTitle, tl_jobPSet.getAttrib (Job.FIELD_JobTitle))).listEntry (HELPER_JobDescription.getForSQL(dummyJobDescription, tl_jobPSet.getAttrib (Job.FIELD_JobDescription))).listEntry (HELPER_JobStatus.getForSQL(dummyJobStatus, tl_jobPSet.getAttrib (Job.FIELD_JobStatus))).listEntry (HELPER_OpenDate.getForSQL(dummyOpenDate, tl_jobPSet.getAttrib (Job.FIELD_OpenDate))).listEntry (HELPER_ApplyBy.getForSQL(dummyApplyBy, tl_jobPSet.getAttrib (Job.FIELD_ApplyBy))).listEntry (HELPER_IncludeAssessmentCriteria.getForSQL(dummyIncludeAssessmentCriteria, tl_jobPSet.getAttrib (Job.FIELD_IncludeAssessmentCriteria))).listEntry (HELPER_AssessmentType.getForSQL(dummyAssessmentType, tl_jobPSet.getAttrib (Job.FIELD_AssessmentType))).listEntry (HELPER_RandomKey.getForSQL(dummyRandomKey, tl_jobPSet.getAttrib (Job.FIELD_RandomKey))).listEntry (HELPER_JobType.getForSQL(dummyJobType, tl_jobPSet.getAttrib (Job.FIELD_JobType))).listEntry (HELPER_ReferenceNumber.getForSQL(dummyReferenceNumber, tl_jobPSet.getAttrib (Job.FIELD_ReferenceNumber))).listEntry (HELPER_LastStatusChangeDate.getForSQL(dummyLastStatusChangeDate, tl_jobPSet.getAttrib (Job.FIELD_LastStatusChangeDate))).listEntry (HELPER_Remote.getForSQL(dummyRemote, tl_jobPSet.getAttrib (Job.FIELD_Remote))).listEntry (HELPER_City.getForSQL(dummyCity, tl_jobPSet.getAttrib (Job.FIELD_City))).listEntry (HELPER_State.getForSQL(dummyState, tl_jobPSet.getAttrib (Job.FIELD_State))).listEntry (HELPER_Country.getForSQL(dummyCountry, tl_jobPSet.getAttrib (Job.FIELD_Country))).listEntry (HELPER_IsManuallyClosed.getForSQL(dummyIsManuallyClosed, tl_jobPSet.getAttrib (Job.FIELD_IsManuallyClosed))).listEntry (HELPER_LastEdited.getForSQL(dummyLastEdited, tl_jobPSet.getAttrib (Job.FIELD_LastEdited))).listEntry (HELPER_IsPPJ.getForSQL(dummyIsPPJ, tl_jobPSet.getAttrib (Job.FIELD_IsPPJ))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_Level)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_Client)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_CompanyUser)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_ShortenedURL)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
if (rowsUpdated != 1)
{
......@@ -624,6 +632,8 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr
tl_jobPSet.setAttrib(Job.FIELD_State, HELPER_State.getFromRS(dummyState, r, "state"));
tl_jobPSet.setAttrib(Job.FIELD_Country, HELPER_Country.getFromRS(dummyCountry, r, "country"));
tl_jobPSet.setAttrib(Job.FIELD_IsManuallyClosed, HELPER_IsManuallyClosed.getFromRS(dummyIsManuallyClosed, r, "manually_closed"));
tl_jobPSet.setAttrib(Job.FIELD_LastEdited, HELPER_LastEdited.getFromRS(dummyLastEdited, r, "last_edited"));
tl_jobPSet.setAttrib(Job.FIELD_IsPPJ, HELPER_IsPPJ.getFromRS(dummyIsPPJ, r, "is_ppj"));
tl_jobPSet.setAttrib(Job.SINGLEREFERENCE_Level, r.getObject ("level_id"));
tl_jobPSet.setAttrib(Job.SINGLEREFERENCE_Client, r.getObject ("client_id"));
......@@ -645,10 +655,10 @@ public class JobPersistenceMgr extends ObjectPersistenceMgr
{
executeStatement (sqlMgr,
"INSERT INTO {PREFIX}tl_job " +
" (job_title, job_description, job_status, open_date, apply_by, include_assessment_criteria, assessment_type, random_key, job_type, ref_number, last_status_change_date, remote, city, state, country, manually_closed, level_id, client_id, company_user_id, shortened_url_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
" (job_title, job_description, job_status, open_date, apply_by, include_assessment_criteria, assessment_type, random_key, job_type, ref_number, last_status_change_date, remote, city, state, country, manually_closed, last_edited, is_ppj, level_id, client_id, company_user_id, shortened_url_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
"VALUES " +
" (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_JobTitle.getForSQL(dummyJobTitle, tl_jobPSet.getAttrib (Job.FIELD_JobTitle))).listEntry (HELPER_JobDescription.getForSQL(dummyJobDescription, tl_jobPSet.getAttrib (Job.FIELD_JobDescription))).listEntry (HELPER_JobStatus.getForSQL(dummyJobStatus, tl_jobPSet.getAttrib (Job.FIELD_JobStatus))).listEntry (HELPER_OpenDate.getForSQL(dummyOpenDate, tl_jobPSet.getAttrib (Job.FIELD_OpenDate))).listEntry (HELPER_ApplyBy.getForSQL(dummyApplyBy, tl_jobPSet.getAttrib (Job.FIELD_ApplyBy))).listEntry (HELPER_IncludeAssessmentCriteria.getForSQL(dummyIncludeAssessmentCriteria, tl_jobPSet.getAttrib (Job.FIELD_IncludeAssessmentCriteria))).listEntry (HELPER_AssessmentType.getForSQL(dummyAssessmentType, tl_jobPSet.getAttrib (Job.FIELD_AssessmentType))).listEntry (HELPER_RandomKey.getForSQL(dummyRandomKey, tl_jobPSet.getAttrib (Job.FIELD_RandomKey))).listEntry (HELPER_JobType.getForSQL(dummyJobType, tl_jobPSet.getAttrib (Job.FIELD_JobType))).listEntry (HELPER_ReferenceNumber.getForSQL(dummyReferenceNumber, tl_jobPSet.getAttrib (Job.FIELD_ReferenceNumber))).listEntry (HELPER_LastStatusChangeDate.getForSQL(dummyLastStatusChangeDate, tl_jobPSet.getAttrib (Job.FIELD_LastStatusChangeDate))).listEntry (HELPER_Remote.getForSQL(dummyRemote, tl_jobPSet.getAttrib (Job.FIELD_Remote))).listEntry (HELPER_City.getForSQL(dummyCity, tl_jobPSet.getAttrib (Job.FIELD_City))).listEntry (HELPER_State.getForSQL(dummyState, tl_jobPSet.getAttrib (Job.FIELD_State))).listEntry (HELPER_Country.getForSQL(dummyCountry, tl_jobPSet.getAttrib (Job.FIELD_Country))).listEntry (HELPER_IsManuallyClosed.getForSQL(dummyIsManuallyClosed, tl_jobPSet.getAttrib (Job.FIELD_IsManuallyClosed))) .listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_Level)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_Client)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_CompanyUser)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_ShortenedURL)))) .listEntry (objectID.longID ()).toList().toArray());
" (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_JobTitle.getForSQL(dummyJobTitle, tl_jobPSet.getAttrib (Job.FIELD_JobTitle))).listEntry (HELPER_JobDescription.getForSQL(dummyJobDescription, tl_jobPSet.getAttrib (Job.FIELD_JobDescription))).listEntry (HELPER_JobStatus.getForSQL(dummyJobStatus, tl_jobPSet.getAttrib (Job.FIELD_JobStatus))).listEntry (HELPER_OpenDate.getForSQL(dummyOpenDate, tl_jobPSet.getAttrib (Job.FIELD_OpenDate))).listEntry (HELPER_ApplyBy.getForSQL(dummyApplyBy, tl_jobPSet.getAttrib (Job.FIELD_ApplyBy))).listEntry (HELPER_IncludeAssessmentCriteria.getForSQL(dummyIncludeAssessmentCriteria, tl_jobPSet.getAttrib (Job.FIELD_IncludeAssessmentCriteria))).listEntry (HELPER_AssessmentType.getForSQL(dummyAssessmentType, tl_jobPSet.getAttrib (Job.FIELD_AssessmentType))).listEntry (HELPER_RandomKey.getForSQL(dummyRandomKey, tl_jobPSet.getAttrib (Job.FIELD_RandomKey))).listEntry (HELPER_JobType.getForSQL(dummyJobType, tl_jobPSet.getAttrib (Job.FIELD_JobType))).listEntry (HELPER_ReferenceNumber.getForSQL(dummyReferenceNumber, tl_jobPSet.getAttrib (Job.FIELD_ReferenceNumber))).listEntry (HELPER_LastStatusChangeDate.getForSQL(dummyLastStatusChangeDate, tl_jobPSet.getAttrib (Job.FIELD_LastStatusChangeDate))).listEntry (HELPER_Remote.getForSQL(dummyRemote, tl_jobPSet.getAttrib (Job.FIELD_Remote))).listEntry (HELPER_City.getForSQL(dummyCity, tl_jobPSet.getAttrib (Job.FIELD_City))).listEntry (HELPER_State.getForSQL(dummyState, tl_jobPSet.getAttrib (Job.FIELD_State))).listEntry (HELPER_Country.getForSQL(dummyCountry, tl_jobPSet.getAttrib (Job.FIELD_Country))).listEntry (HELPER_IsManuallyClosed.getForSQL(dummyIsManuallyClosed, tl_jobPSet.getAttrib (Job.FIELD_IsManuallyClosed))).listEntry (HELPER_LastEdited.getForSQL(dummyLastEdited, tl_jobPSet.getAttrib (Job.FIELD_LastEdited))).listEntry (HELPER_IsPPJ.getForSQL(dummyIsPPJ, tl_jobPSet.getAttrib (Job.FIELD_IsPPJ))) .listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_Level)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_Client)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_CompanyUser)))).listEntry (SQLManager.CheckNull((Long)(tl_jobPSet.getAttrib (Job.SINGLEREFERENCE_ShortenedURL)))) .listEntry (objectID.longID ()).toList().toArray());
tl_jobPSet.setStatus (PersistentSetStatus.PROCESSED);
}
......
package performa.orm;
import oneit.utils.math.NullArith;
public class PaymentPlan extends BasePaymentPlan
{
private static final long serialVersionUID = 0L;
public static final Double PER_PER_JOB_AMOUNT = 499D;
// This constructor should not be called
public PaymentPlan ()
{
// 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();
}
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
<?xml version="1.0" encoding="UTF-8"?>
<ROOT xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='http://www.oneit.com.au/schemas/5.2/BusinessObject.xsd'>
<BUSINESSCLASS name="PaymentPlan" package="performa.orm">
<IMPORT value="performa.orm.types.*"/>
<TABLE name="tl_payment_plan" tablePrefix="object" polymorphic="FALSE">
<ATTRIB name="StripeReference" type="String" dbcol="stripe_reference" length="100" mandatory="true"/>
<ATTRIB name="PlanName" type="String" dbcol="plan_name" />
<ATTRIB name="Description" type="String" dbcol="description" />
<ATTRIB name="CurrencyType" type="CurrencyType" dbcol="currency_type" mandatory="true" attribHelper="EnumeratedAttributeHelper" defaultValue="CurrencyType.AUD"/>
<ATTRIB name="Amount" type="Double" dbcol="amount" mandatory="true" SubType="Currency" Formatter="Currency" />
<ATTRIB name="Interval" type="Interval" dbcol="interval" mandatory="true" attribHelper="EnumeratedAttributeHelper" />
<ATTRIB name="IntervalCount" type="Integer" dbcol="interval_count" mandatory="true"/>
<ATTRIB name="TrialPeriodDays" type="Integer" dbcol="trial_period_days" />
<ATTRIB name="ActiveJobCount" type="Integer" dbcol="active_job_count" />
</TABLE>
<SEARCH type="All" paramFilter="tl_payment_plan.object_id is not null" orderBy="tl_payment_plan.object_id" />
<SEARCH type="Max" paramFilter="tl_payment_plan.object_id IS NOT NULL AND active_job_count IS NOT NULL" orderBy="tl_payment_plan.active_job_count DESC LIMIT 1" singleton="TRUE" />
</BUSINESSCLASS>
</ROOT>
\ No newline at end of file
package performa.orm;
import java.io.*;
import java.util.*;
import java.sql.ResultSet;
import java.sql.SQLException;
import oneit.logging.*;
import oneit.objstore.*;
import oneit.objstore.assocs.*;
import oneit.objstore.rdbms.*;
import oneit.objstore.utils.*;
import oneit.sql.*;
import oneit.utils.resource.*;
import oneit.utils.*;
import oneit.utils.threading.*;
import performa.orm.types.*;
/**
* IMPORTANT!!!! Autogenerated class, DO NOT EDIT!!!!!
* Template: Infrastructure8.2[oneit.objstore.PersistenceMgrTemplate.xsl]
*/
public class PaymentPlanPersistenceMgr extends ObjectPersistenceMgr
{
private static final LoggingArea PaymentPlanPersistence = LoggingArea.createLoggingArea(ObjectPersistenceMgr.OBJECT_PERSISTENCE, "PaymentPlan");
// Private attributes corresponding to business object data
private String dummyStripeReference;
private String dummyPlanName;
private String dummyDescription;
private CurrencyType dummyCurrencyType;
private Double dummyAmount;
private Interval dummyInterval;
private Integer dummyIntervalCount;
private Integer dummyTrialPeriodDays;
private Integer dummyActiveJobCount;
// Static constants corresponding to attribute helpers
private static final DefaultAttributeHelper HELPER_StripeReference = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_PlanName = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_Description = DefaultAttributeHelper.INSTANCE;
private static final EnumeratedAttributeHelper HELPER_CurrencyType = new EnumeratedAttributeHelper (CurrencyType.FACTORY_CurrencyType);
private static final DefaultAttributeHelper HELPER_Amount = DefaultAttributeHelper.INSTANCE;
private static final EnumeratedAttributeHelper HELPER_Interval = new EnumeratedAttributeHelper (Interval.FACTORY_Interval);
private static final DefaultAttributeHelper HELPER_IntervalCount = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_TrialPeriodDays = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_ActiveJobCount = DefaultAttributeHelper.INSTANCE;
public PaymentPlanPersistenceMgr ()
{
dummyStripeReference = (String)(HELPER_StripeReference.initialise (dummyStripeReference));
dummyPlanName = (String)(HELPER_PlanName.initialise (dummyPlanName));
dummyDescription = (String)(HELPER_Description.initialise (dummyDescription));
dummyCurrencyType = (CurrencyType)(HELPER_CurrencyType.initialise (dummyCurrencyType));
dummyAmount = (Double)(HELPER_Amount.initialise (dummyAmount));
dummyInterval = (Interval)(HELPER_Interval.initialise (dummyInterval));
dummyIntervalCount = (Integer)(HELPER_IntervalCount.initialise (dummyIntervalCount));
dummyTrialPeriodDays = (Integer)(HELPER_TrialPeriodDays.initialise (dummyTrialPeriodDays));
dummyActiveJobCount = (Integer)(HELPER_ActiveJobCount.initialise (dummyActiveJobCount));
}
private String SELECT_COLUMNS = "{PREFIX}tl_payment_plan.object_id as id, {PREFIX}tl_payment_plan.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_payment_plan.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_payment_plan.stripe_reference, {PREFIX}tl_payment_plan.plan_name, {PREFIX}tl_payment_plan.description, {PREFIX}tl_payment_plan.currency_type, {PREFIX}tl_payment_plan.amount, {PREFIX}tl_payment_plan.interval, {PREFIX}tl_payment_plan.interval_count, {PREFIX}tl_payment_plan.trial_period_days, {PREFIX}tl_payment_plan.active_job_count, 1 AS commasafe ";
private String SELECT_JOINS = "";
public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
Set<BaseBusinessClass> resultByIDs = fetchByIDs(Collections.singleton (id), allPSets, context, sqlMgr);
if (resultByIDs.isEmpty ())
{
return null;
}
else if (resultByIDs.size () > 1)
{
throw new StorageException ("Multiple results for id:" + id);
}
else
{
return resultByIDs.iterator ().next ();
}
}
public Set<BaseBusinessClass> fetchByIDs(Set<ObjectID> ids, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
Set<BaseBusinessClass> results = new HashSet ();
Set<Long> idsToFetch = new HashSet ();
for (ObjectID id : ids)
{
if (context.containsObject(id)) // Check for cached version
{
BaseBusinessClass objectToReturn = context.getObjectToReplace(id, PaymentPlan.REFERENCE_PaymentPlan);
if (objectToReturn instanceof PaymentPlan)
{
LogMgr.log (PaymentPlanPersistence, LogLevel.TRACE, "Cache hit for id:", id);
results.add (objectToReturn);
}
else
{
throw new StorageException ("Cache collision for id:" + id + " with object " + objectToReturn + "while fetching a PaymentPlan");
}
}
PersistentSet tl_payment_planPSet = allPSets.getPersistentSet(id, "tl_payment_plan", PersistentSetStatus.FETCHED);
// Check for persistent sets already prefetched
if (false || !tl_payment_planPSet.containsAttrib(BaseBusinessClass.FIELD_ObjectLastModified) ||
!tl_payment_planPSet.containsAttrib(PaymentPlan.FIELD_StripeReference)||
!tl_payment_planPSet.containsAttrib(PaymentPlan.FIELD_PlanName)||
!tl_payment_planPSet.containsAttrib(PaymentPlan.FIELD_Description)||
!tl_payment_planPSet.containsAttrib(PaymentPlan.FIELD_CurrencyType)||
!tl_payment_planPSet.containsAttrib(PaymentPlan.FIELD_Amount)||
!tl_payment_planPSet.containsAttrib(PaymentPlan.FIELD_Interval)||
!tl_payment_planPSet.containsAttrib(PaymentPlan.FIELD_IntervalCount)||
!tl_payment_planPSet.containsAttrib(PaymentPlan.FIELD_TrialPeriodDays)||
!tl_payment_planPSet.containsAttrib(PaymentPlan.FIELD_ActiveJobCount))
{
// We will need to retrieve it
idsToFetch.add (id.longValue());
}
else
{
LogMgr.log (PaymentPlanPersistence, LogLevel.DEBUG2, "Persistent set preloaded id:", id);
/* Non Polymorphic */
PaymentPlan result = new PaymentPlan ();
result.setFromPersistentSets(id, allPSets);
context.addRetrievedObject(result);
results.add (result);
}
}
if (idsToFetch.size () > 0)
{
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}tl_payment_plan " +
"WHERE " + SELECT_JOINS + "{PREFIX}tl_payment_plan.object_id IN ?";
BaseBusinessClass[] resultsFetched = loadQuery (allPSets, sqlMgr, context, query, new Object[] { idsToFetch }, null, false);
for (BaseBusinessClass objFetched : resultsFetched)
{
results.add (objFetched);
}
}
return results;
}
public BaseBusinessClass[] getReferencedObjects(ObjectID _objectID, String refName, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
if (false)
{
throw new RuntimeException ();
}
else
{
throw new IllegalArgumentException ("Illegal reference type:" + refName);
}
}
public void update(BaseBusinessClass obj, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, ConcurrentUpdateConflictException, StorageException
{
EqualityResult test = EqualityResult.compare (obj, obj.getBackup ());
ObjectID objectID = obj.getID ();
if (!test.areAttributesEqual () || !test.areSingleAssocsEqual () || obj.getForcedSave())
{
PersistentSet tl_payment_planPSet = allPSets.getPersistentSet(objectID, "tl_payment_plan");
if (tl_payment_planPSet.getStatus () != PersistentSetStatus.PROCESSED &&
tl_payment_planPSet.getStatus () != PersistentSetStatus.DEFERRED)
{
int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}tl_payment_plan " +
"SET stripe_reference = ?, plan_name = ?, description = ?, currency_type = ?, amount = ?, interval = ?, interval_count = ?, trial_period_days = ?, active_job_count = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE tl_payment_plan.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_StripeReference.getForSQL(dummyStripeReference, tl_payment_planPSet.getAttrib (PaymentPlan.FIELD_StripeReference))).listEntry (HELPER_PlanName.getForSQL(dummyPlanName, tl_payment_planPSet.getAttrib (PaymentPlan.FIELD_PlanName))).listEntry (HELPER_Description.getForSQL(dummyDescription, tl_payment_planPSet.getAttrib (PaymentPlan.FIELD_Description))).listEntry (HELPER_CurrencyType.getForSQL(dummyCurrencyType, tl_payment_planPSet.getAttrib (PaymentPlan.FIELD_CurrencyType))).listEntry (HELPER_Amount.getForSQL(dummyAmount, tl_payment_planPSet.getAttrib (PaymentPlan.FIELD_Amount))).listEntry (HELPER_Interval.getForSQL(dummyInterval, tl_payment_planPSet.getAttrib (PaymentPlan.FIELD_Interval))).listEntry (HELPER_IntervalCount.getForSQL(dummyIntervalCount, tl_payment_planPSet.getAttrib (PaymentPlan.FIELD_IntervalCount))).listEntry (HELPER_TrialPeriodDays.getForSQL(dummyTrialPeriodDays, tl_payment_planPSet.getAttrib (PaymentPlan.FIELD_TrialPeriodDays))).listEntry (HELPER_ActiveJobCount.getForSQL(dummyActiveJobCount, tl_payment_planPSet.getAttrib (PaymentPlan.FIELD_ActiveJobCount))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
if (rowsUpdated != 1)
{
// Error, either a concurrency error or a not-exists error
ResultSet r = executeQuery (sqlMgr,
"SELECT object_id, object_LAST_UPDATED_DATE FROM {PREFIX}tl_payment_plan WHERE object_id = ?",
new Object[] { objectID.longID () });
if (r.next ())
{
Date d = new java.util.Date (r.getTimestamp (2).getTime());
String errorMsg = QueryBuilder.buildQueryString ("Concurrent update error:[?] for row:[?] objDate:[?] dbDate:[?]",
new Object[] { "tl_payment_plan", objectID.longID (), obj.getObjectLastModified (), d },
sqlMgr.getPortabilityServices ());
LogMgr.log (PaymentPlanPersistence, LogLevel.BUSINESS1, errorMsg);
throw new ConcurrentUpdateConflictException (obj, "tl_payment_plan");
}
else
{
String errorMsg = "Attempt to update nonexistent row in table:tl_payment_plan for row:" + objectID + " objDate:" + obj.getObjectLastModified ();
LogMgr.log (PaymentPlanPersistence, LogLevel.BUSINESS1, errorMsg);
throw new RuntimeException (errorMsg);
}
}
tl_payment_planPSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
else
{
LogMgr.log (PaymentPlanPersistence, LogLevel.DEBUG1, "Skipping update since no attribs or simple assocs changed on ", objectID);
}
}
public void delete(BaseBusinessClass obj, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, ConcurrentUpdateConflictException, StorageException
{
ObjectID objectID = obj.getID ();
PersistentSet tl_payment_planPSet = allPSets.getPersistentSet(objectID, "tl_payment_plan");
LogMgr.log (PaymentPlanPersistence, LogLevel.DEBUG2, "Deleting:", objectID);
if (tl_payment_planPSet.getStatus () != PersistentSetStatus.PROCESSED &&
tl_payment_planPSet.getStatus () != PersistentSetStatus.DEFERRED)
{
int rowsDeleted = executeStatement (sqlMgr,
"DELETE " +
"FROM {PREFIX}tl_payment_plan " +
"WHERE tl_payment_plan.object_id = ? AND " + sqlMgr.getPortabilityServices ().getTruncatedTimestampColumn ("object_LAST_UPDATED_DATE") + " = " + sqlMgr.getPortabilityServices ().getTruncatedTimestampParam("?") + " ",
new Object[] { objectID.longID(), obj.getObjectLastModified () });
if (rowsDeleted != 1)
{
// Error, either a concurrency error or a not-exists error
ResultSet r = executeQuery (sqlMgr,
"SELECT object_id FROM {PREFIX}tl_payment_plan WHERE object_id = ?",
new Object[] { objectID.longID() });
if (r.next ())
{
throw new ConcurrentUpdateConflictException (obj, "tl_payment_plan");
}
else
{
String errorMsg = "Attempt to delete nonexistent row in table:tl_payment_plan for row:" + objectID;
LogMgr.log (PaymentPlanPersistence, LogLevel.SYSTEMERROR1, errorMsg);
throw new RuntimeException (errorMsg);
}
}
tl_payment_planPSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
public ResultSet executeSearchQueryAll (SQLManager sqlMgr) throws SQLException
{
throw new RuntimeException ("NOT implemented: executeSearchQueryAll");
}
public ResultSet executeSearchQueryMax (SQLManager sqlMgr) throws SQLException
{
throw new RuntimeException ("NOT implemented: executeSearchQueryMax");
}
public BaseBusinessClass[] loadQuery (PersistentSetCollection allPSets, SQLManager sqlMgr, RDBMSPersistenceContext context, String query, Object[] params, Integer maxRows, boolean truncateExtra) throws SQLException, StorageException
{
LinkedHashMap<ObjectID, PaymentPlan> results = new LinkedHashMap ();
ResultSet r = executeQuery (sqlMgr, query, params);
while (r.next())
{
ThreadUtils.checkInterrupted ();
ObjectID objectID = new ObjectID (PaymentPlan.REFERENCE_PaymentPlan.getObjectIDSpace (), r.getLong ("id"));
PaymentPlan resultElement;
if (maxRows != null && !results.containsKey (objectID) && results.size () >= maxRows)
{
if (truncateExtra)
{
break;
}
else
{
throw new SearchRowsExceededException ("Maximum rows exceeded:" + maxRows);
}
}
if (context.containsObject(objectID))
{
BaseBusinessClass cachedElement = context.getObjectToReplace(objectID, PaymentPlan.REFERENCE_PaymentPlan);
if (cachedElement instanceof PaymentPlan)
{
LogMgr.log (PaymentPlanPersistence, LogLevel.TRACE, "Cache hit for id:", objectID);
resultElement = (PaymentPlan)cachedElement;
}
else
{
throw new StorageException ("Cache collision for id:" + objectID + " with object " + cachedElement + "while fetching a PaymentPlan");
}
}
else
{
PersistentSet tl_payment_planPSet = allPSets.getPersistentSet(objectID, "tl_payment_plan", PersistentSetStatus.FETCHED);
createPersistentSetFromRS(allPSets, r, objectID);
resultElement = new PaymentPlan ();
resultElement.setFromPersistentSets(objectID, allPSets);
context.addRetrievedObject(resultElement);
}
results.put (objectID, resultElement);
}
BaseBusinessClass[] resultsArr = new BaseBusinessClass[results.size ()];
return results.values ().toArray (resultsArr);
}
public BaseBusinessClass[] find(String searchType, PersistentSetCollection allPSets, Hashtable criteria, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
LogMgr.log (PaymentPlanPersistence, LogLevel.DEBUG2, "Search executing:", searchType, " criteria:", criteria);
String customParamFilter = (String)criteria.get (SEARCH_CustomFilter);
String customOrderBy = (String)criteria.get (SEARCH_OrderBy);
String customTables = (String)criteria.get (SEARCH_CustomExtraTables);
Boolean noCommaBeforeCustomExtraTables = (Boolean)criteria.get (SEARCH_CustomExtraTablesNoComma);
if (searchType.equals (SEARCH_CustomSQL))
{
Set<ObjectID> processedIDs = new HashSet();
SearchParamTransform tx = new SearchParamTransform (criteria);
Object[] searchParams;
customParamFilter = StringUtils.replaceParams (customParamFilter, tx);
searchParams = tx.getParamsArray();
if (customOrderBy != null)
{
customOrderBy = " ORDER BY " + customOrderBy;
}
else
{
customOrderBy = "";
}
ResultSet r;
String concatCustomTableWith = CollectionUtils.equals(noCommaBeforeCustomExtraTables, true) ? " " : ", ";
String tables = StringUtils.subBlanks(customTables) == null ? " " : concatCustomTableWith + customTables + " ";
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}tl_payment_plan " + tables +
"WHERE " + SELECT_JOINS + " " + customParamFilter + customOrderBy;
BaseBusinessClass[] results = loadQuery (allPSets, sqlMgr, context, query, searchParams, null, false);
return results;
}
else if (searchType.equals (PaymentPlan.SEARCH_All))
{
// Local scope for transformed variables
{
}
String orderBy = " ORDER BY tl_payment_plan.object_id";
String tables = " ";
Set<String> joinTableSet = new HashSet<String>();
String filter;
Object[] searchParams; // paramFilter: tl_payment_plan.object_id is not null
String preFilter = "(tl_payment_plan.object_id is not null)"
+ " ";
preFilter += context.getLoadingAttributes ().getCustomSQL() ;
SearchParamTransform tx = new SearchParamTransform (criteria);
filter = StringUtils.replaceParams (preFilter, tx);
searchParams = tx.getParamsArray();
Integer maxRows = context.getLoadingAttributes ().getMaxRows ();
boolean truncateExtra = !context.getLoadingAttributes ().isFailIfMaxExceeded();
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}tl_payment_plan " + tables + tableSetToSQL(joinTableSet) +
"WHERE " + SELECT_JOINS + " " + filter + orderBy;
BaseBusinessClass[] results = loadQuery (allPSets, sqlMgr, context, query, searchParams, maxRows, truncateExtra);
return results;
}
else if (searchType.equals (PaymentPlan.SEARCH_Max))
{
// Local scope for transformed variables
{
}
String orderBy = " ORDER BY tl_payment_plan.active_job_count DESC LIMIT 1";
String tables = " ";
Set<String> joinTableSet = new HashSet<String>();
String filter;
Object[] searchParams; // paramFilter: tl_payment_plan.object_id IS NOT NULL AND active_job_count IS NOT NULL
String preFilter = "(tl_payment_plan.object_id IS NOT NULL AND active_job_count IS NOT NULL)"
+ " ";
preFilter += context.getLoadingAttributes ().getCustomSQL() ;
SearchParamTransform tx = new SearchParamTransform (criteria);
filter = StringUtils.replaceParams (preFilter, tx);
searchParams = tx.getParamsArray();
Integer maxRows = context.getLoadingAttributes ().getMaxRows ();
boolean truncateExtra = !context.getLoadingAttributes ().isFailIfMaxExceeded();
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}tl_payment_plan " + tables + tableSetToSQL(joinTableSet) +
"WHERE " + SELECT_JOINS + " " + filter + orderBy;
BaseBusinessClass[] results = loadQuery (allPSets, sqlMgr, context, query, searchParams, maxRows, truncateExtra);
return results;
}
else
{
throw new IllegalArgumentException ("Illegal search type:" + searchType);
}
}
private void createPersistentSetFromRS(PersistentSetCollection allPSets, ResultSet r, ObjectID objectID) throws SQLException
{
PersistentSet tl_payment_planPSet = allPSets.getPersistentSet(objectID, "tl_payment_plan", PersistentSetStatus.FETCHED);
// Object Modified
tl_payment_planPSet.setAttrib(BaseBusinessClass.FIELD_ObjectLastModified, r.getTimestamp ("LAST_UPDATED_DATE"));
// Object Created
tl_payment_planPSet.setAttrib(BaseBusinessClass.FIELD_ObjectCreated, r.getTimestamp ("CREATED_DATE"));
tl_payment_planPSet.setAttrib(PaymentPlan.FIELD_StripeReference, HELPER_StripeReference.getFromRS(dummyStripeReference, r, "stripe_reference"));
tl_payment_planPSet.setAttrib(PaymentPlan.FIELD_PlanName, HELPER_PlanName.getFromRS(dummyPlanName, r, "plan_name"));
tl_payment_planPSet.setAttrib(PaymentPlan.FIELD_Description, HELPER_Description.getFromRS(dummyDescription, r, "description"));
tl_payment_planPSet.setAttrib(PaymentPlan.FIELD_CurrencyType, HELPER_CurrencyType.getFromRS(dummyCurrencyType, r, "currency_type"));
tl_payment_planPSet.setAttrib(PaymentPlan.FIELD_Amount, HELPER_Amount.getFromRS(dummyAmount, r, "amount"));
tl_payment_planPSet.setAttrib(PaymentPlan.FIELD_Interval, HELPER_Interval.getFromRS(dummyInterval, r, "interval"));
tl_payment_planPSet.setAttrib(PaymentPlan.FIELD_IntervalCount, HELPER_IntervalCount.getFromRS(dummyIntervalCount, r, "interval_count"));
tl_payment_planPSet.setAttrib(PaymentPlan.FIELD_TrialPeriodDays, HELPER_TrialPeriodDays.getFromRS(dummyTrialPeriodDays, r, "trial_period_days"));
tl_payment_planPSet.setAttrib(PaymentPlan.FIELD_ActiveJobCount, HELPER_ActiveJobCount.getFromRS(dummyActiveJobCount, r, "active_job_count"));
}
public void create(BaseBusinessClass obj, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
ObjectID objectID = obj.getID ();
PersistentSet tl_payment_planPSet = allPSets.getPersistentSet(objectID, "tl_payment_plan");
if (tl_payment_planPSet.getStatus () != PersistentSetStatus.PROCESSED &&
tl_payment_planPSet.getStatus () != PersistentSetStatus.DEFERRED)
{
executeStatement (sqlMgr,
"INSERT INTO {PREFIX}tl_payment_plan " +
" (stripe_reference, plan_name, description, currency_type, amount, interval, interval_count, trial_period_days, active_job_count, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
"VALUES " +
" (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_StripeReference.getForSQL(dummyStripeReference, tl_payment_planPSet.getAttrib (PaymentPlan.FIELD_StripeReference))).listEntry (HELPER_PlanName.getForSQL(dummyPlanName, tl_payment_planPSet.getAttrib (PaymentPlan.FIELD_PlanName))).listEntry (HELPER_Description.getForSQL(dummyDescription, tl_payment_planPSet.getAttrib (PaymentPlan.FIELD_Description))).listEntry (HELPER_CurrencyType.getForSQL(dummyCurrencyType, tl_payment_planPSet.getAttrib (PaymentPlan.FIELD_CurrencyType))).listEntry (HELPER_Amount.getForSQL(dummyAmount, tl_payment_planPSet.getAttrib (PaymentPlan.FIELD_Amount))).listEntry (HELPER_Interval.getForSQL(dummyInterval, tl_payment_planPSet.getAttrib (PaymentPlan.FIELD_Interval))).listEntry (HELPER_IntervalCount.getForSQL(dummyIntervalCount, tl_payment_planPSet.getAttrib (PaymentPlan.FIELD_IntervalCount))).listEntry (HELPER_TrialPeriodDays.getForSQL(dummyTrialPeriodDays, tl_payment_planPSet.getAttrib (PaymentPlan.FIELD_TrialPeriodDays))).listEntry (HELPER_ActiveJobCount.getForSQL(dummyActiveJobCount, tl_payment_planPSet.getAttrib (PaymentPlan.FIELD_ActiveJobCount))) .listEntry (objectID.longID ()).toList().toArray());
tl_payment_planPSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
}
package performa.orm.types;
import java.util.*;
import oneit.utils.*;
/**
* This class was generated using constGen.bat.
* DO NOT MODIFY THIS CODE.
* Edit the associated .xml file, and regenerate this file
* constGen (directory) (file minus extension)
* e.g. constGen C:\...\sql FieldType
*/
public class CurrencyType extends AbstractEnumerated
{
public static final EnumeratedFactory FACTORY_CurrencyType = new CurrencyTypeFactory();
public static final CurrencyType AUD = new CurrencyType ("AUD", "AUD", "AUD", false);
public static final CurrencyType NZD = new CurrencyType ("NZD", "NZD", "NZD", false);
public static final CurrencyType EUR = new CurrencyType ("EUR", "EUR", "EUR", false);
public static final CurrencyType GBP = new CurrencyType ("GBP", "GBP", "GBP", false);
public static final CurrencyType USD = new CurrencyType ("USD", "USD", "USD", false);
public static final CurrencyType SGD = new CurrencyType ("SGD", "SGD", "SGD", false);
private static final CurrencyType[] allCurrencyTypes =
new CurrencyType[] { AUD,NZD,EUR,GBP,USD,SGD};
private static CurrencyType[] getAllCurrencyTypes ()
{
return allCurrencyTypes;
}
private CurrencyType (String name, String value, String description, boolean disabled)
{
super (name, value, description, disabled);
}
public static final Comparator COMPARE_BY_POSITION = new CompareEnumByPosition (allCurrencyTypes);
static
{
defineAdditionalData ();
}
public boolean isEqual (CurrencyType other)
{
return this.name.equals (other.name);
}
public Enumeration getAllInstances ()
{
return CurrencyType.getAll ();
}
private Object readResolve() throws java.io.ObjectStreamException
{
return CurrencyType.forName (this.name);
}
public EnumeratedFactory getFactory ()
{
return FACTORY_CurrencyType;
}
public static CurrencyType forName (String name)
{
if (name == null) { return null; }
CurrencyType[] all = getAllCurrencyTypes();
int enumIndex = AbstractEnumerated.getIndexForName (all, name);
return all[enumIndex];
}
public static CurrencyType forValue (String value)
{
if (value == null) { return null; }
CurrencyType[] all = getAllCurrencyTypes();
int enumIndex = AbstractEnumerated.getIndexForValue (getAllCurrencyTypes (), value);
return all[enumIndex];
}
public static java.util.Enumeration getAll ()
{
return AbstractEnumerated.getAll (getAllCurrencyTypes());
}
public static CurrencyType[] getCurrencyTypeArray ()
{
return (CurrencyType[])getAllCurrencyTypes().clone ();
}
public static void defineAdditionalData ()
{
}
static class CurrencyTypeFactory implements EnumeratedFactory
{
public AbstractEnumerated getForName (String name)
{
return CurrencyType.forName (name);
}
public AbstractEnumerated getForValue (String name)
{
return CurrencyType.forValue (name);
}
public Enumeration getAll ()
{
return CurrencyType.getAll ();
}
}
public Map getAdditionalAttributes ()
{
Map attribs = new HashMap ();
return attribs;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<ROOT>
<CONSTANT package="performa.orm.types" name="CurrencyType">
<VALUE name="AUD" description="AUD" />
<VALUE name="NZD" description="NZD" />
<VALUE name="EUR" description="EUR" />
<VALUE name="GBP" description="GBP" />
<VALUE name="USD" description="USD" />
<VALUE name="SGD" description="SGD" />
</CONSTANT>
</ROOT>
package performa.orm.types;
import java.util.*;
import oneit.utils.*;
/**
* This class was generated using constGen.bat.
* DO NOT MODIFY THIS CODE.
* Edit the associated .xml file, and regenerate this file
* constGen (directory) (file minus extension)
* e.g. constGen C:\...\sql FieldType
*/
public class Interval extends AbstractEnumerated
{
public static final EnumeratedFactory FACTORY_Interval = new IntervalFactory();
public static final Interval DAY = new Interval ("DAY", "DAY", "Day", false);
public static final Interval WEEK = new Interval ("WEEK", "WEEK", "Week", false);
public static final Interval MONTH = new Interval ("MONTH", "MONTH", "Month", false);
public static final Interval YEAR = new Interval ("YEAR", "YEAR", "Year", false);
private static final Interval[] allIntervals =
new Interval[] { DAY,WEEK,MONTH,YEAR};
private static Interval[] getAllIntervals ()
{
return allIntervals;
}
private Interval (String name, String value, String description, boolean disabled)
{
super (name, value, description, disabled);
}
public static final Comparator COMPARE_BY_POSITION = new CompareEnumByPosition (allIntervals);
static
{
defineAdditionalData ();
}
public boolean isEqual (Interval other)
{
return this.name.equals (other.name);
}
public Enumeration getAllInstances ()
{
return Interval.getAll ();
}
private Object readResolve() throws java.io.ObjectStreamException
{
return Interval.forName (this.name);
}
public EnumeratedFactory getFactory ()
{
return FACTORY_Interval;
}
public static Interval forName (String name)
{
if (name == null) { return null; }
Interval[] all = getAllIntervals();
int enumIndex = AbstractEnumerated.getIndexForName (all, name);
return all[enumIndex];
}
public static Interval forValue (String value)
{
if (value == null) { return null; }
Interval[] all = getAllIntervals();
int enumIndex = AbstractEnumerated.getIndexForValue (getAllIntervals (), value);
return all[enumIndex];
}
public static java.util.Enumeration getAll ()
{
return AbstractEnumerated.getAll (getAllIntervals());
}
public static Interval[] getIntervalArray ()
{
return (Interval[])getAllIntervals().clone ();
}
public static void defineAdditionalData ()
{
}
static class IntervalFactory implements EnumeratedFactory
{
public AbstractEnumerated getForName (String name)
{
return Interval.forName (name);
}
public AbstractEnumerated getForValue (String name)
{
return Interval.forValue (name);
}
public Enumeration getAll ()
{
return Interval.getAll ();
}
}
public Map getAdditionalAttributes ()
{
Map attribs = new HashMap ();
return attribs;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<ROOT>
<CONSTANT package="performa.orm.types" name="Interval">
<VALUE name="DAY" description="Day" />
<VALUE name="WEEK" description="Week" />
<VALUE name="MONTH" description="Month" />
<VALUE name="YEAR" description="Year" />
</CONSTANT>
</ROOT>
\ No newline at end of file
......@@ -23,6 +23,7 @@ import oneit.servlets.utils.BaseHttpServletResponse;
import oneit.servlets.utils.decorator.ServletDecorator;
import oneit.servlets.utils.decorator.ServletDecoratorConfig;
import oneit.utils.*;
import oneit.utils.parsers.FieldException;
import performa.orm.Candidate;
import performa.orm.CompanyUser;
import performa.orm.Company;
......@@ -78,7 +79,7 @@ public class PerformaOAuthCallbackDecorator implements ServletDecorator, Initial
{
SecUser secUser = loginHandler.getOrCreateSecuser(request, transaction);
if(fullURL.contains(WebUtils.APPLICANT_PORTAL))
if(fullURL.contains(WebUtils.APPLICANT_PORTAL) && !secUser.hasPrivilege(Utils.PRIV_ACCESS_ADMIN_PORTAL))
{
secUser.addRole(Role.searchNAME(secUser.getTransaction(), Utils.ROLE_APPLICANT));
......@@ -86,7 +87,7 @@ public class PerformaOAuthCallbackDecorator implements ServletDecorator, Initial
candidate.setUser(secUser);
}
else if(fullURL.contains(WebUtils.ADMIN_PORTAL))
else if(fullURL.contains(WebUtils.ADMIN_PORTAL) && !secUser.hasPrivilege(Utils.PRIV_ACCESS_APPLICANT_PORTAL))
{
secUser.addRole(Role.searchNAME(secUser.getTransaction(), Utils.ROLE_CLIENT));
secUser.addRole(Role.searchNAME(secUser.getTransaction(), Utils.ROLE_COMPANY_ADMIN));
......
......@@ -6,23 +6,35 @@ import com.stripe.exception.APIException;
import com.stripe.exception.AuthenticationException;
import com.stripe.exception.CardException;
import com.stripe.exception.InvalidRequestException;
import com.stripe.model.Card;
import com.stripe.model.Customer;
import com.stripe.model.Event;
import com.stripe.model.Invoice;
import com.stripe.model.Plan;
import com.stripe.model.Subscription;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import oneit.appservices.config.ConfigMgr;
import oneit.logging.LogLevel;
import oneit.logging.LogMgr;
import oneit.logging.LoggingArea;
import oneit.objstore.ObjectTransaction;
import oneit.objstore.StorageException;
import oneit.objstore.rdbms.filters.EqualsFilter;
import oneit.security.SecUser;
import oneit.utils.DateDiff;
import oneit.utils.parsers.FieldException;
import performa.orm.Company;
import performa.orm.CompanyUser;
import performa.orm.PaymentPlan;
import spark.utils.IOUtils;
public class StripeUtils
......@@ -53,6 +65,7 @@ public class StripeUtils
company.setStripeReference(customer.getId());
LogMgr.log(LoggingArea.ALL, LogLevel.PROCESSING1, "Create customer in stripe : ", customer);
}
catch (StorageException | AuthenticationException | InvalidRequestException | APIConnectionException | CardException | APIException ex)
{
......@@ -61,6 +74,78 @@ public class StripeUtils
}
public static Card updateCardDetails(Company company, String token) throws FieldException
{
try
{
if(company.getStripeReference() == null)
{
createCustomer(company.getAddedByUser());
}
Customer customer = Customer.retrieve(company.getStripeReference());
Map<String, Object> updateParams = new HashMap<>();
updateParams.put("source", token);
customer = customer.update(updateParams);
Card card = (Card) customer.getSources().retrieve(customer.getDefaultSource());
LogMgr.log(LoggingArea.ALL, LogLevel.PROCESSING1, "Update card details in stripe, customer : ", customer, " card : ", card);
return card;
}
catch (StorageException | AuthenticationException | InvalidRequestException | APIConnectionException | CardException | APIException ex)
{
LogMgr.log(LoggingArea.ALL, LogLevel.PROCESSING1, ex, "Error while updating a customer in stripe");
}
return null;
}
public static Card retrieveCard(Company company) throws FieldException
{
try
{
Customer customer = Customer.retrieve(company.getStripeReference());
return (Card) customer.getSources().retrieve(customer.getDefaultSource());
}
catch (StorageException | AuthenticationException | InvalidRequestException | APIConnectionException | CardException | APIException ex)
{
LogMgr.log(LoggingArea.ALL, LogLevel.PROCESSING1, ex, "Error while updating a customer in stripe");
}
return null;
}
public static List<Invoice> retrieveInvoices(Company company) throws FieldException
{
if(company.getStripeSubscription() != null)
{
try
{
Map<String, Object> invoiceParams = new HashMap<>();
invoiceParams.put("customer", company.getStripeReference());
return Invoice.list(invoiceParams).getData();
}
catch (StorageException | AuthenticationException | InvalidRequestException | APIConnectionException | CardException | APIException ex)
{
LogMgr.log(LoggingArea.ALL, LogLevel.PROCESSING1, ex, "Error while retriving invoices in stripe for subscription: " + company.getStripeSubscription());
}
}
return new ArrayList<>();
}
public static void subscribeCustomer(Company company) throws FieldException
{
try
......@@ -83,6 +168,54 @@ public class StripeUtils
Subscription subscription = Subscription.create(params);
LogMgr.log(LoggingArea.ALL, LogLevel.PROCESSING1, "Subscribing customer in stripe : ", subscription);
company.setStripeSubscription(subscription.getId());
}
catch (StorageException | AuthenticationException | InvalidRequestException | APIConnectionException | CardException | APIException ex)
{
LogMgr.log(LoggingArea.ALL, LogLevel.PROCESSING1, ex, "Error while creating subscrition in stripe");
}
}
public static void updatePlan(Company company) throws FieldException
{
try
{
Subscription subscription = null;
PaymentPlan paymentPlan = company.getPaymentPlan();
Map<String, Object> item = new HashMap<>();
if(company.getStripeSubscription() != null)
{
subscription = Subscription.retrieve(company.getStripeSubscription());
item.put("id", subscription.getSubscriptionItems().getData().get(0).getId());
}
item.put("plan", paymentPlan.getStripeReference());
Map<String, Object> items = new HashMap<>();
items.put("0", item);
Map<String, Object> params = new HashMap<>();
params.put("items", items);
if(subscription != null)
{
subscription.update(params);
}
else
{
params.put("customer", company.getStripeReference());
subscription = Subscription.create(params);
}
LogMgr.log(LoggingArea.ALL, LogLevel.PROCESSING1, "Subscribing customer in stripe : ", subscription);
company.setStripeSubscription(subscription.getId());
}
catch (StorageException | AuthenticationException | InvalidRequestException | APIConnectionException | CardException | APIException ex)
......@@ -90,4 +223,51 @@ public class StripeUtils
LogMgr.log(LoggingArea.ALL, LogLevel.PROCESSING1, ex, "Error while creating subscrition in stripe");
}
}
public static void handleWebhook(HttpServletRequest request, ObjectTransaction objTran) throws FieldException
{
try
{
String rawJson = IOUtils.toString(request.getInputStream());
Event event = Event.GSON.fromJson(rawJson, Event.class);
LogMgr.log(LoggingArea.ALL, LogLevel.PROCESSING1, "Event received from stripe : ", event);
if (event != null && event.getType().equals("invoice.payment_succeeded"))
{
Invoice invoice = (Invoice) event.getData().getObject();
LogMgr.log(LoggingArea.ALL, LogLevel.PROCESSING1, "Payment Succeeded event received from stripe with invoice : ", invoice);
if(invoice.getBilling().equals("charge_automatically"))
{
Company[] companies = Company.SearchByAll().andStripeReference(new EqualsFilter<>(invoice.getCustomer())).search(objTran);
if(companies != null && companies.length > 0)
{
Company company = companies[0];
Date invoiceDate = new Date(invoice.getDate() * 1000L);
if(company.getPlanRenewedOn() == null || !DateDiff.startOfDay(invoiceDate).equals(DateDiff.startOfDay(company.getPlanRenewedOn())))
{
if(company.getPlanRenewedOn() != null)
{
company.setUsedCredits(0);
}
company.setPlanRenewedOn(invoiceDate);
}
LogMgr.log(LoggingArea.ALL, LogLevel.PROCESSING1, "Setting company with reset plan details : ", company);
}
}
}
}
catch (IOException ex)
{
LogMgr.log(LoggingArea.ALL, LogLevel.PROCESSING1, ex, "Error while handling webhook");
}
}
}
......@@ -519,4 +519,18 @@ public class Utils
return SecUserToNameTransform.INSTANCE.transform(companyUser.getUser());
}
}
public static PaymentPlan[] getPaymentPlansForJobs(ObjectTransaction objTran)
{
return PaymentPlan.SearchByAll()
.andActiveJobCount(new IsNotNullFilter<>())
.search(objTran);
}
public static PaymentPlan getMaximumPaymentPlan(ObjectTransaction objTran)
{
return PaymentPlan.SearchByMax().search(objTran);
}
}
\ No newline at end of file
......@@ -25,6 +25,10 @@ public class WebUtils
public static final String JOB_REVIEW = "JobReview";
public static final String APPLY_JOB = "ApplyJob";
public static final String JOB_APPLICATION = "JobApplication";
public static final String JOB_PAYMENT = "JobPayment";
public static final String CARD_PAYMENT = "CardPayment";
public static final String REPLACE_CARD = "ReplaceCard";
public static final String EDIT_CARD = "EditCard";
public static final String CREATED_JOB = "CreatedJob";
public static final String EDIT_JOB = "EditJob";
public static final String JOBS = "Jobs";
......@@ -147,6 +151,10 @@ public class WebUtils
renderMode.equals(WORKPLACE_CULTURE) ||
renderMode.equals(JOB_MATCH) ||
renderMode.equals(JOB_REVIEW) ||
renderMode.equals(JOB_PAYMENT) ||
renderMode.equals(CARD_PAYMENT) ||
renderMode.equals(REPLACE_CARD) ||
renderMode.equals(EDIT_CARD) ||
renderMode.equals(CREATED_JOB);
}
......
......@@ -810,7 +810,7 @@ span.checkbox.checked + .slider:before {-webkit-transform: translateX(18px);-ms-
margin-bottom: 15px;
}
.form-page-area {
padding: 65px 13.5%;
padding: 65px 10.5%;
background: #fff;
float: left;
width: 100%;
......@@ -844,9 +844,10 @@ span.checkbox.checked + .slider:before {-webkit-transform: translateX(18px);-ms-
font-size: 15px;
text-align: center;
border-color: #03a0e7;
width: 400px;
width: 300px;
height: 60px;
margin-top: 10px;
margin-right: 20px;
font-weight: 500;
}
.btn.btn-primary.largeBtn.greyBtn, .btn.btn-primary.largeBtn.greyBtn:hover
......@@ -1158,6 +1159,7 @@ span.skill-label span{
font-size: 16px;
top: -2px;
position: relative;
padding-top: 12px;
}
.plan-link a {
text-decoration: underline;
......@@ -2716,7 +2718,7 @@ a.forgot-pass {
text-align: left;
font-size: 26px;
font-weight: 300;
margin-bottom: 24px;
margin-bottom: 15px;
}
.chief-officer span{
color: #ffffff;
......@@ -4613,7 +4615,7 @@ img.alert-icon {float: left;}
.applicant-sidebar {margin-bottom: 15px;width: 100%;}
.main-applicant-content {width: 100%;}
.off-name {font-size: 11px;}
.chief-officer{margin-bottom: 15px;}
.chief-officer{margin-bottom: 12px;}
.job-status-appli{font-size: 9px;}
.edit-btn-dropdown a {height: 34px;line-height: 34px;margin-left: 10px;padding: 0 15px;}
.edit-btn-dropdown img {margin-left: 5px;}
......@@ -5415,15 +5417,54 @@ label, label .label-title span {
font-weight: normal;
}
.company-content-area label
{
.company-content-area label{
font-family: "Usual-Regular";
}
.company-content-area .fileLink
{
.company-content-area .fileLink{
display: none;
}
.company-content-area .grey-area, .billing-content-area .grey-area{
background-color: #EFF0F2;
border-radius: 2px;
padding: 5% 10%;
margin-top: 10px;
}
.company-content-area .line-break, .billing-content-area .line-break{
border: solid 1px #EFF0F2;
display: inline-block;
width: 100%;
margin-top: 5px;
}
.company-content-area .footer-note{
margin-top: 150px;
}
.label-20{
font-size: 20px;
}
.label-14{
font-size: 14px;
}
.company-content-area .bold, .billing-content-area .bold{
font-family: "Usual-Medium";
}
.large-btn, .line-break .large-btn{
width: 50%;
height: 60px;
border-radius: 100px;
font-size: 15px;
font-family: "Usual-Medium";
margin-top: 20px;
}
.edit-card-link
{
text-decoration: underline;
font-size: 13px;
}
.deselected-link{
color: #03a0e7;
}
/*My Company Pages End*/
......@@ -5870,3 +5911,294 @@ input{
color: #9b9b9b;
font-family: "Usual-Light";
}
.ja-exp-fact-c {
color: #4E5258;
font-family: "Usual-Bold";
font-size: 12px;
font-weight: bold;
line-height: 14px;
}
.ja-exp-fact {
color: #4E5258;
font-family: "Usual-Light";
font-size: 12px;
line-height: 24px;
}
.ja-exp-f-c-b-b{
border-bottom: 1px solid #868686;
padding: 0 0 0 0;
}
.ja-exp-f-b-b{
border-bottom: 1px solid #E4E4E4;;
padding: 0 0 0 0;
}
.ja-exp-f-box{
padding: 0 12px;
line-height: 8px;
}
.ja-exp-b-p{
padding-bottom: 0;
}
.ja-exp-fact-score {
color: #667281;
font-family: "Usual-Light";
font-size: 18px;
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;
display: inline-block;
text-align: center;
}
.payment-type-row{
padding-top: 30px;
padding-bottom: 70px;
}
.active-jobs-per-mont {
width: 66px;
color: #8D8D8D;
font-family: "Usual-Light";
font-size: 12px;
display: inline-block;
text-align: left;
vertical-align: middle;
margin-right: 6px;
}
.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: 100%;
color: #777777;
font-family: "Usual-Light";
font-size: 12px;
font-style: italic;
padding-top: 20px;
}
.payment-paln-count{
width: 75px;
font-size: 24px;
text-align: center;
margin-top: 6px;
}
.payment-grey-area{
height: 370px;
}
.pay-subsc-row{
vertical-align: middle;
margin-right: -10px;
margin-left: -10px;
}
.pay-subsc-txt{
margin-top: 7px;
}
.pay-subsc-amt {
color: #03A0E7;
font-family: "Usual-Light";
font-size: 16px;
}
.pay-subsc-det {
color: #777777;
font-family: "Usual-Light";
font-size: 12px;
font-style: italic;
margin-top: 6px;
}
.pay-subsc-det-row{
padding-top: 50px;
margin-bottom: 70px;
}
.pay-subsc-btn-row{
padding-bottom: 40px;
}
.inv-hdr {
color: #4E5258;
font-family: "Usual-Regular";
font-size: 14px;
font-weight: 500;
line-height: 17px;
}
.inv-pdf{
width: 18px;
height: 24px;
}
.inv-amt{
color: #3F84CC;
font-family: "Usual-Regular";
font-size: 14px;
font-weight: 500;
line-height: 17px;
}
.inv-det {
color: #4E5258;
font-family: "Usual-Regular";
font-size: 11px;
font-weight: 500;
line-height: 13px;
}
.inv-des{
color: #4E5258;
font-family: "Usual-Regular";
font-size: 12px;
line-height: 16px;
}
.card-payment label{
font-family: "Usual-Regular";
}
.card-payment .cancel-and-go-back{
color: #8D8D8D;
font-family: "Usual-Regular";
font-size: 14px;
line-height: 17px;
text-align: center;
}
.card-payment .btn-footer{
margin-top: 40px;
}
.card-payment .large-btn{
width: 80%;
}
.card-payment .btn-right{
text-align: right;
}
.info-panel p{
line-height: 0.5;
color: #7d7f82;
font-size: 10px;
padding-top: 5px;
}
.info-toggle{
padding-left: 10px;
display: inline-block;
font-weight: bold;
font-size: 15px;
}
.info-panel{
padding: 0 31.5%;
display: none;
background-color: white;
overflow: hidden;
color: #7d7f82;
font-size: 10px;
}
.subscr-change.disabled button{
background-color: #939393 !important;
border-color: #939393 !important;
}
.footer-note a{
color: #03A0E7;
text-decoration: underline;
}
.select-plan.disabled button{
background-color: #939393 !important;
border-color: #939393 !important;
}
\ No newline at end of file
/*! jQuery UI - v1.11.4 - 2015-08-12
* http://jqueryui.com
* Includes: core.css, draggable.css, resizable.css, selectable.css, sortable.css, accordion.css, autocomplete.css, button.css, datepicker.css, dialog.css, menu.css, progressbar.css, selectmenu.css, slider.css, spinner.css, tabs.css, tooltip.css, theme.css
* To view and modify this theme, visit http://jqueryui.com/themeroller/
* Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */
/* Layout helpers
----------------------------------*/
.ui-helper-hidden {
display: none;
}
.ui-helper-hidden-accessible {
border: 0;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
}
.ui-helper-reset {
margin: 0;
padding: 0;
border: 0;
outline: 0;
line-height: 1.3;
text-decoration: none;
font-size: 100%;
list-style: none;
}
.ui-helper-clearfix:before,
.ui-helper-clearfix:after {
content: "";
display: table;
border-collapse: collapse;
}
.ui-helper-clearfix:after {
clear: both;
}
.ui-helper-clearfix {
min-height: 0; /* support: IE7 */
}
.ui-helper-zfix {
width: 100%;
height: 100%;
top: 0;
left: 0;
position: absolute;
opacity: 0;
filter:Alpha(Opacity=0); /* support: IE8 */
}
.ui-front {
z-index: 100;
}
/* Interaction Cues
----------------------------------*/
.ui-state-disabled {
cursor: default !important;
}
/* Icons
----------------------------------*/
/* states and images */
.ui-icon {
display: block;
text-indent: -99999px;
overflow: hidden;
background-repeat: no-repeat;
}
/* Misc visuals
----------------------------------*/
/* Overlays */
.ui-widget-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.ui-draggable-handle {
-ms-touch-action: none;
touch-action: none;
}
.ui-resizable {
position: relative;
}
.ui-resizable-handle {
position: absolute;
font-size: 0.1px;
display: block;
-ms-touch-action: none;
touch-action: none;
}
.ui-resizable-disabled .ui-resizable-handle,
.ui-resizable-autohide .ui-resizable-handle {
display: none;
}
.ui-resizable-n {
cursor: n-resize;
height: 7px;
width: 100%;
top: -5px;
left: 0;
}
.ui-resizable-s {
cursor: s-resize;
height: 7px;
width: 100%;
bottom: -5px;
left: 0;
}
.ui-resizable-e {
cursor: e-resize;
width: 7px;
right: -5px;
top: 0;
height: 100%;
}
.ui-resizable-w {
cursor: w-resize;
width: 7px;
left: -5px;
top: 0;
height: 100%;
}
.ui-resizable-se {
cursor: se-resize;
width: 12px;
height: 12px;
right: 1px;
bottom: 1px;
}
.ui-resizable-sw {
cursor: sw-resize;
width: 9px;
height: 9px;
left: -5px;
bottom: -5px;
}
.ui-resizable-nw {
cursor: nw-resize;
width: 9px;
height: 9px;
left: -5px;
top: -5px;
}
.ui-resizable-ne {
cursor: ne-resize;
width: 9px;
height: 9px;
right: -5px;
top: -5px;
}
.ui-selectable {
-ms-touch-action: none;
touch-action: none;
}
.ui-selectable-helper {
position: absolute;
z-index: 100;
border: 1px dotted black;
}
.ui-sortable-handle {
-ms-touch-action: none;
touch-action: none;
}
.ui-accordion .ui-accordion-header {
display: block;
cursor: pointer;
position: relative;
margin: 2px 0 0 0;
padding: .5em .5em .5em .7em;
min-height: 0; /* support: IE7 */
font-size: 100%;
}
.ui-accordion .ui-accordion-icons {
padding-left: 2.2em;
}
.ui-accordion .ui-accordion-icons .ui-accordion-icons {
padding-left: 2.2em;
}
.ui-accordion .ui-accordion-header .ui-accordion-header-icon {
position: absolute;
left: .5em;
top: 50%;
margin-top: -8px;
}
.ui-accordion .ui-accordion-content {
padding: 1em 2.2em;
border-top: 0;
overflow: auto;
}
.ui-autocomplete {
position: absolute;
top: 0;
left: 0;
cursor: default;
}
.ui-autocomplete-loading { background:url(images/loading.gif) no-repeat right center }
.ui-button {
display: inline-block;
position: relative;
padding: 0;
line-height: normal;
margin-right: .1em;
cursor: pointer;
vertical-align: middle;
text-align: center;
overflow: visible; /* removes extra width in IE */
}
.ui-button,
.ui-button:link,
.ui-button:visited,
.ui-button:hover,
.ui-button:active {
text-decoration: none;
}
/* to make room for the icon, a width needs to be set here */
.ui-button-icon-only {
width: 2.2em;
}
/* button elements seem to need a little more width */
button.ui-button-icon-only {
width: 2.4em;
}
.ui-button-icons-only {
width: 3.4em;
}
button.ui-button-icons-only {
width: 3.7em;
}
/* button text element */
.ui-button .ui-button-text {
display: block;
line-height: normal;
}
.ui-button-text-only .ui-button-text {
padding: .4em 1em;
}
.ui-button-icon-only .ui-button-text,
.ui-button-icons-only .ui-button-text {
padding: .4em;
text-indent: -9999999px;
}
.ui-button-text-icon-primary .ui-button-text,
.ui-button-text-icons .ui-button-text {
padding: .4em 1em .4em 2.1em;
}
.ui-button-text-icon-secondary .ui-button-text,
.ui-button-text-icons .ui-button-text {
padding: .4em 2.1em .4em 1em;
}
.ui-button-text-icons .ui-button-text {
padding-left: 2.1em;
padding-right: 2.1em;
}
/* no icon support for input elements, provide padding by default */
input.ui-button {
padding: .4em 1em;
}
/* button icon element(s) */
.ui-button-icon-only .ui-icon,
.ui-button-text-icon-primary .ui-icon,
.ui-button-text-icon-secondary .ui-icon,
.ui-button-text-icons .ui-icon,
.ui-button-icons-only .ui-icon {
position: absolute;
top: 50%;
margin-top: -8px;
}
.ui-button-icon-only .ui-icon {
left: 50%;
margin-left: -8px;
}
.ui-button-text-icon-primary .ui-button-icon-primary,
.ui-button-text-icons .ui-button-icon-primary,
.ui-button-icons-only .ui-button-icon-primary {
left: .5em;
}
.ui-button-text-icon-secondary .ui-button-icon-secondary,
.ui-button-text-icons .ui-button-icon-secondary,
.ui-button-icons-only .ui-button-icon-secondary {
right: .5em;
}
/* button sets */
.ui-buttonset {
margin-right: 7px;
}
.ui-buttonset .ui-button {
margin-left: 0;
margin-right: -.3em;
}
/* workarounds */
/* reset extra padding in Firefox, see h5bp.com/l */
input.ui-button::-moz-focus-inner,
button.ui-button::-moz-focus-inner {
border: 0;
padding: 0;
}
.ui-datepicker {
width: 17em;
padding: .2em .2em 0;
display: none;
}
.ui-datepicker .ui-datepicker-header {
position: relative;
padding: .2em 0;
}
.ui-datepicker .ui-datepicker-prev,
.ui-datepicker .ui-datepicker-next {
position: absolute;
top: 2px;
width: 1.8em;
height: 1.8em;
}
.ui-datepicker .ui-datepicker-prev-hover,
.ui-datepicker .ui-datepicker-next-hover {
top: 1px;
}
.ui-datepicker .ui-datepicker-prev {
left: 2px;
}
.ui-datepicker .ui-datepicker-next {
right: 2px;
}
.ui-datepicker .ui-datepicker-prev-hover {
left: 1px;
}
.ui-datepicker .ui-datepicker-next-hover {
right: 1px;
}
.ui-datepicker .ui-datepicker-prev span,
.ui-datepicker .ui-datepicker-next span {
display: block;
position: absolute;
left: 50%;
margin-left: -8px;
top: 50%;
margin-top: -8px;
}
.ui-datepicker .ui-datepicker-title {
margin: 0 2.3em;
line-height: 1.8em;
text-align: center;
}
.ui-datepicker .ui-datepicker-title select {
font-size: 1em;
margin: 1px 0;
}
.ui-datepicker select.ui-datepicker-month,
.ui-datepicker select.ui-datepicker-year {
width: 45%;
}
.ui-datepicker table {
width: 100%;
font-size: .9em;
border-collapse: collapse;
margin: 0 0 .4em;
}
.ui-datepicker th {
padding: .7em .3em;
text-align: center;
font-weight: bold;
border: 0;
}
.ui-datepicker td {
border: 0;
padding: 1px;
}
.ui-datepicker td span,
.ui-datepicker td a {
display: block;
padding: .2em;
text-align: right;
text-decoration: none;
}
.ui-datepicker .ui-datepicker-buttonpane {
background-image: none;
margin: .7em 0 0 0;
padding: 0 .2em;
border-left: 0;
border-right: 0;
border-bottom: 0;
}
.ui-datepicker .ui-datepicker-buttonpane button {
float: right;
margin: .5em .2em .4em;
cursor: pointer;
padding: .2em .6em .3em .6em;
width: auto;
overflow: visible;
}
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {
float: left;
}
/* with multiple calendars */
.ui-datepicker.ui-datepicker-multi {
width: auto;
}
.ui-datepicker-multi .ui-datepicker-group {
float: left;
}
.ui-datepicker-multi .ui-datepicker-group table {
width: 95%;
margin: 0 auto .4em;
}
.ui-datepicker-multi-2 .ui-datepicker-group {
width: 50%;
}
.ui-datepicker-multi-3 .ui-datepicker-group {
width: 33.3%;
}
.ui-datepicker-multi-4 .ui-datepicker-group {
width: 25%;
}
.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,
.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header {
border-left-width: 0;
}
.ui-datepicker-multi .ui-datepicker-buttonpane {
clear: left;
}
.ui-datepicker-row-break {
clear: both;
width: 100%;
font-size: 0;
}
/* RTL support */
.ui-datepicker-rtl {
direction: rtl;
}
.ui-datepicker-rtl .ui-datepicker-prev {
right: 2px;
left: auto;
}
.ui-datepicker-rtl .ui-datepicker-next {
left: 2px;
right: auto;
}
.ui-datepicker-rtl .ui-datepicker-prev:hover {
right: 1px;
left: auto;
}
.ui-datepicker-rtl .ui-datepicker-next:hover {
left: 1px;
right: auto;
}
.ui-datepicker-rtl .ui-datepicker-buttonpane {
clear: right;
}
.ui-datepicker-rtl .ui-datepicker-buttonpane button {
float: left;
}
.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,
.ui-datepicker-rtl .ui-datepicker-group {
float: right;
}
.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,
.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header {
border-right-width: 0;
border-left-width: 1px;
}
.ui-dialog {
overflow: hidden;
position: absolute;
top: 0;
left: 0;
padding: .2em;
outline: 0;
}
.ui-dialog .ui-dialog-titlebar {
padding: .4em 1em;
position: relative;
}
.ui-dialog .ui-dialog-title {
float: left;
margin: .1em 0;
white-space: nowrap;
width: 90%;
overflow: hidden;
text-overflow: ellipsis;
}
.ui-dialog .ui-dialog-titlebar-close {
position: absolute;
right: .3em;
top: 50%;
width: 20px;
margin: -10px 0 0 0;
padding: 1px;
height: 20px;
}
.ui-dialog .ui-dialog-content {
position: relative;
border: 0;
padding: .5em 1em;
background: none;
overflow: auto;
}
.ui-dialog .ui-dialog-buttonpane {
text-align: left;
border-width: 1px 0 0 0;
background-image: none;
margin-top: .5em;
padding: .3em 1em .5em .4em;
}
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
float: right;
}
.ui-dialog .ui-dialog-buttonpane button {
margin: .5em .4em .5em 0;
cursor: pointer;
}
.ui-dialog .ui-resizable-se {
width: 12px;
height: 12px;
right: -5px;
bottom: -5px;
background-position: 16px 16px;
}
.ui-draggable .ui-dialog-titlebar {
cursor: move;
}
.ui-menu {
list-style: none;
padding: 0;
margin: 0;
display: block;
outline: none;
}
.ui-menu .ui-menu {
position: absolute;
}
.ui-menu .ui-menu-item {
position: relative;
margin: 0;
padding: 3px 1em 3px .4em;
cursor: pointer;
min-height: 0; /* support: IE7 */
/* support: IE10, see #8844 */
list-style-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7");
}
.ui-menu .ui-menu-divider {
margin: 5px 0;
height: 0;
font-size: 0;
line-height: 0;
border-width: 1px 0 0 0;
}
.ui-menu .ui-state-focus,
.ui-menu .ui-state-active {
margin: -1px;
}
/* icon support */
.ui-menu-icons {
position: relative;
}
.ui-menu-icons .ui-menu-item {
padding-left: 2em;
}
/* left-aligned */
.ui-menu .ui-icon {
position: absolute;
top: 0;
bottom: 0;
left: .2em;
margin: auto 0;
}
/* right-aligned */
.ui-menu .ui-menu-icon {
left: auto;
right: 0;
}
.ui-progressbar {
height: 2em;
text-align: left;
overflow: hidden;
}
.ui-progressbar .ui-progressbar-value {
margin: -1px;
height: 100%;
}
.ui-progressbar .ui-progressbar-overlay {
background: url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw==");
height: 100%;
filter: alpha(opacity=25); /* support: IE8 */
opacity: 0.25;
}
.ui-progressbar-indeterminate .ui-progressbar-value {
background-image: none;
}
.ui-selectmenu-menu {
padding: 0;
margin: 0;
position: absolute;
top: 0;
left: 0;
display: none;
}
.ui-selectmenu-menu .ui-menu {
overflow: auto;
/* Support: IE7 */
overflow-x: hidden;
padding-bottom: 1px;
}
.ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup {
font-size: 1em;
font-weight: bold;
line-height: 1.5;
padding: 2px 0.4em;
margin: 0.5em 0 0 0;
height: auto;
border: 0;
}
.ui-selectmenu-open {
display: block;
}
.ui-selectmenu-button {
display: inline-block;
overflow: hidden;
position: relative;
text-decoration: none;
cursor: pointer;
}
.ui-selectmenu-button span.ui-icon {
right: 0.5em;
left: auto;
margin-top: -8px;
position: absolute;
top: 50%;
}
.ui-selectmenu-button span.ui-selectmenu-text {
text-align: left;
padding: 0.4em 2.1em 0.4em 1em;
display: block;
line-height: 1.4;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.ui-slider {
position: relative;
text-align: left;
}
.ui-slider .ui-slider-handle {
position: absolute;
z-index: 2;
width: 1.2em;
height: 1.2em;
cursor: default;
-ms-touch-action: none;
touch-action: none;
}
.ui-slider .ui-slider-range {
position: absolute;
z-index: 1;
font-size: .7em;
display: block;
border: 0;
background-position: 0 0;
}
/* support: IE8 - See #6727 */
.ui-slider.ui-state-disabled .ui-slider-handle,
.ui-slider.ui-state-disabled .ui-slider-range {
filter: inherit;
}
.ui-slider-horizontal {
height: .8em;
}
.ui-slider-horizontal .ui-slider-handle {
top: -.3em;
margin-left: -.6em;
}
.ui-slider-horizontal .ui-slider-range {
top: 0;
height: 100%;
}
.ui-slider-horizontal .ui-slider-range-min {
left: 0;
}
.ui-slider-horizontal .ui-slider-range-max {
right: 0;
}
.ui-slider-vertical {
width: .8em;
height: 100px;
}
.ui-slider-vertical .ui-slider-handle {
left: -.3em;
margin-left: 0;
margin-bottom: -.6em;
}
.ui-slider-vertical .ui-slider-range {
left: 0;
width: 100%;
}
.ui-slider-vertical .ui-slider-range-min {
bottom: 0;
}
.ui-slider-vertical .ui-slider-range-max {
top: 0;
}
.ui-spinner {
position: relative;
display: inline-block;
overflow: hidden;
padding: 0;
vertical-align: middle;
}
.ui-spinner-input {
border: none;
background: none;
color: inherit;
padding: 0;
margin: .2em 0;
vertical-align: middle;
margin-left: .4em;
margin-right: 22px;
}
.ui-spinner-button {
width: 16px;
height: 50%;
font-size: .5em;
padding: 0;
margin: 0;
text-align: center;
position: absolute;
cursor: default;
display: block;
overflow: hidden;
right: 0;
}
/* more specificity required here to override default borders */
.ui-spinner a.ui-spinner-button {
border-top: none;
border-bottom: none;
border-right: none;
}
/* vertically center icon */
.ui-spinner .ui-icon {
position: absolute;
margin-top: -8px;
top: 50%;
left: 0;
}
.ui-spinner-up {
top: 0;
}
.ui-spinner-down {
bottom: 0;
}
/* TR overrides */
.ui-spinner .ui-icon-triangle-1-s {
/* need to fix icons sprite */
background-position: -65px -16px;
}
.ui-tabs {
position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
padding: .2em;
}
.ui-tabs .ui-tabs-nav {
margin: 0;
padding: .2em .2em 0;
}
.ui-tabs .ui-tabs-nav li {
list-style: none;
float: left;
position: relative;
top: 0;
margin: 1px .2em 0 0;
border-bottom-width: 0;
padding: 0;
white-space: nowrap;
}
.ui-tabs .ui-tabs-nav .ui-tabs-anchor {
float: left;
padding: .5em 1em;
text-decoration: none;
}
.ui-tabs .ui-tabs-nav li.ui-tabs-active {
margin-bottom: -1px;
padding-bottom: 1px;
}
.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,
.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,
.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor {
cursor: text;
}
.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor {
cursor: pointer;
}
.ui-tabs .ui-tabs-panel {
display: block;
border-width: 0;
padding: 1em 1.4em;
background: none;
}
.ui-tooltip {
padding: 8px;
position: absolute;
z-index: 9999;
max-width: 300px;
-webkit-box-shadow: 0 0 5px #aaa;
box-shadow: 0 0 5px #aaa;
}
body .ui-tooltip {
border-width: 2px;
}
/* Component containers
----------------------------------*/
.ui-widget {
font-family: Verdana,Arial,sans-serif;
font-size: 1.1em;
}
.ui-widget .ui-widget {
font-size: 1em;
}
.ui-widget input,
.ui-widget select,
.ui-widget textarea,
.ui-widget button {
font-family: Verdana,Arial,sans-serif;
font-size: 1em;
}
.ui-widget-content {
border: 1px solid #aaaaaa;
background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x;
color: #222222;
}
.ui-widget-content a {
color: #222222;
}
.ui-widget-header {
border: 1px solid #aaaaaa;
background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x;
color: #222222;
font-weight: bold;
}
.ui-widget-header a {
color: #222222;
}
/* Interaction states
----------------------------------*/
.ui-state-default,
.ui-widget-content .ui-state-default,
.ui-widget-header .ui-state-default {
border: 1px solid #d3d3d3;
background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x;
font-weight: normal;
color: #555555;
}
.ui-state-default a,
.ui-state-default a:link,
.ui-state-default a:visited {
color: #555555;
text-decoration: none;
}
.ui-state-hover,
.ui-widget-content .ui-state-hover,
.ui-widget-header .ui-state-hover,
.ui-state-focus,
.ui-widget-content .ui-state-focus,
.ui-widget-header .ui-state-focus {
border: 1px solid #999999;
background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x;
font-weight: normal;
color: #212121;
}
.ui-state-hover a,
.ui-state-hover a:hover,
.ui-state-hover a:link,
.ui-state-hover a:visited,
.ui-state-focus a,
.ui-state-focus a:hover,
.ui-state-focus a:link,
.ui-state-focus a:visited {
color: #212121;
text-decoration: none;
}
.ui-state-active,
.ui-widget-content .ui-state-active,
.ui-widget-header .ui-state-active {
border: 1px solid #aaaaaa;
background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x;
font-weight: normal;
color: #212121;
}
.ui-state-active a,
.ui-state-active a:link,
.ui-state-active a:visited {
color: #212121;
text-decoration: none;
}
/* Interaction Cues
----------------------------------*/
.ui-state-highlight,
.ui-widget-content .ui-state-highlight,
.ui-widget-header .ui-state-highlight {
border: 1px solid #fcefa1;
background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x;
color: #363636;
}
.ui-state-highlight a,
.ui-widget-content .ui-state-highlight a,
.ui-widget-header .ui-state-highlight a {
color: #363636;
}
.ui-state-error,
.ui-widget-content .ui-state-error,
.ui-widget-header .ui-state-error {
border: 1px solid #cd0a0a;
background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x;
color: #cd0a0a;
}
.ui-state-error a,
.ui-widget-content .ui-state-error a,
.ui-widget-header .ui-state-error a {
color: #cd0a0a;
}
.ui-state-error-text,
.ui-widget-content .ui-state-error-text,
.ui-widget-header .ui-state-error-text {
color: #cd0a0a;
}
.ui-priority-primary,
.ui-widget-content .ui-priority-primary,
.ui-widget-header .ui-priority-primary {
font-weight: bold;
}
.ui-priority-secondary,
.ui-widget-content .ui-priority-secondary,
.ui-widget-header .ui-priority-secondary {
opacity: .7;
filter:Alpha(Opacity=70); /* support: IE8 */
font-weight: normal;
}
.ui-state-disabled,
.ui-widget-content .ui-state-disabled,
.ui-widget-header .ui-state-disabled {
opacity: .35;
filter:Alpha(Opacity=35); /* support: IE8 */
background-image: none;
}
.ui-state-disabled .ui-icon {
filter:Alpha(Opacity=35); /* support: IE8 - See #6059 */
}
/* Icons
----------------------------------*/
/* states and images */
.ui-icon {
width: 16px;
height: 16px;
}
.ui-icon,
.ui-widget-content .ui-icon {
background-image: url(images/ui-icons_222222_256x240.png);
}
.ui-widget-header .ui-icon {
background-image: url(images/ui-icons_222222_256x240.png);
}
.ui-state-default .ui-icon {
background-image: url(images/ui-icons_888888_256x240.png);
}
.ui-state-hover .ui-icon,
.ui-state-focus .ui-icon {
background-image: url(images/ui-icons_454545_256x240.png);
}
.ui-state-active .ui-icon {
background-image: url(images/ui-icons_454545_256x240.png);
}
.ui-state-highlight .ui-icon {
background-image: url(images/ui-icons_2e83ff_256x240.png);
}
.ui-state-error .ui-icon,
.ui-state-error-text .ui-icon {
background-image: url(images/ui-icons_cd0a0a_256x240.png);
}
/* positioning */
.ui-icon-blank { background-position: 16px 16px; }
.ui-icon-carat-1-n { background-position: 0 0; }
.ui-icon-carat-1-ne { background-position: -16px 0; }
.ui-icon-carat-1-e { background-position: -32px 0; }
.ui-icon-carat-1-se { background-position: -48px 0; }
.ui-icon-carat-1-s { background-position: -64px 0; }
.ui-icon-carat-1-sw { background-position: -80px 0; }
.ui-icon-carat-1-w { background-position: -96px 0; }
.ui-icon-carat-1-nw { background-position: -112px 0; }
.ui-icon-carat-2-n-s { background-position: -128px 0; }
.ui-icon-carat-2-e-w { background-position: -144px 0; }
.ui-icon-triangle-1-n { background-position: 0 -16px; }
.ui-icon-triangle-1-ne { background-position: -16px -16px; }
.ui-icon-triangle-1-e { background-position: -32px -16px; }
.ui-icon-triangle-1-se { background-position: -48px -16px; }
.ui-icon-triangle-1-s { background-position: -64px -16px; }
.ui-icon-triangle-1-sw { background-position: -80px -16px; }
.ui-icon-triangle-1-w { background-position: -96px -16px; }
.ui-icon-triangle-1-nw { background-position: -112px -16px; }
.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
.ui-icon-arrow-1-n { background-position: 0 -32px; }
.ui-icon-arrow-1-ne { background-position: -16px -32px; }
.ui-icon-arrow-1-e { background-position: -32px -32px; }
.ui-icon-arrow-1-se { background-position: -48px -32px; }
.ui-icon-arrow-1-s { background-position: -64px -32px; }
.ui-icon-arrow-1-sw { background-position: -80px -32px; }
.ui-icon-arrow-1-w { background-position: -96px -32px; }
.ui-icon-arrow-1-nw { background-position: -112px -32px; }
.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
.ui-icon-arrow-4 { background-position: 0 -80px; }
.ui-icon-arrow-4-diag { background-position: -16px -80px; }
.ui-icon-extlink { background-position: -32px -80px; }
.ui-icon-newwin { background-position: -48px -80px; }
.ui-icon-refresh { background-position: -64px -80px; }
.ui-icon-shuffle { background-position: -80px -80px; }
.ui-icon-transfer-e-w { background-position: -96px -80px; }
.ui-icon-transferthick-e-w { background-position: -112px -80px; }
.ui-icon-folder-collapsed { background-position: 0 -96px; }
.ui-icon-folder-open { background-position: -16px -96px; }
.ui-icon-document { background-position: -32px -96px; }
.ui-icon-document-b { background-position: -48px -96px; }
.ui-icon-note { background-position: -64px -96px; }
.ui-icon-mail-closed { background-position: -80px -96px; }
.ui-icon-mail-open { background-position: -96px -96px; }
.ui-icon-suitcase { background-position: -112px -96px; }
.ui-icon-comment { background-position: -128px -96px; }
.ui-icon-person { background-position: -144px -96px; }
.ui-icon-print { background-position: -160px -96px; }
.ui-icon-trash { background-position: -176px -96px; }
.ui-icon-locked { background-position: -192px -96px; }
.ui-icon-unlocked { background-position: -208px -96px; }
.ui-icon-bookmark { background-position: -224px -96px; }
.ui-icon-tag { background-position: -240px -96px; }
.ui-icon-home { background-position: 0 -112px; }
.ui-icon-flag { background-position: -16px -112px; }
.ui-icon-calendar { background-position: -32px -112px; }
.ui-icon-cart { background-position: -48px -112px; }
.ui-icon-pencil { background-position: -64px -112px; }
.ui-icon-clock { background-position: -80px -112px; }
.ui-icon-disk { background-position: -96px -112px; }
.ui-icon-calculator { background-position: -112px -112px; }
.ui-icon-zoomin { background-position: -128px -112px; }
.ui-icon-zoomout { background-position: -144px -112px; }
.ui-icon-search { background-position: -160px -112px; }
.ui-icon-wrench { background-position: -176px -112px; }
.ui-icon-gear { background-position: -192px -112px; }
.ui-icon-heart { background-position: -208px -112px; }
.ui-icon-star { background-position: -224px -112px; }
.ui-icon-link { background-position: -240px -112px; }
.ui-icon-cancel { background-position: 0 -128px; }
.ui-icon-plus { background-position: -16px -128px; }
.ui-icon-plusthick { background-position: -32px -128px; }
.ui-icon-minus { background-position: -48px -128px; }
.ui-icon-minusthick { background-position: -64px -128px; }
.ui-icon-close { background-position: -80px -128px; }
.ui-icon-closethick { background-position: -96px -128px; }
.ui-icon-key { background-position: -112px -128px; }
.ui-icon-lightbulb { background-position: -128px -128px; }
.ui-icon-scissors { background-position: -144px -128px; }
.ui-icon-clipboard { background-position: -160px -128px; }
.ui-icon-copy { background-position: -176px -128px; }
.ui-icon-contact { background-position: -192px -128px; }
.ui-icon-image { background-position: -208px -128px; }
.ui-icon-video { background-position: -224px -128px; }
.ui-icon-script { background-position: -240px -128px; }
.ui-icon-alert { background-position: 0 -144px; }
.ui-icon-info { background-position: -16px -144px; }
.ui-icon-notice { background-position: -32px -144px; }
.ui-icon-help { background-position: -48px -144px; }
.ui-icon-check { background-position: -64px -144px; }
.ui-icon-bullet { background-position: -80px -144px; }
.ui-icon-radio-on { background-position: -96px -144px; }
.ui-icon-radio-off { background-position: -112px -144px; }
.ui-icon-pin-w { background-position: -128px -144px; }
.ui-icon-pin-s { background-position: -144px -144px; }
.ui-icon-play { background-position: 0 -160px; }
.ui-icon-pause { background-position: -16px -160px; }
.ui-icon-seek-next { background-position: -32px -160px; }
.ui-icon-seek-prev { background-position: -48px -160px; }
.ui-icon-seek-end { background-position: -64px -160px; }
.ui-icon-seek-start { background-position: -80px -160px; }
/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
.ui-icon-seek-first { background-position: -80px -160px; }
.ui-icon-stop { background-position: -96px -160px; }
.ui-icon-eject { background-position: -112px -160px; }
.ui-icon-volume-off { background-position: -128px -160px; }
.ui-icon-volume-on { background-position: -144px -160px; }
.ui-icon-power { background-position: 0 -176px; }
.ui-icon-signal-diag { background-position: -16px -176px; }
.ui-icon-signal { background-position: -32px -176px; }
.ui-icon-battery-0 { background-position: -48px -176px; }
.ui-icon-battery-1 { background-position: -64px -176px; }
.ui-icon-battery-2 { background-position: -80px -176px; }
.ui-icon-battery-3 { background-position: -96px -176px; }
.ui-icon-circle-plus { background-position: 0 -192px; }
.ui-icon-circle-minus { background-position: -16px -192px; }
.ui-icon-circle-close { background-position: -32px -192px; }
.ui-icon-circle-triangle-e { background-position: -48px -192px; }
.ui-icon-circle-triangle-s { background-position: -64px -192px; }
.ui-icon-circle-triangle-w { background-position: -80px -192px; }
.ui-icon-circle-triangle-n { background-position: -96px -192px; }
.ui-icon-circle-arrow-e { background-position: -112px -192px; }
.ui-icon-circle-arrow-s { background-position: -128px -192px; }
.ui-icon-circle-arrow-w { background-position: -144px -192px; }
.ui-icon-circle-arrow-n { background-position: -160px -192px; }
.ui-icon-circle-zoomin { background-position: -176px -192px; }
.ui-icon-circle-zoomout { background-position: -192px -192px; }
.ui-icon-circle-check { background-position: -208px -192px; }
.ui-icon-circlesmall-plus { background-position: 0 -208px; }
.ui-icon-circlesmall-minus { background-position: -16px -208px; }
.ui-icon-circlesmall-close { background-position: -32px -208px; }
.ui-icon-squaresmall-plus { background-position: -48px -208px; }
.ui-icon-squaresmall-minus { background-position: -64px -208px; }
.ui-icon-squaresmall-close { background-position: -80px -208px; }
.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
/* Misc visuals
----------------------------------*/
/* Corner radius */
.ui-corner-all,
.ui-corner-top,
.ui-corner-left,
.ui-corner-tl {
border-top-left-radius: 4px;
}
.ui-corner-all,
.ui-corner-top,
.ui-corner-right,
.ui-corner-tr {
border-top-right-radius: 4px;
}
.ui-corner-all,
.ui-corner-bottom,
.ui-corner-left,
.ui-corner-bl {
border-bottom-left-radius: 4px;
}
.ui-corner-all,
.ui-corner-bottom,
.ui-corner-right,
.ui-corner-br {
border-bottom-right-radius: 4px;
}
/* Overlays */
.ui-widget-overlay {
background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;
opacity: .3;
filter: Alpha(Opacity=30); /* support: IE8 */
}
.ui-widget-shadow {
margin: -8px 0 0 -8px;
padding: 8px;
background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;
opacity: .3;
filter: Alpha(Opacity=30); /* support: IE8 */
border-radius: 8px;
}
/*
* jQuery UI CSS Framework 1.8.16
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Theming/API
*/
/* Layout helpers
----------------------------------*/
.ui-helper-hidden { display: none; }
.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
.ui-helper-clearfix { display: inline-block; }
/* required comment for clearfix to work in Opera \*/
* html .ui-helper-clearfix { height:1%; }
.ui-helper-clearfix { display:block; }
/* end clearfix */
.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
/* Interaction Cues
----------------------------------*/
.ui-state-disabled { cursor: default !important; }
/* Icons
----------------------------------*/
/* states and images */
.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
/* Misc visuals
----------------------------------*/
/* Overlays */
.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
/*
* jQuery UI CSS Framework 1.8.16
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Theming/API
*
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana,Arial,sans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
*/
/* Component containers
----------------------------------*/
.ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; }
.ui-widget .ui-widget { font-size: 1em; }
.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; }
.ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; }
.ui-widget-content a { color: #222222; }
.ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; }
.ui-widget-header a { color: #222222; }
/* Interaction states
----------------------------------*/
.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; }
.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; }
.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; }
.ui-state-hover a, .ui-state-hover a:hover { color: #212121; text-decoration: none; }
.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; }
.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; text-decoration: none; }
.ui-widget :active { outline: none; }
/* Interaction Cues
----------------------------------*/
.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; }
.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; }
.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; }
.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; }
.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; }
.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
/* Icons
----------------------------------*/
/* states and images */
.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); }
.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
.ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
.ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png); }
.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
.ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); }
.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); }
/* positioning */
.ui-icon-carat-1-n { background-position: 0 0; }
.ui-icon-carat-1-ne { background-position: -16px 0; }
.ui-icon-carat-1-e { background-position: -32px 0; }
.ui-icon-carat-1-se { background-position: -48px 0; }
.ui-icon-carat-1-s { background-position: -64px 0; }
.ui-icon-carat-1-sw { background-position: -80px 0; }
.ui-icon-carat-1-w { background-position: -96px 0; }
.ui-icon-carat-1-nw { background-position: -112px 0; }
.ui-icon-carat-2-n-s { background-position: -128px 0; }
.ui-icon-carat-2-e-w { background-position: -144px 0; }
.ui-icon-triangle-1-n { background-position: 0 -16px; }
.ui-icon-triangle-1-ne { background-position: -16px -16px; }
.ui-icon-triangle-1-e { background-position: -32px -16px; }
.ui-icon-triangle-1-se { background-position: -48px -16px; }
.ui-icon-triangle-1-s { background-position: -64px -16px; }
.ui-icon-triangle-1-sw { background-position: -80px -16px; }
.ui-icon-triangle-1-w { background-position: -96px -16px; }
.ui-icon-triangle-1-nw { background-position: -112px -16px; }
.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
.ui-icon-arrow-1-n { background-position: 0 -32px; }
.ui-icon-arrow-1-ne { background-position: -16px -32px; }
.ui-icon-arrow-1-e { background-position: -32px -32px; }
.ui-icon-arrow-1-se { background-position: -48px -32px; }
.ui-icon-arrow-1-s { background-position: -64px -32px; }
.ui-icon-arrow-1-sw { background-position: -80px -32px; }
.ui-icon-arrow-1-w { background-position: -96px -32px; }
.ui-icon-arrow-1-nw { background-position: -112px -32px; }
.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
.ui-icon-arrow-4 { background-position: 0 -80px; }
.ui-icon-arrow-4-diag { background-position: -16px -80px; }
.ui-icon-extlink { background-position: -32px -80px; }
.ui-icon-newwin { background-position: -48px -80px; }
.ui-icon-refresh { background-position: -64px -80px; }
.ui-icon-shuffle { background-position: -80px -80px; }
.ui-icon-transfer-e-w { background-position: -96px -80px; }
.ui-icon-transferthick-e-w { background-position: -112px -80px; }
.ui-icon-folder-collapsed { background-position: 0 -96px; }
.ui-icon-folder-open { background-position: -16px -96px; }
.ui-icon-document { background-position: -32px -96px; }
.ui-icon-document-b { background-position: -48px -96px; }
.ui-icon-note { background-position: -64px -96px; }
.ui-icon-mail-closed { background-position: -80px -96px; }
.ui-icon-mail-open { background-position: -96px -96px; }
.ui-icon-suitcase { background-position: -112px -96px; }
.ui-icon-comment { background-position: -128px -96px; }
.ui-icon-person { background-position: -144px -96px; }
.ui-icon-print { background-position: -160px -96px; }
.ui-icon-trash { background-position: -176px -96px; }
.ui-icon-locked { background-position: -192px -96px; }
.ui-icon-unlocked { background-position: -208px -96px; }
.ui-icon-bookmark { background-position: -224px -96px; }
.ui-icon-tag { background-position: -240px -96px; }
.ui-icon-home { background-position: 0 -112px; }
.ui-icon-flag { background-position: -16px -112px; }
.ui-icon-calendar { background-position: -32px -112px; }
.ui-icon-cart { background-position: -48px -112px; }
.ui-icon-pencil { background-position: -64px -112px; }
.ui-icon-clock { background-position: -80px -112px; }
.ui-icon-disk { background-position: -96px -112px; }
.ui-icon-calculator { background-position: -112px -112px; }
.ui-icon-zoomin { background-position: -128px -112px; }
.ui-icon-zoomout { background-position: -144px -112px; }
.ui-icon-search { background-position: -160px -112px; }
.ui-icon-wrench { background-position: -176px -112px; }
.ui-icon-gear { background-position: -192px -112px; }
.ui-icon-heart { background-position: -208px -112px; }
.ui-icon-star { background-position: -224px -112px; }
.ui-icon-link { background-position: -240px -112px; }
.ui-icon-cancel { background-position: 0 -128px; }
.ui-icon-plus { background-position: -16px -128px; }
.ui-icon-plusthick { background-position: -32px -128px; }
.ui-icon-minus { background-position: -48px -128px; }
.ui-icon-minusthick { background-position: -64px -128px; }
.ui-icon-close { background-position: -80px -128px; }
.ui-icon-closethick { background-position: -96px -128px; }
.ui-icon-key { background-position: -112px -128px; }
.ui-icon-lightbulb { background-position: -128px -128px; }
.ui-icon-scissors { background-position: -144px -128px; }
.ui-icon-clipboard { background-position: -160px -128px; }
.ui-icon-copy { background-position: -176px -128px; }
.ui-icon-contact { background-position: -192px -128px; }
.ui-icon-image { background-position: -208px -128px; }
.ui-icon-video { background-position: -224px -128px; }
.ui-icon-script { background-position: -240px -128px; }
.ui-icon-alert { background-position: 0 -144px; }
.ui-icon-info { background-position: -16px -144px; }
.ui-icon-notice { background-position: -32px -144px; }
.ui-icon-help { background-position: -48px -144px; }
.ui-icon-check { background-position: -64px -144px; }
.ui-icon-bullet { background-position: -80px -144px; }
.ui-icon-radio-off { background-position: -96px -144px; }
.ui-icon-radio-on { background-position: -112px -144px; }
.ui-icon-pin-w { background-position: -128px -144px; }
.ui-icon-pin-s { background-position: -144px -144px; }
.ui-icon-play { background-position: 0 -160px; }
.ui-icon-pause { background-position: -16px -160px; }
.ui-icon-seek-next { background-position: -32px -160px; }
.ui-icon-seek-prev { background-position: -48px -160px; }
.ui-icon-seek-end { background-position: -64px -160px; }
.ui-icon-seek-start { background-position: -80px -160px; }
/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
.ui-icon-seek-first { background-position: -80px -160px; }
.ui-icon-stop { background-position: -96px -160px; }
.ui-icon-eject { background-position: -112px -160px; }
.ui-icon-volume-off { background-position: -128px -160px; }
.ui-icon-volume-on { background-position: -144px -160px; }
.ui-icon-power { background-position: 0 -176px; }
.ui-icon-signal-diag { background-position: -16px -176px; }
.ui-icon-signal { background-position: -32px -176px; }
.ui-icon-battery-0 { background-position: -48px -176px; }
.ui-icon-battery-1 { background-position: -64px -176px; }
.ui-icon-battery-2 { background-position: -80px -176px; }
.ui-icon-battery-3 { background-position: -96px -176px; }
.ui-icon-circle-plus { background-position: 0 -192px; }
.ui-icon-circle-minus { background-position: -16px -192px; }
.ui-icon-circle-close { background-position: -32px -192px; }
.ui-icon-circle-triangle-e { background-position: -48px -192px; }
.ui-icon-circle-triangle-s { background-position: -64px -192px; }
.ui-icon-circle-triangle-w { background-position: -80px -192px; }
.ui-icon-circle-triangle-n { background-position: -96px -192px; }
.ui-icon-circle-arrow-e { background-position: -112px -192px; }
.ui-icon-circle-arrow-s { background-position: -128px -192px; }
.ui-icon-circle-arrow-w { background-position: -144px -192px; }
.ui-icon-circle-arrow-n { background-position: -160px -192px; }
.ui-icon-circle-zoomin { background-position: -176px -192px; }
.ui-icon-circle-zoomout { background-position: -192px -192px; }
.ui-icon-circle-check { background-position: -208px -192px; }
.ui-icon-circlesmall-plus { background-position: 0 -208px; }
.ui-icon-circlesmall-minus { background-position: -16px -208px; }
.ui-icon-circlesmall-close { background-position: -32px -208px; }
.ui-icon-squaresmall-plus { background-position: -48px -208px; }
.ui-icon-squaresmall-minus { background-position: -64px -208px; }
.ui-icon-squaresmall-close { background-position: -80px -208px; }
.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
/* Misc visuals
----------------------------------*/
/* Corner radius */
.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -khtml-border-top-left-radius: 4px; border-top-left-radius: 4px; }
.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -khtml-border-top-right-radius: 4px; border-top-right-radius: 4px; }
.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -khtml-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; }
.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; -khtml-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
/* Overlays */
.ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); }
.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/*
* jQuery UI Resizable 1.8.16
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Resizable#theming
*/
.ui-resizable { position: relative;}
.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block; }
.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }
.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }
.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/*
* jQuery UI Selectable 1.8.16
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Selectable#theming
*/
.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
/*
* jQuery UI Accordion 1.8.16
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Accordion#theming
*/
/* IE/Win - Fix animation bug - #4615 */
.ui-accordion { width: 100%; }
.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; }
.ui-accordion .ui-accordion-li-fix { display: inline; }
.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; }
.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; }
.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; }
.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; }
.ui-accordion .ui-accordion-content-active { display: block; }
/*
* jQuery UI Autocomplete 1.8.16
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Autocomplete#theming
*/
.ui-autocomplete { position: absolute; cursor: default; }
/* workarounds */
* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
/*
* jQuery UI Menu 1.8.16
*
* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Menu#theming
*/
.ui-menu {
list-style:none;
padding: 2px;
margin: 0;
display:block;
float: left;
}
.ui-menu .ui-menu {
margin-top: -3px;
}
.ui-menu .ui-menu-item {
margin:0;
padding: 0;
zoom: 1;
float: left;
clear: left;
width: 100%;
}
.ui-menu .ui-menu-item a {
text-decoration:none;
display:block;
padding:.2em .4em;
line-height:1.5;
zoom:1;
}
.ui-menu .ui-menu-item a.ui-state-hover,
.ui-menu .ui-menu-item a.ui-state-active {
font-weight: normal;
margin: -1px;
}
/*
* jQuery UI Button 1.8.16
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Button#theming
*/
.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */
.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
.ui-button-icons-only { width: 3.4em; }
button.ui-button-icons-only { width: 3.7em; }
/*button text element */
.ui-button .ui-button-text { display: block; line-height: 1.4; }
.ui-button-text-only .ui-button-text { padding: .4em 1em; }
.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }
.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; }
.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; }
.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }
/* no icon support for input elements, provide padding by default */
input.ui-button { padding: .4em 1em; }
/*button icon element(s) */
.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; }
.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; }
.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; }
.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
/*button sets*/
.ui-buttonset { margin-right: 7px; }
.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }
/* workarounds */
button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
/*
* jQuery UI Dialog 1.8.16
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Dialog#theming
*/
.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; }
.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; }
.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; }
.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; }
.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; }
.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
.ui-draggable .ui-dialog-titlebar { cursor: move; }
/*
* jQuery UI Slider 1.8.16
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Slider#theming
*/
.ui-slider { position: relative; text-align: left; }
.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
.ui-slider-horizontal { height: .8em; }
.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
.ui-slider-horizontal .ui-slider-range-min { left: 0; }
.ui-slider-horizontal .ui-slider-range-max { right: 0; }
.ui-slider-vertical { width: .8em; height: 100px; }
.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
.ui-slider-vertical .ui-slider-range-min { bottom: 0; }
.ui-slider-vertical .ui-slider-range-max { top: 0; }/*
* jQuery UI Tabs 1.8.16
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Tabs#theming
*/
.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; }
.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; }
.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; }
.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; }
.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; }
.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; }
.ui-tabs .ui-tabs-hide { display: none !important; }
/*
* jQuery UI Datepicker 1.8.16
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Datepicker#theming
*/
.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
.ui-datepicker .ui-datepicker-prev { left:2px; }
.ui-datepicker .ui-datepicker-next { right:2px; }
.ui-datepicker .ui-datepicker-prev-hover { left:1px; }
.ui-datepicker .ui-datepicker-next-hover { right:1px; }
.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
.ui-datepicker select.ui-datepicker-month-year {width: 100%;}
.ui-datepicker select.ui-datepicker-month,
.ui-datepicker select.ui-datepicker-year { width: 49%;}
.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
.ui-datepicker td { border: 0; padding: 1px; }
.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
/* with multiple calendars */
.ui-datepicker.ui-datepicker-multi { width:auto; }
.ui-datepicker-multi .ui-datepicker-group { float:left; }
.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
.ui-datepicker-row-break { clear:both; width:100%; font-size:0em; }
/* RTL support */
.ui-datepicker-rtl { direction: rtl; }
.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
.ui-datepicker-rtl .ui-datepicker-group { float:right; }
.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
.ui-datepicker-cover {
display: none; /*sorry for IE5*/
display/**/: block; /*sorry for IE5*/
position: absolute; /*must have*/
z-index: -1; /*must have*/
filter: mask(); /*must have*/
top: -4px; /*must have*/
left: -4px; /*must have*/
width: 200px; /*must have*/
height: 200px; /*must have*/
}/*
* jQuery UI Progressbar 1.8.16
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Progressbar#theming
*/
.ui-progressbar { height:2em; text-align: left; }
.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }
\ No newline at end of file
......@@ -53,6 +53,10 @@
<FORM name="*.saveClient" factory="Participant" class="performa.form.SaveClientFP"/>
<FORM name="*.saveCompany" factory="Participant" class="performa.form.SaveCompanyFP"/>
<FORM name="*.processCulture" factory="Participant" class="performa.form.ProcessCultureFP"/>
<FORM name="*.savePayment" factory="Participant" class="performa.form.MakePaymentFP"/>
<FORM name="*.managePlans" factory="Participant" class="performa.form.ManagePlansFP"/>
<FORM name="*.updateCard" factory="Participant" class="performa.form.UpdateCardFP"/>
<FORM name="*.replaceCard" factory="Participant" class="performa.form.ReplaceCardFP"/>
</NODE>
<NODE name="job_assessment_criteria_add_jsp" factory="Participant">
......@@ -126,6 +130,10 @@
<INHERITS factory="Named" nodename="CoreORMAdminNoPriv"/>
</NODE>
<NODE name="webhook_jsp" factory="Participant">
<INHERITS factory="Named" nodename="CoreORMAdminNoPriv"/>
</NODE>
<NODE name="ORMErrorConfig::ADMIN_PORTAL" factory="Participant" class="oneit.servlets.forms.ErrorReportConfig">
<format item="field.*.error.pageHeader_performa_errorPrefix">
<![CDATA[<div class="error-message message-common"><img src="${contextRoot}/images/error-alert.png" class="alert-icon" /><span class="message-txt" style="font-weight: bold">${translateLabel:Errors_Occurred:Errors occurred, please correct them and try again}</span><br/>]]>
......
......@@ -40,7 +40,11 @@
<RenderMode name="WorkplaceCulture" preIncludeJSP="extensions/adminportal/workplace_culture.jsp"/>
<RenderMode name="JobMatchAssessment" preIncludeJSP="extensions/adminportal/job_match_assessment.jsp"/>
<RenderMode name="JobReview" preIncludeJSP="extensions/adminportal/job_review_submit.jsp"/>
<RenderMode name="JobPayment" preIncludeJSP="extensions/adminportal/job_payment.jsp"/>
<RenderMode name="CardPayment" preIncludeJSP="extensions/adminportal/card_payment.jsp"/>
<RenderMode name="CreatedJob" preIncludeJSP="extensions/adminportal/created_job.jsp"/>
<RenderMode name="ReplaceCard" preIncludeJSP="extensions/adminportal/replace_card_payment.jsp"/>
<RenderMode name="EditCard" preIncludeJSP="extensions/adminportal/edit_card_payment.jsp"/>
</NODE>
</MAP>
......@@ -72,7 +76,12 @@
<NODE name="Config" factory="Participant" class="oneit.business.content.ArticleConfiguration">
<INHERITS nodename="StandardJSP"/>
<RenderMode name="Page" preIncludeJSP="extensions/adminportal/my_company.jsp"/>
<RenderMode name="Page" preIncludeJSP="extensions/adminportal/my_company.jsp"/>
<RenderMode name="ManagePlan" preIncludeJSP="extensions/adminportal/manage_plan.jsp"/>
<RenderMode name="Billing" preIncludeJSP="extensions/adminportal/billing.jsp"/>
<RenderMode name="ReplaceCard" preIncludeJSP="extensions/adminportal/replace_card.jsp"/>
<RenderMode name="EditCard" preIncludeJSP="extensions/adminportal/edit_card.jsp"/>
<RenderMode name="Invoices" preIncludeJSP="extensions/adminportal/invoices.jsp"/>
</NODE>
</MAP>
......@@ -129,6 +138,18 @@
</TASK>
<TASK factory="Participant" class="oneit.appservices.batch.DefaultTask" lockName="performa">
<RUN class="performa.batch.PullStripeDataBatch" factory="Participant"/>
<WHEN factory="MetaComponent" component="BatchSchedule" selector="performa.runbatch">
<NODE name="schedule" class="oneit.appservices.batch.HourlySchedule">
<NODE name="minuteOfHour" factory="Integer" value="1"/>
</NODE>
</WHEN>
</TASK>
<TASK factory="Participant" class="oneit.appservices.batch.DefaultTask" lockName="performa">
<RUN class="performa.batch.URLShortnerBatch" factory="Participant"/>
<WHEN factory="MetaComponent" component="BatchSchedule" selector="performa.runbatch">
......
<%@ page extends="oneit.servlets.jsp.JSPInclude" %>
<%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%>
<%@ include file="/inc/stdcms.jsp" %><%-- This is in cougar --%>
<%@ include file="/extensions/performa/inc/stdimports.jsp" %>
<oneit:dynIncluded>
<%
SecUser loggedInUser = SecUser.getTXUser(transaction);
CompanyUser companyUser = loggedInUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
Company company = companyUser.getCompany();
Debug.assertion(company != null , "Invalid company in admin portal my company");
String nextPage = WebUtils.getSamePageInRenderMode(request, "Billing");
String replaceCardPage = WebUtils.getSamePageInRenderMode(request, "ReplaceCard");
%>
<script type="text/javascript">
$(document).ready(function()
{
recalcFunction = setupRecalc ($("makePayment"), {'recalcOnError':true});
});
</script>
<div class="container-fluid">
<div class="row content">
<div class="main-content-area">
<h1 class="page-title">My Hiring Team</h1>
<div class="my-company-area">
<oneit:form name="makePayment" method="post" enctype="multipart/form-data">
<div style="padding-left: 15px; padding-right: 15px;">
<oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/>
</div>
<oneit:dynInclude page="/extensions/adminportal/inc/my_company_tabs.jsp" TabNumber="3" data="<%= CollectionUtils.EMPTY_MAP%>"/>
<div class="company-content-area">
<!-- Tab panes -->
<div class="tab-content">
<div class="tab-pane active" id="company-detail">
<div class="form-group row">
<div class="col-md-12 col-sm-12 col-xs-12 text-left">
<label class="label-20 pay-subsc-txt">Billing</label><br/>
<span id="card-errors" style="color: #eb1c26; font-size: 15px;"></span>
</div>
</div>
<%
if(company.getCardID() != null)
{
%>
<oneit:dynInclude page="/extensions/adminportal/inc/existing_card.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"
Company="<%= company %>" IsEdit="<%= false %>" IsReplace="<%= false %>"/>
<%
}
else
{
%>
<div class="form-group row">
<div class="col-md-12 col-sm-12 col-xs-12 text-left">
<label class="label-14 bold">Add a payment method</label><br/>
<label class="label-14">Your card details will be saved for future billing</label>
</div>
</div>
<div class="grey-area">
<oneit:dynInclude page="/extensions/adminportal/inc/card_details.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"
Company="<%= company %>" IsEdit="<%= false %>" IsReplace="<%= true %>"/>
</div>
<div class="form-group">
<oneit:button value="Save Card" name="updateCard" cssClass="btn btn-primary btn-green large-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry("Company", company)
.toMap() %>" />
</div>
<%
}
%>
</div>
</div>
</div>
</oneit:form>
<oneit:form name="editCompany" method="post" enctype="multipart/form-data">
<div class="row">
<div class="col-lg-4 col-md-4 col-sm-6">
<div class="form-group hide">
<input type="hidden" name="stripe-token-id" />
</div>
</div>
</div>
<oneit:button value="Pay" name="replaceCard" cssClass="hide" id="payNow"
requestAttribs='<%= CollectionUtils.mapEntry("nextPage", nextPage)
.toMap() %>'/>
</oneit:form>
<script src="https://js.stripe.com/v3/"></script>
<script>
var stripePubKey = '<%= MakePaymentFP.STRIPE_PUB_KEY %>';
</script>
<oneit:script>
<!-- MUST be included after initializing stripePubKey -->
<oneit:script src="/scripts/performaStripe.js"/>
</oneit:script>
</div>
</div>
</div>
</div>
</oneit:dynIncluded>
<%@ page extends="oneit.servlets.jsp.JSPInclude" %>
<%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%>
<%@ include file="/inc/stdcms.jsp" %><%-- This is in cougar --%>
<%@ include file="/extensions/performa/inc/stdimports.jsp" %>
<oneit:dynIncluded>
<%
SecUser loggedInUser = SecUser.getTXUser(transaction);
CompanyUser companyUser = loggedInUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
Company company = companyUser.getCompany();
Job job = (Job) process.getAttribute("Job");
String nextPage = WebUtils.getSamePageInRenderMode(request, WebUtils.CREATED_JOB) + "&JobID=" + job.getObjectID() + "&fromJob=true";
Boolean ppj = (Boolean) process.getAttribute("PPJ");
String jobsPage = WebUtils.getSamePageInRenderMode(request, "Page");
%>
<oneit:form name="makePayment" method="post" enctype="multipart/form-data">
<script type="text/javascript">
$(document).ready(function()
{
recalcFunction = setupRecalc ($("makePayment"), {'recalcOnError':true});
});
</script>
<div class="main-created-job card-payment">
<h1 class="page-title select-payment-optio">
Enter Payment Details
</h1>
<div class="form-page-area billing-content-area">
<oneit:dynInclude page="/extensions/adminportal/inc/payment_plan.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"
Company="<%= company %>" Job="<%= job %>"/>
<div class="form-group row">
<div class="col-md-12 col-sm-12 col-xs-12 text-left">
<label class="label-20 pay-subsc-txt">Payment</label><br/>
<span id="card-errors" style="color: #eb1c26; font-size: 15px;"></span>
</div>
</div>
<%
if(company.getCardID() != null)
{
%>
<oneit:dynInclude page="/extensions/adminportal/inc/existing_card.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"
Company="<%= company %>" IsEdit="<%= false %>" IsReplace="<%= false %>"/>
<%
}
else
{
%>
<div class="form-group row">
<div class="col-md-12 col-sm-12 col-xs-12 text-left">
<label class="label-14">Your card details will be saved for future billing</label>
</div>
</div>
<div class="grey-area">
<oneit:dynInclude page="/extensions/adminportal/inc/card_details.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"
Company="<%= company %>" IsEdit="<%= false %>" IsReplace="<%= true %>"/>
</div>
<%
}
%>
<div class="form-group row" style="padding-top: 30px;">
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 btn-footer">
<oneit:button value="Cancel and go back to Jobs" name="gotoPage" skin="link" cssClass="cancel-and-go-back"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", jobsPage)
.toMap() %>" />
</div>
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 btn-right">
<oneit:button value="Pay and Open Job" name="savePayment" cssClass="btn btn-primary large-btn btn-green"
requestAttribs='<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry("Company", company)
.mapEntry("PPJ", ppj)
.toMap() %>'/>
</div>
</div>
</div>
</div>
</oneit:form>
<oneit:form name="editJob" method="post" enctype="multipart/form-data">
<div class="row">
<div class="col-lg-4 col-md-4 col-sm-6">
<div class="form-group hide">
<input type="hidden" name="stripe-token-id" />
</div>
</div>
</div>
<oneit:button value="Pay" name="savePayment" cssClass="hide" id="payNow"
requestAttribs='<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry("Company", company)
.mapEntry("ReplaceCard", Boolean.TRUE)
.mapEntry("PPJ", ppj)
.toMap() %>'/>
</oneit:form>
<script src="https://js.stripe.com/v3/"></script>
<script>
var stripePubKey = '<%= MakePaymentFP.STRIPE_PUB_KEY %>';
</script>
<oneit:script>
<!-- MUST be included after initializing stripePubKey -->
<oneit:script src="/scripts/performaStripe.js"/>
</oneit:script>
</oneit:dynIncluded>
\ No newline at end of file
<%@ page extends="oneit.servlets.jsp.JSPInclude" %>
<%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%>
<%@ include file="/inc/stdcms.jsp" %><%-- This is in cougar --%>
<%@ include file="/extensions/performa/inc/stdimports.jsp" %>
<oneit:dynIncluded>
<%
SecUser loggedInUser = SecUser.getTXUser(transaction);
CompanyUser companyUser = loggedInUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
Company company = companyUser.getCompany();
Debug.assertion(company != null , "Invalid company in admin portal my company");
String nextPage = WebUtils.getSamePageInRenderMode(request, "Billing");
%>
<script type="text/javascript">
$(document).ready(function()
{
recalcFunction = setupRecalc ($("makePayment"), {'recalcOnError':true});
});
</script>
<h1 class="page-title">My Hiring Team</h1>
<div class="my-company-area">
<oneit:form name="makePayment" method="post" enctype="multipart/form-data">
<div style="padding-left: 15px; padding-right: 15px;">
<oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/>
</div>
<oneit:dynInclude page="/extensions/adminportal/inc/my_company_tabs.jsp" TabNumber="3" data="<%= CollectionUtils.EMPTY_MAP%>"/>
<div class="company-content-area">
<!-- Tab panes -->
<div class="tab-content">
<div class="tab-pane active" id="company-detail">
<div class="form-group row">
<div class="col-md-12 col-sm-12 col-xs-12 text-left">
<label class="label-20 pay-subsc-txt">Billing</label><br/>
<span id="card-errors" style="color: #eb1c26; font-size: 15px;"></span>
</div>
</div>
<%
if(company.getCardID() != null)
{
%>
<oneit:dynInclude page="/extensions/adminportal/inc/existing_card.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"
Company="<%= company %>" IsEdit="<%= true %>" IsReplace="<%= false %>"/>
<%
}
%>
</div>
<div>
<div class="form-group row">
<div class="col-md-12 col-sm-12 col-xs-12 text-left">
<label class="label-14 bold">Edit Card</label><br/>
<label class="label-14">Your card details will be saved for future billing</label>
</div>
</div>
<div class="grey-area">
<oneit:dynInclude page="/extensions/adminportal/inc/card_details.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"
Company="<%= company %>" IsEdit="<%= true %>" IsReplace="<%= false %>"/>
<div class="form-group">
<oneit:button value="Save Card" name="updateCard" cssClass="btn btn-primary btn-green large-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry("Company", company)
.toMap() %>" />
</div>
</div>
</div>
</div>
</div>
</oneit:form>
<oneit:form name="editCompany" method="post" enctype="multipart/form-data">
<div class="row">
<div class="col-lg-4 col-md-4 col-sm-6">
<div class="form-group hide">
<input type="hidden" name="expiry-date" />
</div>
<div class="form-group hide">
<input type="hidden" name="holder-name" />
</div>
<div class="form-group hide">
<input type="hidden" name="address-zip" />
</div>
</div>
</div>
<oneit:button value="Pay" name="updateCard" cssClass="hide" id="payNow"
requestAttribs='<%= CollectionUtils.mapEntry("nextPage", nextPage)
.toMap() %>'/>
</oneit:form>
<script src="https://js.stripe.com/v2/"></script>
<script src="https://js.stripe.com/v3/"></script>
<script>
var stripePubKey = '<%= MakePaymentFP.STRIPE_PUB_KEY %>';
</script>
<oneit:script>
<!-- MUST be included after initializing stripePubKey -->
<oneit:script src="/scripts/updateCardStripe.js"/>
</oneit:script>
</div>
</oneit:dynIncluded>
<%@ page extends="oneit.servlets.jsp.JSPInclude" %>
<%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%>
<%@ include file="/inc/stdcms.jsp" %><%-- This is in cougar --%>
<%@ include file="/extensions/performa/inc/stdimports.jsp" %>
<oneit:dynIncluded>
<%
SecUser loggedInUser = SecUser.getTXUser(transaction);
CompanyUser companyUser = loggedInUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
Company company = companyUser.getCompany();
String nextPage = WebUtils.getSamePageInRenderMode(request, WebUtils.CREATED_JOB) + "&fromJob=true";
Job job = (Job) process.getAttribute("Job");
String jobsPage = WebUtils.getSamePageInRenderMode(request, "Page");
Boolean ppj = (Boolean) process.getAttribute("PPJ");
%>
<oneit:form name="makePayment" method="post" enctype="multipart/form-data">
<script type="text/javascript">
$(document).ready(function()
{
recalcFunction = setupRecalc ($("makePayment"), {'recalcOnError':true});
});
</script>
<div class="main-created-job card-payment">
<h1 class="page-title select-payment-optio">
Enter Payment Details
</h1>
<div class="form-page-area billing-content-area">
<oneit:dynInclude page="/extensions/adminportal/inc/payment_plan.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"
Company="<%= company %>" Job="<%= job %>"/>
<div class="form-group row">
<div class="col-md-12 col-sm-12 col-xs-12 text-left">
<label class="label-20 pay-subsc-txt">Payment</label><br/>
<span id="card-errors" style="color: #eb1c26; font-size: 15px;"></span>
</div>
</div>
<%
if(company.getCardID() != null)
{
%>
<oneit:dynInclude page="/extensions/adminportal/inc/existing_card.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"
Company="<%= company %>" IsEdit="<%= true %>" IsReplace="<%= false %>"/>
<%
}
%>
<div class="form-brack-line"></div>
<div class="form-group row">
<div class="col-md-12 col-sm-12 col-xs-12 text-left">
<label class="label-14 bold">Edit Card</label><br/>
<label class="label-14">Your card details will be saved for future billing</label>
</div>
</div>
<div class="grey-area">
<oneit:dynInclude page="/extensions/adminportal/inc/card_details.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"
Company="<%= company %>" IsEdit="<%= true %>" IsReplace="<%= false %>"/>
</div>
<div class="form-group row" style="padding-top: 30px;">
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 btn-footer">
<oneit:button value="Cancel and go back to Jobs" name="gotoPage" skin="link" cssClass="cancel-and-go-back"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", jobsPage)
.toMap() %>" />
</div>
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 btn-right">
<oneit:button value="Pay and Open Job" name="updateCard" cssClass="btn btn-primary large-btn btn-green"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.toMap() %>" />
</div>
</div>
</div>
</div>
</oneit:form>
<oneit:form name="editJob" method="post" enctype="multipart/form-data">
<div class="row">
<div class="col-lg-4 col-md-4 col-sm-6">
<div class="form-group hide">
<input type="hidden" name="expiry-date" />
</div>
<div class="form-group hide">
<input type="hidden" name="holder-name" />
</div>
<div class="form-group hide">
<input type="hidden" name="address-zip" />
</div>
</div>
</div>
<oneit:button value="Pay" name="savePayment" cssClass="hide" id="payNow"
requestAttribs='<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry("EditCard", Boolean.TRUE)
.mapEntry("PPJ", ppj)
.toMap() %>'/>
</oneit:form>
<script src="https://js.stripe.com/v2/"></script>
<script src="https://js.stripe.com/v3/"></script>
<script>
var stripePubKey = '<%= MakePaymentFP.STRIPE_PUB_KEY %>';
</script>
<oneit:script>
<!-- MUST be included after initializing stripePubKey -->
<oneit:script src="/scripts/updateCardStripe.js"/>
</oneit:script>
</oneit:dynIncluded>
\ No newline at end of file
<%@ page extends="oneit.servlets.jsp.JSPInclude" %>
<%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%>
<%@ include file="/inc/stdcms.jsp" %><%-- This is in cougar --%>
<%@ include file="/extensions/performa/inc/stdimports.jsp" %>
<%
Company company = (Company) getData(request, "Company");
boolean isReplace = (boolean) getData(request, "IsReplace");
boolean isEdit = (boolean) getData(request, "IsEdit");
String nextPage = WebUtils.getSamePageInRenderMode(request, "Billing");
%>
<oneit:dynIncluded>
<script>
$(document).ready(function() {
$('#cardExpiry').attr("maxlength", 7);
$("#cardExpiry" ).keydown(function(e) {
var val = $(this).val();
if(e.keyCode == 8) {
temp_val = val.substring(0,1);
$(this).val(temp_val);
}
if(!isNaN(val)) {
if(val.length === 3 || val.length === 2)
{
temp_val = val + " / ";
$(this).val(temp_val);
}
else
{
if(val > 1 && val < 10 && val.length === 1) {
temp_val = "0" + val + " / ";
$(this).val(temp_val);
}
else if (val >= 1 && val < 10 && val.length === 2 && e.keyCode != 7) {
temp_val = val + " / ";
$(this).val(temp_val);
}
else if(val > 9 && val.length === 2 && e.keyCode !== 7) {
temp_val = val + " / ";
$(this).val(temp_val);
}
}
}
});
});
</script>
<div class="form-group row">
<div class="col-md-12 col-sm-12 col-xs-12 text-left">
<label>Card Number</label>
<div style="float: right; margin-top:-15px;">
<img src="images/master-small.png" style="width:30px;"/>
<img src="images/visa.svg" style="width:40px;"/>
</div>
<%
if(isEdit)
{
%>
<input type="text" name="cardNumber" value="<%= company.getCardNumber() %>" class="form-control" readonly>
<%
}
else
{
%>
<div id="card-number" class="form-control" style="padding-top:15px;">
</div>
<%
}
%>
</div>
</div>
<div class="form-group row">
<div class="col-md-12 col-sm-12 col-xs-12 text-left">
<label>Name on Card</label>
<oneit:ormInput obj="<%= company %>" type="text" attributeName="NameOnCard" cssClass="form-control" id="NameOnCard" data-stripe="name"/>
</div>
</div>
<div class="form-group row">
<div class="col-lg-4 col-md-4 col-sm-4">
<label>Expires</label>
<%
if(isEdit)
{
%>
<input type="text" id="cardExpiry" class="form-control" placeholder="MM / YY" value="<%= company.getExpiry() %>">
<%
}
else
{
%>
<div id="card-expiry" class="form-control" style="padding-top:15px;">
</div>
<%
}
%>
</div>
<div class="col-lg-4 col-md-4 col-sm-4">
<label>CCV</label>
<%
if(isEdit)
{
%>
<input type="text" name="ccv" value="" class="form-control" readonly>
<%
}
else
{
%>
<div id="card-cvc" class="form-control" style="padding-top:15px;">
</div>
<%
}
%>
</div>
<div class="col-md-4col-lg-4 col-md-4 col-sm-4">
<label>Postal Code</label>
<oneit:ormInput obj="<%= company %>" type="text" attributeName="CardPostCode" cssClass="form-control" id="PostCode" />
</div>
</div>
</oneit:dynIncluded>
......@@ -51,13 +51,13 @@
if(company.getIsVerified()==Boolean.TRUE || !CollectionUtils.equals(company.getAddedByUser(), companyUser))
{
%>
<oneit:ormInput obj="<%= company %>" type="text" attributeName="CompanyName" cssClass="form-control" readonly="true" required="true"/>
<oneit:ormInput obj="<%= company %>" type="text" attributeName="CompanyName" cssClass="form-control" readonly="true" required="true" placeholder="Your company name"/>
<%
}
else
{
%>
<oneit:ormInput obj="<%= company %>" type="text" attributeName="CompanyName" cssClass="form-control" required="true"/>
<oneit:ormInput obj="<%= company %>" type="text" attributeName="CompanyName" cssClass="form-control" required="true" placeholder="Your company name"/>
<%
}
%>
......
<%@ page extends="oneit.servlets.jsp.JSPInclude" %>
<%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%>
<%@ include file="/inc/stdcms.jsp" %><%-- This is in cougar --%>
<%@ include file="/extensions/performa/inc/stdimports.jsp" %>
<%
Company company = (Company) getData(request, "Company");
boolean isReplace = (boolean) getData(request, "IsReplace");
boolean isEdit = (boolean) getData(request, "IsEdit");
String replaceCardPage = WebUtils.getSamePageInRenderMode(request, "ReplaceCard");
String editCardPage = WebUtils.getSamePageInRenderMode(request, "EditCard");
String cardNumber = company.getCardNumber();
Job job = (Job) process.getAttribute("Job");
Boolean ppj = (Boolean) process.getAttribute("PPJ");
%>
<oneit:dynIncluded>
<div class="form-group row">
<div class="col-lg-3 col-md-3 col-sm-3">
<label>Card on file</label>
</div>
<div class="col-lg-5 col-md-5 col-sm-5" style="margin-top: -20px;">
<img src="<%= company.getStripeBrand().equals("MasterCard") ? "images/master.svg" : "images/visa.svg" %>" style="width:60px;"/>
<label><%= cardNumber %></label>
</div>
<div class="col-lg-2 col-md-2 col-sm-2">
<oneit:button value=" " name="gotoPage" skin="link" cssClass="<%= "edit-card-link " + (isEdit ? "" : "deselected-link")%>"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", editCardPage)
.mapEntry("procParams", CollectionUtils.mapEntry("Job", job)
.mapEntry("PPJ", ppj).toMap())
.toMap() %>">
Edit Card
</oneit:button>
</div>
<div class="col-lg-2 col-md-2 col-sm-2">
<oneit:button value=" " name="gotoPage" skin="link" cssClass="<%= "edit-card-link " + (isReplace ? "" : "deselected-link")%>"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", replaceCardPage)
.mapEntry("procParams", CollectionUtils.mapEntry("Job", job)
.mapEntry("PPJ", ppj).toMap())
.toMap() %>">
Replace Card
</oneit:button>
</div>
</div>
</oneit:dynIncluded>
......@@ -37,6 +37,12 @@
</oneit:button>
</div>
<div class="off-name">
<oneit:toString value="<%= job.getAssessmentType() %>" mode="EscapeHTML" nullValue=""/>:
<span class="ex-management">
<oneit:toString value="<%= job.getLevel() %>" mode="EscapeHTML" />
</span>
</div>
<div class="off-name">
<span class="austr-post">
<%
if(job.isClientAvailable())
......@@ -47,9 +53,6 @@
}
%>
</span> by <oneit:toString value="<%= job.getCompanyUser() %>" mode="EscapeHTML" nullValue=""/>
<span class="ex-management">&bull;&nbsp;
<oneit:toString value="<%= job.getLevel() %>" mode="EscapeHTML" />
</span>
</div>
</div>
<div class="applicant-right-status">
......
......@@ -7,6 +7,12 @@
<%
String tabNumber = (String) getData(request, "TabNumber");
String firstPage = WebUtils.getSamePageInRenderMode(request, "Page");
String secondPage = WebUtils.getSamePageInRenderMode(request, "ManagePlan");
String thirdPage = WebUtils.getSamePageInRenderMode(request, "Billing");
String forthPage = WebUtils.getSamePageInRenderMode(request, "Invoices");
SecUser loggedInUser = SecUser.getTXUser(transaction);
CompanyUser companyUser = loggedInUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
%>
<oneit:dynIncluded>
......@@ -19,9 +25,34 @@
Hiring Team Details
</oneit:button>
</li>
<li class="">Manage Plan</li>
<li class="">Billing</li>
<li class="disabled">Invoices</li>
<%
if(companyUser.hasRole(RoleType.BILLING))
{
%>
<li class="<%= tabNumber == "2" ? "active" : ""%>">
<oneit:button value=" " name="gotoPage" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", secondPage)
.toMap() %>">
Manage Plan
</oneit:button>
</li>
<li class="<%= tabNumber == "3" ? "active" : ""%>">
<oneit:button value=" " name="gotoPage" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", thirdPage)
.toMap() %>">
Billing
</oneit:button>
</li>
<li class="<%= tabNumber == "4" ? "active" : ""%>">
<oneit:button value=" " name="gotoPage" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", forthPage)
.toMap() %>">
Invoices
</oneit:button>
</li>
<%
}
%>
</ul>
</div>
</oneit:dynIncluded>
......
<%@ page extends="oneit.servlets.jsp.JSPInclude" %>
<%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%>
<%@ include file="/inc/stdcms.jsp" %><%-- This is in cougar --%>
<%@ include file="/extensions/performa/inc/stdimports.jsp" %>
<%
Company company = (Company) getData(request, "Company");
Job job = (Job) getData(request, "Job");
PaymentPlan[] plans = Utils.getPaymentPlansForJobs(transaction);
Integer maxCount = 0;
Integer minCount = 0;
if(company.getPaymentPlan() != null && company.getPaymentJobCount() == null)
{
company.setPaymentJobCount(company.getPaymentPlan().getActiveJobCount());
}
if(plans.length > 0)
{
Collection<Integer> jCounts = PaymentPlan.pipesPaymentPlan(plans).toActiveJobCount().vals();
maxCount = Collections.max(jCounts);
minCount = Collections.min(jCounts);
}
%>
<style>
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
opacity: 1;
}
</style>
<oneit:dynIncluded>
<div class="a-label-row pay-subsc-row">
<div class="col-md-6 col-sm-6 col-xs-6 text-left">
<label class="label-20 pay-subsc-txt"><%= company.getPaymentPlan() != null ? "Monthly Plan" : job.getAssessmentType().getDescription() %></label>
</div>
<%
if(company.getPaymentPlan() != null)
{
%>
<div class="col-md-6 col-sm-6 col-xs-6 text-right">
<oneit:ormInput type="number" obj="<%= company %>" attributeName="PaymentJobCount" required="true"
min="<%= minCount %>" max="<%= maxCount %>" step="1" cssClass="payment-paln-count"/>
<label class="label-20">&nbsp;Jobs / month </label>
</div>
<%
}
%>
</div>
<div class="form-group row">
<div class="pay-subsc-det-row a-label-row">
<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">
Total:
<span class="pay-subsc-amt">
<oneit:recalc mode="Currency" script="company.getPaymentPlanAmount()" company="<%= company %>" nullValue=""/>
/ mo
</span>
</div>
<div class="col-md-6 col-sm-6 col-xs-6 text-right pay-subsc-det">
<div class="text-right">
<oneit:recalc mode="Currency" script="company.getPerJobPaymentPlanAmount()" company="<%= company %>" nullValue=""/>
per job. Save
<oneit:recalc mode="Currency" script="company.getPaymentPlanSaveAmount()" company="<%= company %>" nullValue=""/>
per month.
</div>
</div>
</oneit:recalcClass>
</div>
</div>
</oneit:dynIncluded>
......@@ -318,6 +318,16 @@
<div class="tab-row" id="<%= factorScore.getObjectID() %>">
<div class="tab-view-label">
<oneit:toString value="<%= factorLevelLink.getFactor() %>" mode="EscapeHTML"/>
<%
if(job.isExpressJob())
{
%>
<div class="ja-exp-fact-score">
<oneit:toString value="<%= factorScore.getScore() %>" mode="EscapeHTML"/>
</div>
<%
}
%>
</div>
<div class="tab-view-side">
<div class="result-want">
......@@ -451,13 +461,34 @@
<span class="common-dot <%= dotClass %>"></span> &nbsp;
<oneit:toString value="<%= answer.getAssessmentCriteria().getCriteriaType() %>" mode="EscapeHTML"/>
</div>
<div class="detail-tab-row-text col-md-8 col-sm-8 col-xs-8" style="width: 65%">
<div class="detail-tab-row-text col-md-7 col-sm-7 col-xs-7" style="width: 55%">
<oneit:toString value="<%= answer.getAssessmentCriteria() %>" mode="EscapeHTML"/>
<span style="padding-left: 10px; float: right">
<oneit:toString value="<%= answer.getAnswer() ? "Yes" : "No" %>" mode="EscapeHTML"/>
</span>
</div>
<div class="detail-tab-row-text col-md-1 col-sm-1 col-xs-1" style="width: 15%; line-height: 0.1;">
<oneit:toString value="<%= answer.getAnswer() ? "Yes" : "No" %>" mode="EscapeHTML"/>
<%
if(answer.getNotes()!=null)
{
%>
<span class="info-toggle">
&#9432;
</span>
<%
}
%>
</div>
</div>
<%
if(answer.getNotes()!=null)
{
%>
<div class="tab-row info-panel">
<oneit:toString value="<%= answer.getNotes() %>" mode="ParagraphHTML"/>
</div>
<%
}
%>
<%
}
%>
......
<%@ page extends="oneit.servlets.jsp.JSPInclude" %>
<%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%>
<%@ include file="/inc/stdcms.jsp" %><%-- This is in cougar --%>
<%@ include file="/extensions/performa/inc/stdimports.jsp" %>
<oneit:dynIncluded>
<%
SecUser loggedInUser = SecUser.getTXUser(transaction);
CompanyUser companyUser = loggedInUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
Company company = companyUser.getCompany();
Debug.assertion(company != null , "Invalid company in admin portal my company");
String nextPage = WebUtils.getSamePageInRenderMode(request, "Page");
List<Invoice> invoices = StripeUtils.retrieveInvoices(company);
%>
<div class="container-fluid">
<div class="row content">
<div class="main-content-area">
<h1 class="page-title">My Hiring Team</h1>
<div class="my-company-area">
<oneit:form name="editCompany" method="post" enctype="multipart/form-data">
<div style="padding-left: 15px; padding-right: 15px;">
<oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/>
</div>
<oneit:dynInclude page="/extensions/adminportal/inc/my_company_tabs.jsp" TabNumber="4" data="<%= CollectionUtils.EMPTY_MAP%>"/>
<div class="company-content-area">
<!-- Tab panes -->
<div class="tab-content">
<div class="tab-pane active" id="company-detail">
<div class="tabpage-title">
<label class="label-20">Invoices</label><br/>
</div>
</div>
<div class="">
<div class="a-label-row">
<div class="col-md-2 col-sm-2 col-xs-2 inv-hdr text-left">Date</div>
<div class="col-md-6 col-sm-6 col-xs-6 inv-hdr text-left">Item</div>
<div class="col-md-2 col-sm-2 col-xs-2 inv-hdr text-right">Charge</div>
<div class="col-md-2 col-sm-2 col-xs-2 inv-hdr text-right">Export</div>
</div>
<div class="line-break"></div>
<%
for(Invoice invoice : invoices)
{
%>
<div class="a-label-row">
<div class="col-md-2 col-sm-2 col-xs-2 text-left inv-det">
<oneit:toString value="<%= new Date(invoice.getDate() * 1000) %>" mode="MidDate"/>
</div>
<div class="col-md-6 col-sm-6 col-xs-6 text-left inv-des">
Subscription <%= StringUtils.subNulls(invoice.getDescription(), "") %>
<!--<div class="inv-det">#12536536</div>-->
</div>
<div class="col-md-2 col-sm-2 col-xs-2 text-right inv-amt">
<oneit:toString value="<%= invoice.getAmountDue() * 0.01 %>" mode="Currency"/>
</div>
<div class="col-md-2 col-sm-2 col-xs-2 text-right inv-det">
<a href="#">
<span class=""><img src="images/pdf.svg" class="inv-pdf"/><span>
&nbsp;
PDF
</a>
</div>
</div>
<div class="line-break"></div>
<%
}
%>
</div>
</div>
</div>
</oneit:form>
</div>
</div>
</div>
</div>
</oneit:dynIncluded>
<%@ page extends="oneit.servlets.jsp.JSPInclude" %>
<%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%>
<%@ include file="/inc/stdcms.jsp" %><%-- This is in cougar --%>
<%@ include file="/extensions/performa/inc/stdimports.jsp" %>
<oneit:dynIncluded>
<%
Job job = (Job) process.getAttribute("Job");
SecUser loggedInUser = SecUser.getTXUser(transaction);
CompanyUser companyUser = loggedInUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
Company company = companyUser.getCompany();
PaymentPlan[] plans = Utils.getPaymentPlansForJobs(transaction);
Integer maxCount = 0;
Integer minCount = 0;
if(company.getPaymentPlan()!=null && company.getPaymentJobCount()==null)
{
company.setPaymentJobCount(company.getPaymentPlan().getActiveJobCount());
}
if(plans.length>0)
{
Collection<Integer> jCounts = PaymentPlan.pipesPaymentPlan(plans).toActiveJobCount().vals();
maxCount = Collections.max(jCounts);
minCount = Collections.min(jCounts);
}
Debug.assertion(company != null , "Invalid company in admin portal my company");
String nextPage = WebUtils.getSamePageInRenderMode(request, WebUtils.CREATED_JOB) + "&fromJob=true";
String jobsPage = WebUtils.getSamePageInRenderMode(request, "Page");
String fromPage = WebUtils.getSamePageInRenderMode(request, WebUtils.JOB_PAYMENT);
String paymentPage = WebUtils.getSamePageInRenderMode(request, WebUtils.CARD_PAYMENT);
%>
<script type="text/javascript">
$(document).ready(function()
{
recalcFunction = setupRecalc ($("form"), {'recalcOnError':true});
addPostRecalcHandler(function ($fieldThatChanged) {
if (! $fieldThatChanged) {
return;
}
var name = $fieldThatChanged.attr('name');
if (typeof name !== typeof undefined && name !== false) {
if ( name.indexOf('PaymentJobCount') >= 0 ) {
validate();
}
}
});
validate();
$('input').on('change keyup', function() { validate() });
});
function validate() {
if ($('.select-plan').hasClass('disabled')) {
$('.save-btn').attr('disabled', 'disabled');
} else {
$('.save-btn').removeAttr('disabled');
}
}
</script>
<style>
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
opacity: 1;
}
</style>
<oneit:form name="editJob" method="post" enctype="multipart/form-data">
<oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/>
<div class="main-created-job">
<h1 class="page-title select-payment-optio">
Select Payment Option
</h1>
<div class="form-page-area payment-optio-bg">
<div class="a-label-row annual-plan">
Annual Plan
</div>
<div class="a-label-row payment-optio-text">
<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-6 col-sm-6 col-xs-6 text-right">
<div class="active-jobs-per-mont">
Active Jobs Per Month
</div>
<oneit:ormInput type="number" obj="<%= company %>" attributeName="PaymentJobCount"
min="<%= minCount %>" max="<%= maxCount %>" step="1" cssClass="payment-paln-count"/>
</div>
<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.getPerJobPaymentPlanAmount()" company="<%= company %>" nullValue=""/>
</span>
<span class="text-left">
<p class="per-job">
Per Job
</p>
</span>
</div>
</oneit:recalcClass>
</div>
</div>
<div class="a-label-row text-center">
<oneit:recalcClass htmlTag="span" classScript="company.getPaymentPlanAmount()!=null ? 'select-plan enabled': 'select-plan disabled'" company="<%= company %>">
<oneit:button value="Select Plan" name="saveJob" cssClass="btn btn-primary largeBtn btn-green save-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", paymentPage)
.mapEntry("PPJ", Boolean.FALSE)
.mapEntry ("fromPage", fromPage)
.mapEntry("JobStatus", JobStatus.OPEN)
.mapEntry ("restartProcess", Boolean.TRUE)
.mapEntry ("attribNamesToRestore", Collections.singleton("Job"))
.toMap() %>" />
</oneit:recalcClass>
</div>
<div class="a-label-row text-center">
<div class="col-md-12 col-sm-12 col-xs-12 text-center">
<div class="payment-job-det ">
<oneit:recalcClass htmlTag="span" classScript="company.getPaymentPlanAmount()!=null ? 'show': 'hide'" company="<%= company %>">
<oneit:recalc mode="Currency" script="company.getPaymentPlanAmount()" company="<%= company %>" nullValue=""/>
Monthly for up to
<oneit:recalc mode="EscapeHTML" script="company.getPaymentJobCount()" company="<%= company %>" nullValue=""/>
jobs / month
<div>
Save
<oneit:recalc mode="Currency" script="company.getPaymentPlanSaveAmount()" company="<%= company %>" nullValue=""/>
per month
</div>
</oneit:recalcClass>
</div>
</div>
</div>
</div>
<div class="form-page-area payment-optio-sep">
<div class="a-label-row">
<div class="col-md-3 col-sm-3 col-xs-3">
</div>
<div class="col-md-3 col-sm-3 col-xs-3">
<div class="annual-plan">Pay Per Job</div>
<div class="">
<span class="pay-only-job-amt">
<oneit:toString value="<%= job.getAssessmentType() == AssessmentType.COMPREHENSIVE ? 499.0 : 399.0%>" mode="Currency"/>
</span>
<span class="pay-only-job-txt">&ensp;&ensp;Open for 30 Days</span>
</div>
</div>
<div class="col-md-6 col-sm-6 col-xs-6">
<oneit:button value="Pay for this job only" name="gotoPage" cssClass="btn pay-only-job-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", paymentPage)
.mapEntry("procParams", CollectionUtils.mapEntry("Job", job)
.mapEntry("PPJ", Boolean.TRUE).toMap())
.toMap() %>" />
</div>
</div>
</div>
</div>
<div class="payment-optio-text text-center payment-cancel">
<oneit:button value="Cancel and go back to Jobs" name="gotoPage" cssClass="" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", jobsPage)
.mapEntry(UpdateMappedObjFP.FAIL_VALIDATION_ERRORS, Boolean.FALSE).toMap() %>"/>
</div>
</oneit:form>
</oneit:dynIncluded>
......@@ -6,7 +6,7 @@
<oneit:dynIncluded>
<%
Job job = (Job) process.getAttribute("Job");
String nextPage = WebUtils.getSamePageInRenderMode(request, WebUtils.CREATED_JOB) + "&fromJob=true";
String nextPage = WebUtils.getSamePageInRenderMode(request, WebUtils.JOB_PAYMENT);
String firstPage = WebUtils.getSamePageInRenderMode(request, WebUtils.CREATE_JOB);
String secondPage = WebUtils.getSamePageInRenderMode(request, WebUtils.ASSESSMENT_CRITERIA);
String thirdPage = WebUtils.getSamePageInRenderMode(request, WebUtils.WORKPLACE_CULTURE);
......@@ -20,6 +20,9 @@
process.setAttribute("Job", job);
}
CompanyUser companyUser = job.getCompanyUser();
Company company = companyUser.getCompany();
Debug.assertion(job != null, "Job is null in admin portal create job");
%>
......@@ -29,11 +32,27 @@
<oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/>
<h1 class="page-title">Review Job</h1>
<!-- <div class="page-subtitle-">
<span class="pull-right plan-link"> Post multiple jobs per month? <a href="#">See our plans</a></span>
</div>-->
<h1 class="page-title">Review Job
<%
if(company.getPaymentPlan()!=null)
{
Integer activeCount = company.getOpenJobsCount();
Integer totCount = company.getPaymentPlan().getActiveJobCount();
Integer remCount = (totCount - activeCount) > 0 ? (totCount - activeCount) : 0;
%>
<div style="float:right;">
<span class="pull-right plan-link">
<oneit:toString value="<%= remCount %>" mode="EscapeHTML" />
/
<oneit:toString value="<%= totCount %>" mode="EscapeHTML" />
&nbsp;Jobs remaining this month
</span>
</div>
<%
}
%>
</h1>
<oneit:dynInclude page="/extensions/adminportal/inc/job_main_tabs.jsp" PageNumber="5" data="<%= CollectionUtils.EMPTY_MAP%>"/>
......@@ -73,10 +92,11 @@
</div>
</div>
<%
SecUser txUser = SecUser.getTXUser(process.getTransaction());
CompanyUser companyUser = txUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
// SecUser txUser = SecUser.getTXUser(process.getTransaction());
// CompanyUser companyUser = txUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
// Company company = companyUser.getCompany();
if(companyUser.getCompany().showHasClientSupport())
if(company.showHasClientSupport())
{
%>
<div class="row main-review-label">
......@@ -212,14 +232,42 @@
.mapEntry ("restartProcess", Boolean.TRUE)
.mapEntry ("attribNamesToRestore", Collections.singleton("Job"))
.toMap() %>" />
<oneit:button value="Open this job" name="saveJob" cssClass="btn btn-primary btn-green top-margin-25 largeBtn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry ("fromPage", fifthPage)
.mapEntry("JobStatus", JobStatus.OPEN)
.mapEntry ("restartProcess", Boolean.TRUE)
.mapEntry ("attribNamesToRestore", Collections.singleton("Job"))
.toMap() %>" />
<%
if(company.canCreateJob())
{
if(company.getCardID() != null)
{
String createJobPage = WebUtils.getSamePageInRenderMode(request, WebUtils.CREATED_JOB) + "&fromJob=true";
%>
<oneit:button value="Confirm and Create Job" name="saveJob" cssClass="btn btn-primary btn-green top-margin-25 largeBtn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", createJobPage)
.mapEntry ("fromPage", fifthPage)
.mapEntry("JobStatus", JobStatus.OPEN)
.mapEntry ("restartProcess", Boolean.TRUE)
.mapEntry ("attribNamesToRestore", Collections.singleton("Job"))
.toMap() %>" />
<%
}
else
{
String createJobPage = WebUtils.getSamePageInRenderMode(request, WebUtils.CARD_PAYMENT);
%>
<oneit:button value="Confirm and Create Job" name="gotoPage" cssClass="btn btn-primary btn-green top-margin-25 largeBtn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", createJobPage).toMap() %>" />
<%
}
}
else
{
%>
<oneit:button value="Confirm and make payment" name="gotoPage" cssClass="btn btn-primary btn-green top-margin-25 largeBtn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage).toMap() %>" />
<%
}
%>
</div>
</div>
</div>
......
<%@ page extends="oneit.servlets.jsp.JSPInclude" %>
<%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%>
<%@ include file="/inc/stdcms.jsp" %><%-- This is in cougar --%>
<%@ include file="/extensions/performa/inc/stdimports.jsp" %>
<oneit:dynIncluded>
<%
String nextPage = WebUtils.getSamePageInRenderMode(request, "ManagePlan");
SecUser loggedInUser = SecUser.getTXUser(transaction);
CompanyUser companyUser = loggedInUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
Company company = companyUser.getCompany();
Debug.assertion(company != null , "Invalid company in admin portal my company");
PaymentPlan[] plans = Utils.getPaymentPlansForJobs(transaction);
Integer maxCount = 0;
Integer minCount = 0;
if(company.getPaymentPlan()!=null && company.getPaymentJobCount()==null)
{
company.setPaymentJobCount(company.getPaymentPlan().getActiveJobCount());
}
if(plans.length>0)
{
Collection<Integer> jCounts = PaymentPlan.pipesPaymentPlan(plans).toActiveJobCount().vals();
maxCount = Collections.max(jCounts);
minCount = Collections.min(jCounts);
}
%>
<script type="text/javascript">
$(document).ready(function()
{
recalcFunction = setupRecalc ($("form"), {'recalcOnError':true});
$("#upload").change(function(){
readURL(this);
});
$("#remove-logo").click(function(){
removeLogo();
});
validate();
$('input').on('change keyup', function() { validate() });
addPostRecalcHandler(function ($fieldThatChanged) {
if (! $fieldThatChanged) {
return;
}
var name = $fieldThatChanged.attr('name');
if (typeof name !== typeof undefined && name !== false) {
if ( name.indexOf('PaymentJobCount') >= 0 ) {
validate();
}
}
});
});
function validate() {
// var empty = false;
// $('input[required]').each(function() {
// if ($( this ).val() == '') {
// empty = true;
// }
// });
//
// if (empty) {
// $('.save-btn').attr('disabled', 'disabled');
// } else {
// $('.save-btn').removeAttr('disabled');
// }
if ($('.subscr-change').hasClass('disabled')) {
$('.save-btn').attr('disabled', 'disabled');
} else {
$('.save-btn').removeAttr('disabled');
}
}
</script>
<style>
.subscr-change button{
background-color: grey;
}
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
opacity: 1;
}
</style>
<div class="container-fluid">
<div class="row content">
<div class="main-content-area">
<h1 class="page-title">My Hiring Team</h1>
<div class="my-company-area">
<oneit:form name="editCompany" method="post" enctype="multipart/form-data">
<div style="padding-left: 15px; padding-right: 15px;">
<oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/>
</div>
<oneit:dynInclude page="/extensions/adminportal/inc/my_company_tabs.jsp" TabNumber="2" data="<%= CollectionUtils.EMPTY_MAP%>"/>
<div class="company-content-area">
<!-- Tab panes -->
<div class="tab-content">
<div class="tab-pane active" id="company-detail">
<%
if(company.getPaymentPlan()==null)
{
%>
<div class="tabpage-title">
<label class="label-20">No Current Plan</label><br/>
<label class="label-14">You'll be charged each time you add a new job</label>
<div class="line-break"></div>
</div>
<div>
<label class="label-20">Talentology Subscription</label>
</div>
<div class="grey-area payment-grey-area">
<div class="text-center">
<label class="label-20">Subscribe and save</label>
</div>
<div class="a-label-row payment-type-row">
<div class="col-md-6 col-sm-6 col-xs-6 text-right">
<div class="active-jobs-per-mont">
Active Jobs Per Month
</div>
<oneit:ormInput type="number" obj="<%= company %>" attributeName="PaymentJobCount" required="true"
min="<%= minCount %>" max="<%= maxCount %>" step="1" cssClass="payment-paln-count"/>
</div>
<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.getPerJobPaymentPlanAmount()" company="<%= company %>" nullValue=""/>
</span>
<span class="text-left">
<p class="per-job">
Per Job
</p>
</span>
</div>
</oneit:recalcClass>
</div>
</div>
<div class="a-label-row text-center">
<oneit:button value="Upgrade" name="saveCompany" cssClass="btn btn-primary largeBtn btn-green save-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry ("restartProcess", Boolean.TRUE)
.mapEntry ("Company", company)
.mapEntry ("IsPayment", Boolean.TRUE)
.mapEntry ("attribNamesToRestore", Collections.singleton("Company"))
.toMap() %>" />
</div>
<oneit:recalcClass htmlTag="span" classScript="company.getPaymentPlanAmount()!=null ? 'show': 'hide'" company="<%= company %>">
<div class="a-label-row text-center">
<div class="col-md-12 col-sm-12 col-xs-12 payment-job-det text-center">
<oneit:recalc mode="Currency" script="company.getPerJobPaymentPlanAmount()" company="<%= company %>" nullValue=""/>
Monthly for up to
<oneit:recalc mode="EscapeHTML" script="company.getPaymentJobCount()" company="<%= company %>" nullValue=""/>
jobs / month
<div>
Save
<oneit:recalc mode="Currency" script="company.getPaymentPlanSaveAmount()" company="<%= company %>" nullValue=""/>
per month
</div>
</div>
<div class="col-md-3 col-sm-3 col-xs-3">
</div>
</div>
</oneit:recalcClass>
<div class="a-label-row">&nbsp;</div>
</div>
<%
}
else
{
%>
<div class="tabpage-title">
<label class="label-20">Current Plan</label><br/>
<label class="label-14">View and edit your subscription </label>
<div class="line-break"></div>
</div>
<div class="a-label-row pay-subsc-row">
<div class="col-md-6 col-sm-6 col-xs-6 text-left">
<label class="label-20 pay-subsc-txt">Talentology Subscription</label>
</div>
<div class="col-md-6 col-sm-6 col-xs-6 text-right">
<oneit:ormInput type="number" obj="<%= company %>" attributeName="PaymentJobCount" required="true"
min="<%= minCount %>" max="<%= maxCount %>" step="1" cssClass="payment-paln-count"/>
<label class="label-20">&nbsp;Jobs / month </label>
</div>
</div>
<div class="pay-subsc-det-row a-label-row">
<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">
Total:
<span class="pay-subsc-amt">
<oneit:recalc mode="Currency" script="company.getPaymentPlanAmount()" company="<%= company %>" nullValue=""/>
/ mo
</span>
</div>
<div class="col-md-6 col-sm-6 col-xs-6 text-right pay-subsc-det">
<div class="text-right">
<oneit:recalc mode="Currency" script="company.getPerJobPaymentPlanAmount()" company="<%= company %>" nullValue=""/>
per job. Save
<oneit:recalc mode="Currency" script="company.getPaymentPlanSaveAmount()" company="<%= company %>" nullValue=""/>
per month.
</div>
</div>
</oneit:recalcClass>
</div>
<div class="a-label-row text-center pay-subsc-btn-row">
<oneit:recalcClass htmlTag="div" classScript="company.isSubscriptionChanged() ? 'subscr-change enabled': 'subscr-change disabled'" company="<%= company %>">
<oneit:button value="Update Subscription" name="saveCompany" cssClass="btn btn-primary largeBtn btn-green save-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry ("restartProcess", Boolean.TRUE)
.mapEntry ("Company", company)
.mapEntry ("IsPayment", Boolean.TRUE)
.mapEntry ("attribNamesToRestore", Collections.singleton("Company"))
.toMap() %>" />
</oneit:recalcClass>
</div>
<div class="line-break"></div>
<%
}
%>
<div class="text-center footer-note">
Looking to cancel your account? Please <a href="http://www.talentology.com/">contact us.</a>
</div>
</div>
</div>
</div>
</oneit:form>
</div>
</div>
</div>
</div>
</oneit:dynIncluded>
......@@ -36,3 +36,4 @@ Company.RoleType = Role
Company.CompanyLogo = Logo
Company.HiringTeamType = Hiring Team
Company.CompanyName = Hiring Team Name
Company.PaymentPlan = Payment Plan
......@@ -4,4 +4,6 @@
#passwordNotMatch = The password does not match. Please try again.
#invitationSent = Your invitation has been successfully sent.
#invalidEmail = Invalid email address.
#emailChangeVefified = Your email address has been successfully changed and you can now use new email address when signing in.
\ No newline at end of file
#emailChangeVefified = Your email address has been successfully changed and you can now use new email address when signing in.
#mandatoryCardDetails = Please enter card details to open the job.
#insufficientCredit = Insufficient credit to open the job.
\ No newline at end of file
......@@ -47,7 +47,7 @@
<div class="tab-content">
<div class="tab-pane active" id="company-detail">
<div class="tabpage-title">
<label class="label-16">Hiring Team Details</label>
<label class="label-20">Hiring Team Details</label>
</div>
<div class="form-group">
<label><oneit:ormlabel obj="<%= company %>" field="CompanyName" /></label>
......@@ -77,7 +77,7 @@
<div class="form-group row">
<div class="col-md-6">
<label><oneit:label GUIName="Industry" /></label>
<oneit:ormEnum obj="<%= company %>" attributeName="Industry" cssClass="form-control"/>
<oneit:ormEnum obj="<%= company %>" attributeName="Industry" cssClass="form-control" displayType="autocomplete"/>
</div>
</div>
<div class="form-group">
......
......@@ -48,6 +48,16 @@
.byCompany(secUser.getExtension(CompanyUser.REFERENCE_CompanyUser).getCompany())
.search(transaction);
Job[] allJobs = Job.SearchByCompany()
.byCompany(secUser.getExtension(CompanyUser.REFERENCE_CompanyUser).getCompany())
.search(transaction);
List<Job> recentJobs = ObjstoreUtils.sort(Arrays.asList(allJobs),
new ObjectTransform[]{ Job.pipesJob().toLastEdited() ,
Job.pipesJob().toObjectLastModified()},
new Comparator[]{ CollectionUtils.reverse(CollectionUtils.DEFAULT_COMPARATOR), CollectionUtils.reverse(CollectionUtils.DEFAULT_COMPARATOR), CollectionUtils.reverse(CollectionUtils.DEFAULT_COMPARATOR) });
Article jobsArticle = WebUtils.getArticleByShortCut(transaction, WebUtils.JOBS);
String nextPage = jobsArticle.getLink(request, CollectionUtils.mapEntry("cms.rm", WebUtils.VIEW_APPLICANTS).toMap());
String shortlistPage = jobsArticle.getLink(request, CollectionUtils.mapEntry("cms.rm", WebUtils.APPLICANTS_SHORTLIST).toMap());
......@@ -131,10 +141,23 @@
</div>
<div class="second-part">
<oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/>
<div class="d-job-title">Open Jobs</div>
<oneit:dynInclude page="/extensions/adminportal/inc/job_list.jsp" data="<%= CollectionUtils.EMPTY_MAP%>" ShortlistPage="<%= shortlistPage %>"
NextPage="<%= nextPage%>" HomePage="<%= homePage%>" Jobs="<%= jobs %>"/>
<div class="d-job-title">Recent Jobs</div>
<%
if(recentJobs.isEmpty())
{
%>
No jobs available.
<%
}
else
{
%>
<oneit:dynInclude page="/extensions/adminportal/inc/job_list.jsp" data="<%= CollectionUtils.EMPTY_MAP%>" ShortlistPage="<%= shortlistPage %>"
NextPage="<%= nextPage%>" HomePage="<%= homePage%>"
Jobs="<%= CollectionUtils.batch(recentJobs, 10).get(0).toArray(new Job[0]) %>"/>
<%
}
%>
</div>
</div>
</oneit:form>
......
<%@ page extends="oneit.servlets.jsp.JSPInclude" %>
<%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%>
<%@ include file="/inc/stdcms.jsp" %><%-- This is in cougar --%>
<%@ include file="/extensions/performa/inc/stdimports.jsp" %>
<oneit:dynIncluded>
<%
SecUser loggedInUser = SecUser.getTXUser(transaction);
CompanyUser companyUser = loggedInUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
Company company = companyUser.getCompany();
Debug.assertion(company != null , "Invalid company in admin portal my company");
String nextPage = WebUtils.getSamePageInRenderMode(request, "Billing");
%>
<script type="text/javascript">
$(document).ready(function()
{
recalcFunction = setupRecalc ($("makePayment"), {'recalcOnError':true});
});
</script>
<h1 class="page-title">My Hiring Team</h1>
<div class="my-company-area">
<oneit:form name="makePayment" method="post" enctype="multipart/form-data">
<div style="padding-left: 15px; padding-right: 15px;">
<oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/>
</div>
<oneit:dynInclude page="/extensions/adminportal/inc/my_company_tabs.jsp" TabNumber="3" data="<%= CollectionUtils.EMPTY_MAP%>"/>
<div class="company-content-area">
<!-- Tab panes -->
<div class="tab-content">
<div class="tab-pane active" id="company-detail">
<div class="form-group row">
<div class="col-md-12 col-sm-12 col-xs-12 text-left">
<label class="label-20 pay-subsc-txt">Billing</label><br/>
<span id="card-errors" style="color: #eb1c26; font-size: 15px;"></span>
</div>
</div>
<%
if(company.getCardID() != null)
{
%>
<oneit:dynInclude page="/extensions/adminportal/inc/existing_card.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"
Company="<%= company %>" IsEdit="<%= false %>" IsReplace="<%= true %>"/>
<%
}
%>
</div>
<div>
<div class="form-group row">
<div class="col-md-12 col-sm-12 col-xs-12 text-left">
<label class="label-14 bold">Replace Card</label><br/>
<label class="label-14">Your card details will be saved for future billing</label>
</div>
</div>
<div class="grey-area">
<oneit:dynInclude page="/extensions/adminportal/inc/card_details.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"
Company="<%= company %>" IsEdit="<%= false %>" IsReplace="<%= true %>"/>
<div class="form-group">
<oneit:button value="Save Card" name="updateCard" cssClass="btn btn-primary btn-green large-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry("Company", company)
.toMap() %>" />
</div>
</div>
</div>
</div>
</div>
</oneit:form>
<oneit:form name="editCompany" method="post" enctype="multipart/form-data">
<div class="row">
<div class="col-lg-4 col-md-4 col-sm-6">
<div class="form-group hide">
<input type="hidden" name="stripe-token-id" />
</div>
</div>
</div>
<oneit:button value="Pay" name="replaceCard" cssClass="hide" id="payNow"
requestAttribs='<%= CollectionUtils.mapEntry("nextPage", nextPage)
.toMap() %>'/>
</oneit:form>
<script src="https://js.stripe.com/v3/"></script>
<script>
var stripePubKey = '<%= MakePaymentFP.STRIPE_PUB_KEY %>';
</script>
<oneit:script>
<!-- MUST be included after initializing stripePubKey -->
<oneit:script src="/scripts/performaStripe.js"/>
</oneit:script>
</div>
</oneit:dynIncluded>
<%@ page extends="oneit.servlets.jsp.JSPInclude" %>
<%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%>
<%@ include file="/inc/stdcms.jsp" %><%-- This is in cougar --%>
<%@ include file="/extensions/performa/inc/stdimports.jsp" %>
<oneit:dynIncluded>
<%
SecUser loggedInUser = SecUser.getTXUser(transaction);
CompanyUser companyUser = loggedInUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
Company company = companyUser.getCompany();
String nextPage = WebUtils.getSamePageInRenderMode(request, WebUtils.CREATED_JOB) + "&fromJob=true";
Job job = (Job) process.getAttribute("Job");
String jobsPage = WebUtils.getSamePageInRenderMode(request, "Page");
Boolean ppj = (Boolean) process.getAttribute("PPJ");
%>
<oneit:form name="makePayment" method="post" enctype="multipart/form-data">
<script type="text/javascript">
$(document).ready(function()
{
recalcFunction = setupRecalc ($("makePayment"), {'recalcOnError':true});
});
</script>
<div class="main-created-job card-payment">
<h1 class="page-title select-payment-optio">
Enter Payment Details
</h1>
<div class="form-page-area billing-content-area">
<oneit:dynInclude page="/extensions/adminportal/inc/payment_plan.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"
Company="<%= company %>" Job="<%= job %>"/>
<div class="form-group row">
<div class="col-md-12 col-sm-12 col-xs-12 text-left">
<label class="label-20 pay-subsc-txt">Payment</label><br/>
<span id="card-errors" style="color: #eb1c26; font-size: 15px;"></span>
</div>
</div>
<%
if(company.getCardID() != null)
{
%>
<oneit:dynInclude page="/extensions/adminportal/inc/existing_card.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"
Company="<%= company %>" IsEdit="<%= false %>" IsReplace="<%= true %>"/>
<%
}
%>
<div class="form-brack-line"></div>
<div class="form-group row">
<div class="col-md-12 col-sm-12 col-xs-12 text-left">
<label class="label-14 bold">Replace Card</label><br/>
<label class="label-14">Your card details will be saved for future billing</label>
</div>
</div>
<div class="grey-area">
<oneit:dynInclude page="/extensions/adminportal/inc/card_details.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"
Company="<%= company %>" IsEdit="<%= false %>" IsReplace="<%= true %>"/>
</div>
<div class="form-group row" style="padding-top: 30px;">
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 btn-footer">
<oneit:button value="Cancel and go back to Jobs" name="gotoPage" skin="link" cssClass="cancel-and-go-back"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", jobsPage)
.toMap() %>" />
</div>
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 btn-right">
<oneit:button value="Pay and Open Job" name="savePayment" cssClass="btn btn-primary large-btn btn-green"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry("Company", company)
.toMap() %>" />
</div>
</div>
</div>
</div>
</oneit:form>
<oneit:form name="editJob" method="post" enctype="multipart/form-data">
<div class="row">
<div class="col-lg-4 col-md-4 col-sm-6">
<div class="form-group hide">
<input type="hidden" name="stripe-token-id" />
</div>
</div>
</div>
<oneit:button value="Pay" name="savePayment" cssClass="hide" id="payNow"
requestAttribs='<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry("Company", company)
.mapEntry("ReplaceCard", Boolean.TRUE)
.mapEntry("PPJ", ppj)
.toMap() %>'/>
</oneit:form>
<script src="https://js.stripe.com/v3/"></script>
<script>
var stripePubKey = '<%= MakePaymentFP.STRIPE_PUB_KEY %>';
</script>
<oneit:script>
<!-- MUST be included after initializing stripePubKey -->
<oneit:script src="/scripts/performaStripe.js"/>
</oneit:script>
</oneit:dynIncluded>
\ No newline at end of file
<?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
<?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_job</tableName>
<column name="last_edited" type="Date" nullable="true"/>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
<?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="plan_renewed_on" type="Date" nullable="true"/>
<column name="used_credits" type="Long" nullable="true"/>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
<?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_job</tableName>
<column name="is_ppj" type="Boolean" nullable="true"/>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
......@@ -83,7 +83,7 @@
});
});
function validate() {
var empty = false;
$('input[required]').each(function() {
......@@ -95,8 +95,7 @@
}
});
if (!$('input[name$=Password]').val() || $('input[name$=Password]').val() !== $('input[name$=Password2]').val())
{
if (<%= !socialLogin %> && (!$('input[name$=Password]').val() || $('input[name$=Password]').val() !== $('input[name$=Password2]').val())) {
empty = true;
}
......
......@@ -115,8 +115,6 @@
String appID = "app-id-" + jobApplication.getID().toString();
Integer overallRank = jobApplication.getOverallRank();
Boolean isTopRank = CollectionUtils.equals(overallRank, 1);
Map<FactorClass, Tuple.T3<Double, ColorCode, Double>> roleScoreMap = (Map<FactorClass, Tuple.T3<Double, ColorCode, Double>>)jobApplication.getRoleFit();
%>
<div class="<%= "appl-c-box " + (i == 0 ? " cb-one" : "")%> ">
<!--TODO: need to work on the logic. just added to demonstrate that there are 3 different colors for this-->
......@@ -143,19 +141,78 @@
<div class="jcc-box">
<div class="job-match jcc">
<img src="images/app-job-match-icon.svg"> Role fit
<span><oneit:toString value="<%= jobApplication.getRoleFitPercentage() %>" mode="PercentageTwoDP" /></span>
</div>
<%
if(!job.isExpressJob())
{
%>
<div class="detail-box">
<%
for(FactorClass factorClass : jobApplication.getSortedFactorClasses())
if(!job.isExpressJob())
{
if(factorClass != null && roleScoreMap.get(factorClass) != null)
{
%>
<span><oneit:toString value="<%= jobApplication.getRoleFitPercentage() %>" mode="PercentageTwoDP" /></span>
<%
}
%>
</div>
<%
if(job.isExpressJob())
{
Map<FactorClass, Map<FactorLevelLink, Map>> factorClassDtls = (Map<FactorClass, Map<FactorLevelLink, Map>>) jobApplication.getFactorScoreDetails();
for(FactorClass factorClass : factorClassDtls.keySet())
{
if(factorClass != null)
{
%>
<div class="detail-box ja-exp-b-p">
<div class="detail-row">
<div class="detail-label ja-exp-fact-c">
<oneit:toString value="<%= factorClass %>" mode="EscapeHTML"/>
</div>
</div>
</div>
<%
Map<FactorLevelLink, Map> factorDetails = factorClassDtls.get(factorClass);
for(FactorLevelLink factorLevelLink : factorDetails.keySet())
{
Map factorLinkDetails = factorDetails.get(factorLevelLink);
if(!factorLinkDetails.isEmpty())
{
FactorScore factorScore = (FactorScore) factorLinkDetails.get("factorScore");
%>
<div class="detail-box ja-exp-f-box">
<div class="detail-row">
<div class="detail-label">
<oneit:toString value="<%= factorLevelLink.getFactor() %>" mode="EscapeHTML"/>
</div>
<div class="detail-no">
<oneit:toString value="<%= factorScore.getScore() %>" mode="WholeNumber"/>
</div>
</div>
</div>
<div class="detail-box ja-exp-f-b-b">
</div>
<%
}
}
%>
<div class="detail-box ja-exp-f-c-b-b">
</div>
<%
}
}
}
else
{
%>
<div class="detail-box">
<%
Map<FactorClass, Tuple.T3<Double, ColorCode, Double>> roleScoreMap = (Map<FactorClass, Tuple.T3<Double, ColorCode, Double>>)jobApplication.getRoleFit();
for(FactorClass factorClass : jobApplication.getSortedFactorClasses())
{
if(factorClass != null && roleScoreMap.get(factorClass) != null)
{
%>
<div class="detail-row">
<div class="detail-label">
<oneit:toString value="<%= factorClass %>" mode="EscapeHTML"/>
......@@ -164,14 +221,14 @@
<oneit:toString value="<%= roleScoreMap.get(factorClass).get2() %>" mode="PercentageWholeNumber"/>
</div>
</div>
<%
<%
}
}
}
%>
</div>
<%
}
%>
%>
</div>
<%
}
%>
<div class="culture jcc">
<img src="images/culture-icon.svg"> culture fit
<span>
......
......@@ -93,6 +93,11 @@
showPercent: true
});
$(".info-toggle").click(function(){
// alert('sdfdsf')
$(this).parent('div').parent('.tab-row').next('.info-panel').slideToggle();
});
});
</script>
......
<%@page import="performa.utils.StripeUtils"%>
<%@page import="oneit.objstore.ObjectTransaction"%>
<%@page import="oneit.servlets.process.ProcessDecorator"%>
<%@page import="oneit.servlets.process.ORMProcessState"%>
<%@ page extends="oneit.servlets.jsp.FormJSP" %>
<%! protected String getName (ServletConfig config) { return "webhook_jsp"; } %>
<%
ORMProcessState process = (ORMProcessState) ProcessDecorator.getDefaultProcess(request);
ObjectTransaction objTran = process.getTransaction ();
StripeUtils.handleWebhook(request, objTran);
process.complete();
%>
\ No newline at end of file
<%@ page import="performa.orm.*, performa.orm.types.*, performa.form.*, performa.utils.*"%>
<%@ page import="performa.intercom.utils.*, performa.intercom.resources.User"%>
<%@ page import="oneit.objstore.rdbms.filters.*, oneit.security.jsp.SecUserToNameTransform, oneit.servlets.utils.*, oneit.utils.image.* "%>
<%@ page import="performa.intercom.utils.*, performa.intercom.resources.User, com.stripe.model.*"%>
<%@ page import="oneit.objstore.rdbms.filters.*, oneit.security.jsp.SecUserToNameTransform, oneit.servlets.utils.*, oneit.utils.image.*, oneit.objstore.utils.ObjstoreUtils "%>
<?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.DefineTableOperation">
<tableName factory="String">tl_payment_plan</tableName>
<column name="object_id" type="Long" nullable="false" length="11"/>
<column name="object_last_updated_date" type="Date" nullable="false" length="22"/>
<column name="object_created_date" type="Date" nullable="false" length="22"/>
<column name="stripe_reference" type="String" nullable="false" length="100"/>
<column name="plan_name" type="CLOB" nullable="true"/>
<column name="description" type="CLOB" nullable="true"/>
<column name="currency_type" type="String" nullable="false" length="200"/>
<column name="amount" type="Double" nullable="false"/>
<column name="interval" type="String" nullable="false" length="200"/>
<column name="interval_count" type="Long" nullable="false"/>
<column name="trial_period_days" type="Long" nullable="true"/>
<column name="active_job_count" type="Long" nullable="true"/>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
<?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="name_on_card" type="String" nullable="true" length="100"/>
<column name="card_post_code" type="String" nullable="true" length="10"/>
<column name="card_id" type="String" nullable="true" length="100"/>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
<?xml version="1.0" ?><svg height="60px" version="1.1" viewBox="0 0 60 60" width="60px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><title/><desc/><defs/><g fill="none" fill-rule="evenodd" id="Page-1" stroke="none" stroke-width="1"><g id="Social_icons" transform="translate(-422.000000, -954.000000)"><g id="Mastercard" transform="translate(422.000000, 954.000000)"><circle cx="30" cy="30" fill="#FFFFFF" id="Oval" r="30"/><g id="g3110" transform="translate(12.000000, 19.000000)"><path d="M35.9736305,11.1445924 C35.9736305,17.2982476 30.994537,22.2867716 24.8525128,22.2867716 C18.7104886,22.2867716 13.7313936,17.2982476 13.7313936,11.1445924 C13.7313936,4.99093624 18.7104886,0.00241261301 24.8525128,0.00241261301 C30.994537,0.00241261301 35.9736305,4.99093624 35.9736305,11.1445924 L35.9736305,11.1445924 Z" fill="#F79F1A" id="path2997"/><path d="M22.2540437,11.1445924 C22.2540437,17.2982476 17.2749503,22.2867716 11.132926,22.2867716 C4.99090183,22.2867716 0.0118068562,17.2982476 0.0118068562,11.1445924 C0.0118068562,4.99093624 4.99090183,0.00241261301 11.132926,0.00241261301 C17.2749503,0.00241261301 22.2540437,4.99093624 22.2540437,11.1445924 L22.2540437,11.1445924 Z" fill="#EA001B" id="path2995"/><path d="M17.9927419,2.3733871 C15.3979037,4.41315778 13.7322581,7.58283794 13.7322581,11.1435484 C13.7322581,14.7042588 15.3979037,17.8763582 17.9927419,19.916129 C20.5875801,17.8763582 22.2532258,14.7042588 22.2532258,11.1435484 C22.2532258,7.58283794 20.5875801,4.41315778 17.9927419,2.3733871 L17.9927419,2.3733871 Z" fill="#FF5F01" id="path2999"/></g></g></g></g></svg>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<svg width="19px" height="24px" viewBox="0 0 19 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: sketchtool 48.2 (47327) - http://www.bohemiancoding.com/sketch -->
<title>C8712D45-F20C-4D6B-8B1B-7BF5B326C740</title>
<desc>Created with sketchtool.</desc>
<defs>
<polygon id="path-1" points="0.0177487805 0.0224188235 16.8673079 0.0224188235 16.8673079 22.1449412 0.0177487805 22.1449412"></polygon>
<polygon id="path-3" points="0 23.9775812 18.9526738 23.9775812 18.9526738 0.0564705882 0 0.0564705882"></polygon>
</defs>
<g id="HT024---Invoices" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" transform="translate(-1304.000000, -514.000000)">
<g id="Group-2-Copy-2" transform="translate(706.000000, 514.000000)">
<g id="pdf" transform="translate(598.000000, 0.000000)">
<g id="Group-3" transform="translate(2.085366, 0.034052)">
<mask id="mask-2" fill="white">
<use xlink:href="#path-1"></use>
</mask>
<g id="Clip-2"></g>
<path d="M7.64427927,21.2940988 L1.96148354,21.2940988 C1.37057195,21.2940988 0.890590244,20.7648 0.890590244,20.11392 L0.890590244,9.82689882 L0.0177487805,9.82689882 L0.0177487805,20.11392 C0.0177487805,21.2336753 0.889721341,22.1449412 1.96148354,22.1449412 L8.31889512,22.1449412 L7.64427927,21.2940988 Z M12.4516848,5.32585412 C12.1410232,5.32585412 11.8879409,5.03909647 11.8879409,4.68598588 L11.8879409,1.53865412 L15.4403037,5.32585412 L12.4516848,5.32585412 Z M11.6478921,0.0223623529 L1.96148354,0.0223623529 C0.889721341,0.0223623529 0.0177487805,0.933628235 0.0177487805,2.05338353 L0.0177487805,3.89212235 L0.890590244,3.89212235 L0.890590244,2.05338353 C0.890590244,1.40250353 1.37057195,0.873261176 1.96148354,0.873261176 L11.0150415,0.873261176 L11.0150415,4.68598588 C11.0150415,5.50791529 11.6593616,6.17669647 12.4516848,6.17669647 L15.9944896,6.17669647 L15.9944896,20.11392 C15.9944896,20.7648 15.5143921,21.2940988 14.9235384,21.2940988 L13.6727823,21.2940988 L12.9981085,22.1449412 L14.9235384,22.1449412 C15.9953006,22.1449412 16.8673311,21.2336753 16.8673311,20.11392 L16.8673311,5.58618353 L11.6478921,0.0223623529 Z" id="Fill-1" fill="#4D4D4D" mask="url(#mask-2)"></path>
</g>
<mask id="mask-4" fill="white">
<use xlink:href="#path-3"></use>
</mask>
<g id="Clip-5"></g>
<polygon id="Fill-4" fill="#E03E1A" mask="url(#mask-4)" points="0 9.26575059 11.5930122 9.26575059 11.5930122 4.52188235 0 4.52188235"></polygon>
<path d="M9.05765915,18.7693271 C8.94823537,18.7693271 8.84831159,18.8299765 8.80011646,18.9258071 C8.75186341,19.0215247 8.76373841,19.1357082 8.83070183,19.2200753 L12.5170494,23.86896 C12.5713848,23.9375153 12.6552049,23.9776094 12.7440646,23.9776094 C12.8328665,23.9776094 12.9166866,23.9375153 12.9710799,23.86896 L16.6574854,19.2200753 C16.7244488,19.1357082 16.7363238,19.0215247 16.6880707,18.9258071 C16.6398756,18.8299765 16.5399518,18.7693271 16.4304701,18.7693271 L15.072839,18.7693271 C14.9935951,18.7693271 14.9293543,18.7067576 14.9293543,18.6294494 L14.9293543,13.6545035 C14.9293543,13.5 14.8008726,13.3748047 14.6424427,13.3748047 L10.8457445,13.3748047 C10.6873146,13.3748047 10.5588329,13.5 10.5588329,13.6545035 L10.5588329,18.6294494 C10.5588329,18.7067576 10.4945921,18.7693271 10.4153482,18.7693271 L9.05765915,18.7693271 Z" id="Fill-6" fill="#E03E1A" mask="url(#mask-4)"></path>
<path d="M2.56623384,6.78934588 C2.6268253,6.80301176 2.7010875,6.80747294 2.80350213,6.80747294 C3.18066372,6.80747294 3.41347165,6.62134588 3.41347165,6.30816 C3.41347165,6.02693647 3.21333445,5.85888 2.8595753,5.85888 C2.71522165,5.85888 2.6173253,5.87248941 2.56623384,5.88609882 L2.56623384,6.78934588 Z M1.8633497,5.40056471 C2.08202348,5.36414118 2.38915152,5.33703529 2.82232835,5.33703529 C3.25990762,5.33703529 3.57195945,5.41863529 3.78124909,5.58206118 C3.98173384,5.73645176 4.11670335,5.99056941 4.11670335,6.29008941 C4.11670335,6.58960941 4.01428872,6.84389647 3.82776433,7.01635765 C3.58597774,7.23879529 3.22729482,7.33863529 2.80842591,7.33863529 C2.71522165,7.33863529 2.63140152,7.33411765 2.56623384,7.32491294 L2.56623384,8.41880471 L1.8633497,8.41880471 L1.8633497,5.40056471 Z" id="Fill-7" fill="#FFFFFF" mask="url(#mask-4)"></path>
<path d="M5.28203476,7.89680753 C5.34227866,7.91047341 5.44011707,7.91047341 5.52851341,7.91047341 C6.17109573,7.915104 6.5903122,7.57012518 6.5903122,6.83922635 C6.59483049,6.20381929 6.21315061,5.86804518 5.60312317,5.86804518 C5.44469329,5.86804518 5.34227866,5.88171106 5.28203476,5.89515106 L5.28203476,7.89680753 Z M4.56965061,5.40052518 C4.83014756,5.35969694 5.17017805,5.33699576 5.52851341,5.33699576 C6.12440671,5.33699576 6.51112622,5.44135341 6.81362012,5.66384753 C7.13963232,5.89983812 7.34440366,6.27655341 7.34440366,6.81658165 C7.34440366,7.40212518 7.1255561,7.80605929 6.82312012,8.05565929 C6.49253171,8.32349929 5.98949512,8.45061459 5.37494939,8.45061459 C5.00711402,8.45061459 4.74632744,8.42785694 4.56965061,8.40515576 L4.56965061,5.40052518 Z" id="Fill-8" fill="#FFFFFF" mask="url(#mask-4)"></path>
<polygon id="Fill-9" fill="#FFFFFF" mask="url(#mask-4)" points="7.81178049 5.35968565 9.72962195 5.35968565 9.72962195 5.92698918 8.52410671 5.92698918 8.52410671 6.62598212 9.65078354 6.62598212 9.65078354 7.18893741 8.52410671 7.18893741 8.52410671 8.41881035 7.81178049 8.41881035"></polygon>
</g>
</g>
</g>
</svg>
\ No newline at end of file
<?xml version="1.0" ?><!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'><svg height="512px" style="enable-background:new 0 0 512 512;" version="1.1" viewBox="0 0 512 512" width="512px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="形状_1_3_" style="enable-background:new ;"><g id="形状_1"><g><path d="M211.328,184.445l-23.465,144.208h37.542l23.468-144.208 H211.328z M156.276,184.445l-35.794,99.185l-4.234-21.358l0.003,0.007l-0.933-4.787c-4.332-9.336-14.365-27.08-33.31-42.223 c-5.601-4.476-11.247-8.296-16.705-11.559l32.531,124.943h39.116l59.733-144.208H156.276z M302.797,224.48 c0-16.304,36.563-14.209,52.629-5.356l5.357-30.972c0,0-16.534-6.288-33.768-6.288c-18.632,0-62.875,8.148-62.875,47.739 c0,37.26,51.928,37.723,51.928,57.285c0,19.562-46.574,16.066-61.944,3.726l-5.586,32.373c0,0,16.763,8.148,42.382,8.148 c25.616,0,64.272-13.271,64.272-49.37C355.192,244.272,302.797,240.78,302.797,224.48z M455.997,184.445h-30.185 c-13.938,0-17.332,10.747-17.332,10.747l-55.988,133.461h39.131l7.828-21.419h47.728l4.403,21.419h34.472L455.997,184.445z M410.27,277.641l19.728-53.966l11.098,53.966H410.27z" style="fill-rule:evenodd;clip-rule:evenodd;fill:#005BAC;"/></g></g></g><g id="形状_1_2_" style="enable-background:new ;"><g id="形状_1_1_"><g><path d="M104.132,198.022c0,0-1.554-13.015-18.144-13.015H25.715 l-0.706,2.446c0,0,28.972,5.906,56.767,28.033c26.562,21.148,35.227,47.51,35.227,47.51L104.132,198.022z" style="fill-rule:evenodd;clip-rule:evenodd;fill:#F6AC1D;"/></g></g></g></svg>
\ No newline at end of file
......@@ -9,12 +9,14 @@
<oneit:css>
<oneit:css href="/css/bootstrap.min.css" />
<oneit:css href="/css/select2.min.css" />
<oneit:css href="/css/jquery-ui-1.11.xx/jquery-ui.css"/>
<oneit:css href="/css/common.css" />
<oneit:css href="/css/fa/font-awesome.css" />
</oneit:css>
<oneit:script>
<oneit:script src="/scripts/jquery-1.12.4.min.js"/>
<oneit:script src="/scripts/jquery-ui-1.11.xx.js"/>
<oneit:script src="/scripts/bootstrap.min.js" />
<oneit:script src="/scripts/select2.min.js"/>
<oneit:script src="/scripts/common.js"/>
......
$(document).ready(function () {
var sdh = $('.company-content-area').outerHeight() > 700 ? $('.company-content-area').outerHeight() : 700;
$('.tabing-sidebar').css('min-height',sdh);
$('select').select2({
minimumResultsForSearch: Infinity
});
......@@ -23,14 +27,14 @@ $(document).ready(function () {
$('.errorField input, .errorField select, .errorField textarea, .errorField .assocObjDesc').eq(0).focus();
/*Set sidebar height*/
$(window).load(function() {
var sdh = $('.company-content-area').outerHeight();
$('.tabing-sidebar').css('min-height',sdh);
});
$(window).resize(function(){
var sdh = $('.company-content-area').outerHeight();
$('.tabing-sidebar').css('min-height',sdh);
});
// $(window).load(function() {
// var sdh = $('.company-content-area').outerHeight();
// $('.tabing-sidebar').css('min-height',sdh);
// });
// $(window).resize(function(){
// var sdh = $('.company-content-area').outerHeight();
// $('.tabing-sidebar').css('min-height',sdh);
// });
});
function addUserPic(opt) {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
/**
* Reference : https://stripe.com/docs/stripe-js#elements
*/
// Create a Stripe client
var stripe = Stripe(stripePubKey);
// Create an instance of Elements
var elements = stripe.elements();
// Custom styling can be passed to options when creating an Element.
var style = {
base: {
// Add your base input styles here. For example:
fontSize: '18px',
fontFamily: '"Usual-Light"',
color: "#555",
'::placeholder': {
color: '#DBDBDF',
fontSize: '18px',
},
// padding-top: "7px !important",
}
};
var cardNumber = elements.create('cardNumber', {style: style, placeholder: ''});
cardNumber.mount('#card-number');
var cardExpiry = elements.create('cardExpiry', {style: style});
cardExpiry.mount('#card-expiry');
var cardCvc = elements.create('cardCvc', {style: style, placeholder: ''});
cardCvc.mount('#card-cvc');
cardNumber.addEventListener('change', function(event) {
var displayError = document.getElementById('card-errors');
if (event.error) {
displayError.textContent = event.error.message;
} else {
displayError.textContent = '';
}
});
cardExpiry.addEventListener('change', function(event) {
var displayError = document.getElementById('card-errors');
if (event.error) {
displayError.textContent = event.error.message;
} else {
displayError.textContent = '';
}
});
cardCvc.addEventListener('change', function(event) {
var displayError = document.getElementById('card-errors');
if (event.error) {
displayError.textContent = event.error.message;
} else {
displayError.textContent = '';
}
});
// Create a token or display an error when the form is submitted.
var form = document.getElementById('makePayment');
form.addEventListener('submit', function(event) {
event.preventDefault();
var nameOnCard = document.getElementById('NameOnCard').value;
var postalCode = document.getElementById('PostCode').value;
stripe.createToken(cardNumber, {name: nameOnCard, address_zip : postalCode}).then(function(result) {
if (result.error) {
// Inform the customer that there was an error
var errorElement = document.getElementById('card-errors');
errorElement.textContent = result.error.message;
} else {
// Send the token to your server
$('input[name=stripe-token-id]').val(result.token.id);
$('#payNow').click();
}
});
});
\ No newline at end of file
/**
* Reference : https://stripe.com/docs/stripe-js#elements
*/
// Create a Stripe client
var stripe = Stripe(stripePubKey);
var form = document.getElementById('makePayment');
form.addEventListener('submit', function(event) {
event.preventDefault();
var cardExpiry = document.getElementById('cardExpiry').value;
if(cardExpiry.length !== 0 && !Stripe.card.validateExpiry(cardExpiry))
{
var displayError = document.getElementById('card-errors');
displayError.textContent = "Please enter a valid expiry";
}
else
{
$('input[name=expiry-date]').val(document.getElementById('cardExpiry').value);
$('input[name=holder-name]').val(document.getElementById('NameOnCard').value);
$('input[name=address-zip]').val(document.getElementById('PostCode').value);
$('#payNow').click();
}
});
\ No newline at end of file
......@@ -4,7 +4,7 @@
<SYSTEM name="PerformaInvestments" targetDir="C:/build/PerformaInvestments" executor="testMainApp">
<WEBAPP name="cmsWebApp" relative-path="cmsWebApp" deployment="cms">
<OVERLAY system="CougarCMS8.2" subsystem="cmsWebApp" pin="d610a98773b9e156fb1aaa49ea6561f570a387f6"/>
<OVERLAY system="CougarCMS8.2" subsystem="cmsWebApp" pin="90996c49c3f6371029c5c0511b995a9c2be0f598"/>
</WEBAPP>
<PARAMETER name="key.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