18 package org.turro.erp.purchase;
20 import java.util.ArrayList;
21 import java.util.Date;
22 import java.util.HashMap;
23 import java.util.List;
24 import org.amic.util.date.CheckDate;
25 import org.turro.command.Command;
26 import org.turro.command.Context;
27 import org.turro.elephant.context.Application;
28 import org.turro.elephant.util.Images;
29 import org.turro.elephant.zkoss.Modal;
30 import org.turro.erp.db.ErpPU;
31 import org.turro.erp.entity.OrderItem;
32 import org.turro.erp.entity.ReceiptItem;
33 import org.turro.zkoss.grid.PagingGrid;
34 import org.turro.zkoss.label.LabelExtended;
35 import org.turro.zkoss.menu.ElephantMenu;
36 import org.zkoss.zk.ui.Component;
37 import org.zkoss.zk.ui.Executions;
38 import org.zkoss.zk.ui.event.Event;
39 import org.zkoss.zk.ui.event.EventListener;
40 import org.zkoss.zk.ui.event.Events;
41 import org.zkoss.zk.ui.ext.AfterCompose;
42 import org.zkoss.zul.*;
50 private Date lastDate =
null;
54 if(lastDate ==
null) {
55 lastDate =
new CheckDate().setHour(8).setMinute(0).setSecond(0).getDate();
59 doEdit(dr,
new Command() {
61 public Object execute(Context context) {
73 final List<OrderItem> l =
new ArrayList<>();
74 HashMap<String, Object> map =
new HashMap<>();
75 map.put(
"orderList", l);
76 ElephantMenu.showModalZulFile(
"lSelect",
"/WEB-INF/_zul/erp/purchase/orderSelector.zul", map,
new Command() {
78 public Object execute(Context context) {
110 private void addColumns() {
111 Columns cols =
new Columns();
114 Column col =
new Column(
null,
null,
"100px");
115 cols.appendChild(col);
118 cols.appendChild(col);
121 cols.appendChild(col);
124 cols.appendChild(col);
127 cols.appendChild(col);
130 col.setAlign(
"right");
131 cols.appendChild(col);
134 col.setAlign(
"right");
135 cols.appendChild(col);
137 col =
new Column(
null,
null,
"40px");
138 cols.appendChild(col);
143 Vlayout vbox =
new Vlayout();
145 edit.addEventListener(Events.ON_CLICK,
new EventListener() {
147 public void onEvent(Event event)
throws Exception {
148 doEdit(dr,
new Command() {
150 public Object execute(Context context) {
155 row.getChildren().clear();
164 vbox.appendChild(edit);
167 le.setSclass(
"softLabel");
168 vbox.appendChild(le);
181 private void doEdit(
ReceiptItem dr, Command command) {
182 Window w = (Window) Executions.createComponents(
"/WEB-INF/_zul/erp/purchase/editReceipt.zul",
null,
null);
183 w.setMode(Window.MODAL);
184 Events.sendEvent(Events.ON_USER, w, dr);
static String getString(String key)
static String getImage(String image)
static int doModal(String file)
void setDedication(double dedication)
void setStartWorking(Date startWorking)
ReceiptStatus getStatus()
void deleteReceipt(ReceiptItem dro)
Component getEditBox(final Row row, final ReceiptItem dr)
void deleteObject(Object obj)
Rows getRows(boolean create)
LabelExtended setResourceValue(String resourceValue)