18 package org.turro.financials.batchof;
20 import java.util.Collection;
21 import org.turro.command.CommandUtil;
22 import org.turro.elephant.util.DateFormats;
23 import org.turro.elephant.util.DecimalFormats;
24 import org.turro.financials.document.action.DocumentActionMenu;
25 import org.turro.financials.entity.BatchOf;
26 import org.turro.financials.entity.Document;
27 import org.turro.financials.menu.FinancialsMenu;
28 import org.turro.i18n.I_;
29 import org.turro.zkoss.grid.PagingGrid;
30 import org.zkoss.zk.ui.event.Event;
31 import org.zkoss.zk.ui.event.EventListener;
32 import org.zkoss.zk.ui.event.Events;
33 import org.zkoss.zul.*;
45 this.batchOf = batchOf;
51 private void addRows() {
54 Rows rows =
new Rows();
59 rows.appendChild(row);
61 row.setSclass(
"draft");
63 row.appendChild(
new Label(doc.getId() +
""));
64 row.appendChild(
new Label(DateFormats.format(doc.getReceiptDate(),
true)));
65 row.appendChild(
new Label(DateFormats.format(doc.getDocumentDate(),
true)));
66 row.appendChild(
new Label(doc.getDocumentNumber()));
67 Vlayout vbox =
new Vlayout();
69 doc.getDocumentDefinition().getName() +
70 (doc.getForcedView() ==
null ?
"" :
" (" + doc.getForcedView().getName() +
")"));
71 b.setImage(
"/_zul/images/document.png");
72 b.addEventListener(Events.ON_CLICK,
new EventListener() {
74 public void onEvent(Event event)
throws Exception {
75 FinancialsMenu.showDocument(doc.getId());
79 b.setAttribute(
"document", doc);
81 vbox.appendChild(CommandUtil.getLinkOrSpace(doc.getContract()));
82 row.appendChild(vbox);
83 row.appendChild(
new Label(DecimalFormats.format(doc.getTotalAmount(),
84 DecimalFormats.getStringFormat(doc.getCurrency().getDefaultFractionDigits()))));
90 private void addColumns() {
94 Column col =
new Column(
"#",
null,
"40px");
95 cols.appendChild(col);
97 col =
new Column(I_.get(
"Receipt/Issue"),
null,
"120px");
98 cols.appendChild(col);
100 col =
new Column(I_.get(
"Date"),
null,
"90px");
101 cols.appendChild(col);
103 col =
new Column(I_.get(
"Number"),
null,
"180px");
104 cols.appendChild(col);
106 col =
new Column(I_.get(
"Document"));
107 cols.appendChild(col);
109 col =
new Column(I_.get(
"Amount"),
null,
"120px");
110 col.setAlign(
"right");
111 cols.appendChild(col);
BatchOfDetailGrid(BatchOf batchOf, DocumentActionMenu dam)
Set< Document > getDocuments()
Columns getColumns(boolean create)
void setRowCount(int rows)