diff --git a/services/client_project_entities_dao/src/java/main/com/topcoder/clients/model/Client.java b/services/client_project_entities_dao/src/java/main/com/topcoder/clients/model/Client.java index 0d603ec39..5b3b666b5 100644 --- a/services/client_project_entities_dao/src/java/main/com/topcoder/clients/model/Client.java +++ b/services/client_project_entities_dao/src/java/main/com/topcoder/clients/model/Client.java @@ -112,7 +112,7 @@ public class Client extends AuditableEntity { *

*/ @Column(name = "enable_effort_hours") - private boolean enableEffortHours; + private Boolean enableEffortHours; /** *

@@ -381,7 +381,7 @@ public void setStartDate(Date startDate) { * * @return whether this client enabled effort hours. */ - public boolean isEffortHoursEnabled() { + public Boolean isEffortHoursEnabled() { return this.enableEffortHours; } @@ -391,7 +391,7 @@ public boolean isEffortHoursEnabled() { * @param enableEffortHours * whether this client enabled effort hours. */ - public void setEnableEffortHours(boolean enableEffortHours) { + public void setEnableEffortHours(Boolean enableEffortHours) { this.enableEffortHours = enableEffortHours; } } diff --git a/services/contest_service_facade/src/java/main/com/topcoder/service/facade/contest/ejb/ContestServiceFacadeBean.java b/services/contest_service_facade/src/java/main/com/topcoder/service/facade/contest/ejb/ContestServiceFacadeBean.java index 90c69f239..de0fb86e7 100644 --- a/services/contest_service_facade/src/java/main/com/topcoder/service/facade/contest/ejb/ContestServiceFacadeBean.java +++ b/services/contest_service_facade/src/java/main/com/topcoder/service/facade/contest/ejb/ContestServiceFacadeBean.java @@ -2470,45 +2470,45 @@ private SoftwareContestPaymentResult processContestSaleInternal(TCSubject tcSubj if (competition.getProjectHeader().getProjectCategory().getProjectType().getId() != ProjectType.STUDIO.getId()) { // software competition if (contest.getProperty(ProjectPropertyType.ADMIN_FEE_PROJECT_PROPERTY_KEY) != null - && !((String)contest.getProperty(ProjectPropertyType.ADMIN_FEE_PROJECT_PROPERTY_KEY)).equals("")) + && !(contest.getProperty(ProjectPropertyType.ADMIN_FEE_PROJECT_PROPERTY_KEY)).equals("")) { - totalFee += Double.parseDouble((String) contest.getProperty(ProjectPropertyType.ADMIN_FEE_PROJECT_PROPERTY_KEY)); + totalFee += Double.parseDouble(contest.getProperty(ProjectPropertyType.ADMIN_FEE_PROJECT_PROPERTY_KEY)); } if (contest.getProperty(ProjectPropertyType.FIRST_PLACE_COST_PROJECT_PROPERTY_KEY) != null - && !((String)contest.getProperty(ProjectPropertyType.FIRST_PLACE_COST_PROJECT_PROPERTY_KEY)).equals("")) + && !(contest.getProperty(ProjectPropertyType.FIRST_PLACE_COST_PROJECT_PROPERTY_KEY)).equals("")) { - totalFee += Double.parseDouble((String) contest.getProperty(ProjectPropertyType.FIRST_PLACE_COST_PROJECT_PROPERTY_KEY)); + totalFee += Double.parseDouble(contest.getProperty(ProjectPropertyType.FIRST_PLACE_COST_PROJECT_PROPERTY_KEY)); } if (contest.getProperty(ProjectPropertyType.SECOND_PLACE_COST_PROJECT_PROPERTY_KEY) != null - && !((String)contest.getProperty(ProjectPropertyType.SECOND_PLACE_COST_PROJECT_PROPERTY_KEY)).equals("")) + && !(contest.getProperty(ProjectPropertyType.SECOND_PLACE_COST_PROJECT_PROPERTY_KEY)).equals("")) { - totalFee += Double.parseDouble((String) contest.getProperty(ProjectPropertyType.SECOND_PLACE_COST_PROJECT_PROPERTY_KEY)); + totalFee += Double.parseDouble(contest.getProperty(ProjectPropertyType.SECOND_PLACE_COST_PROJECT_PROPERTY_KEY)); } if (contest.getProperty(ProjectPropertyType.CHECKPOINT_BONUS_COST_PROJECT_PROPERTY_KEY) != null - && !((String)contest.getProperty(ProjectPropertyType.CHECKPOINT_BONUS_COST_PROJECT_PROPERTY_KEY)).equals("")) + && !(contest.getProperty(ProjectPropertyType.CHECKPOINT_BONUS_COST_PROJECT_PROPERTY_KEY)).equals("")) { - totalFee += Double.parseDouble((String) contest.getProperty(ProjectPropertyType.CHECKPOINT_BONUS_COST_PROJECT_PROPERTY_KEY)); + totalFee += Double.parseDouble(contest.getProperty(ProjectPropertyType.CHECKPOINT_BONUS_COST_PROJECT_PROPERTY_KEY)); } if (contest.getProperty(ProjectPropertyType.REVIEW_COSTS_PROJECT_PROPERTY_KEY) != null - && !((String)contest.getProperty(ProjectPropertyType.REVIEW_COSTS_PROJECT_PROPERTY_KEY)).equals("")) + && !(contest.getProperty(ProjectPropertyType.REVIEW_COSTS_PROJECT_PROPERTY_KEY)).equals("")) { - totalFee += Double.parseDouble((String) contest.getProperty(ProjectPropertyType.REVIEW_COSTS_PROJECT_PROPERTY_KEY)); + totalFee += Double.parseDouble(contest.getProperty(ProjectPropertyType.REVIEW_COSTS_PROJECT_PROPERTY_KEY)); } if (contest.getProperty(ProjectPropertyType.SPEC_REVIEW_COSTS_PROJECT_PROPERTY_KEY) != null - && !((String)contest.getProperty(ProjectPropertyType.SPEC_REVIEW_COSTS_PROJECT_PROPERTY_KEY)).equals("")) + && !(contest.getProperty(ProjectPropertyType.SPEC_REVIEW_COSTS_PROJECT_PROPERTY_KEY)).equals("")) { - totalFee += Double.parseDouble((String) contest.getProperty(ProjectPropertyType.SPEC_REVIEW_COSTS_PROJECT_PROPERTY_KEY)); + totalFee += Double.parseDouble(contest.getProperty(ProjectPropertyType.SPEC_REVIEW_COSTS_PROJECT_PROPERTY_KEY)); } if (contest.getProperty(ProjectPropertyType.RELIABILITY_BONUS_COST_PROJECT_PROPERTY_KEY) != null - && !((String)contest.getProperty(ProjectPropertyType.RELIABILITY_BONUS_COST_PROJECT_PROPERTY_KEY)).equals("")) + && !(contest.getProperty(ProjectPropertyType.RELIABILITY_BONUS_COST_PROJECT_PROPERTY_KEY)).equals("")) { - totalFee += Double.parseDouble((String) contest.getProperty(ProjectPropertyType.RELIABILITY_BONUS_COST_PROJECT_PROPERTY_KEY)); + totalFee += Double.parseDouble(contest.getProperty(ProjectPropertyType.RELIABILITY_BONUS_COST_PROJECT_PROPERTY_KEY)); } // checkpoint prizes @@ -2523,21 +2523,21 @@ private SoftwareContestPaymentResult processContestSaleInternal(TCSubject tcSubj // studio competition if (contest.getProperty(ProjectPropertyType.ADMIN_FEE_PROJECT_PROPERTY_KEY) != null - && !((String)contest.getProperty(ProjectPropertyType.ADMIN_FEE_PROJECT_PROPERTY_KEY)).equals("")) + && !(contest.getProperty(ProjectPropertyType.ADMIN_FEE_PROJECT_PROPERTY_KEY)).equals("")) { - totalFee += Double.parseDouble((String) contest.getProperty(ProjectPropertyType.ADMIN_FEE_PROJECT_PROPERTY_KEY)); + totalFee += Double.parseDouble(contest.getProperty(ProjectPropertyType.ADMIN_FEE_PROJECT_PROPERTY_KEY)); } if (contest.getProperty(ProjectPropertyType.SPEC_REVIEW_COSTS_PROJECT_PROPERTY_KEY) != null - && !((String)contest.getProperty(ProjectPropertyType.SPEC_REVIEW_COSTS_PROJECT_PROPERTY_KEY)).equals("")) + && !(contest.getProperty(ProjectPropertyType.SPEC_REVIEW_COSTS_PROJECT_PROPERTY_KEY)).equals("")) { - totalFee += Double.parseDouble((String) contest.getProperty(ProjectPropertyType.SPEC_REVIEW_COSTS_PROJECT_PROPERTY_KEY)); + totalFee += Double.parseDouble(contest.getProperty(ProjectPropertyType.SPEC_REVIEW_COSTS_PROJECT_PROPERTY_KEY)); } if (contest.getProperty(ProjectPropertyType.REVIEW_COSTS_PROJECT_PROPERTY_KEY) != null - && !((String)contest.getProperty(ProjectPropertyType.REVIEW_COSTS_PROJECT_PROPERTY_KEY)).equals("")) + && !(contest.getProperty(ProjectPropertyType.REVIEW_COSTS_PROJECT_PROPERTY_KEY)).equals("")) { - totalFee += Double.parseDouble((String) contest.getProperty(ProjectPropertyType.REVIEW_COSTS_PROJECT_PROPERTY_KEY)); + totalFee += Double.parseDouble(contest.getProperty(ProjectPropertyType.REVIEW_COSTS_PROJECT_PROPERTY_KEY)); } for (Prize prize : competition.getProjectHeader().getPrizes()) { @@ -2567,7 +2567,10 @@ private SoftwareContestPaymentResult processContestSaleInternal(TCSubject tcSubj double totalCost = totalFee; double totalMemberCost = totalFee; - totalMemberCost = totalMemberCost - Double.parseDouble((String) contest.getProperty(ProjectPropertyType.ADMIN_FEE_PROJECT_PROPERTY_KEY)); + String adminFee = contest.getProperty(ProjectPropertyType.ADMIN_FEE_PROJECT_PROPERTY_KEY); + if (adminFee != null && adminFee.trim().length() != 0) { + totalMemberCost = totalMemberCost - Double.parseDouble(adminFee); + } if (paymentData instanceof TCPurhcaseOrderPaymentData) { @@ -5956,7 +5959,7 @@ public SoftwareCompetition getSoftwareContestByProjectId(TCSubject tcSubject, lo try { Client client = projectService.getClientByProject(fullProjectData.getProjectHeader().getTcDirectProjectId()); if (client != null) { - effortHoursEnabled = client.isEffortHoursEnabled(); + effortHoursEnabled = client.isEffortHoursEnabled() == null ? false : client.isEffortHoursEnabled(); } } catch (PersistenceFault e) { diff --git a/services/project_services/src/java/main/com/topcoder/project/service/impl/ProjectServicesImpl.java b/services/project_services/src/java/main/com/topcoder/project/service/impl/ProjectServicesImpl.java index 56a2b9eb9..db3b0e5fc 100644 --- a/services/project_services/src/java/main/com/topcoder/project/service/impl/ProjectServicesImpl.java +++ b/services/project_services/src/java/main/com/topcoder/project/service/impl/ProjectServicesImpl.java @@ -247,7 +247,7 @@ * Changes in v1.4.4 (TC Direct Release Assembly 7) * - add method updateContestSale for updating contest sale. *

- * + * *

* Version 1.4.4 (TC Direct Replatforming Release 1) Change notes: *

*

- * + * *

* Version 1.4.5 (TC Direct Replatforming Release 2) Change notes: *