Пример #1
0
 protected AwardProjectDirector getProjectDirector(AwardDTO kcAward) {
   AwardProjectDirector director = new AwardProjectDirector();
   director.setPrincipalId(kcAward.getPrincipalInvestigatorId());
   director.setProjectDirector(getPersonService().getPerson(kcAward.getPrincipalInvestigatorId()));
   director.setProposalNumber(kcAward.getAwardId());
   return director;
 }
Пример #2
0
 protected Award awardFromDTO(AwardDTO kcAward) {
   Award award = new Award();
   award.setProposalNumber(kcAward.getAwardId());
   award.setAwardNumber(kcAward.getAwardNumber());
   award.setAwardBeginningDate(
       kcAward.getAwardStartDate() == null
           ? null
           : new java.sql.Date(kcAward.getAwardStartDate().getDate()));
   award.setAwardEndingDate(
       kcAward.getAwardEndDate() == null
           ? null
           : new java.sql.Date(kcAward.getAwardEndDate().getDate()));
   award.setAwardTotalAmount(kcAward.getAwardTotalAmount());
   award.setAwardDirectCostAmount(kcAward.getAwardDirectCostAmount());
   award.setAwardIndirectCostAmount(kcAward.getAwardIndirectCostAmount());
   award.setAwardDocumentNumber(kcAward.getAwardDocumentNumber());
   award.setAwardLastUpdateDate(
       kcAward.getAwardLastUpdateDate() == null
           ? null
           : new java.sql.Timestamp(kcAward.getAwardLastUpdateDate().getDate()));
   award.setAwardCreateTimestamp(
       kcAward.getAwardCreateTimestamp() == null
           ? null
           : new java.sql.Timestamp(kcAward.getAwardCreateTimestamp().getDate()));
   award.setProposalAwardTypeCode(kcAward.getProposalAwardTypeCode());
   award.setAwardStatusCode(kcAward.getAwardStatusCode());
   award.setAgencyNumber(kcAward.getSponsorCode());
   award.setAwardTitle(kcAward.getTitle());
   award.setAwardCommentText(kcAward.getAwardCommentText());
   award.setAgency(new Agency(kcAward.getSponsor()));
   if (kcAward.getProposal() != null) {
     award.setProposal(new Proposal(kcAward.getProposal()));
     award.getProposal().setAward(award);
   }
   award.setAdditionalFormsRequiredIndicator(kcAward.isAdditionalFormsRequired());
   award.setAutoApproveIndicator(kcAward.isAutoApproveInvoice());
   award.setMinInvoiceAmount(kcAward.getMinInvoiceAmount());
   award.setAdditionalFormsDescription(kcAward.getAdditionalFormsDescription());
   award.setStopWorkIndicator(kcAward.isStopWork());
   award.setCommentText(kcAward.getStopWorkReason());
   award.setInvoicingOptions(kcAward.getInvoicingOption());
   award.setDunningCampaign(kcAward.getDunningCampaignId());
   if (StringUtils.isNotEmpty(kcAward.getFundManagerId())) {
     award.setAwardPrimaryFundManager(
         new AwardFundManager(award.getProposalNumber(), kcAward.getFundManagerId()));
   }
   AccountAutoCreateDefaults defaults =
       getAccountDefaultsService().getAccountDefaults(kcAward.getUnitNumber());
   if (defaults != null) {
     AwardOrganization awardOrg = new AwardOrganization();
     awardOrg.setActive(true);
     awardOrg.setAwardPrimaryOrganizationIndicator(true);
     awardOrg.setChartOfAccountsCode(defaults.getChartOfAccountsCode());
     awardOrg.setChartOfAccounts(defaults.getChartOfAccounts());
     awardOrg.setOrganization(defaults.getOrganization());
     awardOrg.setOrganizationCode(defaults.getOrganizationCode());
     awardOrg.setProposalNumber(award.getProposalNumber());
     award.setPrimaryAwardOrganization(awardOrg);
   }
   if (kcAward.getMethodOfPayment() != null) {
     award.setLetterOfCreditFundCode(kcAward.getMethodOfPayment().getMethodOfPaymentCode());
     award.setLetterOfCreditFund(
         new LetterOfCreditFund(
             kcAward.getMethodOfPayment().getMethodOfPaymentCode(),
             kcAward.getMethodOfPayment().getDescription()));
   }
   award.setBillingFrequency(
       getBillingFrequencyService().createBillingFrequency(kcAward.getInvoiceBillingFrequency()));
   award.setSuspendInvoicingIndicator(
       getDoNotInvoiceStatuses().contains(kcAward.getAwardStatusCode()));
   award.setAwardPrimaryProjectDirector(getProjectDirector(kcAward));
   return award;
 }