19 package org.turro.erp.purchase;
21 import java.util.ArrayList;
22 import java.util.Date;
23 import java.util.List;
24 import java.util.logging.Level;
25 import java.util.logging.Logger;
26 import org.amic.util.date.CheckDate;
27 import org.turro.elephant.context.Application;
28 import org.turro.elephant.util.DateFormats;
29 import org.turro.elephant.util.DecimalFormats;
30 import org.turro.erp.db.ErpPU;
31 import org.turro.erp.entity.HumanResource;
32 import org.turro.erp.entity.Task;
33 import org.turro.erp.entity.WorkOrder;
34 import org.turro.erp.reference.OrderReferenceGrid;
35 import org.turro.erp.reference.OrderReferencePositionListbox;
36 import org.turro.erp.resource.ResourceAptitude;
37 import org.turro.erp.resource.ResourceAptitudeCombobox;
38 import org.turro.erp.task.TaskListbox;
39 import org.turro.jpa.Dao;
40 import org.turro.zkoss.grid.CollectionGrid;
41 import org.turro.zkoss.grid.EditableCell;
42 import org.turro.zkoss.grid.EditableColumn;
43 import org.turro.zkoss.input.Percentbox;
44 import org.zkoss.zk.ui.HtmlBasedComponent;
45 import org.zkoss.zk.ui.event.Event;
46 import org.zkoss.zk.ui.event.EventListener;
47 import org.zkoss.zk.ui.event.Events;
48 import org.zkoss.zk.ui.ext.AfterCompose;
49 import org.zkoss.zul.Row;
57 private long lastWorkOrderId;
58 private int lastOrderRef;
59 private Date lastDate;
60 private Task lastTask;
62 private String lastConcept;
63 private boolean receipt;
74 this.receipt = receipt;
78 if(lastDate ==
null) {
79 lastDate =
new CheckDate(documentDate).setHour(8).setMinute(0).setSecond(0).getDate();
119 orplb.setMold(
"select");
125 orplb.addEventListener(Events.ON_SELECT,
new EventListener() {
127 public void onEvent(Event event)
throws Exception {
131 Events.postEvent(
new Event(Events.ON_CHANGING,
HoursGrid.this, editableCell));
140 tlb.setMold(
"select");
155 if(value !=
null) pc.
setValue((Double) value);
159 return super.createEditor(editableCell);
168 lastTask = hoursItem.
getTask();
171 if(value instanceof
Task) {
180 return super.formatCell(editableCell, value);
191 super.cellChanged(editableCell, value);
202 return super.isCellValid(editableCell, value);
205 private void addColumns() {
217 }
catch (ClassNotFoundException ex) {
218 Logger.getLogger(OrderReferenceGrid.class.getName()).log(Level.SEVERE,
null, ex);
224 List<HoursItem> l =
new ArrayList<HoursItem>();
static String getString(String key)
static WorkOrder getByWorkOrderId(long value)
boolean isCellValid(EditableCell editableCell, Object value)
void cellChanged(EditableCell editableCell, Object value)
void setDocumentDate(Date documentDate)
void initiateRow(Row row, HoursItem value)
HtmlBasedComponent createEditor(final EditableCell editableCell)
String formatCell(EditableCell editableCell, Object value)
boolean deleteRow(Row row)
boolean isValid(HoursItem v)
void refreshUsing(HumanResource humanResource, String documentNumber, Date documentDate)
void setReceipt(boolean receipt)
void setStartWorking(Date startWorking)
void setWorkOrderId(long workOrderId)
ResourceAptitude getResourceAptitude()
void setResourceAptitude(ResourceAptitude resourceAptitude)
void setConcept(String concept)
OrderReference getOrderReference()
void setDedication(double dedication)
void setOrderRef(int orderRef)
void setWorkOrder(WorkOrder workOrder)
void setOrderReference(OrderReference orderReference)
void updateCollection(Collection< V > collection)
EditableColumn addColumn(String label, Class javaClass, String property, String format, int scale, boolean onlyDate, boolean readOnly)
Object getCellValue(EditableCell editableCell)