fix op_liste Zahlungseingang - Anzeige Währungen

This commit is contained in:
Ralph Soika 2025-06-10 14:39:00 +02:00
parent ea5a43e259
commit f294d64e8c
4 changed files with 30 additions and 18 deletions

View file

@ -376,11 +376,11 @@ public class OPListController implements Serializable {
} }
/** /**
* Berechnet den Zahlbetrag in EUR bei Fremdwärungen * Berechnet den Zahlbetrag in der Hauswährung bei Fremdwährungen
* *
* @return * @return
*/ */
public double calculatePaymentSaldoEUR() { public double calculatePaymentSaldoMainCurrency() {
double result = 0; double result = 0;
if (invoiceList != null) { if (invoiceList != null) {
for (ItemCollection invoice : invoiceList) { for (ItemCollection invoice : invoiceList) {
@ -425,4 +425,12 @@ public class OPListController implements Serializable {
} }
} }
public String getCurrenciesOutMain() {
try {
return invoiceService.getCurrenciesOutMain();
} catch (PluginException e) {
return "undefined currency";
}
}
} }

View file

@ -95,8 +95,10 @@
</h:outputText> </h:outputText>
</td> </td>
<td> <td>
<!-- if not EUR --> <!-- if not Main Currency -->
<h:outputText rendered="#{invoice.item['invoice.currency'] ne 'EUR'}" value=" EUR" /> <h:outputText
rendered="#{invoice.item['invoice.currency'] ne opListController.currenciesOutMain}"
value=" #{opListController.currenciesOutMain}" />
</td> </td>
@ -121,7 +123,8 @@
</td> </td>
<td style="color: red;"> <td style="color: red;">
<h:outputText rendered="#{!empty invoice.item['invoice.saldo.byrate']}" value="EUR" /> <h:outputText rendered="#{!empty invoice.item['invoice.saldo.byrate']}"
value="#{opListController.currenciesOutMain}" />
</td> </td>
<!-- Teilbetrag --> <!-- Teilbetrag -->
@ -199,19 +202,19 @@
</h:outputText> </h:outputText>
</h:panelGroup> </h:panelGroup>
</strong> </strong>
<!-- Anzeige des Zahlbetrags in EUR bei Fremdwärungszahlung --> <!-- Anzeige des Zahlbetrags in Maincurrency bei Fremdwärungszahlung -->
<ui:fragment rendered="#{workitem.item['payment.currency'] ne 'EUR'}"> <ui:fragment rendered="#{workitem.item['payment.currency'] ne opListController.currenciesOutMain}">
<br /> <br />
EUR <h:outputText value="#{opListController.calculatePaymentSaldoEUR()}"> #{opListController.currenciesOutMain} <h:outputText
value="#{opListController.calculatePaymentSaldoMainCurrency()}">
<f:convertNumber minFractionDigits="2" locale="de" /> <f:convertNumber minFractionDigits="2" locale="de" />
</h:outputText> </h:outputText>
</ui:fragment> </ui:fragment>
</td> </td>
<td />
<td></td>
</tr> </tr>
</table> </table>
<!-- dieses feld speichert die selection der rechnungen --> <!-- dieses feld speichert die selection der rechnungen -->
@ -244,11 +247,11 @@
// set the payment amount to the invoice total if the field is still empty // set the payment amount to the invoice total if the field is still empty
// if the paymetn dif is lower than the invoice saldo we take the dif amount // if the payment dif is lower than the invoice saldo we take the dif amount
// if the currecny is not EUR and not equal go home! // if the currency is not Main Currency and not equal go home!
function initInvoicePayment(element) { function initInvoicePayment(element) {
// console.log('...initInvoicePayment...' + element.checked); // console.log('...initInvoicePayment...' + element.checked);
var mainCurrency = "#{ opListController.currenciesOutMain }";
var currentTD = $(element).closest('td'); var currentTD = $(element).closest('td');
var prevTD = $(currentTD).prev().prev().prev().prev().prev(); var prevTD = $(currentTD).prev().prev().prev().prev().prev();
var amountValue = $(prevTD).text(); var amountValue = $(prevTD).text();
@ -276,7 +279,7 @@
// wenn wir noch keinen wert haben, dann betrag übernehmen // wenn wir noch keinen wert haben, dann betrag übernehmen
if ($(amountInput).val() == '' || $(amountInput).val() == '0,00') { if ($(amountInput).val() == '' || $(amountInput).val() == '0,00') {
// wenn wir einen saldo.max.byrate haben // wenn wir einen saldo.max.byrate haben
if (paymentCurrency === 'EUR' && saldoMaxByRate > '') { if (paymentCurrency === mainCurrency && saldoMaxByRate > '') {
amountValue = saldoMaxByRate; amountValue = saldoMaxByRate;
} else { } else {
amountValue = amountValue; amountValue = amountValue;

View file

@ -5,6 +5,7 @@
<ui:fragment rendered="#{!readonly}"> <ui:fragment rendered="#{!readonly}">
<h:selectOneMenu required="#{required?validationController.required:false}" value="#{workitem.item[item.name]}"> <h:selectOneMenu required="#{required?validationController.required:false}" value="#{workitem.item[item.name]}">
<f:selectItems value="#{aglConfigController.getSelectItems('currency.out')}" /> <f:selectItems value="#{aglConfigController.getSelectItems('currency.out')}" />
<f:ajax event="change" render="#{formComponents.clientId}" />
</h:selectOneMenu> </h:selectOneMenu>
</ui:fragment> </ui:fragment>
<ui:fragment rendered="#{readonly}"> <ui:fragment rendered="#{readonly}">

View file

@ -552,7 +552,7 @@ result.isValid=true;
<bpmn2:sequenceFlow id="SequenceFlow_4" sourceRef="StartEvent_1" targetRef="Task_1"> <bpmn2:sequenceFlow id="SequenceFlow_4" sourceRef="StartEvent_1" targetRef="Task_1">
<bpmn2:documentation id="documentation_xo2RYQ"/> <bpmn2:documentation id="documentation_xo2RYQ"/>
</bpmn2:sequenceFlow> </bpmn2:sequenceFlow>
<bpmn2:dataObject id="DataObject_1" name="Form"> <bpmn2:dataObject id="DataObject_1" imixs:datatype="form-data" name="Form">
<bpmn2:documentation id="Documentation_17"><![CDATA[<?xml version="1.0"?> <bpmn2:documentation id="Documentation_17"><![CDATA[<?xml version="1.0"?>
<imixs-form> <imixs-form>
<imixs-form-section columns="2" > <imixs-form-section columns="2" >
@ -651,7 +651,7 @@ result.isValid=true;
<bpmn2:sequenceFlow id="SequenceFlow_5" sourceRef="EventBasedGateway_1" targetRef="IntermediateCatchEvent_1"> <bpmn2:sequenceFlow id="SequenceFlow_5" sourceRef="EventBasedGateway_1" targetRef="IntermediateCatchEvent_1">
<bpmn2:documentation id="documentation_9sxTZg"/> <bpmn2:documentation id="documentation_9sxTZg"/>
</bpmn2:sequenceFlow> </bpmn2:sequenceFlow>
<bpmn2:dataObject id="DataObject_2" name="Form"> <bpmn2:dataObject id="DataObject_2" imixs:datatype="form-data" name="Form">
<bpmn2:documentation id="Documentation_16"><![CDATA[<?xml version="1.0"?> <bpmn2:documentation id="Documentation_16"><![CDATA[<?xml version="1.0"?>
<imixs-form> <imixs-form>
<imixs-form-section columns="2" label="Zahlungsdaten"> <imixs-form-section columns="2" label="Zahlungsdaten">