18 package org.turro.financials.document;
20 import java.util.Date;
21 import java.util.HashSet;
22 import java.util.logging.Level;
23 import java.util.logging.Logger;
24 import org.turro.elephant.context.ElephantContext;
25 import org.turro.financials.entity.Document;
26 import org.turro.financials.entity.Register;
27 import org.turro.financials.entity.RegisterView;
28 import org.turro.financials.model.register.RegisterWrapper;
29 import org.turro.financials.register.EntriesGrid;
30 import org.turro.i18n.I_;
31 import org.turro.zkoss.grid.CollectionGrid;
32 import org.turro.zkoss.grid.EditableCell;
33 import org.zkoss.zul.Detail;
34 import org.zkoss.zul.Row;
35 import org.zkoss.zul.Vbox;
58 this.document = document;
62 if(document !=
null && document.
getContract() !=
null) {
75 throw new UnsupportedOperationException(
"Not supported yet.");
86 if(value instanceof Long) {
87 if(((Long) value) == 0) {
97 return super.formatCell(editableCell, value);
106 }
catch (ClassNotFoundException ex) {
110 super.afterCompose();
113 private void addColumns() throws ClassNotFoundException {
117 "idRegister",
null, 0,
false,
false).setWidth(
"120px");
119 "registerDate",
null, 0,
true,
false).setWidth(
"120px");
121 "view",
null, 0,
false,
false).setWidth(
"200px");
123 "bookString",
null, 0,
false,
false);
126 private void addDetail(Row row) {
127 row.getChildren().clear();
128 Detail detail =
new Detail();
129 row.appendChild(detail);
130 Vbox vbox =
new Vbox();
131 vbox.setWidth(
"100%");
132 vbox.setStyle(
"padding:5px");
133 detail.appendChild(vbox);
134 EntriesGrid eg =
new EntriesGrid(
new RegisterWrapper((Register) row.getValue(),
false));
135 eg.setDependingRow(row);
139 vbox.appendChild(eg);
141 detail.setVisible(!eg.getCollection().isEmpty());
142 detail.setOpen(detail.isVisible());
143 row.setVisible(detail.isVisible());
static String logMsg(String msg)
void initiateRow(Row row, Register value)
boolean isValid(Register v)
DocumentRegisterView(Document document)
void setDocument(Document document)
String formatCell(EditableCell editableCell, Object value)
boolean deleteRow(Row row)
Set< Register > getRegisters()
DocumentDefinition getDocumentDefinition()
static String get(String msg)
void setCollection(Collection< V > collection)
Collection< V > getCollection()
void setAllowDeletions(boolean allowDeletions)
EditableColumn addColumn(String label, Class javaClass, String property, String format, int scale, boolean onlyDate, boolean readOnly)
void setAllowInsertions(boolean allowInsertions)
boolean isAllowInsertions()
boolean isAllowDeletions()
void setReadOnly(boolean readOnly)