18 package org.turro.financials.account.logic;
20 import java.util.Date;
21 import javax.persistence.NoResultException;
22 import org.turro.financials.entity.RegisterView;
23 import org.turro.i18n.I_;
24 import org.turro.jpa.Dao;
33 private Date fromDate;
34 private String accountSearch;
44 this.initialCredit = initialCredit;
55 return I_.
get(
"Accumulated");
83 this.accountSearch = accountSearch;
91 this.fromDate = fromDate;
117 Object[] pars = view !=
null ?
119 accountSearch.replaceAll(
"\\*",
"%"),
125 accountSearch.replaceAll(
"\\*",
"%"),
130 "select sum(entry.debit), sum(entry.credit) " +
131 "from RegisterEntry as entry " +
132 "where entry.account.id like ? " +
133 "and entry.register.registerDate < ? " +
134 (init !=
null ?
"and entry.register.registerDate >= ? " :
"and ? is null ") +
135 (view !=
null ?
"and entry.register.view = ? " :
""),
137 if(o !=
null && o.length == 2) {
139 initialCredit = (Double) (o[1] ==
null ? 0.0 : o[1]);
146 "select max(r.registerDate) from Register r " +
147 "where r.registerDate < ? " +
148 "and r.closing = TRUE " +
149 "and day(r.registerDate) = 1 " +
150 "and month(r.registerDate) = 1",
151 new Object[] { fromDate });
152 }
catch(NoResultException ex) {
void setInheritedBalance(double inheritedBalance)
StatementFirst(double initialDebit, double initialCredit)
String getAccountSearch()
void setView(RegisterView view)
Date getInitialDate(Dao dao, Date fromDate)
void setFromDate(Date fromDate)
void setAccountSearch(String accountSearch)
void refreshData(Dao dao)
static String get(String msg)
Object getSingleResult(WhereClause wc)