Commit 3ecd2258 by Nilu

set up payment plan modifications

parent ee7fc713
......@@ -35,6 +35,7 @@
<column name="coupon_expiry_date" type="Date" nullable="true"/>
<column name="last_plan_amount" type="Double" nullable="true"/>
<column name="google_address_text" type="String" nullable="true" length="300"/>
<column name="plan_cancelled" type="Boolean" nullable="true"/>
<column name="company_id" type="Long" length="11" nullable="false"/>
<column name="billing_team_id" type="Long" length="11" nullable="true"/>
<column name="added_by_user_id" type="Long" length="11" nullable="false"/>
......
......@@ -35,6 +35,7 @@ CREATE TABLE tl_hiring_team (
coupon_expiry_date datetime NULL,
last_plan_amount numeric(20,5) NULL,
google_address_text varchar(300) NULL,
plan_cancelled char(1) NULL,
company_id numeric(12) NOT NULL,
billing_team_id numeric(12) NULL,
added_by_user_id numeric(12) NOT NULL,
......
......@@ -36,6 +36,7 @@ CREATE TABLE tl_hiring_team (
coupon_expiry_date date NULL,
last_plan_amount number(20,5) NULL,
google_address_text varchar2(300) NULL,
plan_cancelled char(1) NULL,
company_id number(12) NOT NULL,
billing_team_id number(12) NULL,
added_by_user_id number(12) NOT NULL,
......
......@@ -36,6 +36,7 @@ CREATE TABLE tl_hiring_team (
coupon_expiry_date timestamp NULL,
last_plan_amount numeric(20,5) NULL,
google_address_text varchar(300) NULL,
plan_cancelled char(1) NULL,
company_id numeric(12) NOT NULL,
billing_team_id numeric(12) NULL,
added_by_user_id numeric(12) NOT NULL,
......
package performa.form;
import com.stripe.model.Subscription;
import java.util.Date;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import oneit.logging.LogLevel;
......@@ -16,7 +15,6 @@ import oneit.utils.BusinessException;
import oneit.utils.CollectionUtils;
import oneit.utils.MultiException;
import performa.orm.HiringTeam;
import performa.orm.PaymentPlan;
import performa.utils.StripeUtils;
......@@ -28,7 +26,6 @@ public class SaveCompanyFP extends SaveFP
HttpServletRequest request = submission.getRequest();
HiringTeam hiringTeam = (HiringTeam) process.getAttribute("HiringTeam");
Boolean isPayment = (Boolean) request.getAttribute("IsPayment");
PaymentPlan paymentPlan = (PaymentPlan) request.getAttribute("PaymentPlan");
Subscription subscription = StripeUtils.retrieveSubscription(hiringTeam.getStripeSubscription());
if(CollectionUtils.equals(hiringTeam.getIsLogoDeleted(), Boolean.TRUE))
......@@ -65,90 +62,6 @@ public class SaveCompanyFP extends SaveFP
}
}
if(subscription != null)
{
if(hiringTeam.getIsPPJ())
{
StripeUtils.cancelSubscription(subscription, true);
LogMgr.log(HiringTeam.LOG, LogLevel.PROCESSING1,"In SaveCompanyFP cancelling a subscription in Stripe since moving to PPJ : ", subscription );
}
else
{
if(hiringTeam.getPaymentPlan() != null)
{
StripeUtils.cancelSubscription(subscription, false);
LogMgr.log(HiringTeam.LOG, LogLevel.PROCESSING1,"In SaveCompanyFP reactivating a subscription (as subscription is not cancelled yet) in Stripe since moving to Subscription from PPJ : ", subscription );
}
}
}
if(CollectionUtils.equals(isPayment, Boolean.TRUE))
{
LogMgr.log(HiringTeam.LOG, LogLevel.PROCESSING1,"Hiring Team payment plan updated.", hiringTeam, " payment plan: ", hiringTeam.getPaymentPlan());
if(hiringTeam.getCardID() == null)
{
throw new BusinessException("Please enter billing details before selecting a payment plan");
}
// cannot subscribe a user to a plan without card details
Subscription updatedSubscription = StripeUtils.updatePlan(hiringTeam, subscription, paymentPlan);
if(updatedSubscription == null)
{
throw new BusinessException("Problem with changing your plan. Please contact adminstrator for more info.");
}
PaymentPlan currentPlan = hiringTeam.getPaymentPlan();
if(subscription != null && currentPlan != null && currentPlan.getActiveJobCount() < paymentPlan.getActiveJobCount())
{
boolean hasValidCoupon = hiringTeam.hasValidCouponOn(new Date(subscription.getCurrentPeriodEnd() * 1000));
double currentPlanCost = hiringTeam.getLastPlanAmount() != null ? hiringTeam.getLastPlanAmount() : currentPlan.getAmount();
double newPlanCost = hasValidCoupon ? paymentPlan.getAmount() * (1 - (hiringTeam.getCoupon().getPercentageOff() * 0.01)) : paymentPlan.getAmount();
double costDiff = newPlanCost - currentPlanCost;
StripeUtils.chargeUpgradePlanDifference(hiringTeam, costDiff);
}
double discountPercentage = 0d;
if(subscription != null && subscription.getDiscount() != null && subscription.getDiscount().getCoupon() != null && subscription.getDiscount().getCoupon().getPercentOff() != null)
{
discountPercentage = 1 - (subscription.getDiscount().getCoupon().getPercentOff().doubleValue() * 0.01 );
}
hiringTeam.setLastPlanAmount(discountPercentage > 0 ? paymentPlan.getAmount() * discountPercentage : paymentPlan.getAmount());
if(currentPlan == null || currentPlan.getActiveJobCount() < paymentPlan.getActiveJobCount())
{
hiringTeam.setAvailableCredits(paymentPlan.getActiveJobCount());
}
hiringTeam.setPaymentPlan(paymentPlan);
LogMgr.log(HiringTeam.LOG, LogLevel.PROCESSING1,"Stripe subscription updated.", hiringTeam, hiringTeam.getStripeSubscription());
}
if(!hiringTeam.isTrue(hiringTeam.getHasCap()))
{
hiringTeam.setMaxCap(null);
}
if(hiringTeam.isTrue(hiringTeam.getHasCap()) && hiringTeam.getPaymentPlan() != null)
{
if(hiringTeam.getMaxCap() == null)
{
hiringTeam.setMaxCap(hiringTeam.getPaymentPlan().getActiveJobCount());
}
else if(hiringTeam.getMaxCap() < hiringTeam.getPaymentPlan().getActiveJobCount())
{
throw new BusinessException("Cap should be greater than the number of jobs of the selected plan");
}
}
// // Update company in intercom
// IntercomUtils.updateCompany(company);
......
package performa.form;
import com.stripe.model.Subscription;
import java.util.Date;
import java.util.Map;
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.orm.HiringTeam;
import performa.orm.PaymentPlan;
import performa.utils.StripeUtils;
public class SavePaymentPlanFP extends SaveFP
{
@Override
public SuccessfulResult processForm(ORMProcessState process, SubmissionDetails submission, Map params) throws BusinessException, StorageException
{
HttpServletRequest request = submission.getRequest();
HiringTeam hiringTeam = (HiringTeam) process.getAttribute("HiringTeam");
PaymentPlan paymentPlan = request.getAttribute("PaymentPlan") != null ? (PaymentPlan) request.getAttribute("PaymentPlan") : hiringTeam.getPaymentPlan();
Boolean firstTime = request.getAttribute("firstTime") != null ? (Boolean) request.getAttribute("firstTime") : Boolean.FALSE;
Boolean savePlan = request.getAttribute("savePlan") != null ? (Boolean) request.getAttribute("savePlan") : Boolean.FALSE;
Boolean savePPJ = request.getAttribute("savePPJ") != null ? (Boolean) request.getAttribute("savePPJ") : Boolean.FALSE;
Boolean saveCap = request.getAttribute("saveCap") != null ? (Boolean) request.getAttribute("saveCap") : Boolean.FALSE;
// Billing needs to be setup first. Cannot subscribe a user to a plan without card details
if(hiringTeam.getCardID() == null)
{
throw new BusinessException("Please enter billing details before selecting a payment plan");
}
Subscription subscription = StripeUtils.retrieveSubscription(hiringTeam.getStripeSubscription());
if(subscription != null && savePPJ)
{
if(CollectionUtils.equals(hiringTeam.getIsPPJ(), Boolean.TRUE))
{
StripeUtils.cancelSubscription(subscription, true);
hiringTeam.setHasCap(false);
hiringTeam.setMaxCap(null);
hiringTeam.setPlanCancelled(true);
LogMgr.log(HiringTeam.LOG, LogLevel.PROCESSING1,"In SaveCompanyFP cancelling a subscription in Stripe since moving to PPJ : ", subscription );
}
else
{
if(hiringTeam.getPaymentPlan() != null && hiringTeam.isTrue(hiringTeam.getPlanCancelled()))
{
StripeUtils.cancelSubscription(subscription, false);
hiringTeam.setPlanCancelled(false);
LogMgr.log(HiringTeam.LOG, LogLevel.PROCESSING1,"In SaveCompanyFP reactivating a subscription (as subscription is not cancelled yet) in Stripe since moving to Subscription from PPJ : ", subscription );
}
}
}
// When Subscribe and Save selected
if(CollectionUtils.equals(hiringTeam.getIsPPJ(), Boolean.FALSE) && (firstTime || savePlan))
{
LogMgr.log(HiringTeam.LOG, LogLevel.PROCESSING1,"Hiring Team payment plan updated.", hiringTeam, " payment plan: ", hiringTeam.getPaymentPlan());
Subscription updatedSubscription = StripeUtils.updatePlan(hiringTeam, subscription, paymentPlan);
if(updatedSubscription == null)
{
throw new BusinessException("Problem with changing your plan. Please contact adminstrator for more info.");
}
if(firstTime)
{
hiringTeam.setAvailableCredits(paymentPlan.getActiveJobCount());
}
else
{
PaymentPlan currentPlan = hiringTeam.getPaymentPlan();
if(subscription != null && currentPlan != null && currentPlan.getActiveJobCount() < paymentPlan.getActiveJobCount())
{
boolean hasValidCoupon = hiringTeam.hasValidCouponOn(new Date(subscription.getCurrentPeriodEnd() * 1000));
double currentPlanCost = hiringTeam.getLastPlanAmount() != null ? hiringTeam.getLastPlanAmount() : currentPlan.getAmount();
double newPlanCost = hasValidCoupon ? paymentPlan.getAmount() * (1 - (hiringTeam.getCoupon().getPercentageOff() * 0.01)) : paymentPlan.getAmount();
double costDiff = newPlanCost - currentPlanCost;
StripeUtils.chargeUpgradePlanDifference(hiringTeam, costDiff);
hiringTeam.setAvailableCredits(paymentPlan.getActiveJobCount());
}
hiringTeam.setPaymentPlan(paymentPlan);
}
double discountPercentage = 0d;
if(subscription != null && subscription.getDiscount() != null && subscription.getDiscount().getCoupon() != null && subscription.getDiscount().getCoupon().getPercentOff() != null)
{
discountPercentage = 1 - (subscription.getDiscount().getCoupon().getPercentOff().doubleValue() * 0.01 );
}
hiringTeam.setLastPlanAmount(discountPercentage > 0 ? paymentPlan.getAmount() * discountPercentage : paymentPlan.getAmount());
LogMgr.log(HiringTeam.LOG, LogLevel.PROCESSING1,"Stripe subscription updated.", hiringTeam, hiringTeam.getStripeSubscription());
}
if(!hiringTeam.isTrue(hiringTeam.getHasCap()))
{
hiringTeam.setMaxCap(null);
}
if((firstTime || saveCap) && (hiringTeam.isTrue(hiringTeam.getHasCap()) && hiringTeam.getPaymentPlan() != null))
{
if(hiringTeam.getMaxCap() == null)
{
hiringTeam.setMaxCap(hiringTeam.getPaymentPlan().getActiveJobCount());
}
else if(hiringTeam.getMaxCap() < hiringTeam.getPaymentPlan().getActiveJobCount())
{
throw new BusinessException("Cap should be greater than the number of jobs of the selected plan");
}
}
return super.processForm(process, submission, params);
}
@Override
public void validate(ORMProcessState process, SubmissionDetails submission, MultiException exceptions, Map params) throws StorageException
{
HttpServletRequest request = submission.getRequest();
HiringTeam hiringTeam = (HiringTeam) process.getAttribute("HiringTeam");
PaymentPlan paymentPlan = request.getAttribute("PaymentPlan") != null ? (PaymentPlan) request.getAttribute("PaymentPlan") : hiringTeam.getPaymentPlan();
Boolean firstTime = request.getAttribute("firstTime") != null ? (Boolean) request.getAttribute("firstTime") : Boolean.FALSE;
Boolean savePlan = request.getAttribute("savePlan") != null ? (Boolean) request.getAttribute("savePlan") : Boolean.FALSE;
if(CollectionUtils.equals(hiringTeam.getIsPPJ(), Boolean.FALSE) && (firstTime || savePlan))
{
BusinessObjectParser.assertFieldCondition(paymentPlan != null, hiringTeam , HiringTeam.SINGLEREFERENCE_PaymentPlan, "mandatory", exceptions, true, request);
}
super.validate(process, submission, exceptions, params);
}
}
\ No newline at end of file
......@@ -69,6 +69,7 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
public static final String FIELD_CouponExpiryDate = "CouponExpiryDate";
public static final String FIELD_LastPlanAmount = "LastPlanAmount";
public static final String FIELD_GoogleAddressText = "GoogleAddressText";
public static final String FIELD_PlanCancelled = "PlanCancelled";
public static final String FIELD_IsLogoDeleted = "IsLogoDeleted";
public static final String FIELD_CouponCode = "CouponCode";
public static final String FIELD_StripeBrand = "StripeBrand";
......@@ -119,6 +120,7 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
private static final DefaultAttributeHelper<HiringTeam> HELPER_CouponExpiryDate = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<HiringTeam> HELPER_LastPlanAmount = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<HiringTeam> HELPER_GoogleAddressText = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<HiringTeam> HELPER_PlanCancelled = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<HiringTeam> HELPER_IsLogoDeleted = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<HiringTeam> HELPER_CouponCode = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<HiringTeam> HELPER_StripeBrand = DefaultAttributeHelper.INSTANCE;
......@@ -153,6 +155,7 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
private Date _CouponExpiryDate;
private Double _LastPlanAmount;
private String _GoogleAddressText;
private Boolean _PlanCancelled;
private Boolean _IsLogoDeleted;
private String _CouponCode;
private String _StripeBrand;
......@@ -208,6 +211,7 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
private static final AttributeValidator[] FIELD_CouponExpiryDate_Validators;
private static final AttributeValidator[] FIELD_LastPlanAmount_Validators;
private static final AttributeValidator[] FIELD_GoogleAddressText_Validators;
private static final AttributeValidator[] FIELD_PlanCancelled_Validators;
// Arrays of behaviour decorators
......@@ -265,6 +269,7 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
FIELD_CouponExpiryDate_Validators = (AttributeValidator[])setupAttribMetaData_CouponExpiryDate(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_LastPlanAmount_Validators = (AttributeValidator[])setupAttribMetaData_LastPlanAmount(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_GoogleAddressText_Validators = (AttributeValidator[])setupAttribMetaData_GoogleAddressText(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_PlanCancelled_Validators = (AttributeValidator[])setupAttribMetaData_PlanCancelled(validatorMapping).toArray (new AttributeValidator[0]);
REFERENCE_HiringTeam.initialiseReference ();
......@@ -990,6 +995,25 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_PlanCancelled(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "plan_cancelled");
metaInfo.put ("defaultValue", "Boolean.FALSE");
metaInfo.put ("name", "PlanCancelled");
metaInfo.put ("type", "Boolean");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for HiringTeam.PlanCancelled:", metaInfo);
ATTRIBUTES_METADATA_HiringTeam.put (FIELD_PlanCancelled, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(HiringTeam.class, "PlanCancelled", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for HiringTeam.PlanCancelled:", validators);
return validators;
}
// END OF STATIC METADATA DEFINITION
......@@ -1044,6 +1068,7 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
_CouponExpiryDate = (Date)(HELPER_CouponExpiryDate.initialise (_CouponExpiryDate));
_LastPlanAmount = (Double)(HELPER_LastPlanAmount.initialise (_LastPlanAmount));
_GoogleAddressText = (String)(HELPER_GoogleAddressText.initialise (_GoogleAddressText));
_PlanCancelled = (Boolean)(Boolean.FALSE);
_IsLogoDeleted = (Boolean)(Boolean.FALSE);
_CouponCode = (String)(HELPER_CouponCode.initialise (_CouponCode));
_StripeBrand = (String)(HELPER_StripeBrand.initialise (_StripeBrand));
......@@ -3737,6 +3762,104 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
}
/**
* Get the attribute PlanCancelled
*/
public Boolean getPlanCancelled ()
{
assertValid();
Boolean valToReturn = _PlanCancelled;
for (HiringTeamBehaviourDecorator bhd : HiringTeam_BehaviourDecorators)
{
valToReturn = bhd.getPlanCancelled ((HiringTeam)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 prePlanCancelledChange (Boolean newPlanCancelled) 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 postPlanCancelledChange () throws FieldException
{
}
public FieldWriteability getWriteability_PlanCancelled ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute PlanCancelled. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setPlanCancelled (Boolean newPlanCancelled) throws FieldException
{
boolean oldAndNewIdentical = HELPER_PlanCancelled.compare (_PlanCancelled, newPlanCancelled);
try
{
for (HiringTeamBehaviourDecorator bhd : HiringTeam_BehaviourDecorators)
{
newPlanCancelled = bhd.setPlanCancelled ((HiringTeam)this, newPlanCancelled);
oldAndNewIdentical = HELPER_PlanCancelled.compare (_PlanCancelled, newPlanCancelled);
}
if (FIELD_PlanCancelled_Validators.length > 0)
{
Object newPlanCancelledObj = HELPER_PlanCancelled.toObject (newPlanCancelled);
if (newPlanCancelledObj != null)
{
int loopMax = FIELD_PlanCancelled_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_HiringTeam.get (FIELD_PlanCancelled);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_PlanCancelled_Validators[v].checkAttribute (this, FIELD_PlanCancelled, metadata, newPlanCancelledObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_PlanCancelled () != FieldWriteability.FALSE, "Field PlanCancelled is not writeable");
prePlanCancelledChange (newPlanCancelled);
markFieldChange (FIELD_PlanCancelled);
_PlanCancelled = newPlanCancelled;
postFieldChange (FIELD_PlanCancelled);
postPlanCancelledChange ();
}
}
/**
* Get the attribute IsLogoDeleted
*/
public Boolean getIsLogoDeleted ()
......@@ -5405,6 +5528,7 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
tl_hiring_teamPSet.setAttrib (FIELD_CouponExpiryDate, HELPER_CouponExpiryDate.toObject (_CouponExpiryDate)); //
tl_hiring_teamPSet.setAttrib (FIELD_LastPlanAmount, HELPER_LastPlanAmount.toObject (_LastPlanAmount)); //
tl_hiring_teamPSet.setAttrib (FIELD_GoogleAddressText, HELPER_GoogleAddressText.toObject (_GoogleAddressText)); //
tl_hiring_teamPSet.setAttrib (FIELD_PlanCancelled, HELPER_PlanCancelled.toObject (_PlanCancelled)); //
_Company.getPersistentSets (allSets);
_BilledByTeam.getPersistentSets (allSets);
_AddedByUser.getPersistentSets (allSets);
......@@ -5451,6 +5575,7 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
_CouponExpiryDate = (Date)(HELPER_CouponExpiryDate.fromObject (_CouponExpiryDate, tl_hiring_teamPSet.getAttrib (FIELD_CouponExpiryDate))); //
_LastPlanAmount = (Double)(HELPER_LastPlanAmount.fromObject (_LastPlanAmount, tl_hiring_teamPSet.getAttrib (FIELD_LastPlanAmount))); //
_GoogleAddressText = (String)(HELPER_GoogleAddressText.fromObject (_GoogleAddressText, tl_hiring_teamPSet.getAttrib (FIELD_GoogleAddressText))); //
_PlanCancelled = (Boolean)(HELPER_PlanCancelled.fromObject (_PlanCancelled, tl_hiring_teamPSet.getAttrib (FIELD_PlanCancelled))); //
_Company.setFromPersistentSets (objectID, allSets);
_BilledByTeam.setFromPersistentSets (objectID, allSets);
_AddedByUser.setFromPersistentSets (objectID, allSets);
......@@ -5714,6 +5839,15 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
e.addException (ex);
}
try
{
setPlanCancelled (otherHiringTeam.getPlanCancelled ());
}
catch (FieldException ex)
{
e.addException (ex);
}
}
}
......@@ -5756,6 +5890,7 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
_CouponExpiryDate = sourceHiringTeam._CouponExpiryDate;
_LastPlanAmount = sourceHiringTeam._LastPlanAmount;
_GoogleAddressText = sourceHiringTeam._GoogleAddressText;
_PlanCancelled = sourceHiringTeam._PlanCancelled;
_IsLogoDeleted = sourceHiringTeam._IsLogoDeleted;
_CouponCode = sourceHiringTeam._CouponCode;
_StripeBrand = sourceHiringTeam._StripeBrand;
......@@ -5851,6 +5986,7 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
_CouponExpiryDate = (Date)(HELPER_CouponExpiryDate.readExternal (_CouponExpiryDate, vals.get(FIELD_CouponExpiryDate))); //
_LastPlanAmount = (Double)(HELPER_LastPlanAmount.readExternal (_LastPlanAmount, vals.get(FIELD_LastPlanAmount))); //
_GoogleAddressText = (String)(HELPER_GoogleAddressText.readExternal (_GoogleAddressText, vals.get(FIELD_GoogleAddressText))); //
_PlanCancelled = (Boolean)(HELPER_PlanCancelled.readExternal (_PlanCancelled, vals.get(FIELD_PlanCancelled))); //
_IsLogoDeleted = (Boolean)(HELPER_IsLogoDeleted.readExternal (_IsLogoDeleted, vals.get(FIELD_IsLogoDeleted))); //
_CouponCode = (String)(HELPER_CouponCode.readExternal (_CouponCode, vals.get(FIELD_CouponCode))); //
_StripeBrand = (String)(HELPER_StripeBrand.readExternal (_StripeBrand, vals.get(FIELD_StripeBrand))); //
......@@ -5901,6 +6037,7 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
vals.put (FIELD_CouponExpiryDate, HELPER_CouponExpiryDate.writeExternal (_CouponExpiryDate));
vals.put (FIELD_LastPlanAmount, HELPER_LastPlanAmount.writeExternal (_LastPlanAmount));
vals.put (FIELD_GoogleAddressText, HELPER_GoogleAddressText.writeExternal (_GoogleAddressText));
vals.put (FIELD_PlanCancelled, HELPER_PlanCancelled.writeExternal (_PlanCancelled));
vals.put (FIELD_IsLogoDeleted, HELPER_IsLogoDeleted.writeExternal (_IsLogoDeleted));
vals.put (FIELD_CouponCode, HELPER_CouponCode.writeExternal (_CouponCode));
vals.put (FIELD_StripeBrand, HELPER_StripeBrand.writeExternal (_StripeBrand));
......@@ -6034,6 +6171,10 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
{
listener.notifyFieldChange(this, other, FIELD_GoogleAddressText, HELPER_GoogleAddressText.toObject(this._GoogleAddressText), HELPER_GoogleAddressText.toObject(otherHiringTeam._GoogleAddressText));
}
if (!HELPER_PlanCancelled.compare(this._PlanCancelled, otherHiringTeam._PlanCancelled))
{
listener.notifyFieldChange(this, other, FIELD_PlanCancelled, HELPER_PlanCancelled.toObject(this._PlanCancelled), HELPER_PlanCancelled.toObject(otherHiringTeam._PlanCancelled));
}
// Compare single assocs
_Company.compare (otherHiringTeam._Company, listener);
......@@ -6095,6 +6236,7 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
visitor.visitField(this, FIELD_CouponExpiryDate, HELPER_CouponExpiryDate.toObject(getCouponExpiryDate()));
visitor.visitField(this, FIELD_LastPlanAmount, HELPER_LastPlanAmount.toObject(getLastPlanAmount()));
visitor.visitField(this, FIELD_GoogleAddressText, HELPER_GoogleAddressText.toObject(getGoogleAddressText()));
visitor.visitField(this, FIELD_PlanCancelled, HELPER_PlanCancelled.toObject(getPlanCancelled()));
visitor.visitAssociation (_Company);
visitor.visitAssociation (_BilledByTeam);
visitor.visitAssociation (_AddedByUser);
......@@ -6276,6 +6418,10 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
{
return filter.matches (getGoogleAddressText ());
}
else if (attribName.equals (FIELD_PlanCancelled))
{
return filter.matches (getPlanCancelled ());
}
else if (attribName.equals (SINGLEREFERENCE_Company))
{
return filter.matches (getCompany ());
......@@ -6489,6 +6635,12 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
return this;
}
public SearchAll andPlanCancelled (QueryFilter<Boolean> filter)
{
filter.addFilter (context, "tl_hiring_team.plan_cancelled", "PlanCancelled");
return this;
}
public SearchAll andCompany (QueryFilter<Company> filter)
{
filter.addFilter (context, "tl_hiring_team.company_id", "Company");
......@@ -6662,6 +6814,10 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
{
return HELPER_GoogleAddressText.toObject (getGoogleAddressText ());
}
else if (attribName.equals (FIELD_PlanCancelled))
{
return HELPER_PlanCancelled.toObject (getPlanCancelled ());
}
else if (attribName.equals (FIELD_IsLogoDeleted))
{
return HELPER_IsLogoDeleted.toObject (getIsLogoDeleted ());
......@@ -6799,6 +6955,10 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
{
return HELPER_GoogleAddressText;
}
else if (attribName.equals (FIELD_PlanCancelled))
{
return HELPER_PlanCancelled;
}
else if (attribName.equals (FIELD_IsLogoDeleted))
{
return HELPER_IsLogoDeleted;
......@@ -6936,6 +7096,10 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
{
setGoogleAddressText ((String)(HELPER_GoogleAddressText.fromObject (_GoogleAddressText, attribValue)));
}
else if (attribName.equals (FIELD_PlanCancelled))
{
setPlanCancelled ((Boolean)(HELPER_PlanCancelled.fromObject (_PlanCancelled, attribValue)));
}
else if (attribName.equals (FIELD_IsLogoDeleted))
{
setIsLogoDeleted ((Boolean)(HELPER_IsLogoDeleted.fromObject (_IsLogoDeleted, attribValue)));
......@@ -7080,6 +7244,10 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
{
return getWriteability_GoogleAddressText ();
}
else if (fieldName.equals (FIELD_PlanCancelled))
{
return getWriteability_PlanCancelled ();
}
else if (fieldName.equals (MULTIPLEREFERENCE_Users))
{
return getWriteability_Users ();
......@@ -7273,6 +7441,11 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
fields.add (FIELD_GoogleAddressText);
}
if (getWriteability_PlanCancelled () != FieldWriteability.TRUE)
{
fields.add (FIELD_PlanCancelled);
}
if (getWriteability_IsLogoDeleted () != FieldWriteability.TRUE)
{
fields.add (FIELD_IsLogoDeleted);
......@@ -7329,6 +7502,7 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
result.add(HELPER_CouponExpiryDate.getAttribObject (getClass (), _CouponExpiryDate, false, FIELD_CouponExpiryDate));
result.add(HELPER_LastPlanAmount.getAttribObject (getClass (), _LastPlanAmount, false, FIELD_LastPlanAmount));
result.add(HELPER_GoogleAddressText.getAttribObject (getClass (), _GoogleAddressText, false, FIELD_GoogleAddressText));
result.add(HELPER_PlanCancelled.getAttribObject (getClass (), _PlanCancelled, false, FIELD_PlanCancelled));
result.add(HELPER_IsLogoDeleted.getAttribObject (getClass (), _IsLogoDeleted, false, FIELD_IsLogoDeleted));
result.add(HELPER_CouponCode.getAttribObject (getClass (), _CouponCode, false, FIELD_CouponCode));
result.add(HELPER_StripeBrand.getAttribObject (getClass (), _StripeBrand, false, FIELD_StripeBrand));
......@@ -7888,6 +8062,24 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
}
/**
* Get the attribute PlanCancelled
*/
public Boolean getPlanCancelled (HiringTeam obj, Boolean original)
{
return original;
}
/**
* Change the value set for attribute PlanCancelled.
* May modify the field beforehand
* Occurs before validation.
*/
public Boolean setPlanCancelled (HiringTeam obj, Boolean newPlanCancelled) throws FieldException
{
return newPlanCancelled;
}
/**
* Get the attribute IsLogoDeleted
*/
public Boolean getIsLogoDeleted (HiringTeam obj, Boolean original)
......@@ -8147,6 +8339,10 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
{
return toGoogleAddressText ();
}
if (name.equals ("PlanCancelled"))
{
return toPlanCancelled ();
}
if (name.equals ("Company"))
{
return toCompany ();
......@@ -8234,6 +8430,8 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
public PipeLine<From, Double> toLastPlanAmount () { return pipe(new ORMAttributePipe<Me, Double>(FIELD_LastPlanAmount)); }
public PipeLine<From, String> toGoogleAddressText () { return pipe(new ORMAttributePipe<Me, String>(FIELD_GoogleAddressText)); }
public PipeLine<From, Boolean> toPlanCancelled () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_PlanCancelled)); }
public Company.CompanyPipeLineFactory<From, Company> toCompany () { return toCompany (Filter.ALL); }
public Company.CompanyPipeLineFactory<From, Company> toCompany (Filter<Company> filter)
......
......@@ -261,4 +261,9 @@ public class HiringTeam extends BaseHiringTeam
return addUser;
}
public boolean isPlanActive(PaymentPlan paymentPlan)
{
return CollectionUtils.equals(getPaymentPlan(), paymentPlan);
}
}
\ No newline at end of file
......@@ -45,6 +45,7 @@
<ATTRIB name="CouponExpiryDate" type="Date" dbcol="coupon_expiry_date" />
<ATTRIB name="LastPlanAmount" type="Double" dbcol="last_plan_amount" />
<ATTRIB name="GoogleAddressText" type="String" dbcol="google_address_text" length="300" />
<ATTRIB name="PlanCancelled" type="Boolean" dbcol="plan_cancelled" defaultValue="Boolean.FALSE"/>
<SINGLEREFERENCE name="Company" type="Company" dbcol="company_id" mandatory="true" backreferenceName="HiringTeams" />
<SINGLEREFERENCE name="BilledByTeam" type="HiringTeam" dbcol="billing_team_id" mandatory="false" backreferenceName="BillingTeams" />
......
......@@ -55,6 +55,7 @@ public class HiringTeamPersistenceMgr extends ObjectPersistenceMgr
private Date dummyCouponExpiryDate;
private Double dummyLastPlanAmount;
private String dummyGoogleAddressText;
private Boolean dummyPlanCancelled;
// Static constants corresponding to attribute helpers
......@@ -85,6 +86,7 @@ public class HiringTeamPersistenceMgr extends ObjectPersistenceMgr
private static final DefaultAttributeHelper HELPER_CouponExpiryDate = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_LastPlanAmount = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_GoogleAddressText = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_PlanCancelled = DefaultAttributeHelper.INSTANCE;
......@@ -118,10 +120,11 @@ public class HiringTeamPersistenceMgr extends ObjectPersistenceMgr
dummyCouponExpiryDate = (Date)(HELPER_CouponExpiryDate.initialise (dummyCouponExpiryDate));
dummyLastPlanAmount = (Double)(HELPER_LastPlanAmount.initialise (dummyLastPlanAmount));
dummyGoogleAddressText = (String)(HELPER_GoogleAddressText.initialise (dummyGoogleAddressText));
dummyPlanCancelled = (Boolean)(HELPER_PlanCancelled.initialise (dummyPlanCancelled));
}
private String SELECT_COLUMNS = "{PREFIX}tl_hiring_team.object_id as id, {PREFIX}tl_hiring_team.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_hiring_team.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_hiring_team.hiring_team_name, {PREFIX}tl_hiring_team.hiring_team_logo, {PREFIX}tl_hiring_team.hiring_team_type, {PREFIX}tl_hiring_team.industry, {PREFIX}tl_hiring_team.time_zone, {PREFIX}tl_hiring_team.state, {PREFIX}tl_hiring_team.country, {PREFIX}tl_hiring_team.post_code, {PREFIX}tl_hiring_team.city, {PREFIX}tl_hiring_team.has_client_support, {PREFIX}tl_hiring_team.manage_own_billing, {PREFIX}tl_hiring_team.stripe_reference, {PREFIX}tl_hiring_team.stripe_subscription, {PREFIX}tl_hiring_team.stripe_fixed_sub_item, {PREFIX}tl_hiring_team.stripe_metered_sub_item, {PREFIX}tl_hiring_team.name_on_card, {PREFIX}tl_hiring_team.card_post_code, {PREFIX}tl_hiring_team.card_id, {PREFIX}tl_hiring_team.plan_renewed_on, {PREFIX}tl_hiring_team.used_credits, {PREFIX}tl_hiring_team.available_credits, {PREFIX}tl_hiring_team.is_ppj, {PREFIX}tl_hiring_team.has_cap, {PREFIX}tl_hiring_team.max_cap, {PREFIX}tl_hiring_team.coupon_expiry_date, {PREFIX}tl_hiring_team.last_plan_amount, {PREFIX}tl_hiring_team.google_address_text, {PREFIX}tl_hiring_team.company_id, {PREFIX}tl_hiring_team.billing_team_id, {PREFIX}tl_hiring_team.added_by_user_id, {PREFIX}tl_hiring_team.payment_plan_id, {PREFIX}tl_hiring_team.coupon_id, 1 AS commasafe ";
private String SELECT_COLUMNS = "{PREFIX}tl_hiring_team.object_id as id, {PREFIX}tl_hiring_team.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_hiring_team.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_hiring_team.hiring_team_name, {PREFIX}tl_hiring_team.hiring_team_logo, {PREFIX}tl_hiring_team.hiring_team_type, {PREFIX}tl_hiring_team.industry, {PREFIX}tl_hiring_team.time_zone, {PREFIX}tl_hiring_team.state, {PREFIX}tl_hiring_team.country, {PREFIX}tl_hiring_team.post_code, {PREFIX}tl_hiring_team.city, {PREFIX}tl_hiring_team.has_client_support, {PREFIX}tl_hiring_team.manage_own_billing, {PREFIX}tl_hiring_team.stripe_reference, {PREFIX}tl_hiring_team.stripe_subscription, {PREFIX}tl_hiring_team.stripe_fixed_sub_item, {PREFIX}tl_hiring_team.stripe_metered_sub_item, {PREFIX}tl_hiring_team.name_on_card, {PREFIX}tl_hiring_team.card_post_code, {PREFIX}tl_hiring_team.card_id, {PREFIX}tl_hiring_team.plan_renewed_on, {PREFIX}tl_hiring_team.used_credits, {PREFIX}tl_hiring_team.available_credits, {PREFIX}tl_hiring_team.is_ppj, {PREFIX}tl_hiring_team.has_cap, {PREFIX}tl_hiring_team.max_cap, {PREFIX}tl_hiring_team.coupon_expiry_date, {PREFIX}tl_hiring_team.last_plan_amount, {PREFIX}tl_hiring_team.google_address_text, {PREFIX}tl_hiring_team.plan_cancelled, {PREFIX}tl_hiring_team.company_id, {PREFIX}tl_hiring_team.billing_team_id, {PREFIX}tl_hiring_team.added_by_user_id, {PREFIX}tl_hiring_team.payment_plan_id, {PREFIX}tl_hiring_team.coupon_id, 1 AS commasafe ";
private String SELECT_JOINS = "";
public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
......@@ -199,6 +202,7 @@ public class HiringTeamPersistenceMgr extends ObjectPersistenceMgr
!tl_hiring_teamPSet.containsAttrib(HiringTeam.FIELD_CouponExpiryDate)||
!tl_hiring_teamPSet.containsAttrib(HiringTeam.FIELD_LastPlanAmount)||
!tl_hiring_teamPSet.containsAttrib(HiringTeam.FIELD_GoogleAddressText)||
!tl_hiring_teamPSet.containsAttrib(HiringTeam.FIELD_PlanCancelled)||
!tl_hiring_teamPSet.containsAttrib(HiringTeam.SINGLEREFERENCE_Company)||
!tl_hiring_teamPSet.containsAttrib(HiringTeam.SINGLEREFERENCE_BilledByTeam)||
!tl_hiring_teamPSet.containsAttrib(HiringTeam.SINGLEREFERENCE_AddedByUser)||
......@@ -293,10 +297,10 @@ public class HiringTeamPersistenceMgr extends ObjectPersistenceMgr
{
int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}tl_hiring_team " +
"SET hiring_team_name = ?, hiring_team_logo = ?, hiring_team_type = ?, industry = ?, time_zone = ?, state = ?, country = ?, post_code = ?, city = ?, has_client_support = ?, manage_own_billing = ?, stripe_reference = ?, stripe_subscription = ?, stripe_fixed_sub_item = ?, stripe_metered_sub_item = ?, name_on_card = ?, card_post_code = ?, card_id = ?, plan_renewed_on = ?, used_credits = ?, available_credits = ?, is_ppj = ?, has_cap = ?, max_cap = ?, coupon_expiry_date = ?, last_plan_amount = ?, google_address_text = ?, company_id = ? , billing_team_id = ? , added_by_user_id = ? , payment_plan_id = ? , coupon_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"SET hiring_team_name = ?, hiring_team_logo = ?, hiring_team_type = ?, industry = ?, time_zone = ?, state = ?, country = ?, post_code = ?, city = ?, has_client_support = ?, manage_own_billing = ?, stripe_reference = ?, stripe_subscription = ?, stripe_fixed_sub_item = ?, stripe_metered_sub_item = ?, name_on_card = ?, card_post_code = ?, card_id = ?, plan_renewed_on = ?, used_credits = ?, available_credits = ?, is_ppj = ?, has_cap = ?, max_cap = ?, coupon_expiry_date = ?, last_plan_amount = ?, google_address_text = ?, plan_cancelled = ?, company_id = ? , billing_team_id = ? , added_by_user_id = ? , payment_plan_id = ? , coupon_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE tl_hiring_team.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_HiringTeamName.getForSQL(dummyHiringTeamName, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HiringTeamName))).listEntry (HELPER_HiringTeamLogo.getForSQL(dummyHiringTeamLogo, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HiringTeamLogo))).listEntry (HELPER_HiringTeamType.getForSQL(dummyHiringTeamType, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HiringTeamType))).listEntry (HELPER_Industry.getForSQL(dummyIndustry, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_Industry))).listEntry (HELPER_TimeZone.getForSQL(dummyTimeZone, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_TimeZone))).listEntry (HELPER_State.getForSQL(dummyState, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_State))).listEntry (HELPER_Country.getForSQL(dummyCountry, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_Country))).listEntry (HELPER_PostCode.getForSQL(dummyPostCode, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_PostCode))).listEntry (HELPER_City.getForSQL(dummyCity, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_City))).listEntry (HELPER_HasClientSupport.getForSQL(dummyHasClientSupport, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HasClientSupport))).listEntry (HELPER_ManageOwnBilling.getForSQL(dummyManageOwnBilling, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_ManageOwnBilling))).listEntry (HELPER_StripeReference.getForSQL(dummyStripeReference, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_StripeReference))).listEntry (HELPER_StripeSubscription.getForSQL(dummyStripeSubscription, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_StripeSubscription))).listEntry (HELPER_StripeFixedSubItem.getForSQL(dummyStripeFixedSubItem, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_StripeFixedSubItem))).listEntry (HELPER_StripeMeteredSubItem.getForSQL(dummyStripeMeteredSubItem, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_StripeMeteredSubItem))).listEntry (HELPER_NameOnCard.getForSQL(dummyNameOnCard, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_NameOnCard))).listEntry (HELPER_CardPostCode.getForSQL(dummyCardPostCode, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_CardPostCode))).listEntry (HELPER_CardID.getForSQL(dummyCardID, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_CardID))).listEntry (HELPER_PlanRenewedOn.getForSQL(dummyPlanRenewedOn, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_PlanRenewedOn))).listEntry (HELPER_UsedCredits.getForSQL(dummyUsedCredits, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_UsedCredits))).listEntry (HELPER_AvailableCredits.getForSQL(dummyAvailableCredits, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_AvailableCredits))).listEntry (HELPER_IsPPJ.getForSQL(dummyIsPPJ, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_IsPPJ))).listEntry (HELPER_HasCap.getForSQL(dummyHasCap, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HasCap))).listEntry (HELPER_MaxCap.getForSQL(dummyMaxCap, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_MaxCap))).listEntry (HELPER_CouponExpiryDate.getForSQL(dummyCouponExpiryDate, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_CouponExpiryDate))).listEntry (HELPER_LastPlanAmount.getForSQL(dummyLastPlanAmount, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_LastPlanAmount))).listEntry (HELPER_GoogleAddressText.getForSQL(dummyGoogleAddressText, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_GoogleAddressText))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_Company)))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_BilledByTeam)))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_AddedByUser)))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_PaymentPlan)))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_Coupon)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
CollectionUtils.listEntry (HELPER_HiringTeamName.getForSQL(dummyHiringTeamName, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HiringTeamName))).listEntry (HELPER_HiringTeamLogo.getForSQL(dummyHiringTeamLogo, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HiringTeamLogo))).listEntry (HELPER_HiringTeamType.getForSQL(dummyHiringTeamType, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HiringTeamType))).listEntry (HELPER_Industry.getForSQL(dummyIndustry, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_Industry))).listEntry (HELPER_TimeZone.getForSQL(dummyTimeZone, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_TimeZone))).listEntry (HELPER_State.getForSQL(dummyState, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_State))).listEntry (HELPER_Country.getForSQL(dummyCountry, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_Country))).listEntry (HELPER_PostCode.getForSQL(dummyPostCode, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_PostCode))).listEntry (HELPER_City.getForSQL(dummyCity, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_City))).listEntry (HELPER_HasClientSupport.getForSQL(dummyHasClientSupport, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HasClientSupport))).listEntry (HELPER_ManageOwnBilling.getForSQL(dummyManageOwnBilling, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_ManageOwnBilling))).listEntry (HELPER_StripeReference.getForSQL(dummyStripeReference, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_StripeReference))).listEntry (HELPER_StripeSubscription.getForSQL(dummyStripeSubscription, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_StripeSubscription))).listEntry (HELPER_StripeFixedSubItem.getForSQL(dummyStripeFixedSubItem, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_StripeFixedSubItem))).listEntry (HELPER_StripeMeteredSubItem.getForSQL(dummyStripeMeteredSubItem, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_StripeMeteredSubItem))).listEntry (HELPER_NameOnCard.getForSQL(dummyNameOnCard, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_NameOnCard))).listEntry (HELPER_CardPostCode.getForSQL(dummyCardPostCode, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_CardPostCode))).listEntry (HELPER_CardID.getForSQL(dummyCardID, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_CardID))).listEntry (HELPER_PlanRenewedOn.getForSQL(dummyPlanRenewedOn, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_PlanRenewedOn))).listEntry (HELPER_UsedCredits.getForSQL(dummyUsedCredits, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_UsedCredits))).listEntry (HELPER_AvailableCredits.getForSQL(dummyAvailableCredits, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_AvailableCredits))).listEntry (HELPER_IsPPJ.getForSQL(dummyIsPPJ, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_IsPPJ))).listEntry (HELPER_HasCap.getForSQL(dummyHasCap, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HasCap))).listEntry (HELPER_MaxCap.getForSQL(dummyMaxCap, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_MaxCap))).listEntry (HELPER_CouponExpiryDate.getForSQL(dummyCouponExpiryDate, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_CouponExpiryDate))).listEntry (HELPER_LastPlanAmount.getForSQL(dummyLastPlanAmount, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_LastPlanAmount))).listEntry (HELPER_GoogleAddressText.getForSQL(dummyGoogleAddressText, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_GoogleAddressText))).listEntry (HELPER_PlanCancelled.getForSQL(dummyPlanCancelled, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_PlanCancelled))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_Company)))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_BilledByTeam)))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_AddedByUser)))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_PaymentPlan)))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_Coupon)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
if (rowsUpdated != 1)
{
......@@ -579,6 +583,7 @@ public class HiringTeamPersistenceMgr extends ObjectPersistenceMgr
tl_hiring_teamPSet.setAttrib(HiringTeam.FIELD_CouponExpiryDate, HELPER_CouponExpiryDate.getFromRS(dummyCouponExpiryDate, r, "coupon_expiry_date"));
tl_hiring_teamPSet.setAttrib(HiringTeam.FIELD_LastPlanAmount, HELPER_LastPlanAmount.getFromRS(dummyLastPlanAmount, r, "last_plan_amount"));
tl_hiring_teamPSet.setAttrib(HiringTeam.FIELD_GoogleAddressText, HELPER_GoogleAddressText.getFromRS(dummyGoogleAddressText, r, "google_address_text"));
tl_hiring_teamPSet.setAttrib(HiringTeam.FIELD_PlanCancelled, HELPER_PlanCancelled.getFromRS(dummyPlanCancelled, r, "plan_cancelled"));
tl_hiring_teamPSet.setAttrib(HiringTeam.SINGLEREFERENCE_Company, r.getObject ("company_id"));
tl_hiring_teamPSet.setAttrib(HiringTeam.SINGLEREFERENCE_BilledByTeam, r.getObject ("billing_team_id"));
......@@ -601,10 +606,10 @@ public class HiringTeamPersistenceMgr extends ObjectPersistenceMgr
{
executeStatement (sqlMgr,
"INSERT INTO {PREFIX}tl_hiring_team " +
" (hiring_team_name, hiring_team_logo, hiring_team_type, industry, time_zone, state, country, post_code, city, has_client_support, manage_own_billing, stripe_reference, stripe_subscription, stripe_fixed_sub_item, stripe_metered_sub_item, name_on_card, card_post_code, card_id, plan_renewed_on, used_credits, available_credits, is_ppj, has_cap, max_cap, coupon_expiry_date, last_plan_amount, google_address_text, company_id, billing_team_id, added_by_user_id, payment_plan_id, coupon_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
" (hiring_team_name, hiring_team_logo, hiring_team_type, industry, time_zone, state, country, post_code, city, has_client_support, manage_own_billing, stripe_reference, stripe_subscription, stripe_fixed_sub_item, stripe_metered_sub_item, name_on_card, card_post_code, card_id, plan_renewed_on, used_credits, available_credits, is_ppj, has_cap, max_cap, coupon_expiry_date, last_plan_amount, google_address_text, plan_cancelled, company_id, billing_team_id, added_by_user_id, payment_plan_id, coupon_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
"VALUES " +
" (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_HiringTeamName.getForSQL(dummyHiringTeamName, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HiringTeamName))).listEntry (HELPER_HiringTeamLogo.getForSQL(dummyHiringTeamLogo, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HiringTeamLogo))).listEntry (HELPER_HiringTeamType.getForSQL(dummyHiringTeamType, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HiringTeamType))).listEntry (HELPER_Industry.getForSQL(dummyIndustry, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_Industry))).listEntry (HELPER_TimeZone.getForSQL(dummyTimeZone, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_TimeZone))).listEntry (HELPER_State.getForSQL(dummyState, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_State))).listEntry (HELPER_Country.getForSQL(dummyCountry, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_Country))).listEntry (HELPER_PostCode.getForSQL(dummyPostCode, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_PostCode))).listEntry (HELPER_City.getForSQL(dummyCity, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_City))).listEntry (HELPER_HasClientSupport.getForSQL(dummyHasClientSupport, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HasClientSupport))).listEntry (HELPER_ManageOwnBilling.getForSQL(dummyManageOwnBilling, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_ManageOwnBilling))).listEntry (HELPER_StripeReference.getForSQL(dummyStripeReference, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_StripeReference))).listEntry (HELPER_StripeSubscription.getForSQL(dummyStripeSubscription, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_StripeSubscription))).listEntry (HELPER_StripeFixedSubItem.getForSQL(dummyStripeFixedSubItem, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_StripeFixedSubItem))).listEntry (HELPER_StripeMeteredSubItem.getForSQL(dummyStripeMeteredSubItem, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_StripeMeteredSubItem))).listEntry (HELPER_NameOnCard.getForSQL(dummyNameOnCard, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_NameOnCard))).listEntry (HELPER_CardPostCode.getForSQL(dummyCardPostCode, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_CardPostCode))).listEntry (HELPER_CardID.getForSQL(dummyCardID, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_CardID))).listEntry (HELPER_PlanRenewedOn.getForSQL(dummyPlanRenewedOn, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_PlanRenewedOn))).listEntry (HELPER_UsedCredits.getForSQL(dummyUsedCredits, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_UsedCredits))).listEntry (HELPER_AvailableCredits.getForSQL(dummyAvailableCredits, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_AvailableCredits))).listEntry (HELPER_IsPPJ.getForSQL(dummyIsPPJ, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_IsPPJ))).listEntry (HELPER_HasCap.getForSQL(dummyHasCap, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HasCap))).listEntry (HELPER_MaxCap.getForSQL(dummyMaxCap, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_MaxCap))).listEntry (HELPER_CouponExpiryDate.getForSQL(dummyCouponExpiryDate, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_CouponExpiryDate))).listEntry (HELPER_LastPlanAmount.getForSQL(dummyLastPlanAmount, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_LastPlanAmount))).listEntry (HELPER_GoogleAddressText.getForSQL(dummyGoogleAddressText, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_GoogleAddressText))) .listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_Company)))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_BilledByTeam)))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_AddedByUser)))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_PaymentPlan)))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_Coupon)))) .listEntry (objectID.longID ()).toList().toArray());
" (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_HiringTeamName.getForSQL(dummyHiringTeamName, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HiringTeamName))).listEntry (HELPER_HiringTeamLogo.getForSQL(dummyHiringTeamLogo, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HiringTeamLogo))).listEntry (HELPER_HiringTeamType.getForSQL(dummyHiringTeamType, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HiringTeamType))).listEntry (HELPER_Industry.getForSQL(dummyIndustry, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_Industry))).listEntry (HELPER_TimeZone.getForSQL(dummyTimeZone, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_TimeZone))).listEntry (HELPER_State.getForSQL(dummyState, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_State))).listEntry (HELPER_Country.getForSQL(dummyCountry, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_Country))).listEntry (HELPER_PostCode.getForSQL(dummyPostCode, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_PostCode))).listEntry (HELPER_City.getForSQL(dummyCity, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_City))).listEntry (HELPER_HasClientSupport.getForSQL(dummyHasClientSupport, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HasClientSupport))).listEntry (HELPER_ManageOwnBilling.getForSQL(dummyManageOwnBilling, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_ManageOwnBilling))).listEntry (HELPER_StripeReference.getForSQL(dummyStripeReference, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_StripeReference))).listEntry (HELPER_StripeSubscription.getForSQL(dummyStripeSubscription, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_StripeSubscription))).listEntry (HELPER_StripeFixedSubItem.getForSQL(dummyStripeFixedSubItem, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_StripeFixedSubItem))).listEntry (HELPER_StripeMeteredSubItem.getForSQL(dummyStripeMeteredSubItem, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_StripeMeteredSubItem))).listEntry (HELPER_NameOnCard.getForSQL(dummyNameOnCard, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_NameOnCard))).listEntry (HELPER_CardPostCode.getForSQL(dummyCardPostCode, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_CardPostCode))).listEntry (HELPER_CardID.getForSQL(dummyCardID, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_CardID))).listEntry (HELPER_PlanRenewedOn.getForSQL(dummyPlanRenewedOn, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_PlanRenewedOn))).listEntry (HELPER_UsedCredits.getForSQL(dummyUsedCredits, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_UsedCredits))).listEntry (HELPER_AvailableCredits.getForSQL(dummyAvailableCredits, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_AvailableCredits))).listEntry (HELPER_IsPPJ.getForSQL(dummyIsPPJ, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_IsPPJ))).listEntry (HELPER_HasCap.getForSQL(dummyHasCap, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HasCap))).listEntry (HELPER_MaxCap.getForSQL(dummyMaxCap, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_MaxCap))).listEntry (HELPER_CouponExpiryDate.getForSQL(dummyCouponExpiryDate, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_CouponExpiryDate))).listEntry (HELPER_LastPlanAmount.getForSQL(dummyLastPlanAmount, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_LastPlanAmount))).listEntry (HELPER_GoogleAddressText.getForSQL(dummyGoogleAddressText, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_GoogleAddressText))).listEntry (HELPER_PlanCancelled.getForSQL(dummyPlanCancelled, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_PlanCancelled))) .listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_Company)))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_BilledByTeam)))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_AddedByUser)))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_PaymentPlan)))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_Coupon)))) .listEntry (objectID.longID ()).toList().toArray());
tl_hiring_teamPSet.setStatus (PersistentSetStatus.PROCESSED);
}
......
......@@ -6592,14 +6592,15 @@ span.tab-number {
margin: 0
}
.setmax button {
.setmax a {
height: 50px;
width: 100px;
border-radius: 0 2px 2px 0;
background-color: #4E5258;
color: #FFFFFF;
font-size: 11px;
margin: 0
margin: 0;
padding-top: 15px;
}
#change-plan .jBox-content {padding: 0;}
......@@ -7630,3 +7631,7 @@ input{
font-weight: 500;
color: #ffffff !important;
}
.container-fluid.repeat{
margin-top: 50px;
}
\ No newline at end of file
......@@ -54,6 +54,7 @@
<FORM name="*.saveClient" factory="Participant" class="performa.form.SaveClientFP"/>
<FORM name="*.applyCoupon" factory="Participant" class="performa.form.ApplyCouponFP"/>
<FORM name="*.saveCompany" factory="Participant" class="performa.form.SaveCompanyFP"/>
<FORM name="*.savePlan" factory="Participant" class="performa.form.SavePaymentPlanFP"/>
<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"/>
......
......@@ -322,7 +322,7 @@
</div>
</div>
<div class="form-group row">
<div class="col-md-4">
<div class="col-md-6">
<div class="styled_checkboxes">
<div class="checkbox checkbox-primary">
<oneit:ormInput obj="<%= template %>" id="is-remote" attributeName="Remote" type="checkbox"/>
......@@ -579,7 +579,7 @@
</div>
</div>
<div class="container-fluid">
<div class="container-fluid repeat">
<div class="main-tab-template">
<span class="tab-number">2</span>
<span class="job-details">Requirements</span>
......
......@@ -43,6 +43,7 @@
<script>
dataLayer = [{
'userId': '<%= clientUser != null ? clientUser.getUserName() : "" %>',
'stripeId': '<%= selectedTeam != null ? selectedTeam.getStripeReference() : "" %>',
}];
</script>
<script>
......
......@@ -338,7 +338,7 @@
</div>
</div>
<div class="form-group row">
<div class="col-md-4">
<div class="col-md-6">
<div class="styled_checkboxes">
<div class="checkbox checkbox-primary">
<oneit:ormInput obj="<%= job %>" id="is-remote" attributeName="Remote" type="checkbox"/>
......
......@@ -7,7 +7,7 @@
<oneit:dynIncluded>
<%
String hiringTeamList = WebUtils.getSamePageInRenderMode(request, "Page");
String nextPage = WebUtils.getSamePageInRenderMode(request, "ManagePlan");
String homePage = WebUtils.getArticleByShortCut(process.getTransaction(), WebUtils.ADMIN_HOME).getLink(request);
SecUser loggedInUser = SecUser.getTXUser(transaction);
CompanyUser companyUser = loggedInUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
Company company = companyUser.getCompany();
......@@ -38,7 +38,15 @@
}
String currencyFormat = Utils.getCurrencyFormat(hiringTeam);
boolean firstTime = hiringTeam.getIsPPJ() == null || (!hiringTeam.getIsPPJ() && hiringTeam.getPaymentPlan() == null);
String nextPage = firstTime ? homePage : WebUtils.getSamePageInRenderMode(request, "ManagePlan");
%>
<style>
.select-button input[type=radio] {
position: absolute;
visibility: hidden;
}
</style>
<script type="text/javascript">
var Popup = null;
var PopupCoupon = null;
......@@ -137,10 +145,21 @@
}
}
function paymentPlanChanged()
{
function savePaymentPlan(){
$("#savePaymentPlan").click();
}
function saveCap(){
$("#saveCap").click();
}
function changePPJ(){
$("#savePPJ").click();
}
function changeSubscribe(){
$("#saveSubscribe").click();
}
</script>
<div class="overlayx"></div>
<div class="container-fluid">
......@@ -216,9 +235,16 @@
<div class="manage-plan-row">
<div class="radio">
<label class="plan-selection">
<oneit:ormInput obj="<%= hiringTeam %>" type="radio" attributeName="IsPPJ" value="true" onchange="paymentPlanChanged()"/>
<oneit:ormInput obj="<%= hiringTeam %>" type="radio" attributeName="IsPPJ" value="true" onchange="<%= firstTime ? "return false;" : "changePPJ()" %>"/>
</label>
</div>
<oneit:button value=" " name="savePlan" cssClass="hide" id="savePPJ"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry ("restartProcess", Boolean.TRUE)
.mapEntry ("savePPJ", Boolean.TRUE)
.mapEntry(NotificationUtils.DISPLAY_NOTIFICATION_PARAM, false)
.mapEntry ("attribNamesToRestore", Collections.singleton("HiringTeam"))
.toMap() %>" />
<div class="manage-plan-title">
<h3>Pay Per Job</h3>
<span>
......@@ -254,6 +280,13 @@
<oneit:ormInput obj="<%= hiringTeam %>" type="radio" attributeName="IsPPJ" value="false"/>
</label>
</div>
<oneit:button value=" " name="savePlan" cssClass="hide" id="saveSubscribe"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry ("restartProcess", Boolean.TRUE)
.mapEntry ("savePPJ", Boolean.TRUE)
.mapEntry(NotificationUtils.DISPLAY_NOTIFICATION_PARAM, false)
.mapEntry ("attribNamesToRestore", Collections.singleton("HiringTeam"))
.toMap() %>" />
<div class="manage-plan-title">
<h3>Subscribe & Save</h3>
<span>
......@@ -297,7 +330,8 @@
{
boolean isSelectedPlan = CollectionUtils.equals(paymentPlan, currentPlan);
%>
<div class="choose-plan-item <%= isSelectedPlan ? "active" : ""%>">
<oneit:recalcClass htmlTag="div" classScript="hiringTeam.isPlanActive(paymentPlan) ? 'choose-plan-item active' : 'choose-plan-item' " hiringTeam="<%= hiringTeam %>" paymentPlan="<%= paymentPlan %>">
<div class="jobs">
<%= paymentPlan.getActiveJobCount() %> Jobs
</div>
......@@ -328,7 +362,7 @@
%>
</div>
<div class="select-button">
<oneit:button skin="link" value=" " name="saveCompany" cssClass="btn select-btn" style="display:none;"
<oneit:button skin="link" value=" " name="savePlan" cssClass="btn select-btn" style="display:none;"
requestAttribs="<%= CollectionUtils.EMPTY_MAP%>" />
<%
if(isSelectedPlan)
......@@ -400,10 +434,10 @@
</div>
<div class="change-plan-button">
<a class="change-plan-no-button popup-no-button">No</a>
<oneit:button skin="link" value="Yes" name="saveCompany" cssClass="change-plan-yes-button"
<oneit:button skin="link" value="Yes" name="savePlan" cssClass="change-plan-yes-button"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry ("restartProcess", Boolean.TRUE)
.mapEntry ("IsPayment", Boolean.TRUE)
.mapEntry ("savePlan", Boolean.TRUE)
.mapEntry ("PaymentPlan", paymentPlan)
.mapEntry ("procParams", CollectionUtils.mapEntry("HiringTeam", hiringTeam).toMap())
.mapEntry ("attribNamesToRestore", Collections.singleton("HiringTeam"))
......@@ -415,20 +449,21 @@
}
else
{
String planKey = WebUtils.getRadioSingleAssocKey(request, hiringTeam, HiringTeam.SINGLEREFERENCE_PaymentPlan);
String planId = String.valueOf(paymentPlan.getID().longID());
%>
<oneit:button skin="link" value="Select" name="saveCompany" cssClass="btn select-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry ("restartProcess", Boolean.TRUE)
.mapEntry ("IsPayment", Boolean.TRUE)
.mapEntry ("PaymentPlan", paymentPlan)
.mapEntry ("procParams", CollectionUtils.mapEntry("HiringTeam", hiringTeam).toMap())
.mapEntry ("attribNamesToRestore", Collections.singleton("HiringTeam"))
.toMap() %>" />
<input type="radio" name="<%= planKey %>" id="<%= planId %>" class="level_radio" value="<%= planId %>"/>
<label for="<%= planId %>">
<oneit:recalcClass htmlTag="a" classScript="hiringTeam.isPlanActive(paymentPlan) ? 'btn active-btn' : 'btn select-btn' " hiringTeam="<%= hiringTeam %>" paymentPlan="<%= paymentPlan %>">
<oneit:recalc mode="EscapeHTML" script="hiringTeam.isPlanActive(paymentPlan) ? 'Active' : 'Select' " hiringTeam="<%= hiringTeam %>" paymentPlan="<%= paymentPlan %>" nullValue=""/>
</oneit:recalcClass>
</label>
<%
}
%>
</div>
</div>
</oneit:recalcClass>
<%
}
%>
......@@ -445,7 +480,7 @@
<span> No, leave it open</span>
<label class="switch">
<oneit:recalcClass htmlTag="span" classScript="hiringTeam.isTrue(hiringTeam.getHasCap()) ? 'checkbox checked': 'checkbox unchecked'" hiringTeam="<%= hiringTeam %>">
<oneit:ormInput obj="<%= hiringTeam %>" attributeName="HasCap" type="checkbox" onChange="paymentPlanChanged()"/>
<oneit:ormInput obj="<%= hiringTeam %>" attributeName="HasCap" type="checkbox" onChange="<%= firstTime ? "return false;" : "savePaymentPlan()" %>"/>
</oneit:recalcClass>
<div class="slider round"></div>
</label>
......@@ -455,10 +490,11 @@
<div class="setmax">
<oneit:recalcClass htmlTag="div" classScript="hiringTeam.isTrue(hiringTeam.getHasCap()) ? 'show': 'hide'" hiringTeam="<%= hiringTeam %>">
<oneit:ormInput obj="<%= hiringTeam %>" type="text" attributeName="MaxCap" cssClass="form-control" />
<oneit:button value="Set Max" name="saveCompany" cssClass="btn btn-primary"
<a class="btn btn-primary" onClick="<%= firstTime ? "return false;" : "saveCap()" %>">Set Max</a>
<oneit:button value="Set Max" name="savePlan" cssClass="btn btn-primary hide" id="saveCap"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry ("restartProcess", Boolean.TRUE)
.mapEntry ("saveCap", Boolean.TRUE)
.mapEntry ("attribNamesToRestore", Collections.singleton("HiringTeam"))
.toMap() %>" />
</oneit:recalcClass>
......@@ -469,13 +505,16 @@
</div>
</div>
<div class="form-group row">
<oneit:button value=" " name="saveCompany" cssClass="btn btn-primary largeBtn btn-green save-btn" style="display:none;" id="savePaymentPlan"
<div class="text-center form-group">
<oneit:button value="Save Plan" name="savePlan" cssClass="<%= "btn btn-primary largeBtn save-btn " + ( firstTime ? "" : "hide")%>" id="savePaymentPlan"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry ("restartProcess", Boolean.TRUE)
.mapEntry ("firstTime", firstTime)
.mapEntry(NotificationUtils.DISPLAY_NOTIFICATION_PARAM, false)
.mapEntry ("attribNamesToRestore", Collections.singleton("HiringTeam"))
.toMap() %>" />
</div>
</div>
<div class="text-center footer-note">
Looking to cancel your account? Please <a href=" https://www.talentology.com/support/" target="_blank">contact us.</a>
</div>
......
......@@ -322,7 +322,7 @@
requestAttribs='<%= CollectionUtils.mapEntry ("nextPage", nextPage)
.mapEntry("cancelProcess", true)
.toMap() %>'/>
<oneit:button value="Save Updates" name="saveCompany" cssClass="btn btn-primary largeBtn" disabled="<%= readOnly ? "true" : "false" %>"
<oneit:button value="Save Team" name="saveCompany" cssClass="btn btn-primary largeBtn" disabled="<%= readOnly ? "true" : "false" %>"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry("procParams", CollectionUtils.mapEntry("HiringTeam", hiringTeam).toMap())
.mapEntry("Company", company)
......
......@@ -86,7 +86,7 @@
right: 0;
bottom: 0;
background-color: rgba(0,0,0,0.5);
z-index: 2;
z-index: 99999;
cursor: pointer;
}
.welcome-pop-top {
......
<?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_hiring_team</tableName>
<column name="plan_cancelled" type="Boolean" nullable="true"/>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment