18 package org.turro.financials.contract;
20 import java.util.logging.Level;
21 import java.util.logging.Logger;
22 import org.amic.util.db.Converter;
23 import org.turro.string.Strings;
24 import org.turro.elephant.context.ElephantContext;
25 import org.turro.financials.db.FinancialsPU;
26 import org.turro.financials.entity.Contract;
27 import org.turro.financials.entity.Product;
28 import org.turro.financials.entity.ProductByContractor;
29 import org.turro.financials.product.ProductCombobox;
30 import org.turro.i18n.I_;
31 import org.turro.zkoss.grid.CollectionGrid;
32 import org.turro.zkoss.grid.EditableCell;
33 import org.zkoss.zk.ui.HtmlBasedComponent;
34 import org.zkoss.zk.ui.ext.AfterCompose;
35 import org.zkoss.zul.Row;
55 this.contract = contract;
57 "select pbc from ProductByContractor pbc " +
58 "where pbc.contract = ?",
59 new Object[] { contract }
75 "select count(dl) from DocumentLine dl " +
76 "where dl.productByContractor = ?",
77 new Object[] { row.getValue() }
79 return new Converter(count).getLong() > 0 ? false :
true;
95 return super.createEditor(editableCell);
107 return super.formatCell(editableCell, value);
110 private void addColumns() {
113 "product",
null, 0,
false,
false).setWidth(
"40%");
115 "contractorCode",
null, 0,
false,
false).setWidth(
"20%");
117 "tax",
null, 0,
false,
false).setWidth(
"20%");
119 "price",
null, 0,
false,
false).setWidth(
"20%");
120 }
catch (ClassNotFoundException ex) {
121 Logger.getLogger(
ProductGrid.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(
null), ex);
void initiateRow(Row row, ProductByContractor value)
boolean isValid(ProductByContractor v)
void setContract(Contract contract)
String formatCell(EditableCell editableCell, Object value)
HtmlBasedComponent createEditor(EditableCell editableCell)
boolean deleteRow(Row row)
String getContractorCode()
void setContract(Contract contract)
String getProductString()
static String get(String msg)
Object getSingleResultOrNull(SqlClause sc)
void setCollection(Collection< V > collection)
EditableColumn addColumn(String label, Class javaClass, String property, String format, int scale, boolean onlyDate, boolean readOnly)
Object getCellValue(EditableCell editableCell)