BrightSide Workbench Full Report + Source Code
m111/ModelType.java
Go to the documentation of this file.
1 /*
2  * TurrĂ³ i Cutiller Foundation. License notice.
3  * Copyright (C) 2011 Lluis TurrĂ³ Cutiller <http://www.turro.org/>
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU Affero General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU Affero General Public License for more details.
14  *
15  * You should have received a copy of the GNU Affero General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 package org.turro.financials.treasury.m111;
19 
24 public enum ModelType {
25 
26  RET_PERSONAL(10000, "475110[0-9]*", "[6,2][0-9]*", 1L),
27  RET_PROFESSIONAL(11000, "475120[0-9]*", "[6,2][0-9]*", 1L),
28  RET_RENTER(12000, "47513[0-9]*", "6[0-9]*", 1L),
29  RET_DIVIDEND(13000, "47514[0-9]*", "6[0-9]*", 1L);
30 
31  private int order;
32  private String retAccount, opAccount;
33  private long bookId;
34 
35  private ModelType(int order, String retAccount, String opAccount, Long bookId) {
36  this.order = order;
37  this.retAccount = retAccount;
38  this.opAccount = opAccount;
39  this.bookId = bookId;
40  }
41 
42  public String getOpAccount() {
43  return opAccount;
44  }
45 
46  public long getBookId() {
47  return bookId;
48  }
49 
50  public int getOrder() {
51  return order;
52  }
53 
54  public String getRetAccount() {
55  return retAccount;
56  }
57 
58  public static ModelType checkType(String accountId) {
59  if(accountId.matches(RET_PERSONAL.getRetAccount())) {
60  return RET_PERSONAL;
61  } else if(accountId.matches(RET_PROFESSIONAL.getRetAccount())) {
62  return RET_PROFESSIONAL;
63  } else if(accountId.matches(RET_RENTER.getRetAccount())) {
64  return RET_RENTER;
65  } else if(accountId.matches(RET_DIVIDEND.getRetAccount())) {
66  return RET_DIVIDEND;
67  }
68  return null;
69  }
70 
71  public static boolean isTaxable(String accountId) {
72  if(accountId.matches(RET_PERSONAL.getOpAccount())) {
73  return true;
74  } else if(accountId.matches(RET_PROFESSIONAL.getOpAccount())) {
75  return true;
76  } else if(accountId.matches(RET_RENTER.getOpAccount())) {
77  return true;
78  } else if(accountId.matches(RET_DIVIDEND.getOpAccount())) {
79  return true;
80  }
81  return false;
82  }
83 
84  public static String getModel() {
85  return "111,115,123";
86  }
87 
88 }
static ModelType checkType(String accountId)
static boolean isTaxable(String accountId)