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
c51b36af
Commit
c51b36af
authored
Apr 05, 2018
by
Nilu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
J014 modifications
parent
ea648583
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
400 additions
and
35 deletions
+400
-35
MakePaymentFP.java
cmsWebApp/src/performa/form/MakePaymentFP.java
+3
-0
SaveCompanyFP.java
cmsWebApp/src/performa/form/SaveCompanyFP.java
+9
-0
SendVerificationMailFP.java
cmsWebApp/src/performa/form/SendVerificationMailFP.java
+1
-0
Company.java
cmsWebApp/src/performa/orm/Company.java
+10
-0
StripeUtils.java
cmsWebApp/src/performa/utils/StripeUtils.java
+47
-0
common.css
cmsWebApp/webroot/css/common.css
+24
-1
billing.jsp
cmsWebApp/webroot/extensions/adminportal/billing.jsp
+37
-4
card_payment.jsp
cmsWebApp/webroot/extensions/adminportal/card_payment.jsp
+61
-6
edit_card.jsp
cmsWebApp/webroot/extensions/adminportal/edit_card.jsp
+7
-3
edit_card_payment.jsp
...bApp/webroot/extensions/adminportal/edit_card_payment.jsp
+37
-4
card_details.jsp
...ebApp/webroot/extensions/adminportal/inc/card_details.jsp
+10
-5
existing_card.jsp
...bApp/webroot/extensions/adminportal/inc/existing_card.jsp
+4
-4
payment_plan.jsp
...ebApp/webroot/extensions/adminportal/inc/payment_plan.jsp
+70
-0
job_payment.jsp
cmsWebApp/webroot/extensions/adminportal/job_payment.jsp
+3
-1
job_review_submit.jsp
...bApp/webroot/extensions/adminportal/job_review_submit.jsp
+34
-0
replace_card.jsp
cmsWebApp/webroot/extensions/adminportal/replace_card.jsp
+7
-3
replace_card_payment.jsp
...p/webroot/extensions/adminportal/replace_card_payment.jsp
+36
-4
No files found.
cmsWebApp/src/performa/form/MakePaymentFP.java
View file @
c51b36af
...
@@ -59,6 +59,9 @@ public class MakePaymentFP extends SaveFP
...
@@ -59,6 +59,9 @@ public class MakePaymentFP extends SaveFP
company
.
setNameOnCard
(
card
.
getName
());
company
.
setNameOnCard
(
card
.
getName
());
company
.
setCardPostCode
(
card
.
getAddressZip
());
company
.
setCardPostCode
(
card
.
getAddressZip
());
company
.
setCardID
(
card
.
getId
());
company
.
setCardID
(
card
.
getId
());
// cannot subscribe to a plan without card details
StripeUtils
.
updatePlan
(
company
);
}
}
catch
(
StorageException
|
FieldException
e
)
catch
(
StorageException
|
FieldException
e
)
{
{
...
...
cmsWebApp/src/performa/form/SaveCompanyFP.java
View file @
c51b36af
...
@@ -15,6 +15,7 @@ import oneit.utils.CollectionUtils;
...
@@ -15,6 +15,7 @@ import oneit.utils.CollectionUtils;
import
oneit.utils.MultiException
;
import
oneit.utils.MultiException
;
import
performa.intercom.utils.IntercomUtils
;
import
performa.intercom.utils.IntercomUtils
;
import
performa.orm.Company
;
import
performa.orm.Company
;
import
performa.utils.StripeUtils
;
public
class
SaveCompanyFP
extends
SaveFP
public
class
SaveCompanyFP
extends
SaveFP
...
@@ -40,6 +41,14 @@ public class SaveCompanyFP extends SaveFP
...
@@ -40,6 +41,14 @@ public class SaveCompanyFP extends SaveFP
company
.
setPaymentPlan
(
company
.
getSelectedPaymentPlan
());
company
.
setPaymentPlan
(
company
.
getSelectedPaymentPlan
());
LogMgr
.
log
(
Company
.
LOG
,
LogLevel
.
PROCESSING1
,
"Company payment plan updated."
,
company
,
company
.
getPaymentPlan
());
LogMgr
.
log
(
Company
.
LOG
,
LogLevel
.
PROCESSING1
,
"Company payment plan updated."
,
company
,
company
.
getPaymentPlan
());
if
(
company
.
getCardID
()
!=
null
)
{
// cannot subscribe a user to a plan without card details
StripeUtils
.
updatePlan
(
company
);
LogMgr
.
log
(
Company
.
LOG
,
LogLevel
.
PROCESSING1
,
"Strpe subscription updated."
,
company
,
company
.
getStripeSubscription
());
}
}
}
// Update company in intercom
// Update company in intercom
...
...
cmsWebApp/src/performa/form/SendVerificationMailFP.java
View file @
c51b36af
...
@@ -130,6 +130,7 @@ public class SendVerificationMailFP extends SaveFP
...
@@ -130,6 +130,7 @@ public class SendVerificationMailFP extends SaveFP
secUser
=
SecUser
.
createSecUser
(
objTran
);
secUser
=
SecUser
.
createSecUser
(
objTran
);
secUser
.
setUserName
(
email
);
secUser
.
setUserName
(
email
);
secUser
.
setEmail
(
email
);
secUser
.
setAttribute
(
"md5:"
+
SecUser
.
FIELD_Password
,
CompanyUser
.
DEFAULT_PASSWORD
);
secUser
.
setAttribute
(
"md5:"
+
SecUser
.
FIELD_Password
,
CompanyUser
.
DEFAULT_PASSWORD
);
secUser
.
addRole
(
Utils
.
getRole
(
Utils
.
ROLE_APPLICANT
,
objTran
));
secUser
.
addRole
(
Utils
.
getRole
(
Utils
.
ROLE_APPLICANT
,
objTran
));
}
}
...
...
cmsWebApp/src/performa/orm/Company.java
View file @
c51b36af
...
@@ -11,6 +11,7 @@ import oneit.utils.CollectionUtils;
...
@@ -11,6 +11,7 @@ import oneit.utils.CollectionUtils;
import
oneit.utils.StringUtils
;
import
oneit.utils.StringUtils
;
import
oneit.utils.math.NullArith
;
import
oneit.utils.math.NullArith
;
import
oneit.utils.parsers.FieldException
;
import
oneit.utils.parsers.FieldException
;
import
performa.orm.types.JobStatus
;
import
performa.utils.StripeUtils
;
import
performa.utils.StripeUtils
;
...
@@ -137,6 +138,15 @@ public class Company extends BaseCompany
...
@@ -137,6 +138,15 @@ public class Company extends BaseCompany
}
}
public
boolean
canCreateJob
()
{
Job
[]
openJobs
=
Job
.
SearchByCompany
().
andJobStatus
(
new
EqualsFilter
<>(
JobStatus
.
OPEN
))
.
byCompany
(
this
)
.
search
(
getTransaction
());
return
getPaymentPlan
()
!=
null
&&
getPaymentPlan
().
getActiveJobCount
()
>
openJobs
.
length
;
}
public
String
getCardNumber
()
throws
FieldException
public
String
getCardNumber
()
throws
FieldException
{
{
Card
card
=
StripeUtils
.
retrieveCard
(
this
);
Card
card
=
StripeUtils
.
retrieveCard
(
this
);
...
...
cmsWebApp/src/performa/utils/StripeUtils.java
View file @
c51b36af
...
@@ -24,6 +24,7 @@ import oneit.utils.DateDiff;
...
@@ -24,6 +24,7 @@ import oneit.utils.DateDiff;
import
oneit.utils.parsers.FieldException
;
import
oneit.utils.parsers.FieldException
;
import
performa.orm.Company
;
import
performa.orm.Company
;
import
performa.orm.CompanyUser
;
import
performa.orm.CompanyUser
;
import
performa.orm.PaymentPlan
;
public
class
StripeUtils
public
class
StripeUtils
...
@@ -144,4 +145,50 @@ public class StripeUtils
...
@@ -144,4 +145,50 @@ public class StripeUtils
LogMgr
.
log
(
LoggingArea
.
ALL
,
LogLevel
.
PROCESSING1
,
ex
,
"Error while creating subscrition in stripe"
);
LogMgr
.
log
(
LoggingArea
.
ALL
,
LogLevel
.
PROCESSING1
,
ex
,
"Error while creating subscrition in stripe"
);
}
}
}
}
public
static
void
updatePlan
(
Company
company
)
throws
FieldException
{
try
{
Subscription
subscription
=
null
;
PaymentPlan
paymentPlan
=
company
.
getPaymentPlan
();
Map
<
String
,
Object
>
item
=
new
HashMap
<>();
if
(
company
.
getStripeSubscription
()
!=
null
)
{
subscription
=
Subscription
.
retrieve
(
company
.
getStripeSubscription
());
item
.
put
(
"id"
,
subscription
.
getSubscriptionItems
().
getData
().
get
(
0
).
getId
());
}
item
.
put
(
"plan"
,
paymentPlan
.
getStripeReference
());
Map
<
String
,
Object
>
items
=
new
HashMap
<>();
items
.
put
(
"0"
,
item
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"items"
,
items
);
if
(
subscription
!=
null
)
{
subscription
.
update
(
params
);
}
else
{
params
.
put
(
"customer"
,
company
.
getStripeReference
());
subscription
=
Subscription
.
create
(
params
);
}
LogMgr
.
log
(
LoggingArea
.
ALL
,
LogLevel
.
PROCESSING1
,
"Subscribing customer in stripe : "
,
subscription
);
company
.
setStripeSubscription
(
subscription
.
getId
());
}
catch
(
StorageException
|
AuthenticationException
|
InvalidRequestException
|
APIConnectionException
|
CardException
|
APIException
ex
)
{
LogMgr
.
log
(
LoggingArea
.
ALL
,
LogLevel
.
PROCESSING1
,
ex
,
"Error while creating subscrition in stripe"
);
}
}
}
}
cmsWebApp/webroot/css/common.css
View file @
c51b36af
...
@@ -5447,7 +5447,7 @@ label, label .label-title span {
...
@@ -5447,7 +5447,7 @@ label, label .label-title span {
.company-content-area
.bold
,
.billing-content-area
.bold
{
.company-content-area
.bold
,
.billing-content-area
.bold
{
font-family
:
"Usual-Medium"
;
font-family
:
"Usual-Medium"
;
}
}
.
company-content-area
.
large-btn
,
.line-break
.large-btn
{
.large-btn
,
.line-break
.large-btn
{
width
:
50%
;
width
:
50%
;
height
:
60px
;
height
:
60px
;
border-radius
:
100px
;
border-radius
:
100px
;
...
@@ -6073,6 +6073,8 @@ input{
...
@@ -6073,6 +6073,8 @@ input{
.pay-subsc-row
{
.pay-subsc-row
{
vertical-align
:
middle
;
vertical-align
:
middle
;
margin-right
:
-10px
;
margin-left
:
-10px
;
}
}
.pay-subsc-txt
{
.pay-subsc-txt
{
...
@@ -6141,3 +6143,23 @@ input{
...
@@ -6141,3 +6143,23 @@ input{
.card-payment
label
{
.card-payment
label
{
font-family
:
"Usual-Regular"
;
font-family
:
"Usual-Regular"
;
}
}
.card-payment
.cancel-and-go-back
{
color
:
#8D8D8D
;
font-family
:
"Usual-Regular"
;
font-size
:
14px
;
line-height
:
17px
;
text-align
:
center
;
}
.card-payment
.btn-footer
{
margin-top
:
40px
;
}
.card-payment
.large-btn
{
width
:
80%
;
}
.card-payment
.btn-right
{
text-align
:
right
;
}
\ No newline at end of file
cmsWebApp/webroot/extensions/adminportal/billing.jsp
View file @
c51b36af
...
@@ -39,10 +39,12 @@
...
@@ -39,10 +39,12 @@
<!-- Tab panes -->
<!-- Tab panes -->
<div class="tab-content">
<div class="tab-content">
<div class="tab-pane active" id="company-detail">
<div class="tab-pane active" id="company-detail">
<div class="tabpage-title">
<div class="form-group row">
<label class="label-20">Billing</label><br/>
<div class="col-md-12 col-sm-12 col-xs-12 text-left">
<label class="label-20 pay-subsc-txt">Billing</label><br/>
<span id="card-errors" style="color: #eb1c26; font-size: 15px;"></span>
<span id="card-errors" style="color: #eb1c26; font-size: 15px;"></span>
</div>
</div>
</div>
<%
<%
if(company.getCardID() != null)
if(company.getCardID() != null)
{
{
...
@@ -55,11 +57,22 @@
...
@@ -55,11 +57,22 @@
else
else
{
{
%>
%>
<div>
<div class="form-group row">
<div class="col-md-12 col-sm-12 col-xs-12 text-left">
<label class="label-14 bold">Add a payment method</label><br/>
<label class="label-14 bold">Add a payment method</label><br/>
<label class="label-14">Your card details will be saved for future billing</label>
<label class="label-14">Your card details will be saved for future billing</label>
</div>
</div>
<oneit:dynInclude page="/extensions/adminportal/inc/card_details.jsp" data="<%= CollectionUtils.EMPTY_MAP%>" Company="<%= company %>"/>
</div>
<div class="grey-area">
<oneit:dynInclude page="/extensions/adminportal/inc/card_details.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"
Company="<%= company %>" IsEdit="<%= false %>" IsReplace="<%= true %>"/>
</div>
<div class="form-group">
<oneit:button value="Save Card" name="updateCard" cssClass="btn btn-primary btn-green large-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry("Company", company)
.toMap() %>" />
</div>
<%
<%
}
}
%>
%>
...
@@ -67,6 +80,26 @@
...
@@ -67,6 +80,26 @@
</div>
</div>
</div>
</div>
</oneit:form>
</oneit:form>
<oneit:form name="editCompany" method="post" enctype="multipart/form-data">
<div class="row">
<div class="col-lg-4 col-md-4 col-sm-6">
<div class="form-group hide">
<input type="hidden" name="stripe-token-id" />
</div>
</div>
</div>
<oneit:button value="Pay" name="savePayment" cssClass="hide" id="payNow"
requestAttribs='<%= CollectionUtils.mapEntry("nextPage", nextPage)
.toMap() %>'/>
</oneit:form>
<script src="https://js.stripe.com/v3/"></script>
<script>
var stripePubKey = '<%= MakePaymentFP.STRIPE_PUB_KEY %>';
</script>
<oneit:script>
<!-- MUST be included after initializing stripePubKey -->
<oneit:script src="/scripts/performaStripe.js"/>
</oneit:script>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
cmsWebApp/webroot/extensions/adminportal/card_payment.jsp
View file @
c51b36af
...
@@ -9,18 +9,34 @@
...
@@ -9,18 +9,34 @@
CompanyUser companyUser = loggedInUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
CompanyUser companyUser = loggedInUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
Company company = companyUser.getCompany();
Company company = companyUser.getCompany();
String nextPage = WebUtils.getSamePageInRenderMode(request, "CardPayment");
String nextPage = WebUtils.getSamePageInRenderMode(request, "CardPayment");
Job job = (Job) process.getAttribute("Job");
String jobsPage = WebUtils.getSamePageInRenderMode(request, "Page");
%>
%>
<oneit:form name="editJob" method="post" enctype="multipart/form-data">
<oneit:form name="makePayment" method="post" enctype="multipart/form-data">
<script type="text/javascript">
$(document).ready(function()
{
recalcFunction = setupRecalc ($("form"), {'recalcOnError':true});
});
</script>
<div class="main-created-job card-payment">
<div class="main-created-job card-payment">
<h1 class="page-title select-payment-optio">
<h1 class="page-title select-payment-optio">
Enter Payment Details
Enter Payment Details
</h1>
</h1>
<div class="form-page-area">
<div class="form-page-area billing-content-area">
<div class="tabpage-title">
<label class="label-20">Payment</label><br/>
<oneit:dynInclude page="/extensions/adminportal/inc/payment_plan.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"
Company="<%= company %>" Job="<%= job %>"/>
<div class="form-group row">
<div class="col-md-12 col-sm-12 col-xs-12 text-left">
<label class="label-20 pay-subsc-txt">Payment</label><br/>
<span id="card-errors" style="color: #eb1c26; font-size: 15px;"></span>
<span id="card-errors" style="color: #eb1c26; font-size: 15px;"></span>
</div>
</div>
</div>
<%
<%
if(company.getCardID() != null)
if(company.getCardID() != null)
{
{
...
@@ -33,15 +49,53 @@
...
@@ -33,15 +49,53 @@
else
else
{
{
%>
%>
<div>
<div class="form-group row">
<div class="col-md-12 col-sm-12 col-xs-12 text-left">
<label class="label-14">Your card details will be saved for future billing</label>
<label class="label-14">Your card details will be saved for future billing</label>
</div>
</div>
<oneit:dynInclude page="/extensions/adminportal/inc/card_details.jsp" data="<%= CollectionUtils.EMPTY_MAP%>" Company="<%= company %>"/>
</div>
<div class="grey-area">
<oneit:dynInclude page="/extensions/adminportal/inc/card_details.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"
Company="<%= company %>" IsEdit="<%= false %>" IsReplace="<%= true %>"/>
</div>
<%
<%
}
}
%>
%>
<div class="form-group row" style="padding-top: 30px;">
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 btn-footer">
<oneit:button value="Cancel and go back to Jobs" name="gotoPage" skin="link" cssClass="cancel-and-go-back"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", jobsPage)
.toMap() %>" />
</div>
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 btn-right">
<oneit:button value="Pay and Open Job" name="updateCard" cssClass="btn btn-primary large-btn btn-green"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry("Company", company)
.toMap() %>" />
</div>
</div>
</div>
</div>
</oneit:form>
<oneit:form name="editJob" method="post" enctype="multipart/form-data">
<div class="row">
<div class="col-lg-4 col-md-4 col-sm-6">
<div class="form-group hide">
<input type="hidden" name="stripe-token-id" />
</div>
</div>
</div>
</div>
</div>
<oneit:button value="Pay" name="savePayment" cssClass="hide" id="payNow"
requestAttribs='<%= CollectionUtils.mapEntry("nextPage", nextPage)
.toMap() %>'/>
</oneit:form>
</oneit:form>
<script src="https://js.stripe.com/v3/"></script>
<script>
var stripePubKey = '<%= MakePaymentFP.STRIPE_PUB_KEY %>';
</script>
<oneit:script>
<!-- MUST be included after initializing stripePubKey -->
<oneit:script src="/scripts/performaStripe.js"/>
</oneit:script>
</oneit:dynIncluded>
</oneit:dynIncluded>
\ No newline at end of file
cmsWebApp/webroot/extensions/adminportal/edit_card.jsp
View file @
c51b36af
...
@@ -35,10 +35,12 @@
...
@@ -35,10 +35,12 @@
<!-- Tab panes -->
<!-- Tab panes -->
<div class="tab-content">
<div class="tab-content">
<div class="tab-pane active" id="company-detail">
<div class="tab-pane active" id="company-detail">
<div class="tabpage-title">
<div class="form-group row">
<label class="label-20">Billing</label><br/>
<div class="col-md-12 col-sm-12 col-xs-12 text-left">
<label class="label-20 pay-subsc-txt">Billing</label><br/>
<span id="card-errors" style="color: #eb1c26; font-size: 15px;"></span>
<span id="card-errors" style="color: #eb1c26; font-size: 15px;"></span>
</div>
</div>
</div>
<%
<%
if(company.getCardID() != null)
if(company.getCardID() != null)
{
{
...
@@ -51,10 +53,12 @@
...
@@ -51,10 +53,12 @@
%>
%>
</div>
</div>
<div>
<div>
<div>
<div class="form-group row">
<div class="col-md-12 col-sm-12 col-xs-12 text-left">
<label class="label-14 bold">Edit Card</label><br/>
<label class="label-14 bold">Edit Card</label><br/>
<label class="label-14">Your card details will be saved for future billing</label>
<label class="label-14">Your card details will be saved for future billing</label>
</div>
</div>
</div>
<div class="grey-area">
<div class="grey-area">
<oneit:dynInclude page="/extensions/adminportal/inc/card_details.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"
<oneit:dynInclude page="/extensions/adminportal/inc/card_details.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"
Company="<%= company %>" IsEdit="<%= true %>" IsReplace="<%= false %>"/>
Company="<%= company %>" IsEdit="<%= true %>" IsReplace="<%= false %>"/>
...
...
cmsWebApp/webroot/extensions/adminportal/edit_card_payment.jsp
View file @
c51b36af
...
@@ -9,17 +9,34 @@
...
@@ -9,17 +9,34 @@
CompanyUser companyUser = loggedInUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
CompanyUser companyUser = loggedInUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
Company company = companyUser.getCompany();
Company company = companyUser.getCompany();
String nextPage = WebUtils.getSamePageInRenderMode(request, "CardPayment");
String nextPage = WebUtils.getSamePageInRenderMode(request, "CardPayment");
Job job = (Job) process.getAttribute("Job");
String jobsPage = WebUtils.getSamePageInRenderMode(request, "Page");
%>
%>
<oneit:form name="makePayment" method="post" enctype="multipart/form-data">
<oneit:form name="makePayment" method="post" enctype="multipart/form-data">
<script type="text/javascript">
$(document).ready(function()
{
recalcFunction = setupRecalc ($("form"), {'recalcOnError':true});
});
</script>
<div class="main-created-job card-payment">
<div class="main-created-job card-payment">
<h1 class="page-title select-payment-optio">
<h1 class="page-title select-payment-optio">
Enter Payment Details
Enter Payment Details
</h1>
</h1>
<div class="form-page-area billing-content-area">
<div class="form-page-area billing-content-area">
<div class="tabpage-title">
<label class="label-20">Payment</label><br/>
<oneit:dynInclude page="/extensions/adminportal/inc/payment_plan.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"
Company="<%= company %>" Job="<%= job %>"/>
<div class="form-group row">
<div class="col-md-12 col-sm-12 col-xs-12 text-left">
<label class="label-20 pay-subsc-txt">Payment</label><br/>
<span id="card-errors" style="color: #eb1c26; font-size: 15px;"></span>
<span id="card-errors" style="color: #eb1c26; font-size: 15px;"></span>
</div>
</div>
</div>
<%
<%
if(company.getCardID() != null)
if(company.getCardID() != null)
{
{
...
@@ -30,15 +47,31 @@
...
@@ -30,15 +47,31 @@
<%
<%
}
}
%>
%>
<div>
<div>
<div class="form-brack-line"></div>
<div class="form-group row">
<div class="col-md-12 col-sm-12 col-xs-12 text-left">
<label class="label-14 bold">Edit Card</label><br/>
<label class="label-14 bold">Edit Card</label><br/>
<label class="label-14">Your card details will be saved for future billing</label>
<label class="label-14">Your card details will be saved for future billing</label>
</div>
</div>
</div>
<div class="grey-area">
<div class="grey-area">
<oneit:dynInclude page="/extensions/adminportal/inc/card_details.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"
<oneit:dynInclude page="/extensions/adminportal/inc/card_details.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"
Company="<%= company %>" IsEdit="<%= true %>" IsReplace="<%= false %>"/>
Company="<%= company %>" IsEdit="<%= true %>" IsReplace="<%= false %>"/>
</div>
</div>
<div class="form-group row" style="padding-top: 30px;">
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 btn-footer">
<oneit:button value="Cancel and go back to Jobs" name="gotoPage" skin="link" cssClass="cancel-and-go-back"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", jobsPage)
.toMap() %>" />
</div>
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 btn-right">
<oneit:button value="Pay and Open Job" name="updateCard" cssClass="btn btn-primary large-btn btn-green"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry("Company", company)
.toMap() %>" />
</div>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
cmsWebApp/webroot/extensions/adminportal/inc/card_details.jsp
View file @
c51b36af
...
@@ -50,7 +50,8 @@
...
@@ -50,7 +50,8 @@
});
});
});
});
</script>
</script>
<div class="form-group">
<div class="form-group row">
<div class="col-md-12 col-sm-12 col-xs-12 text-left">
<label>Card Number</label>
<label>Card Number</label>
<%
<%
if(isEdit)
if(isEdit)
...
@@ -68,12 +69,15 @@
...
@@ -68,12 +69,15 @@
}
}
%>
%>
</div>
</div>
<div class="form-group">
</div>
<div class="form-group row">
<div class="col-md-12 col-sm-12 col-xs-12 text-left">
<label>Name on Card</label>
<label>Name on Card</label>
<oneit:ormInput obj="<%= company %>" type="text" attributeName="NameOnCard" cssClass="form-control" id="NameOnCard" data-stripe="name"/>
<oneit:ormInput obj="<%= company %>" type="text" attributeName="NameOnCard" cssClass="form-control" id="NameOnCard" data-stripe="name"/>
</div>
</div>
</div>
<div class="form-group row">
<div class="form-group row">
<div class="col-
md
-4">
<div class="col-
lg-4 col-md-4 col-sm
-4">
<label>Expires</label>
<label>Expires</label>
<%
<%
if(isEdit)
if(isEdit)
...
@@ -91,7 +95,7 @@
...
@@ -91,7 +95,7 @@
}
}
%>
%>
</div>
</div>
<div class="col-
md
-4">
<div class="col-
lg-4 col-md-4 col-sm
-4">
<label>CCV</label>
<label>CCV</label>
<%
<%
if(isEdit)
if(isEdit)
...
@@ -110,10 +114,11 @@
...
@@ -110,10 +114,11 @@
}
}
%>
%>
</div>
</div>
<div class="col-md-4">
<div class="col-md-4
col-lg-4 col-md-4 col-sm-4
">
<label>Postal Code</label>
<label>Postal Code</label>
<oneit:ormInput obj="<%= company %>" type="text" attributeName="CardPostCode" cssClass="form-control" id="PostCode" />
<oneit:ormInput obj="<%= company %>" type="text" attributeName="CardPostCode" cssClass="form-control" id="PostCode" />
</div>
</div>
</div>
</div>
</oneit:dynIncluded>
</oneit:dynIncluded>
cmsWebApp/webroot/extensions/adminportal/inc/existing_card.jsp
View file @
c51b36af
...
@@ -13,20 +13,20 @@
...
@@ -13,20 +13,20 @@
%>
%>
<oneit:dynIncluded>
<oneit:dynIncluded>
<div class="form-group row">
<div class="form-group row">
<div class="col-
md
-3">
<div class="col-
lg-3 col-md-3 col-sm
-3">
<label>Card on file</label>
<label>Card on file</label>
</div>
</div>
<div class="col-
md
-5">
<div class="col-
lg-5 col-md-5 col-sm
-5">
<label><%= company.getCardNumber() %></label>
<label><%= company.getCardNumber() %></label>
</div>
</div>
<div class="col-
md
-2">
<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")%>"
<oneit:button value=" " name="gotoPage" skin="link" cssClass="<%= "edit-card-link " + (isEdit ? "" : "deselected-link")%>"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", editCardPage)
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", editCardPage)
.toMap() %>">
.toMap() %>">
Edit Card
Edit Card
</oneit:button>
</oneit:button>
</div>
</div>
<div class="col-
md
-2">
<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")%>"
<oneit:button value=" " name="gotoPage" skin="link" cssClass="<%= "edit-card-link " + (isReplace ? "" : "deselected-link")%>"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", replaceCardPage)
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", replaceCardPage)
.toMap() %>">
.toMap() %>">
...
...
cmsWebApp/webroot/extensions/adminportal/inc/payment_plan.jsp
0 → 100644
View file @
c51b36af
<%@ page extends="oneit.servlets.jsp.JSPInclude" %>
<%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%>
<%@ include file="/inc/stdcms.jsp" %><%-- This is in cougar --%>
<%@ include file="/extensions/performa/inc/stdimports.jsp" %>
<%
Company company = (Company) getData(request, "Company");
Job job = (Job) getData(request, "Job");
PaymentPlan[] plans = Utils.getPaymentPlansForJobs(transaction);
Integer maxCount = 0;
Integer minCount = 0;
if(company.getPaymentPlan() != null && company.getPaymentJobCount() == null)
{
company.setPaymentJobCount(company.getPaymentPlan().getActiveJobCount());
}
if(plans.length > 0)
{
Collection<Integer> jCounts = PaymentPlan.pipesPaymentPlan(plans).toActiveJobCount().vals();
maxCount = Collections.max(jCounts);
minCount = Collections.min(jCounts);
}
%>
<oneit:dynIncluded>
<div class="a-label-row pay-subsc-row">
<div class="col-md-6 col-sm-6 col-xs-6 text-left">
<label class="label-20 pay-subsc-txt"><%= company.getPaymentPlan() != null ? "Monthly Plan" : job.getAssessmentType().getDescription() %></label>
</div>
<%
if(company.getPaymentPlan() != null)
{
%>
<div class="col-md-6 col-sm-6 col-xs-6 text-right">
<oneit:ormInput type="number" obj="<%= company %>" attributeName="PaymentJobCount" required="true"
min="<%= minCount %>" max="<%= maxCount %>" step="1" cssClass="payment-paln-count"/>
<label class="label-20"> Jobs / month </label>
</div>
<%
}
%>
</div>
<div class="form-group row">
<div class="pay-subsc-det-row a-label-row">
<oneit:recalcClass htmlTag="span" classScript="company.getPaymentPlanAmount()!=null ? 'show': 'hide'" company="<%= company %>">
<div class="col-md-6 col-sm-6 col-xs-6 text-left">
Total:
<span class="pay-subsc-amt">
<oneit:recalc mode="Currency" script="company.getPaymentPlanAmount()" company="<%= company %>" nullValue=""/>
/ mo
</span>
</div>
<div class="col-md-6 col-sm-6 col-xs-6 text-right pay-subsc-det">
<div class="text-right">
<oneit:recalc mode="Currency" script="company.getPerJobPaymentPlanAmount()" company="<%= company %>" nullValue=""/>
per job. Save
<oneit:recalc mode="Currency" script="company.getPaymentPlanSaveAmount()" company="<%= company %>" nullValue=""/>
per month.
</div>
</div>
</oneit:recalcClass>
</div>
</div>
</oneit:dynIncluded>
cmsWebApp/webroot/extensions/adminportal/job_payment.jsp
View file @
c51b36af
...
@@ -143,7 +143,9 @@
...
@@ -143,7 +143,9 @@
</div>
</div>
<div class="col-md-6 col-sm-6 col-xs-6">
<div class="col-md-6 col-sm-6 col-xs-6">
<oneit:button value="Pay for this job only" name="gotoPage" cssClass="btn pay-only-job-btn"
<oneit:button value="Pay for this job only" name="gotoPage" cssClass="btn pay-only-job-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", paymentPage).toMap() %>" />
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", paymentPage)
.mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap())
.toMap() %>" />
</div>
</div>
</div>
</div>
</div>
</div>
...
...
cmsWebApp/webroot/extensions/adminportal/job_review_submit.jsp
View file @
c51b36af
...
@@ -75,6 +75,7 @@
...
@@ -75,6 +75,7 @@
<%
<%
SecUser txUser = SecUser.getTXUser(process.getTransaction());
SecUser txUser = SecUser.getTXUser(process.getTransaction());
CompanyUser companyUser = txUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
CompanyUser companyUser = txUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
Company company = companyUser.getCompany();
if(companyUser.getCompany().showHasClientSupport())
if(companyUser.getCompany().showHasClientSupport())
{
{
...
@@ -212,9 +213,42 @@
...
@@ -212,9 +213,42 @@
.mapEntry ("restartProcess", Boolean.TRUE)
.mapEntry ("restartProcess", Boolean.TRUE)
.mapEntry ("attribNamesToRestore", Collections.singleton("Job"))
.mapEntry ("attribNamesToRestore", Collections.singleton("Job"))
.toMap() %>" />
.toMap() %>" />
<%
if(company.canCreateJob())
{
if(company.getCardID() != null)
{
String createJobPage = WebUtils.getSamePageInRenderMode(request, WebUtils.CREATED_JOB) + "&fromJob=true";
%>
<oneit:button value="Confirm and Create Job" name="saveJob" cssClass="btn btn-primary btn-green top-margin-25 largeBtn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", createJobPage)
.mapEntry ("fromPage", fifthPage)
.mapEntry("JobStatus", JobStatus.OPEN)
.mapEntry ("restartProcess", Boolean.TRUE)
.mapEntry ("attribNamesToRestore", Collections.singleton("Job"))
.toMap() %>" />
<%
}
else
{
String createJobPage = WebUtils.getSamePageInRenderMode(request, WebUtils.CARD_PAYMENT);
%>
<oneit:button value="Confirm and Create Job" name="gotoPage" cssClass="btn btn-primary btn-green top-margin-25 largeBtn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", createJobPage).toMap() %>" />
<%
}
}
else
{
%>
<oneit:button value="Confirm and make payment" name="gotoPage" cssClass="btn btn-primary btn-green top-margin-25 largeBtn"
<oneit:button value="Confirm and make payment" name="gotoPage" cssClass="btn btn-primary btn-green top-margin-25 largeBtn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage).toMap() %>" />
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage).toMap() %>" />
<%
}
%>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
cmsWebApp/webroot/extensions/adminportal/replace_card.jsp
View file @
c51b36af
...
@@ -35,10 +35,12 @@
...
@@ -35,10 +35,12 @@
<!-- Tab panes -->
<!-- Tab panes -->
<div class="tab-content">
<div class="tab-content">
<div class="tab-pane active" id="company-detail">
<div class="tab-pane active" id="company-detail">
<div class="tabpage-title">
<div class="form-group row">
<label class="label-20">Billing</label><br/>
<div class="col-md-12 col-sm-12 col-xs-12 text-left">
<label class="label-20 pay-subsc-txt">Billing</label><br/>
<span id="card-errors" style="color: #eb1c26; font-size: 15px;"></span>
<span id="card-errors" style="color: #eb1c26; font-size: 15px;"></span>
</div>
</div>
</div>
<%
<%
if(company.getCardID() != null)
if(company.getCardID() != null)
{
{
...
@@ -51,10 +53,12 @@
...
@@ -51,10 +53,12 @@
%>
%>
</div>
</div>
<div>
<div>
<div>
<div class="form-group row">
<div class="col-md-12 col-sm-12 col-xs-12 text-left">
<label class="label-14 bold">Replace Card</label><br/>
<label class="label-14 bold">Replace Card</label><br/>
<label class="label-14">Your card details will be saved for future billing</label>
<label class="label-14">Your card details will be saved for future billing</label>
</div>
</div>
</div>
<div class="grey-area">
<div class="grey-area">
<oneit:dynInclude page="/extensions/adminportal/inc/card_details.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"
<oneit:dynInclude page="/extensions/adminportal/inc/card_details.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"
Company="<%= company %>" IsEdit="<%= false %>" IsReplace="<%= true %>"/>
Company="<%= company %>" IsEdit="<%= false %>" IsReplace="<%= true %>"/>
...
...
cmsWebApp/webroot/extensions/adminportal/replace_card_payment.jsp
View file @
c51b36af
...
@@ -9,17 +9,33 @@
...
@@ -9,17 +9,33 @@
CompanyUser companyUser = loggedInUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
CompanyUser companyUser = loggedInUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
Company company = companyUser.getCompany();
Company company = companyUser.getCompany();
String nextPage = WebUtils.getSamePageInRenderMode(request, "CardPayment");
String nextPage = WebUtils.getSamePageInRenderMode(request, "CardPayment");
Job job = (Job) process.getAttribute("Job");
String jobsPage = WebUtils.getSamePageInRenderMode(request, "Page");
%>
%>
<oneit:form name="makePayment" method="post" enctype="multipart/form-data">
<oneit:form name="makePayment" method="post" enctype="multipart/form-data">
<script type="text/javascript">
$(document).ready(function()
{
recalcFunction = setupRecalc ($("form"), {'recalcOnError':true});
});
</script>
<div class="main-created-job card-payment">
<div class="main-created-job card-payment">
<h1 class="page-title select-payment-optio">
<h1 class="page-title select-payment-optio">
Enter Payment Details
Enter Payment Details
</h1>
</h1>
<div class="form-page-area billing-content-area">
<div class="form-page-area billing-content-area">
<div class="tabpage-title">
<label class="label-20">Payment</label><br/>
<oneit:dynInclude page="/extensions/adminportal/inc/payment_plan.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"
Company="<%= company %>" Job="<%= job %>"/>
<div class="form-group row">
<div class="col-md-12 col-sm-12 col-xs-12 text-left">
<label class="label-20 pay-subsc-txt">Payment</label><br/>
<span id="card-errors" style="color: #eb1c26; font-size: 15px;"></span>
<span id="card-errors" style="color: #eb1c26; font-size: 15px;"></span>
</div>
</div>
</div>
<%
<%
if(company.getCardID() != null)
if(company.getCardID() != null)
{
{
...
@@ -30,15 +46,31 @@
...
@@ -30,15 +46,31 @@
<%
<%
}
}
%>
%>
<div>
<div>
<div class="form-brack-line"></div>
<div class="form-group row">
<div class="col-md-12 col-sm-12 col-xs-12 text-left">
<label class="label-14 bold">Replace Card</label><br/>
<label class="label-14 bold">Replace Card</label><br/>
<label class="label-14">Your card details will be saved for future billing</label>
<label class="label-14">Your card details will be saved for future billing</label>
</div>
</div>
</div>
<div class="grey-area">
<div class="grey-area">
<oneit:dynInclude page="/extensions/adminportal/inc/card_details.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"
<oneit:dynInclude page="/extensions/adminportal/inc/card_details.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"
Company="<%= company %>" IsEdit="<%= false %>" IsReplace="<%= true %>"/>
Company="<%= company %>" IsEdit="<%= false %>" IsReplace="<%= true %>"/>
</div>
</div>
<div class="form-group row" style="padding-top: 30px;">
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 btn-footer">
<oneit:button value="Cancel and go back to Jobs" name="gotoPage" skin="link" cssClass="cancel-and-go-back"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", jobsPage)
.toMap() %>" />
</div>
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 btn-right">
<oneit:button value="Pay and Open Job" name="updateCard" cssClass="btn btn-primary large-btn btn-green"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry("Company", company)
.toMap() %>" />
</div>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
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