Commit 3d48ef86 by nilu

S21294007 # Client - Incoming Issues (raised by Client) #Free Trial

parent 4ab4a41c
......@@ -36,6 +36,7 @@
<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="on_trial" 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"/>
......
......@@ -36,6 +36,7 @@ CREATE TABLE tl_hiring_team (
last_plan_amount numeric(20,5) NULL,
google_address_text varchar(300) NULL,
plan_cancelled char(1) NULL,
on_trial char(1) NULL,
company_id numeric(12) NOT NULL,
billing_team_id numeric(12) NULL,
added_by_user_id numeric(12) NOT NULL,
......
......@@ -37,6 +37,7 @@ CREATE TABLE tl_hiring_team (
last_plan_amount number(20,5) NULL,
google_address_text varchar2(300) NULL,
plan_cancelled char(1) NULL,
on_trial char(1) NULL,
company_id number(12) NOT NULL,
billing_team_id number(12) NULL,
added_by_user_id number(12) NOT NULL,
......
......@@ -37,6 +37,7 @@ CREATE TABLE tl_hiring_team (
last_plan_amount numeric(20,5) NULL,
google_address_text varchar(300) NULL,
plan_cancelled char(1) NULL,
on_trial char(1) NULL,
company_id numeric(12) NOT NULL,
billing_team_id numeric(12) NULL,
added_by_user_id numeric(12) NOT NULL,
......
......@@ -265,6 +265,11 @@ public class HiringTeam extends BaseHiringTeam
{
if(getManageOwnBilling())
{
if(isTrue(getOnTrial()))
{
return true;
}
return getCardID() != null && getIsPPJ() != null && (getIsPPJ() || (!getIsPPJ() && getPaymentPlan() != null && getStripeSubscription() != null));
}
......@@ -281,4 +286,14 @@ public class HiringTeam extends BaseHiringTeam
return getBilledByTeam().allowJobCreation();
}
public boolean allowTrialJobCreation()
{
if(getManageOwnBilling())
{
return isTrue(isPPJ()) || ( isFalse(isPPJ()) && getPaymentPlan() != null && getStripeSubscription() != null && (getAvailableCredits() > getUsedCredits() || !getHasCap() || (getHasCap() && getMaxCap() > getUsedCredits())));
}
return getBilledByTeam().allowJobCreation();
}
}
\ No newline at end of file
......@@ -46,6 +46,8 @@
<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"/>
<ATTRIB name="OnTrial" type="Boolean" dbcol="on_trial" defaultValue="Boolean.TRUE"/>
<ATTRIB name="TrialJobCount" type="Integer" dbcol="trial_job_count" defaultValue="0"/>
<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" />
......
......@@ -81,6 +81,7 @@
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry("CompanyUser", companyUser)
.mapEntry("Skip", Boolean.FALSE)
.mapEntry(NotificationUtils.DISPLAY_NOTIFICATION_PARAM, false)
.mapEntry("procParams", CollectionUtils.mapEntry("socialLogin", socialLogin).mapEntry("Company", company).toMap())
.toMap() %>"/>
......@@ -89,6 +90,7 @@
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry("CompanyUser", companyUser)
.mapEntry("Skip", Boolean.TRUE)
.mapEntry(NotificationUtils.DISPLAY_NOTIFICATION_PARAM, false)
.mapEntry("procParams", CollectionUtils.mapEntry("socialLogin", socialLogin).mapEntry("Company", company).toMap())
.toMap() %>"/>
</div>
......
......@@ -222,7 +222,7 @@
</div>
</oneit:form>
<%
if(billingTeam.getCardID() == null)
if(!billingTeam.isTrue(billingTeam.getOnTrial()) && billingTeam.getCardID() == null)
{
%>
<oneit:form name="setupBilling" method="post" enctype="multipart/form-data">
......@@ -259,7 +259,7 @@
<%
}
else if(billingTeam.getIsPPJ() == null || (!billingTeam.getIsPPJ() && billingTeam.getStripeSubscription() == null))
else if(!billingTeam.isTrue(billingTeam.getOnTrial()) && (billingTeam.getIsPPJ() == null || (!billingTeam.getIsPPJ() && billingTeam.getStripeSubscription() == null)))
{
%>
......
<?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="on_trial" 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