BrightSide Workbench Full Report + Source Code
org.turro.financials.model.document.AnnualTransactionsSet Class Referenceabstract
Inheritance diagram for org.turro.financials.model.document.AnnualTransactionsSet:
Collaboration diagram for org.turro.financials.model.document.AnnualTransactionsSet:

Public Member Functions

Collection< String > getColumns ()
 
Collection< Object[]> getRows ()
 
abstract String getLabel (String key)
 
void fillSet (int year)
 

Detailed Description

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

Definition at line 33 of file AnnualTransactionsSet.java.

Member Function Documentation

◆ fillSet()

void org.turro.financials.model.document.AnnualTransactionsSet.fillSet ( int  year)

Definition at line 73 of file AnnualTransactionsSet.java.

73  {
74  //TODO: add to line type the transaction type, ex.: A, B
75  WhereClause wc = new WhereClause();
76  wc.addClause("select line from DocumentLine line join line.document doc");
77  wc.addClause("where year(doc.receiptDate) = :year");
78  wc.addNamedValue("year", year);
79  wc.addClause("and doc.documentDefinition.id in (12, 2, 1, 51, 49, 46, 5, 15, 18, 52)");
80  wc.addClause("and line.lineType.id in (12, 4, 97, 1, 3, 125, 150, 149, 151, 146, 147, 122, 123, 103, 126, 19, 135, 132, 169)");
81 
82  Dao dao = new FinancialsPU();
83 
84  for(DocumentLine line : (List<DocumentLine>) dao.getResultList(wc)) {
85  String opKey = "E";
86  switch((int) line.getLineType().getId()) {
87  case 12:
88  case 4:
89  case 97:
90  case 125:
91  case 150:
92  case 149:
93  case 151:
94  case 146:
95  case 147:
96  case 122:
97  case 123:
98  case 103:
99  case 126:
100  case 19:
101  case 135:
102  case 132:
103  opKey = "A";
104  break;
105  case 1:
106  case 3:
107  case 169:
108  opKey ="B";
109  break;
110  }
111  AnnualTransaction at = getAnnualTransaction(
112  (line.getDocument().getForcedView() == null ? "" : line.getDocument().getForcedView().getName()),
113  opKey,
114  line.getDocument().getContract().getContractor());
115  at.addOperationsAmount(new CheckDate(line.getDocument().getReceiptDate()).getQuarter(), line.getToDeclare());
116  }
117  }
Here is the call graph for this function:

◆ getColumns()

Collection<String> org.turro.financials.model.document.AnnualTransactionsSet.getColumns ( )

Definition at line 35 of file AnnualTransactionsSet.java.

35  {
36  return Arrays.asList(new String[] {
37  getLabel("View"),
38  getLabel("Key"),
39  getLabel("Global identifier"),
40  getLabel("Name"),
41  getLabel("Address"),
42  "Q1",
43  "Q2",
44  "Q3",
45  "Q4",
46  getLabel("Amount")
47  });
48  }
Here is the call graph for this function:

◆ getLabel()

abstract String org.turro.financials.model.document.AnnualTransactionsSet.getLabel ( String  key)
abstract
Here is the caller graph for this function:

◆ getRows()

Collection<Object[]> org.turro.financials.model.document.AnnualTransactionsSet.getRows ( )

Definition at line 50 of file AnnualTransactionsSet.java.

50  {
51  List<Object[]> l = new ArrayList<Object[]>();
52  for(AnnualTransaction at : this) {
53  Contact c = at.getContact();
54  Address a = c.getAddressMap().get("Fiscal");
55  l.add(new Object[] {
56  at.getView(),
57  at.getOpKey(),
58  c.getGlobalIdentifier(),
59  c.getName(),
60  (a != null ? a.getAddressString() : ""),
61  at.getOperationsAmount(1),
62  at.getOperationsAmount(2),
63  at.getOperationsAmount(3),
64  at.getOperationsAmount(4),
65  at.getOperationsAmountSum()
66  });
67  }
68  return l;
69  }
Here is the call graph for this function:

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