|
void | print (final String type) |
|
- Author
- Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g
Definition at line 63 of file DiaryReport.java.
◆ DiaryReport()
org.turro.financials.account.DiaryReport.DiaryReport |
( |
| ) |
|
◆ exportAccountBalance()
static void org.turro.financials.account.DiaryReport.exportAccountBalance |
( |
int |
year, |
|
|
int |
month, |
|
|
boolean |
carry, |
|
|
boolean |
breakdown |
|
) |
| |
|
static |
Definition at line 231 of file DiaryReport.java.
232 WhereClause wc =
new WhereClause();
233 wc.addClause(
"select r.view.name,");
235 wc.addClause(
"year(r.registerDate),");
236 wc.addClause(
"month(r.registerDate),");
238 wc.addClause(
"substring(re.account.id, 1, 1), (select ma1.description from MajorAccount ma1 where ma1.account = substring(re.account.id, 1, 1)),");
239 wc.addClause(
"substring(re.account.id, 1, 2), (select ma2.description from MajorAccount ma2 where ma2.account = substring(re.account.id, 1, 2)),");
240 wc.addClause(
"substring(re.account.id, 1, 3), (select ma3.description from MajorAccount ma3 where ma3.account = substring(re.account.id, 1, 3)),");
241 wc.addClause(
"ma.account, ma.description, re.account.id,");
242 wc.addClause(
"re.account.description, sum(re.debit), sum(re.credit)");
243 wc.addClause(
"from RegisterEntry re join re.register r, MajorAccount ma");
244 wc.addClause(
"where ma.account = (select max(m.account) from MajorAccount as m");
245 wc.addClause(
"where re.account.id like concat(m.account, '%'))");
246 wc.addClause(
"and r.registerDate < :date");
247 wc.addNamedValue(
"date",
new CheckDate(year, month, 1, 0, 0, 0).addMonths(1).getDate());
249 wc.addClause(
"and year(r.registerDate) >= :carry");
251 wc.addClause(
"and not (r.exclude = TRUE and year(r.registerDate) = :year)");
252 wc.addNamedValue(
"year", year);
254 wc.addClause(
"and year(r.registerDate) = :carry");
255 wc.addNamedValue(
"carry", year);
256 wc.addClause(
"and not (r.exclude = TRUE or r.closing = TRUE)");
259 wc.addClause(
"group by r.view.name, year(r.registerDate), month(r.registerDate), re.account.id, ma.account, ma.description");
261 wc.addClause(
"group by r.view.name, re.account.id, ma.account, ma.description");
263 wc.addClause(
"order by re.account.id");
267 l = Arrays.asList(
new String[] {
271 "M1",
"M1Desc",
"M2",
"M2Desc",
"M3",
"M3Desc",
272 I_.get(
"Major account"),
275 I_.get(
"Description"),
280 l = Arrays.asList(
new String[] {
282 "M1",
"M1Desc",
"M2",
"M2Desc",
"M3",
"M3Desc",
283 I_.get(
"Major account"),
286 I_.get(
"Description"),
291 Dao dao =
new FinancialsPU();
292 String name = ElephantContext.getSiteName() +
"_AccountBalance.xls";
293 ExportQuery eq =
new ExportQuery(l, dao.getResultList(wc));
294 Filedownload.save(eq.getExcel(name),
new MimetypesFileTypeMap().getContentType(name), name);
static Integer getLastInitialSince(int year)
◆ exportDiary()
static void org.turro.financials.account.DiaryReport.exportDiary |
( |
| ) |
|
|
static |
Definition at line 183 of file DiaryReport.java.
184 IContact contact = Authentication.getIContact();
185 MailSenders.getHeavy()
187 .onStart(s -> MessageQueue.pushMessage(contact, I_.get(
"Report will be sent by email")))
188 .onCancel(s -> MessageQueue.pushMessage(contact, I_.get(
"Task already running")))
189 .onBuild(s -> diaryToExcel((IMailSender) s))
190 .send(I_.get(
"Export diary"), I_.get(
"Export diary"));
◆ getLastInitialSince()
static Integer org.turro.financials.account.DiaryReport.getLastInitialSince |
( |
int |
year | ) |
|
|
static |
Definition at line 297 of file DiaryReport.java.
298 return SqlClause.select(
"year(max(registerDate))").from(
"Register")
299 .where().equal(
"closing",
true)
300 .and().equal(
"exclude",
false)
301 .and().smallerOrEqual(
"year(registerDate)", year)
302 .and().equal(
"view.id", 1L)
303 .dao(
new FinancialsPU())
304 .singleResult(Integer.class);
◆ getRegisters()
Collection<Long> org.turro.financials.account.DiaryReport.getRegisters |
( |
| ) |
|
Definition at line 156 of file DiaryReport.java.
157 WhereClause wc =
new WhereClause();
158 wc.addClause(
"select reg.id");
159 wc.addClause(
"from Register reg");
160 wc.addClause(
"where reg.view = :view");
161 wc.addNamedValue(
"view", view);
162 wc.addClause(
"and year(reg.registerDate) = :year");
163 wc.addNamedValue(
"year", year);
164 wc.addClause(
"order by reg.idRegister");
166 Dao dao =
new FinancialsPU();
167 return dao.getResultList(wc);
◆ getSQLRegisters()
WhereClause org.turro.financials.account.DiaryReport.getSQLRegisters |
( |
| ) |
|
Definition at line 170 of file DiaryReport.java.
171 WhereClause wc =
new WhereClause();
172 wc.addClause(
"select reg");
173 wc.addClause(
"from Register reg");
174 wc.addClause(
"where reg.view = :view");
175 wc.addNamedValue(
"view", view);
176 wc.addClause(
"and year(reg.registerDate) = :year");
177 wc.addNamedValue(
"year", year);
178 wc.addClause(
"order by reg.idRegister");
◆ print()
void org.turro.financials.account.DiaryReport.print |
( |
final String |
type | ) |
|
|
protected |
Reimplemented from org.turro.zkoss.print.ReportMenuitem.
Definition at line 73 of file DiaryReport.java.
75 view = ViewWrapper.getFormalView();
77 year =
new CheckDate().getYear();
81 Framework.getCurrent().getPage(),
84 new InputField(
"Year", year, null, 0),
85 new InputField(
"Start page", startPage, null, 0),
86 new InputField(
"View", null, null, 0) {
88 protected HtmlBasedComponent createEditor() {
89 ViewListbox vl = new ViewListbox();
96 public Object execute(Context context) {
97 InputField[] fields = (InputField[]) context.get(
"fields");
98 if(fields.length > 0) {
99 for(InputField f : fields) {
100 if(
"Year".equals(f.getLabel())) {
101 year = (Integer) f.getValue();
102 }
else if(
"Start page".equals(f.getLabel())) {
103 startPage = (Integer) f.getValue() - 1;
104 }
else if(
"View".equals(f.getLabel())) {
105 view = (RegisterView) f.getValue();
109 IContact contact = Authentication.getIContact();
110 MailSenders.getHeavy()
112 .onStart(s -> MessageQueue.pushMessage(contact, I_.get(
"Report will be sent by email")))
113 .onCancel(s -> MessageQueue.pushMessage(contact, I_.get(
"Task already running")))
114 .onBuild(s -> print2execute((IMailSender) s))
115 .send(I_.get(
"Diary book"), I_.get(
"Diary book"));
The documentation for this class was generated from the following file: