001/*
002 * Copyright 2007 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 */
016package org.kuali.ole.gl.service.impl;
017
018import java.sql.Date;
019
020import org.kuali.ole.gl.businessobject.CollectorDetail;
021import org.kuali.ole.gl.dataaccess.CollectorDetailDao;
022import org.kuali.ole.gl.service.CollectorDetailService;
023import org.kuali.ole.sys.context.SpringContext;
024import org.kuali.rice.krad.service.BusinessObjectService;
025import org.springframework.transaction.annotation.Transactional;
026
027/**
028 * The base implementation of CollectorDetailService
029 */
030@Transactional
031public class CollectorDetailServiceImpl implements CollectorDetailService {
032    private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(CollectorDetailServiceImpl.class);
033
034    private CollectorDetailDao collectorDetailDao;
035
036    /**
037     * Purge the sufficient funds balance table by year/chart
038     * 
039     * @param chart chart of CollectorDetails to purge
040     * @param year year of CollectorDetails to purage
041     * @see org.kuali.ole.gl.service.CollectorDetailService#purgeYearByChart(java.lang.String, int)
042     */
043    public void purgeYearByChart(String chartOfAccountsCode, int universityFiscalYear) {
044        LOG.debug("purgeYearByChart() started");
045
046        collectorDetailDao.purgeYearByChart(chartOfAccountsCode, universityFiscalYear);
047    }
048    
049    public Integer getNextCreateSequence(Date date) {
050        return collectorDetailDao.getMaxCreateSequence(date);
051    }
052
053    /**
054     * Saves a CollectorDetail
055     * 
056     * @param detail the detail to save
057     * @see org.kuali.ole.gl.service.CollectorDetailService#save(org.kuali.ole.gl.businessobject.CollectorDetail)
058     */
059    public void save(CollectorDetail detail) {
060        LOG.debug("save() started");
061        SpringContext.getBean(BusinessObjectService.class).save(detail);
062    }
063
064    public void setCollectorDetailDao(CollectorDetailDao idbd) {
065        collectorDetailDao = idbd;
066    }
067}