19 package org.turro.erp.reference;
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.DateFormats;
25 import org.turro.elephant.util.DecimalFormats;
26 import org.turro.elephant.util.ZkossUtils;
27 import org.turro.elephant.zkoss.Modal;
28 import org.turro.erp.entity.CustomerOrder;
29 import org.turro.erp.entity.OrderReference;
30 import org.turro.zkoss.layout.GridLayout;
31 import org.zkoss.zk.ui.Component;
32 import org.zkoss.zk.ui.Executions;
33 import org.zkoss.zk.ui.event.Event;
34 import org.zkoss.zk.ui.event.Events;
35 import org.zkoss.zk.ui.util.GenericForwardComposer;
36 import org.zkoss.zul.Label;
37 import org.zkoss.zul.Toolbarbutton;
38 import org.zkoss.zul.Window;
46 private Toolbarbutton newOrder, editOrder, deleteOrder;
48 private Label orderId, orderDate, custCode, controlDate, delivery, description, quantity, price;
53 Events.postEvent(
new Event(Events.ON_CHANGE));
58 Events.postEvent(
new Event(Events.ON_CHANGE));
62 ZkossUtils.confirmDeletion(
null,
new Command() {
64 public Object execute(Context context) {
67 Events.postEvent(
new Event(Events.ON_CHANGE));
73 private void editOrder() {
74 Window w = (Window) Executions.createComponents(
"/WEB-INF/_zul/erp/workorder/editCustomerOrder.zul",
null,
null);
75 w.setMode(Window.MODAL);
76 Events.sendEvent(Events.ON_USER, w, orderReference);
79 public Object execute(Context context) {
88 super.doAfterCompose(comp);
94 private void updateControls() {
96 newOrder.setVisible(customerOrder ==
null);
97 editOrder.setVisible(!newOrder.isVisible());
98 deleteOrder.setVisible(!newOrder.isVisible());
99 order.setVisible(!newOrder.isVisible());
100 if(order.isVisible()) {
111 orderId.setValue(
null);
112 orderDate.setValue(
null);
113 custCode.setValue(
null);
114 controlDate.setValue(
null);
115 delivery.setValue(
null);
116 description.setValue(
null);
117 quantity.setValue(
null);
118 price.setValue(
null);
static String getString(String key)
static int doModal(String file)
CustomerOrder getCustomerOrder()
void setCustomerOrder(CustomerOrder customerOrder)
void doAfterCompose(Component comp)
void onClick $editOrder()
void onClick $deleteOrder()