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.ar.document.service; 017 018 019 import java.util.Collection; 020 import java.util.Map; 021 022 import org.kuali.kfs.coa.businessobject.ObjectCode; 023 import org.kuali.kfs.module.ar.businessobject.CustomerInvoiceDetail; 024 import org.kuali.kfs.module.ar.businessobject.CustomerInvoiceWriteoffLookupResult; 025 import org.kuali.kfs.module.ar.document.CustomerInvoiceDocument; 026 import org.kuali.kfs.module.ar.document.CustomerInvoiceWriteoffDocument; 027 import org.kuali.rice.kew.exception.WorkflowException; 028 import org.kuali.rice.kim.bo.Person; 029 030 public interface CustomerInvoiceWriteoffDocumentService { 031 032 /** 033 * 034 * Finalizes the actions of a Writeoff document, once its been completely approved. 035 * 036 * Generates paid applieds for the source invoice, and closes the source invoice. 037 * 038 * @param writeoff The approved Writeoff document to complete. 039 */ 040 public void completeWriteoffProcess(CustomerInvoiceWriteoffDocument writeoff); 041 042 /** 043 * This method setups any default values for a new customer invoice document 044 * @param customerInvoiceWriteoffDocument 045 */ 046 public void setupDefaultValuesForNewCustomerInvoiceWriteoffDocument(CustomerInvoiceWriteoffDocument customerInvoiceWriteoffDocument); 047 048 /** 049 * This method returns true if a customer invoice writeoff document is approved 050 * @param customerInvoiceWriteoffDocumentNumber 051 * @return 052 */ 053 public boolean isCustomerInvoiceWriteoffDocumentApproved(String customerInvoiceWriteoffDocumentNumber); 054 055 /** 056 * This method returns a collection of customer invoice documents that are eligible for writeoff 057 * @param fieldValues 058 * @return 059 */ 060 public Collection<CustomerInvoiceWriteoffLookupResult> getCustomerInvoiceDocumentsForInvoiceWriteoffLookup(Map<String, String> fieldValues); 061 062 /** 063 * This method filters invoices which have related CRMs and/or writeoffs in route 064 * @param customerInvoiceDocuments 065 * @return filteredInvoices 066 */ 067 public Collection<CustomerInvoiceDocument> filterInvoices(Collection<CustomerInvoiceDocument> customerInvoiceDocuments); 068 069 /** 070 * This method checks if there is no another CRM in route for the invoice 071 * Not in route if CRM status is one of the following: processed, cancelled, or disapproved 072 * @param invoice 073 * @return 074 */ 075 public boolean checkIfThereIsNoAnotherCRMInRouteForTheInvoice(String invoiceDocumentNumber); 076 077 /** 078 * This method checks if there is no another writeoff in route for the invoice 079 * Not in route if writeoff status is one of the following: processed, cancelled, or disapproved 080 * 081 * @param invoice 082 * @return 083 */ 084 public boolean checkIfThereIsNoAnotherWriteoffInRouteForTheInvoice(String invoiceDocumentNumber); 085 086 /** 087 * 088 * Accepts a lookup result and creates a batch file dropped into the batch system for later asynchronous 089 * processing. 090 * 091 * @param personId 092 * @param customerInvoiceWriteoffLookupResults 093 * @return filename and path of created batch file 094 */ 095 public String sendCustomerInvoiceWriteoffDocumentsToBatch(Person person, Collection<CustomerInvoiceWriteoffLookupResult> customerInvoiceWriteoffLookupResults); 096 097 /** 098 * 099 * Creates a new Invoice Writeoff Document based on the indicated Invoice doc number and the initiator. 100 * @param initiator Person who initiated the writeoffs. 101 * @param invoiceNumber Invoice document number to base the writeoff on. 102 * @param note User note to be added to the document. 103 * @return Returns the Document Number of the Invoice Writeoff document created. 104 * @throws WorkflowException 105 */ 106 public String createCustomerInvoiceWriteoffDocument(Person initiator, String invoiceNumber, String note) throws WorkflowException; 107 108 109 public String getFinancialObjectCode(CustomerInvoiceDetail postable, CustomerInvoiceWriteoffDocument poster, boolean isUsingOrgAcctDefaultWriteoffFAU, boolean isUsingChartForWriteoff, String chartOfAccountsCode); 110 111 112 public ObjectCode getObjectCode(CustomerInvoiceDetail postable, CustomerInvoiceWriteoffDocument poster, boolean isUsingOrgAcctDefaultWriteoffFAU, boolean isUsingChartForWriteoff, String chartOfAccountsCode); 113 114 }