当前位置: 首页>>代码示例>>Java>>正文


Java DocumentService.saveDocument方法代码示例

本文整理汇总了Java中org.kuali.rice.krad.service.DocumentService.saveDocument方法的典型用法代码示例。如果您正苦于以下问题:Java DocumentService.saveDocument方法的具体用法?Java DocumentService.saveDocument怎么用?Java DocumentService.saveDocument使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.kuali.rice.krad.service.DocumentService的用法示例。


在下文中一共展示了DocumentService.saveDocument方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: disapprove

import org.kuali.rice.krad.service.DocumentService; //导入方法依赖的package包/类
/**
 * Performs the disapprove workflow action on the form document instance
 *
 * @param form - document form base containing the document instance that will be disapproved
 * @return ModelAndView
 */
@RequestMapping(params = "methodToCall=disapprove")
public ModelAndView disapprove(@ModelAttribute("KualiForm") DocumentFormBase form, BindingResult result,
                               HttpServletRequest request, HttpServletResponse response) throws Exception {
    OLESerialReceivingForm oleSerialReceivingForm = (OLESerialReceivingForm) form;
    OLESerialReceivingDocument oldSerialReceivingDocument = (OLESerialReceivingDocument) oleSerialReceivingForm.getDocument();
    ModelAndView modelAndView = super.disapprove(form, result, request, response);
    form.setDocId(null);
    form.setCommand(KewApiConstants.INITIATE_COMMAND);
    super.docHandler(form, result, request, response);
    OLESerialReceivingService oleSerialReceivingService = new OLESerialReceivingServiceImpl();
    String user = oldSerialReceivingDocument.getDocumentHeader().getWorkflowDocument().getInitiatorPrincipalId();
    Person person = SpringContext.getBean(PersonService.class).getPerson(user);
    GlobalVariables.setUserSession(new UserSession(person.getPrincipalName()));
    DocumentService documentService = GlobalResourceLoader.getService(OLEConstants.DOCUMENT_HEADER_SERVICE);
    OLESerialReceivingDocument newDocument = (OLESerialReceivingDocument) documentService.getNewDocument("OLE_SER_RECV_REC");
    newDocument.getDocumentHeader().setDocumentDescription(OLEConstants.SERIAL_REC_DESC + form.getDocument().getDocumentNumber());
    oleSerialReceivingService.disapproveCreateNewWithExisting(newDocument, oldSerialReceivingDocument);
    documentService.saveDocument(newDocument);
    form.setDocument(newDocument);
    return modelAndView;
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:28,代码来源:OLESerialReceivingController.java

示例2: saveDocument

import org.kuali.rice.krad.service.DocumentService; //导入方法依赖的package包/类
/**
 * Helper method to route the document.
 * 
 * @param document                 The assign contract manager document to be routed.
 * @param annotation               The annotation String.
 * @param documentService          The service to use to route the document.
 * @throws WorkflowException
 */
private void saveDocument(Document document, String annotation, DocumentService documentService) throws WorkflowException {
    try {
        documentService.saveDocument(document);
    }
    catch (ValidationException e) {
        // If the business rule evaluation fails then give us more info for debugging this test.
        fail(e.getMessage() + ", " + GlobalVariables.getMessageMap());
    }
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:18,代码来源:ElectronicInvoiceRejectDocumentTest.java

示例3: saveDocument

import org.kuali.rice.krad.service.DocumentService; //导入方法依赖的package包/类
public static void saveDocument(FinancialSystemTransactionalDocument document, DocumentService documentService) throws WorkflowException {
    try {
        documentService.saveDocument(document);
    }
    catch (ValidationException e) {
        // If the business rule evaluation fails then give us more info for debugging this test.
        Assert.fail("Document save failed with ValidationException: " + e.getMessage() + ", " + dumpMessageMapErrors());
    }
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:10,代码来源:AccountingDocumentTestUtils.java

示例4: saveDocument

import org.kuali.rice.krad.service.DocumentService; //导入方法依赖的package包/类
/**
 * Helper method to route the document.
 *
 * @param document                 The assign contract manager document to be routed.
 * @param annotation               The annotation String.
 * @param documentService          The service to use to route the document.
 * @throws WorkflowException
 */
private void saveDocument(Document document, String annotation, DocumentService documentService) throws WorkflowException {
    try {
        documentService.saveDocument(document);
    }
    catch (ValidationException e) {
        // If the business rule evaluation fails then give us more info for debugging this test.
        fail(e.getMessage() + ", " + GlobalVariables.getMessageMap());
    }
}
 
开发者ID:kuali,项目名称:kfs,代码行数:18,代码来源:ElectronicInvoiceRejectDocumentTest.java

示例5: saveDocument

import org.kuali.rice.krad.service.DocumentService; //导入方法依赖的package包/类
public static void saveDocument(Document document, DocumentService documentService) throws WorkflowException {
    try {
        documentService.saveDocument(document);
    }
    catch (ValidationException e) {
        // If the business rule evaluation fails then give us more info for debugging this test.
        fail(e.getMessage() + ", " + GlobalVariables.getMessageMap());
    }
}
 
开发者ID:kuali,项目名称:kfs,代码行数:10,代码来源:CloseServiceTest.java

示例6: createLicenseRequest

import org.kuali.rice.krad.service.DocumentService; //导入方法依赖的package包/类
/**                                                                                                                N
 *  This method creates license request for maintenanceDocument using  document number and  licenseRequest.
 * @param documentnumber
 * @param itemUUIDs
 */
@Override
public OleLicenseRequestBo createLicenseRequest(String documentnumber, String itemUUIDs) {
    try{
        String user = ConfigContext.getCurrentContextConfig().getProperty(OLEConstants.OleLicenseRequest.LICENSE_DOCUMENT_INITIATOR);
        GlobalVariables.setUserSession(new UserSession(user));
        DocumentService documentService= GlobalResourceLoader.getService(OLEConstants.DOCUMENT_HEADER_SERVICE);

        MaintenanceDocument licenseDoc = (MaintenanceDocument) documentService.getNewDocument(OLEConstants.OleLicenseRequest.LICENSE_REQUEST_DOC_TYPE);
        OleLicenseRequestBo oleLicenseRequestBo = (OleLicenseRequestBo) licenseDoc.getDocumentDataObject();
        oleLicenseRequestBo.setLocationId(OLEConstants.OleLicenseRequest.LICENSE_INITIAL_LOCATON);
        oleLicenseRequestBo.setLicenseRequestWorkflowTypeCode(OLEConstants.OleLicenseRequest.LICENSE_INITIAL_WORKFLOW);
        OleEventLogBo eventLog = new OleEventLogBo();
        eventLog.setEventType("system");
        eventLog.setCreatedBy(user);
        eventLog.setEventDescription(OLEConstants.OleLicenseRequest.LICENSE_REQ_INTIAL_EVENT_LOG);
        eventLog.setCurrentTimeStamp();
        oleLicenseRequestBo.getEventLogs().add(eventLog);
        oleLicenseRequestBo.seteResourceDocNumber(documentnumber);
        oleLicenseRequestBo.setLicenseRequestStatusCode(
                ConfigContext.getCurrentContextConfig().getProperty(OLEConstants.OleLicenseRequest.LICENSE_REQ_DOCUMENT_STATUS));
        if(licenseDoc.getDocumentNumber() != null) {
            oleLicenseRequestBo.setDocumentNumber(licenseDoc.getDocumentNumber());
            oleLicenseRequestBo.setLicenseDocumentNumber(licenseDoc.getDocumentNumber());
        }

        List<OleLicenseRequestItemTitle> oleLicenseRequestItemTitles= new ArrayList<OleLicenseRequestItemTitle>();
        OleLicenseRequestItemTitle oleLicenseRequestItemTitle;
        String[] bibUUIDs;
        if (itemUUIDs != null ) {
            bibUUIDs=itemUUIDs.split(",");
            for(int i=0;i<bibUUIDs.length;i++){
                oleLicenseRequestItemTitle=new OleLicenseRequestItemTitle();
                oleLicenseRequestItemTitle.setItemUUID(bibUUIDs[i]);
                oleLicenseRequestItemTitles.add(oleLicenseRequestItemTitle);
            }
        }

        oleLicenseRequestBo.setOleLicenseRequestItemTitles(oleLicenseRequestItemTitles);
        Date now = CoreApiServiceLocator.getDateTimeService().getCurrentSqlDate();
        Map criteria = new HashMap();
        criteria.put("code",
                ConfigContext.getCurrentContextConfig().getProperty(OLEConstants.OleLicenseRequest.LICENSE_REQ_DOCUMENT_STATUS));
        OleLicenseRequestStatus licenseRequestStatus = KRADServiceLocator.getBusinessObjectService().findByPrimaryKey(OleLicenseRequestStatus.class,
                criteria);
        licenseDoc.getDocumentHeader().getWorkflowDocument().setApplicationDocumentStatus(licenseRequestStatus.getName());

        licenseDoc.getDocumentHeader().setDocumentDescription(OLEConstants.OleLicenseRequest.LICENSE_DESC+"[date:"+now+"]");
        licenseDoc.getNewMaintainableObject().setDataObject(oleLicenseRequestBo);
        MaintenanceDocument createdLicenseRequest = (MaintenanceDocument)documentService.saveDocument(licenseDoc);
        DocumentRouteHeaderValue documentHeader= DocumentRouteHeaderValue.from(licenseDoc.getDocumentHeader().getWorkflowDocument().getDocument());
        oleLicenseRequestBo.setDocumentRouteHeaderValue(documentHeader);
        return oleLicenseRequestBo;

    }catch(Exception e){
        LOG.error("Exception while creating license request"+e.getMessage());
        throw new RuntimeException(e);
    }
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:64,代码来源:OleLicenseRequestWebServiceImpl.java

示例7: setUp

import org.kuali.rice.krad.service.DocumentService; //导入方法依赖的package包/类
/**
 * @see junit.framework.TestCase#setUp()
 */
@Override
protected void setUp() throws Exception {
    super.setUp();

    // setting up document
    String chartCode = "BL";
    String orgCode = "UGCS";
    String customerNumber = "ABB2";
    String customerName = "WOODS CORPORATION";

    // To create a basic invoice with test data
    DocumentService documentService = SpringContext.getBean(DocumentService.class);
    ContractsAndGrantsBillingAward award = ARAwardFixture.CG_AWARD_MONTHLY_BILLED_DATE_NULL.createAward();
    ContractsAndGrantsBillingAwardAccount awardAccount_1 = ARAwardAccountFixture.AWD_ACCT_1.createAwardAccount();
    List<ContractsAndGrantsBillingAwardAccount> awardAccounts = new ArrayList<ContractsAndGrantsBillingAwardAccount>();
    awardAccounts.add(awardAccount_1);
    award.getActiveAwardAccounts().clear();

    award.getActiveAwardAccounts().add(awardAccount_1);
    award = ARAwardFixture.CG_AWARD_MONTHLY_BILLED_DATE_NULL.setAgencyFromFixture((Award) award);

    List<ErrorMessage> errorMessages = new ArrayList<ErrorMessage>();
    ContractsGrantsInvoiceDocument cgInvoice = SpringContext.getBean(ContractsGrantsInvoiceCreateDocumentService.class).createCGInvoiceDocumentByAwardInfo(award, awardAccounts, chartCode, orgCode, errorMessages, null, null);
    cgInvoice.getFinancialSystemDocumentHeader().setFinancialDocumentStatusCode(KFSConstants.DocumentStatusCodes.APPROVED);
    cgInvoice.getAccountsReceivableDocumentHeader().setCustomerNumber(customerNumber);
    cgInvoice.getAccountsReceivableDocumentHeader().setDocumentHeader(cgInvoice.getDocumentHeader());

    cgInvoice.setBillingDate(new java.sql.Date(new Date().getTime()));
    cgInvoice.getInvoiceGeneralDetail().setAward(award);
    cgInvoice.setOpenInvoiceIndicator(true);
    cgInvoice.setCustomerName(customerName);
    for (InvoiceAddressDetail invoiceAddressDetail : cgInvoice.getInvoiceAddressDetails()) {
        invoiceAddressDetail.setCustomerInvoiceTemplateCode("STD");
        invoiceAddressDetail.setInvoiceTransmissionMethodCode("MAIL");
    }

    documentService.saveDocument(cgInvoice);

    contractsGrantsAgingReportLookupableHelperServiceImpl = new ContractsGrantsAgingReportLookupableHelperServiceImpl();
    contractsGrantsAgingReportLookupableHelperServiceImpl.setBusinessObjectService(SpringContext.getBean(BusinessObjectService.class));
    contractsGrantsAgingReportLookupableHelperServiceImpl.setBusinessObjectClass(ContractsAndGrantsAgingReport.class);
    contractsGrantsAgingReportLookupableHelperServiceImpl.setDateTimeService(SpringContext.getBean(DateTimeService.class));
    contractsGrantsAgingReportLookupableHelperServiceImpl.setContractsGrantsAgingReportService(SpringContext.getBean(ContractsGrantsAgingReportService.class));
    contractsGrantsAgingReportLookupableHelperServiceImpl.setCustomerAgingReportService(SpringContext.getBean(CustomerAgingReportService.class));
    contractsGrantsAgingReportLookupableHelperServiceImpl.setCustomerCreditMemoDocumentService(SpringContext.getBean(CustomerCreditMemoDocumentService.class));
    contractsGrantsAgingReportLookupableHelperServiceImpl.setModuleService(SpringContext.getBean(KualiModuleService.class));
    contractsGrantsAgingReportLookupableHelperServiceImpl.afterPropertiesSet();
    fieldValues = new LinkedHashMap();

    DateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy");
    fieldValues.put("backLocation", null);
    fieldValues.put("reportRunDate", dateFormat.format(new Date()));
    fieldValues.put("docFormKey", null);
    fieldValues.put("businessObjectClassName", ContractsAndGrantsAgingReport.class.getName());

}
 
开发者ID:kuali,项目名称:kfs,代码行数:60,代码来源:ContractsGrantsAgingReportLookupableHelperServiceImplTest.java

示例8: setUp

import org.kuali.rice.krad.service.DocumentService; //导入方法依赖的package包/类
/**
 * @see junit.framework.TestCase#setUp()
 */
@Override
protected void setUp() throws Exception {
    super.setUp();
    generateDunningLettersLookupableHelperServiceImpl = new GenerateDunningLettersLookupableHelperServiceImpl();
    generateDunningLettersLookupableHelperServiceImpl.setContractsGrantsInvoiceDocumentService(SpringContext.getBean(ContractsGrantsInvoiceDocumentService.class));
    generateDunningLettersLookupableHelperServiceImpl.setContractsGrantsReportHelperService(SpringContext.getBean(ContractsGrantsReportHelperService.class));
    generateDunningLettersLookupableHelperServiceImpl.setBusinessObjectClass(GenerateDunningLettersLookupResult.class);
    generateDunningLettersLookupableHelperServiceImpl.setBusinessObjectService(SpringContext.getBean(BusinessObjectService.class));
    generateDunningLettersLookupableHelperServiceImpl.setAccountService(SpringContext.getBean(AccountService.class));
    generateDunningLettersLookupableHelperServiceImpl.setParameterService(SpringContext.getBean(ParameterService.class));
    generateDunningLettersLookupableHelperServiceImpl.setDunningLetterService(SpringContext.getBean(DunningLetterService.class));
    DocumentService documentService = SpringContext.getBean(DocumentService.class);
    generateDunningLettersLookupForm = new GenerateDunningLettersLookupForm();
    // To create a basic invoice with test data

    String coaCode = "BL";
    String orgCode = "SRS";
    ContractsAndGrantsBillingAward award = ARAwardFixture.CG_AWARD_MONTHLY_BILLED_DATE_NULL.createAward();
    ContractsAndGrantsBillingAwardAccount awardAccount_1 = ARAwardAccountFixture.AWD_ACCT_1.createAwardAccount();
    List<ContractsAndGrantsBillingAwardAccount> awardAccounts = new ArrayList<ContractsAndGrantsBillingAwardAccount>();
    awardAccounts.add(awardAccount_1);
    award.getActiveAwardAccounts().clear();

    award.getActiveAwardAccounts().add(awardAccount_1);
    award = ARAwardFixture.CG_AWARD_MONTHLY_BILLED_DATE_NULL.setAgencyFromFixture((Award) award);
    // To add data for OrganizationOptions as fixture.


    OrganizationOptions organizationOptions = new OrganizationOptions();

    organizationOptions.setChartOfAccountsCode(coaCode);
    organizationOptions.setOrganizationCode(orgCode);
    organizationOptions.setProcessingChartOfAccountCode(coaCode);
    organizationOptions.setProcessingOrganizationCode(orgCode);
    SpringContext.getBean(BusinessObjectService.class).save(organizationOptions);

    List<ErrorMessage> errorMessages = new ArrayList<ErrorMessage>();
    ContractsGrantsInvoiceDocument cgInvoice = SpringContext.getBean(ContractsGrantsInvoiceCreateDocumentService.class).createCGInvoiceDocumentByAwardInfo(award, awardAccounts, coaCode, orgCode, errorMessages, null, null);
    cgInvoice.getFinancialSystemDocumentHeader().setFinancialDocumentStatusCode(KFSConstants.DocumentStatusCodes.APPROVED);

    // To create Dunning Campaign and Dunning LEtter Distribtuions and templates.

    DunningCampaign dunningCampaign = DunningCampaignFixture.AR_DUNC1.createDunningCampaign();
    DunningLetterDistribution dunningLetterDistribution = DunningLetterDistributionFixture.AR_DLD1.createDunningLetterDistribution();
    dunningLetterDistribution.setActiveIndicator(true);
    dunningLetterDistribution.setSendDunningLetterIndicator(true);
    DunningLetterTemplate dunningLetterTemplate = DunningLetterTemplateFixture.CG_DLTS1.createDunningLetterTemplate();
    SpringContext.getBean(BusinessObjectService.class).save(dunningLetterTemplate);
    dunningLetterDistribution.setDunningLetterTemplate(dunningLetterTemplate.getDunningLetterTemplateCode());
    dunningCampaign.getDunningLetterDistributions().add(dunningLetterDistribution);
    SpringContext.getBean(BusinessObjectService.class).save(dunningCampaign);

    award = ARAwardFixture.CG_AWARD_MONTHLY_BILLED_DATE_NULL.setDunningCampaignFromFixture((Award) award);
    cgInvoice.getInvoiceGeneralDetail().setAward(award);
    cgInvoice.setAge(10);
    Timestamp ts = new Timestamp(new java.util.Date().getTime());
    Date today = new Date(ts.getTime());

    cgInvoice.setBillingDate(today);
    for (InvoiceAddressDetail invoiceAddressDetail : cgInvoice.getInvoiceAddressDetails()) {
        invoiceAddressDetail.setCustomerInvoiceTemplateCode("STD");
        invoiceAddressDetail.setInvoiceTransmissionMethodCode("MAIL");
    }
    documentService.saveDocument(cgInvoice);
    fieldValues = new LinkedHashMap();
    fieldValues.put("invoiceDocumentNumber", cgInvoice.getDocumentNumber());

    Map<String, String> qualification = new HashMap<String, String>(3);
    qualification.put(ArKimAttributes.BILLING_CHART_OF_ACCOUNTS_CODE, cgInvoice.getBillByChartOfAccountCode());
    qualification.put(ArKimAttributes.BILLING_ORGANIZATION_CODE, cgInvoice.getBilledByOrganizationCode());

    org.kuali.rice.kim.api.role.RoleService roleService = KimApiServiceLocator.getRoleService();
    Person user = GlobalVariables.getUserSession().getPerson();
    roleService.assignPrincipalToRole(user.getPrincipalId(), ArConstants.AR_NAMESPACE_CODE, KFSConstants.SysKimApiConstants.ACCOUNTS_RECEIVABLE_COLLECTOR, qualification);

}
 
开发者ID:kuali,项目名称:kfs,代码行数:80,代码来源:DunningLetterDistributionLookupableHelperServiceImplTest.java

示例9: testPerformLookup

import org.kuali.rice.krad.service.DocumentService; //导入方法依赖的package包/类
/**
 * This method tests the performLookup method of TicklersReportLookupableHelperServiceImpl.
 */
public void testPerformLookup() throws WorkflowException {
    DocumentService documentService = SpringContext.getBean(DocumentService.class);
    Collection resultTable = new ArrayList<String>();
    // To create a basic invoice with test data

    ContractsAndGrantsBillingAward award = ARAwardFixture.CG_AWARD_MONTHLY_BILLED_DATE_NULL.createAward();
    ContractsAndGrantsBillingAwardAccount awardAccount_1 = ARAwardAccountFixture.AWD_ACCT_1.createAwardAccount();
    List<ContractsAndGrantsBillingAwardAccount> awardAccounts = new ArrayList<ContractsAndGrantsBillingAwardAccount>();
    awardAccounts.add(awardAccount_1);
    award.getActiveAwardAccounts().clear();

    award.getActiveAwardAccounts().add(awardAccount_1);
    award = ARAwardFixture.CG_AWARD_MONTHLY_BILLED_DATE_NULL.setAgencyFromFixture((Award) award);

    // To add data for OrganizationOptions as fixture.
    OrganizationOptions organizationOptions = new OrganizationOptions();

    organizationOptions.setChartOfAccountsCode(CHART_OF_ACCOUNTS_CODE);
    organizationOptions.setOrganizationCode(ORGANIZATION_CODE);
    organizationOptions.setProcessingChartOfAccountCode(CHART_OF_ACCOUNTS_CODE);
    organizationOptions.setProcessingOrganizationCode(ORGANIZATION_CODE);
    SpringContext.getBean(BusinessObjectService.class).save(organizationOptions);

    List<ErrorMessage> errorMessages = new ArrayList<ErrorMessage>();
    ContractsGrantsInvoiceDocument cgInvoice = SpringContext.getBean(ContractsGrantsInvoiceCreateDocumentService.class).createCGInvoiceDocumentByAwardInfo(award, awardAccounts, CHART_OF_ACCOUNTS_CODE, ORGANIZATION_CODE, errorMessages, null, null);
    cgInvoice.getFinancialSystemDocumentHeader().setFinancialDocumentStatusCode(KFSConstants.DocumentStatusCodes.APPROVED);
    for (InvoiceAddressDetail invoiceAddressDetail : cgInvoice.getInvoiceAddressDetails()) {
        invoiceAddressDetail.setCustomerInvoiceTemplateCode("STD");
        invoiceAddressDetail.setInvoiceTransmissionMethodCode("MAIL");
    }
    documentService.saveDocument(cgInvoice);

    // to Add events
    CollectionEvent event = new CollectionEvent();
    event.setInvoiceNumber(cgInvoice.getDocumentNumber());
    event.setActivityCode("TEST");
    event.setUser(user);
    Timestamp ts = new Timestamp(new java.util.Date().getTime());
    Date today = new Date(ts.getTime());
    event.setFollowupDate(today);
    event.setInvoiceDocument(cgInvoice);
    SpringContext.getBean(BusinessObjectService.class).save(event);

    cgInvoice.getCollectionEvents().add(event);
    documentService.saveDocument(cgInvoice);

    ticklersReportLookupForm.setFieldsForLookup(fieldValues);

    assertTrue(ticklersReportLookupableHelperServiceImpl.performLookup(ticklersReportLookupForm, resultTable, true).size() > 0);
}
 
开发者ID:kuali,项目名称:kfs,代码行数:54,代码来源:TicklersReportLookupableHelperServiceImplTest.java

示例10: setUp

import org.kuali.rice.krad.service.DocumentService; //导入方法依赖的package包/类
/**
 * @see junit.framework.TestCase#setUp()
 */
@Override
protected void setUp() throws Exception {
    super.setUp();

    // setting up document
    String chartCode = "BL";
    //String orgCode = "SRS";
    String orgCode = "UGCS";

    String customerNumber = "ABB2";
    String customerName = "WOODS CORPORATION";

    // To create a basic invoice with test data
    DocumentService documentService = SpringContext.getBean(DocumentService.class);
    ContractsAndGrantsBillingAward award = ARAwardFixture.CG_AWARD_MONTHLY_BILLED_DATE_NULL.createAward();
    ContractsAndGrantsBillingAwardAccount awardAccount_1 = ARAwardAccountFixture.AWD_ACCT_1.createAwardAccount();
    List<ContractsAndGrantsBillingAwardAccount> awardAccounts = new ArrayList<ContractsAndGrantsBillingAwardAccount>();
    awardAccounts.add(awardAccount_1);
    award.getActiveAwardAccounts().clear();

    award.getActiveAwardAccounts().add(awardAccount_1);
    award = ARAwardFixture.CG_AWARD_MONTHLY_BILLED_DATE_NULL.setAgencyFromFixture((Award) award);

    List<ErrorMessage> errorMessages = new ArrayList<ErrorMessage>();
    ContractsGrantsInvoiceDocument cgInvoice = SpringContext.getBean(ContractsGrantsInvoiceCreateDocumentService.class).createCGInvoiceDocumentByAwardInfo(award, awardAccounts, chartCode, orgCode, errorMessages, null, null);
    cgInvoice.getFinancialSystemDocumentHeader().setFinancialDocumentStatusCode(KFSConstants.DocumentStatusCodes.APPROVED);
    cgInvoice.getAccountsReceivableDocumentHeader().setCustomerNumber(customerNumber);

    cgInvoice.getAccountsReceivableDocumentHeader().setDocumentHeader(cgInvoice.getDocumentHeader());

    cgInvoice.setBillingDate(new java.sql.Date(new Date().getTime()));
    cgInvoice.getInvoiceGeneralDetail().setAward(award);
    cgInvoice.setOpenInvoiceIndicator(true);

    cgInvoice.setCustomerName(customerName);
    for (InvoiceAddressDetail invoiceAddressDetail : cgInvoice.getInvoiceAddressDetails()) {
        invoiceAddressDetail.setCustomerInvoiceTemplateCode("STD");
        invoiceAddressDetail.setInvoiceTransmissionMethodCode("MAIL");
    }
    documentService.saveDocument(cgInvoice);

    agingOpenInvoicesReportLookupableHelperServiceImpl = new ContractsGrantsAgingOpenInvoicesReportLookupableHelperServiceImpl();
    agingOpenInvoicesReportLookupableHelperServiceImpl.setBusinessObjectService(SpringContext.getBean(BusinessObjectService.class));
    agingOpenInvoicesReportLookupableHelperServiceImpl.setBusinessObjectClass(ContractsGrantsAgingOpenInvoicesReport.class);
    agingOpenInvoicesReportLookupableHelperServiceImpl.setContractsGrantsAgingOpenInvoicesReportService(SpringContext.getBean(ContractsGrantsAgingOpenInvoicesReportService.class));
    agingOpenInvoicesReportLookupableHelperServiceImpl.setContractsGrantsReportHelperService(SpringContext.getBean(ContractsGrantsReportHelperService.class));
    fieldValues = new LinkedHashMap();

    DateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy");
    fieldValues.put("backLocation", null);
    fieldValues.put("reportRunDate", dateFormat.format(new Date()));
    fieldValues.put(KFSPropertyConstants.ORGANIZATION_CODE, orgCode);
    fieldValues.put(ArPropertyConstants.BILLING_CHART_CODE, chartCode);
    fieldValues.put("docFormKey", null);
    fieldValues.put(KFSPropertyConstants.CUSTOMER_NUMBER, customerNumber);
    fieldValues.put(KFSPropertyConstants.CUSTOMER_NAME, customerName);
    fieldValues.put("businessObjectClassName", ContractsGrantsAgingOpenInvoicesReport.class.getName());

    Map<String,String[]> parameters = new HashMap<String, String[]>();
    parameters.put(KFSPropertyConstants.CUSTOMER_NUMBER, new String[] { customerNumber });
    parameters.put(KFSPropertyConstants.CUSTOMER_NAME, new String[] { customerName });
    agingOpenInvoicesReportLookupableHelperServiceImpl.setParameters(parameters);

}
 
开发者ID:kuali,项目名称:kfs,代码行数:68,代码来源:ContractsGrantsAgingOpenInvoicesReportLookupableHelperServiceImplTest.java

示例11: setUp

import org.kuali.rice.krad.service.DocumentService; //导入方法依赖的package包/类
/**
 * @see junit.framework.TestCase#setUp()
 */
@Override
public void setUp() throws Exception {
    super.setUp();
    // setting up document
    String chartCode = "BL";
    String orgCode = "UGCS";

    // To create a basic invoice with test data
    DocumentService documentService = SpringContext.getBean(DocumentService.class);
    ContractsAndGrantsBillingAward award = ARAwardFixture.CG_AWARD_MONTHLY_BILLED_DATE_NULL.createAward();
    ContractsAndGrantsBillingAwardAccount awardAccount_1 = ARAwardAccountFixture.AWD_ACCT_1.createAwardAccount();
    List<ContractsAndGrantsBillingAwardAccount> awardAccounts = new ArrayList<ContractsAndGrantsBillingAwardAccount>();
    awardAccounts.add(awardAccount_1);
    award.getActiveAwardAccounts().clear();

    award.getActiveAwardAccounts().add(awardAccount_1);
    award = ARAwardFixture.CG_AWARD_MONTHLY_BILLED_DATE_NULL.setAgencyFromFixture((Award) award);

    BusinessObjectService businessObjectService = SpringContext.getBean(BusinessObjectService.class);
    List<ErrorMessage> errorMessages = new ArrayList<ErrorMessage>();
    ContractsGrantsInvoiceDocument cgInvoice = SpringContext.getBean(ContractsGrantsInvoiceCreateDocumentService.class).createCGInvoiceDocumentByAwardInfo(award, awardAccounts, chartCode, orgCode, errorMessages, null, null);

    DocumentHeader documentHeader = cgInvoice.getDocumentHeader();
    WorkflowDocument workflowDocument = documentHeader.getWorkflowDocument();

    cgInvoice.getFinancialSystemDocumentHeader().setFinancialDocumentStatusCode(KFSConstants.DocumentStatusCodes.APPROVED);

    cgInvoice.getAccountsReceivableDocumentHeader().setCustomerNumber(CUSTOMER_NUMBER);
    cgInvoice.getAccountsReceivableDocumentHeader().setDocumentHeader(documentHeader);

    cgInvoice.setBillingDate(new java.sql.Date(new Date().getTime()));
    cgInvoice.getInvoiceGeneralDetail().setAward(award);
    cgInvoice.setOpenInvoiceIndicator(true);
    cgInvoice.setCustomerName(CUSTOMER_NAME);
    for (InvoiceAddressDetail invoiceAddressDetail : cgInvoice.getInvoiceAddressDetails()) {
        invoiceAddressDetail.setCustomerInvoiceTemplateCode("STD");
        invoiceAddressDetail.setInvoiceTransmissionMethodCode("MAIL");
    }
    documentService.saveDocument(cgInvoice);

    contractsGrantsAgingOpenInvoicesReportService = SpringContext.getBean(ContractsGrantsAgingOpenInvoicesReportService.class);
}
 
开发者ID:kuali,项目名称:kfs,代码行数:46,代码来源:ContractsGrantsAgingOpenInvoicesReportServiceTest.java

示例12: setUp

import org.kuali.rice.krad.service.DocumentService; //导入方法依赖的package包/类
/**
 * @see junit.framework.TestCase#setUp()
 */
@Override
public void setUp() throws Exception {
    super.setUp();

    // setting up document
    String chartCode = "BL";
    String orgCode = "SRS";

    // To create a basic invoice with test data
    DocumentService documentService = SpringContext.getBean(DocumentService.class);
    ContractsAndGrantsBillingAward award = ARAwardFixture.CG_AWARD_MONTHLY_BILLED_DATE_NULL.createAward();
    ContractsAndGrantsBillingAwardAccount awardAccount_1 = ARAwardAccountFixture.AWD_ACCT_1.createAwardAccount();
    List<ContractsAndGrantsBillingAwardAccount> awardAccounts = new ArrayList<ContractsAndGrantsBillingAwardAccount>();
    awardAccounts.add(awardAccount_1);
    award.getActiveAwardAccounts().clear();

    award.getActiveAwardAccounts().add(awardAccount_1);
    award = ARAwardFixture.CG_AWARD_MONTHLY_BILLED_DATE_NULL.setAgencyFromFixture((Award) award);

    List<ErrorMessage> errorMessages = new ArrayList<ErrorMessage>();
    ContractsGrantsInvoiceDocument cgInvoice = SpringContext.getBean(ContractsGrantsInvoiceCreateDocumentService.class).createCGInvoiceDocumentByAwardInfo(award, awardAccounts, chartCode, orgCode, errorMessages, null, null);

    DocumentHeader documentHeader = cgInvoice.getDocumentHeader();
    WorkflowDocument workflowDocument = documentHeader.getWorkflowDocument();

    cgInvoice.getFinancialSystemDocumentHeader().setFinancialDocumentStatusCode(KFSConstants.DocumentStatusCodes.APPROVED);
    cgInvoice.getAccountsReceivableDocumentHeader().setCustomerNumber(CUSTOMER_NUMBER);
    cgInvoice.getAccountsReceivableDocumentHeader().setDocumentHeader(documentHeader);

    cgInvoice.setBillingDate(new java.sql.Date(new Date().getTime()));
    cgInvoice.getInvoiceGeneralDetail().setAward(award);
    cgInvoice.setOpenInvoiceIndicator(true);
    cgInvoice.setCustomerName(CUSTOMER_NAME);
    for (InvoiceAddressDetail invoiceAddressDetail : cgInvoice.getInvoiceAddressDetails()) {
        invoiceAddressDetail.setCustomerInvoiceTemplateCode("STD");
        invoiceAddressDetail.setInvoiceTransmissionMethodCode("MAIL");
    }
    documentService.saveDocument(cgInvoice);
    cgInvoice.getAccountsReceivableDocumentHeader().refresh();
    contractsGrantsAgingReportService = SpringContext.getBean(ContractsGrantsAgingReportService.class);

    OrganizationOptions organizationOptions = new OrganizationOptions();

    organizationOptions.setChartOfAccountsCode(chartCode);
    organizationOptions.setOrganizationCode(orgCode);
    organizationOptions.setProcessingChartOfAccountCode(chartCode);
    organizationOptions.setProcessingOrganizationCode(orgCode);
    organizationOptions.setCgBillerIndicator(true);
    SpringContext.getBean(BusinessObjectService.class).save(organizationOptions);

    Map<String, String> qualification = new HashMap<String, String>(3);
    qualification.put(ArKimAttributes.BILLING_CHART_OF_ACCOUNTS_CODE, cgInvoice.getBillByChartOfAccountCode());
    qualification.put(ArKimAttributes.BILLING_ORGANIZATION_CODE, cgInvoice.getBilledByOrganizationCode());

    org.kuali.rice.kim.api.role.RoleService roleService = KimApiServiceLocator.getRoleService();
    Person user = GlobalVariables.getUserSession().getPerson();
    roleService.assignPrincipalToRole(user.getPrincipalId(), ArConstants.AR_NAMESPACE_CODE, KFSConstants.SysKimApiConstants.ACCOUNTS_RECEIVABLE_COLLECTOR, qualification);
}
 
开发者ID:kuali,项目名称:kfs,代码行数:62,代码来源:ContractsGrantsAgingReportServiceTest.java


注:本文中的org.kuali.rice.krad.service.DocumentService.saveDocument方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。