Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
PERFORMA_REPLICA
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Muhammad Usman
PERFORMA_REPLICA
Commits
b4215bac
Commit
b4215bac
authored
Oct 29, 2018
by
Nilu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moving company based billing to hiring team levels
parent
cf67a23d
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
183 additions
and
123 deletions
+183
-123
PullStripeDataBatch.java
cmsWebApp/src/performa/batch/PullStripeDataBatch.java
+5
-1
MakePaymentFP.java
cmsWebApp/src/performa/form/MakePaymentFP.java
+3
-1
ReplaceCardFP.java
cmsWebApp/src/performa/form/ReplaceCardFP.java
+7
-17
SaveCompanyFP.java
cmsWebApp/src/performa/form/SaveCompanyFP.java
+1
-1
UpdateCardFP.java
cmsWebApp/src/performa/form/UpdateCardFP.java
+7
-15
BaseHiringTeam.java
cmsWebApp/src/performa/orm/BaseHiringTeam.java
+0
-0
Company.java
cmsWebApp/src/performa/orm/Company.java
+0
-41
HiringTeam.java
cmsWebApp/src/performa/orm/HiringTeam.java
+52
-0
HiringTeam.xml
cmsWebApp/src/performa/orm/HiringTeam.xml
+2
-0
StripeUtils.java
cmsWebApp/src/performa/utils/StripeUtils.java
+6
-6
Utils.java
cmsWebApp/src/performa/utils/Utils.java
+30
-0
billing.jsp
cmsWebApp/webroot/extensions/adminportal/billing.jsp
+18
-4
edit_card.jsp
cmsWebApp/webroot/extensions/adminportal/edit_card.jsp
+18
-9
card_details.jsp
...ebApp/webroot/extensions/adminportal/inc/card_details.jsp
+5
-5
existing_card.jsp
...bApp/webroot/extensions/adminportal/inc/existing_card.jsp
+7
-7
manage_plan.jsp
cmsWebApp/webroot/extensions/adminportal/manage_plan.jsp
+0
-0
my_company.jsp
cmsWebApp/webroot/extensions/adminportal/my_company.jsp
+4
-7
replace_card.jsp
cmsWebApp/webroot/extensions/adminportal/replace_card.jsp
+18
-9
No files found.
cmsWebApp/src/performa/batch/PullStripeDataBatch.java
View file @
b4215bac
...
...
@@ -78,11 +78,15 @@ public class PullStripeDataBatch extends ORMBatch
paymentPlan
.
setAmount
(
plan
.
getAmount
().
doubleValue
()
/
100
);
paymentPlan
.
setInterval
(
Interval
.
forName
(
plan
.
getInterval
().
toUpperCase
()));
paymentPlan
.
setIntervalCount
(
plan
.
getIntervalCount
().
intValue
());
paymentPlan
.
setTrialPeriodDays
(
plan
.
getTrialPeriodDays
().
intValue
());
paymentPlan
.
setDisabled
(
Boolean
.
FALSE
);
paymentPlan
.
setProductReference
(
plan
.
getProduct
());
paymentPlan
.
setUsageType
(
UsageType
.
forName
(
plan
.
getUsageType
().
toUpperCase
()));
if
(
plan
.
getTrialPeriodDays
()
!=
null
)
{
paymentPlan
.
setTrialPeriodDays
(
plan
.
getTrialPeriodDays
().
intValue
());
}
if
(
activeJobs
!=
null
)
{
paymentPlan
.
setActiveJobCount
(
Integer
.
valueOf
(
activeJobs
));
...
...
cmsWebApp/src/performa/form/MakePaymentFP.java
View file @
b4215bac
...
...
@@ -26,6 +26,7 @@ import oneit.utils.DateDiff;
import
performa.intercom.utils.IntercomUtils
;
import
performa.orm.Company
;
import
performa.orm.CompanyUser
;
import
performa.orm.HiringTeam
;
import
performa.orm.Job
;
import
performa.orm.types.AssessmentType
;
import
performa.orm.types.JobStatus
;
...
...
@@ -50,6 +51,7 @@ public class MakePaymentFP extends SaveFP
CompanyUser
companyUser
=
secUser
.
getExtension
(
CompanyUser
.
REFERENCE_CompanyUser
);
Company
company
=
companyUser
.
getCompany
();
Job
job
=
(
Job
)
process
.
getAttribute
(
"Job"
);
HiringTeam
hiringTeam
=
(
HiringTeam
)
process
.
getAttribute
(
"HiringTeam"
);
LogMgr
.
log
(
LOG
,
LogLevel
.
PROCESSING1
,
"In MakePaymentFP from customer to open job: "
+
company
.
getStripeReference
());
...
...
@@ -85,7 +87,7 @@ public class MakePaymentFP extends SaveFP
if
(
company
.
getCardID
()
==
null
)
{
Card
card
=
StripeUtils
.
retrieveCard
(
company
);
Card
card
=
StripeUtils
.
retrieveCard
(
hiringTeam
);
company
.
setNameOnCard
(
card
.
getName
());
company
.
setCardPostCode
(
card
.
getAddressZip
());
...
...
cmsWebApp/src/performa/form/ReplaceCardFP.java
View file @
b4215bac
...
...
@@ -9,7 +9,6 @@ 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
;
...
...
@@ -17,8 +16,7 @@ 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.orm.HiringTeam
;
import
performa.utils.StripeUtils
;
...
...
@@ -55,22 +53,14 @@ public class ReplaceCardFP extends SaveFP
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
();
HiringTeam
hiringTeam
=
(
HiringTeam
)
process
.
getAttribute
(
"HiringTeam"
);
Card
card
=
StripeUtils
.
updateCardDetails
(
hiringTeam
,
token
);
LogMgr
.
log
(
LOG
,
LogLevel
.
PROCESSING1
,
"In ReplaceCardFP replacing card details of
company: "
+
company
);
LogMgr
.
log
(
LOG
,
LogLevel
.
PROCESSING1
,
"In ReplaceCardFP replacing card details of
hiringTeam: "
+
hiringTeam
);
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);
}
hiringTeam
.
setNameOnCard
(
card
.
getName
());
hiringTeam
.
setCardPostCode
(
card
.
getAddressZip
());
hiringTeam
.
setCardID
(
card
.
getId
());
}
catch
(
StorageException
|
FieldException
e
)
{
...
...
cmsWebApp/src/performa/form/SaveCompanyFP.java
View file @
b4215bac
...
...
@@ -54,7 +54,7 @@ public class SaveCompanyFP extends SaveFP
LogMgr
.
log
(
HiringTeam
.
LOG
,
LogLevel
.
PROCESSING1
,
"Hiring Team payment plan updated."
,
hiringTeam
,
" payment plan: "
,
hiringTeam
.
getPaymentPlan
());
if
(
hiringTeam
.
getC
ompany
().
getC
ardID
()
==
null
)
if
(
hiringTeam
.
getCardID
()
==
null
)
{
throw
new
BusinessException
(
"Please enter billing details before selecting a payment plan"
);
}
...
...
cmsWebApp/src/performa/form/UpdateCardFP.java
View file @
b4215bac
package
performa
.
form
;
import
com.stripe.Stripe
;
import
com.stripe.exception.AuthenticationException
;
import
com.stripe.exception.CardException
;
import
com.stripe.exception.InvalidRequestException
;
import
com.stripe.exception.StripeException
;
import
com.stripe.model.Card
;
import
java.util.HashMap
;
...
...
@@ -13,15 +10,13 @@ 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.orm.HiringTeam
;
import
performa.utils.StripeUtils
;
...
...
@@ -46,13 +41,10 @@ public class UpdateCardFP extends SaveFP
try
{
HttpServletRequest
request
=
submission
.
getRequest
();
HiringTeam
hiringTeam
=
(
HiringTeam
)
process
.
getAttribute
(
"HiringTeam"
);
Card
card
=
StripeUtils
.
retrieveCard
(
hiringTeam
);
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
);
LogMgr
.
log
(
LOG
,
LogLevel
.
PROCESSING1
,
"In UpdateCardFP updating card details of user : "
,
hiringTeam
,
" card : "
,
card
);
Map
<
String
,
Object
>
updateParams
=
new
HashMap
<>();
String
expiryDate
=
request
.
getParameter
(
"expiry-date"
);
...
...
@@ -68,19 +60,19 @@ public class UpdateCardFP extends SaveFP
if
(
name
!=
null
&&
!
name
.
isEmpty
())
{
updateParams
.
put
(
"name"
,
name
);
company
.
setNameOnCard
(
name
);
hiringTeam
.
setNameOnCard
(
name
);
}
if
(
addressZip
!=
null
&&
!
addressZip
.
isEmpty
())
{
updateParams
.
put
(
"address_zip"
,
addressZip
);
company
.
setCardPostCode
(
addressZip
);
hiringTeam
.
setCardPostCode
(
addressZip
);
}
Card
updatedCard
=
card
.
update
(
updateParams
);
LogMgr
.
log
(
LOG
,
LogLevel
.
PROCESSING1
,
"Updated card details of user : "
,
company
,
" updated card : "
,
updatedCard
);
LogMgr
.
log
(
LOG
,
LogLevel
.
PROCESSING1
,
"Updated card details of user : "
,
hiringTeam
,
" updated card : "
,
updatedCard
);
}
catch
(
StripeException
e
)
{
...
...
cmsWebApp/src/performa/orm/BaseHiringTeam.java
View file @
b4215bac
This diff is collapsed.
Click to expand it.
cmsWebApp/src/performa/orm/Company.java
View file @
b4215bac
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.BusinessException
;
...
...
@@ -12,7 +9,6 @@ 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
;
...
...
@@ -169,43 +165,6 @@ public class Company extends BaseCompany
}
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
();
...
...
cmsWebApp/src/performa/orm/HiringTeam.java
View file @
b4215bac
package
performa
.
orm
;
import
com.stripe.model.Card
;
import
java.util.Set
;
import
oneit.logging.LoggingArea
;
import
oneit.objstore.ValidationContext
;
import
oneit.objstore.rdbms.filters.EqualsFilter
;
import
oneit.utils.StringUtils
;
import
oneit.utils.filter.Filter
;
import
oneit.utils.parsers.FieldException
;
import
performa.utils.StripeUtils
;
public
class
HiringTeam
extends
BaseHiringTeam
...
...
@@ -55,4 +58,52 @@ public class HiringTeam extends BaseHiringTeam
{
return
isTrue
(
getIsPPJ
());
}
public
int
getRemainingJobs
()
{
return
getPaymentPlan
()
!=
null
&&
getPaymentPlan
().
getActiveJobCount
()
!=
null
?
getPaymentPlan
().
getActiveJobCount
()
-
getUsedCredits
()
:
0
;
}
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
)
:
""
;
}
@Override
public
Integer
getUsedCredits
()
{
return
super
.
getUsedCredits
()
!=
null
?
super
.
getUsedCredits
()
:
0
;
}
}
\ No newline at end of file
cmsWebApp/src/performa/orm/HiringTeam.xml
View file @
b4215bac
...
...
@@ -13,6 +13,8 @@
<TRANSIENT
name=
"IsLogoDeleted"
type=
"Boolean"
defaultValue=
"Boolean.FALSE"
/>
<TRANSIENT
name=
"CouponCode"
type=
"String"
length=
"20"
/>
<TRANSIENT
name=
"StripeBrand"
type=
"String"
/>
<TRANSIENT
name=
"StripeLast4"
type=
"String"
/>
<TABLE
name=
"tl_hiring_team"
tablePrefix=
"object"
>
...
...
cmsWebApp/src/performa/utils/StripeUtils.java
View file @
b4215bac
...
...
@@ -72,16 +72,16 @@ public class StripeUtils
}
public
static
Card
updateCardDetails
(
Company
company
,
String
token
)
throws
FieldException
public
static
Card
updateCardDetails
(
HiringTeam
hiringTeam
,
String
token
)
throws
FieldException
{
try
{
if
(
company
.
getStripeReference
()
==
null
)
if
(
hiringTeam
.
getStripeReference
()
==
null
)
{
createCustomer
(
company
.
getAddedByUser
().
getDefaultHiringTeam
());
createCustomer
(
hiringTeam
.
getAddedByUser
().
getDefaultHiringTeam
());
}
Customer
customer
=
Customer
.
retrieve
(
company
.
getStripeReference
());
Customer
customer
=
Customer
.
retrieve
(
hiringTeam
.
getStripeReference
());
Map
<
String
,
Object
>
updateParams
=
new
HashMap
<>();
...
...
@@ -105,11 +105,11 @@ public class StripeUtils
}
public
static
Card
retrieveCard
(
Company
company
)
throws
FieldException
public
static
Card
retrieveCard
(
HiringTeam
hiringTeam
)
throws
FieldException
{
try
{
Customer
customer
=
Customer
.
retrieve
(
company
.
getStripeReference
());
Customer
customer
=
Customer
.
retrieve
(
hiringTeam
.
getStripeReference
());
return
(
Card
)
customer
.
getSources
().
retrieve
(
customer
.
getDefaultSource
());
}
...
...
cmsWebApp/src/performa/utils/Utils.java
View file @
b4215bac
...
...
@@ -626,4 +626,33 @@ public class Utils
}
return
null
;
}
public
static
int
getDayOfMonth
(
Date
date
)
{
Calendar
cal
=
new
GregorianCalendar
();
cal
.
setTime
(
date
);
return
cal
.
get
(
Calendar
.
DAY_OF_MONTH
);
}
public
static
String
getDayNumberSuffix
(
int
day
)
{
if
(
day
>=
11
&&
day
<=
13
)
{
return
"th"
;
}
switch
(
day
%
10
)
{
case
1
:
return
"st"
;
case
2
:
return
"nd"
;
case
3
:
return
"rd"
;
default
:
return
"th"
;
}
}
}
\ No newline at end of file
cmsWebApp/webroot/extensions/adminportal/billing.jsp
View file @
b4215bac
...
...
@@ -9,9 +9,13 @@
SecUser loggedInUser = SecUser.getTXUser(transaction);
CompanyUser companyUser = loggedInUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
Company company = companyUser.getCompany();
HiringTeam hiringTeam = (HiringTeam) process.getAttribute("HiringTeam");
Debug.assertion(company != null , "Invalid company in admin portal my company");
Debug.assertion(hiringTeam != null , "Invalid hiring team in admin portal my company");
String hiringTeamList = WebUtils.getSamePageInRenderMode(request, "Page");
String nextPage = WebUtils.getSamePageInRenderMode(request, "Billing");
String replaceCardPage = WebUtils.getSamePageInRenderMode(request, "ReplaceCard");
%>
...
...
@@ -25,7 +29,15 @@
<div class="container-fluid">
<div class="row content">
<div class="main-content-area">
<h1 class="page-title">My Hiring Team</h1>
<oneit:form name="hiringTeamTilte" method="post" enctype="multipart/form-data">
<h1 class="page-title page-title-with-arrow">
<oneit:button cssClass="arrow-btn-blue" name="gotoPage" value=" " skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", hiringTeamList).toMap() %>" >
<img src="images/arrow-left-prev_blue.svg" />
</oneit:button>
<%= hiringTeam.getHiringTeamName() %>
</h1>
</oneit:form>
<div class="my-company-area">
<oneit:form name="makePayment" method="post" enctype="multipart/form-data">
...
...
@@ -46,7 +58,7 @@
</div>
</div>
<%
if(
company
.getCardID() != null)
if(
hiringTeam
.getCardID() != null)
{
%>
<oneit:dynInclude page="/extensions/adminportal/inc/existing_card.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"
...
...
@@ -65,12 +77,11 @@
</div>
<div class="grey-area">
<oneit:dynInclude page="/extensions/adminportal/inc/card_details.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"
Company="<%= company
%>" IsEdit="<%= false %>" IsReplace="<%= true %>"/>
HiringTeam="<%= hiringTeam
%>" 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>
<%
...
...
@@ -90,6 +101,9 @@
</div>
<oneit:button value="Pay" name="replaceCard" cssClass="hide" id="payNow"
requestAttribs='<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry ("restartProcess", Boolean.TRUE)
.mapEntry("procParams", CollectionUtils.mapEntry("HiringTeam", hiringTeam).toMap())
.mapEntry ("attribNamesToRestore", Collections.singleton("HiringTeam"))
.toMap() %>'/>
</oneit:form>
<script src="https://js.stripe.com/v3/"></script>
...
...
cmsWebApp/webroot/extensions/adminportal/edit_card.jsp
View file @
b4215bac
...
...
@@ -6,12 +6,11 @@
<oneit:dynIncluded>
<%
SecUser loggedInUser = SecUser.getTXUser(transaction);
CompanyUser companyUser = loggedInUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
Company company = companyUser.getCompany();
HiringTeam hiringTeam = (HiringTeam) process.getAttribute("HiringTeam");
Debug.assertion(
company != null , "Invalid company
in admin portal my company");
Debug.assertion(
hiringTeam != null , "Invalid hiring team
in admin portal my company");
String hiringTeamList = WebUtils.getSamePageInRenderMode(request, "Page");
String nextPage = WebUtils.getSamePageInRenderMode(request, "Billing");
%>
<script type="text/javascript">
...
...
@@ -21,7 +20,15 @@
});
</script>
<h1 class="page-title">My Hiring Team</h1>
<oneit:form name="hiringTeamTilte" method="post" enctype="multipart/form-data">
<h1 class="page-title page-title-with-arrow">
<oneit:button cssClass="arrow-btn-blue" name="gotoPage" value=" " skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", hiringTeamList).toMap() %>" >
<img src="images/arrow-left-prev_blue.svg" />
</oneit:button>
<%= hiringTeam.getHiringTeamName() %>
</h1>
</oneit:form>
<div class="my-company-area">
<oneit:form name="makePayment" method="post" enctype="multipart/form-data">
...
...
@@ -42,11 +49,11 @@
</div>
</div>
<%
if(
company
.getCardID() != null)
if(
hiringTeam
.getCardID() != null)
{
%>
<oneit:dynInclude page="/extensions/adminportal/inc/existing_card.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"
Company="<%= company
%>" IsEdit="<%= true %>" IsReplace="<%= false %>"/>
HiringTeam="<%= hiringTeam
%>" IsEdit="<%= true %>" IsReplace="<%= false %>"/>
<%
}
...
...
@@ -61,11 +68,10 @@
</div>
<div class="grey-area">
<oneit:dynInclude page="/extensions/adminportal/inc/card_details.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"
Company="<%= company
%>" IsEdit="<%= true %>" IsReplace="<%= false %>"/>
HiringTeam="<%= hiringTeam
%>" 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>
...
...
@@ -89,6 +95,9 @@
</div>
<oneit:button value="Pay" name="updateCard" cssClass="hide" id="payNow"
requestAttribs='<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry ("restartProcess", Boolean.TRUE)
.mapEntry("procParams", CollectionUtils.mapEntry("HiringTeam", hiringTeam).toMap())
.mapEntry ("attribNamesToRestore", Collections.singleton("HiringTeam"))
.toMap() %>'/>
</oneit:form>
<script src="https://js.stripe.com/v2/"></script>
...
...
cmsWebApp/webroot/extensions/adminportal/inc/card_details.jsp
View file @
b4215bac
...
...
@@ -5,7 +5,7 @@
<%@ include file="/extensions/performa/inc/stdimports.jsp" %>
<%
Company company = (Company) getData(request, "Company");
HiringTeam hiringTeam = (HiringTeam) getData(request, "HiringTeam");
boolean isReplace = (boolean) getData(request, "IsReplace");
boolean isEdit = (boolean) getData(request, "IsEdit");
String nextPage = WebUtils.getSamePageInRenderMode(request, "Billing");
...
...
@@ -62,7 +62,7 @@
if(isEdit)
{
%>
<input type="text" name="cardNumber" value="<%=
company
.getCardNumber() %>" class="form-control" readonly>
<input type="text" name="cardNumber" value="<%=
hiringTeam
.getCardNumber() %>" class="form-control" readonly>
<%
}
else
...
...
@@ -78,7 +78,7 @@
<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"/>
<oneit:ormInput obj="<%=
hiringTeam
%>" type="text" attributeName="NameOnCard" cssClass="form-control" id="NameOnCard" data-stripe="name"/>
</div>
</div>
<div class="form-group row">
...
...
@@ -88,7 +88,7 @@
if(isEdit)
{
%>
<input type="text" id="cardExpiry" class="form-control" placeholder="MM / YY" value="<%=
company
.getExpiry() %>">
<input type="text" id="cardExpiry" class="form-control" placeholder="MM / YY" value="<%=
hiringTeam
.getExpiry() %>">
<%
}
else
...
...
@@ -121,7 +121,7 @@
</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" />
<oneit:ormInput obj="<%=
hiringTeam
%>" type="text" attributeName="CardPostCode" cssClass="form-control" id="PostCode" />
</div>
</div>
...
...
cmsWebApp/webroot/extensions/adminportal/inc/existing_card.jsp
View file @
b4215bac
...
...
@@ -5,14 +5,16 @@
<%@ include file="/extensions/performa/inc/stdimports.jsp" %>
<%
Company company = (Company) getData(request, "Company
");
HiringTeam hiringTeam = (HiringTeam) getData(request, "HiringTeam
");
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();
String
cardNumber = hiringTeam
.getCardNumber();
Job job = (Job) process.getAttribute("Job");
Boolean ppj = (Boolean) process.getAttribute("PPJ");
String nextPage = WebUtils.getSamePageInRenderMode(request, "Billing");
%>
<oneit:dynIncluded>
<div class="form-group row">
...
...
@@ -20,14 +22,13 @@
<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;"/>
<img src="<%=
hiringTeam
.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())
.mapEntry("procParams", CollectionUtils.mapEntry("HiringTeam", hiringTeam).toMap())
.toMap() %>">
Edit Card
</oneit:button>
...
...
@@ -35,8 +36,7 @@
<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())
.mapEntry("procParams", CollectionUtils.mapEntry("HiringTeam", hiringTeam).toMap())
.toMap() %>">
Replace Card
</oneit:button>
...
...
cmsWebApp/webroot/extensions/adminportal/manage_plan.jsp
View file @
b4215bac
This diff is collapsed.
Click to expand it.
cmsWebApp/webroot/extensions/adminportal/my_company.jsp
View file @
b4215bac
...
...
@@ -14,7 +14,7 @@
Debug.assertion(company != null , "Invalid company in admin portal my company");
Debug.assertion(
company
!= null , "Invalid hiring team in admin portal my company");
Debug.assertion(
hiringTeam
!= null , "Invalid hiring team in admin portal my company");
%>
<script type="text/javascript">
...
...
@@ -29,12 +29,7 @@
$("#remove-logo").click(function(){
removeLogo();
});
});
</script>
<div class="container-fluid">
...
...
@@ -42,11 +37,13 @@
<div class="main-content-area">
<oneit:form name="editCompany" method="post" enctype="multipart/form-data">
<h1 class="page-title page-title-with-arrow">
<oneit:button cssClass="arrow-btn-blue" name="gotoPage" value=" " skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage).toMap() %>" >
<img src="images/arrow-left-prev_blue.svg" />
</oneit:button>
<h1 class="page-title"><%= hiringTeam.getHiringTeamName() %></h1>
<%= hiringTeam.getHiringTeamName() %>
</h1>
<div class="my-company-area">
<div style="padding-left: 15px; padding-right: 15px;">
...
...
cmsWebApp/webroot/extensions/adminportal/replace_card.jsp
View file @
b4215bac
...
...
@@ -6,12 +6,11 @@
<oneit:dynIncluded>
<%
SecUser loggedInUser = SecUser.getTXUser(transaction);
CompanyUser companyUser = loggedInUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
Company company = companyUser.getCompany();
HiringTeam hiringTeam = (HiringTeam) process.getAttribute("HiringTeam");
Debug.assertion(
company != null , "Invalid company
in admin portal my company");
Debug.assertion(
hiringTeam != null , "Invalid hiringTeam
in admin portal my company");
String hiringTeamList = WebUtils.getSamePageInRenderMode(request, "Page");
String nextPage = WebUtils.getSamePageInRenderMode(request, "Billing");
%>
<script type="text/javascript">
...
...
@@ -21,7 +20,15 @@
});
</script>
<h1 class="page-title">My Hiring Team</h1>
<oneit:form name="hiringTeamTilte" method="post" enctype="multipart/form-data">
<h1 class="page-title page-title-with-arrow">
<oneit:button cssClass="arrow-btn-blue" name="gotoPage" value=" " skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", hiringTeamList).toMap() %>" >
<img src="images/arrow-left-prev_blue.svg" />
</oneit:button>
<%= hiringTeam.getHiringTeamName() %>
</h1>
</oneit:form>
<div class="my-company-area">
<oneit:form name="makePayment" method="post" enctype="multipart/form-data">
...
...
@@ -42,11 +49,11 @@
</div>
</div>
<%
if(
company
.getCardID() != null)
if(
hiringTeam
.getCardID() != null)
{
%>
<oneit:dynInclude page="/extensions/adminportal/inc/existing_card.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"
Company="<%= company
%>" IsEdit="<%= false %>" IsReplace="<%= true %>"/>
HiringTeam="<%= hiringTeam
%>" IsEdit="<%= false %>" IsReplace="<%= true %>"/>
<%
}
...
...
@@ -61,11 +68,10 @@
</div>
<div class="grey-area">
<oneit:dynInclude page="/extensions/adminportal/inc/card_details.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"
Company="<%= company
%>" IsEdit="<%= false %>" IsReplace="<%= true %>"/>
HiringTeam="<%= hiringTeam
%>" 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>
...
...
@@ -83,6 +89,9 @@
</div>
<oneit:button value="Pay" name="replaceCard" cssClass="hide" id="payNow"
requestAttribs='<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry ("restartProcess", Boolean.TRUE)
.mapEntry("procParams", CollectionUtils.mapEntry("HiringTeam", hiringTeam).toMap())
.mapEntry ("attribNamesToRestore", Collections.singleton("HiringTeam"))
.toMap() %>'/>
</oneit:form>
<script src="https://js.stripe.com/v3/"></script>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment