1
|
package eu.dnetlib.client.fundingrequest.stepinfo;
|
2
|
|
3
|
import com.google.gwt.core.client.GWT;
|
4
|
import com.google.gwt.i18n.client.DateTimeFormat;
|
5
|
import com.google.gwt.user.client.ui.HTML;
|
6
|
import com.google.gwt.user.client.ui.IsWidget;
|
7
|
import com.google.gwt.user.client.ui.Widget;
|
8
|
import eu.dnetlib.goldoa.domain.Invoice;
|
9
|
|
10
|
/**
|
11
|
* Created by stefania on 4/4/15.
|
12
|
*/
|
13
|
public class InvoiceInlineInfo implements IsWidget {
|
14
|
|
15
|
private HTML invoiceInlineInfo = new HTML();
|
16
|
private String invoiceInfoContents = "";
|
17
|
|
18
|
private DateTimeFormat dtf = DateTimeFormat.getFormat("yyyy-MM-dd");
|
19
|
|
20
|
public InvoiceInlineInfo(Invoice invoice) {
|
21
|
|
22
|
invoiceInfoContents = "<div class=\"displayInlineInfo\">";
|
23
|
|
24
|
invoiceInfoContents += "<dl><dt class=\"chronologySubTitle\">INVOICE</dt></dl>";
|
25
|
invoiceInfoContents += "<dd>";
|
26
|
|
27
|
invoiceInfoContents += "Invoice number: " + invoice.getNumber();
|
28
|
if(invoice.getAlternativeId()!=null && !invoice.getAlternativeId().trim().equals(""))
|
29
|
invoiceInfoContents += ", Alternative ID: " + invoice.getAlternativeId();
|
30
|
invoiceInfoContents += ", Date issued: " + dtf.format(invoice.getDate());
|
31
|
invoiceInfoContents += ", " + "<a href=\"" + GWT.getModuleBaseURL() + "invoice?invoiceId=" + invoice.getId() + "\" target=\"_blank\">Click here to download the invoice</a>";
|
32
|
|
33
|
invoiceInfoContents += "</dd>";
|
34
|
|
35
|
invoiceInfoContents += "</div>";
|
36
|
invoiceInlineInfo.setHTML(invoiceInfoContents);
|
37
|
}
|
38
|
|
39
|
@Override
|
40
|
public Widget asWidget() {
|
41
|
return invoiceInlineInfo;
|
42
|
}
|
43
|
|
44
|
public void addStyleName(String styleName) {
|
45
|
invoiceInlineInfo.addStyleName(styleName);
|
46
|
}
|
47
|
}
|