op section währungen
This commit is contained in:
parent
b35dea70f8
commit
29f62710a9
2 changed files with 25 additions and 3 deletions
|
|
@ -306,6 +306,18 @@ public class OPListController implements Serializable {
|
|||
|
||||
}
|
||||
|
||||
public double calculateInvoiceTotal(String currency) {
|
||||
double result = 0;
|
||||
for (ItemCollection invoice : invoiceList) {
|
||||
if (currency.equals(invoice.getItemValueString("invoice.currency"))) {
|
||||
result = result + invoice.getItemValueDouble("invoice.total");
|
||||
}
|
||||
}
|
||||
// rond with 2 digits
|
||||
return InvoiceUtil.round(result);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Berechnet den gesammten OP Saldo
|
||||
*
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@
|
|||
|
||||
<!-- Shows the op liste fo rthe current dbtr.number -->
|
||||
|
||||
|
||||
<h:commandScript name="calculateOpSummary"
|
||||
execute="invoiceRefHolder_ID" render="opcalculater_id" />
|
||||
|
||||
|
|
@ -149,12 +148,23 @@
|
|||
<!-- Invoice total -->
|
||||
<td style="text-align: right;"><strong> <h:panelGroup
|
||||
id="invoice_total">
|
||||
<h:outputText value="#{opListController.calculateInvoiceTotal()}">
|
||||
<h:outputText value="#{opListController.calculateInvoiceTotal('EUR')}">
|
||||
<f:convertNumber minFractionDigits="2" locale="de" />
|
||||
</h:outputText>
|
||||
|
||||
<br />
|
||||
|
||||
<h:outputText value="#{opListController.calculateInvoiceTotal('USD')}">
|
||||
<f:convertNumber minFractionDigits="2" locale="de" />
|
||||
</h:outputText>
|
||||
</h:panelGroup>
|
||||
</strong></td>
|
||||
<td /><td /><td /><td /> <td />
|
||||
|
||||
|
||||
<td><strong>EUR<br />USD</strong></td>
|
||||
|
||||
|
||||
<td /><td /><td /> <td />
|
||||
<td />
|
||||
<td /><td />
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue