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.RequestInfo;
|
9
|
|
10
|
/**
|
11
|
* Created by stefania on 8/27/15.
|
12
|
*/
|
13
|
public class BankTransferInlineInfo 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 BankTransferInlineInfo(RequestInfo requestInfo) {
|
21
|
|
22
|
invoiceInfoContents = "<div class=\"displayInlineInfo\">";
|
23
|
|
24
|
invoiceInfoContents += "<dl><dt class=\"chronologySubTitle\">BANK TRANSFER INFO</dt></dl>";
|
25
|
invoiceInfoContents += "<dd>";
|
26
|
|
27
|
invoiceInfoContents += "Date of payment: " + dtf.format(requestInfo.getDate_paid());
|
28
|
invoiceInfoContents += ", APC paid: " + Math.round(requestInfo.getApc_paid()*100) / 100.0 + " EUR";
|
29
|
invoiceInfoContents += ", Transfer costs: " + Math.round(requestInfo.getTransfer_cost()*100) / 100.0 + " EUR";
|
30
|
if(requestInfo.getOther_cost()!=null)
|
31
|
invoiceInfoContents += ", Other expenses: " + Math.round(requestInfo.getOther_cost()*100) / 100.0 + " EUR</dd>";
|
32
|
invoiceInfoContents += "<dd>" + "<a href=\"" + GWT.getModuleBaseURL() + "bankTransfer?requestId=" + requestInfo.getId() + "\" target=\"_blank\">Click here to download the bank transfer document</a>";
|
33
|
|
34
|
invoiceInfoContents += "</dd>";
|
35
|
|
36
|
invoiceInfoContents += "</div>";
|
37
|
invoiceInlineInfo.setHTML(invoiceInfoContents);
|
38
|
}
|
39
|
|
40
|
@Override
|
41
|
public Widget asWidget() {
|
42
|
return invoiceInlineInfo;
|
43
|
}
|
44
|
|
45
|
public void addStyleName(String styleName) {
|
46
|
invoiceInlineInfo.addStyleName(styleName);
|
47
|
}
|
48
|
}
|