18 package org.turro.financials.assets;
20 import java.util.Collection;
21 import org.turro.command.Command;
22 import org.turro.command.Context;
23 import org.turro.elephant.util.DecimalFormats;
24 import org.turro.financials.assets.filter.AssetFilterGrid;
25 import org.turro.financials.entity.DocumentLine;
26 import org.turro.financials.entity.FixedAsset;
27 import org.turro.financials.menu.FinancialsMenu;
28 import org.turro.i18n.I_;
29 import org.turro.zkoss.grid.PagingGrid;
30 import org.turro.zkoss.label.LabelTypes;
31 import org.zkoss.zk.ui.event.Event;
32 import org.zkoss.zk.ui.event.EventListener;
33 import org.zkoss.zk.ui.event.Events;
34 import org.zkoss.zk.ui.ext.AfterCompose;
35 import org.zkoss.zul.*;
50 this.fixedAsset = fixedAsset;
61 public Object execute(Context context) {
74 private void addRows() {
77 Rows rows =
new Rows();
82 rows.appendChild(row);
84 row.appendChild(
new Label(dl.getDocument().getId() +
""));
86 b.addEventListener(Events.ON_CLICK,
new EventListener() {
88 public void onEvent(Event event)
throws Exception {
92 Vlayout vbox =
new Vlayout();
93 vbox.appendChild(LabelTypes.getCaptionLabel(dl.getDocument().getContract().getFullDescription()));
94 vbox.appendChild(LabelTypes.getSoftLabel(dl.getDocument().getDocumentString()));
98 if(dl.getProduct() !=
null) {
99 vbox.appendChild(LabelTypes.getSoftLabel(dl.getProduct().getProductCodeStr() +
100 " - " + dl.getProduct().getDescription()));
102 if(dl.getProductByContractor() !=
null) {
103 vbox.appendChild(LabelTypes.getSoftLabel(dl.getProductByContractor().getProduct().getProductCodeStr() +
104 " - " + dl.getProductByContractor().getProduct().getDescription()));
106 if(dl.getConcept() !=
null) {
107 vbox.appendChild(LabelTypes.getSoftLabel(dl.getConcept()));
109 vbox.appendChild(LabelTypes.getSoftLabel(dl.getStore().getPartialDescription()));
110 row.appendChild(vbox);
111 row.appendChild(
new Label(DecimalFormats.format(dl.getTaxable(),
112 DecimalFormats.getStringFormat(dl.getDocument().getCurrency().getDefaultFractionDigits()))));
113 Checkbox cb =
new Checkbox();
114 cb.setChecked(
false);
116 row.setAttribute(
"cb", cb);
123 private void addColumns() {
127 Column col =
new Column(
"#",
null,
"60px");
128 cols.appendChild(col);
130 col =
new Column(I_.get(
"Document"),
null,
"50%");
131 cols.appendChild(col);
133 col =
new Column(I_.get(
"Concept"),
null,
"50%");
134 cols.appendChild(col);
136 col =
new Column(I_.get(
"Amount"),
null,
"120px");
137 col.setAlign(
"right");
138 cols.appendChild(col);
140 col =
new Column(
"",
"/_zul/images/edit-delete.png",
"30px");
141 cols.appendChild(col);
void setFixedAsset(FixedAsset fixedAsset)
FixedAsset getFixedAsset()
void createRelation(FixedAssetWrapper wrapper, AssetFilterGrid filter)
void loadLines(FilterGrid filterGrid, final Command command)
Set< DocumentLine > getDocumentLines()
Columns getColumns(boolean create)
Rows getRows(boolean create)
void setRowCount(int rows)