Search in sources :

Example 6 with DocumentHeader

use of org.kuali.kfs.krad.bo.DocumentHeader in project cu-kfs by CU-CommunityApps.

the class CuFinancialMaintenanceDocumentActionTest method createMockDocumentHeader.

protected DocumentHeader createMockDocumentHeader(DocumentStatus documentStatus) {
    DocumentHeader documentHeader = mock(FinancialSystemDocumentHeader.class);
    WorkflowDocument mockWorkflowDocument = createMockWorkflowDocument(documentStatus);
    when(documentHeader.getWorkflowDocument()).thenReturn(mockWorkflowDocument);
    return documentHeader;
}
Also used : WorkflowDocument(org.kuali.rice.kew.api.WorkflowDocument) FinancialSystemDocumentHeader(org.kuali.kfs.sys.businessobject.FinancialSystemDocumentHeader) DocumentHeader(org.kuali.kfs.krad.bo.DocumentHeader)

Example 7 with DocumentHeader

use of org.kuali.kfs.krad.bo.DocumentHeader in project cu-kfs by CU-CommunityApps.

the class CuFinancialMaintenanceDocumentActionTest method setupMockMaintenanceDocument.

protected void setupMockMaintenanceDocument(Class<? extends PersistableBusinessObject> dataObjectClass, DocumentStatus documentStatus, String objectId) {
    Maintainable mockMaintainable = createMockMaintainable(dataObjectClass, objectId);
    PersistableBusinessObject mockDataObject = (PersistableBusinessObject) mockMaintainable.getDataObject();
    DocumentHeader mockDocumentHeader = createMockDocumentHeader(documentStatus);
    testDocument = mock(FinancialSystemMaintenanceDocument.class);
    when(((FinancialSystemMaintenanceDocument) testDocument).getNewMaintainableObject()).thenReturn(mockMaintainable);
    when(testDocument.getNoteTarget()).thenReturn(mockDataObject);
    when(testDocument.getDocumentHeader()).thenReturn(mockDocumentHeader);
}
Also used : PersistableBusinessObject(org.kuali.kfs.krad.bo.PersistableBusinessObject) FinancialSystemMaintenanceDocument(org.kuali.kfs.sys.document.FinancialSystemMaintenanceDocument) FinancialSystemDocumentHeader(org.kuali.kfs.sys.businessobject.FinancialSystemDocumentHeader) DocumentHeader(org.kuali.kfs.krad.bo.DocumentHeader) Maintainable(org.kuali.kfs.kns.maintenance.Maintainable) FinancialSystemMaintainable(org.kuali.kfs.sys.document.FinancialSystemMaintainable)

Example 8 with DocumentHeader

use of org.kuali.kfs.krad.bo.DocumentHeader in project cu-kfs by CU-CommunityApps.

the class AccountReversionTrickleDownInactivationServiceImpl method addNotesToDocument.

/**
 * Adds notes about inactivated AccountReversions, any errors while persisting inactivated account reversions or account reversions that were loccked.
 *
 * @param documentNumber
 * @param inactivatedAccountReversions
 * @param alreadyLockedAccountReversions
 * @param errorPersistingAccountReversions
 */
protected void addNotesToDocument(String documentNumber, List<AccountReversion> inactivatedAccountReversions, Map<AccountReversion, String> alreadyLockedAccountReversions, List<AccountReversion> errorPersistingAccountReversions) {
    if (inactivatedAccountReversions.isEmpty() && alreadyLockedAccountReversions.isEmpty() && errorPersistingAccountReversions.isEmpty()) {
        // if we didn't try to inactivate any AccountReversions, then don't bother
        return;
    }
    DocumentHeader noteParent = documentHeaderService.getDocumentHeaderById(documentNumber);
    Note newNote = new Note();
    addNotes(documentNumber, inactivatedAccountReversions, CUKFSKeyConstants.ACCOUNT_REVERSION_TRICKLE_DOWN_INACTIVATION, noteParent, newNote);
    addNotes(documentNumber, errorPersistingAccountReversions, CUKFSKeyConstants.ACCOUNT_REVERSION_TRICKLE_DOWN_INACTIVATION_ERROR_DURING_PERSISTENCE, noteParent, newNote);
    addMaintenanceLockedNotes(documentNumber, alreadyLockedAccountReversions, CUKFSKeyConstants.ACCOUNT_REVERSION_TRICKLE_DOWN_INACTIVATION_RECORD_ALREADY_MAINTENANCE_LOCKED, noteParent, newNote);
}
Also used : Note(org.kuali.kfs.krad.bo.Note) DocumentHeader(org.kuali.kfs.krad.bo.DocumentHeader)

Example 9 with DocumentHeader

use of org.kuali.kfs.krad.bo.DocumentHeader in project cu-kfs by CU-CommunityApps.

the class CuFinancialMaintenanceDocumentActionTest method setupMockTransactionalDocument.

protected void setupMockTransactionalDocument(DocumentStatus documentStatus) {
    testDocument = mock(FinancialSystemTransactionalDocumentBase.class);
    DocumentHeader mockDocumentHeader = createMockDocumentHeader(documentStatus);
    when(testDocument.getDocumentHeader()).thenReturn(mockDocumentHeader);
}
Also used : FinancialSystemTransactionalDocumentBase(org.kuali.kfs.sys.document.FinancialSystemTransactionalDocumentBase) FinancialSystemDocumentHeader(org.kuali.kfs.sys.businessobject.FinancialSystemDocumentHeader) DocumentHeader(org.kuali.kfs.krad.bo.DocumentHeader)

Aggregations

DocumentHeader (org.kuali.kfs.krad.bo.DocumentHeader)9 FinancialSystemDocumentHeader (org.kuali.kfs.sys.businessobject.FinancialSystemDocumentHeader)5 Note (org.kuali.kfs.krad.bo.Note)3 MaintenanceDocument (org.kuali.kfs.kns.document.MaintenanceDocument)2 Document (org.kuali.kfs.krad.document.Document)2 FinancialSystemMaintenanceDocument (org.kuali.kfs.sys.document.FinancialSystemMaintenanceDocument)2 HashMap (java.util.HashMap)1 Map (java.util.Map)1 ActionForward (org.apache.struts.action.ActionForward)1 FormFile (org.apache.struts.upload.FormFile)1 AccountGlobal (org.kuali.kfs.coa.businessobject.AccountGlobal)1 AccountGlobalDetail (org.kuali.kfs.coa.businessobject.AccountGlobalDetail)1 LaborLedgerPostingDocumentForSearching (org.kuali.kfs.integration.ld.LaborLedgerPostingDocumentForSearching)1 DocumentAuthorizer (org.kuali.kfs.kns.document.authorization.DocumentAuthorizer)1 Maintainable (org.kuali.kfs.kns.maintenance.Maintainable)1 KualiDocumentFormBase (org.kuali.kfs.kns.web.struts.form.KualiDocumentFormBase)1 Attachment (org.kuali.kfs.krad.bo.Attachment)1 PersistableBusinessObject (org.kuali.kfs.krad.bo.PersistableBusinessObject)1 DataDictionary (org.kuali.kfs.krad.datadictionary.DataDictionary)1 DocumentEntry (org.kuali.kfs.krad.datadictionary.DocumentEntry)1