private List<Customer> checkForOnlyBillableCustomers( UserCriteria userCriteria, List<Customer> customers) { List<Customer> billableCustomers = new ArrayList<Customer>(); LOGGER.debug("Finding on billable only: " + userCriteria.isOnlyBillableProjects()); if (userCriteria.isOnlyBillableProjects()) { for (Customer customer : customers) { List<Project> billableProjects; if (userCriteria.isOnlyActiveProjects()) { billableProjects = ProjectUtil.getBillableProjects(customer.getActiveProjects()); } else { billableProjects = ProjectUtil.getBillableProjects(customer.getProjects()); } if (!CollectionUtils.isEmpty(billableProjects)) { billableCustomers.add(customer); } } } else { return customers; } return billableCustomers; }
private List<Project> checkForOnlyBillableProjects( UserCriteria userCriteria, List<Project> projects) { if (userCriteria.isOnlyBillableProjects()) { projects = ProjectUtil.getBillableProjects(projects); } return projects; }