BrightSide Workbench Full Report + Source Code
org.turro.financials.document.process.CashInvoiceAdvance Class Reference
Inheritance diagram for org.turro.financials.document.process.CashInvoiceAdvance:
Collaboration diagram for org.turro.financials.document.process.CashInvoiceAdvance:

Public Member Functions

String getLabel ()
 
void doProcess (final Document document)
 
Collection< DocumentgetDocuments (FilterGrid filterGrid)
 
- Public Member Functions inherited from org.turro.financials.document.process.DocumentProcess
Document getDocument ()
 

Static Public Member Functions

static boolean isAccepted (Document document)
 
- Static Public Member Functions inherited from org.turro.financials.document.process.DocumentProcess
static List< DocumentProcessgetInstances (Document document)
 

Additional Inherited Members

- Protected Attributes inherited from org.turro.financials.document.process.DocumentProcess
Document document
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 45 of file CashInvoiceAdvance.java.

Member Function Documentation

◆ doProcess()

void org.turro.financials.document.process.CashInvoiceAdvance.doProcess ( final Document  document)

Reimplemented from org.turro.financials.document.process.DocumentProcess.

Definition at line 61 of file CashInvoiceAdvance.java.

61  {
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() {
67  @Override
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);
73  int count = document.getMaxLineOrder() + 1;
74  Dao dao = new FinancialsPU();
75  for(Document d : list) {
76  DocumentLine dl = new DocumentLine();
77  dl.setDocument(document);
78  document.getDocumentLines().add(dl);
79  dl.setConcept(d.getContract().getFullDescription() + "\n" + d.getDocumentString());
80  dl.setPrice(d.getTotalAmount());
81  dl.setLineOrder(count++);
82  dl.setLineType(document.getDefaultLineType());
83  dl.setStore(store);
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());
90  sldw.setStore(store);
91  }
92  }
93  }
94  return true;
95  }
96  });
97 // if(Modal.doModal(processForm) == 1) {
98 // Collection<Document> list = (Collection<Document>) ((Object[]) processForm.getResultValue())[0];
99 // Contract store = (Contract) ((Object[]) processForm.getResultValue())[1];
100 // Framework.setAttribute(this, "store", store);
101 // int count = document.getMaxLineOrder() + 1;
102 // Dao dao = new FinancialsPU();
103 // for(Document d : list) {
104 // DocumentLine dl = new DocumentLine();
105 // dl.setDocument(document);
106 // document.getDocumentLines().add(dl);
107 // dl.setConcept(d.getContract().getFullDescription() + "\n" + d.getDocumentString());
108 // dl.setPrice(d.getTotalAmount());
109 // dl.setLineOrder(count++);
110 // dl.setLineType(document.getDefaultLineType());
111 // dl.setStore(store);
112 // for(DocumentRelation dr : d.getDescendants()) {
113 // SingleLineDocumentWrapper sldw = new SingleLineDocumentWrapper(document, dao.find(DocumentDefinition.class, 61L));
114 // Document dd = dr.getDescendant();
115 // sldw.setConcept(dd.getContract().getFullDescription() + "\n" + dd.getDocumentString());
116 // sldw.setPrice(dd.getTotalAmount());
117 // sldw.setDocumentDate(dd.getDocumentDate());
118 // sldw.setStore(store);
119 // }
120 // }
121 // }
122  }
Set< DocumentLine > getDocumentLines()
Definition: Document.java:180
Here is the call graph for this function:

◆ getDocuments()

Collection<Document> org.turro.financials.document.process.CashInvoiceAdvance.getDocuments ( FilterGrid  filterGrid)

Definition at line 124 of file CashInvoiceAdvance.java.

124  {
125  Dao dao = new FinancialsPU();
126  List<Document> relDocs = new ArrayList<>();
127  WhereClause wc = createCriteria(filterGrid.getValues());
128  relDocs.addAll(dao.getResultList(wc));
129  return relDocs;
130  }
Here is the call graph for this function:

◆ getLabel()

String org.turro.financials.document.process.CashInvoiceAdvance.getLabel ( )

Reimplemented from org.turro.financials.document.process.DocumentProcess.

Definition at line 56 of file CashInvoiceAdvance.java.

56  {
57  return "Selection";
58  }

◆ isAccepted()

static boolean org.turro.financials.document.process.CashInvoiceAdvance.isAccepted ( Document  document)
static

Definition at line 47 of file CashInvoiceAdvance.java.

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file: