Search in sources :

Example 11 with ContractsAndGrantsBillingAward

use of org.kuali.kfs.integration.cg.ContractsAndGrantsBillingAward in project cu-kfs by CU-CommunityApps.

the class ContractsGrantsInvoiceCreateDocumentServiceImpl method writeErrorToFile.

protected void writeErrorToFile(Map<ContractsAndGrantsBillingAward, List<String>> invalidGroup, String errOutputFile) {
    PrintStream outputFileStream = null;
    File errOutPutfile = new File(errOutputFile);
    try {
        outputFileStream = new PrintStream(errOutPutfile, StandardCharsets.UTF_8);
        writeReportHeader(outputFileStream);
        for (ContractsAndGrantsBillingAward award : invalidGroup.keySet()) {
            writeErrorEntryByAward(award, invalidGroup.get(award), outputFileStream);
        }
        outputFileStream.print("\r\n");
    } catch (IOException ioe) {
        LOG.error("Could not write errors in Contracts & Grants Invoice Document creation process to file" + ioe.getMessage());
        throw new RuntimeException("Could not write errors in Contracts & Grants Invoice Document creation " + "process to file", ioe);
    } finally {
        if (outputFileStream != null) {
            outputFileStream.close();
        }
    }
}
Also used : PrintStream(java.io.PrintStream) ContractsAndGrantsBillingAward(org.kuali.kfs.integration.cg.ContractsAndGrantsBillingAward) IOException(java.io.IOException) File(java.io.File)

Aggregations

ContractsAndGrantsBillingAward (org.kuali.kfs.integration.cg.ContractsAndGrantsBillingAward)11 HashMap (java.util.HashMap)4 ContractsAndGrantsBillingAwardAccount (org.kuali.kfs.integration.cg.ContractsAndGrantsBillingAwardAccount)4 KualiDecimal (org.kuali.kfs.core.api.util.type.KualiDecimal)3 ContractsGrantsInvoiceDocumentErrorMessage (org.kuali.kfs.module.ar.businessobject.ContractsGrantsInvoiceDocumentErrorMessage)3 InvoiceAccountDetail (org.kuali.kfs.module.ar.businessobject.InvoiceAccountDetail)3 Date (java.sql.Date)2 ArrayList (java.util.ArrayList)2 ContractsGrantsInvoiceDocumentErrorLog (org.kuali.kfs.module.ar.businessobject.ContractsGrantsInvoiceDocumentErrorLog)2 InvoiceGeneralDetail (org.kuali.kfs.module.ar.businessobject.InvoiceGeneralDetail)2 SystemOptions (org.kuali.kfs.sys.businessobject.SystemOptions)2 File (java.io.File)1 IOException (java.io.IOException)1 PrintStream (java.io.PrintStream)1 List (java.util.List)1 Account (org.kuali.kfs.coa.businessobject.Account)1 ContractsAndGrantsOrganization (org.kuali.kfs.integration.cg.ContractsAndGrantsOrganization)1 ErrorMessage (org.kuali.kfs.krad.util.ErrorMessage)1 ContractsGrantsLetterOfCreditReviewDetail (org.kuali.kfs.module.ar.businessobject.ContractsGrantsLetterOfCreditReviewDetail)1 CustomerInvoiceDetail (org.kuali.kfs.module.ar.businessobject.CustomerInvoiceDetail)1