BrightSide Workbench Full Report + Source Code
org.turro.financials.register.BalanceFilter Class Reference
Collaboration diagram for org.turro.financials.register.BalanceFilter:

Public Member Functions

 BalanceFilter ()
 
int getBreakdown ()
 
void setBreakdown (int breakdown)
 
boolean hasOneGroup ()
 
boolean hasTwoGroup ()
 
Date getFromDate ()
 
void setFromDate (Date fromDate)
 
Date getToDate ()
 
void setToDate (Date toDate)
 
ViewSets getViewSets ()
 
void setViewSets (ViewSets viewSets)
 
Company getCompany ()
 
void setCompany (Company company)
 
Contact getContact ()
 
void setContact (Contact contact)
 
Contract getContract ()
 
void setContract (Contract contract)
 
Department getDepartment ()
 
void setDepartment (Department department)
 
Headquarters getHeadquarters ()
 
void setHeadquarters (Headquarters headquarters)
 
Service getService ()
 
void setService (Service service)
 
String getFilterString ()
 
String getFullFilterString ()
 
Double[] getAmountsA (String account)
 
Double[] getAmountsB (String account)
 
Double[] getAmounts (String account, String viewFilter)
 
List< MajorAccountgetMajorAccounts (String parent)
 
List< AccountgetAccounts (String parent)
 
Collection< AccountRIgetAccountRIs ()
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 35 of file BalanceFilter.java.

Constructor & Destructor Documentation

◆ BalanceFilter()

org.turro.financials.register.BalanceFilter.BalanceFilter ( )

Definition at line 48 of file BalanceFilter.java.

48  {
49  fromDate = new CheckDate().setDay(1).setMonth(1).getDate();
50  toDate = new Date();
51  viewSets = new ViewSets();
52  }

Member Function Documentation

◆ getAccountRIs()

Collection<AccountRI> org.turro.financials.register.BalanceFilter.getAccountRIs ( )

Definition at line 253 of file BalanceFilter.java.

253  {
254  Object[] pars = new Object[] {
255  fromDate,
256  toDate
257  };
258  return new AccountRIAdapter(new FinancialsPU().getResultList(
259  "select a from Account as a " +
260  "where exists ( " +
261  " select re from RegisterEntry as re " +
262  " where re.account.id = a.id " +
263  getInClause("re.account.id") +
264  " and re.register.registerDate >= ? " +
265  " and re.register.registerDate <= ? " +
266  viewSets.getSqlWhereAB("re.register.view") +
267  ") " +
268  "order by a.id",
269  pars)).getRIs(this);
270  }
String getSqlWhereAB(String field)
Definition: ViewSets.java:75
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAccounts()

List<Account> org.turro.financials.register.BalanceFilter.getAccounts ( String  parent)

Definition at line 225 of file BalanceFilter.java.

225  {
226  Object[] pars = new Object[] {
227  fromDate,
228  toDate
229  };
230  return new FinancialsPU().getResultList(
231  "select a from Account as a " +
232  "where exists ( " +
233  " select ma from MajorAccount as ma " +
234  " where ma.account = '" + parent + "' " +
235  " and a.id like concat(ma.account, '_%') " +
236  " and not exists ( " +
237  " select ma2 from MajorAccount as ma2 " +
238  " where ma2.account like concat(substring(a.id, 1, length(ma.account) + 1), '%') " +
239  " ) " +
240  ") " +
241  "and exists ( " +
242  " select re from RegisterEntry as re " +
243  " where re.account.id = a.id " +
244  getInClause("re.account.id") +
245  " and re.register.registerDate >= ? " +
246  " and re.register.registerDate <= ? " +
247  viewSets.getSqlWhereAB("re.register.view") +
248  ") " +
249  "order by a.id",
250  pars);
251  }
Here is the call graph for this function:

◆ getAmounts()

Double [] org.turro.financials.register.BalanceFilter.getAmounts ( String  account,
String  viewFilter 
)

Definition at line 178 of file BalanceFilter.java.

178  {
179  Object[] pars = new Object[] {
180  account + "%",
181  fromDate,
182  toDate
183  };
184  Object[] o = (Object[]) new FinancialsPU().getSingleResult(
185  "select sum(round(entry.debit, 4) + 0.0), sum(round(entry.credit, 4) + 0.0) " +
186  "from RegisterEntry as entry " +
187  "where entry.account.id like ? " +
188  getInClause("entry.account.id") +
189  "and entry.register.registerDate >= ? " +
190  "and entry.register.registerDate <= ? " +
191  "and entry.register.exclude = FALSE " +
192  viewFilter,
193  pars);
194  return new Double[] {
195  (Double) (o[0] == null ? 0.0 : o[0]),
196  (Double) (o[1] == null ? 0.0 : o[1])
197  };
198  }
Object getSingleResult(WhereClause wc)
Definition: Dao.java:380
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAmountsA()

Double [] org.turro.financials.register.BalanceFilter.getAmountsA ( String  account)

Definition at line 170 of file BalanceFilter.java.

170  {
171  return getAmounts(account, viewSets.getSqlWhereA("entry.register.view"));
172  }
Double[] getAmounts(String account, String viewFilter)
String getSqlWhereA(String field)
Definition: ViewSets.java:99
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAmountsB()

Double [] org.turro.financials.register.BalanceFilter.getAmountsB ( String  account)

Definition at line 174 of file BalanceFilter.java.

174  {
175  return getAmounts(account, viewSets.getSqlWhereB("entry.register.view"));
176  }
String getSqlWhereB(String field)
Definition: ViewSets.java:115
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getBreakdown()

int org.turro.financials.register.BalanceFilter.getBreakdown ( )

Definition at line 54 of file BalanceFilter.java.

54  {
55  return breakdown;
56  }
Here is the caller graph for this function:

◆ getCompany()

Company org.turro.financials.register.BalanceFilter.getCompany ( )

Definition at line 95 of file BalanceFilter.java.

95  {
96  return company;
97  }

◆ getContact()

Contact org.turro.financials.register.BalanceFilter.getContact ( )

Definition at line 104 of file BalanceFilter.java.

104  {
105  return contact;
106  }

◆ getContract()

Contract org.turro.financials.register.BalanceFilter.getContract ( )

Definition at line 113 of file BalanceFilter.java.

113  {
114  return contract;
115  }

◆ getDepartment()

Department org.turro.financials.register.BalanceFilter.getDepartment ( )

Definition at line 122 of file BalanceFilter.java.

122  {
123  return department;
124  }

◆ getFilterString()

String org.turro.financials.register.BalanceFilter.getFilterString ( )

Definition at line 149 of file BalanceFilter.java.

149  {
150  if(company != null) {
151  return I_.get("Company") + ": " + company.getName();
152  } else if(contact != null) {
153  return I_.get("Contact") + ": " + contact.getName();
154  } else if(contract != null) {
155  return I_.get("Contract") + ": " + contract.getFullDescription();
156  } else if(department != null) {
157  return I_.get("Department") + ": " + department.getFullName();
158  } else if(headquarters != null) {
159  return I_.get("Headquarters") + ": " + headquarters.getName();
160  } else if(service != null) {
161  return I_.get("Service") + ": " + service.getFullName();
162  }
163  return "";
164  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getFromDate()

Date org.turro.financials.register.BalanceFilter.getFromDate ( )

Definition at line 71 of file BalanceFilter.java.

71  {
72  return fromDate;
73  }

◆ getFullFilterString()

String org.turro.financials.register.BalanceFilter.getFullFilterString ( )

Definition at line 166 of file BalanceFilter.java.

166  {
167  return viewSets.getStringFilter() + " - " + getFilterString();
168  }
Here is the call graph for this function:

◆ getHeadquarters()

Headquarters org.turro.financials.register.BalanceFilter.getHeadquarters ( )

Definition at line 131 of file BalanceFilter.java.

131  {
132  return headquarters;
133  }

◆ getMajorAccounts()

List<MajorAccount> org.turro.financials.register.BalanceFilter.getMajorAccounts ( String  parent)

Definition at line 200 of file BalanceFilter.java.

200  {
201  Object[] pars = new Object[] {
202  fromDate,
203  toDate
204  };
205  if(parent == null) {
206  parent = "";
207  }
208  parent += "_";
209  List<MajorAccount> l = new FinancialsPU().getResultList(
210  "select m from MajorAccount as m " +
211  "where m.account like '" + parent + "' " +
212  "and exists ( " +
213  " select re from RegisterEntry as re " +
214  " where re.account.id like concat(m.account, '%') " +
215  getInClause("re.account.id") +
216  " and re.register.registerDate >= ? " +
217  " and re.register.registerDate <= ? " +
218  viewSets.getSqlWhereAB("re.register.view") +
219  ") " +
220  "order by m.account",
221  pars);
222  return l;
223  }
Here is the call graph for this function:

◆ getService()

Service org.turro.financials.register.BalanceFilter.getService ( )

Definition at line 140 of file BalanceFilter.java.

140  {
141  return service;
142  }

◆ getToDate()

Date org.turro.financials.register.BalanceFilter.getToDate ( )

Definition at line 79 of file BalanceFilter.java.

79  {
80  return toDate;
81  }

◆ getViewSets()

ViewSets org.turro.financials.register.BalanceFilter.getViewSets ( )

Definition at line 87 of file BalanceFilter.java.

87  {
88  return viewSets;
89  }

◆ hasOneGroup()

boolean org.turro.financials.register.BalanceFilter.hasOneGroup ( )

Definition at line 62 of file BalanceFilter.java.

62  {
63  return !(viewSets.getGroupA().isEmpty());
64  }
Set< RegisterView > getGroupA()
Definition: ViewSets.java:40
Here is the call graph for this function:

◆ hasTwoGroup()

boolean org.turro.financials.register.BalanceFilter.hasTwoGroup ( )

Definition at line 66 of file BalanceFilter.java.

66  {
67  return !(viewSets.getGroupA().isEmpty()) &&
68  !(viewSets.getGroupB().isEmpty());
69  }
Set< RegisterView > getGroupB()
Definition: ViewSets.java:49
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setBreakdown()

void org.turro.financials.register.BalanceFilter.setBreakdown ( int  breakdown)

Definition at line 58 of file BalanceFilter.java.

58  {
59  this.breakdown = breakdown;
60  }

◆ setCompany()

void org.turro.financials.register.BalanceFilter.setCompany ( Company  company)

Definition at line 99 of file BalanceFilter.java.

99  {
100  clearValues();
101  this.company = company;
102  }

◆ setContact()

void org.turro.financials.register.BalanceFilter.setContact ( Contact  contact)

Definition at line 108 of file BalanceFilter.java.

108  {
109  clearValues();
110  this.contact = contact;
111  }

◆ setContract()

void org.turro.financials.register.BalanceFilter.setContract ( Contract  contract)

Definition at line 117 of file BalanceFilter.java.

117  {
118  clearValues();
119  this.contract = contract;
120  }

◆ setDepartment()

void org.turro.financials.register.BalanceFilter.setDepartment ( Department  department)

Definition at line 126 of file BalanceFilter.java.

126  {
127  clearValues();
128  this.department = department;
129  }

◆ setFromDate()

void org.turro.financials.register.BalanceFilter.setFromDate ( Date  fromDate)

Definition at line 75 of file BalanceFilter.java.

75  {
76  this.fromDate = fromDate;
77  }

◆ setHeadquarters()

void org.turro.financials.register.BalanceFilter.setHeadquarters ( Headquarters  headquarters)

Definition at line 135 of file BalanceFilter.java.

135  {
136  clearValues();
137  this.headquarters = headquarters;
138  }

◆ setService()

void org.turro.financials.register.BalanceFilter.setService ( Service  service)

Definition at line 144 of file BalanceFilter.java.

144  {
145  clearValues();
146  this.service = service;
147  }

◆ setToDate()

void org.turro.financials.register.BalanceFilter.setToDate ( Date  toDate)

Definition at line 83 of file BalanceFilter.java.

83  {
84  this.toDate = toDate;
85  }

◆ setViewSets()

void org.turro.financials.register.BalanceFilter.setViewSets ( ViewSets  viewSets)

Definition at line 91 of file BalanceFilter.java.

91  {
92  this.viewSets = viewSets;
93  }

The documentation for this class was generated from the following file: