18 package org.turro.erp.workorder;
20 import org.turro.elephant.db.WhereClause;
21 import org.turro.financials.entity.Product;
22 import org.turro.financials.product.ProductCombobox;
23 import org.turro.zkoss.filter.FilterField;
24 import org.turro.zkoss.filter.FilterFieldOperator;
25 import org.turro.zkoss.filter.FilterGrid;
26 import org.zkoss.zk.ui.HtmlBasedComponent;
38 public void addConstraint(WhereClause wc) {
39 doAddConstraint(wc,
"wo.workOrderId");
44 public void addConstraint(WhereClause wc) {
45 doAddConstraint(wc,
"wo.id");
48 addField(
new FilterField(
"lDate",
new java.util.Date(
new java.util.Date().getTime() - (1L * 30L * 24L * 60L * 60L * 1000L))) {
50 public void addConstraint(WhereClause wc) {
51 doAddConstraint(wc,
"wo.workOrderDate");
54 addField(
new FilterField(
"lDescription",
"", FilterFieldOperator.FILTER_CONTAINS) {
56 public void addConstraint(WhereClause wc) {
57 doAddConstraint(wc, new String[] {
"wo.description",
"r.description" });
60 addField(
new FilterField(
"lDraft",
true) {
62 public void addConstraint(WhereClause wc) {
63 doAddConstraint(wc,
"wo.draft");
66 addField(
new FilterField(
"lProduct") {
68 protected HtmlBasedComponent createEditor() {
69 ProductCombobox pcb =
new ProductCombobox();
70 if(value instanceof Long) {
71 pcb.setProductId((Long) value);
77 protected Object getEditorValue() {
78 Product product = (Product) super.getEditorValue();
80 return product.getId();
85 public void addConstraint(WhereClause wc) {
86 doAddConstraint(wc,
"wo.productId");
89 if(!loadPreferences(this.getClass().getName()+
"_filter")) {
90 addCurrentField(
"lNumber");
FilterField addField(FilterField filterField)