1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.fp.document.validation.impl;
17
18 import org.kuali.ole.fp.document.DisbursementVoucherDocument;
19 import org.kuali.ole.sys.OLEPropertyConstants;
20 import org.kuali.ole.sys.document.AccountingDocument;
21 import org.kuali.ole.sys.document.validation.GenericValidation;
22 import org.kuali.ole.sys.document.validation.event.AttributedDocumentEvent;
23 import org.kuali.ole.sys.document.validation.impl.BankCodeValidation;
24
25 public class DisbursementVoucherBankCodeValidation extends GenericValidation {
26 private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(DisbursementVoucherBankCodeValidation.class);
27
28 private AccountingDocument accountingDocumentForValidation;
29
30
31
32
33 public boolean validate(AttributedDocumentEvent event) {
34 LOG.debug("validate start");
35
36 DisbursementVoucherDocument dvDocument = (DisbursementVoucherDocument) accountingDocumentForValidation;
37
38 boolean isValid = BankCodeValidation.validate(dvDocument, dvDocument.getDisbVchrBankCode(), OLEPropertyConstants.DISB_VCHR_BANK_CODE, false, true);
39
40 return isValid;
41 }
42
43
44
45
46
47 public void setAccountingDocumentForValidation(AccountingDocument accountingDocumentForValidation) {
48 this.accountingDocumentForValidation = accountingDocumentForValidation;
49 }
50
51
52
53
54
55 public AccountingDocument getAccountingDocumentForValidation() {
56 return accountingDocumentForValidation;
57 }
58 }