18 package org.turro.financials.assets;
20 import java.util.Collection;
21 import org.turro.command.CommandUtil;
22 import org.turro.elephant.util.DecimalFormats;
23 import org.turro.financials.assets.filter.FixedAssetFilterGrid;
24 import org.turro.financials.entity.FixedAsset;
25 import org.turro.i18n.I_;
26 import org.turro.zkoss.grid.PagingGrid;
27 import org.turro.zkoss.label.LabelTypes;
28 import org.zkoss.zk.ui.ext.AfterCompose;
29 import org.zkoss.zul.*;
51 this.filterGrid = filterGrid;
59 private void addRows() {
64 Rows rows =
new Rows();
67 double t_investment = 0, t_depreciated = 0;
72 rows.appendChild(row);
73 if(fa.isUnsubscribed()) {
74 row.setSclass(
"invalid");
77 row.appendChild(
new Label(fa.getId() +
""));
78 row.appendChild(CommandUtil.getAdapter(fa).setLabel(
80 " (" + fa.getView().getName() +
")" +
81 " - " + fa.getStore().getFullDescription()
83 row.appendChild(
new Label(fa.getInvestmentPreference().getName()));
86 row.appendChild(
new Label(DecimalFormats.format(investment,
87 DecimalFormats.getStringFormat(2))));
88 row.appendChild(
new Label(DecimalFormats.format(depreciated,
89 DecimalFormats.getStringFormat(2))));
90 row.appendChild(
new Label(DecimalFormats.format(investment - depreciated,
91 DecimalFormats.getStringFormat(2))));
92 t_investment += investment;
93 t_depreciated += depreciated;
99 Footer footer =
new Footer(
"");
101 foot.appendChild(footer);
102 footer =
new Footer();
103 footer.setAlign(
"right");
104 footer.appendChild(LabelTypes.getCaptionLabel(DecimalFormats.format(t_investment,
"#,##0.00")));
105 foot.appendChild(footer);
106 footer =
new Footer();
107 footer.setAlign(
"right");
108 footer.appendChild(LabelTypes.getCaptionLabel(DecimalFormats.format(t_depreciated,
"#,##0.00")));
109 foot.appendChild(footer);
110 footer =
new Footer();
111 footer.setAlign(
"right");
112 footer.appendChild(LabelTypes.getCaptionLabel(DecimalFormats.format(t_investment - t_depreciated,
"#,##0.00")));
113 foot.appendChild(footer);
116 private void addColumns() {
122 Column col =
new Column(
"#",
null,
"40px");
123 cols.appendChild(col);
125 col =
new Column(I_.get(
"Name"));
127 cols.appendChild(col);
129 col =
new Column(I_.get(
"Type"));
131 cols.appendChild(col);
133 col =
new Column(I_.get(
"Investment"),
null,
"120px");
134 col.setAlign(
"right");
135 cols.appendChild(col);
137 col =
new Column(I_.get(
"Depreciated"),
null,
"120px");
138 col.setAlign(
"right");
139 cols.appendChild(col);
141 col =
new Column(I_.get(
"Pending"),
null,
"120px");
142 col.setAlign(
"right");
143 cols.appendChild(col);
Collection< FixedAsset > getAssets(List< IFilterValue > values)
void setFilterGrid(FixedAssetFilterGrid filterGrid)
List< IFilterValue > getValues()
Foot getFoot(boolean create)
Columns getColumns(boolean create)
Rows getRows(boolean create)
void setRowCount(int rows)