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.document.validation.impl;
17  
18  import org.kuali.ole.module.purap.businessobject.PurApAccountingLine;
19  import org.kuali.ole.module.purap.document.PurchasingAccountsPayableDocumentBase;
20  import org.kuali.ole.sys.businessobject.AccountingLine;
21  import org.kuali.ole.sys.document.validation.GenericValidation;
22  import org.kuali.ole.sys.document.validation.event.AttributedDocumentEvent;
23  
24  public class PurchasingAccountingLineAmountValidation extends GenericValidation {
25  
26      private AccountingLine updatedAccountingLine;
27  
28      @Override
29      public boolean validate(AttributedDocumentEvent event) {
30          boolean valid = true;
31          PurApAccountingLine purapAccountingLine = (PurApAccountingLine) updatedAccountingLine;
32          //  PurchasingDocumentBase purapDoc = (PurchasingDocumentBase) event.getDocument();
33          PurchasingAccountsPayableDocumentBase purapDoc = (PurchasingAccountsPayableDocumentBase) event.getDocument();
34  
35  //        if (PurapConstants.AccountDistributionMethodCodes.SEQUENTIAL_CODE.equalsIgnoreCase(purapDoc.getAccountDistributionMethod())) {
36  //            if (ObjectUtils.isNull(purapAccountingLine.getAmount())) {
37  //                GlobalVariables.getMessageMap().putError(PurapPropertyConstants.ACCOUNTS, PurapKeyConstants.ERROR_PURCHASING_AMOUNT_MISSING);
38  //                valid &= false;
39  //            }
40  //        }
41  
42          return valid;
43      }
44  
45      public AccountingLine getUpdatedAccountingLine() {
46          return updatedAccountingLine;
47      }
48  
49      public void setUpdatedAccountingLine(AccountingLine updatedAccountingLine) {
50          this.updatedAccountingLine = updatedAccountingLine;
51      }
52  
53  }