BrightSide Workbench Full Report + Source Code
AccountsReport.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.report;
19 
24 public class AccountsReport extends AccountReport {
25 
26  public AccountsReport() {
27  super("Accounts report");
28  setShowTotal(true);
29  createReport();
30  loadData();
31  }
32 
33  private void createReport() {
34  AccountReportItem ari1, ari2, ari = addItem("Balance sheet"); // Balanç
35  ari1 = ari.addItem("Liabilities"); // Passiu
36  ari1.setShowTotal(true);
37  ari2 = ari1.addItem("Equity"); // Fons propis
38  ari2.setMode(ItemMode.BY_YEAR);
39  ari2.addPattern("^1[01234][0-9]*");
40  ari2 = ari1.addItem("Long term creditors");
41  ari2.setMode(ItemMode.BY_YEAR);
42  ari2.addPattern("^1[5678][0-9]*");
43  ari2 = ari1.addItem("Short term creditors");
44  ari2.setMode(ItemMode.BY_YEAR);
45  ari2.addPattern("^4[01][0-9]*");
46  ari2.addPattern("^4[68]5[0-9]*");
47  ari2.addPattern("^47[5679][0-9]*");
48  ari2.addPattern("^499[0-9]*");
49  ari2.addPattern("^5[012][0-9]*");
50  ari2.addPattern("^56[01][0-9]*");
51  ari2.addPattern("^585[0-9]*");
52  ari1 = ari.addItem("Assets"); // Actiu
53  ari1.setShowTotal(true);
54  ari2 = ari1.addItem("Fixed assets"); // Inmobilitzat
55  ari2.setMode(ItemMode.BY_YEAR);
56  ari2.addPattern("^19[0-9]*");
57  ari2.addPattern("^2[0-9]*");
58  ari2 = ari1.addItem("Stocks"); // Existències
59  ari2.setMode(ItemMode.BY_YEAR);
60  ari2.addPattern("^3[0-9]*");
61  ari2 = ari1.addItem("Short term debtors");
62  ari2.setMode(ItemMode.BY_YEAR);
63  ari2.addPattern("^4[34][0-9]*");
64  ari2.addPattern("^4[68]0[0-9]*");
65  ari2.addPattern("^47[01234][0-9]*");
66  ari2.addPattern("^49[034][0-9]*");
67  ari2.addPattern("^55[^5][0-9]*");
68  ari2.addPattern("^580[0-9]*");
69  ari2 = ari1.addItem("Financial investments"); // Inversions financeres
70  ari2.setMode(ItemMode.BY_YEAR);
71  ari2.addPattern("^5[349][0-9]*");
72  ari2.addPattern("^56[56][0-9]*");
73  ari2 = ari1.addItem("Outstanding entries"); // Partides pendents
74  ari2.setMode(ItemMode.BY_YEAR);
75  ari2.addPattern("^555[0-9]*");
76  ari2 = ari1.addItem("Liquid assets"); // Tresoreria
77  ari2.setMode(ItemMode.BY_YEAR);
78  ari2.addPattern("^57[0-9]*");
79  ari = addItem("Operating"); // Explotació
80  ari1 = ari.addItem("Credit"); // Haver
81  ari1.setShowTotal(true);
82  ari2 = ari1.addItem("Income"); // Ingresos
83  ari2.setMode(ItemMode.BY_TAM);
84  ari2.addPattern("^7[01345][0-9]*");
85  ari2 = ari1.addItem("Financial receipt"); // Ingresos financers
86  ari2.setMode(ItemMode.BY_TAM);
87  ari2.addPattern("^76[0-9]*");
88  ari2 = ari1.addItem("Nonrecurrent receipt"); // Ingresos extraordinaris
89  ari2.setMode(ItemMode.BY_TAM);
90  ari2.addPattern("^77[0-9]*");
91  ari1 = ari.addItem("Debit"); // Deure
92  ari1.setShowTotal(true);
93  ari2 = ari1.addItem("Goods"); // Consum
94  ari2.setMode(ItemMode.BY_TAM);
95  ari2.addPattern("^6[01][0-9]*");
96  ari2 = ari1.addItem("Services"); // Serveis
97  ari2.setMode(ItemMode.BY_TAM);
98  ari2.addPattern("^6[25][0-9]*");
99  ari2 = ari1.addItem("Personnel"); // Personal
100  ari2.setMode(ItemMode.BY_TAM);
101  ari2.addPattern("^64[0-9]*");
102  ari2 = ari1.addItem("Tributes"); // Tributs
103  ari2.setMode(ItemMode.BY_TAM);
104  ari2.addPattern("^63[0-9]*");
105  ari2 = ari1.addItem("Financial expenses"); // Despeses financeres
106  ari2.setMode(ItemMode.BY_TAM);
107  ari2.addPattern("^66[0-9]*");
108  ari2.addPattern("^79[0-9]*");
109  ari2 = ari1.addItem("Other expenses"); // Altres despeses
110  ari2.setMode(ItemMode.BY_TAM);
111  ari2.addPattern("^6[789][0-9]*");
112 
114  //Operating results - Resultats d'explotació
115  arf = addFormula("Operating results");
116  arf.setFormula("-@{lIncome} - @{lGoods} - @{lServices} - @{lPersonnel} - @{lTributes}");
117  //Cash flow
118  arf = addFormula("Cash flow");
119  arf.setFormula("@F{lOperatingResults} - @{lFinancialExpenses} + -@{lFinancialReceipt}");
120  //Results
121  arf = addFormula("Results");
122  arf.setFormula("@F{lCashFlow} - @{lOtherExpenses} + -@{lNonrecurrentReceipt}");
123  //Return of Equity - Rendabilitat del actiu
124  arf = addFormula("Return of equity");
125  arf.setFormula("@F{lResults} / (@{lFixedAssets} + @{lStocks} + @{lShortTermDebtors} + @{lFinancialInvestments} + @{lOutstandingEntries} + @{lLiquidAssets})");
126  arf.setPercent(true);
127  }
128 
129 }
AccountReportFormula addFormula(String label)
AccountReportItem addItem(String label)