18 package org.turro.financials.document.process;
20 import java.util.ArrayList;
21 import java.util.Collection;
22 import java.util.HashMap;
23 import java.util.List;
24 import org.turro.command.Command;
25 import org.turro.command.Context;
26 import org.turro.elephant.db.WhereClause;
27 import org.turro.elephant.zkoss.Modal;
28 import org.turro.elephant.zkoss.ModalWindow;
29 import org.turro.financials.db.FinancialsPU;
30 import org.turro.financials.entity.Contract;
31 import org.turro.financials.entity.Document;
32 import org.turro.financials.entity.DocumentDefinition;
33 import org.turro.financials.entity.DocumentLine;
34 import org.turro.financials.entity.DocumentRelation;
35 import org.turro.financials.model.document.SingleLineDocumentWrapper;
36 import org.turro.jpa.Dao;
37 import org.turro.plugin.filter.IFilterValue;
38 import org.turro.zkoss.filter.FilterGrid;
39 import org.turro.zul.frame.Framework;
62 HashMap args =
new HashMap();
63 args.put(
"currentDocProcess",
this);
65 final ModalWindow processForm =
Modal.
getModal(
"/WEB-INF/_zul/financials/document/process/cashInvoiceAdvance.zul",
null, args);
68 public Object execute(Context context) {
70 Collection<Document> list = (Collection<Document>) ((Object[]) processForm.
getResultValue())[0];
79 dl.
setConcept(d.getContract().getFullDescription() +
"\n" + d.getDocumentString());
126 List<Document> relDocs =
new ArrayList<>();
128 relDocs.addAll(dao.getResultList(wc));
132 private WhereClause createCriteria(List<IFilterValue> values) {
134 wc.
addClause(
"select doc from Document as doc");
135 wc.
addClause(
"where doc.documentDefinition.id = 1");
139 wc.
addClause(
"order by doc.documentDate");
void addClause(String clause)
static int doModal(String file)
static ModalWindow getModal(String file)
void doProcess(final Document document)
static boolean isAccepted(Document document)
Collection< Document > getDocuments(FilterGrid filterGrid)
ContractDefinition getContractDefinition()
String getFullDescription()
void setStore(Contract store)
void setLineOrder(int lineOrder)
void setLineType(LineType lineType)
void setDocument(Document document)
void setPrice(double price)
void setConcept(String concept)
Set< DocumentLine > getDocumentLines()
String getDocumentString()
LineType getDefaultLineType()
DocumentDefinition getDocumentDefinition()
void setStore(Contract store)
void setDocumentDate(Date documentDate)
void setConcept(String concept)
void setPrice(double price)
List< IFilterValue > getValues()
static Object getAttribute(Object object, String key)
static void setAttribute(Object object, String key, Object value)