Revision 36069
Added by Stefania Martziou about 9 years ago
modules/uoa-goldoa-portal/trunk/src/main/java/eu/dnetlib/client/RequestInfoElement.java | ||
---|---|---|
94 | 94 |
} |
95 | 95 |
|
96 | 96 |
if(requestInfo.getProjectParticipation()!=null && requestInfo.getFundingRequested()!=null) { |
97 |
AccountingInlineInfo accountingInlineInfo = new AccountingInlineInfo(new Request(requestInfo), apc, discount); |
|
97 |
AccountingInlineInfo accountingInlineInfo = new AccountingInlineInfo(new Request(requestInfo), apc, discount, requestInfo.getInvoice());
|
|
98 | 98 |
requestSummaryPanel.add(accountingInlineInfo.asWidget()); |
99 | 99 |
} |
100 | 100 |
|
modules/uoa-goldoa-portal/trunk/src/main/java/eu/dnetlib/client/fundingrequest/newrequest/ChronologyWidget.java | ||
---|---|---|
45 | 45 |
|
46 | 46 |
if (fundingWizardState.getPublication() != null && fundingWizardState.getPublication().getJournal() != null) { |
47 | 47 |
loadAccountingInfo(fundingWizardState.getRequest(), fundingWizardState.getPublication().getJournal().getApc(), |
48 |
fundingWizardState.getPublication().getJournal().getDiscount()); |
|
48 |
fundingWizardState.getPublication().getJournal().getDiscount(), fundingWizardState.getInvoice());
|
|
49 | 49 |
} |
50 | 50 |
|
51 | 51 |
if (fundingWizardState.getPublication() != null && fundingWizardState.getPublication().getPublisher() != null) { |
52 | 52 |
loadAccountingInfo(fundingWizardState.getRequest(), fundingWizardState.getPublication().getPublisher().getAPC(), |
53 |
fundingWizardState.getPublication().getPublisher().getDiscount()); |
|
53 |
fundingWizardState.getPublication().getPublisher().getDiscount(), fundingWizardState.getInvoice());
|
|
54 | 54 |
} |
55 | 55 |
} |
56 | 56 |
|
... | ... | |
93 | 93 |
chronologyPanel.add(publisherFullInfo.asWidget()); |
94 | 94 |
} |
95 | 95 |
|
96 |
private void loadAccountingInfo(Request request, float apc, float discount) { |
|
96 |
private void loadAccountingInfo(Request request, float apc, float discount, Invoice invoice) {
|
|
97 | 97 |
|
98 |
AccountingFullInfo accountingFullInfo = new AccountingFullInfo(request, apc, discount); |
|
98 |
AccountingFullInfo accountingFullInfo = new AccountingFullInfo(request, apc, discount, invoice);
|
|
99 | 99 |
chronologyPanel.add(accountingFullInfo.asWidget()); |
100 | 100 |
} |
101 | 101 |
} |
modules/uoa-goldoa-portal/trunk/src/main/java/eu/dnetlib/client/fundingrequest/newrequest/summarystep/AccountingSummaryPanel.java | ||
---|---|---|
44 | 44 |
&& fundingWizardState.getRequest().getFundingRequested()!=null) { |
45 | 45 |
|
46 | 46 |
AccountingFullInfo accountingFullInfo = new AccountingFullInfo(fundingWizardState.getRequest(), |
47 |
fundingWizardState.getPublication().getJournal().getApc(), fundingWizardState.getPublication().getJournal().getDiscount()); |
|
47 |
fundingWizardState.getPublication().getJournal().getApc(), fundingWizardState.getPublication().getJournal().getDiscount(), |
|
48 |
fundingWizardState.getInvoice()); |
|
48 | 49 |
accountingInfoPanel.add(accountingFullInfo.asWidget()); |
49 | 50 |
} |
50 | 51 |
|
... | ... | |
54 | 55 |
&& fundingWizardState.getRequest().getFundingRequested()!=null) { |
55 | 56 |
|
56 | 57 |
AccountingFullInfo accountingFullInfo = new AccountingFullInfo(fundingWizardState.getRequest(), |
57 |
fundingWizardState.getPublication().getPublisher().getAPC(), fundingWizardState.getPublication().getPublisher().getDiscount()); |
|
58 |
fundingWizardState.getPublication().getPublisher().getAPC(), fundingWizardState.getPublication().getPublisher().getDiscount(), |
|
59 |
fundingWizardState.getInvoice()); |
|
58 | 60 |
accountingInfoPanel.add(accountingFullInfo.asWidget()); |
59 | 61 |
} |
60 | 62 |
} |
modules/uoa-goldoa-portal/trunk/src/main/java/eu/dnetlib/client/fundingrequest/existingrequests/ExistingRequestElement.java | ||
---|---|---|
63 | 63 |
} |
64 | 64 |
|
65 | 65 |
if(requestInfo.getProjectParticipation()!=null && requestInfo.getFundingRequested()!=null) { |
66 |
AccountingInlineInfo accountingInlineInfo = new AccountingInlineInfo(new Request(requestInfo), apc, discount); |
|
66 |
AccountingInlineInfo accountingInlineInfo = new AccountingInlineInfo(new Request(requestInfo), apc, discount, requestInfo.getInvoice());
|
|
67 | 67 |
requestSummaryPanel.add(accountingInlineInfo.asWidget()); |
68 | 68 |
} |
69 | 69 |
|
modules/uoa-goldoa-portal/trunk/src/main/java/eu/dnetlib/client/fundingrequest/stepinfo/AccountingInlineInfo.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.client.fundingrequest.stepinfo; |
2 | 2 |
|
3 |
import com.google.gwt.core.client.GWT; |
|
4 |
import com.google.gwt.i18n.client.DateTimeFormat; |
|
3 | 5 |
import com.google.gwt.user.client.ui.HTML; |
4 | 6 |
import com.google.gwt.user.client.ui.IsWidget; |
5 | 7 |
import com.google.gwt.user.client.ui.Widget; |
8 |
import eu.dnetlib.goldoa.domain.Invoice; |
|
6 | 9 |
import eu.dnetlib.goldoa.domain.Request; |
7 | 10 |
|
8 | 11 |
/** |
... | ... | |
13 | 16 |
private HTML accountingInlineInfo = new HTML(); |
14 | 17 |
private String accountingInfoContents = ""; |
15 | 18 |
|
16 |
public AccountingInlineInfo(Request request, float apc, float discount) {
|
|
19 |
private DateTimeFormat dtf = DateTimeFormat.getFormat("yyyy/MM/dd");
|
|
17 | 20 |
|
21 |
public AccountingInlineInfo(Request request, float apc, float discount, Invoice invoice) { |
|
22 |
|
|
18 | 23 |
accountingInfoContents = "<div class=\"displayInlineInfo\">"; |
19 | 24 |
|
20 | 25 |
accountingInfoContents += "<dl><dt class=\"chronologySubTitle\">ACCOUNTING</dt></dl>"; |
... | ... | |
26 | 31 |
accountingInfoContents += ", Funded with: " + Math.round(request.getFundingRequested()*100) / 100.0 + " EUROS"; |
27 | 32 |
|
28 | 33 |
accountingInfoContents += "</dd>"; |
34 |
|
|
35 |
if(invoice!=null) { |
|
36 |
|
|
37 |
accountingInfoContents += "<dl><dt class=\"chronologySubTitle\">INVOICE</dt></dl>"; |
|
38 |
accountingInfoContents += "<dd>"; |
|
39 |
|
|
40 |
accountingInfoContents += "Invoice number: " + invoice.getNumber(); |
|
41 |
accountingInfoContents += ", Date issued: " + dtf.format(invoice.getDate()); |
|
42 |
accountingInfoContents += ", " + "<a href=\"" + GWT.getModuleBaseURL() + "invoice?invoiceId=" + invoice.getId() + "\" target=\"_blank\">Click here to download the invoice</a>"; |
|
43 |
|
|
44 |
accountingInfoContents += "</dd>"; |
|
45 |
} |
|
46 |
|
|
29 | 47 |
accountingInfoContents += "</div>"; |
30 | 48 |
accountingInlineInfo.setHTML(accountingInfoContents); |
31 | 49 |
} |
modules/uoa-goldoa-portal/trunk/src/main/java/eu/dnetlib/client/fundingrequest/stepinfo/AccountingFullInfo.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.client.fundingrequest.stepinfo; |
2 | 2 |
|
3 |
import com.google.gwt.core.client.GWT; |
|
4 |
import com.google.gwt.i18n.client.DateTimeFormat; |
|
3 | 5 |
import com.google.gwt.user.client.ui.HTML; |
4 | 6 |
import com.google.gwt.user.client.ui.IsWidget; |
5 | 7 |
import com.google.gwt.user.client.ui.Widget; |
8 |
import eu.dnetlib.goldoa.domain.Invoice; |
|
6 | 9 |
import eu.dnetlib.goldoa.domain.Request; |
7 | 10 |
|
8 | 11 |
/** |
... | ... | |
13 | 16 |
private HTML accountingInfo = new HTML(); |
14 | 17 |
private String accountingInfoContents = ""; |
15 | 18 |
|
16 |
public AccountingFullInfo(Request request, float apc, float discount) {
|
|
19 |
private DateTimeFormat dtf = DateTimeFormat.getFormat("yyyy/MM/dd");
|
|
17 | 20 |
|
21 |
public AccountingFullInfo(Request request, float apc, float discount, Invoice invoice) { |
|
22 |
|
|
18 | 23 |
accountingInfoContents = "<div>"; |
19 | 24 |
|
20 | 25 |
accountingInfoContents += "<dl><dt class=\"chronologySubTitle\">ACCOUNTING</dt></dl>"; |
21 | 26 |
|
22 |
accountingInfoContents += "<dl><dt>APC</dt><dd>" + Math.round(apc*100) / 100.0 + "</dd></dl>";
|
|
23 |
accountingInfoContents += "<dl><dt>Gold OA discount</dt><dd>" + Math.round(discount*100) / 100.0 + "%</dd></dl>";
|
|
24 |
accountingInfoContents += "<dl><dt>Project participation</dt><dd>" + Math.round(request.getProjectParticipation()*100) / 100.0 + "</dd></dl>";
|
|
25 |
accountingInfoContents += "<dl><dt>Funding requested</dt><dd>" + Math.round(request.getFundingRequested()*100) / 100.0 + "</dd></dl>";
|
|
27 |
accountingInfoContents += "<dd>APC: " + Math.round(apc*100) / 100.0 + " EUROS ";
|
|
28 |
accountingInfoContents += "(" + Math.round(discount*100) / 100.0 + "% discount)</dd>";
|
|
29 |
accountingInfoContents += "<dd>Project participation: " + Math.round(request.getProjectParticipation()*100) / 100.0 + "</dd>";
|
|
30 |
accountingInfoContents += "<dd>Funding requested: " + Math.round(request.getFundingRequested()*100) / 100.0 + "</dd>";
|
|
26 | 31 |
|
32 |
if(invoice!=null) { |
|
33 |
|
|
34 |
accountingInfoContents += "<dl><dt class=\"chronologySubTitle\">INVOICE</dt></dl>"; |
|
35 |
|
|
36 |
accountingInfoContents += "<dd>Invoice number: " + invoice.getNumber() + "</dd>"; |
|
37 |
accountingInfoContents += "<dd>Date issued: " + dtf.format(invoice.getDate()) + "</dd>"; |
|
38 |
accountingInfoContents += "<dd>" + "<a href=\"" + GWT.getModuleBaseURL() + "invoice?invoiceId=" + invoice.getId() + "\" target=\"_blank\">Click here to download the invoice</a>" + "</dd>"; |
|
39 |
} |
|
40 |
|
|
27 | 41 |
accountingInfoContents += "</div>"; |
28 | 42 |
accountingInfo.setHTML(accountingInfoContents); |
29 | 43 |
} |
Also available in: Unified diff
Added invoice info to accounting info widgets when available