18 package org.turro.financials.treasury.m303;
20 import java.util.Date;
21 import org.amic.util.date.CheckDate;
22 import org.turro.jpa.Dao;
32 private Double amountDeclared;
36 this.quarter = quarter;
41 return amountDeclared ==
null ? 0 : amountDeclared;
52 private void fillData() {
54 "select sum(e.credit) from RegisterEntry e " +
55 "where e.register.registerDate <= ? " +
56 "and e.register.registerDate >= ? " +
57 "and e.register.view.id = 1 " +
58 "and (e.register.exclude = FALSE and e.register.closing = FALSE and e.register.regularizeVAT = FALSE) " +
60 "and e.account.id = ?",
62 if(amountDeclared ==
null || amountDeclared == 0) {
64 "select sum(e.debit) from RegisterEntry e " +
65 "where e.register.registerDate <= ? " +
66 "and e.register.registerDate >= ? " +
67 "and e.register.view.id = 1 " +
68 "and (e.register.exclude = FALSE and e.register.closing = FALSE and e.register.regularizeVAT = FALSE) " +
70 "and e.account.id = ?",
73 if(amountDeclared !=
null) {
74 amountDeclared = -amountDeclared;
80 return new CheckDate(
set.getExercise(), ((quarter - 1) * 3) + 1, 1, 0, 0, 0).addDays(26).getDate();
84 return new CheckDate(
set.getExercise(), ((quarter - 1) * 3) + 4, 1, 0, 0, 0).addDays(-1).addDays(25).getDate();
88 return new CheckDate(
set.getExercise(), ((quarter - 1) * 3) + 4, 1, 0, 0, 0).addDays(-1).getDate();
DeclaredQuarter(ModelSet set, int quarter)
double getAmountDeclared()
Object getSingleResult(WhereClause wc)