gt: 					&& awardComment.getCommentTypeCode().equals(IDC_COMMENT)) {
context: /*
   * Kuali Coeus, a comprehensive research administration system for higher education.
   * 
   * Copyright 2005-2016 Kuali, Inc.
   * 
   * This program is free software: you can redistribute it and/or modify
   * it under the terms of the GNU Affero General Public License as
   * published by the Free Software Foundation, either version 3 of the
   * License, or (at your option) any later version.
   * 
   * This program is distributed in the hope that it will be useful,
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   * GNU Affero General Public License for more details.
   * 
   * You should have received a copy of the GNU Affero General Public License
   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
   */
  package org.kuali.kra.award.printing.xmlstream;
  
  import org.apache.commons.lang3.StringUtils;
  import org.apache.commons.logging.Log;
  import org.apache.commons.logging.LogFactory;
  import org.kuali.coeus.common.framework.person.KcPerson;
  import org.kuali.coeus.common.framework.print.stream.xml.XmlStream;
  import org.kuali.coeus.common.framework.print.util.PrintingUtils;
  import org.kuali.coeus.common.framework.rolodex.Rolodex;
  import org.kuali.coeus.common.framework.sponsor.Sponsor;
  import org.kuali.coeus.common.framework.sponsor.term.SponsorTermType;
  import org.kuali.coeus.common.framework.type.ActivityType;
  import org.kuali.coeus.common.framework.unit.admin.UnitAdministrator;
  import org.kuali.coeus.common.framework.unit.admin.UnitAdministratorType;
  import org.kuali.coeus.propdev.impl.core.ProposalDevelopmentDocument;
  import org.kuali.kra.award.awardhierarchy.AwardHierarchy;
  import org.kuali.kra.award.budget.document.AwardBudgetDocument;
  import org.kuali.kra.award.commitments.AwardCostShare;
  import org.kuali.kra.award.contacts.AwardPerson;
  import org.kuali.kra.award.contacts.AwardPersonUnit;
  import org.kuali.kra.award.contacts.AwardSponsorContact;
  import org.kuali.kra.award.contacts.AwardUnitContact;
  import org.kuali.kra.award.document.AwardDocument;
  import org.kuali.kra.award.home.*;
  import org.kuali.kra.award.home.AwardAmountInfo;
  import org.kuali.kra.award.home.AwardType;
  import org.kuali.kra.award.home.approvedsubawards.AwardApprovedSubaward;
  import org.kuali.kra.award.home.fundingproposal.AwardFundingProposal;
  import org.kuali.kra.award.home.keywords.AwardScienceKeyword;
  import org.kuali.kra.award.paymentreports.awardreports.AwardReportTerm;
  import org.kuali.kra.award.paymentreports.awardreports.AwardReportTermRecipient;
  import org.kuali.kra.award.paymentreports.closeout.AwardCloseout;
  import org.kuali.kra.award.paymentreports.paymentschedule.AwardPaymentSchedule;
  import org.kuali.kra.award.paymentreports.specialapproval.approvedequipment.AwardApprovedEquipment;
  import org.kuali.kra.award.paymentreports.specialapproval.foreigntravel.AwardApprovedForeignTravel;
  import org.kuali.kra.award.specialreview.AwardSpecialReview;
  import org.kuali.kra.bo.*;
  import org.kuali.coeus.common.framework.costshare.CostShareService;
  import org.kuali.kra.printing.schema.*;
  import org.kuali.kra.printing.schema.AwardNoticeDocument.AwardNotice;
  import org.kuali.kra.printing.schema.AwardNoticeDocument.AwardNotice.AODetails;
  import org.kuali.kra.printing.schema.AwardNoticeDocument.AwardNotice.PrintRequirement;
  import org.kuali.kra.printing.schema.AwardType.*;
  import org.kuali.kra.printing.schema.AwardType.AwardContacts.ContactDetails;
  import org.kuali.kra.printing.schema.AwardType.AwardCostSharing.CostSharingItem;
  import org.kuali.kra.printing.schema.AwardType.AwardDetails.OtherHeaderDetails;
  import org.kuali.kra.printing.schema.AwardType.AwardFundingProposals.FundingProposal;
  import org.kuali.kra.printing.schema.AwardType.AwardIndirectCosts.IndirectCostSharingItem;
  import org.kuali.kra.printing.schema.AwardType.AwardPaymentSchedules.PaymentSchedule;
  import org.kuali.kra.printing.schema.AwardType.AwardSpecialItems.Equipment;
  import org.kuali.kra.printing.schema.AwardType.AwardSpecialItems.ForeignTravel;
  import org.kuali.kra.printing.schema.AwardType.AwardSpecialItems.Subcontract;
  import org.kuali.kra.printing.schema.AwardType.AwardTransferringSponsors.TransferringSponsor;
  import org.kuali.kra.printing.schema.AwardType.AwardCloseOutDeadlines;
  import org.kuali.kra.printing.schema.AwardType.AwardCloseOutDeadlines.CloseOutDeadlines;
  import org.kuali.kra.printing.schema.SpecialReviewType;
  import org.kuali.rice.core.api.datetime.DateTimeService;
  import org.kuali.coeus.sys.api.model.ScaleTwoDecimal;
  import org.kuali.rice.coreservice.framework.parameter.ParameterService;
  import org.kuali.rice.kew.api.exception.WorkflowException;
  import org.kuali.rice.krad.data.DataObjectService;
  import org.kuali.rice.krad.service.BusinessObjectService;
  import org.kuali.rice.krad.service.DocumentService;
  import org.kuali.rice.location.api.country.Country;
  import org.kuali.rice.location.api.state.State;
  
  import java.math.BigDecimal;
  import java.util.*;
  
  /**
   * This class will contain all common methods that can be used across all XML
   * generator streams related to Award. All award report XML stream
   * implementations need to extend and use the functions defined in this class.
   */
  public abstract class AwardBaseStream implements XmlStream {
  
  	private static final String INVOICE_INSTRUCTIONS_COMMENT_TYPE_CODE = "1";
      private static final String NOT_PRESENT_INDICATOR = "N";
      private static final String PRESENT_INDICATOR = "P";
      protected static final String OBLIGATED_DIRECT_INDIRECT_COST_CONSTANT = "ENABLE_AWD_ANT_OBL_DIRECT_INDIRECT_COST";
  	private static final String ON_CAMPUS_FLAG_SET = "N";
  	private static final Log LOG = LogFactory.getLog(AwardBaseStream.class);
  	private static final String NSF_CODE_PARAMETER = "nsfCode";
  	private static final String STRING_SEPARATER = ",";
      protected static final String OTHER_DATA = "otherData";
  	protected static final String SIGNATURE_REQUIRED = "signatureRequired";
  	protected static final String COMMENT_TYPE_CODE_PARAMETER = "commentTypeCode";
  	protected static final String ACTIVITY_TYPE_CODE_PARAMETER = "code";
  	protected static final String ACCOUNT_TYPE_CODE_PARAMETER = "accountTypeCode";
  	protected static final String REQUIRED = "1";
  	protected static final String NOT_REQUIRED = "0";
  	protected static final String START_ASTERISK_SPACE_INDICATOR = "* ";
  	protected static final String END_ASTERISK_SPACE_INDICATOR = " *";
  	protected static final String FELLOWSHIP_ADMIN_NAME = "FELLOWSHIP_OSP_ADMIN";
  	private static final String SCHOOL_NAME = "SCHOOL_NAME";
  	private static final String SCHOOL_ACRONYM = "SCHOOL_ACRONYM";
  	protected static final String EMPTY_STRING = "";
  	protected static final String INDICATOR_CONSTANT = "1";
  	protected static final String SPONSOR_CODE_DELETED_INDICATOR = "DELETED - ";
  	protected static final String SPONSOR_CODE_ADDED_INDICATOR = "ADDED - ";
  	protected static final String SEQUENCE_NUMBER_PARAMETER = "sequenceNumber";
  	protected static final String AWARD_NUMBER_PARAMETER = "awardNumber";
  	protected static final String ROOT_AWARD_NUMBER_PARAMETER = "rootAwardNumber";
  	protected static final String COST_SHARING_COMMENT = "9";
  	protected static final String IDC_COMMENT = "8";
  	protected static final String CURRENT_ACTION_COMMENT = "21";
  	protected static final String COMMA_STRING = ", ";
  	protected static final String EMPTY_SPACE = " ";
  	protected static final String DOCUMENT_NUMBER = "documentNumber";
  	protected AwardDocument awardDocument = null;
  	protected Award award = null;
  
  	protected AwardAmountInfo awardAmountInfo = null;
  	protected Award prevAward = null;
  	protected AwardAmountInfo prevAwardAmountInfo = null;
  	protected BusinessObjectService businessObjectService = null;
      protected DataObjectService dataObjectService = null;
      private DocumentService documentService = null;
  	protected DateTimeService dateTimeService = null;
  	private ParameterService parameterService;
  	private CostShareService costShareService;
  
  	protected abstract PrintRequirement getPrintRequirement(
  			Map<String, Object> reportParameters);
  
  	protected org.kuali.kra.printing.schema.AwardType getAward() {
  		org.kuali.kra.printing.schema.AwardType awardType = org.kuali.kra.printing.schema.AwardType.Factory
  				.newInstance();	
  		awardType.setAwardDetails(getAwardDetails());
  		awardType.setAwardInvestigators(getAwardInvestigators());
  		awardType.setAwardKeyPersons(getKeyPersons());
  		awardType.setAwardComments(getAwardComments());
  		awardType.setAwardAmountInfo(getAwardAmountInfo());
  		awardType.setAwardTransactionInfo(getAwardTransactionInfo());
  		awardType.setAwardScienceCodes(getAwardScienceCodes());		
  		awardType.setAwardTermsDetails(getAwardTermsDetails());
  		awardType.setAwardReportingDetails(getAwardReportingDetails());
  		awardType.setAwardSpecialItems(getAwardSpecialItems());
  		awardType.setAwardCostSharing(getAwardCostSharing());
  		awardType.setAwardIndirectCosts(getAwardIndirectCosts());
  		awardType.setAwardCloseOutDeadlines(getAwardCloseOutDeadlines());
  		awardType.setAwardContacts(getAwardContacts());
  		awardType.setAwardFundingProposals(getAwardFundingProposals());
  		return awardType;
  	}
  
  	/*
  	 * This method will set the values to award notice attributes and finally
  	 * returns award notice Xml Object
  	 */
  	protected AwardNotice getAwardNotice(Map<String, Object> reportParameters) {
  		AwardNotice awardNotice = AwardNotice.Factory.newInstance();
  		awardNotice.setSchoolInfo(getSchoolInfoType());
  		awardNotice.setAwardDisclosure(getAwardDisclosureType());
  		awardNotice.setAward(getAward());
  		awardNotice.setAODetails(getAODetailsType());
  		awardNotice.setPrintRequirement(getPrintRequirement(reportParameters));
  		return awardNotice;
  	}
  
  	/**
  	 * <p>
  	 * This method will set the values to school info attributes and finally
  	 * returns SchoolInfoType XmlObject
  	 * </p>
  	 * 
  	 * @return returns SchoolInfoType XmlObject
  	 */
  	protected SchoolInfoType2 getSchoolInfoType() {
  		SchoolInfoType2 schoolInfoType = SchoolInfoType2.Factory.newInstance();
  		try {
  			String schoolName = getProposalParameterValue(SCHOOL_NAME);
  			String schoolAcronym = getProposalParameterValue(SCHOOL_ACRONYM);
  			if (schoolName != null) {
  				schoolInfoType.setSchoolName(schoolName);
  			}
  			if (schoolAcronym != null) {
  				schoolInfoType.setAcronym(schoolAcronym);
  			}
  		} catch (Exception e) {
  			// LOg e
  		}
  		return schoolInfoType;
  	}
  
  	private String getProposalParameterValue(String param) {
          return parameterService.getParameterValueAsString(ProposalDevelopmentDocument.class, param);
      }
  
      /**
  	 * <p>
  	 * This method will set the values to Award Disclosure attributes and
  	 * finally returns AwardDisclosureType XmlObject
  	 * </p>
  	 * 
  	 * @return returns AwardDisclosureType XmlObject
  	 */
  	protected AwardDisclosureType getAwardDisclosureType() {
  		AwardDisclosureType awardDisclosureType = AwardDisclosureType.Factory
  				.newInstance();
  		AwardHeaderType awardHeaderType = getAwardHeaderType();
  		awardDisclosureType.setAwardHeader(awardHeaderType);
  		DisclosureItemType[] disclosureItemTypes = getDisclosureItems();
  		awardDisclosureType.setDisclosureItemArray(disclosureItemTypes);
  		return awardDisclosureType;
  	}
  
  	/**
  	 * <p>
  	 * This method will set the values the payment schedule XmlObject and return
  	 * it
  	 * </p>
  	 * 
  	 * @param awardPaymentSchedule
  	 *            it contains information about payment schedule {@link
  	 *            AwardPaymentSchedule}
  	 * @return paymentSchedule XmlObject
  	 */
  	protected PaymentSchedule getAwardPaymentSchedule(
  			AwardPaymentSchedule awardPaymentSchedule) {
  		PaymentSchedule paymentSchedule = PaymentSchedule.Factory.newInstance();
  		if (awardPaymentSchedule.getAwardNumber() != null) {
  			paymentSchedule.setAwardNumber(awardPaymentSchedule
  					.getAwardNumber());
  		}
  		if (awardPaymentSchedule.getSequenceNumber() != null) {
  			paymentSchedule.setSequenceNumber(awardPaymentSchedule
  					.getSequenceNumber());
  		}
  		Calendar dueDate = getDueDate(awardPaymentSchedule);
  		if (dueDate != null) {
  			paymentSchedule.setDueDate(dueDate);
  		}
  		if (awardPaymentSchedule.getAmount() != null) {
  			paymentSchedule.setAmount(awardPaymentSchedule.getAmount()
  					.bigDecimalValue());
  		}
  		Calendar submitDate = getSubmitDate(awardPaymentSchedule);
  		if (submitDate != null) {
  			paymentSchedule.setSubmitDate(submitDate);
  		}
  		if (awardPaymentSchedule.getSubmittedBy() != null) {
  			paymentSchedule.setSubmittedBy(awardPaymentSchedule
  					.getSubmittedBy());
  		}
  		if (awardPaymentSchedule.getInvoiceNumber() != null) {
  			paymentSchedule.setInvoiceNumber(awardPaymentSchedule
  					.getInvoiceNumber());
  		}
  		if (awardPaymentSchedule.getStatusDescription() != null) {
  			paymentSchedule.setStatusDescription(awardPaymentSchedule
  					.getStatusDescription());
  		}
  		return paymentSchedule;
  	}
  
      /**
       * <p>
       * This method will set the values to transferring sponsor XmlObject and
       * return it
       * </p>
       * 
       * @param awardTransferringSponsor
       *            it contains information about the award transferring sponsor
       *            {@link AwardTransferringSponsor}
       * @return awardTransferringSponsor xmlObject
       */
      protected TransferringSponsor getAwardTransferringSponsor(
              AwardTransferringSponsor awardTransferringSponsor) {
          TransferringSponsor transferringSponsor = TransferringSponsor.Factory
                  .newInstance();
          if (awardTransferringSponsor.getAwardNumber() != null) {
              transferringSponsor.setAwardNumber(awardTransferringSponsor
                      .getAwardNumber());
          }
          if (awardTransferringSponsor.getSequenceNumber() != null) {
              transferringSponsor.setSequenceNumber(awardTransferringSponsor
                      .getSequenceNumber());
          }
          if (awardTransferringSponsor.getSponsorCode() != null) {
              transferringSponsor.setSponsorCode(awardTransferringSponsor.getSponsorCode());
          }
          Sponsor sponsor = awardTransferringSponsor.getSponsor();
          if (sponsor != null && sponsor.getSponsorName() != null) {
              transferringSponsor.setSponsorDescription(sponsor.getSponsorName());
          }
          return transferringSponsor;
      }
  
  	/**
  	 * <p>
  	 * This method will set the values to award Special Review XmlObject and
  	 * return it
  	 * </p>
  	 * 
  	 * @param awardSpecialReview
  	 *            it contains information about the award Special Review {@link
  	 *            AwardSpecialReview}
  	 * @return awardSpecialReview XmlObject
  	 */
  	protected SpecialReviewType getAwardSpecialReview(
  			AwardSpecialReview awardSpecialReview) {
  		SpecialReviewType specialReviewType = SpecialReviewType.Factory
  				.newInstance();
  		if (award.getAwardNumber() != null) {
  			specialReviewType.setAwardNumber(award.getAwardNumber());
  		}
  		if (awardSpecialReview.getSequenceNumber() != null) {
  			specialReviewType.setSequenceNumber(awardSpecialReview
  					.getSequenceNumber());
  		}
  		if (awardSpecialReview.getSpecialReviewTypeCode() != null) {
  			specialReviewType.setReviewType(Integer.valueOf(awardSpecialReview.getSpecialReviewTypeCode()));
  		}
          if (awardSpecialReview.getApprovalTypeCode() != null) {
              specialReviewType.setApprovalType(Integer.parseInt(awardSpecialReview.getApprovalTypeCode()));
              awardSpecialReview.refreshReferenceObject("specialReviewApprovalType");
              if(awardSpecialReview.getApprovalType()!=null){
                  specialReviewType.setApprovalTypeDesc(awardSpecialReview.getApprovalType().getDescription());
              }
          }
  		if (awardSpecialReview.getApprovalTypeCode() != null) {
  			specialReviewType.setApprovalType(Integer.valueOf(awardSpecialReview.getApprovalTypeCode()));
  		}
  		if (awardSpecialReview.getComments() != null) {
  			specialReviewType.setComments(awardSpecialReview.getComments());
  		}
  		if (awardSpecialReview.getProtocolNumber() != null) {
  			specialReviewType.setProtocolNumber(awardSpecialReview.getProtocolNumber());
  		}
  		awardSpecialReview.refreshReferenceObject("specialReview");
  		if (awardSpecialReview.getSpecialReviewType() != null
  				&& awardSpecialReview.getSpecialReviewType().getDescription() != null) {
  			specialReviewType.setReviewTypeDesc(awardSpecialReview.getSpecialReviewType().getDescription());
  		}
  		Calendar applicationDate = getApplicationDate(awardSpecialReview);
  		if (applicationDate != null) {
  			specialReviewType.setApplicationDate(applicationDate);
  		}
  		Calendar approvalDate = getApprovalDate(awardSpecialReview);
  		if (approvalDate != null) {
  			specialReviewType.setApprovalDate(approvalDate);
  		}
  		return specialReviewType;
  	}
  
  	/**
  	 * <p>
  	 * This method will set the values to Award Header attributes and finally
  	 * returns AwardHeaderType XmlObject
  	 * </p>
  	 * 
  	 * @return returns AwardHeaderType XmlObject
  	 */
  	protected AwardHeaderType getAwardHeaderType() {
  		AwardHeaderType awardHeaderType = AwardHeaderType.Factory.newInstance();
  		if (award.getAwardNumber() != null) {
  			awardHeaderType.setAwardNumber(award.getAwardNumber());
  		}
  		if (award.getSequenceNumber() != null) {
  			awardHeaderType.setSequenceNumber(award.getSequenceNumber());
  		}
  		if (award.getAccountNumber() != null) {
  			awardHeaderType.setAccountNumber(award.getAccountNumber());
  		}
  		if (award.getStatusCode() != null) {
  			awardHeaderType
  					.setStatusCode(String.valueOf(award.getStatusCode()));
  		}
  		if (award.getStatusDescription() != null) {
  			if (prevAward != null && prevAward.getStatusDescription() != null) {
  				String CurrAwardStatus = award.getStatusDescription();
  				String prevAwardStatus = prevAward.getStatusDescription();
  				String awardStatusMod = getModAwardStatus(CurrAwardStatus,
  						prevAwardStatus);
  				if (awardStatusMod != null) {
  					awardHeaderType.setStatusDescription(awardStatusMod);
  				}
  			} else {
  				awardHeaderType.setStatusDescription(award.getStatusDescription());
  			}	
  		}	
  		if (award.getSponsorCode() != null) {
  			awardHeaderType.setSponsorCode(award.getSponsorCode());
  		}
  		String sponsorDesc = getSponsorDescription();
  		if (sponsorDesc != null) {
  			awardHeaderType.setSponsorDescription(sponsorDesc);
  		}
  		String sponosorAwardnumber = getSponsorAwardNumber();
  		if (sponosorAwardnumber != null) {
  			awardHeaderType.setSponsorAwardNumber(sponosorAwardnumber);
  		}
  		if (award.getModificationNumber() != null) {
  			awardHeaderType
  					.setModificationNumber(award.getModificationNumber());			
  		}
  		if (award.getNsfCode() != null) {
  			awardHeaderType.setNSFCode(award.getNsfCode());
  		}
  		String nsfDescription = getNSFDescription(award.getNsfCode());
  		if (nsfDescription != null) {
  			awardHeaderType.setNSFDescription(nsfDescription);
  		}
  		if (award.getPrincipalInvestigatorName() != null) {
  			awardHeaderType.setPIName(award.getPrincipalInvestigatorName());
  		}
  		if (award.getTitle() != null) {
  			if (prevAward != null && prevAward.getTitle() != null) {
  				String awardTitle = award.getTitle();
  				String prevAwardTitle = prevAward.getTitle();
  				String awardTitleMod = getModAwardTitle(awardTitle,
  						prevAwardTitle);
  				if (awardTitleMod != null) {
  					awardHeaderType.setTitle(awardTitleMod);
  				}
  			} else {
  				awardHeaderType.setTitle(award.getTitle());
  			}	
  		}
  		return awardHeaderType;
  	}
  	
  	
  	/*
  	 * This method will get the title based on if previous award type
  	 * title is equal to null or not equal to award award title
  	 * Otherwise returns * (Asterisk)
  	 */
  	private String getModAwardTitle(String awardTitle,
  			String prevAwardTitle) {
  		String awardTitleMod = null;
  		if (awardTitle != null) {
  			if (prevAwardTitle == null
  					|| !awardTitle.equals(prevAwardTitle)) {
  				awardTitleMod = new StringBuilder(awardTitle).append(
  						END_ASTERISK_SPACE_INDICATOR).toString();
  
  			} else {
  				awardTitleMod = awardTitle;
  			}
  		} else if (prevAwardTitle != null) {
  
  			awardTitleMod = START_ASTERISK_SPACE_INDICATOR;
  		}
  		return awardTitleMod;
  	}
  	
  	/*
  	 * This method will get the previous status
  	 * status is equal to null or not equal to award award status
  	 * Otherwise returns * (Asterisk)
  	 */
  	private String getModAwardStatus(String CurrAwardStatus,
  			String prevAwardStatus) {
  		String awardStatusMod = null;
  		if (CurrAwardStatus != null) {
  			if (prevAwardStatus == null
  					|| !CurrAwardStatus.equals(prevAwardStatus)) {
  				awardStatusMod = new StringBuilder(CurrAwardStatus).append(
  						END_ASTERISK_SPACE_INDICATOR).toString();
  				} else {
  				awardStatusMod = CurrAwardStatus;
  			}
  		} else if (prevAwardStatus != null) {
  	    awardStatusMod = START_ASTERISK_SPACE_INDICATOR;
  		}
  		return awardStatusMod;
  	}
  	
  
  	/**
  	 * <p>
  	 * This method will set the values to Award Reporting Details attributes and
  	 * finally returns AwardReportingDetails XmlObject
  	 * </p>
  	 * 
  	 * @return returns AwardHeaderType XmlObject
  	 */
  	protected AwardReportingDetails getAwardReportingDetails() {
  		AwardReportingDetails awardReportingDetails = AwardReportingDetails.Factory.newInstance();
  		String reportClassCode = null;
  		ReportTermType2 reportTermType = null;
  		for (AwardReportTerm awardReportTerm : award.getAwardReportTermItems()) {
  		    if(reportClassCode==null || !reportClassCode.equals(awardReportTerm.getReportClassCode())){
  		        reportTermType = awardReportingDetails.addNewReportDetails();
  		    }
  		    reportClassCode = awardReportTerm.getReportClassCode();
  			getAwardReportTermBean(awardReportTerm,reportTermType);
  			if (awardReportTerm.getReportClass() != null) {
  				String reportTermTypeDescription = awardReportTerm
  						.getReportClass().getDescription();
  				if (reportTermTypeDescription != null) {
  					reportTermType.setDescription(reportTermTypeDescription);
  				}
  			}
  		}
  		return awardReportingDetails;
  	}
  
  	/**
  	 * <p>
  	 * This method will set the values to AO Details attributes and finally
  	 * returns AODetails XmlObject
  	 * </p>
  	 * 
  	 * @return returns AODetails XmlObject
  	 */
  	protected AODetails getAODetailsType() {
  
  		final Optional<KcPerson> person = award.getCentralAdminContacts().stream()
  				.filter(contact -> contact.getUnitAdministratorType().getCode().equals(UnitAdministratorType.ADMINISTRATIVE_OFFICER_TYPE_CODE))
  				.map(AwardUnitContact::getPerson)
  				.findAny();
  
  		final AODetails aODetailsType = AODetails.Factory.newInstance();
  		if (person.isPresent()) {
  			if (person.get().getOfficeLocation() != null) {
  				aODetailsType.setAOAddress(person.get().getOfficeLocation());
  			}
  			if (person.get().getFullName() != null) {
  				aODetailsType.setAOName(person.get().getFullName());
  			}
  		}
  		return aODetailsType;
  	}
  
  	/**
  	 * <p>
  	 * This method will set the values to Award Funding Proposals attributes and
  	 * finally returns AwardFundingProposals XmlObject
  	 * </p>
  	 * 
  	 * @return returns AwardFundingProposals XmlObject
  	 */
  	protected AwardFundingProposals getAwardFundingProposals() {
  		AwardFundingProposals awardFundingProposals = AwardFundingProposals.Factory
  				.newInstance();
  		List<FundingProposal> fundingProposals = new ArrayList<FundingProposal>();
  		for (AwardFundingProposal awardFundingProposal : award
  				.getFundingProposals()) {
  			FundingProposal fundingProposal = FundingProposal.Factory
  					.newInstance();
  			fundingProposal.setAwardNumber(award.getAwardNumber());
  			fundingProposal.setSequenceNumber(award.getSequenceNumber());
  			if (awardFundingProposal.getProposal() != null) {
  				fundingProposal.setProposalNumber(awardFundingProposal
  						.getProposal().getProposalNumber());
  
  				fundingProposal.setProposalSequenceNumber(awardFundingProposal
  						.getProposal().getSequenceNumber());
  				fundingProposal.setProopsalTypeCode(awardFundingProposal
  						.getProposal().getProposalTypeCode());
  				if (awardFundingProposal.getProposal().getProposalType() != null) {
  					fundingProposal
  							.setProposalTypeDescription(awardFundingProposal
  									.getProposal().getProposalType()
  									.getDescription());
  				}
  				fundingProposal.setProposalStatusCode(awardFundingProposal
  						.getProposal().getStatusCode());
  				if (awardFundingProposal.getProposal()
  						.getRequestedStartDateTotal() != null) {
  					fundingProposal.setRequestedStartDateTotal(dateTimeService
  							.getCalendar(awardFundingProposal.getProposal()
  									.getRequestedStartDateTotal()));
  				}
  				if(awardFundingProposal.getProposal()
  						.getRequestedEndDateTotal()!=null){
  				fundingProposal.setRequestedEndDateTotal(dateTimeService
  						.getCalendar(awardFundingProposal.getProposal()
  								.getRequestedEndDateTotal()));
  				}
  				if (awardFundingProposal.getProposal()
  						.getTotalDirectCostTotal() != null) {
  					fundingProposal.setDirectCostTotal(awardFundingProposal
  							.getProposal().getTotalDirectCostTotal()
  							.bigDecimalValue());
  				}
  				if (awardFundingProposal.getProposal()
  						.getTotalIndirectCostTotal() != null) {
  					fundingProposal.setIndirectCostTotal(awardFundingProposal
  							.getProposal().getTotalIndirectCostTotal()
  							.bigDecimalValue());
  				}
  			}
  			fundingProposals.add(fundingProposal);
  		}
  		awardFundingProposals.setFundingProposalArray(fundingProposals
  				.toArray(new FundingProposal[0]));
  		return awardFundingProposals;
  	}
  
  	/**
  	 * <p>
  	 * This method will set the values to Award Contacts attributes and finally
  	 * returns AwardContacts XmlObject
  	 * </p>
  	 * 
  	 * @return returns AwardContacts XmlObject
  	 */
  	protected AwardContacts getAwardContacts() {
  		AwardContacts awardContacts = AwardContacts.Factory.newInstance();
  		List<AwardSponsorContact> awardSponsorContacts = award
  				.getSponsorContacts();
  		for (AwardSponsorContact awardSponsorContact : awardSponsorContacts) {
  		    ContactDetails contactDetails = awardContacts.addNewContactDetails();
  			if (award.getAwardNumber() != null) {
  				contactDetails.setAwardNumber(award.getAwardNumber());
  			}
  			if (award.getSequenceNumber() != null) {
  				contactDetails.setSequenceNumber(award.getSequenceNumber());
  			}
  			if (awardSponsorContact.getContactRoleCode() != null) {
  				contactDetails.setContactType(Integer
  						.valueOf(awardSponsorContact.getContactRoleCode()));
  			}
  			if (awardSponsorContact.getContactOrganizationName() != null) {
  				contactDetails.setContactTypeDesc(awardSponsorContact
  						.getContactRole().getRoleDescription());	
  			}
  			contactDetails
  					.setRolodexDetails(getRolodexDetails(awardSponsorContact));
  		}
  		return awardContacts;
  	}
  
  	/**
  	 * <p>
  	 * This method will get the approval date {@link Calendar} from award
  	 * special review
  	 * </p>
  	 * 
  	 * @param awardSpecialReview
  	 *            it contains information about award special review {@link
  	 *            AwardSpecialReview}
  	 * @return approval date{@link Calendar}if it found in award special
  	 *         review otherwise null
  	 */
  	protected Calendar getApprovalDate(AwardSpecialReview awardSpecialReview) {
  		Calendar approvalDate = null;
  		if (awardSpecialReview.getApprovalDate() != null) {
  			approvalDate = dateTimeService.getCalendar(awardSpecialReview
  					.getApprovalDate());
  		}
  		return approvalDate;
  	}
  
  	/**
  	 * <p>
  	 * This method will get the application {@link Calendar} from award special
  	 * review
  	 * </p>
  	 * 
  	 * @param awardSpecialReview
  	 *            it contains information about award special review {@link
  	 *            AwardSpecialReview}
  	 * @return application date{@link Calendar}if it found in award special
  	 *         review otherwise null
  	 */
  	protected Calendar getApplicationDate(AwardSpecialReview awardSpecialReview) {
  		Calendar applicationDate = null;
  		if (awardSpecialReview.getApplicationDate() != null) {
  			applicationDate = dateTimeService.getCalendar(awardSpecialReview
  					.getApplicationDate());
  		}
  		return applicationDate;
  	}
  
  	/**
  	 * <p>
  	 * This method will set the values to CloseOut Deadlines attributes and
  	 * finally returns CloseOut Deadlines XmlObject
  	 * </p>
  	 * 
  	 * @return returns CloseOut Deadlines XmlObject
  	 */
  	protected AwardCloseOutDeadlines getAwardCloseOutDeadlines() {
  		AwardCloseOutDeadlines awardcloseOutDeadlines = AwardCloseOutDeadlines.Factory.newInstance();
  		
  
  		List<AwardCloseout> awardCloseoutItems = award.getAwardCloseoutItems();
  		AwardCloseout preAwardCloseout = null;
  		if (prevAward != null && !prevAward.getAwardCloseoutItems().isEmpty()) {
  			preAwardCloseout = prevAward.getAwardCloseoutItems().get(0);
  		}
  		List<CloseOutDeadlines> closeOutDeadlines = new ArrayList<>();
  		if (awardCloseoutItems != null && !awardCloseoutItems.isEmpty()) {
  			if (awardCloseoutItems.get(0).getSequenceNumber() != null) {
  				awardcloseOutDeadlines.setSequenceNumber(awardCloseoutItems.get(0).getSequenceNumber());
  
  
  
  
  
  
  
  
  			}
  			if (awardCloseoutItems.get(0).getAwardNumber() != null) {
  				awardcloseOutDeadlines
  						.setAwardNumber(awardCloseoutItems.get(0).getAwardNumber());
  
  			}
  			if(award.getArchiveLocation()!=null)
  				awardcloseOutDeadlines.setArchiveLocation(award.getArchiveLocation());
  			if(award.getCloseoutDate()!=null)
  				awardcloseOutDeadlines.setArchiveDate(dateTimeService.getCalendar(award.getCloseoutDate()));
  			
  			for (AwardCloseout awardCloseout:awardCloseoutItems ){
  				CloseOutDeadlines closeOutDeadline = CloseOutDeadlines.Factory.newInstance();		
  				
  				if (awardCloseout.getCloseoutReportName() != null) {
  					closeOutDeadline.setFinalReportType(awardCloseout.getCloseoutReportName());
  				}
  				if (awardCloseout.getDueDate() != null) {
  					Calendar closeoutDate = dateTimeService
  							.getCalendar(awardCloseout.getDueDate());
  					closeOutDeadline.setFinalDueDate(closeoutDate);
  				}
  				if (preAwardCloseout != null) {
  					String closeOutDateModified = getCloseOutDateModified(
  							awardCloseout, preAwardCloseout);
  					if (closeOutDateModified != null) {
  						closeOutDeadline
  								.setFinalDueDateModified(closeOutDateModified);
  					}
  				} else if (awardCloseout.getDueDate() != null) {
  					closeOutDeadline.setFinalDueDateModified(String
  							.valueOf(awardCloseout.getDueDate()));
  				}
  				if (awardCloseout.getFinalSubmissionDate() != null) {
  					Calendar finalSubmissionDate = dateTimeService
  							.getCalendar(awardCloseout.getFinalSubmissionDate());
  					closeOutDeadline.setFinalSubDate(finalSubmissionDate);
  				}
  				if (preAwardCloseout != null) {
  					String finalPropSubDateModified = getFinalProbSubDateModified(
  							awardCloseout, preAwardCloseout);
  					if (finalPropSubDateModified != null) {
  						closeOutDeadline.setFinalSubDateModified(finalPropSubDateModified);
  					}
  				} else if (awardCloseout.getFinalSubmissionDate() != null) {
  					closeOutDeadline.setFinalSubDateModified(String
  							.valueOf(awardCloseout.getFinalSubmissionDate()));
  				}
  				closeOutDeadlines.add(closeOutDeadline);
  			}
  
  
  
  		}
  
  		awardcloseOutDeadlines.setCloseOutDeadlinesArray(closeOutDeadlines
  				.toArray(new CloseOutDeadlines[0]));
  		return awardcloseOutDeadlines;
  	}
  
  	/**
  	 * <p>
  	 * This method will set the values to Award Indirect Costs attributes and
  	 * finally returns Award IndirectCosts XmlObject
  	 * </p>
  	 * 
  	 * @return returns Award IndirectCosts XmlObject
  	 */
  	protected AwardIndirectCosts getAwardIndirectCosts() {
          AwardIndirectCosts awardIndirectCost = AwardIndirectCosts.Factory
                  .newInstance();
          String comemnts = getIndirectCostComments();
          if (comemnts != null) {
              awardIndirectCost.setComments(comemnts);
          }
          List<IndirectCostSharingItem> indirectCostSharingItems = new ArrayList<>();
          award.getAwardFandaRate().forEach(awardFandaRate -> {
              if(awardFandaRate!=null){
                  IndirectCostSharingItem indirectCostSharingItem = IndirectCostSharingItem.Factory
                  .newInstance();
                  indirectCostSharingItem.setSequenceNumber(award.getSequenceNumber());   
                  if(awardFandaRate.getFiscalYear()!=null){
                      indirectCostSharingItem.setFiscalYear(String.valueOf(awardFandaRate.getFiscalYear())); 
                  }
                  if(awardFandaRate.getApplicableFandaRate()!=null){
                      indirectCostSharingItem
                      .setApplicableRate(awardFandaRate.getApplicableFandaRate().bigDecimalValue());    
                  }
                  else{
                      indirectCostSharingItem
                      .setApplicableRate(ScaleTwoDecimal.ZERO.bigDecimalValue());
                  }
                  boolean campus = (awardFandaRate.getOnCampusFlag() != null && awardFandaRate
  						.getOnCampusFlag().equals(ON_CAMPUS_FLAG_SET));
                  indirectCostSharingItem.setCampus(campus);
                  if(awardFandaRate.getSourceAccount()!=null){
                      indirectCostSharingItem.setSourceAccount(awardFandaRate.getSourceAccount());         
                  }
                  if(awardFandaRate.getUnderrecoveryOfIndirectCost()!=null){
                      indirectCostSharingItem.setUnderRecoveryAmount(awardFandaRate.getUnderrecoveryOfIndirectCost().bigDecimalValue());
                  }
                  else{
                      indirectCostSharingItem.setUnderRecoveryAmount(ScaleTwoDecimal.ZERO.bigDecimalValue());
                  }
                  if(awardFandaRate.getDestinationAccount()!=null){
                      indirectCostSharingItem.setDestinationAccount(awardFandaRate.getDestinationAccount());
                  }
                  if(awardFandaRate.getStartDate()!=null){
                      indirectCostSharingItem.setStartDate(dateTimeService.getCalendar(awardFandaRate.getStartDate()));
                  }
                  if(awardFandaRate.getEndDate()!=null){
                      indirectCostSharingItem.setEndDate(dateTimeService.getCalendar(awardFandaRate.getEndDate()));  
                  }
                  if(awardFandaRate.getFandaRateType()!=null && awardFandaRate.getFandaRateType().getDescription()!=null){
                      indirectCostSharingItem.setIDCRateDescription(awardFandaRate.getFandaRateType().getDescription());
                  }
                  indirectCostSharingItems.add(indirectCostSharingItem);
              }
          });
          awardIndirectCost
                  .setIndirectCostSharingItemArray(indirectCostSharingItems
  						.toArray(new IndirectCostSharingItem[0]));
          return awardIndirectCost;
      }
  
  	/*
  	 * Fetch the BudgetDocument associated with Award
  	 */
  	protected AwardBudgetDocument getBudgetDocument() {
  		AwardBudgetDocument awardBudgetDocument = null;
  		try {
  			if (!awardDocument.getBudgetDocumentVersions().isEmpty()) {
  				awardBudgetDocument = (AwardBudgetDocument) documentService
  						.getByDocumentHeaderId(awardDocument
  								.getBudgetDocumentVersion(0)
  								.getDocumentNumber());
  			}
  		} catch (WorkflowException e) {
  			LOG.error(e.getMessage(), e);
  		}
  		return awardBudgetDocument;
  	}
  
  	/**
  	 * <p>
  	 * This method will set the values to Award Cost Sharing attributes and
  	 * finally returns Award CostSharing XmlObject
  	 * </p>
  	 * 
  	 * @return returns Award CostSharing XmlObject
  	 */
  	protected AwardCostSharing getAwardCostSharing() {
  		AwardCostSharing awardCostSharing = AwardCostSharing.Factory
  				.newInstance();
  		String comments = getCostSharingComments();
  		if (comments != null) {
  			awardCostSharing.setComments(comments);
  		}
  		awardCostSharing.setCostSharingItemArray(getCostSharingItemDetails());
  		return awardCostSharing;
  	}
  
  	/**
  	 * <p>
  	 * This method will set the values to Award Special Items attributes and
  	 * finally returns Award Special Items XmlObject
  	 * </p>
  	 * 
  	 * @return returns Award Special Items XmlObject
  	 */
  	protected AwardSpecialItems getAwardSpecialItems() {
  		AwardSpecialItems awardSpecialItem = AwardSpecialItems.Factory.newInstance();
  		awardSpecialItem.setEquipmentArray(getEquipmentType());
  		awardSpecialItem.setForeignTravelArray(getForeignTravel());
  		setSubcontracts(awardSpecialItem);
  		return awardSpecialItem;
  	}
  
  
  
      private void setSubcontracts(AwardSpecialItems awardSpecialItem) {
          List<AwardApprovedSubaward> awardApprovedSubawards = award.getAwardApprovedSubawards();
          for (AwardApprovedSubaward awardApprovedSubcontractBean : awardApprovedSubawards) {
              Subcontract subcontractType = awardSpecialItem.addNewSubcontract();
              BigDecimal bdecAmount = awardApprovedSubcontractBean.getAmount().bigDecimalValue();
              subcontractType.setAmount(bdecAmount.setScale(2,BigDecimal.ROUND_HALF_DOWN));
              subcontractType.setAwardNumber(awardApprovedSubcontractBean.getAwardNumber());
              subcontractType.setSequenceNumber(awardApprovedSubcontractBean.getSequenceNumber());
              subcontractType.setSubcontractorName(awardApprovedSubcontractBean.getOrganizationName());
          }
      }
  
      /**
  	 * <p>
  	 * This method will set the values to Award Comments attributes and finally
  	 * returns Award Comments XmlObject
  	 * </p>
  	 * 
  	 * @return returns Award Comments XmlObject
  	 */
  	protected AwardComments getAwardComments() {
  		AwardComments awardComments = AwardComments.Factory.newInstance();
  
  		for (AwardComment awardComment : award.getAwardComments()) {
  
      		    CommentType2 commentType = awardComments.addNewComment();
      		    CommentDetailsType commentDetailsType = commentType.addNewCommentDetails();
      			if (awardComment.getAwardNumber() != null) {
      				commentDetailsType.setAwardNumber(award.getAwardNumber());
      			}
      			if (awardComment.getSequenceNumber() != null) {
      				commentDetailsType.setSequenceNumber(awardComment
      						.getSequenceNumber());
      			}
      			if (awardComment.getCommentTypeCode() != null) {
      				commentDetailsType.setCommentCode(awardComment
      						.getCommentTypeCode());
      				commentType.setDescription(getCommentTypeDesc(awardComment
      						.getCommentTypeCode()));
      			}
      			if (awardComment.getComments() != null) {
      				commentDetailsType.setComments(awardComment.getComments());
      			}
      			if (awardComment.getChecklistPrintFlag() != null) {
      				commentDetailsType.setPrintChecklist(awardComment
      						.getChecklistPrintFlag());
      			}
      			commentType.setCommentDetails(commentDetailsType);		    
  		}
  		return awardComments;
  	}
  
  	/**
  	 * <p>
  	 * This method will set the values to Award TransactionInfo attributes and
  	 * finally returns Award TransactionInfo XmlObject
  	 * </p>
  	 * 
  	 * @return returns Award TransactionInfo XmlObject
  	 */
  	protected AwardTransactionInfo getAwardTransactionInfo() {
  		AwardTransactionInfo awardTransactionInfo = AwardTransactionInfo.Factory
  				.newInstance();
  		AwardTransactionType awardTransactionType = awardTransactionInfo.addNewTransactionInfo();
  
  		if (award.getAwardNumber() != null) {
  			awardTransactionType.setAwardNumber(award.getAwardNumber());
  		}
  		if (award.getSequenceNumber() != null) {
  			awardTransactionType.setSequenceNumber(award.getSequenceNumber());
  		}
  		if (awardAmountInfo != null
  				&& awardAmountInfo.getSequenceNumber() != null) {
  			awardTransactionType.setAmountSequenceNumber(awardAmountInfo
  					.getSequenceNumber());
  		}
          if (award.getNoticeDate() != null) {
              awardTransactionType.setNoticeDate(dateTimeService
                                   .getCalendar(award.getNoticeDate()));
          }
          award.getAwardComments().forEach(awardComments -> {
              if (awardComments.getCommentTypeCode().equals(CURRENT_ACTION_COMMENT)) {
                  awardTransactionType.setComments(awardComments.getComments());
              }
          });
          if (award.getAwardTransactionTypeCode() != null) {
              award.refreshReferenceObject("awardTransactionType");  
              awardTransactionType.setTransactionTypeCode(award.getAwardTransactionTypeCode());
              if (award.getAwardTransactionType() != null) {
                  awardTransactionType.setTransactionTypeDesc(award.getAwardTransactionType().getDescription());
              }
          }
  		return awardTransactionInfo;
  	}
  
  	/**
  	 * <p>
  	 * This method will set the values to Award Key Persons attributes and
  	 * finally returns Award Key Persons XmlObject
  	 * </p>
  	 * 
  	 * @return returns Award Key Persons XmlObject
  	 */
  	protected AwardKeyPersons getKeyPersons() {
  		KeyPersonType keyPersonType;
  		List<KeyPersonType> keyPersonTypes = new ArrayList<>();
  		for (AwardPerson awardPerson : award.getProjectPersons()) {
  			if (awardPerson.isKeyPerson()) {
  				keyPersonType = KeyPersonType.Factory.newInstance();
  				if (award.getAwardNumber() != null) {
  					keyPersonType.setAwardNumber(award.getAwardNumber());
  				}
  				if (award.getSequenceNumber() != null) {
  					keyPersonType.setSequenceNumber(awardPerson
  							.getSequenceNumber());
  				}
  				if (awardPerson.getPersonId() != null) {
  					keyPersonType.setPersonId(awardPerson.getPersonId());
  				}
  				if (awardPerson.getFullName() != null) {
  					keyPersonType.setPersonName(awardPerson.getFullName());
  				}
  				keyPersonType.setFaculty(awardPerson.isFaculty());
  				if (awardPerson.getRoleCode() != null) {
  					keyPersonType.setRoleName(awardPerson.getRoleCode());
  				}
  				if (awardPerson.getPerson() != null
  						&& awardPerson.getPerson().getOfficeLocation() != null) {
  					keyPersonType.setPersonAddress(awardPerson.getPerson()
  							.getOfficeLocation());
  				}
  				keyPersonType.setNonEmployee(!awardPerson.isEmployee());
  				BigDecimal percentageEffort = getPercentageEffort(awardPerson);
  				if (percentageEffort != null) {
  					keyPersonType.setPercentEffort(percentageEffort);
  				}
  				keyPersonTypes.add(keyPersonType);
  			}
  		}
  		AwardKeyPersons awardKeyPersons = AwardKeyPersons.Factory.newInstance();
  		awardKeyPersons.setKeyPersonArray(keyPersonTypes
  				.toArray(new KeyPersonType[0]));
  		return awardKeyPersons;
  	}
  
  	/**
  	 * <p>
  	 * This method will set the values to Award Investigators attributes and
  	 * finally returns Award Investigators XmlObject
  	 * </p>
  	 * 
  	 * @return returns Award Investigators XmlObject
  	 */
  	protected AwardInvestigators getAwardInvestigators() {
  		AwardInvestigators awardInvestigators = AwardInvestigators.Factory
  				.newInstance();
  		List<InvestigatorType> investigatorTypes = new ArrayList<>();
  		award.getProjectPersons().stream().filter(awardPerson -> awardPerson.isPrincipalInvestigator() || awardPerson.isMultiplePi() || awardPerson.isCoInvestigator()).forEach(awardPerson -> {
  			InvestigatorType investigatorType = getInvestigatorType(awardPerson);
  			investigatorTypes.add(investigatorType);
  		});
  		awardInvestigators.setInvestigatorArray(investigatorTypes
  				.toArray(new InvestigatorType[0]));
  		return awardInvestigators;
  	}
  
  	/**
  	 * <p>
  	 * This method will set the values to Award science codes attributes and
  	 * finally returns Award science codes XmlObject
  	 * </p>
  	 * 
  	 * @return returns Award science codes XmlObject
  	 */
  	protected AwardScienceCodes getAwardScienceCodes() {
  		AwardScienceCodes awardScienceCodes = AwardScienceCodes.Factory
  				.newInstance();
  		List<ScienceCodeDetailType> scienceCodeDetailTypes = new ArrayList<>();
  		for (AwardScienceKeyword awardScienceKeyword : award.getKeywords()) {
  			ScienceCodeDetailType scienceCodeDetailType = ScienceCodeDetailType.Factory
  					.newInstance();
  			if (award.getAwardNumber() != null) {
  				scienceCodeDetailType.setAwardNumber(award.getAwardNumber());
  			}
  			if (award.getSequenceNumber() != null) {
  				scienceCodeDetailType.setSequenceNumber(award
  						.getSequenceNumber());
  			}
  			if (awardScienceKeyword.getScienceKeywordCode() != null) {
  				scienceCodeDetailType.setCode(awardScienceKeyword
  						.getScienceKeywordCode());
  			}
  			if (awardScienceKeyword.getScienceKeyword().getDescription() != null) {
  				scienceCodeDetailType.setDescription(awardScienceKeyword
  						.getScienceKeyword().getDescription());				
  			}
  			scienceCodeDetailTypes.add(scienceCodeDetailType);
  		}
  		awardScienceCodes.setScienceCodeDetailArray(scienceCodeDetailTypes
  				.toArray(new ScienceCodeDetailType[0]));		
  		return awardScienceCodes;
  	}
  
  	/**
  	 * <p>
  	 * This method will set the values to Award Terms Details attributes and
  	 * finally returns Award Terms Details XmlObject
  	 * </p>
  	 * 
  	 * @return returns Award Terms Details XmlObject
  	 */
  	protected AwardTermsDetails getAwardTermsDetails() {
  		AwardTermsDetails awardTermsDetails = AwardTermsDetails.Factory.newInstance();
  		String sponsorTermTypeCode = null;
          TermType2 termType = null;
  		for (AwardSponsorTerm awardSponsorTerm : award.getAwardSponsorTerms()) {
  		    if(sponsorTermTypeCode==null || !sponsorTermTypeCode.equals(awardSponsorTerm.getSponsorTermTypeCode())){
  		        termType = awardTermsDetails.addNewTerm();
  		    }
              sponsorTermTypeCode = awardSponsorTerm.getSponsorTermTypeCode();
  		    String sponsorTermTypeDescription =  getSponsorTermTypeDescription(awardSponsorTerm.getSponsorTermTypeCode());
  		    if(sponsorTermTypeDescription!=null){
  		        termType.setDescription(sponsorTermTypeDescription);
  		    }
  			TermDetailsType2 detailsType = termType.addNewTermDetails();
  			if (award.getAwardNumber() != null) {
  				detailsType.setAwardNumber(award.getAwardNumber());
  			}
  			if (awardSponsorTerm.getSequenceNumber() != null) {
  				detailsType.setSequenceNumber(awardSponsorTerm
  						.getSequenceNumber());
  			}
  			if (awardSponsorTerm.getSponsorTerm() != null
  					&& awardSponsorTerm.getSponsorTerm().getSponsorTermCode() != null) {
  				detailsType.setTermCode(Integer.valueOf(awardSponsorTerm
  						.getSponsorTerm().getSponsorTermCode()));
  			}
  			if (awardSponsorTerm.getSponsorTerm() != null
  					&& awardSponsorTerm.getSponsorTerm().getDescription() != null) {
  				detailsType.setTermDescription(awardSponsorTerm
  						.getSponsorTerm().getDescription());
  			}
  		}
  		return awardTermsDetails;
  	}
  
  	private String getSponsorTermTypeDescription(String sponsorTermTypeCode) {
  	    SponsorTermType sponsorTermType = getBusinessObjectService().findBySinglePrimaryKey(SponsorTermType.class, sponsorTermTypeCode);
  	    return sponsorTermType==null?null:sponsorTermType.getDescription();
      }
  
      /**
  	 * <p>
  	 * This method will set the values to Award Details attributes and finally
  	 * returns AwardDetails XmlObject
  	 * </p>
  	 * 
  	 * @return returns AwardDetails XmlObject
  	 */
  	protected AwardDetails getAwardDetails() {
  		AwardDetails awardDetailsType = AwardDetails.Factory.newInstance();
  		AwardHeaderType awardHeaderType = getAwardHeaderType();
  		awardDetailsType.setAwardHeader(awardHeaderType);
  		awardDetailsType.setOtherHeaderDetails(getOtherHeaderDetails());
  		if (prevAward != null) {
  			String beginDateModified = getBeginDateModified();
  			if (beginDateModified != null) {
  				awardDetailsType.setBeginDateModified(beginDateModified);
  			}
  			String executionDateModified = getExecutionDateModified();
  			if (executionDateModified != null) {
  				awardDetailsType
  						.setExecutionDateModified(executionDateModified);
  			}
  			String effectiveDateModified = getEffectiveDateModified();
  			if (effectiveDateModified != null) {
  				awardDetailsType
  						.setEffectiveDateModified(effectiveDateModified);
  			}
  		}
  		Calendar beginDate = getBeginDate();
  		if (beginDate != null) {
  			awardDetailsType.setBeginDate(beginDate);
  		}
  		Calendar executionDate = getExecutionDate();
  		if (executionDate != null) {
  			awardDetailsType.setExecutionDate(executionDate);
  		}
  		Calendar effectiveDate = getEffectiveDate();
  		if (effectiveDate != null) {
  			awardDetailsType.setEffectiveDate(effectiveDate);
  		}
  		awardDetailsType.setApprvdEquipmentIndicator(getIndicator(award.getApprovedEquipmentItems()));
  		awardDetailsType.setApprvdForeginTripIndicator(getIndicator(award.getApprovedForeignTravelTrips()));
  		awardDetailsType.setApprvdSubcontractIndicator(getIndicator(award.getAwardApprovedSubawards()));
  		awardDetailsType.setPaymentScheduleIndicator(getIndicator(award.getPaymentScheduleItems()));
  		awardDetailsType.setIDCIndicator(getIndicator(award.getAwardFandaRate()));
  		awardDetailsType.setTransferSponsorIndicator(getIndicator(award.getAwardTransferringSponsors()));
  		awardDetailsType.setCostSharingIndicator(getIndicator(award.getAwardCostShares()));
  		awardDetailsType.setCostSharingProjectPeriodFieldDescription(getProjectPeriodFieldDescription());	
  		awardDetailsType.setSpecialReviewIndicator(getIndicator(award.getSpecialReviews()));
  		awardDetailsType.setScienceCodeIndicator(getIndicator(award.getKeywords()));
  		return awardDetailsType;
  	}
  	
  	private String getProjectPeriodFieldDescription() {
  	    return costShareService.getCostShareLabel();
  	}
  	
  	private String getIndicator(List list){
  	    return list.isEmpty()?NOT_PRESENT_INDICATOR:PRESENT_INDICATOR;
  	}
  
  	/**
  	 * <p>
  	 * This method will set the values to Award Amount Info attributes and
  	 * finally returns Award Amount Info XmlObject
  	 * </p>
  	 * 
  	 * @return returns Award Amount Info XmlObject
  	 */
  	protected org.kuali.kra.printing.schema.AwardType.AwardAmountInfo getAwardAmountInfo() {
  		org.kuali.kra.printing.schema.AwardType.AwardAmountInfo awardAmountInfoType;
  		awardAmountInfoType = org.kuali.kra.printing.schema.AwardType.AwardAmountInfo.Factory
  				.newInstance();
  		if (awardAmountInfo != null) {
  			AmountInfoType amountInfoType = AmountInfoType.Factory
  					.newInstance();
  			if (award.getAwardNumber() != null) {
  				amountInfoType.setAwardNumber(award.getAwardNumber());
  			}
  			if (award.getSequenceNumber() != null) {
  				amountInfoType.setSequenceNumber(awardAmountInfo
  						.getSequenceNumber());
  			}
  			if (awardAmountInfo.getSequenceNumber() != null) {
  				amountInfoType.setAmountSequenceNumber(awardAmountInfo
  						.getSequenceNumber());
  			}
  			BigDecimal anticipatedTotalAmount = getAnticipatedTotalAmount();
  			if (anticipatedTotalAmount != null) {
  				amountInfoType.setAnticipatedTotalAmt(anticipatedTotalAmount);
  			}
  			BigDecimal antDistributableAmount = getAntDistributableAmount();
  			if (antDistributableAmount != null) {
  				amountInfoType
  						.setAnticipatedDistributableAmt(antDistributableAmount);
  			}
  			Calendar finalExpirationDate = getFinalExpirationDate();
  			if (finalExpirationDate != null) {
  				amountInfoType.setFinalExpirationDate(finalExpirationDate);
  			}
  			Calendar currentFundEffectiveDate = getCurrentFundEffectiveDate();
  			if (currentFundEffectiveDate != null) {
  				amountInfoType
  						.setCurrentFundEffectiveDate(currentFundEffectiveDate);
  			}
  			if (prevAwardAmountInfo != null) {
  				String finalExpirationDateModified = getFinalExpirationDateModified();
  				if (finalExpirationDateModified != null) {
  					amountInfoType
  							.setFinalExpDateModified(finalExpirationDateModified);
  				}
  				String currentFundEffectiveDateModified = getCurrentFundEffectiveDateModified();
  				if (currentFundEffectiveDateModified != null) {
  					amountInfoType
  							.setCurrentFundEffectiveDateModified(currentFundEffectiveDateModified);
  				}
  				String obligatedDistributableAmtModified = getObligatedDistributableAmtModified();
  				if (obligatedDistributableAmtModified != null) {
  					amountInfoType
  							.setObligatedDistributableAmtModified(obligatedDistributableAmtModified);
  				}
  				String obligationExpirationDateModified = getObligationExpirationDateModified();
  				if (obligationExpirationDateModified != null) {
  					amountInfoType
  							.setObligationExpDateModified(obligationExpirationDateModified);
  				}
  			}
  			BigDecimal amountObligatedToDate = getAmtObligatedToDate();
  			if (amountObligatedToDate != null) {
  				amountInfoType.setAmtObligatedToDate(amountObligatedToDate);
  			}
  			BigDecimal obligatedDistributableAmount = getObligatedDistributableAmt();
  			if (obligatedDistributableAmount != null) {
  				amountInfoType
  						.setObligatedDistributableAmt(obligatedDistributableAmount);
  			}
  			Calendar obligationExpirationDate = getObligationExpirationDate();
  			if (obligationExpirationDate != null) {
  				amountInfoType
  						.setObligationExpirationDate(obligationExpirationDate);
  			}
  			if (awardAmountInfo.getTransactionId() != null) {
  				amountInfoType.setTransactionId(String.valueOf(awardAmountInfo
  						.getTransactionId()));
  			}
  			BigDecimal anticipatedChange = getAnticipatedChange();
  			if (anticipatedChange != null) {
  				amountInfoType.setAnticipatedChange(anticipatedChange);
  			}
  			BigDecimal obligatedChange = getObligatedChange();
  			if (obligatedChange != null) {
  				amountInfoType.setObligatedChange(obligatedChange);
  			}
  			amountInfoType.setEntryType(String.valueOf(awardAmountInfo
  					.getEntryType()));
  			amountInfoType.setEOMProcess(true);
  			if (award.getAwardEffectiveDate() != null) {
  				Calendar totalStartDate = dateTimeService.getCalendar(award
  						.getAwardEffectiveDate());
  				if (totalStartDate != null) {
  					amountInfoType.setTotalStartDate(totalStartDate);
  				}
  			}
  			if (award.getProjectEndDate() != null) {
  				Calendar totalEndDate = dateTimeService.getCalendar(award
  						.getProjectEndDate());
  				if (totalEndDate != null) {
  					amountInfoType.setTotalEndDate(totalEndDate);
  				}
  			}
  			ScaleTwoDecimal obligatedChangeDirect = getObligatedChangeDirect();
  			if (obligatedChangeDirect != null) {
  				amountInfoType.setObligatedChangeDirect(obligatedChangeDirect.bigDecimalValue());
  			}
  			ScaleTwoDecimal obligatedChangeIndirect = getObligatedChangeIndirect();
  			if (obligatedChangeIndirect != null) {
  				amountInfoType
  						.setObligatedChangeIndirect(obligatedChangeIndirect.bigDecimalValue());
  			}
  			ScaleTwoDecimal anticipatedChangeDirect = getAnticipatedChangeDirect();
  			if (anticipatedChangeDirect != null) {
  				amountInfoType
  						.setAnticipatedChangeDirect(anticipatedChangeDirect.bigDecimalValue());
  			}
  			ScaleTwoDecimal anticipatedChangeIndirect = getAnticipatedChangeIndirect();
  			if (anticipatedChangeIndirect != null) {
  				amountInfoType
  						.setAnticipatedChangeIndirect(anticipatedChangeIndirect.bigDecimalValue());
  			}
  			BigDecimal anticipatedTotalDirect = getAnticipatedTotalDirect();
  			if (anticipatedTotalDirect != null) {
  				amountInfoType
  						.setAnticipatedTotalDirect(anticipatedTotalDirect);
  			}
  			BigDecimal anticipatedTotalIndirect = getAnticipatedTotalIndirect();
  			if (anticipatedTotalIndirect != null) {
  				amountInfoType
  						.setAnticipatedTotalIndirect(anticipatedTotalIndirect);
  			}
  			BigDecimal obligatedTotalDirect = getObligatedTotalDirect();
  			if (obligatedTotalDirect != null) {
  				amountInfoType.setObligatedTotalDirect(obligatedTotalDirect);
  			}
  			BigDecimal obligatedTotalIndirect = getObligatedTotalIndirect();
  			if (obligatedTotalIndirect != null) {
  				amountInfoType
  						.setObligatedTotalIndirect(obligatedTotalIndirect);
  			}
  			String enableAwdAntOblDirectIndirectCost = getAwardParameterValue(OBLIGATED_DIRECT_INDIRECT_COST_CONSTANT);
  			if (enableAwdAntOblDirectIndirectCost != null) {
  				amountInfoType
  						.setEnableAwdAntOblDirectIndirectCost(enableAwdAntOblDirectIndirectCost);
  			}
  			AmountInfoType[] amountInfoTypes = { amountInfoType };
  			awardAmountInfoType.setAmountInfoArray(amountInfoTypes);
  		}
  		return awardAmountInfoType;
  	}
  
  	/**
  	 * 
  	 * This method will get the NSF description for the nsfCode.If the given
  	 * nsfCode found in NsfCode table returns description otherwise null
  	 * 
  	 * @param nsfCode
  	 *            is a code to find the NSF description
  	 * 
  	 * @return NSF Description if nsfCode found otherwise null
  	 */
  	protected String getNSFDescription(String nsfCode) {
  		String description = null;
  		Map<String, String> nsfCodeMap = new HashMap<>();
  		nsfCodeMap.put(NSF_CODE_PARAMETER, nsfCode);
  		List<NsfCode> nsfCodeList = (List<NsfCode>) businessObjectService
  				.findMatching(NsfCode.class, nsfCodeMap);
  		if (nsfCodeList != null && !nsfCodeList.isEmpty()) {
  			description = nsfCodeList.get(0).getDescription();
  		}
  		return description;
  	}
  
  	/*
  	 * This method will set the values to disclosure items and finally return
  	 * disclosure XmlObject array
  	 * 
  	 */
  	private DisclosureItemType[] getDisclosureItems() {
  		List<DisclosureItemType> disclosureItems = new ArrayList<>();
  		award.getProjectPersons().forEach(awardPerson -> {
  			if (awardPerson.isCoInvestigator()) {
  				DisclosureItemType disclosureItemType = DisclosureItemType.Factory
  						.newInstance();
  
  				disclosureItems.add(disclosureItemType);
  			}
  		});
  		return disclosureItems.toArray(new DisclosureItemType[0]);
  	}
  
  	/*
  	 * 
  	 * This method will get the sponsor award number.
  	 * 
  	 * If AwardDeltaXmlStream instance calling this method then checks if
  	 * prevAward sponsorAwardNumber null or prevAward sponsorAwardNumber is not
  	 * equal to award sponsorAwardNumber then *(Asterisk)append to description
  	 * otherwise return award sponsorAwardNumber
  	 * 
  	 * If AwardNoticeXmlStream {@link AwardNoticeXmlStream} instance calling
  	 * this method then returns award sponsorAwardNumber
  	 * 
  	 */
  	private String getSponsorAwardNumber() {
  		String sponsorAwardNumber = null;
  		if (prevAward != null) {
  			if (award.getSponsorAwardNumber() != null) {
  				if (prevAward.getSponsorAwardNumber() == null
  						|| !award.getSponsorAwardNumber().equals(
  								prevAward.getSponsorAwardNumber())) {
  					sponsorAwardNumber = new StringBuilder(award
  							.getSponsorAwardNumber()).append(
  							END_ASTERISK_SPACE_INDICATOR).toString();
  				} else {
  					sponsorAwardNumber = award.getSponsorAwardNumber();
  				}
  			} else if (prevAward.getSponsorAwardNumber() != null) {
  				sponsorAwardNumber = START_ASTERISK_SPACE_INDICATOR;
  			}
  		} else {
  			sponsorAwardNumber = award.getSponsorAwardNumber();
  		}
  		return sponsorAwardNumber;
  	}
  
  	/*
  	 * 
  	 * This method will get the SponsorDescriptionr.
  	 * 
  	 * If AwardDeltaXmlStream instance calling this method then checks if
  	 * prevAward SponsorDescription null or prevAward SponsorDescription is not
  	 * equal to award SponsorDescription then *(Asterisk)append to description
  	 * otherwise return award SponsorDescription
  	 * 
  	 * If AwardNoticeXmlStream instance calling this method then returns award
  	 * SponsorDescription
  	 * 
  	 */
  	private String getSponsorDescription() {
  		String sponsordescription = null;
  		if (prevAward != null) {
  			if (award.getSponsorCode() != null) {
  				if (prevAward.getSponsorCode() == null
  						|| !award.getSponsorCode().equals(
  								prevAward.getSponsorCode())) {
  					sponsordescription = new StringBuilder(award
  							.getSponsorName()).append(
  							END_ASTERISK_SPACE_INDICATOR).toString();
  				} else {
  					sponsordescription = award.getSponsorName();
  				}
  			} else if (prevAward.getSponsorCode() != null) {
  				sponsordescription = START_ASTERISK_SPACE_INDICATOR;
  			}
  		} else {
  			sponsordescription = award.getSponsorName();
  		}
  		return sponsordescription;
  	}
  
  	/*
  	 * This method will set the values to Report TermDetails Type and finally
  	 * return Report TermDetails Type XmlObject.
  	 * 
  	 */
  	private ReportTermDetailsType2 getAwardReportTermBean(
  			AwardReportTerm awardReportTerm, ReportTermType2 reportTermType) {
  		ReportTermDetailsType2 reportTermDetailsType = reportTermType.addNewReportTermDetails();
  		if (award.getAwardNumber() != null) {
  			reportTermDetailsType.setAwardNumber(award.getAwardNumber());
  		}
  		if (award.getSequenceNumber() != null) {
  			reportTermDetailsType.setSequenceNumber(award.getSequenceNumber());
  		}
  		if (awardReportTerm.getReportClassCode() != null) {
  			reportTermDetailsType.setReportClassCode(Integer
  					.valueOf(awardReportTerm.getReportClassCode()));
  		}
  		if (awardReportTerm.getReportClass() != null
  				&& awardReportTerm.getReportClass().getDescription() != null) {
  			reportTermDetailsType.setReportClassDesc(awardReportTerm
  					.getReportClass().getDescription());
  		}
  		if (awardReportTerm.getReportCode() != null) {
  			reportTermDetailsType.setReportCode(Integer.valueOf(awardReportTerm
  					.getReportCode()));
  		}
  		if (awardReportTerm.getReport() != null
  				&& awardReportTerm.getReport().getDescription() != null) {
  			reportTermDetailsType.setReportCodeDesc(awardReportTerm.getReport()
  					.getDescription());
  		}
  		if (awardReportTerm.getFrequencyCode() != null) {
  			reportTermDetailsType.setFrequencyCode(Integer
  					.valueOf(awardReportTerm.getFrequencyCode()));
  		}
  		if (awardReportTerm.getFrequency() != null
  				&& awardReportTerm.getFrequency().getDescription() != null) {
  			reportTermDetailsType.setFrequencyCodeDesc(awardReportTerm
  					.getFrequency().getDescription());
  		}
  		if (awardReportTerm.getFrequencyBaseCode() != null) {
  			reportTermDetailsType.setFrequencyBaseCode(Integer
  					.valueOf(awardReportTerm.getFrequencyBaseCode()));
  		}
  		if (awardReportTerm.getFrequencyBase() != null && awardReportTerm.getFrequencyBase().getDescription() != null) {
  			reportTermDetailsType.setFrequencyBaseDesc(awardReportTerm
  					.getFrequencyBase().getDescription());
  		}
  		if (awardReportTerm.getOspDistributionCode() != null) {
  			reportTermDetailsType.setOSPDistributionCode(Integer
  					.valueOf(awardReportTerm.getOspDistributionCode()));
  		}
  		if (awardReportTerm.getDistribution() != null
  				&& awardReportTerm.getDistribution().getDescription() != null) {
  			reportTermDetailsType.setOSPDistributionDesc(awardReportTerm
  					.getDistribution().getDescription());
  		}
  		Calendar dueDate = getDueDate(awardReportTerm);
  		if (dueDate != null) {
  			reportTermDetailsType.setDueDate(dueDate);
  		}
  		List<org.kuali.kra.printing.schema.ReportTermDetailsType2.MailCopies> mailCopiesList = getMailCopiesList(awardReportTerm);
  		reportTermDetailsType.setMailCopiesArray(mailCopiesList
  				.toArray(new org.kuali.kra.printing.schema.ReportTermDetailsType2.MailCopies[0]));
  		return reportTermDetailsType;
  	}
  
  	private List<org.kuali.kra.printing.schema.ReportTermDetailsType2.MailCopies> getMailCopiesList(
  			AwardReportTerm awardReportTerm) {
  		List<org.kuali.kra.printing.schema.ReportTermDetailsType2.MailCopies> mailCopiesList = new ArrayList<>();
  		for (AwardReportTermRecipient awardReportTermRecipient : awardReportTerm
  				.getAwardReportTermRecipients()) {
  			org.kuali.kra.printing.schema.ReportTermDetailsType2.MailCopies mailCopies = org.kuali.kra.printing.schema.ReportTermDetailsType2.MailCopies.Factory
  					.newInstance();
  			mailCopies.setContactTypeCode(Integer
  					.parseInt(awardReportTermRecipient.getContactTypeCode()));
  			mailCopies.setContactTypeDesc(awardReportTermRecipient
  					.getContactType().getDescription());
  			mailCopies.setNumberOfCopies(String
  					.valueOf(awardReportTermRecipient.getNumberOfCopies()));
  			mailCopies.setRolodexId(String.valueOf(awardReportTermRecipient
  					.getRolodexId()));
  			mailCopies.setRolodexName(awardReportTermRecipient.getRolodex()
  					.getFullName());
  			mailCopies.setRolodexOrganization(awardReportTermRecipient
  					.getRolodex().getOrganization());
  			mailCopiesList.add(mailCopies);
  		}
  		return mailCopiesList;
  	}
  
  	/*
  	 * This method will get the calendar object for due date of award report
  	 * term
  	 */
  	private Calendar getDueDate(AwardReportTerm awardReportTerm) {
  		Calendar dueDate = null;
  		if (awardReportTerm.getDueDate() != null) {
  			dueDate = dateTimeService.getCalendar(awardReportTerm.getDueDate());
  		}
  		return dueDate;
  	}
  
  	/*
  	 * This method will set the values to Rolodex Details Type and finally
  	 * return Rolodex Details Type XmlObject.
  	 * 
  	 */
  	private RolodexDetailsType2 getRolodexDetails(
  			AwardSponsorContact awardSponsorContact) {
  		RolodexDetailsType2 rolodexDetailsType = RolodexDetailsType2.Factory
  				.newInstance();
  		if (awardSponsorContact.getRolodex() != null) {
  			Rolodex rolodex = awardSponsorContact.getRolodex();
  			if (rolodex.getAddressLine1() != null) {
  				rolodexDetailsType.setAddress1(rolodex.getAddressLine1());
  			}
  			if (rolodex.getAddressLine2() != null) {
  				rolodexDetailsType.setAddress2(rolodex.getAddressLine2());
  			}
  			if (rolodex.getAddressLine3() != null) {
  				rolodexDetailsType.setAddress3(rolodex.getAddressLine3());
  			}
  			if (rolodex.getCity() != null) {
  				rolodexDetailsType.setCity(rolodex.getCity());
  			}
  			if (rolodex.getComments() != null) {
  				rolodexDetailsType.setComments(rolodex.getComments());
  			}
  			if (rolodex.getCountryCode() != null) {
  				rolodexDetailsType.setCountryCode(rolodex.getCountryCode());
  			}
  			String countryDesc = getCountryDescription(rolodex);
  			if (countryDesc != null) {
  				rolodexDetailsType.setCountryDescription(countryDesc);
  			}
  			if (rolodex.getCounty() != null) {
  				rolodexDetailsType.setCounty(rolodex.getCounty());
  			}
  			if (rolodex.getEmailAddress() != null) {
  				rolodexDetailsType.setEmail(rolodex.getEmailAddress());
  			}
  			if (rolodex.getFaxNumber() != null) {
  				rolodexDetailsType.setFax(rolodex.getFaxNumber());
  			}
  			if (rolodex.getFirstName() != null) {
  				rolodexDetailsType.setFirstName(rolodex.getFirstName());
  			}
  			if (rolodex.getMiddleName() != null) {
  				rolodexDetailsType.setMiddleName(rolodex.getMiddleName());
  			}
  			String name = getName(rolodex);
  			if (!name.equals(EMPTY_SPACE)) {
  				rolodexDetailsType.setLastName(name);
  			}
  			if (rolodex.getOrganization() != null) {
  				rolodexDetailsType.setOrganization(rolodex.getOrganization());
  			}
  			if (rolodex.getPhoneNumber() != null) {
  				rolodexDetailsType.setPhoneNumber(rolodex.getPhoneNumber());
  			}
  			if (rolodex.getPostalCode() != null) {
  				rolodexDetailsType.setPincode(rolodex.getPostalCode());
  			}
  			if (rolodex.getPrefix() != null) {
  				rolodexDetailsType.setPrefix(rolodex.getPrefix());
  			}
  			if (rolodex.getRolodexId() != null) {
  				rolodexDetailsType.setRolodexId(String.valueOf(rolodex
  						.getRolodexId()));
  			}
  			if (rolodex.getSponsorCode() != null) {
  				rolodexDetailsType.setSponsorCode(rolodex.getSponsorCode());
  			}
  			if (rolodex.getSponsor() != null
  					&& rolodex.getSponsor().getSponsorName() != null) {
  				rolodexDetailsType.setSponsorName(rolodex.getSponsor()
  						.getSponsorName());
  			}
  			if (rolodex.getState() != null) {
  				rolodexDetailsType.setStateCode(rolodex.getState());
  			}
  			String stateDesc = getState(rolodex);
  			if (stateDesc != null) {
  				rolodexDetailsType.setStateDescription(stateDesc);
  			}
  			if (rolodex.getSuffix() != null) {
  				rolodexDetailsType.setSuffix(rolodex.getSuffix());
  			}
  			if (rolodex.getTitle() != null) {
  				rolodexDetailsType.setTitle(rolodex.getTitle());
  			}
  			if (rolodex.getOwnedByUnit() != null) {
  				rolodexDetailsType.setOwnedByUnit(rolodex.getOwnedByUnit());
  			}
  			if (rolodex.getUnit() != null
  					&& rolodex.getUnit().getUnitName() != null) {
  				rolodexDetailsType.setOwnedByUnit(rolodex.getUnit()
  						.getUnitName());
  			}
  		}
  		return rolodexDetailsType;
  	}
  
  	/*
  	 * This method will get the state description for given state code from
  	 * rolodex
  	 */
  	private String getState(Rolodex rolodex) {
  		String stateDesc = null;
  		if (StringUtils.isNotBlank(rolodex.getState()) && StringUtils.isNotBlank(rolodex.getCountryCode())) {
  			State state = PrintingUtils.getStateFromName(rolodex.getCountryCode(), rolodex.getState());
  			if (state != null) {
  				stateDesc = state.getName();
  			}
  		} else if (StringUtils.isNotBlank(rolodex.getState())) {
  			return rolodex.getState();
  		}
  		return stateDesc;
  	}
  
  	/*
  	 * This method will get the name for rolodex
  	 */
  	private String getName(Rolodex rolodex) {
  		StringBuilder name = new StringBuilder();
  		if (rolodex.getLastName() != null) {
  			name.append(rolodex.getLastName());
  		}
  		if (rolodex.getSuffix() != null) {
  			name.append(EMPTY_SPACE).append(rolodex.getSuffix());
  		}
  		if (rolodex.getPrefix() != null) {
  			name.append(COMMA_STRING).append(rolodex.getPrefix());
  			if (rolodex.getFirstName() != null) {
  				name.append(EMPTY_SPACE).append(rolodex.getFirstName());
  			}
  		} else if (rolodex.getFirstName() != null) {
  			name.append(COMMA_STRING).append(rolodex.getFirstName());
  		}
  		if (rolodex.getMiddleName() != null) {
  			name.append(EMPTY_SPACE).append(rolodex.getMiddleName());
  		}
  		return name.toString();
  	}
  
  	/*
  	 * This method will get the country description for given country code from
  	 * rolodex
  	 */
  	private String getCountryDescription(Rolodex rolodex) {
  		String countryDesc = null;
  		if (StringUtils.isNotBlank(rolodex.getCountryCode())) {
  			Country country = PrintingUtils.getCountryFromCode(rolodex
  					.getCountryCode());
  			if (country != null) {
  				countryDesc = country.getName();
  			}
  		}
  		return countryDesc;
  	}
  
  	/*
  	 * This method will get the final prop submission date modified
  	 */
  	private String getFinalProbSubDateModified(AwardCloseout awardCloseout,
  			AwardCloseout preAwardCloseout) {
  		return getIndicatorIfDatesChanged(preAwardCloseout.getFinalSubmissionDate(),awardCloseout.getFinalSubmissionDate());
  	}
  
  	/*
  	 * This method will get the closeout date modified
  	 */
  	private String getCloseOutDateModified(AwardCloseout awardCloseout,
  			AwardCloseout preAwardCloseout) {
  		return getIndicatorIfDatesChanged(preAwardCloseout.getDueDate(),awardCloseout.getDueDate());
  	}
  	private String getIndicatorIfDatesChanged(Date preAwardDate, Date awardDate) {
  		String finalPropSubDateModified = null;
  		if (preAwardDate == null && awardDate != null) {
  			finalPropSubDateModified = END_ASTERISK_SPACE_INDICATOR;
  		} else if (preAwardDate != null && !preAwardDate.equals(awardDate)) {
  			finalPropSubDateModified = END_ASTERISK_SPACE_INDICATOR;
  		}
  		return finalPropSubDateModified;
  	}
  
  	/*
  	 * This method will get the indirect cost comments
  	 */
  	private String getIndirectCostComments() {
  		String comments = null;
  		for (AwardComment awardComment : award.getAwardComments()) {
  			if (awardComment.getCommentTypeCode() != null
  