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 5/4/15.
|
12
|
*/
|
13
|
public class AlreadyUploadedInvoiceInfo implements IsWidget {
|
14
|
|
15
|
private HTML invoiceInfo = new HTML();
|
16
|
private String invoiceInfoContents = "";
|
17
|
|
18
|
private DateTimeFormat dtf = DateTimeFormat.getFormat("yyyy/MM/dd");
|
19
|
|
20
|
public AlreadyUploadedInvoiceInfo(Invoice invoice) {
|
21
|
|
22
|
invoiceInfoContents = "<div>";
|
23
|
|
24
|
invoiceInfoContents += "<dd>Invoice number: " + invoice.getNumber() + "</dd>";
|
25
|
if(invoice.getAlternativeId()!=null && !invoice.getAlternativeId().trim().equals(""))
|
26
|
invoiceInfoContents += "<dd>Alternative ID: " + invoice.getAlternativeId() + "</dd>";
|
27
|
invoiceInfoContents += "<dd>Date issued: " + dtf.format(invoice.getDate()) + "</dd>";
|
28
|
invoiceInfoContents += "<dd>" + "<a href=\"" + GWT.getModuleBaseURL() + "invoice?invoiceId=" + invoice.getId() + "\" target=\"_blank\">Click here to download the invoice</a>" + "</dd>";
|
29
|
|
30
|
invoiceInfoContents += "</div>";
|
31
|
invoiceInfo.setHTML(invoiceInfoContents);
|
32
|
}
|
33
|
|
34
|
@Override
|
35
|
public Widget asWidget() {
|
36
|
return invoiceInfo;
|
37
|
}
|
38
|
|
39
|
public void addStyleName(String styleName) {
|
40
|
invoiceInfo.addStyleName(styleName);
|
41
|
}
|
42
|
}
|