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 package org.kuali.kfs.module.cab.batch.service; 017 018 import java.sql.Date; 019 import java.sql.Timestamp; 020 import java.util.Collection; 021 import java.util.HashSet; 022 import java.util.List; 023 024 import org.kuali.kfs.gl.businessobject.Entry; 025 import org.kuali.kfs.module.cab.batch.ExtractProcessLog; 026 import org.kuali.kfs.module.cab.businessobject.PurchasingAccountsPayableDocument; 027 import org.kuali.kfs.module.purap.businessobject.PurApAccountingLineBase; 028 import org.kuali.kfs.module.purap.businessobject.PurchaseOrderAccount; 029 030 /** 031 * Declares the service methods used by CAB batch program 032 */ 033 public interface BatchExtractService { 034 035 /** 036 * Allocate additional charges during batch. 037 * 038 * @param purApDocuments 039 */ 040 void allocateAdditionalCharges(HashSet<PurchasingAccountsPayableDocument> purApDocuments); 041 042 /** 043 * Returns the list of CAB eligible GL entries, filter parameters are pre-configured 044 * 045 * @param process log 046 * @return Eligible GL Entries meeting batch parameters configured under parameter group KFS-CAB:Batch 047 */ 048 Collection<Entry> findElgibleGLEntries(ExtractProcessLog processLog); 049 050 051 /** 052 * Saves financial transaction lines which dont have Purchase Order number associated with it 053 * 054 * @param fpLines Financial transaction lines 055 * @param processLog Process Log 056 */ 057 void saveFPLines(List<Entry> fpLines, ExtractProcessLog processLog); 058 059 /** 060 * Saved purchasing line transactions, this method implementation internally uses 061 * {@link org.kuali.kfs.gl.batch.service.ReconciliationService} to QA the data before saving 062 * 063 * @param poLines Eligible GL Lines 064 * @param processLog Process Log 065 */ 066 HashSet<PurchasingAccountsPayableDocument> savePOLines(List<Entry> poLines, ExtractProcessLog processLog); 067 068 /** 069 * Separates out transaction lines associated with purchase order from the rest 070 * 071 * @param fpLines Non-purchasing lines 072 * @param purapLines Purchasing lines 073 * @param elgibleGLEntries Full list of eligible GL entries 074 */ 075 void separatePOLines(List<Entry> fpLines, List<Entry> purapLines, Collection<Entry> elgibleGLEntries); 076 077 /** 078 * Updates the last extract time stamp system parameter, usually done when a batch process is finished successfully. 079 * 080 * @param time Last extract start time 081 */ 082 void updateLastExtractTime(Timestamp time); 083 084 085 /** 086 * This method collects account line history using batch parameters 087 * 088 * @return Collection Purchasing Accounts Payable Account Line History 089 */ 090 Collection<PurApAccountingLineBase> findPurapAccountRevisions(); 091 092 093 /** 094 * Implementation will retrieve all eligible Purchase Order account lines from a Purchase order that matches criteria required 095 * by pre-asset tagging, using these account lines, batch process can identify the eligible purchase order line items to be 096 * saved for pre-tagging screen 097 * 098 * @return Pre-taggable PO Account lines 099 */ 100 Collection<PurchaseOrderAccount> findPreTaggablePOAccounts(); 101 102 /** 103 * Implementation will identify eligible purchase oder line items eligible for pre-tagging screen 104 * 105 * @param preTaggablePOAccounts List of pre-taggable account lines 106 */ 107 void savePreTagLines(Collection<PurchaseOrderAccount> preTaggablePOAccounts); 108 109 /** 110 * Updates the last extract date parameter for Pre Asset Tagging Step 111 * 112 * @param date Date value 113 */ 114 void updateLastExtractDate(Date date); 115 }