/** @return a List of the CustomerInvoiceDetails associated with a given Account Number */ @SuppressWarnings("unchecked") public Collection<ContractsGrantsInvoiceDocument> filterContractsGrantsDocsAccordingToAward( Collection<ContractsGrantsInvoiceDocument> contractsGrantsInvoiceDocs, String awardDocumentNumber, java.sql.Date awardEndDate, String fundManager) { if (ObjectUtils.isNotNull(contractsGrantsInvoiceDocs) && !contractsGrantsInvoiceDocs.isEmpty()) { for (Iterator iter = contractsGrantsInvoiceDocs.iterator(); iter.hasNext(); ) { boolean considerAwardDocNumber = (ObjectUtils.isNotNull(awardDocumentNumber) && !StringUtils.isEmpty(awardDocumentNumber)) ? false : true; boolean considerFundMngr = (ObjectUtils.isNotNull(fundManager) && !StringUtils.isEmpty(fundManager)) ? false : true; boolean considerAwardEndDate = (ObjectUtils.isNotNull(awardEndDate)) ? false : true; ContractsGrantsInvoiceDocument document = (ContractsGrantsInvoiceDocument) iter.next(); considerAwardDocNumber = !considerAwardDocNumber ? awardDocumentNumber.equals(document.getAward().getAwardDocumentNumber()) : considerAwardDocNumber; considerAwardEndDate = !considerAwardEndDate ? awardEndDate.getTime() == document.getAward().getAwardEndingDate().getTime() : considerAwardEndDate; considerFundMngr = !considerFundMngr ? fundManager.equals( document.getAward().getAwardPrimaryFundManager().getPrincipalId()) : considerFundMngr; if (!(considerAwardDocNumber && considerFundMngr && considerAwardEndDate)) { iter.remove(); } } } return contractsGrantsInvoiceDocs; }
protected void getEmailParameterList( Map<String, String> primaryKeys, ContractsGrantsInvoiceDocument invoice, CustomerAddress customerAddress) { String[] orgCode = invoice .getAward() .getAwardPrimaryFundManager() .getFundManager() .getPrimaryDepartmentCode() .split("-"); Map<String, Object> key = new HashMap<String, Object>(); key.put(KFSPropertyConstants.ORGANIZATION_CODE, orgCode[0].trim()); key.put(KFSPropertyConstants.CHART_OF_ACCOUNTS_CODE, orgCode[1].trim()); Organization org = businessObjectService.findByPrimaryKey(Organization.class, key); primaryKeys.put( "grantNumber", returnProperStringValue(invoice.getAward().getProposal().getGrantNumber())); primaryKeys.put("proposalNumber", returnProperStringValue(invoice.getProposalNumber())); primaryKeys.put("invoiceNumber", returnProperStringValue(invoice.getDocumentNumber())); primaryKeys.put( "customerName", returnProperStringValue(customerAddress.getCustomer().getCustomerName())); primaryKeys.put( "addressName", returnProperStringValue(customerAddress.getCustomerAddressName())); primaryKeys.put( "name", returnProperStringValue( invoice.getAward().getAwardPrimaryFundManager().getFundManager().getName())); primaryKeys.put( "title", returnProperStringValue( invoice.getAward().getAwardPrimaryFundManager().getAwardFundManagerProjectTitle())); if (ObjectUtils.isNotNull(org)) { primaryKeys.put("department", returnProperStringValue(org.getOrganizationName())); } primaryKeys.put( "phone", returnProperStringValue( invoice.getAward().getAwardPrimaryFundManager().getFundManager().getPhoneNumber())); primaryKeys.put( "email", returnProperStringValue( invoice.getAward().getAwardPrimaryFundManager().getFundManager().getEmailAddress())); }