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.batchof.filter.BatchOfFilterGrid;
25 import org.turro.financials.entity.BatchOf;
26 import org.turro.i18n.I_;
27 import org.turro.zkoss.grid.PagingGrid;
28 import org.zkoss.zk.ui.ext.AfterCompose;
29 import org.zkoss.zul.*;
45 this.filterGrid = filterGrid;
60 private void addRows() {
65 Rows rows =
new Rows();
68 for(
final BatchOf batchOf : list) {
70 rows.appendChild(row);
71 if(batchOf.getBatch().isDraft()) {
72 row.setSclass(
"draft");
74 row.appendChild(
new Label(batchOf.getId() +
""));
75 row.appendChild(
new Label(DateFormats.format(batchOf.getBatch().getReceiptDate(),
true)));
76 row.appendChild(
new Label(DateFormats.format(batchOf.getBatch().getDocumentDate(),
true)));
77 row.appendChild(
new Label(batchOf.getBatch().getDocumentNumber()));
78 row.appendChild(CommandUtil.getLinkOrSpace(batchOf));
79 row.appendChild(
new Label(DecimalFormats.format(batchOf.getBatch().getTotalAmount(),
80 DecimalFormats.getStringFormat(batchOf.getBatch().getCurrency().getDefaultFractionDigits()))));
86 private void addColumns() {
90 Column col =
new Column(
"#",
null,
"40px");
91 cols.appendChild(col);
93 col =
new Column(I_.get(
"Receipt/Issue"),
null,
"120px");
94 cols.appendChild(col);
96 col =
new Column(I_.get(
"Date"),
null,
"90px");
97 cols.appendChild(col);
99 col =
new Column(I_.get(
"Number"),
null,
"180px");
100 cols.appendChild(col);
102 col =
new Column(I_.get(
"Batch of"));
103 cols.appendChild(col);
105 col =
new Column(I_.get(
"Amount"),
null,
"120px");
106 col.setAlign(
"right");
107 cols.appendChild(col);
Collection< BatchOf > getBatchOfs(List< IFilterValue > values)
void setFilterGrid(BatchOfFilterGrid filterGrid)
BatchOfFilter getFilter()
List< IFilterValue > getValues()
Columns getColumns(boolean create)
Rows getRows(boolean create)
void setRowCount(int rows)