BrightSide Workbench Full Report + Source Code
org.turro.financials.model.register.AccountStringWrapper Class Reference

Public Member Functions

 AccountStringWrapper (String account)
 
Double[] getAmounts (RegisterView view, Date fromDate, Date toDate)
 
Double getBalance (RegisterView view, Date toDate)
 

Detailed Description

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

Definition at line 28 of file AccountStringWrapper.java.

Constructor & Destructor Documentation

◆ AccountStringWrapper()

org.turro.financials.model.register.AccountStringWrapper.AccountStringWrapper ( String  account)

Definition at line 32 of file AccountStringWrapper.java.

32  {
33  this.account = account;
34  }

Member Function Documentation

◆ getAmounts()

Double [] org.turro.financials.model.register.AccountStringWrapper.getAmounts ( RegisterView  view,
Date  fromDate,
Date  toDate 
)

Definition at line 36 of file AccountStringWrapper.java.

36  {
37  Object[] pars = view != null ?
38  new Object[] {
39  account + "%",
40  fromDate,
41  toDate,
42  view
43  } :
44  new Object[] {
45  account + "%",
46  fromDate,
47  toDate
48  };
49  Object[] o = (Object[]) new FinancialsPU().getSingleResult(
50  "select sum(entry.debit), sum(entry.credit) " +
51  "from RegisterEntry as entry " +
52  "where entry.account.id like ? " +
53  "and entry.register.registerDate >= ? " +
54  "and entry.register.registerDate <= ? " +
55  (view != null ? "and entry.register.view = ? " : ""),
56  pars);
57  return new Double[] {
58  (Double) (o[0] == null ? 0.0 : o[0]),
59  (Double) (o[1] == null ? 0.0 : o[1])
60  };
61  }
Here is the call graph for this function:

◆ getBalance()

Double org.turro.financials.model.register.AccountStringWrapper.getBalance ( RegisterView  view,
Date  toDate 
)

Definition at line 63 of file AccountStringWrapper.java.

63  {
64  Object[] pars = view != null ?
65  new Object[] {
66  account + "%",
67  toDate,
68  view
69  } :
70  new Object[] {
71  account + "%",
72  toDate
73  };
74  Object o = new FinancialsPU().getSingleResult(
75  "select sum(entry.debit-entry.credit) " +
76  "from RegisterEntry as entry " +
77  "where entry.account.id like ? " +
78  "and entry.register.registerDate <= ? " +
79  (view != null ? "and entry.register.view = ? " : ""),
80  pars);
81  return (Double) o;
82  }
Here is the call graph for this function:

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