18 package org.turro.erp.purchase;
20 import java.util.List;
21 import org.turro.command.Command;
22 import org.turro.command.Context;
23 import org.turro.elephant.context.Application;
24 import org.turro.elephant.util.Images;
25 import org.turro.elephant.zkoss.Modal;
26 import org.turro.erp.db.ErpPU;
27 import org.turro.erp.entity.OrderItem;
28 import org.turro.erp.entity.OrderStatus;
29 import org.turro.erp.entity.RequiredUsage;
30 import org.turro.erp.entity.TaskStatus;
31 import org.turro.jpa.Dao;
32 import org.turro.zkoss.grid.PagingGrid;
33 import org.turro.zkoss.label.LabelExtended;
34 import org.zkoss.zk.ui.Component;
35 import org.zkoss.zk.ui.Executions;
36 import org.zkoss.zk.ui.event.Event;
37 import org.zkoss.zk.ui.event.EventListener;
38 import org.zkoss.zk.ui.event.Events;
39 import org.zkoss.zk.ui.ext.AfterCompose;
40 import org.zkoss.zul.*;
53 "select dco from OrderItem as dco " +
54 "where dco.sent = FALSE " +
55 "and (dco.documentLineId is null or dco.documentLineId = 0)"),
this));
58 private void addColumns() {
59 Columns cols =
new Columns();
62 Column col =
new Column(
null,
null,
"100px");
63 cols.appendChild(col);
66 cols.appendChild(col);
69 cols.appendChild(col);
72 cols.appendChild(col);
75 cols.appendChild(col);
78 col.setAlign(
"right");
79 cols.appendChild(col);
82 col.setAlign(
"right");
83 cols.appendChild(col);
85 col =
new Column(
null,
null,
"40px");
86 cols.appendChild(col);
91 Vlayout vbox =
new Vlayout();
93 edit.addEventListener(Events.ON_CLICK,
new EventListener() {
95 public void onEvent(Event event)
throws Exception {
99 vbox.appendChild(edit);
102 le.setSclass(
"softLabel");
103 vbox.appendChild(le);
111 "delete from OrderItem as dro where dro.id=? and dro.receiptItems is empty",
112 new Object[] { oi.
getId() });
124 private void doEdit(
final OrderItem oi) {
125 Window w = (Window) Executions.createComponents(
"/WEB-INF/_zul/erp/purchase/editOrder.zul",
null,
null);
126 w.setMode(Window.MODAL);
127 Events.sendEvent(Events.ON_USER, w, oi);
130 public Object execute(Context context) {
139 List l = dao.getResultList(
140 "select u from RequiredUsage u " +
141 "where u.orderItems is empty " +
142 "and (u.task.status = ? or u.task.status = ?)",
static String getString(String key)
static String getImage(String image)
static int doModal(String file)
Set< ReceiptItem > getUpdatedReceiptItems()
void addOrder(RequiredUsage ru)
Component getEditBox(final Row row, final OrderItem oi)
void deleteOrder(OrderItem oi)
int executeUpdate(String query)
LabelExtended setResourceValue(String resourceValue)