62 HashMap args =
new HashMap();
63 args.put(
"currentDocProcess",
this);
64 args.put(
"currentStore", Framework.getAttribute(
this,
"store"));
65 final ModalWindow processForm = Modal.getModal(
"/WEB-INF/_zul/financials/document/process/cashInvoiceAdvance.zul",
null, args);
66 Modal.doModal(processForm,
new Command() {
68 public Object execute(Context context) {
69 if(processForm.getResult() == 1) {
70 Collection<Document> list = (Collection<Document>) ((Object[]) processForm.getResultValue())[0];
71 Contract store = (Contract) ((Object[]) processForm.getResultValue())[1];
72 Framework.setAttribute(
this,
"store", store);
74 Dao dao =
new FinancialsPU();
75 for(Document d : list) {
76 DocumentLine dl =
new DocumentLine();
79 dl.setConcept(d.getContract().getFullDescription() +
"\n" + d.getDocumentString());
80 dl.setPrice(d.getTotalAmount());
81 dl.setLineOrder(count++);
84 for(DocumentRelation dr : d.getDescendants()) {
85 SingleLineDocumentWrapper sldw =
new SingleLineDocumentWrapper(
document, dao.find(DocumentDefinition.class, 61L));
86 Document dd = dr.getDescendant();
87 sldw.setConcept(dd.getContract().getFullDescription() +
"\n" + dd.getDocumentString());
88 sldw.setPrice(dd.getTotalAmount());
89 sldw.setDocumentDate(dd.getDocumentDate());
Set< DocumentLine > getDocumentLines()
LineType getDefaultLineType()