◆ DocumentByContractList()
org.turro.financials.model.document.contract.DocumentByContractList.DocumentByContractList |
( |
| ) |
|
◆ fillList()
void org.turro.financials.model.document.contract.DocumentByContractList.fillList |
( |
RegisterView |
view, |
|
|
Contract |
contract, |
|
|
Date |
from, |
|
|
Date |
to |
|
) |
| |
Definition at line 40 of file DocumentByContractList.java.
41 Dao dao =
new FinancialsPU();
43 addAll(dao.getResultList(
44 "select doc from Document doc " +
45 "where doc.contract = ? " +
46 "and doc.forcedView = ? " +
47 "and doc.documentDate >= ? " +
48 "and doc.documentDate <= ?",
49 new Object[] { contract, view, from, to }));
51 addAll(dao.getResultList(
52 "select doc from Document doc " +
53 "where doc.contract = ? " +
54 "and doc.forcedView is null " +
55 "and doc.documentDate >= ? " +
56 "and doc.documentDate <= ?",
57 new Object[] { contract, from, to }));
◆ getInitialBalance()
double org.turro.financials.model.document.contract.DocumentByContractList.getInitialBalance |
( |
RegisterView |
view, |
|
|
Contract |
contract, |
|
|
Date |
from, |
|
|
Date |
to |
|
) |
| |
Definition at line 61 of file DocumentByContractList.java.
62 Dao dao =
new FinancialsPU();
66 o = dao.getSingleResult(
67 "select sum(re.debit - re.credit) " +
68 "from RegisterEntry re " +
69 "join re.register r " +
71 "and r.registerDate < ? " +
72 (init !=
null ?
"and r.registerDate >= ? " :
"and ? is null ") +
73 "and (re.account.id like '" + AccountFormat.expand(
"400." + contract.getId()) +
"' " +
74 "or re.account.id like '" + AccountFormat.expand(
"401." + contract.getId()) +
"' " +
75 "or re.account.id like '" + AccountFormat.expand(
"410." + contract.getId()) +
"' " +
76 "or re.account.id like '" + AccountFormat.expand(
"411." + contract.getId()) +
"' " +
77 "or re.account.id like '" + AccountFormat.expand(
"430." + contract.getId()) +
"' " +
78 "or re.account.id like '" + AccountFormat.expand(
"431." + contract.getId()) +
"' " +
79 "or re.account.id like '" + AccountFormat.expand(
"440." + contract.getId()) +
"' " +
80 "or re.account.id like '" + AccountFormat.expand(
"441." + contract.getId()) +
"')",
81 new Object[] { view, from, init });
83 o = dao.getSingleResult(
84 "select sum(re.debit - re.credit) " +
85 "from RegisterEntry re " +
86 "join re.register r " +
87 "where r.view.id = 1 " +
88 "and r.registerDate < ? " +
89 (init !=
null ?
"and r.registerDate >= ? " :
"and ? is null ") +
90 "and (re.account.id like '" + AccountFormat.expand(
"400." + contract.getId()) +
"' " +
91 "or re.account.id like '" + AccountFormat.expand(
"401." + contract.getId()) +
"' " +
92 "or re.account.id like '" + AccountFormat.expand(
"410." + contract.getId()) +
"' " +
93 "or re.account.id like '" + AccountFormat.expand(
"411." + contract.getId()) +
"' " +
94 "or re.account.id like '" + AccountFormat.expand(
"430." + contract.getId()) +
"' " +
95 "or re.account.id like '" + AccountFormat.expand(
"431." + contract.getId()) +
"' " +
96 "or re.account.id like '" + AccountFormat.expand(
"440." + contract.getId()) +
"' " +
97 "or re.account.id like '" + AccountFormat.expand(
"441." + contract.getId()) +
"')",
98 new Object[] { from, init });
100 if(o instanceof Double) {
101 if(contract.getContractDefinition().getId() == 55) {
102 return -((Double) o);
Date getInitialDate(Dao dao, Date fromDate)
◆ getInitialDate()
Date org.turro.financials.model.document.contract.DocumentByContractList.getInitialDate |
( |
Dao |
dao, |
|
|
Date |
fromDate |
|
) |
| |
Definition at line 109 of file DocumentByContractList.java.
111 return (Date) dao.getSingleResult(
112 "select max(r.registerDate) from Register r " +
113 "where r.registerDate < ? " +
114 "and r.closing = TRUE " +
115 "and day(r.registerDate) = 1 " +
116 "and month(r.registerDate) = 1",
117 new Object[] { fromDate });
118 }
catch(NoResultException ex) {
The documentation for this class was generated from the following file: