BrightSide Workbench Full Report + Source Code
org.turro.financials.report.AccountReport Class Reference
Inheritance diagram for org.turro.financials.report.AccountReport:

Public Member Functions

 AccountReport (String name)
 
AccountReportItem addItem (String label)
 
AccountReportItem addItem (AccountReportItem item)
 
AccountReportFormula addFormula (String label)
 
AccountReportFormula addFormula (AccountReportFormula formula)
 
List< AccountReportItemgetChildren ()
 
List< AccountReportFormulagetFormulas ()
 
String getName ()
 
void setName (String name)
 
boolean isShowTotal ()
 
void setShowTotal (boolean showTotal)
 
PeriodSet getExistingPeriods ()
 
AccountReportItem getItem (String label)
 
AccountReportFormula getFormula (String label)
 
Dao getDao ()
 
List< String > getAccounts ()
 
void loadData ()
 
AccountReportItem getTotalItem ()
 

Detailed Description

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

Definition at line 30 of file AccountReport.java.

Constructor & Destructor Documentation

◆ AccountReport()

org.turro.financials.report.AccountReport.AccountReport ( String  name)

Definition at line 40 of file AccountReport.java.

40  {
41  this.name = name;
42  children = new ArrayList<AccountReportItem>();
43  formulas = new ArrayList<AccountReportFormula>();
44  }

Member Function Documentation

◆ addFormula() [1/2]

AccountReportFormula org.turro.financials.report.AccountReport.addFormula ( AccountReportFormula  formula)

Definition at line 61 of file AccountReport.java.

61  {
62  formula.setReport(this);
63  formulas.add(formula);
64  return formula;
65  }
Here is the call graph for this function:

◆ addFormula() [2/2]

AccountReportFormula org.turro.financials.report.AccountReport.addFormula ( String  label)

Definition at line 57 of file AccountReport.java.

57  {
58  return addFormula(new AccountReportFormula(label));
59  }
AccountReportFormula addFormula(String label)

◆ addItem() [1/2]

AccountReportItem org.turro.financials.report.AccountReport.addItem ( AccountReportItem  item)

Definition at line 50 of file AccountReport.java.

50  {
51  item.setReport(this);
52  item.setParent(null);
53  children.add(item);
54  return item;
55  }
Here is the call graph for this function:

◆ addItem() [2/2]

AccountReportItem org.turro.financials.report.AccountReport.addItem ( String  label)

Definition at line 46 of file AccountReport.java.

46  {
47  return addItem(new AccountReportItem(label));
48  }
AccountReportItem addItem(String label)

◆ getAccounts()

List<String> org.turro.financials.report.AccountReport.getAccounts ( )

Definition at line 128 of file AccountReport.java.

128  {
129  if(accounts == null) {
130  accounts = getDao().getResultList("select a.id from Account as a");
131  }
132  return accounts;
133  }
Here is the call graph for this function:

◆ getChildren()

List<AccountReportItem> org.turro.financials.report.AccountReport.getChildren ( )

Definition at line 67 of file AccountReport.java.

67  {
68  return children;
69  }

◆ getDao()

Dao org.turro.financials.report.AccountReport.getDao ( )

Definition at line 121 of file AccountReport.java.

121  {
122  if(dao == null) {
123  dao = new FinancialsPU();
124  }
125  return dao;
126  }
Here is the caller graph for this function:

◆ getExistingPeriods()

PeriodSet org.turro.financials.report.AccountReport.getExistingPeriods ( )

Definition at line 91 of file AccountReport.java.

91  {
92  return existingPeriods;
93  }
Here is the caller graph for this function:

◆ getFormula()

AccountReportFormula org.turro.financials.report.AccountReport.getFormula ( String  label)

Definition at line 110 of file AccountReport.java.

110  {
111  if(!Strings.isBlank(label)) {
112  for(AccountReportFormula arf : formulas) {
113  if(label.equals(arf.getLabel())) {
114  return arf;
115  }
116  }
117  }
118  return null;
119  }

◆ getFormulas()

List<AccountReportFormula> org.turro.financials.report.AccountReport.getFormulas ( )

Definition at line 71 of file AccountReport.java.

71  {
72  return formulas;
73  }

◆ getItem()

AccountReportItem org.turro.financials.report.AccountReport.getItem ( String  label)

Definition at line 95 of file AccountReport.java.

95  {
96  if(!Strings.isBlank(label)) {
97  for(AccountReportItem ari : children) {
98  if(label.equals(ari.getLabel())) {
99  return ari;
100  }
101  AccountReportItem ari2 = ari.getItem(label);
102  if(ari2 != null) {
103  return ari2;
104  }
105  }
106  }
107  return null;
108  }
Here is the call graph for this function:

◆ getName()

String org.turro.financials.report.AccountReport.getName ( )

Definition at line 75 of file AccountReport.java.

75  {
76  return name;
77  }

◆ getTotalItem()

AccountReportItem org.turro.financials.report.AccountReport.getTotalItem ( )

Definition at line 146 of file AccountReport.java.

146  {
147  AccountReportItem total = new AccountReportItem(name);
148  total.setMode(null);
149  total.setParent(null);
150  total.setReport(this);
151  total.setTotalItem(true);
152  for(AccountReportPeriod period : existingPeriods) {
153  AccountReportPeriod arp = new AccountReportPeriod(period.getYear(), period.getMonth());
154  arp.setItem(total);
155  for(AccountReportItem item : children) {
156  arp.setValue(arp.getValue() + item.getAccumulatedFor(period));
157  }
158  total.getPeriods().add(arp);
159  }
160  return total;
161  }
Here is the call graph for this function:

◆ isShowTotal()

boolean org.turro.financials.report.AccountReport.isShowTotal ( )

Definition at line 83 of file AccountReport.java.

83  {
84  return showTotal;
85  }

◆ loadData()

void org.turro.financials.report.AccountReport.loadData ( )

Definition at line 135 of file AccountReport.java.

135  {
136  existingPeriods = new PeriodSet();
137  for(AccountReportItem ari : children) {
138  ari.loadData(existingPeriods);
139  }
140  existingPeriods.fillGapsTillNow(null);
141  for(AccountReportItem ari : children) {
142  ari.regularizeMode(existingPeriods);
143  }
144  }
void fillGapsTillNow(AccountReportItem item)
Definition: PeriodSet.java:45
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setName()

void org.turro.financials.report.AccountReport.setName ( String  name)

Definition at line 79 of file AccountReport.java.

79  {
80  this.name = name;
81  }

◆ setShowTotal()

void org.turro.financials.report.AccountReport.setShowTotal ( boolean  showTotal)

Definition at line 87 of file AccountReport.java.

87  {
88  this.showTotal = showTotal;
89  }
Here is the caller graph for this function:

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