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.businessobject;
017    
018    import org.kuali.kfs.coa.businessobject.Account;
019    import org.kuali.kfs.coa.businessobject.ObjectCode;
020    import org.kuali.kfs.coa.service.AccountService;
021    import org.kuali.kfs.coa.service.ObjectCodeService;
022    import org.kuali.kfs.sys.businessobject.TaxDetail;
023    import org.kuali.kfs.sys.context.SpringContext;
024    import org.kuali.rice.kns.util.KualiDecimal;
025    
026    public class SalesTaxCustomerCreditMemoDetail extends CustomerCreditMemoDetail {
027        private TaxDetail taxDetail;
028        private CustomerCreditMemoDetail customerCreditMemoDetail;
029    
030        public SalesTaxCustomerCreditMemoDetail(TaxDetail taxDetail, CustomerCreditMemoDetail customerCreditMemoDetail) {
031            this.taxDetail = taxDetail;
032            this.customerCreditMemoDetail = customerCreditMemoDetail;
033        }
034    
035        @Override
036        public Account getAccount() {
037            return SpringContext.getBean(AccountService.class).getByPrimaryId(taxDetail.getChartOfAccountsCode(), taxDetail.getAccountNumber());
038        }
039    
040        @Override
041        public String getAccountNumber() {
042            return taxDetail.getAccountNumber();
043        }
044    
045        @Override
046        public KualiDecimal getAmount() {
047            return taxDetail.getTaxAmount();
048        }
049    
050        @Override
051        public String getChartOfAccountsCode() {
052            return taxDetail.getChartOfAccountsCode();
053        }
054    
055    
056        @Override
057        public String getFinancialObjectCode() {
058            return taxDetail.getFinancialObjectCode();
059        }
060    
061        @Override
062        public ObjectCode getObjectCode() {
063            return SpringContext.getBean(ObjectCodeService.class).getByPrimaryIdForCurrentYear(taxDetail.getChartOfAccountsCode(), taxDetail.getFinancialObjectCode());
064        }    
065    
066        @Override
067        public String getFinancialSubObjectCode() {
068            return null;
069        }
070    
071        @Override
072        public String getOrganizationReferenceId() {
073            return null;
074        }
075    
076        @Override
077        public String getProjectCode() {
078            return null;
079        }
080    
081        @Override
082        public String getSubAccountNumber() {
083            return null;
084        }
085    }