001    /*
002     * Copyright 2011 The Kuali Foundation.
003     * 
004     * Licensed under the Educational Community License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     * 
008     * http://www.opensource.org/licenses/ecl2.php
009     * 
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     * See the License for the specific language governing permissions and
014     * limitations under the License.
015     */
016    /*
017     * Created on Mar 9, 2005
018     *
019     */
020    package org.kuali.kfs.module.purap.businessobject;
021    
022    import java.io.File;
023    import java.util.ArrayList;
024    import java.util.HashMap;
025    import java.util.List;
026    import java.util.Map;
027    
028    import org.kuali.kfs.module.purap.document.ElectronicInvoiceRejectDocument;
029    
030    public class ElectronicInvoiceLoad {
031    
032        private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(ElectronicInvoiceLoad.class);
033    
034        private Map invoiceLoadSummaries;
035        private Map rejectFilesToMove;
036        private List rejectDocumentList;
037    
038        public ElectronicInvoiceLoad() {
039            invoiceLoadSummaries = new HashMap();
040            rejectFilesToMove = new HashMap();
041            rejectDocumentList = new ArrayList();
042        }
043    
044        public void insertInvoiceLoadSummary(ElectronicInvoiceLoadSummary eils) {
045            invoiceLoadSummaries.put(eils.getVendorDunsNumber(), eils);
046        }
047    
048        public void addRejectFileToMove(File file, String directory) {
049            rejectFilesToMove.put(file, directory);
050        }
051    
052        public void addInvoiceReject(ElectronicInvoiceRejectDocument eir) {
053            rejectDocumentList.add(eir);
054        }
055    
056        public List getRejectDocuments() {
057            return rejectDocumentList;
058        }
059    
060        public Map getInvoiceLoadSummaries() {
061            return invoiceLoadSummaries;
062        }
063    
064        public void setInvoiceLoadSummaries(Map invoiceLoadSummaries) {
065            this.invoiceLoadSummaries = invoiceLoadSummaries;
066        }
067    
068        public Map getRejectFilesToMove() {
069            return rejectFilesToMove;
070        }
071        
072        public boolean containsRejects(){
073            return !rejectDocumentList.isEmpty();
074        }
075    
076    }