18 package org.turro.financials.document.action;
20 import java.util.Date;
21 import org.turro.action.AbstractAction;
22 import org.turro.command.Command;
23 import org.turro.command.Context;
24 import org.turro.financials.contract.ContractCombobox;
25 import org.turro.financials.entity.Contract;
26 import org.turro.financials.entity.Document;
27 import org.turro.financials.menu.FinancialsMenu;
28 import org.turro.i18n.I_;
29 import org.turro.zkoss.dialog.InputDialog;
30 import org.turro.zkoss.dialog.InputField;
31 import org.turro.zkoss.input.DateboxShort;
32 import org.turro.zul.frame.Framework;
33 import org.zkoss.zk.ui.HtmlBasedComponent;
44 doc = (
Document) context.get(
"entity");
51 protected HtmlBasedComponent createEditor() {
61 protected HtmlBasedComponent createEditor() {
68 public Object
execute(Context context) {
72 Boolean draft =
false;
73 if (fields.length > 0) {
75 if (
"Contract".equals(f.getLabel())) {
77 }
else if (
"Date".equals(f.getLabel())) {
78 date = (Date) f.getValue();
80 }
else if (
"Draft".equals(f.getLabel())) {
81 draft = (Boolean) f.getValue();
85 if (contract !=
null) {
109 return I_.
get(
"Clone document");
114 return "/_zul/images/document_clone.png";
void setDocumentDefinition(DocumentDefinition documentDefinition)
void setOnlyActive(boolean onlyActive)
Object execute(Context context)
void setDocumentNumber(String documentNumber)
void setDocumentDate(Date documentDate)
void copyFrom(Document doc, boolean shallowCopy)
void setContract(Contract contract)
void setDraft(boolean draft)
void setReceiptDate(Date receiptDate)
DocumentDefinition getDocumentDefinition()
static String get(String msg)
static Object getAttribute(Object object, String key)
static Framework getCurrent()
static void setAttribute(Object object, String key, Object value)