18 package org.turro.financials.payroll;
20 import java.util.Collection;
21 import java.util.Date;
22 import org.turro.elephant.db.WhereClause;
23 import org.turro.financials.db.FinancialsPU;
24 import org.turro.financials.entity.Document;
25 import org.turro.jpa.Dao;
33 public Collection<Document>
getPayrolls(Date date,
boolean newPayrolls) {
39 return dao.getResultList(wc);
43 private WhereClause createCriteria(Date date,
boolean newPayrolls) {
45 wc.
addClause(
"select doc from Document as doc");
46 wc.
addClause(
"where doc.documentDefinition.id = 9");
49 wc.
addClause(
"select max(doc2.documentDate) from Document as doc2");
50 wc.
addClause(
"where doc2.documentDefinition.id = 9");
51 wc.
addClause(
"and doc2.documentDate <= :date");
55 wc.
addClause(
"and doc.documentDate = :date");
void addClause(String clause)
void addNamedValue(String name, Object value)
Collection< Document > getPayrolls(Date date, boolean newPayrolls)