op section währungen

This commit is contained in:
Ralph Soika 2023-06-19 16:00:32 +02:00
parent b35dea70f8
commit 29f62710a9
2 changed files with 25 additions and 3 deletions

View file

@ -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
*

View file

@ -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 />