Commit 8992bf9b by Nilu

fix issue set up billing popup: if billing is managed by another team, it was showing the popup

parent 9932d318
......@@ -120,6 +120,12 @@ public class HiringTeam extends BaseHiringTeam
}
@Override
public Boolean getManageOwnBilling()
{
return isTrue(super.getManageOwnBilling());
}
public boolean hasValidCoupon() throws FieldException
{
if(getCoupon() != null)
......@@ -257,6 +263,9 @@ public class HiringTeam extends BaseHiringTeam
public boolean hasBillingSetup()
{
return getCardID() != null && getIsPPJ() != null && (getIsPPJ() || (!getIsPPJ() && getPaymentPlan() != null));
HiringTeam billingTeam = getManageOwnBilling() ? this : getBilledByTeam();
return billingTeam.getCardID() != null && billingTeam.getIsPPJ() != null &&
(billingTeam.getIsPPJ() || (!billingTeam.getIsPPJ() && billingTeam.getPaymentPlan() != null));
}
}
\ No newline at end of file
......@@ -46,6 +46,7 @@
CompanyUser companyUser = secUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
HiringTeam hiringTeam = companyUser.getSelectedTeam();
HiringTeam billingTeam = hiringTeam.getManageOwnBilling() ? hiringTeam : hiringTeam.getBilledByTeam();
SearchHome searchHome = (SearchHome) RunSearchExecutorFP.setupExecutor(request, SearchHome.REFERENCE_SearchHome, true);
Job[] allJobs = (Job[])process.getAttribute("allJobs");
RoleType userRole = companyUser.getRoleForHiringTeam(hiringTeam);
......@@ -220,7 +221,7 @@
</div>
</oneit:form>
<%
if(hiringTeam.getCardID() == null)
if(billingTeam.getCardID() == null)
{
%>
<oneit:form name="setupBilling" method="post" enctype="multipart/form-data">
......@@ -257,7 +258,7 @@
<%
}
else if(hiringTeam.getIsPPJ() == null || (!hiringTeam.getIsPPJ() && hiringTeam.getPaymentPlan() == null))
else if(billingTeam.getIsPPJ() == null || (!billingTeam.getIsPPJ() && billingTeam.getPaymentPlan() == null))
{
%>
......
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