18 package org.turro.financials.assets;
20 import java.util.Collection;
21 import org.turro.elephant.util.DateFormats;
22 import org.turro.elephant.util.DecimalFormats;
23 import org.turro.financials.entity.FixedAsset;
24 import org.turro.financials.entity.RegisterEntry;
25 import org.turro.financials.menu.FinancialsMenu;
26 import org.turro.i18n.I_;
27 import org.turro.math.Zero;
28 import org.turro.zkoss.grid.PagingGrid;
29 import org.turro.zkoss.label.LabelTypes;
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.zk.ui.ext.AfterCompose;
34 import org.zkoss.zul.A;
35 import org.zkoss.zul.Column;
36 import org.zkoss.zul.Columns;
37 import org.zkoss.zul.Label;
38 import org.zkoss.zul.Row;
39 import org.zkoss.zul.Rows;
40 import org.zkoss.zul.Vlayout;
55 this.fixedAsset = fixedAsset;
69 private void addRows() {
72 Rows rows =
new Rows();
78 rows.appendChild(row);
80 row.appendChild(
new Label(re.getRegister().getId() +
""));
81 row.appendChild(
new Label(
DateFormats.
format(re.getRegister().getRegisterDate(),
true)));
83 b.addEventListener(Events.ON_CLICK,
new EventListener() {
85 public void onEvent(Event event)
throws Exception {
89 Vlayout vbox =
new Vlayout();
90 vbox.appendChild(LabelTypes.getSoftLabel(re.getAccountString()));
91 vbox.appendChild(LabelTypes.getCaptionLabel(re.getRegister().getView().getName()));
94 row.appendChild(
new Label(DecimalFormats.format(re.getDebit())));
101 private void addColumns() {
105 Column col =
new Column(
"#",
null,
"60px");
106 cols.appendChild(col);
108 col =
new Column(I_.get(
"Date"),
null,
"90px");
109 cols.appendChild(col);
111 col =
new Column(I_.get(
"Account"),
null,
"90%");
112 cols.appendChild(col);
114 col =
new Column(I_.get(
"Amount"),
null,
"120px");
115 col.setAlign(
"right");
116 cols.appendChild(col);
void setFixedAsset(FixedAsset fixedAsset)
FixedAsset getFixedAsset()
Collection< RegisterEntry > getEntries()
static boolean near(double value, int digits)
Columns getColumns(boolean create)
Rows getRows(boolean create)
void setRowCount(int rows)