18 package org.turro.financials.document;
20 import java.util.Collection;
21 import java.util.Date;
22 import java.util.HashSet;
23 import java.util.logging.Level;
24 import java.util.logging.Logger;
25 import org.turro.elephant.context.ElephantContext;
26 import org.turro.financials.entity.Document;
27 import org.turro.financials.entity.DocumentRelation;
28 import org.turro.financials.entity.RegisterView;
29 import org.turro.financials.model.document.DocumentWrapper;
30 import org.turro.financials.model.register.RegisterWrapper;
31 import org.turro.financials.register.EntriesGrid;
32 import org.turro.i18n.I_;
33 import org.turro.zkoss.grid.CollectionGrid;
34 import org.turro.zkoss.grid.EditableCell;
35 import org.zkoss.zul.Detail;
36 import org.zkoss.zul.Row;
37 import org.zkoss.zul.Vbox;
61 this.document = document;
65 if(descendants ==
null)
return;
87 if(document !=
null && document.
getContract() !=
null) {
105 throw new UnsupportedOperationException(
"Not supported yet.");
116 if(value instanceof Long) {
117 if(((Long) value) == 0) {
127 return super.formatCell(editableCell, value);
136 }
catch (ClassNotFoundException ex) {
140 super.afterCompose();
143 private void addColumns() throws ClassNotFoundException {
147 "register.idRegister",
null, 0,
false,
false).setWidth(
"120px");
149 "register.registerDate",
null, 0,
true,
false).setWidth(
"120px");
151 "register.view",
null, 0,
false,
false).setWidth(
"200px");
153 "bookString",
null, 0,
false,
false);
156 private void addDetail(Row row) {
157 row.getChildren().clear();
158 Detail detail =
new Detail();
159 row.appendChild(detail);
160 Vbox vbox =
new Vbox();
161 vbox.setWidth(
"100%");
162 vbox.setStyle(
"padding:5px");
163 detail.appendChild(vbox);
164 EntriesGrid eg =
new EntriesGrid((RegisterWrapper) row.getValue());
165 eg.setDependingRow(row);
169 vbox.appendChild(eg);
171 detail.setVisible(!eg.getCollection().isEmpty());
172 detail.setOpen(detail.isVisible());
173 row.setVisible(detail.isVisible());
static String logMsg(String msg)
void setDescendants(Collection< DocumentRelation > descendants)
void setDocument(Document document)
void initiateRow(Row row, RegisterWrapper value)
DocumentRegistersGrid(Document document)
boolean isValid(RegisterWrapper v)
boolean deleteRow(Row row)
String formatCell(EditableCell editableCell, Object value)
void updateDocument(Document document, Collection< DocumentRelation > descendants)
RegisterView getForcedView()
DocumentDefinition getDocumentDefinition()
Set< RegisterWrapper > getRegisters()
static String get(String msg)
void setCollection(Collection< V > collection)
Collection< V > getCollection()
EditableColumn addColumn(String label, Class javaClass, String property, String format, int scale, boolean onlyDate, boolean readOnly)
boolean isAllowInsertions()
boolean isAllowDeletions()
void setReadOnly(boolean readOnly)