19 package org.turro.entities.portfolio;
21 import java.util.List;
22 import java.util.TreeSet;
23 import org.turro.financials.entity.Document;
24 import org.turro.financials.model.document.contract.DocumentPortfolio;
32 private double finalBalance = 0.0, finalInvoice = 0.0,
33 finalPortfolio = 0.0, finalSettlement = 0.0;
34 private int finalCount = 0;
37 fillPortfolio(documents, entityPaths);
49 return finalPortfolio;
53 return finalSettlement;
67 finalSettlement = 0.0;
68 finalCount = documents.size();
70 for(
final Document doc : documents) {
72 if(doc.getDocumentDefinition().getId() != 1 &&
73 doc.getDocumentDefinition().getId() != 67 &&
74 doc.getDocumentDefinition().getId() != 2 &&
75 doc.getDocumentDefinition().getId() != 43 &&
76 doc.getDocumentDefinition().getId() != 44 &&
77 doc.getDocumentDefinition().getId() != 6 &&
78 doc.getDocumentDefinition().getId() != 7) {
82 DocumentPortfolio dp =
new DocumentPortfolio();
85 dp.setDate(doc.getDocumentDate());
86 dp.setConcept(doc.getDocumentDefinition().getName() +
" " + doc.getDocumentNumber());
88 double amount = doc.getTotalAmount();
90 switch ((
int) doc.getDocumentDefinition().getId()) {
105 switch ((
int) doc.getDocumentDefinition().getId()) {
109 finalBalance += amount;
110 finalInvoice += amount;
111 dp.setInvoice(amount);
112 dp.setPortfolio(
null);
113 dp.setSettlement(
null);
114 dp.setBalance(finalBalance);
118 finalPortfolio += amount;
120 dp.setPortfolio(amount);
121 dp.setSettlement(
null);
122 dp.setBalance(finalBalance);
126 finalBalance -= amount;
127 finalSettlement += amount;
129 dp.setPortfolio(
null);
130 dp.setSettlement(amount);
131 dp.setBalance(finalBalance);
void fillList(List< String > entityPaths)
EntityPortfolioList(DocumentByEntityList documents, List< String > entityPaths)
double getFinalPortfolio()
double getFinalSettlement()