19 package org.turro.erp.workorder;
21 import java.util.Date;
22 import org.turro.command.CommandUtil;
23 import org.turro.command.ControlAdapter;
24 import org.turro.elephant.context.Application;
25 import org.turro.elephant.util.DateFormats;
26 import org.turro.elephant.util.DecimalFormats;
27 import org.turro.elephant.util.Images;
28 import org.turro.erp.entity.*;
29 import org.turro.zkoss.grid.PagingGrid;
30 import org.turro.zkoss.label.LabelAdapter;
31 import org.turro.zkoss.label.PercentLabel;
32 import org.zkoss.zk.ui.Component;
33 import org.zkoss.zk.ui.ext.AfterCompose;
34 import org.zkoss.zul.*;
43 private boolean humanResource =
true, resource =
true, product =
true;
46 this.workOrder = workOrder;
50 this.humanResource = humanResource;
55 this.resource = resource;
60 this.product = product;
70 private void addRows() {
73 Rows rows =
new Rows();
78 rows.appendChild(row);
80 Vlayout vbox =
new Vlayout();
81 row.appendChild(vbox);
82 RequiredUsage requiredUsage = ri.getOrderItem().getOwnerRequiredUsage();
88 row.appendChild(vbox);
89 vbox.appendChild(
new Label(
DateFormats.
formatNull(ri.getWorkDate(), !
"product".equals(ri.getType()))));
93 l.setStyle(
"color:green;font-size:11px;");
95 l.setStyle(
"color:red;font-size:11px;");
99 row.appendChild(
new Image(Images.getImage(ri.getType())));
100 row.appendChild(
new Label(ri.getName()));
101 row.appendChild(
new Label(ri.getDescription()));
102 vbox =
new Vlayout();
103 row.appendChild(vbox);
105 if(ri.getHumanResource() !=
null) {
106 vbox.appendChild(
new LabelAdapter(
new PercentLabel(ri.getDedication())).setSclass(
"softLabel"));
114 private void addColumns() {
115 Columns cols =
new Columns();
118 Column col =
new Column(Application.getString(
"lReference"));
119 cols.appendChild(col);
121 col =
new Column(Application.getString(
"lDate"),
null,
"120px");
122 cols.appendChild(col);
124 col =
new Column(
null,
null,
"30px");
125 cols.appendChild(col);
127 col =
new Column(Application.getString(
"lResource") +
" / " + Application.getString(
"lProduct"));
128 cols.appendChild(col);
130 col =
new Column(Application.getString(
"lConcept"));
131 cols.appendChild(col);
133 col =
new Column(Application.getString(
"lHours") +
" / " + Application.getString(
"lQuantity"),
null,
"120px");
134 col.setAlign(
"right");
135 cols.appendChild(col);
137 col =
new Column(Application.getString(
"lAmount"),
null,
"120px");
138 col.setAlign(
"right");
139 cols.appendChild(col);
143 private void checkRows() {
144 for(Component row :
getRows().getChildren()) {
149 (
"product".equals(ri.
getType()) && product));
static HtmlBasedComponent getLabel(Object entity)
HtmlBasedComponent setSclass(String sclass)
HumanResource getHumanResource()
OrderReference getOrderReference()
void setResource(boolean resource)
void setProduct(boolean product)
void setHumanResource(boolean humanResource)
void setWorkOrder(WorkOrder workOrder)
Rows getRows(boolean create)
void setRowCount(int rows)