View Javadoc
1   /*
2    * Copyright 2009 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.ole.module.purap.service.impl;
17  
18  import org.kuali.ole.coa.businessobject.Account;
19  import org.kuali.ole.sys.OLEKeyConstants;
20  import org.kuali.rice.krad.datadictionary.DataDictionary;
21  import org.kuali.rice.krad.util.GlobalVariables;
22  import org.kuali.rice.krad.util.ObjectUtils;
23  
24  public class VendorCreditMemoAccountingLineRuleHelperServiceImpl extends PurapAccountingLineRuleHelperServiceImpl {
25  
26      /**
27       * @see org.kuali.ole.sys.document.service.impl.AccountingLineRuleHelperServiceImpl#isValidAccount(org.kuali.ole.coa.businessobject.Account, org.kuali.rice.krad.datadictionary.DataDictionary, java.lang.String)
28       */
29      @Override
30      public boolean isValidAccount(Account account, DataDictionary dataDictionary, String errorPropertyName,
31                                    String errorPropertyIdentifyingName) {
32          String label = getAccountLabel();
33  
34          // make sure it exists
35          if (ObjectUtils.isNull(account)) {
36              GlobalVariables.getMessageMap().putError(errorPropertyName, OLEKeyConstants.ERROR_EXISTENCE, label);
37              return false;
38          }
39  
40          return true;
41      }
42  
43  }